/* Your Story, In Your Words — flat design.
   One accent, no shadows, no gradients. Fill or line, never both. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f2;
  --ink: #1b1e1c;
  --muted: #6b716d;
  --line: #e4e6e3;
  --accent: #11694f;
  --accent-ink: #ffffff;
  --accent-soft: #e5f1ec;
  --warn: #9a6410;
  --warn-soft: #f7efe1;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141615; --surface: #141615; --surface-2: #1e211f; --ink: #eceeec; --muted: #9ba19d;
    --line: #2b2f2c; --accent: #5cc39f; --accent-ink: #0b1f18; --accent-soft: #17302a;
    --warn: #e2b064; --warn-soft: #2e2516; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141615; --surface: #141615; --surface-2: #1e211f; --ink: #eceeec; --muted: #9ba19d;
  --line: #2b2f2c; --accent: #5cc39f; --accent-ink: #0b1f18; --accent-soft: #17302a;
  --warn: #e2b064; --warn-soft: #2e2516; color-scheme: dark;
}

.ys, .ys * { box-sizing: border-box; }
.ys { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.ys button, .ys input, .ys textarea, .ys select { font: inherit; color: inherit; }
.ys a { color: var(--accent); }
.ys :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ys h1, .ys h2, .ys h3 { text-wrap: balance; margin: 0; line-height: 1.15; }
.ys p { margin: 0; }
.ys svg { flex: none; }

/* ---------- Stage ---------- */
.ys-stage { min-height: 100vh; display: flex; flex-direction: column; }
.ys-topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.ys-brand { font-weight: 600; letter-spacing: -.01em; }
.ys-brand em { font-style: normal; font-weight: 400; color: var(--muted); }
.ys-toggle { margin-left: auto; display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.ys-toggle button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--muted); }
.ys-toggle button[aria-pressed="true"] { background: var(--bg); color: var(--ink); }

