/* ─── Welcome Tour (first-run onboarding) ─────────────────────────────────────
   Full-screen overlay above the whole app. Uses the current design tokens +
   Helvetica Neue only. Keith's voice = italic, weight 300, slightly muted
   (post-serif-sweep — no Cormorant, no serif). */

.ob-overlay {
  /* Spec is absolute; inset:0 — fixed is the same box here (body = viewport)
     and can't be scrolled away on mobile. */
  position: fixed;
  inset: 0;
  z-index: 100; /* above #app and #bottom-nav (also 100 — later in DOM wins) */
  background: var(--kith-bg);
  color: var(--kith-text);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Warm atmospheric wash behind everything */
.ob-haze {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 300px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, color-mix(in srgb, var(--kith-gold) 18%, transparent) 0%, transparent 56%),
    radial-gradient(ellipse 90% 60% at 16% 22%, color-mix(in srgb, var(--kith-rose) 11%, transparent) 0%, transparent 60%),
    linear-gradient(to bottom, var(--kith-surface-2) 0%, var(--kith-bg) 100%);
}

/* ── Top chrome: back · progress · skip ── */
.ob-chrome {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(56px, env(safe-area-inset-top, 56px)) 18px 4px;
  flex-shrink: 0;
}

/* Unified back-pill chrome (matches .yw-back-btn, circles.css) */
.ob-back {
  width: 40px; height: 36px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--kith-surface);
  border: 1px solid var(--kith-border);
  cursor: pointer;
  color: var(--kith-text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(60, 34, 24, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ob-back:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(60, 34, 24, 0.1);
}

.ob-progress { flex: 1; display: flex; gap: 5px; }
.ob-seg {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--kith-surface-2);
  transition: background 300ms ease;
}
.ob-seg.on { background: var(--kith-gold); }

.ob-skip {
  flex-shrink: 0;
  background: transparent; border: none; cursor: pointer;
  color: var(--kith-text-muted);
  font-family: inherit;
  font-size: 13.5px; font-weight: 500;
  padding: 6px 4px;
}

/* ── Body ── */
.ob-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  padding: 14px 26px 32px;
  -webkit-overflow-scrolling: touch;
}
.ob-body-nochrome { padding-top: max(96px, env(safe-area-inset-top, 40px)); }

@keyframes obStepIn { from { transform: translateY(12px); } to { transform: none; } }
.ob-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  animation: obStepIn 420ms cubic-bezier(.2,.8,.3,1);
}

/* ── Type ── */
/* Keith's voice + the user's own words: Helvetica italic, light, softened */
.ob-voice { font-style: italic; font-weight: 300; }

.ob-h1 {
  font-size: 25px; font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.2;
  margin: 10px 0 0;
  color: var(--kith-text);
  max-width: 320px;
}
.ob-h1-lg { font-size: 27px; letter-spacing: -0.03em; margin-top: 10px; }

.ob-p {
  font-size: 14.5px; color: var(--kith-text-muted);
  line-height: 1.55; margin: 14px auto 0; max-width: 300px;
}

.ob-eyebrow {
  font-style: italic; font-weight: 300;
  font-size: 14px; color: var(--kith-gold);
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-top: 8px;
}

.ob-mark {
  font-style: italic; font-weight: 300;
  font-size: 13px; color: var(--kith-gold);
  letter-spacing: 0.18em; text-transform: uppercase;
}

.ob-faint { color: var(--kith-text-faint); }
.ob-caption { font-size: 12.5px; color: var(--kith-text-faint); margin-top: 13px; }

.ob-pull {
  font-size: 17px; color: var(--kith-text);
  line-height: 1.5; margin: 20px auto 0; max-width: 290px;
}

/* ── Buttons ── */
.ob-cta {
  width: 100%; margin-top: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: opacity 360ms ease;
}
.ob-cta-roomy { margin-top: 34px; }

.ob-primary {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 16px; border-radius: 999px; border: none; cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--kith-gold) 0%, #B68E2C 100%);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--kith-gold) 40%, transparent),
              inset 0 1px 0 rgba(255,255,255,0.3);
  font-family: inherit; font-size: 16px; font-weight: 600; letter-spacing: 0.01em;
}

.ob-ghost {
  width: 100%; padding: 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--kith-line); background: transparent;
  color: var(--kith-text);
  font-family: inherit; font-size: 15px; font-weight: 500;
}

