:root {
  --header: #9c8879;
  --header-text: #f9f6f0;
  --header-muted: #e4d8cc;
  --bg: #f5efe6;
  --sidebar: #f9f6f0;
  --surface: #ffffff;
  --banner: #efe6d9;
  --text: #4a4038;
  --muted: #8a7d72;
  --fs-h1: 24px;
  --fs-h2: 17px;
  --fs-body: 15px;
  --fs-meta: 13px;
  --lh-body: 1.6;
  --border: #e8ddd0;
  --active: #efe4d6;
  --shadow: 0 1px 2px rgba(92, 74, 58, 0.05), 0 12px 28px rgba(92, 74, 58, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --sidebar-width: 228px;
  --sidebar-collapsed: 76px;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --cream: #f9f6f0;
  --cream-border: #e8ddd0;
  --ink-soft: #5c5148;
  --accent: #9c8879;
  --accent-hover: #8a7566;
  --accent-soft: #efe4d6;
  --blush: #e8d5cc;
  --blush-text: #8a6a64;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100vh;
  height: 100dvh;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at center, #3a322c 0%, #1a1613 52%, #110e0c 100%);
  animation: splashOut 2.2s ease forwards;
  pointer-events: none;
}

.splash__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: min(72vw, 420px);
}

.splash__mark::before {
  content: "";
  position: absolute;
  inset: 8% 4%;
  background: radial-gradient(circle, rgba(156, 136, 121, 0.28), transparent 72%);
  filter: blur(28px);
  pointer-events: none;
}

.splash__logo {
  position: relative;
  display: block;
  width: min(72vw, 420px);
  height: auto;
  max-height: min(28vh, 220px);
  object-fit: contain;
  mix-blend-mode: lighten;
  transform-origin: center center;
  animation: splashLogoIn 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.splash.is-gone {
  display: none;
}

@keyframes splashLogoIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splashOut {
  0%,
  68% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash {
    animation: splashOut 0.85s ease forwards;
  }

  .splash__logo {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.hidden {
  display: none !important;
}

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

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

code {
  font-size: 0.92em;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--cream);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  height: 56px;
  padding: 0 18px;
  padding-top: env(safe-area-inset-top);
  background: var(--header);
  color: var(--header-text);
  z-index: 30;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.logo img {
  display: block;
  height: 36px;
  width: auto;
  max-width: min(200px, 46vw);
  object-fit: contain;
  object-position: left center;
}

.date {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--header-muted);
  white-space: nowrap;
}

.nav-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.notice-bar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  min-height: 42px;
  background: var(--banner);
}

.notice-bar__text {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
  padding: 8px 16px;
}

.notice-bar__text:hover {
  text-decoration: underline;
}

body.is-locked #notice-bar {
  display: none;
}

.paywall[hidden] {
  display: none;
}

.paywall {
  display: block;
}

.paywall__banner {
  position: fixed;
  z-index: 18;
  top: calc(56px + env(safe-area-inset-top, 0px));
  left: var(--sidebar-width);
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #efe6d9;
  border-bottom: 1px solid var(--cream-border);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(92, 74, 58, 0.06);
}