.ys-mobile-guide { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 24px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); }
.ys-mobile-guide .lbl { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ys-mobile-guide .lbl .n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ys-mobile-guide .lbl b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys-mobile-guide button { border: 0; background: var(--ink); color: var(--bg); padding: 6px 14px; border-radius: 8px; font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; }

.ys-body { flex: 1; display: grid; grid-template-columns: minmax(0, 880px); justify-content: center; justify-items: center; padding: 40px 16px 56px; }
.ys-body.is-business > * { width: 100%; }

.ys-phone { width: 380px; max-width: 100%; height: min(800px, calc(100vh - 160px)); min-height: 580px; border-radius: 40px; border: 1px solid var(--line); padding: 8px; background: var(--bg); }
.ys-screen { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: var(--bg); }
.ys-screen > .ys-app { height: 100%; overflow-y: auto; padding-top: 20px; }

@media (max-width: 860px) {
  .ys-topbar { padding: 12px 16px; }
  .ys-mobile-guide { justify-content: flex-start; padding: 8px 16px; }
  .ys-mobile-guide .lbl { flex: 1; min-width: 0; }
  .ys-body { padding: 0; }
  .ys-phone { width: 100%; height: auto; min-height: 0; border: 0; border-radius: 0; padding: 0; }
  .ys-screen { border-radius: 0; overflow: visible; height: auto; }
  .ys-screen > .ys-app { height: auto; padding-top: 0; overflow: visible; }
}

/* ---------- Lock screen ---------- */
.ys-lock { min-height: 100%; margin-top: -20px; padding: 72px 18px 24px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: #11694f; color: #fff; }
@media (max-width: 860px) { .ys-lock { margin-top: 0; min-height: calc(100vh - 110px); } }
.ys-lock .date { font-size: 15px; opacity: .8; }
.ys-lock .time { font-size: 72px; font-weight: 300; letter-spacing: -.04em; line-height: 1; margin-bottom: 40px; font-variant-numeric: tabular-nums; }
.ys .ys-notif { width: 100%; text-align: left; border: 0; cursor: pointer; background: #fff; color: #1b1e1c; border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; animation: ys-drop .5s ease-out both .3s; }
.ys-notif .ic { width: 34px; height: 34px; border-radius: 9px; background: #2fbf5b; color: #fff; display: grid; place-items: center; }
.ys-notif .meta { display: flex; justify-content: space-between; font-size: 12px; color: #6b716d; }
.ys-notif .from { font-weight: 600; font-size: 14px; color: #1b1e1c; }
.ys-notif .msg { font-size: 14px; line-height: 1.4; display: block; }
.ys-notif .msg u { color: #11694f; text-decoration: none; font-weight: 500; }
.ys-lock .hint { margin-top: auto; font-size: 13px; opacity: .75; }
@keyframes ys-drop { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ys-notif { animation: none; } }

/* ---------- App ---------- */
.ys-app { background: var(--bg); }
.ys-wrap { max-width: 34rem; margin: 0 auto; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 24px; container-type: inline-size; }
.ys-appbar { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.ys-appbar .back { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.ys-appbar .title { font-weight: 500; flex: 1; min-width: 0; }
.ys-appbar .icon-btn { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; }
.ys-lockline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.ys-hello h1 { font-weight: 600; font-size: 32px; letter-spacing: -.03em; }
.ys-hello p { color: var(--muted); margin-top: 6px; }

.ys-card { background: var(--surface-2); border-radius: var(--r); padding: 18px; }
.ys-cta { background: var(--surface-2); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ys-cta .eyebrow { font-size: 13px; color: var(--muted); }
.ys-cta h2 { font-weight: 500; font-size: 20px; letter-spacing: -.015em; line-height: 1.3; }

.ys-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; padding: 12px 18px; border-radius: 10px; font-weight: 500; font-size: 15px; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.ys-btn svg { width: 18px; height: 18px; }
.ys-btn.is-light { background: var(--accent); color: var(--accent-ink); }
.ys-btn.is-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.ys-btn.is-glow { background: var(--ink); color: var(--bg); }
.ys-btn.is-small { padding: 8px 12px; font-size: 13px; }
.ys-btn[disabled] { opacity: .5; cursor: default; }
.ys-btn.is-block { width: 100%; }

.ys-section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: -12px; }
.ys-section-h h2 { font-size: 13px; color: var(--muted); font-weight: 500; }
.ys-section-h .aside { display: none; }

.ys-storylist { display: flex; flex-direction: column; }
.ys-storyrow { display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 14px 0; cursor: pointer; }
.ys-storyrow:hover .t { color: var(--accent); }
.ys-storyrow .k { font-size: 13px; color: var(--muted); }
.ys-storyrow .t { font-size: 16px; font-weight: 500; }

.ys-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.ys-dot { display: none; }

.ys-moments { display: flex; flex-direction: column; }
.ys-moment { border-bottom: 1px solid var(--line); padding: 14px 0; }
.ys-moment summary { list-style: none; display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: baseline; cursor: pointer; }
.ys-moment summary::-webkit-details-marker { display: none; }
.ys-moment .dt { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ys-moment .pv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ys-moment .qa { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; padding-left: 68px; }
@container (max-width: 420px) { .ys-moment .qa { padding-left: 0; } }
.ys-qa .q { font-size: 13px; color: var(--muted); }
.ys-qa .a { font-size: 15px; }

/* Form */
.ys-form { display: flex; flex-direction: column; gap: 22px; }
.ys-form .prompt-h { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.ys-field { display: flex; flex-direction: column; gap: 8px; }
.ys-field label, .ys-field .lbl { font-weight: 500; }
.ys-field textarea { width: 100%; min-height: 96px; resize: vertical; border: 0; border-radius: var(--r); padding: 14px; background: var(--surface-2); font-size: 16px; line-height: 1.5; }
.ys-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.ys-field input[type="date"], .ys-field select, .ys-field input[type="tel"], .ys-row input, .ys-row select { border: 0; border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.ys-help { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.ys-error { color: #b23b2e; font-size: 14px; font-weight: 500; }
.ys-fill { align-self: flex-start; border: 0; background: transparent; color: var(--accent); font-weight: 500; cursor: pointer; padding: 0; font-size: 14px; }

.ys-banked { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 48px; }
.ys-banked .coin { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent) !important; display: grid; place-items: center; animation: ys-pop .4s ease-out both; }
.ys-banked h1 { font-weight: 600; font-size: 32px; letter-spacing: -.03em; }
.ys-banked p { color: var(--muted); max-width: 24rem; margin-bottom: 8px; }
.ys-banked .ys-btn { width: 100%; max-width: 20rem; }
@keyframes ys-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ys-banked .coin { animation: none; } }

/* Story */
.ys-story-head { display: flex; flex-direction: column; gap: 8px; }
.ys-story-head .k { font-size: 13px; color: var(--muted); }
.ys-story-head h1 { font-weight: 600; font-size: 30px; letter-spacing: -.03em; }
.ys-story-head .meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.ys-story { font-size: 17px; line-height: 1.7; display: flex; flex-direction: column; gap: 16px; }
.ys-story h3 { font-size: 15px; font-weight: 600; margin-top: 12px; }
.ys-story.is-streaming { white-space: pre-wrap; color: var(--muted); }
.ys-coach { background: var(--accent-soft); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ys-coach h2 { font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.ys-coach ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; counter-reset: c; }
.ys-coach li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; counter-increment: c; }
.ys-coach li::before { content: counter(c); font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.ys-coach li b { display: block; font-weight: 600; }
.ys-coach li p { font-size: 14.5px; color: var(--ink); opacity: .8; }

.ys-how { scroll-margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ys-how > summary { cursor: pointer; padding: 16px 0; font-weight: 500; display: flex; align-items: center; list-style: none; }
.ys-how > summary::-webkit-details-marker { display: none; }
.ys-how > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 20px; line-height: 1; }
.ys-how[open] > summary::after { content: "–"; }
.ys-how .body { padding: 0 0 20px; display: flex; flex-direction: column; gap: 16px; }
.ys-how .rule { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.ys-sbs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.ys-sbs h4 { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.ys-sbs .col { min-width: 0; display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow-y: auto; }
.ys-raw { border-left: 2px solid var(--line); padding-left: 12px; display: flex; flex-direction: column; gap: 4px; }
.ys-raw .h { font-size: 12px; color: var(--muted); font-weight: 500; }
.ys-raw .q { font-size: 12px; color: var(--muted); }
.ys-raw .a { font-size: 14px; }
.ys-written p { font-size: 14px; line-height: 1.6; }
.ys-written h5 { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
@container (max-width: 520px) { .ys-sbs { grid-template-columns: minmax(0, 1fr); } .ys-sbs .col { max-height: 340px; } }

.ys-note { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.ys-note.is-stale { background: var(--warn-soft); color: var(--ink); }
.ys-note .grow { flex: 1; min-width: 0; }
.ys-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Dictation */
.ys-talk { position: relative; }
.ys-talk textarea { padding-right: 48px; }
.ys-mic { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--bg); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.ys-mic.is-listening { background: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: no-preference) { .ys-mic.is-listening { animation: ys-pulse 1.2s ease-in-out infinite; } }
@keyframes ys-pulse { 50% { opacity: .55; } }

/* About you */
.ys-form input[type="text"], .ys-form input[type="date"], .ys-form select { width: 100%; border: 0; border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); font-size: 16px; }
.ys-form input:focus, .ys-form select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.ys-pay { border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.ys-pay .lbl { font-weight: 500; }
.ys-pay .ys-row { align-items: flex-end; }
.ys-pay .ys-row .ys-field { flex: 1; min-width: 140px; }

/* Settings */
.ys-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; }
.ys-seg button { border: 0; background: transparent; border-radius: 8px; padding: 9px 4px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.ys-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ys-privacy { padding: 0 4px; }
.ys-privacy svg { color: var(--accent); width: 16px; height: 16px; }

.ys-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 14px; z-index: 50; }

/* ---------- Business ---------- */
.ys-biz { width: 100%; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
@media (max-width: 860px) { .ys-biz { padding: 24px 16px 40px; } }
.ys-biz-h h1 { font-size: 32px; font-weight: 600; letter-spacing: -.03em; }
.ys-biz-h p { color: var(--muted); margin-top: 4px; }
.ys-lockbar { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); border-radius: var(--r); padding: 14px 16px; font-size: 14px; }
.ys-lockbar svg { color: var(--accent); }
.ys-lockbar b { font-weight: 600; }
.ys-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ys-tile { background: var(--surface-2); border-radius: var(--r); padding: 18px; }
.ys-tile b { font-size: 34px; font-weight: 600; display: block; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }
.ys-tile span { font-size: 13px; color: var(--muted); }
@media (max-width: 520px) { .ys-tiles { gap: 8px; } .ys-tile { padding: 14px; } .ys-tile b { font-size: 26px; } }
.ys-panel { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ys-panel h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.ys-panel .sub { font-size: 13px; color: var(--muted); margin-top: -8px; }
.ys-table-wrap { overflow-x: auto; }
.ys-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
.ys-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.ys-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ys-table .ys-fill { color: var(--ink); font-size: 14px; }
.ys-table .ys-fill:hover { color: var(--accent); }
.ys-table .private { color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.ys-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.ys-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ys-status.participating { color: var(--accent); }
.ys-status.quiet { color: var(--warn); }
.ys-status.invited { color: var(--muted); }
.ys-sheet { background: var(--surface-2); border-radius: var(--r); padding: 16px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }

/* Live mode */
.ys-live { min-height: 100vh; }
.ys-gate { max-width: 26rem; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; gap: 16px; }
.ys-gate h1 { font-weight: 600; font-size: 28px; letter-spacing: -.02em; }
.ys-gate p { color: var(--muted); }
.ys-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: ys-spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes ys-spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .ys-brand em { display: none; } .ys-mobile-guide { font-size: 13px; } }

/* Standalone plugin pages (fresh link, sign-up): inputs sit on the page, so they take the grey fill. */
.ys-gate .ys-field input, .ys-gate .ys-field select { border: 0; border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); font-size: 16px; }
.ys-gate .ys-field input:focus, .ys-gate .ys-field select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.ys-gate .ys-brand { margin-bottom: 8px; }

/* `.ys button { color: inherit }` outranks single-class button colors, so restate them. */
.ys button.ys-btn { color: var(--accent-ink); }
.ys button.ys-btn.is-ghost { color: var(--ink); }
.ys button.ys-btn.is-glow { color: var(--bg); }

/* Standalone pages: brand bar with sign-in icon */
.ys-topbar .ys-signin { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.ys-topbar .ys-signin:hover { color: var(--accent); }
.ys-gate { padding-top: 32px; }

.ys-help-text { display: block; }