/* ── Orbital pulse (listening / processing / hero) ── */
@keyframes obPulse {
  0%   { transform: scale(0.55); opacity: 0; }
  10%  { opacity: 0.55; }
  70%  { opacity: 0.1; }
  100% { transform: scale(1.45); opacity: 0; }
}
.ob-pulse {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ob-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--kith-green);
  animation: obPulse 1800ms ease-out infinite;
}
.ob-core {
  width: 34%; height: 34%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, var(--kith-green), var(--kith-accent-ink));
  box-shadow: 0 0 40px color-mix(in srgb, var(--kith-green) 45%, transparent);
}

.ob-hero {
  position: relative;
  width: 118px; height: 118px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.ob-hero .ob-core { display: none; } /* the sun replaces the core in heroes */
.ob-sun {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #F6DD9A, var(--kith-gold) 62%, #B68E2C);
  box-shadow: 0 0 30px color-mix(in srgb, var(--kith-gold) 53%, transparent);
}
.ob-sun-check {
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 34px color-mix(in srgb, var(--kith-gold) 53%, transparent);
}

/* ── Dictation ── */
.ob-greeting {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px; margin-top: 16px; width: 100%;
  background: color-mix(in srgb, var(--kith-gold) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--kith-gold) 27%, transparent);
  border-radius: 16px;
  text-align: left;
}
.ob-greeting-orb {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--kith-gold), #B68E2C);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--kith-gold) 40%, transparent);
}
.ob-greeting-text { flex: 1; font-size: 14.5px; color: var(--kith-text); line-height: 1.5; }

.ob-hint {
  border: 1px solid var(--kith-line);
  border-radius: 18px;
  padding: 16px 18px;
  margin-top: 18px;
  width: 100%;
  background: var(--kith-surface);
  font-size: 15px;
  color: var(--kith-text-faint);
  line-height: 1.55;
  text-align: left;
}

/* Typed answer — same pipeline as voice, no Whisper.
   Visually a real secondary button (mirrors .ob-ghost tokens) so it reads as
   tappable — still clearly subordinate to the mic above it. */
.ob-type-link {
  margin-top: 20px;
  min-height: 48px; padding: 13px 28px;
  border-radius: 999px; cursor: pointer;
  border: 1px solid var(--kith-line); background: transparent;
  color: var(--kith-text);
  font-family: inherit; font-size: 15px; font-weight: 500;
}
.ob-type-link:active { background: color-mix(in srgb, var(--kith-text) 8%, transparent); }
.ob-type-link:focus-visible { outline: 2px solid var(--kith-gold); outline-offset: 2px; }

.ob-type-input {
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--kith-line);
  background: var(--kith-surface);
  color: var(--kith-text);
  font-size: 16px; /* prevents iOS zoom-on-focus — don't shrink */
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
  min-height: 110px;
}
.ob-type-input:focus { border-color: var(--kith-gold); }

.ob-mic {
  width: 82px; height: 82px; border-radius: 50%;
  border: none; cursor: pointer; margin-top: 30px;
  background: linear-gradient(135deg, var(--kith-gold) 0%, #B68E2C 100%);
  color: #fff;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--kith-gold) 47%, transparent),
              inset 0 1px 0 rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
}

.ob-listen {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; padding-top: 16px;
}
.ob-listen .ob-pulse { margin-bottom: 20px; }

.ob-transcript {
  margin-top: 18px;
  padding: 16px;
  width: 100%;
  min-height: 120px;
  background: var(--kith-surface);
  border-radius: 16px;
  box-shadow: var(--kith-shadow-soft);
  font-size: 15.5px;
  color: var(--kith-text);
  line-height: 1.55;
  text-align: left;
}
.ob-listen .ob-transcript { margin-top: 0; }

@keyframes kithBlink { 50% { opacity: 0; } }
.ob-caret {
  display: inline-block;
  width: 2px; height: 17px;
  background: var(--kith-gold);
  margin-left: 2px;
  vertical-align: middle;
  animation: kithBlink 1s infinite;
}

.ob-stop {
  margin-top: 20px;
  padding: 14px 44px;
  border-radius: 999px;
  border: none;
  background: var(--kith-text);
  color: var(--kith-bg);
  font-family: inherit;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}

.ob-processing-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 0;
}
.ob-processing { font-size: 17px; margin-top: 24px; color: var(--kith-text-muted); }

