:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --ink: #172522;
  --muted: #5d6a64;
  --line: rgba(23, 37, 34, 0.14);
  --panel: #ffffff;
  --soft: #e9efe9;
  --accent: #276456;
  --accent-deep: #23483f;
  --accent-2: #7c5d2f;
  --ot-ember: #a65f37;
  --ot-forge-line: rgba(166, 95, 55, 0.34);
  --warn: #8a3b2d;
  --shadow: 0 18px 45px rgba(23, 37, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(180deg, #eef4ef 0%, #fbfcfa 48%, #f2f5f3 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

a {
  color: inherit;
}

.ot-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 50px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 12px 0 24px;
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 72px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ot-ember), rgba(39, 100, 86, 0.48), transparent);
  opacity: 0.78;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-weight: 800;
}

.brand img {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.05;
}

.brand-eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.ot-topbar-slogan {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--ink);
}

.ot-topbar-slogan h1 {
  max-width: 980px;
  color: var(--ink);
  font-size: clamp(1.18rem, 2.05vw, 1.68rem);
  font-weight: 900;
  line-height: 1.28;
  text-wrap: balance;
}

.ot-topbar-slogan h1 span {
  display: block;
}

.ot-topbar-slogan p {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--panel);
  text-decoration: none;
  font-weight: 700;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.08fr) minmax(300px, 0.98fr);
  gap: 18px;
  align-items: start;
}

.panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ot-forge-line), transparent);
}

.panel-inner {
  padding: 20px;
}

.intro {
  display: grid;
  gap: 10px;
  background: #fdfdfb;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.72rem, 3vw, 2.55rem);
  line-height: 1.18;
}

h2 {
  font-size: 1.08rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0;
}

.lede,
.note {
  color: var(--muted);
  line-height: 1.65;
}

.terminology-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.audience-mode-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.audience-mode-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfa;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  scroll-margin-top: 18px;
}

.audience-mode-card:hover {
  transform: translateY(-1px);
  border-color: rgba(39, 100, 86, 0.34);
  box-shadow: 0 14px 26px rgba(23, 37, 34, 0.1);
}

.audience-mode-card:focus-visible {
  outline: 3px solid rgba(39, 100, 86, 0.32);
  outline-offset: 3px;
}

.audience-mode-card.primary {
  border-color: rgba(39, 100, 86, 0.24);
  background: linear-gradient(135deg, rgba(39, 100, 86, 0.12), rgba(255, 255, 255, 0.88));
}

.audience-mode-card.professional {
  border-color: rgba(124, 93, 47, 0.22);
  background: linear-gradient(135deg, rgba(124, 93, 47, 0.12), rgba(255, 255, 255, 0.9));
}

.audience-mode-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audience-mode-card strong {
  color: var(--ink);
  line-height: 1.25;
}

.audience-mode-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.audience-mode-card em {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(23, 37, 34, 0.08);
  color: var(--ink);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.audience-mode-card.primary em {
  background: var(--accent);
  color: #ffffff;
}

.audience-mode-card.professional em {
  background: rgba(124, 93, 47, 0.12);
  color: var(--accent-2);
}

.audience-mode-card[aria-current="page"] {
  box-shadow: 0 0 0 3px rgba(39, 100, 86, 0.16);
}

body[data-ot-audience="client"] .footer-panels {
  display: none;
}

body[data-ot-audience="client"] .intro .eyebrow,
body[data-ot-audience="client"] .terminology-note,
body[data-ot-audience="client"] .boundary-strip p,
body[data-ot-audience="client"] .audience-mode-card p {
  display: none;
}

body[data-ot-audience="client"] .workbench {
  grid-template-columns: minmax(260px, 0.88fr) minmax(360px, 1.1fr) minmax(300px, 1fr);
}

body[data-ot-audience="professional"] #otIntakeForm,
body[data-ot-audience="professional"] .report-preview {
  display: none;
}

body[data-ot-audience="professional"] .workbench {
  grid-template-columns: minmax(0, 1fr);
}

.report-watermark-footer {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(69, 55, 43, 0.16);
  color: rgba(87, 73, 61, 0.74);
  font-size: 0.72rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.boundary-strip {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(138, 59, 45, 0.18);
  border-radius: 8px;
  background: #fff8f5;
  color: var(--warn);
  font-size: 0.92rem;
  line-height: 1.55;
}

body[data-ot-audience="client"] .boundary-strip.compact-disclosure p,
body[data-ot-audience="client"] .intro .audience-mode-card p,
body[data-ot-audience="client"] .report-preview .print-note {
  display: none;
}

.compact-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.compact-disclosure > summary::-webkit-details-marker {
  display: none;
}

.compact-disclosure > summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 900;
}

.compact-disclosure[open] > summary::after {
  content: "-";
}

.panel.compact-disclosure > summary {
  padding: 14px 18px;
}

.panel.compact-disclosure[open] > .panel-inner {
  border-top: 1px solid var(--line);
}

.boundary-strip.compact-disclosure > summary {
  min-height: auto;
}

.field-stack {
  display: grid;
  gap: 14px;
}

#otIntakeForm {
  scroll-margin-top: 22px;
}

