/* ==========================================================================
   Memo — web PWA shell stylesheet
   Tokens: paper #FAF9F6 · ink #1B1A17 · accent deep teal #0E7C6B (60-30-10)
   Type: system-ui stack only · body >=16px · lh 1.5-1.7 · scale 1.25
   Motion: ShinyText (hero headline), Magnet hooks (.btn-magnet via --mx/--my),
           ClickSpark hooks (.spark via --sx/--sy). prefers-reduced-motion
           respected throughout. No marquees anywhere.
   Micro-interaction JS contracts live in design-brief.md § Motion.
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------- */
:root {
  --paper: #FAF9F6;
  --paper-deep: #F1EEE7;          /* 30% secondary surfaces */
  --ink: #1B1A17;
  --ink-soft: #4A463E;            /* secondary text */
  --ink-faint: #8A8478;           /* hints, placeholders */
  --accent: #0E7C6B;             /* ONE accent: buttons, links, key highlights */
  --accent-dark: #0A5C50;        /* hover / active */
  --accent-wash: #E3F0ED;        /* tint for active tab, focus rings on paper */
  --line: #E2DED4;               /* hairlines */
  --card: #FFFFFF;               /* elevated surfaces */
  --danger: #A83A32;
  --warn: #8A6D1B;
  --radius: 14px;
  --radius-sm: 9px;
  --tap: 44px;                   /* minimum touch target */
  --shadow: 0 1px 2px rgba(27,26,23,.06), 0 8px 24px rgba(27,26,23,.07);
  --shadow-lg: 0 2px 4px rgba(27,26,23,.08), 0 16px 40px rgba(27,26,23,.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --lh: 1.6;
  --maxw: 1120px;
  --maxw-read: 68ch;             /* ~65-75 chars line length */
  /* Magnet hooks: main.js sets --mx/--my in px from cursor offset x 0.18 */
  --mx: 0px;
  --my: 0px;
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;               /* >=16px */
  line-height: var(--lh);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.6vw, 3.052rem); }          /* modular 1.25^3 */
h2 { font-size: clamp(1.563rem, 3.6vw, 1.953rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: var(--maxw-read); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--accent-wash); }

.wrap { width: min(var(--maxw), 100% - 2.5rem); margin-inline: auto; }

/* Skip link (a11y) */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem; border-radius: var(--radius-sm);
  transition: top .2s ease-out;
}
.skip-link:focus { top: .75rem; }

/* View switching: integrator toggles .is-hidden on #view-landing / #view-app */
.is-hidden { display: none !important; }

/* ---- Buttons: verb + outcome copy lives in index.html ------------------- */
.btn {
  --btn-bg: var(--card);
  --btn-fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--tap);
  padding: .75rem 1.5rem;
  font: inherit; font-weight: 600; font-size: 1rem;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s ease-out, background .18s ease-out,
              border-color .18s ease-out, box-shadow .18s ease-out;
  position: relative;            /* ClickSpark particles anchor here */
  overflow: hidden;
  touch-action: manipulation;
}
.btn:hover { border-color: var(--ink-faint); }
.btn:active { transform: scale(.97); }

.btn-primary {
  --btn-bg: var(--accent); --btn-fg: #fff;
  border-color: transparent; box-shadow: var(--shadow);
  /* Magnet hook: JS translates --mx/--my (~0.18 x cursor offset) */
  transform: translate(var(--mx), var(--my));
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: translate(var(--mx), var(--my)) scale(.97); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-wash); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-sm { min-height: 40px; padding: .5rem 1rem; font-size: .9375rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ClickSpark hook: main.js appends <span class="spark" style="--sx:…;--sy:…">;
   the burst is pure CSS. --sx/--sy = click point in px relative to button. */
.spark {
  position: absolute; left: var(--sx, 50%); top: var(--sy, 50%);
  width: 6px; height: 6px; margin: -3px; border-radius: 50%;
  background: var(--accent); pointer-events: none;
  animation: spark-fly .5s ease-out forwards;
}
.btn-primary .spark { background: #fff; }
@keyframes spark-fly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx, 0), var(--ty, -44px)) scale(.2); opacity: 0; }
}

/* ---- Header ------------------------------------------------------------- */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
#site-header .wrap {
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px; padding-block: .5rem;
}
#brand-name {
  font-weight: 800; font-size: 1.375rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
#brand-name .dot { color: var(--accent); }
.site-nav { display: none; gap: 1.5rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--ink); }
@media (min-width: 720px) { .site-nav { display: flex; } }
#site-header .btn { min-height: 44px; padding: .625rem 1.25rem; }

/* ---- Landing: hero ------------------------------------------------------ */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { max-width: 16ch; margin-bottom: .75rem; }

