/* Paper-and-ink — same language as the landing page and emails. */
:root {
  color-scheme: light;
  --paper: #f7f3ec;
  --paper-raised: #fcfaf6;
  --paper-sunken: #efe9de;
  --ink: #211d18;
  --ink-soft: #5c554b;
  --ink-faint: #8a8175;
  --line: #ddd4c5;
  --line-strong: #c9bda9;
  --gold: #a2762e;
  --gold-soft: #c99b4d;

  --bg: var(--paper);
  --bg-elevated: var(--paper-raised);
  --bg-card: var(--paper-sunken);
  --border: var(--line);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --accent: #305d76;
  --accent-soft: rgba(48, 93, 118, 0.09);
  --accent-strong: #26495d;
  --warm: var(--gold);
  --danger: #a2493c;
  --success: #4d7257;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(33, 29, 24, 0.06), 0 8px 32px rgba(33, 29, 24, 0.1);
  --orb-hi: #cfe0ea;
  --orb-mid: #4a7d99;
  --orb-lo: #26495d;
  --font: "DM Sans", system-ui, sans-serif;
  --font-serif: "Literata", "Iowan Old Style", Georgia, serif;
}

/* Dusk ink — the landing page's dark palette. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #171310;
    --paper-raised: #201b16;
    --paper-sunken: #120f0c;
    --ink: #ebe3d6;
    --ink-soft: #b0a695;
    --ink-faint: #7d7466;
    --line: #322b23;
    --line-strong: #453c30;
    --gold: #c99b4d;
    --gold-soft: #a2762e;
    --accent: #7fa8c0;
    --accent-soft: rgba(127, 168, 192, 0.12);
    --accent-strong: #a3c4d6;
    --danger: #cb7a6c;
    --success: #85a98f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.45);
    --orb-hi: #b9d2e2;
    --orb-mid: #5b87a3;
    --orb-lo: #2c4a5e;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

body {
  min-height: 100dvh;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 5rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--gold-soft) 0%, var(--gold) 100%);
  box-shadow: 0 1px 3px rgba(33, 29, 24, 0.2);
}

.brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.tabs {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(33, 29, 24, 0.08);
}

.view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.btn {
  font: inherit;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: var(--paper-raised);
  box-shadow: 0 1px 2px rgba(33, 29, 24, 0.15);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn.danger {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn.small {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.btn.large {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state p {
  margin: 0 0 0.5rem;
}

.empty-state .btn {
  margin-top: 1.25rem;
}

.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;
}

.journal-search-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.75rem;
}

.journal-search-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
}

.journal-search-input:focus {
  outline: none;
  border-color: var(--accent-strong);
}

.journal-search-clear {
  flex-shrink: 0;
}

.journal-search-status {
  margin: -0.25rem 0 0.75rem;
}

.entry-card mark {
  background: color-mix(in srgb, var(--gold-soft) 35%, transparent);
  color: inherit;
  padding: 0 0.1em;
  border-radius: 2px;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.entry-card {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  text-align: left;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(33, 29, 24, 0.04);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.entry-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.entry-card.is-today {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
}

.entry-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 2.9rem;
  padding-right: 0.9rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.entry-day-num {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
}

.entry-card.is-today .entry-day-num {
  color: var(--gold);
}

.entry-day-wd {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.entry-body {
  flex: 1;
  min-width: 0;
}

.entry-card .title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.entry-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.entry-card .preview {
  font-size: 0.9rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Today's page hero ─────────────────────────────────────── */

.today-hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem 1.4rem;
  margin-bottom: 1.75rem;
}

.today-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold) 45%, transparent 90%);
  opacity: 0.85;
}