.paywall__banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.paywall__veil {
  position: fixed;
  z-index: 12;
  top: calc(56px + env(safe-area-inset-top, 0px));
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  padding: 28px 20px 40px;
  background: rgba(245, 239, 230, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.paywall__card {
  width: min(440px, 100%);
  padding: 32px 28px 28px;
  border: 1px solid var(--cream-border);
  border-radius: 20px;
  background: var(--cream);
  box-shadow: 0 18px 48px rgba(92, 74, 58, 0.12);
  text-align: center;
}

.paywall__kicker {
  margin: 0 0 8px;
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.paywall__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.paywall__copy {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
}

.paywall__btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--header);
  border-radius: 999px;
  background: var(--header);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.paywall__btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.paywall__btn--primary {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
}

body.nav-closed .paywall__banner,
body.nav-closed .paywall__veil {
  left: var(--sidebar-collapsed);
}

.sidebar {
  width: var(--sidebar-width);
  min-width: 0;
  overflow: hidden;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease;
  flex-shrink: 0;
}

body.nav-closed .sidebar {
  width: var(--sidebar-collapsed);
}

.drawer-brand {
  display: none;
  align-items: center;
  padding: 8px 12px 18px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.side-item,
.side-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.side-item svg,
.side-logout svg {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.side-item span,
.side-logout span {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

body.nav-closed .side-item span,
body.nav-closed .side-logout span,
body.nav-closed .drawer-brand {
  display: none;
}

body.nav-closed .side-item,
body.nav-closed .side-logout {
  justify-content: center;
  padding: 0;
}

.side-item:hover,
.side-logout:hover {
  background: var(--cream);
}

.side-item.is-active {
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}

.side-auth {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--cream-border);
}

.auth-login,
.auth-logout,
.auth-pay {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
}

.auth-login:hover,
.auth-logout:hover,
.auth-pay:hover {
  background: var(--cream);
}

.auth-pay {
  margin-bottom: 8px;
  justify-content: center;
  background: var(--header);
  border-color: var(--header);
  color: #fff;
  font-weight: 600;
}

.auth-pay:hover {
  background: var(--accent-hover);
  color: #fff;
}

.auth-pay.is-paid,
.auth-pay:disabled {
  background: var(--accent-soft);
  border-color: var(--cream-border);
  color: var(--muted);
  cursor: default;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}

.auth-user img,
.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  flex-shrink: 0;
}

.auth-user__meta {
  min-width: 0;
}

.auth-user__name,
.auth-user__email {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user__name {
  font-size: 13px;
  font-weight: 700;
}

.auth-user__email {
  font-size: 11px;
  color: var(--muted);
}

.auth-hint {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form__title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.auth-field span {
  color: var(--muted);
  font-size: 11px;
}

.auth-field .input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
}

.auth-form__error {
  margin: 0;
  color: #9b3d3d;
  font-size: 12px;
  line-height: 1.4;
}

.auth-form__actions {
  display: flex;
  gap: 8px;
}

.auth-form__actions .auth-login,
.auth-form__actions .auth-signup {
  flex: 1;
  justify-content: center;
}

.auth-signup {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.auth-signup:hover {
  background: var(--cream);
}

.auth-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--header-text);
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--header-text);
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.guide-chip:hover,
.auth-chip:hover {
  background: rgba(255, 255, 255, 0.14);
}

.plan-chip {
  border: 0;
  border-radius: 999px;
  background: #f9f6f0;
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.plan-chip:hover {
  background: #fff;
}

body.nav-closed .auth-hint,
body.nav-closed .auth-user__meta,
body.nav-closed .auth-login span,
body.nav-closed .auth-logout span,
body.nav-closed .auth-pay span,
body.nav-closed .auth-form {
  display: none;
}

body.nav-closed .auth-login,
body.nav-closed .auth-logout,
body.nav-closed .auth-pay,
body.nav-closed .auth-user {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.nav-closed .auth-pay {
  display: none;
}

.side-account {
  margin-top: auto;
}

.side-logout {
  color: var(--muted);
  font-size: 13px;
}

.scrim {
  display: none;
}

.view {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 36px 40px 64px;
}

.page {
  min-width: 0;
  max-width: 680px;
  margin: 0 auto;
}

.page--journal {
  max-width: 980px;
}

.page[hidden] {
  display: none;
}

.page__header {
  margin-bottom: 24px;
}

.page__title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--text);
}

.page__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: var(--lh-body);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.report-card .stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.panel,
.task-card,
.sfm-card,
.history-card,
.report-card,
.ai-card,
.think-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  min-width: 0;
  padding: 22px 16px 18px;
  text-align: center;
}

.stat-card__value {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat-card__label {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 22px;
}

.review-form {
  display: flex;
  flex-direction: column;
}

.speech-field {
  margin: 4px 0 16px;
  padding: 16px;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  background: var(--cream);
}

.speech-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--cream-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.mic-btn.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.textarea--hero {
  min-height: 200px;
  background: var(--surface);
  border-color: var(--cream-border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-body);
}

.input,
.select {
  height: 44px;
  padding: 0 14px;
}

.textarea {
  padding: 14px;
  resize: vertical;
  min-height: 140px;
  line-height: var(--lh-body);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: 2px solid var(--blush);
  outline-offset: 1px;
}

.date-field {
  position: relative;
}

.date-field .input {
  padding-right: 42px;
}

.date-field .input::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.date-field__icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #777;
}

.chips-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chips--prompt {
  margin-bottom: 18px;
}

.prompt-chip {
  max-width: 100%;
  min-height: 34px;
  height: auto;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.prompt-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--header);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
}

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

.btn--ghost {
  background: var(--blush);
  color: var(--blush-text);
}

.btn--ghost:hover {
  background: #ddc6c0;
}

.btn--tiny {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.btn--ai {
  min-width: 128px;
  height: 46px;
  letter-spacing: 0.08em;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tabs__item,
.chip {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.tabs__item.is-active,
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.report-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-card {
  padding: 22px;
  min-width: 0;
}

.report-card h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text);
}

.report-card--ai .rv-card__conclusion {
  margin-top: 4px;
}

.report-range,
.report-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.report-summary,
.report-rhythm {
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink-soft);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.report-rhythm {
  margin: 0;
  background: var(--banner);
}

.report-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 12px;
}

.keyword__count {
  color: var(--muted);
}

.highlight-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.highlight-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.highlight-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.highlight-list__date {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.highlight-list__text {
  margin: 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #d8d4ca;
  border-radius: var(--radius);
  line-height: 1.8;
}

.empty__title {
  margin: 0 0 6px;
  font-family: var(--serif);
  color: var(--text);
  font-size: 18px;
}

.add-task {
  display: grid;
  grid-template-columns: 1fr 150px auto;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.add-task .field {
  margin: 0;
}

.task-list,
.history-list,
.library-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.library-group__date {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.task-card,
.history-card {
  padding: 16px 18px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.task-card__title {
  margin: 0 0 8px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.task-card__meta,
.history-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--muted);
  font-size: 12px;
}

.tag--doing {
  background: #efe8dc;
  color: #7a6556;
}

.tag--later {
  background: #f7f1e6;
  color: #8a6420;
}

.tag--done {
  background: var(--accent-soft);
  color: var(--header);
}

.tag--ai {
  background: var(--accent-soft);
  color: var(--header);
}

.task-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.sfm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.sfm-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sfm-card__type {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sfm-card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.sfm-card__body {
  margin: 0;
  color: #555;
  font-size: 13px;
  line-height: 1.8;
  flex: 1;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sfm-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.search-field {
  position: relative;
  display: block;
}

.search-field svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

.search-field .input {
  padding-left: 42px;
}

.history-card__date {
  margin: 0 0 8px;
  font-weight: 600;
  font-family: var(--serif);
}

.history-card__excerpt {
  margin: 0 0 12px;
  color: #555;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.history-card.is-open {
  background: var(--cream);
  border-color: var(--cream-border);
}

.history-report {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--cream-border);
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.38);
}

.modal__card {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 16px;
  background: #fff;
}

.modal__title {
  margin: 0 0 8px;
  font-family: var(--serif);
}

.modal__desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.pricing-modal {
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
}

.pricing-modal::backdrop {
  background: rgba(58, 50, 44, 0.46);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pricing-modal[open] .pricing-modal__card {
  animation: pricingIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pricingIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pricing-modal__card {
  position: relative;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 28px 28px 32px;
  border: 1px solid var(--cream-border);
  border-radius: 24px;
  background: linear-gradient(180deg, #fbf7f1 0%, #f5efe6 42%, #f9f6f0 100%);
  box-shadow: 0 24px 64px rgba(74, 64, 56, 0.18);
}

.pricing-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.pricing-modal__close:hover {
  background: rgba(156, 136, 121, 0.12);
  color: var(--text);
}

.pricing-modal__head {
  max-width: 520px;
  margin: 0 auto 22px;
  padding-right: 28px;
  text-align: center;
}

.pricing-modal__kicker {
  margin: 0 0 8px;
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.pricing-modal__title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.pricing-modal__lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 20px 20px;
  border: 1px solid var(--cream-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(92, 74, 58, 0.06);
}

.pricing-card--featured {
  border-color: var(--header);
  background: linear-gradient(180deg, #fffdf9 0%, #f7efe6 100%);
  box-shadow: 0 14px 32px rgba(156, 136, 121, 0.18);
}

.pricing-card__badge {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--header);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pricing-card__name {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.pricing-card__plan {
  margin: 4px 0 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.pricing-card__price {
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 700;
}

.pricing-card__price span {
  font-family: var(--serif);
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.pricing-card__price small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.pricing-card__eq {
  margin: 0 0 10px;
  color: var(--header);
  font-size: 13px;
  font-weight: 600;
}

.pricing-card__desc {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.pricing-card__list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  flex: 1;
}

.pricing-card__list li {
  position: relative;
  padding: 0 0 8px 18px;
}

.pricing-card__list li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--header);
}

.pricing-card__cta {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--header);
  border-radius: 999px;
  background: #fff;
  color: var(--header);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.pricing-card__cta:hover {
  background: var(--cream);
}

.pricing-card__cta--primary {
  background: var(--header);
  color: #fff;
}

.pricing-card__cta--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.pricing-card__cta:disabled {
  opacity: 0.55;
  cursor: default;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--header);
  color: var(--header-text);
  font-size: 13px;
  line-height: 1.6;
  z-index: 40;
  box-shadow: var(--shadow);
}

.toast[hidden] {
  display: none;
}

.ai-stage {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.ai-thinking {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 22px;
  background: var(--cream);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
}

.ai-thinking__label {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.06em;
}

.ai-thinking__hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-thinking__bar {
  height: 2px;
  overflow: hidden;
  background: var(--cream-border);
  border-radius: 999px;
}

.ai-thinking__bar i {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--accent);
  animation: aiSlide 1.35s ease-in-out infinite;
}

@keyframes aiSlide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.ai-error {
  padding: 22px;
  color: #6b3a32;
  background: #fbf4f1;
  border: 1px solid #ead8d2;
  border-radius: var(--radius);
  line-height: 1.8;
}

.theme-banner {
  padding: 22px 22px 20px;
  background: var(--cream);
  color: var(--text);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.theme-banner__kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.theme-banner__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.theme-banner__lead {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.problem-card {
  padding: 20px 18px;
}

.problem-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.problem-card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.stars {
  color: var(--blush-text);
  letter-spacing: 0.08em;
  font-size: 13px;
  white-space: nowrap;
}

.problem-card__body,
.ai-block p,
.quote-item,
.think-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ai-block {
  padding: 20px 18px;
}

.ai-block h3,
.think-card h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text);
}

.review-list {
  margin: 0;
  padding: 0 0 0 1.2em;
}

.review-list li {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
}

.review-list li:last-child {
  margin-bottom: 0;
}

.conclusion-card {
  background: var(--cream);
  color: var(--text);
  border-color: var(--cream-border);
}

.conclusion-card h3 {
  color: var(--header);
  letter-spacing: 0.14em;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 600;
}

.conclusion-card__text {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.gold-block h3 {
  letter-spacing: 0.04em;
}

.gold-quote + .gold-quote {
  margin-top: 10px;
}

.sfm-hint {
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: var(--lh-body);
}

.btn--ai-ghost {
  min-width: 148px;
  height: 46px;
  letter-spacing: 0.08em;
  background: var(--surface);
  color: var(--header);
  border: 1px solid var(--accent);
}

.btn--ai-ghost:hover {
  background: var(--accent-soft);
}

.quote-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--cream-border);
}

.quote-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.quote-item input,
.check-row input {
  margin-top: 4px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.quote-item span,
.check-row span {
  min-width: 0;
}

.gold-quote {
  margin: 0;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--cream);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-body);
  color: var(--text);
}

.gold-quote-row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.gold-quote-row .btn {
  justify-self: end;
}

.gratitude-box .textarea {
  min-height: 88px;
  margin-top: 8px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--cream-border);
  border-radius: 12px;
  background: #fff;
}

.check-row strong {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text);
}

.check-row small {
  color: var(--muted);
  font-size: var(--fs-meta);
  line-height: var(--lh-body);
}

.think-card {
  padding: 22px 20px;
  background: var(--cream);
  border-color: var(--cream-border);
}

.think-card__round {
  margin: 0 0 10px;
  font-size: var(--fs-meta);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.think-card h3 {
  font-size: var(--fs-h2);
}

.think-card__q {
  margin: 0 0 14px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

@media (prefers-reduced-motion: reduce) {
  .layout,
  .sidebar,
  .ai-thinking__bar i,
  .pricing-modal[open] .pricing-modal__card {
    transition: none;
    animation: none;
  }
}

@media (max-width: 900px) {
  .sidebar,
  body.nav-closed .sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 82vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .drawer-brand,
  body.nav-closed .drawer-brand {
    display: flex;
  }

  body.nav-closed .side-item span,
  body.nav-closed .side-logout span {
    display: inline;
  }

  body.nav-closed .side-item,
  body.nav-closed .side-logout {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.28);
  }

  .scrim[hidden] {
    display: none;
  }

  .view {
    padding: 24px 18px 48px;
  }

  .paywall__banner,
  .paywall__veil,
  body.nav-closed .paywall__banner,
  body.nav-closed .paywall__veil {
    left: 0;
  }

  .paywall__banner {
    padding: 10px 16px;
    text-align: center;
  }

  .pricing-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .pricing-modal__card {
    padding: 22px 16px 20px;
    border-radius: 18px;
  }

  .pricing-modal__title {
    font-size: 22px;
  }

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

  .pricing-card--featured {
    order: -1;
  }

  .pricing-card__price span {
    font-size: 30px;
  }

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

  .report-card .stats {
    grid-template-columns: 1fr 1fr;
  }

  .page__title {
    font-size: 22px;
  }

  .add-task {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: 1fr;
  }

  .task-card__actions {
    justify-content: flex-start;
  }

  .theme-banner__title {
    font-size: 20px;
  }

  .journal-top {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .journal-metrics {
    width: 100%;
  }

  .journal-when {
    align-items: center;
    justify-self: center;
    text-align: center;
  }

  .journal-split,
  .journal-footer__actions {
    grid-template-columns: 1fr;
  }

  .journal-footer .btn--wide,
  .journal-footer .btn--outline {
    width: 100%;
  }
}

.review-board {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.rv-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.rv-card__head {
  display: flex;
  align-items: center;
  padding: 16px 22px 14px;
  background: var(--banner);
  color: var(--text);
  border-bottom: 1px solid var(--cream-border);
}

.rv-card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--text);
}

.rv-card__body {
  padding: 20px 22px 22px;
  background: var(--surface);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-soft);
}

.rv-card__body > p,
.rv-card__body .review-list {
  margin-top: 0;
}

.rv-card--hero .rv-card__body,
.rv-card--insight .rv-card__body {
  background: var(--surface);
  color: var(--text);
  padding: 22px 22px 24px;
}

.rv-card__kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--fs-meta);
  letter-spacing: 0.08em;
}

.thought-timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 18px;
}

.thought-unit {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.thought-unit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  background: var(--banner);
  border-bottom: 1px solid var(--cream-border);
}

.thought-unit__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.thought-unit__stars {
  flex-shrink: 0;
}

.thought-unit__body {
  padding: 18px 20px 16px;
  background: var(--cream);
}

.thought-unit__label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.thought-unit__note {
  margin: 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  white-space: pre-wrap;
}

.thought-unit__conclusion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 18px;
  background: var(--surface);
  border-top: 1px solid var(--cream-border);
}

.thought-unit--past {
  opacity: 0.94;
}

.thought-unit .conclusion-callout {
  margin: 0;
}

.conclusion-callout {
  margin: 6px 0 0;
  padding: 16px 18px 16px 20px;
  background: var(--cream);
  border: 1px solid var(--cream-border);
  border-left: 5px solid var(--header);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.conclusion-callout__label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.conclusion-callout__text {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-body);
  color: var(--text);
  white-space: pre-wrap;
}

.rv-card__conclusion {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-body);
  color: var(--text);
  white-space: pre-wrap;
}

