:root {
  color-scheme: light;
  --bg: #eeeeee;
  --panel: #ffffff;
  --ink: #17352f;
  --muted: #5d716c;
  --line: #d8dedb;
  --brand: #1f6f5f;
  --brand-mid: #2fa084;
  --brand-soft: #6fcf97;
  --brand-strong: #18594c;
  --danger: #9f4c42;
  --danger-strong: #803a32;
  --focus: #2fa084;
  --shadow: 0 14px 32px rgba(31, 111, 95, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #1f6f5f 0 148px, #2fa084 148px 224px, #6fcf97 224px 300px, transparent 300px),
    var(--bg);
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: #fff;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 7px 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.status-pill[data-tone="success"] {
  border-color: rgba(111, 207, 151, 0.55);
  color: #fff;
}

.status-pill[data-tone="error"],
.status-pill[data-tone="warn"] {
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid rgba(31, 111, 95, 0.18);
  border-radius: 8px;
  background: rgba(238, 238, 238, 0.78);
}

.mode-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.mode-tab.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 111, 95, 0.16);
}

.panel,
.notice,
.complete-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.panel[hidden],
.notice[hidden],
.complete-layer[hidden] {
  display: none;
}

.panel-head h2 {
  margin-bottom: 6px;
  font-size: 1.28rem;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font-weight: 500;
  outline: none;
}

.field textarea {
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 160, 132, 0.15);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  line-height: 1.55;
}

.checkline input {
  margin-top: 5px;
  width: 18px;
  height: 18px;
  accent-color: var(--brand-mid);
}

.availability-summary {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.availability-summary[data-tone="success"] {
  color: var(--brand-strong);
}

.availability-summary[data-tone="error"] {
  color: var(--danger);
}

.primary-action,
.danger-action {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  background: var(--brand-mid);
}

.primary-action:hover {
  background: var(--brand);
}

.danger-action {
  background: var(--danger);
}

.danger-action:hover {
  background: var(--danger-strong);
}

.primary-action:disabled,
.danger-action:disabled {
  cursor: wait;
  opacity: 0.7;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  color: var(--muted);
  line-height: 1.55;
  box-shadow: none;
}

.notice[data-tone="success"] {
  border-color: rgba(47, 160, 132, 0.28);
  color: var(--brand-strong);
  background: #effaf4;
}

.notice[data-tone="error"] {
  border-color: rgba(189, 59, 59, 0.25);
  color: var(--danger);
  background: #fff1f1;
}

.complete-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.54);
}

.complete-box {
  width: min(420px, 100%);
  padding: 28px 22px 22px;
  text-align: center;
}

.complete-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #e6f8ee;
  color: var(--brand);
  font-size: 2rem;
  font-weight: 900;
}

.complete-box h2 {
  margin-bottom: 8px;
}

.complete-box p {
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 620px) {
  .app-shell {
    padding-inline: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }
}