.today-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.today-date {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 5vw, 2.05rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.today-line {
  margin: 0 0 1.15rem;
  color: var(--muted);
  max-width: 36em;
}

.today-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.today-stats {
  margin: 1.1rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ── Journal toolbar + month labels ────────────────────────── */

.journal-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.journal-toolbar-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.month-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.35rem 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.month-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.entries-list > .month-label:first-child {
  margin-top: 0.15rem;
}

.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: capitalize;
}

.session-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem 1.25rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.connecting {
  background: var(--warm);
  box-shadow: 0 0 8px var(--warm);
  animation: pulse 1s infinite;
}

.status-dot.listening {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.4s infinite;
}

.status-dot.speaking {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 0.8s infinite;
}

.status-dot.error {
  background: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.orb-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 1.25rem;
}

.orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--orb-hi) 0%, var(--orb-mid) 45%, var(--orb-lo) 100%);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 25%, transparent);
  transition: transform 0.3s, box-shadow 0.3s;
}

.orb.listening {
  animation: breathe 2.5s ease-in-out infinite;
  box-shadow: 0 0 50px color-mix(in srgb, var(--success) 35%, transparent);
}

.orb.speaking {
  animation: speak 0.6s ease-in-out infinite alternate;
  box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 45%, transparent);
}

.orb.connecting {
  animation: spin-soft 2s linear infinite;
  opacity: 0.85;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes speak {
  from {
    transform: scale(0.96);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes spin-soft {
  from {
    filter: hue-rotate(0deg);
  }
  to {
    filter: hue-rotate(40deg);
  }
}

.live-caption {
  min-height: 2.5em;
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
  padding: 0 0.5rem;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toast {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  border-radius: 12px;
  color: var(--success);
  font-size: 0.9rem;
}

.toast.error {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}

.transcript-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.transcript {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.bubble {
  max-width: 92%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  line-height: 1.45;
}

.bubble.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.bubble.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.bubble .who {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.entry-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0;
  max-width: min(560px, 94vw);
  width: 100%;
  box-shadow: var(--shadow);
}

.entry-dialog::backdrop {
  background: rgba(33, 29, 24, 0.45);
  backdrop-filter: blur(2px);
}

#entry-detail {
  padding: 1.5rem 1.5rem 0.5rem;
}

#entry-detail h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

#entry-detail .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

#entry-detail .content {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

#entry-detail .entry-title-input {
  width: 100%;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

#entry-detail .entry-title-input:focus {
  border-color: var(--border);
  outline: none;
  background: var(--bg);
}

#entry-detail .entry-content-input {
  width: 100%;
  min-height: 12rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: inherit;
  resize: vertical;
  box-sizing: border-box;
}

#entry-detail .entry-content-input:focus {
  outline: none;
  border-color: var(--accent);
}

#entry-detail .entry-edit-hint {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

#entry-detail .section-label {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

#entry-detail .entry-photo-actions {
  margin: 0.85rem 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

#entry-detail .entry-media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.35rem 0 0.85rem;
}

#entry-detail .entry-media-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

#entry-detail ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem 1.25rem;
}

/* ── Voice workflow wizard ─────────────────────────────────────── */
.panel-header-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.voice-workflow {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.voice-progress {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.voice-dot {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  transition: background 0.2s ease;
}

.voice-dot.active {
  background: var(--accent);
}

.voice-dot.done {
  background: var(--success);
}

.voice-step {
  display: none;
}

.voice-step.active {
  display: block;
}

.voice-step h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.voice-status-panel,
.voice-review-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.voice-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.voice-stat-row .label {
  color: var(--muted);
  min-width: 7rem;
}

.voice-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent);
}

.voice-badge.high {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}

.voice-badge.medium {
  background: color-mix(in srgb, var(--warm) 15%, transparent);
  color: var(--warm);
}

.voice-badge.low {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}

.voice-entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
  max-height: 280px;
  overflow-y: auto;
}

.voice-entry-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.voice-entry-row .title {
  font-weight: 600;
  font-size: 0.95rem;
}