.rv-card--muted .rv-card__body {
  background: var(--cream);
}

.rv-sub {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--cream-border);
}

.rv-sub:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.rv-sub__title {
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.theme-inline {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}

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

.gap-split__col {
  padding: 14px 14px 12px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--cream-border);
}

.gap-split__label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.gap-card__line {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-body);
  color: var(--text);
}

.think-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.think-panel--past {
  opacity: 0.78;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--cream-border);
}

.think-panel__question {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}

.check-row {
  border-radius: var(--radius-sm);
  border-color: var(--cream-border);
  background: var(--cream);
}

.check-row--practice:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.check-row--practice:has(input:checked) span {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.72;
}

@media (min-width: 640px) {
  .gap-split {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  :root {
    --fs-h1: 22px;
    --fs-h2: 16px;
    --fs-body: 15px;
    --fs-meta: 12px;
  }

  .review-board {
    gap: 22px;
  }

  .rv-card__head {
    padding: 14px 16px 12px;
  }

  .rv-card__body,
  .rv-card--hero .rv-card__body,
  .rv-card--insight .rv-card__body {
    padding: 18px 16px 20px;
  }

  .conclusion-callout {
    padding: 14px 14px 14px 16px;
  }

  .check-row {
    padding: 14px 12px;
  }
}

.review-section__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.raw-block {
  background: var(--cream);
}

.raw-record {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  overflow-wrap: anywhere;
}

.api-status {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.api-status.is-ready {
  background: var(--accent-soft);
  color: var(--header);
}

.settings-hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.journal-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 28px;
  align-items: center;
  margin-bottom: 22px;
}

.journal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.journal-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 6px 4px;
  text-align: center;
}