label,
legend {
  font-weight: 800;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

select,
textarea,
input[type="number"] {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.primary-action {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.secondary-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.loop-grid,
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.loop-card,
.task-card {
  min-width: 0;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

#otTaskCardPicker {
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(39, 100, 86, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(39, 100, 86, 0.08), transparent 62%),
    #fbfcfa;
}

#otTaskCardPicker legend {
  padding: 0;
}

.ot-task-card-grid {
  margin-top: 6px;
}

.ot-task-card-button {
  width: 100%;
  min-height: 94px;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.ot-task-card-button:hover {
  transform: translateY(-1px);
  border-color: rgba(39, 100, 86, 0.32);
  box-shadow: 0 10px 24px rgba(23, 37, 34, 0.08);
}

.ot-task-card-button:focus-visible {
  outline: 3px solid rgba(39, 100, 86, 0.32);
  outline-offset: 3px;
}

.ot-task-card-button[aria-pressed="true"],
.ot-task-card-button.is-selected {
  border-color: rgba(39, 100, 86, 0.48);
  background:
    linear-gradient(90deg, rgba(39, 100, 86, 0.16), transparent 72%),
    #f7fbf8;
  box-shadow: inset 4px 0 0 var(--accent);
}

.task-card strong,
.loop-card strong,
.loop-card span,
.task-card span {
  display: block;
}

.loop-card span,
.task-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.report-preview {
  display: grid;
  gap: 12px;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.report-box {
  min-height: 320px;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.report-box article {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.report-box article:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.report-box strong {
  display: block;
  margin-bottom: 4px;
}

.print-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.ot-share-summary-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(109, 74, 51, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 250, 241, 0.94), rgba(255, 255, 255, 0.92));
}

.ot-share-summary-panel h3,
.ot-share-summary-panel p {
  margin: 0;
}

.ot-share-summary-panel h3 {
  color: var(--accent-deep);
  font-size: 1rem;
}

.ot-share-summary-panel p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.ot-share-summary-print-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(109, 74, 51, 0.15);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 229, 0.9)),
    radial-gradient(circle at 88% 12%, rgba(205, 112, 64, 0.13), transparent 30%);
  box-shadow: 0 16px 34px rgba(79, 57, 37, 0.1);
}

.share-summary-card-brand {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ot-share-summary-print-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.25;
}

.share-summary-meta,
.share-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.share-summary-meta div,
.share-summary-metrics span {
  padding: 10px;
  border: 1px solid rgba(109, 74, 51, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.share-summary-meta dt,
.share-summary-metrics small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.share-summary-meta dd,
.share-summary-metrics b {
  display: block;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 1rem;
}

.ot-share-summary-print-card footer,
.ot-share-summary-text {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.ot-share-summary-text {
  display: block;
  white-space: pre-wrap;
  padding: 12px;
  border: 1px dashed rgba(109, 74, 51, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 0.86rem;
}

.service-next-step {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(109, 74, 51, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(214, 141, 92, 0.12), transparent 58%),
    rgba(255, 255, 255, 0.82);
}

.service-next-step span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.service-next-step strong {
  color: var(--ink);
}

.service-next-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.rehab-entitlement-free-strip,
.rehab-entitlement-action-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rehab-trust-card {
  display: grid;
  gap: 6px;
  margin: 12px 0 14px;
  padding: 13px 15px;
  border: 1px solid rgba(166, 95, 55, 0.2);
  border-left: 5px solid rgba(166, 95, 55, 0.74);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 244, 236, 0.72));
  box-shadow: 0 10px 24px rgba(87, 53, 35, 0.06);
}

.rehab-trust-card span {
  color: var(--ot-ember);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.rehab-trust-card p,
.rehab-trust-card small {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.6;
}

.rehab-trust-card small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.rehab-entitlement-free-strip {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(109, 74, 51, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.rehab-entitlement-free-strip strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.rehab-entitlement-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(109, 74, 51, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.rehab-entitlement-chip.is-silver {
  border-color: rgba(79, 96, 118, 0.2);
  color: #405168;
  background: linear-gradient(135deg, rgba(232, 237, 245, 0.92), rgba(255, 255, 255, 0.86));
}

.rehab-entitlement-chip.is-gold {
  border-color: rgba(183, 128, 33, 0.24);
  color: #8a5b0f;
  background: linear-gradient(135deg, rgba(255, 238, 186, 0.9), rgba(255, 255, 255, 0.86));
}

.rehab-entitlement-upgrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.rehab-entitlement-upgrade-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(109, 74, 51, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.rehab-entitlement-upgrade-card:hover,
.rehab-entitlement-upgrade-card:focus-visible {
  border-color: rgba(205, 112, 64, 0.35);
  box-shadow: 0 12px 26px rgba(79, 57, 37, 0.11);
  outline: none;
}

.rehab-entitlement-upgrade-card strong {
  font-size: 0.95rem;
}

.rehab-entitlement-upgrade-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.status-line {
  min-height: 28px;
  color: var(--warn);
  font-weight: 800;
}

.diary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.full {
  grid-column: 1 / -1;
}

.footer-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.check-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  line-height: 1.55;
}

.check-list li::before {
  content: "• ";
  color: var(--accent);
  font-weight: 900;
}

@media (max-width: 980px) {
  .workbench,
  .footer-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .ot-shell,
  .workbench,
  .panel,
  .intro,
  .topbar,
  .brand,
  .ot-topbar-slogan,
  .footer-panels,
  .loop-grid,
  .task-grid,
  .diary-grid,
  .audience-mode-strip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .ot-shell {
    width: min(100% - 20px, 1240px);
  }

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

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

  .loop-grid,
  .task-grid,
  .diary-grid,
  .segmented,
  .audience-mode-strip {
    grid-template-columns: 1fr;
  }

  .report-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-actions {
    width: 100%;
    justify-content: stretch;
  }

  .secondary-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar::after,
  .panel::before {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .intro,
  #otIntakeForm,
  .footer-panels,
  .report-actions {
    display: none !important;
  }

  .ot-shell {
    width: auto;
    padding: 0;
  }

  .workbench,
  .report-preview {
    display: block;
  }

  .panel,
  .report-box {
    border: 0;
    box-shadow: none;
  }

  .panel-inner,
  .report-box {
    padding: 0;
  }

  .report-box {
    min-height: auto;
    background: #ffffff;
  }

  body.printing-ot-share-summary * {
    visibility: hidden !important;
  }

  body.printing-ot-share-summary .ot-share-summary-panel,
  body.printing-ot-share-summary .ot-share-summary-panel * {
    visibility: visible !important;
  }

  body.printing-ot-share-summary .ot-share-summary-panel {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    max-width: 720px;
    padding: 28px;
    border: 1px solid rgba(109, 74, 51, 0.18);
    background: #ffffff !important;
    box-shadow: none;
  }

  body.printing-ot-share-summary .ot-share-summary-text,
  body.printing-ot-share-summary .ot-share-summary-panel > div:first-child p {
    display: none !important;
  }

  body.printing-ot-share-summary .ot-share-summary-print-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