/* ShinyText: slow sheen across the headline, ~7s ease-in-out infinite.
   Applied by integrator as .shiny on a span inside h1. */
.shiny {
  background: linear-gradient(100deg, var(--ink) 40%, var(--accent) 50%, var(--ink) 60%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shiny-sheen 7s ease-in-out infinite;
}
@keyframes shiny-sheen {
  0%   { background-position: 120% 0; }
  55%  { background-position: -20% 0; }
  100% { background-position: -20% 0; }
}
.hero .subhead {
  font-size: 1.1875rem; color: var(--ink-soft);
  max-width: 52ch; margin-bottom: 2rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: .875rem; margin-bottom: 2rem; }
.hero-note { font-size: .9375rem; color: var(--ink-faint); margin-bottom: 2.5rem; }

/* Trust row: hand-feeling, NOT a marquee — static grid of plain-spoken claims */
.trust-row {
  display: grid; gap: .75rem; padding: 0; margin: 0; list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.trust-row li {
  display: flex; align-items: center; gap: .625rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .75rem .875rem;
  font-size: .9375rem; font-weight: 500; color: var(--ink-soft);
  box-shadow: var(--shadow);
}
.trust-row .tick {
  flex: none; width: 1.375rem; height: 1.375rem;
  border-radius: 50%; background: var(--accent-wash); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8125rem;
}

/* ---- Landing: sections -------------------------------------------------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--paper-deep); border-block: 1px solid var(--line); }
.section .lede { color: var(--ink-soft); font-size: 1.125rem; max-width: 56ch; }

.steps { display: grid; gap: 1rem; margin-top: 2rem; list-style: none; padding: 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1.125rem;
  margin-bottom: 1rem;
}
.step h3 { margin-bottom: .375rem; }
.step p { color: var(--ink-soft); margin: 0; font-size: 1rem; }

/* People differentiator */
.person-cards { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 760px) { .person-cards { grid-template-columns: repeat(2, 1fr); } }
.person-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.person-card h3 { display: flex; align-items: center; gap: .625rem; }
.person-card h3 .avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--accent-wash); color: var(--accent-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.person-card dl { margin: .75rem 0 0; display: grid; gap: .375rem; font-size: .9375rem; }
.person-card dt { font-weight: 700; color: var(--ink); }
.person-card dd { margin: 0; color: var(--ink-soft); }

/* Privacy checklist */
.privacy-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .875rem; }
.privacy-list li {
  display: flex; gap: .875rem; align-items: flex-start;
  font-size: 1.0625rem; max-width: 62ch;
}
.privacy-list .tick {
  flex: none; width: 1.625rem; height: 1.625rem; margin-top: .125rem;
  border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .875rem;
}

/* FAQ accordion */
.faq-list { margin-top: 1.5rem; display: grid; gap: .75rem; max-width: 720px; }
.faq-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-q {
  width: 100%; min-height: var(--tap);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9375rem 1.25rem; background: none; border: 0;
  font: inherit; font-weight: 600; font-size: 1.0625rem; color: var(--ink);
  text-align: left; cursor: pointer; touch-action: manipulation;
}
.faq-q .chev { flex: none; color: var(--accent); font-size: 1.25rem; transition: transform .25s ease-out; }
.faq-item.open .faq-q .chev { transform: rotate(45deg); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease-out;
}
.faq-a > div { padding: 0 1.25rem 1.25rem; color: var(--ink-soft); }
.faq-a > div > :last-child { margin-bottom: 0; }

/* Final CTA band */
.cta-band {
  background: var(--ink); color: var(--paper);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center; margin-block: clamp(2.5rem, 6vw, 4.5rem);
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: var(--paper); margin-bottom: .5rem; }
.cta-band p { color: #D8D4C9; margin: 0 auto 1.75rem; }
.cta-band .btn-primary { --btn-bg: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: center; justify-content: space-between;
  color: var(--ink-faint); font-size: .9375rem;
}
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---- App shell ---------------------------------------------------------- */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-topbar .wrap {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  min-height: 60px; padding-block: .5rem;
}
.app-topbar #brand-name { font-size: 1.25rem; }

#mode-badge {
  font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-dark); background: var(--accent-wash);
  border-radius: 999px; padding: .375rem .75rem;
}
#mode-badge.offline { color: var(--ink-soft); background: var(--paper-deep); }

#minutes-pill {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: .375rem .375rem .375rem .875rem;
  font-size: .875rem; font-weight: 600; color: var(--ink-soft);
  min-height: 44px;
}
#minutes-label b { color: var(--ink); }
#btn-upgrade { min-height: 36px; padding: .375rem .875rem; font-size: .875rem; }
#btn-mock { min-height: 44px; }