.voice-entry-row .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.voice-entry-row .preview {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.voice-entry-row .row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.voice-checklist {
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
}

.voice-review-panel .review-summary {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.voice-review-panel .review-block {
  margin-top: 0.75rem;
}

.voice-review-panel .review-block h5 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.voice-review-panel .example {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 0.55rem 0.65rem;
  margin: 0.35rem 0;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  white-space: pre-wrap;
}

.voice-review-panel .never-list {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.voice-review-actions {
  flex-wrap: wrap;
}

.voice-advanced {
  margin-top: 1rem;
}

.voice-advanced .style-card-pre {
  margin-top: 0.75rem;
}

.footer {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  gap: 1rem;
  flex-wrap: wrap;
}

.health-badge {
  font-variant-numeric: tabular-nums;
}

.health-badge.ok {
  color: var(--success);
}

.health-badge.bad {
  color: var(--danger);
}

@media (max-width: 480px) {
  .orb {
    width: 96px;
    height: 96px;
  }
}

/* ── Onboarding ─────────────────────────────────────────────── */

body.onboarding-active .header,
body.onboarding-active #main-app > main,
body.onboarding-active .footer {
  display: none;
}

body.onboarding-active #main-app {
  display: none;
}

.onboarding {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0 2rem;
}

.onboarding.hidden {
  display: none !important;
}

.onboarding-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}

.ob-dot.active {
  background: var(--accent);
  transform: scale(1.15);
}

.ob-dot.done {
  background: var(--success);
}

.ob-step {
  display: none;
  animation: fadeIn 0.25s ease;
}

.ob-step.active {
  display: block;
}

.ob-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ob-brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ob-promise {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.45;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.ob-ritual {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ob-ritual li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.ob-ritual li strong {
  color: var(--accent);
  font-weight: 600;
}

.ob-fine {
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}

.ob-step h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ob-step > .muted {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.ob-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.ob-input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  outline: none;
  margin-bottom: 0.5rem;
}

.ob-input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ob-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.ob-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.ob-actions .btn {
  width: 100%;
}

.ob-ready-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ob-ready-summary .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.ob-ready-summary .value {
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.ob-ready-summary .value:last-child {
  margin-bottom: 0;
}

.ob-ritual-line {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.ob-textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  outline: none;
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.ob-textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ob-hint {
  font-size: 0.8rem;
  margin: 0 0 0.75rem;
}

.ob-status {
  font-size: 0.85rem;
  color: var(--success);
  margin: 0.5rem 0 0;
}

.ob-status.error {
  color: var(--danger);
}

.ob-actions-row {
  display: flex;
  gap: 0.5rem;
}

.ob-actions-row .btn {
  flex: 1;
}

.chip-groups {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.chip-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chip-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chips-wrap {
  margin-bottom: 1rem;
}

.chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--muted);
}

.chip.selected,
.chip.toggle.selected {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.ob-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin: 0.75rem 0 1rem;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ob-preview-card .preview-title {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  color: var(--accent);
}

.ob-input + .ob-input {
  margin-top: 0.45rem;
}

/* Phone call path */
.phone-call-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem 1.25rem 1.35rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.phone-call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.phone-call-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.phone-ready-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.phone-ready-badge.ready {
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
}

.phone-ready-badge.not-ready {
  background: color-mix(in srgb, var(--warm) 10%, transparent);
  border-color: color-mix(in srgb, var(--warm) 40%, transparent);
  color: var(--warm);
}

.journal-line-display {
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0.75rem 0 1rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.journal-line-display.settings-line {
  font-size: 1.25rem;
  margin: 0.5rem 0 0.75rem;
}

.phone-call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.phone-call-actions .btn.large {
  flex: 1 1 auto;
  text-align: center;
  text-decoration: none;
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

.phone-call-from {
  margin: 0.85rem 0 0;
}

.or-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.35rem 0 0.85rem;
  position: relative;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.empty-state .empty-actions .btn {
  margin-top: 0;
}

/* Usage tab */
.usage-intro {
  margin: -0.25rem 0 1rem;
}

.usage-summary-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.1rem;
  margin-bottom: 1.25rem;
}

.usage-summary-main {
  margin-bottom: 0.65rem;
}

.usage-total {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  font-variant-numeric: tabular-nums;
}

.usage-summary-sub {
  margin: 0;
}

.usage-table {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0;
  font-variant-numeric: tabular-nums;
}

.usage-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #333) 60%, transparent);
}

.usage-row:last-child {
  border-bottom: none;
}

.usage-calls-header {
  margin-top: 0.25rem;
  margin-bottom: 0.65rem;
  align-items: baseline;
}

.usage-calls-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.usage-calls-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 2rem;
}

.usage-call {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.usage-call-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: left;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.usage-call-summary:hover {
  background: color-mix(in srgb, var(--accent, #6b9) 8%, transparent);
}

.usage-call-summary:focus-visible {
  outline: 2px solid var(--accent, #6b9);
  outline-offset: -2px;
}

.usage-call-when {
  font-weight: 600;
  font-size: 0.95rem;
}

.usage-call-meta {
  grid-column: 1;
  font-size: 0.82rem;
  color: var(--muted);
}

.usage-call-total {
  grid-row: 1 / span 2;
  align-self: center;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent, #6b9);
}

.usage-call-title {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-call.open .usage-call-summary {
  border-bottom: 1px solid var(--border);
}

.usage-call-detail {
  display: none;
  padding: 0.75rem 1rem 1rem;
}

.usage-call.open .usage-call-detail {
  display: block;
}

.usage-call-detail h4 {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.usage-call-detail h4:first-child {
  margin-top: 0;
}

.usage-detail-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  padding: 0.18rem 0;
  color: var(--muted);
}

.usage-detail-line strong {
  color: inherit;
  font-weight: 500;
}

.usage-compare {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--bg, #111) 70%, transparent);
  font-size: 0.8rem;
  color: var(--muted);
}

.usage-compare strong {
  color: var(--text, #eee);
  font-weight: 600;
}

.usage-mode-pill {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Settings */

.settings-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  margin-bottom: 1rem;
}

.settings-section h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.settings-section .muted.small {
  font-size: 0.85rem;
  margin: 0 0 0.9rem;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.style-card-details {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.style-card-details summary {
  cursor: pointer;
  color: var(--accent);
}

.style-card-pre {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  white-space: pre-wrap;
  color: var(--ink-soft);
  max-height: 200px;
  overflow: auto;
}

/* Print book wizard (Phase 1 PDF) */

.print-book-panel {
  margin: 0 0 1.25rem;
}

.print-book-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.print-book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.print-book-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.print-book-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 1rem 0 0.75rem;
}

.print-book-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.print-book-row.full {
  grid-column: 1 / -1;
}

.print-book-row label {
  font-size: 0.8rem;
  color: var(--muted);
}

.print-book-row input,
.print-book-row select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.print-entries-preview .print-preview-note {
  list-style: none;
  margin: 0 0 0.35rem;
  font-style: italic;
  opacity: 0.9;
}
.print-entries-preview {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.1rem;
  max-height: 8rem;
  overflow: auto;
}

.print-book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.print-book-foot {
  margin: 0.85rem 0 0;
}

.print-book-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.15rem 0 0.85rem;
}

.print-ship-heading {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.print-orders-list {
  margin-top: 0.85rem;
}

.print-orders-list .print-order-row {
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
}

button.linkish {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── People / beta invites ───────────────────────────────────── */

.people-invite-form .ob-input {
  margin-bottom: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.people-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.people-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.people-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.people-email {
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-all;
}

.people-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.people-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.people-status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.people-status-pill.pending {
  color: var(--warm);
  border-color: color-mix(in srgb, var(--warm) 40%, transparent);
}

.people-status-pill.accepted {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.people-status-pill.disabled,
.people-status-pill.revoked {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.people-status-pill.env {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.people-status-pill.invited {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.people-status-pill.dismissed {
  color: var(--muted);
  border-color: var(--border);
}

.people-waitlist-section {
  margin-bottom: 1.25rem;
}

.people-waitlist-tools {
  display: grid;
  grid-template-columns: 1fr minmax(8rem, 9.5rem);
  gap: 0.5rem;
  margin: 0.5rem 0 0.85rem;
}

.people-status-filter {
  cursor: pointer;
}

@media (max-width: 480px) {
  .people-waitlist-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tabs {
    width: 100%;
    justify-content: stretch;
  }

  .tab {
    flex: 1;
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
  }

  .print-book-fields {
    grid-template-columns: 1fr;
  }

  .panel-header-actions {
    flex-wrap: wrap;
  }
}