/* Summary — one row per extracted {section, value} */
.ob-summary {
  width: 100%;
  margin-top: 14px;
  background: var(--kith-surface);
  border-radius: 16px;
  box-shadow: var(--kith-shadow-soft);
  overflow: hidden;
  text-align: left;
}
.ob-row {
  display: flex; gap: 12px;
  padding: 13px 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 360ms ease, transform 360ms cubic-bezier(.2,.8,.3,1);
}
.ob-row + .ob-row { border-top: 1px solid var(--kith-line-soft); }
.ob-row.on { opacity: 1; transform: none; }
.ob-row-label {
  width: 96px; flex-shrink: 0;
  font-size: 10.5px; font-weight: 600;
  color: var(--kith-text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding-top: 3px;
}
.ob-row-val { flex: 1; font-size: 14px; color: var(--kith-text); line-height: 1.45; }

/* ── Import ── */
.ob-motif {
  display: flex; align-items: center; justify-content: center;
  height: 78px; margin-bottom: 4px;
}
.ob-motif-disc {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2.5px solid var(--kith-bg);
  display: inline-block;
}

.ob-tone-green { background: var(--kith-green-soft); color: var(--kith-green); }
.ob-tone-rose  { background: var(--kith-rose-soft);  color: var(--kith-rose); }
.ob-tone-gold  { background: var(--kith-gold-soft);  color: var(--kith-gold); }
.ob-tone-sand  { background: var(--kith-surface-2);  color: var(--kith-text-muted); }

.ob-file-card {
  width: 100%; margin-top: 26px;
  background: var(--kith-surface);
  border-radius: 18px;
  box-shadow: var(--kith-shadow-soft);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  text-align: left;
}
.ob-file-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: color-mix(in srgb, var(--kith-gold) 12%, transparent);
  color: var(--kith-gold);
  display: flex; align-items: center; justify-content: center;
}
.ob-file-meta { flex: 1; min-width: 0; }
.ob-file-name { font-size: 14.5px; font-weight: 600; color: var(--kith-text); }
.ob-file-sub  { font-size: 12.5px; color: var(--kith-text-muted); margin-top: 2px; }

.ob-import-btn {
  padding: 9px 16px; border-radius: 999px; border: none;
  cursor: pointer; flex-shrink: 0;
  background: var(--kith-green); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 600;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--kith-green) 27%, transparent);
}

.ob-import-error {
  margin-top: 12px;
  font-size: 13px;
  color: var(--kith-red);
  line-height: 1.5;
  max-width: 300px;
}

/* ── Person picker ── */
.ob-person-hero {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 500;
}

.ob-search-wrap { position: relative; width: 100%; margin-top: 20px; }
.ob-search-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--kith-text-faint);
  display: flex;
}
.ob-search {
  width: 100%;
  padding: 14px 16px 14px 42px;
  border-radius: 14px;
  border: 1px solid var(--kith-line);
  background: var(--kith-surface);
  color: var(--kith-text);
  font-size: 16px; /* prevents iOS zoom-on-focus — don't shrink */
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.ob-person-list {
  width: 100%; margin-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.ob-person-row {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px; width: 100%;
  background: var(--kith-surface);
  border: 1px solid var(--kith-line);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--kith-text);
}
.ob-person-row-new { background: transparent; border-style: dashed; }

.ob-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.ob-person-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ob-person-name { font-size: 15px; font-weight: 600; color: var(--kith-text); }
.ob-person-rel  { font-size: 12.5px; color: var(--kith-text-muted); margin-top: 1px; }
.ob-person-plus {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: color-mix(in srgb, var(--kith-gold) 12%, transparent);
  color: var(--kith-gold);
  display: flex; align-items: center; justify-content: center;
}

/* ── Reminders ── */
.ob-bell-wrap {
  position: relative;
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kith-gold) 10%, transparent);
}

.ob-toggle-row {
  width: 100%; margin-top: 26px;
  padding: 16px 18px; border-radius: 18px;
  border: 1px solid var(--kith-line);
  cursor: pointer;
  background: var(--kith-surface);
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  font-family: inherit;
  transition: background 200ms, border-color 200ms;
}
.ob-toggle-row.on {
  border-color: color-mix(in srgb, var(--kith-gold) 40%, transparent);
  background: color-mix(in srgb, var(--kith-gold) 8%, transparent);
}
.ob-toggle-meta { flex: 1; display: flex; flex-direction: column; }
.ob-toggle-label { font-size: 15px; font-weight: 600; color: var(--kith-text); }
.ob-toggle-sub   { font-size: 12.5px; color: var(--kith-text-muted); margin-top: 2px; }

.ob-switch {
  width: 46px; height: 28px; border-radius: 999px; flex-shrink: 0;
  position: relative;
  background: var(--kith-surface-2);
  transition: background 200ms;
}
.ob-switch.on { background: var(--kith-gold); }
.ob-knob {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  transition: left 200ms cubic-bezier(.2,.8,.3,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ob-switch.on .ob-knob { left: 21px; }