/* Tab bar: bottom tabs on mobile, left rail on desktop */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(27,26,23,.06);
}
.tabbar button {
  appearance: none; background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 60px; padding: .625rem .25rem calc(.625rem + env(safe-area-inset-bottom, 0));
  font: inherit; font-size: .75rem; font-weight: 600; color: var(--ink-faint);
  touch-action: manipulation;
}
.tabbar button .ico { font-size: 1.375rem; line-height: 1; }
.tabbar button[aria-selected="true"] { color: var(--accent-dark); }
.tabbar button[aria-selected="true"] .ico {
  background: var(--accent-wash); border-radius: 999px; padding: .25rem .75rem;
}
@media (min-width: 900px) {
  .tabbar {
    position: sticky; top: 60px; align-self: flex-start;
    grid-template-columns: 1fr; width: 200px;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .5rem; box-shadow: var(--shadow);
  }
  .tabbar button {
    flex-direction: row; gap: .75rem; min-height: var(--tap);
    padding: .75rem 1rem; border-radius: var(--radius-sm);
    font-size: .9375rem;
  }
  .tabbar button[aria-selected="true"] { background: var(--accent-wash); }
  .tabbar button[aria-selected="true"] .ico { background: none; padding: 0; }
}

.app-main {
  flex: 1; width: 100%;
  padding: 1.25rem 0 calc(84px + env(safe-area-inset-bottom, 0)); /* tabbar clearance */
}
@media (min-width: 900px) {
  .app-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
  .app-main { padding-bottom: 2rem; }
}
.panel { animation: panel-in .22s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }

/* ---- Notes panel -------------------------------------------------------- */
.notes-layout { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .notes-layout { grid-template-columns: 320px 1fr; align-items: start; }
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.panel-head h2 { margin: 0; }

#notes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .625rem; }
#notes-list button {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .875rem 1rem;
  font: inherit; color: var(--ink); touch-action: manipulation;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
  min-height: var(--tap);
}
#notes-list button:hover { border-color: var(--ink-faint); }
#notes-list button[aria-current="true"] {
  border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent);
}
#notes-list .n-title { font-weight: 600; display: block; }
#notes-list .n-snippet {
  display: block; font-size: .875rem; color: var(--ink-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .25rem;
}
/* Empty state: what + why + one CTA (copy in index.html) */
.empty {
  text-align: left; background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 2rem 1.5rem;
}
.empty h3 { margin-bottom: .375rem; }
.empty p { color: var(--ink-soft); margin-bottom: 1.25rem; }

.editor-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem;
}
#note-title {
  width: 100%; border: 0; border-bottom: 1px solid var(--line);
  font: inherit; font-size: 1.375rem; font-weight: 700; color: var(--ink);
  padding: .5rem 0; margin-bottom: .75rem; background: transparent;
}
#note-title:focus { outline: none; border-bottom-color: var(--accent); }
#editor {
  min-height: 220px; padding: .5rem 0;
  font-size: 1rem; line-height: var(--lh); color: var(--ink);
}
#editor:focus { outline: none; }
#editor:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-faint); pointer-events: none;
}
.editor-actions {
  display: flex; flex-wrap: wrap; gap: .625rem;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
#note-meta { font-size: .8125rem; color: var(--ink-faint); margin-top: .75rem; }

/* ---- Record panel ------------------------------------------------------- */
.record-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem; text-align: center; max-width: 560px; margin-inline: auto;
}
#rec-state {
  font-size: .875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .25rem;
}
#rec-state.live { color: var(--danger); }
#rec-time {
  font-size: 2.5rem; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; margin-bottom: 1.25rem;
}
#btn-record {
  width: 96px; height: 96px; border-radius: 50%;
  border: 0; cursor: pointer; background: var(--accent); color: #fff;
  font-size: 2rem; box-shadow: var(--shadow-lg);
  transition: transform .15s ease-out, background .15s ease-out;
  touch-action: manipulation;
}
#btn-record:hover { background: var(--accent-dark); }
#btn-record:active { transform: scale(.94); }
#btn-record.recording {
  background: var(--danger);
  animation: rec-pulse 1.6s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,58,50,.35); }
  50%      { box-shadow: 0 0 0 14px rgba(168,58,50,0); }
}
.record-alt {
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
  display: grid; gap: .75rem; justify-items: center;
}
.record-alt p { color: var(--ink-soft); font-size: .9375rem; margin: 0; }
/* Real file input stays visually hidden; #btn-upload triggers it */
#file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#btn-transcribe { margin-top: .5rem; }
#transcript-out {
  margin-top: 1.25rem; text-align: left;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem;
  font-size: 1rem; line-height: var(--lh); max-height: 320px; overflow: auto;
}
#transcript-out:empty { display: none; }
#btn-save-transcript { margin-top: .875rem; }