.journal-metric strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text);
}

.journal-metric span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.journal-when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  text-align: right;
}

.journal-when__date {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  cursor: pointer;
}

.journal-card {
  margin-bottom: 16px;
  padding: 22px 24px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.journal-card__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.journal-card__title span {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--header);
  line-height: 1;
}

.journal-guide {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.journal-guide--tight {
  margin: -4px 0 12px;
}

.journal-label {
  display: block;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.journal-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 22px 28px;
  align-items: start;
}

.journal-split--body {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.journal-col {
  min-width: 0;
}

.thanks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thanks-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.thanks-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--header);
  font-size: 13px;
  font-weight: 700;
}

.thanks-row .input {
  width: 100%;
}

.mood-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mood-btn {
  width: 76px;
  height: 76px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--cream);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mood-btn:hover {
  border-color: var(--accent);
}

.mood-btn.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.body-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.tag-btn:hover {
  border-color: var(--accent);
}

.tag-btn.is-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--header);
  font-weight: 600;
}

.body-check {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.body-check-group {
  padding: 16px 16px 14px;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  background: var(--cream);
}

.body-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.body-flag-btn {
  min-height: 34px;
  height: auto;
  padding: 6px 12px;
  line-height: 1.4;
  text-align: left;
}

.body-reason {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.body-reason[hidden] {
  display: none;
}

.body-coach {
  padding: 18px 18px 16px;
  border: 1px solid #e4d4c8;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffdf9 0%, var(--cream) 100%);
  box-shadow: 0 8px 24px rgba(92, 74, 58, 0.06);
}

.body-coach__head {
  margin-bottom: 12px;
}

.body-coach__kicker {
  margin: 0 0 6px;
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.body-coach__title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.body-coach__lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.body-coach .ai-check-btn {
  width: 100%;
  margin: 0 0 12px;
}

.body-coach__body.is-loading {
  opacity: 0.38;
}

.body-coach__analysis {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
}

.body-coach__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.body-coach__list li {
  position: relative;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.body-coach__list li::before {
  content: attr(data-step);
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
}

.journal-qs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  counter-reset: journal-q;
}

.journal-qs li {
  counter-increment: journal-q;
  min-width: 0;
}

.journal-qs p {
  margin: 0 0 8px;
  padding-left: 28px;
  position: relative;
  font-size: 14px;
  line-height: 1.55;
}

.journal-qs p::before {
  content: counter(journal-q);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.journal-qs p.journal-q--pending {
  color: var(--muted);
  font-weight: 500;
}

.journal-qs.is-waiting .input {
  opacity: 0.7;
}

.deep-list.is-waiting {
  min-height: 88px;
}

.deep-empty {
  margin: 0;
  padding: 16px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.check-line:hover {
  background: var(--cream);
}

.check-line:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 600;
}

.check-line input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.ai-check-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin-top: 14px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--header);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.ai-check-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2.2l2.05 6.32 6.65.22-5.18 4.18 1.78 6.4L12 15.7 6.7 19.32l1.78-6.4L3.3 8.74l6.65-.22z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2.2l2.05 6.32 6.65.22-5.18 4.18 1.78 6.4L12 15.7 6.7 19.32l1.78-6.4L3.3 8.74l6.65-.22z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ai-check-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.ai-check-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.check-loading {
  margin: 0 0 12px;
  padding: 14px 12px 12px;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.check-loading__label {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--header);
}

.check-list.is-loading {
  opacity: 0.38;
  pointer-events: none;
}

.insight-card {
  position: relative;
  margin-bottom: 16px;
  padding: 22px 24px 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, var(--cream) 100%);
  border: 1px solid #e4d4c8;
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(156, 136, 121, 0.06),
    0 10px 28px rgba(92, 74, 58, 0.08),
    0 0 32px rgba(232, 213, 204, 0.45);
}

.insight-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -12%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 213, 204, 0.7) 0%, rgba(232, 213, 204, 0) 70%);
  pointer-events: none;
}