/* ---- People panel ------------------------------------------------------- */
.people-layout { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .people-layout { grid-template-columns: 300px 1fr; align-items: start; }
}
#people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .625rem; }
#people-list button {
  width: 100%; display: flex; align-items: center; gap: .875rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .75rem .875rem;
  font: inherit; color: var(--ink); cursor: pointer; text-align: left;
  min-height: 60px; touch-action: manipulation;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
#people-list button:hover { border-color: var(--ink-faint); }
#people-list button[aria-current="true"] {
  border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent);
}
#people-list .avatar {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--accent-wash); color: var(--accent-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.125rem;
}
#people-list .p-name { font-weight: 600; display: block; }
#people-list .p-sub { font-size: .8125rem; color: var(--ink-faint); display: block; }

#person-detail {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem;
}
#person-detail .pd-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
#person-detail .pd-head .avatar {
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.5rem;
}
#pd-name { margin: 0; font-size: 1.5rem; }
.pd-field { margin-bottom: 1rem; }
.pd-field h3 {
  font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); margin-bottom: .375rem;
}
.pd-field p, .pd-field ul { margin: 0; font-size: 1rem; color: var(--ink-soft); }
.pd-field ul { padding-left: 1.25rem; }
#pd-notes { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
#pd-notes li {
  font-size: .9375rem; color: var(--ink-soft);
  border-left: 3px solid var(--accent-wash); padding: .375rem .75rem;
}
#btn-link-person { margin-top: 1.25rem; }

/* ---- Ask panel ---------------------------------------------------------- */
.ask-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem; max-width: 720px; margin-inline: auto;
}
.ask-row { display: flex; gap: .625rem; }
#ask-input {
  flex: 1; min-height: var(--tap);
  font: inherit; font-size: 1rem; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .75rem 1rem; background: var(--paper);
}
#ask-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
#ask-out { margin-top: 1.25rem; font-size: 1rem; line-height: var(--lh); }
#ask-out:empty { display: none; }
#ask-out .answer {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem;
}
#ask-out .answer > :last-child { margin-bottom: 0; }
#ask-sources { margin: 1rem 0 0; padding: 0; list-style: none; font-size: .875rem; }
#ask-sources li { margin-bottom: .375rem; }
#ask-sources a { color: var(--accent); }

/* Skeleton (Doherty: never spinners — shimmer placeholders while AI thinks) */
.loading-skel {
  display: grid; gap: .625rem; margin-top: 1.25rem;
}
.loading-skel span {
  display: block; height: 1rem; border-radius: 6px;
  background: linear-gradient(90deg, var(--paper-deep) 25%, #E9E4D6 50%, var(--paper-deep) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}
@keyframes skel-shimmer { to { background-position: -200% 0; } }

/* ---- Upgrade modal ------------------------------------------------------ */
#modal-upgrade {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
#modal-upgrade .scrim {
  position: absolute; inset: 0; background: rgba(27,26,23,.5);
  animation: fade-in .2s ease-out;
}
#modal-upgrade .sheet {
  position: relative; background: var(--card); color: var(--ink);
  border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-lg);
  width: min(480px, 100%); padding: 2rem;
  animation: sheet-up .25s ease-out;
  max-height: calc(100dvh - 2rem); overflow: auto;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(16px); } }
#modal-upgrade h2 { margin-bottom: .5rem; }
#upgrade-note { color: var(--ink-soft); font-size: .9375rem; }
#modal-upgrade .sheet .btn { width: 100%; margin-top: 1rem; }
#btn-upgrade-close {
  position: absolute; top: .75rem; right: .75rem;
  width: var(--tap); height: var(--tap);
  border: 0; border-radius: 50%; background: var(--paper-deep);
  font-size: 1.25rem; cursor: pointer; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Toast -------------------------------------------------------------- */
/* Errors = what happened + why + how to fix (copy in index.html / main.js) */
#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%) translateY(16px);
  z-index: 180; max-width: min(560px, calc(100vw - 2rem));
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-sm); padding: .875rem 1.25rem;
  font-size: .9375rem; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease-out, transform .22s ease-out;
}
@media (min-width: 900px) { #toast { bottom: 2rem; } }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#toast.error { background: #3A1512; border-left: 4px solid var(--danger); }
#toast.success { border-left: 4px solid var(--accent); }

/* ---- Forms (shared) ----------------------------------------------------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .375rem; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%; min-height: var(--tap);
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .75rem 1rem;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}

/* ---- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .shiny {
    background: none; -webkit-text-fill-color: currentColor; color: inherit;
    animation: none;
  }
  #btn-record.recording { animation: none; border: 3px solid var(--danger); }
  .btn-primary { transform: none; }   /* Magnet off */
}