.insight-card__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.insight-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--header);
  box-shadow: 0 0 16px rgba(156, 136, 121, 0.28);
}

.insight-card__icon svg {
  width: 20px;
  height: 20px;
}

.insight-card__title {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.insight-card__lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.insight-card .ai-check-btn {
  position: relative;
  margin-top: 0;
  margin-bottom: 12px;
}

.insight-card__body.is-loading {
  opacity: 0.45;
}

.insight-card__empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.insight-card__result {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-card__kicker {
  margin: 0;
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.insight-card__headline {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}

.insight-card__conclusion {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.insight-card__note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.deep-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deep-item {
  padding: 12px 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.deep-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.deep-item summary::-webkit-details-marker {
  display: none;
}

.deep-item summary::after {
  content: "▾";
  flex-shrink: 0;
  color: var(--muted);
  font-size: 16px;
  transition: transform 0.15s ease;
}

.deep-item:not([open]) summary::after {
  transform: rotate(-90deg);
}

.deep-block {
  margin-top: 12px;
}

.deep-guide {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.deep-guide strong {
  display: inline-block;
  margin-right: 6px;
  color: var(--header);
  font-weight: 700;
}

.deep-item .ai-check-btn {
  margin-top: 14px;
}

.deep-follow {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deep-follow:empty {
  display: none;
}

.deep-follow__head {
  margin: 2px 0 0;
  color: var(--header);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.deep-probe {
  padding: 12px 14px 12px;
  border: 1px solid #e4d4c8;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 16px rgba(232, 213, 204, 0.35);
}

.deep-probe__q {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}

.deep-probe .textarea {
  min-height: 72px;
  background: #fff;
}

.journal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 28px 0 8px;
  text-align: center;
}

.journal-footer__actions {
  display: grid;
  grid-template-columns: minmax(220px, 280px) auto;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.btn--wide {
  min-width: 220px;
  height: 46px;
  letter-spacing: 0.04em;
}

.btn--outline {
  height: 46px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--outline:hover {
  background: var(--cream);
  border-color: var(--accent);
  color: var(--header);
}

.journal-footer__note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .logo img {
    height: 32px;
  }

  .date {
    display: none;
  }

  .guide-chip {
    display: none;
  }

  .notice-bar__text {
    text-align: center;
  }

  .form-actions,
  .ai-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn,
  .ai-actions .btn {
    width: 100%;
  }

  .tabs {
    width: 100%;
  }

  .tabs__item {
    flex: 1;
    min-width: 0;
  }
}

.report-card--charts,
.report-card--coach,
.report-card--glow,
.report-card--break {
  background: var(--surface);
}

.report-card--glow {
  background: linear-gradient(180deg, #fbf6ef 0%, #ffffff 48%);
}

.report-card--break {
  background: linear-gradient(180deg, #f7efe8 0%, #ffffff 52%);
}

.growth-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.growth-metric {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--cream-border);
}

.growth-metric span,
.growth-metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.growth-metric strong {
  display: block;
  margin: 4px 0 2px;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--text);
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.2fr);
  gap: 16px;
}

.chart-panel {
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--cream-border);
}

.chart-panel__label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap--wide {
  height: 260px;
}

.chart-fallback {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-fallback__row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.chart-fallback__row i {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9c8879, #c4a484);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.archive-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid var(--cream-border);
}

.archive-card__title {
  margin: 0 0 4px;
  font-weight: 600;
}

.archive-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.archive-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.archive-modal {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
}

.archive-modal::backdrop {
  background: rgba(74, 64, 56, 0.38);
}

.archive-modal__card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.archive-modal__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-border);
}

.archive-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 18px 22px;
}

@media (max-width: 900px) {
  .growth-metrics,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .archive-card {
    grid-template-columns: 1fr;
  }

  .archive-modal__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  .splash {
    display: none !important;
  }

  body * {
    visibility: hidden !important;
  }

  #reportArchiveModal,
  #reportArchiveModal * {
    visibility: visible !important;
  }

  #reportArchiveModal {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .archive-modal__card {
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border: 0;
  }

  .archive-modal__actions,
  .sidebar,
  .scrim,
  .toast {
    display: none !important;
  }

  .chart-wrap {
    break-inside: avoid;
  }
}

.nichi-tour.driver-popover {
  background: #f9f6f0;
  color: var(--text);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 14px;
  max-width: min(320px, calc(100vw - 28px));
  font-family: var(--sans);
}

.nichi-tour .driver-popover-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  padding-right: 22px;
}

.nichi-tour .driver-popover-description {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.nichi-tour .driver-popover-close-btn {
  color: var(--muted);
}

.nichi-tour .driver-popover-close-btn:hover,
.nichi-tour .driver-popover-close-btn:focus {
  color: var(--text);
}

.nichi-tour .driver-popover-footer {
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 14px;
}

.nichi-tour .driver-popover-progress-text {
  color: var(--muted);
  font-size: 12px;
}

.nichi-tour .driver-popover-prev-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--cream-border);
  text-shadow: none;
  border-radius: 10px;
  padding: 7px 12px;
}

.nichi-tour .driver-popover-next-btn {
  background: var(--accent);
  color: var(--header-text);
  border: 0;
  text-shadow: none;
  border-radius: 10px;
  padding: 7px 14px;
}

.nichi-tour .driver-popover-next-btn:hover,
.nichi-tour .driver-popover-prev-btn:hover {
  background: var(--accent-hover);
  color: var(--header-text);
  border-color: transparent;
}

.nichi-tour__skip {
  all: unset;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-right: auto;
}

.nichi-tour__skip:hover {
  color: var(--text);
  text-decoration: underline;
}

.nichi-tour .driver-popover-arrow-side-left,
.nichi-tour .driver-popover-arrow-side-right,
.nichi-tour .driver-popover-arrow-side-top,
.nichi-tour .driver-popover-arrow-side-bottom {
  border-color: #f9f6f0;
}

@media (max-width: 560px) {
  .date {
    display: none;
  }
}

/* --- 針對手機版（螢幕寬度小於 768px）的排版優化 --- */
@media (max-width: 768px) {
  .journal-split,
  .journal-split--body,
  .journal-top,
  .journal-footer__actions,
  .pricing-grid,
  .growth-metrics,
  .chart-grid,
  .add-task,
  .task-card,
  .archive-card {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .form-actions,
  .ai-actions,
  .journal-footer__actions,
  .archive-modal__head,
  .archive-modal__actions {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .view {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .journal-card,
  .insight-card,
  .body-check-group,
  .body-coach,
  .pricing-modal__card,
  .pricing-card,
  .paywall__card {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .journal-card .input,
  .journal-card .textarea,
  .journal-card .ai-check-btn,
  .body-coach .ai-check-btn,
  .pricing-card__cta,
  .paywall__btn,
  .paywall__btn--primary,
  .journal-footer .btn,
  .form-actions .btn,
  .ai-actions .btn {
    width: 100%;
    box-sizing: border-box;
  }

  .body-flags,
  .mood-row,
  .pricing-grid,
  .journal-split,
  .journal-split--body {
    gap: 0.75rem;
  }

  .body-flag-btn {
    display: inline-flex;
    flex: 1 1 calc(50% - 0.4rem);
    align-items: center;
    justify-content: center;
    min-height: 40px;
    text-align: center;
  }
}
