  :root {
    --bg: #F6EEDF;
    --bg-2: #EFE3CF;
    --surface: #FBF6EC;
    --chip: #EADFCB;
    --ink: #2B211B;
    --ink-soft: #7C6B5C;
    --line: #E1D3BB;
    --accent: #B9772F;
    --accent-ink: #FFF8EC;
    --voice: #7F6FA6;
    --voice-soft: #E4DEF0;
    --danger: #B0544F;
    --back: #E5D6BC;
    --glass: rgba(251,246,236,.74);
    --shadow: 0 1px 2px rgba(60,40,25,.08), 0 10px 28px rgba(60,40,25,.10);
    --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #1A1410;
      --bg-2: #221A14;
      --surface: #261D17;
      --chip: #33271F;
      --ink: #F2E7D7;
      --ink-soft: #A39180;
      --line: #3A2D24;
      --accent: #D39A55;
      --accent-ink: #1E140B;
      --voice: #B7A8DC;
      --voice-soft: #362F47;
      --danger: #E58A84;
      --back: #2B2119;
      --glass: rgba(38,29,23,.78);
      --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.35);
    }
  }
  :root[data-theme="dark"] {
    --bg: #1A1410;
    --bg-2: #221A14;
    --surface: #261D17;
    --chip: #33271F;
    --ink: #F2E7D7;
    --ink-soft: #A39180;
    --line: #3A2D24;
    --accent: #D39A55;
    --accent-ink: #1E140B;
    --voice: #B7A8DC;
    --voice-soft: #362F47;
    --danger: #E58A84;
    --back: #2B2119;
    --glass: rgba(38,29,23,.78);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.35);
  }
  html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
  *, *::before, *::after { box-sizing: border-box; }
  body {
    margin: 0; min-height: 100vh;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) fixed;
    color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  button, input, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* ---------- app shell ---------- */
  .stage { max-width: 760px; margin: 0 auto; padding: 22px 20px 130px; }
  .brand, .rail-foot { display: none; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0 16px calc(12px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
  .nav-pill {
    pointer-events: auto; max-width: 420px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow);
  }
  .nav button {
    background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 7px 4px 6px; border-radius: 999px; color: var(--ink-soft); font-size: .72rem; font-weight: 500;
  }
  .nav button[aria-current="page"] { color: var(--accent); background: rgba(185,119,47,.13); }
  .nav .add { color: var(--accent-ink); }
  .nav .add span.ic { background: var(--accent); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; margin-top: -2px; }
  .nav .add span.lbl { display: none; }

  @media (min-width: 920px) {
    body { display: grid; grid-template-columns: 236px 1fr; }
    .stage { max-width: 1080px; width: 100%; padding: 44px 48px 60px; }
    .brand { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 500; line-height: 1.05; padding: 6px 12px 28px; }
    .nav { position: sticky; top: 0; height: 100vh; padding: 28px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); pointer-events: auto; }
    .nav-pill { display: flex; flex-direction: column; gap: 4px; max-width: none; margin: 0; background: none; border: 0; box-shadow: none; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
    .nav button { flex-direction: row; gap: 12px; padding: 11px 14px; font-size: .98rem; justify-content: flex-start; border-radius: 12px; }
    .nav button:hover { background: var(--chip); }
    .nav .add { color: var(--ink); }
    .nav .add span.ic { background: var(--accent); color: var(--accent-ink); width: 26px; height: 26px; margin: 0; }
    .nav .add span.lbl { display: inline; }
    .rail-foot { display: block; margin-top: auto; padding: 12px; font-size: .8rem; color: var(--ink-soft); }
  }

  /* ---------- page header ---------- */
  .pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
  h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.3rem, 7vw, 3.4rem); line-height: 1; letter-spacing: -.015em; margin: 0; }
  .sub { color: var(--ink-soft); margin: 8px 0 0; font-size: .96rem; }
  .avatar {
    flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip);
    font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--accent);
  }
  h2 { font-family: var(--serif); font-weight: 500; font-size: 1.65rem; margin: 34px 0 14px; letter-spacing: -.005em; }
  .muted { color: var(--ink-soft); }

  .pill { border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 600; font-size: .92rem; background: var(--chip); color: var(--ink); }
  .pill.solid { background: var(--accent); color: var(--accent-ink); }
  .pill.ghost { background: transparent; border: 1px solid var(--line); }
  .pill:active { transform: scale(.97); }
  .pill.icon { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
  .pill.voice { background: var(--voice-soft); color: var(--voice); }

  /* ---------- home ---------- */
  .hscroll { display: flex; gap: 14px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hscroll::-webkit-scrollbar { display: none; }
  .rcard {
    flex: none; width: min(330px, 86%); scroll-snap-align: start; display: grid; grid-template-columns: 84px 1fr; gap: 16px;
    background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: var(--shadow);
  }
  .rc-cover { background: none; border: 0; padding: 0; text-align: left; align-self: start; }
  .rcard h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.1; margin: 0; }
  .rcard p { margin: 3px 0 10px; font-size: .86rem; color: var(--ink-soft); }
  .track { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; }
  .track > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
  .rc-meta { font-size: .78rem; color: var(--ink-soft); margin: 6px 0 12px; }
  .rc-actions { display: flex; gap: 8px; align-items: center; }
  .empty-card { background: var(--glass); border: 1px dashed var(--line); border-radius: 22px; padding: 26px; text-align: center; color: var(--ink-soft); }
  .empty-card p { font-family: var(--serif); font-size: 1.45rem; color: var(--ink); margin: 0 0 4px; }
  .empty-card span { display: block; margin-bottom: 16px; font-size: .92rem; }

  .cards { display: grid; gap: 14px; }
  @media (min-width: 700px) { .cards.two { grid-template-columns: 1fr 1fr; } .rcard { width: 360px; } }
  .panelcard { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); }
  .goal-row { display: flex; align-items: baseline; gap: 8px; }
  .goal-big { font-family: var(--serif); font-size: 2.9rem; font-weight: 500; line-height: 1; }
  .goal-in { width: 62px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-weight: 600; text-align: center; }
  .panelcard .track { margin: 14px 0 10px; height: 7px; }
  .stat-line { font-size: .86rem; color: var(--ink-soft); }

  .mini-note { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 13px 0; }
  .mini-note:first-child { border-top: 0; padding-top: 2px; }
  .mini-note .who { font-size: .8rem; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .mini-note .txt { margin: 3px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tag { font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-soft); }
  .tag.voice { background: var(--voice-soft); color: var(--voice); }
  .tag.label { background: rgba(185,119,47,.14); color: var(--accent); }

  /* ---------- shelf view ---------- */
  .tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 14px; padding: 0 20px 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; border: 0; background: var(--chip); color: var(--ink-soft); padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: .92rem; white-space: nowrap; }
  .tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
  .controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
  .search { flex: 1 1 200px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; }
  .search::placeholder { color: var(--ink-soft); }
  .seg { display: inline-flex; background: var(--chip); border-radius: 999px; padding: 3px; }
  .seg button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
  .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(60,40,25,.15); }

  .case {
    position: relative; background: var(--back); border-radius: 14px; margin: 0 -6px;
    border-left: 10px solid #4B3529; border-right: 10px solid #4B3529; border-top: 10px solid #4B3529;
    box-shadow: inset 0 0 40px rgba(60,40,25,.14), var(--shadow);
  }
  .srow { position: relative; }
  .sbooks { display: flex; align-items: flex-end; gap: 3px; padding: 0 12px; overflow: visible; }
  .sbooks.covers { gap: 14px; }
  .ledge { height: 16px; background: linear-gradient(#634a3b, #3B2A21); position: relative; box-shadow: 0 7px 10px rgba(40,25,15,.28); z-index: 1; }
  .ledge::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(255,255,255,.14); }
  .decor { margin-left: auto; flex: none; margin-right: 6px; }

  .spine {
    --lift: 0px; flex: none; width: var(--w); height: var(--h); border: 0; padding: 7px 0; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px;
    border-radius: 3px 3px 1px 1px; box-shadow: 2px 0 4px rgba(40,25,15,.22), inset -2px 0 3px rgba(0,0,0,.08), inset 2px 0 2px rgba(255,255,255,.12);
    transform: translateY(var(--lift)); transition: transform .22s ease;
  }
  .spine.reading { --lift: -16px; }
  .spine.reading::after { content: ""; position: absolute; top: 0; right: 6px; width: 7px; height: 20px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
  @media (hover: hover) { .spine:hover { --lift: -10px; } .spine.reading:hover { --lift: -22px; } }
  .band { width: 70%; height: 3px; background: currentColor; opacity: .3; flex: none; }
  .band.thick { height: 6px; opacity: .22; }
  .stitle { flex: 1; min-height: 0; writing-mode: vertical-rl; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.15; max-height: 100%; }
  .v0 .stitle { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.02rem; }
  .v1 .stitle { font-weight: 700; font-size: .78rem; letter-spacing: .03em; }
  .v2 .stitle { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; }
  .sauth { writing-mode: vertical-rl; font-size: .62rem; opacity: .75; max-height: 44px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: none; }

  .cvr-wrap { flex: none; background: none; border: 0; padding: 0; transform-origin: 50% 100%; transform: rotate(var(--tilt, 0deg)); transition: transform .22s ease; }
  @media (hover: hover) { .cvr-wrap:hover { transform: rotate(0deg) translateY(-6px); } }

  .cover {
    position: relative; overflow: hidden; border-radius: 3px 8px 8px 3px; padding: 11px 9px 9px 15px; text-align: left;
    display: flex; flex-direction: column; justify-content: space-between; box-shadow: 2px 3px 8px rgba(40,25,15,.3);
  }
  .cover::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: currentColor; opacity: .25; }
  .cover .t { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.15rem; line-height: 1.05; overflow-wrap: anywhere; }
  .cover .t.long { font-size: .98rem; }
  .cover .t.xlong { font-size: .84rem; }
  .cover .a { font-size: .66rem; opacity: .8; }
  .cover .cp { position: absolute; left: 15px; right: 9px; bottom: 6px; height: 3px; background: rgba(0,0,0,.18); border-radius: 3px; overflow: hidden; }
  .cover .cp i { display: block; height: 100%; background: currentColor; opacity: .75; }

  .case-empty { position: absolute; left: 0; right: 0; top: 54px; text-align: center; padding: 0 30px; z-index: 2; pointer-events: none; }
  .case-empty p { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; margin: 0 0 4px; }
  .case-empty span { display: block; color: var(--ink-soft); margin-bottom: 14px; font-size: .94rem; }
  .case-empty .pill { pointer-events: auto; }

  /* ---------- notes view ---------- */
  .chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 16px; padding: 0 20px 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); padding: 6px 14px; border-radius: 999px; font-size: .86rem; font-weight: 500; white-space: nowrap; }
  .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .feed .nitem { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
  .nhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: .82rem; color: var(--ink-soft); }
  .nhead .bk { background: none; border: 0; padding: 0; font-weight: 600; color: var(--ink); font-size: .9rem; text-align: left; }
  .ntext { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
  .ntext.quote { font-family: var(--serif); font-style: italic; font-size: 1.22rem; line-height: 1.35; padding-left: 12px; border-left: 2px solid var(--voice); }
  .ntext.none { color: var(--ink-soft); font-style: italic; }

  .player { display: flex; align-items: center; gap: 10px; }
  .play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--voice); color: var(--bg); display: grid; place-items: center; }
  .wave { flex: 1; height: 6px; border-radius: 6px; background: var(--voice-soft); overflow: hidden; }
  .wave i { display: block; height: 100%; width: 0; background: var(--voice); border-radius: 6px; }
  .dur { font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--ink-soft); min-width: 34px; text-align: right; }
  .speed { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 2px 9px; font-size: .78rem; font-weight: 600; color: var(--ink-soft); }

  .sync { margin-top: 40px; font-size: .8rem; color: var(--ink-soft); }
  .nothing { text-align: center; color: var(--ink-soft); padding: 40px 10px; }
  .nothing p { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin: 0 0 4px; }

  /* ---------- book sheet ---------- */
  .scrim { position: fixed; inset: 0; background: rgba(35,22,12,.42); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 10; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .sheet {
    position: fixed; z-index: 11; left: 0; right: 0; bottom: 0; top: 0; background: var(--surface); overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 22px calc(48px + env(safe-area-inset-bottom, 0px));
    transform: translateY(102%); visibility: hidden; transition: transform .32s cubic-bezier(.2,.75,.2,1), visibility 0s .32s;
  }
  .sheet.open { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.2,.75,.2,1), visibility 0s; }
  @media (min-width: 920px) {
    .sheet { left: auto; width: 540px; box-shadow: -14px 0 44px rgba(40,25,10,.2); transform: translateX(102%); padding: 28px 32px 56px; }
    .sheet.open { transform: none; }
  }
  .sheet-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
  .link { background: none; border: 0; padding: 6px 0; color: var(--ink-soft); font-size: .92rem; font-weight: 500; }
  .link:hover { color: var(--ink); }
  .link.danger { color: var(--ink-soft); }
  .link.danger.armed { color: var(--danger); font-weight: 700; }
  .head { display: grid; grid-template-columns: 86px 1fr; gap: 18px; align-items: start; margin-bottom: 24px; }
  .f-title, .f-author { width: 100%; background: transparent; border: 0; border-bottom: 1px solid transparent; padding: 2px 0; border-radius: 0; }
  .f-title { font-family: var(--serif); font-size: 1.95rem; font-weight: 600; line-height: 1.05; }
  .f-author { color: var(--ink-soft); margin-top: 4px; }
  .f-title:hover, .f-author:hover, .f-title:focus, .f-author:focus { border-bottom-color: var(--line); outline: none; }
  .f-title::placeholder, .f-author::placeholder { color: var(--ink-soft); opacity: .65; }
  .group { margin-bottom: 22px; }
  .lbl { display: block; font-size: .84rem; color: var(--ink-soft); margin-bottom: 8px; }
  .seg.full { display: flex; width: 100%; }
  .seg.full button { flex: 1; padding: 9px 6px; }
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .num { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
  .prog { height: 5px; border-radius: 5px; background: var(--line); margin-top: 12px; overflow: hidden; }
  .prog > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; transition: width .2s ease; }
  .rate { display: flex; gap: 12px; }
  .rate button { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--accent); background: none; padding: 0; }
  .rate button.on { background: var(--accent); }
  .swatches { display: flex; gap: 9px; flex-wrap: wrap; }
  .swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
  .swatches button[aria-pressed="true"] { border-color: var(--ink); }

  .recorder { background: var(--voice-soft); border-radius: 20px; padding: 18px; margin-bottom: 16px; }
  .rec-btn { width: 100%; border: 0; background: var(--voice); color: var(--bg); border-radius: 14px; padding: 13px 16px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; }
  .recorder .hint { margin: 10px 2px 0; font-size: .84rem; color: var(--ink-soft); }
  .recorder .warn { margin: 10px 2px 0; font-size: .86rem; color: var(--danger); }
  .live { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--voice); }
  .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1.3s ease-in-out infinite; }
  .live-text { margin: 12px 0 14px; min-height: 3.2em; max-height: 9em; overflow-y: auto; color: var(--ink); font-size: .96rem; }
  .live-text.empty { color: var(--ink-soft); font-style: italic; }
  .rec-actions { display: flex; gap: 10px; }
  .rec-actions .pill { flex: 1; }

  .composer { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 20px; }
  .composer textarea { width: 100%; min-height: 76px; resize: vertical; background: transparent; border: 0; padding: 0; outline: none; line-height: 1.5; }
  .composer textarea::placeholder { color: var(--ink-soft); }
  .crow { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
  .crow .num { width: 78px; padding: 6px 10px; border-radius: 10px; }
  .crow .lab { flex: 1 1 110px; min-width: 0; padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
  .crow .pill.solid { margin-left: auto; padding: 8px 18px; }
  .err { color: var(--danger); font-size: .84rem; margin: 8px 0 0; min-height: 1.2em; }

  .note { padding: 16px 0; border-top: 1px solid var(--line); }
  .note:first-child { border-top: 0; padding-top: 2px; }
  .nmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; font-size: .8rem; color: var(--ink-soft); }
  .nmeta .lab { width: 130px; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed var(--line); padding: 2px 0; font-size: .86rem; font-weight: 600; color: var(--accent); }
  .nmeta .lab::placeholder { color: var(--ink-soft); font-weight: 400; }
  .nmeta .lab:focus { outline: none; border-bottom-color: var(--accent); }
  .nmeta .sp { flex: 1; }
  .note textarea { width: 100%; background: transparent; border: 0; padding: 0; resize: none; overflow: hidden; line-height: 1.55; outline: none; }
  .note.quote textarea { font-family: var(--serif); font-style: italic; font-size: 1.22rem; line-height: 1.4; padding-left: 12px; border-left: 2px solid var(--voice); }
  .note .tagrow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
  .nope { color: var(--ink-soft); font-size: .94rem; }

  .cimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .cover.has-img::before { display: none; }
  .cover.has-img .t, .cover.has-img .a { visibility: hidden; }
  .cover .cp { z-index: 1; }
  .sugg { margin: -10px 0 18px; }
  .sugg:empty { margin: 0; }
  .sugg-box { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
  .sugg-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 11px 14px; }
  .sugg-item:first-child { border-top: 0; }
  .sugg-item:hover { background: var(--chip); }
  .sugg-item strong { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; display: block; line-height: 1.15; }
  .sugg-item span { font-size: .84rem; color: var(--ink-soft); }
  .sugg-note { padding: 12px 14px; font-size: .88rem; color: var(--ink-soft); }
  .sidelinks { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
  .sidelinks .link { font-size: .8rem; padding: 2px 0; }
  .swatch-custom { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); background: conic-gradient(#C98B84, #DDB54E, #9DB38F, #8FAFC4, #A79BC6, #C98B84); overflow: hidden; display: inline-block; cursor: pointer; }
  .swatch-custom.on { border-color: var(--ink); }
  .swatch-custom input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }
  .sec-label { display: flex; align-items: baseline; gap: 8px; padding: 16px 18px 8px; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
  .sec-label span { font-family: var(--sans); font-size: .8rem; font-weight: 500; color: var(--ink-soft); }
  .dq { width: 100%; min-height: 88px; resize: vertical; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; line-height: 1.5; outline: none; }
  .dq:focus { border-color: var(--accent); }
  .dq::placeholder { color: var(--ink-soft); }
  .exs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
  .check { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-soft); margin: 4px 0 14px; }
  .check input { width: 18px; height: 18px; accent-color: var(--accent); }
  .rec { display: grid; grid-template-columns: 62px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
  .rec:first-child { border-top: 0; padding-top: 2px; }
  .rec h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.1; margin: 0; }
  .rec .by { font-size: .84rem; color: var(--ink-soft); margin: 3px 0 7px; }
  .rec .why { margin: 8px 0 12px; font-size: .94rem; }
  .ai-note { font-size: .8rem; color: var(--ink-soft); margin: 14px 2px 0; }
  .thinking { display: flex; align-items: center; gap: 12px; padding: 18px 4px; color: var(--ink-soft); }
  .spin { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
  .scan-drop { display: block; width: 100%; border: 1.5px dashed var(--line); border-radius: 22px; background: var(--glass); padding: 30px 18px; text-align: center; color: var(--ink); }
  .scan-drop .ic { color: var(--accent); display: block; margin: 0 auto 6px; }
  .scan-drop strong { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
  .scan-drop span.tips { display: block; font-size: .88rem; color: var(--ink-soft); margin-top: 8px; }
  .scan-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); align-items: start; }
  .scan-item:first-child { border-top: 0; padding-top: 2px; }
  .scan-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 5px; }
  .si { width: 100%; background: transparent; border: 0; border-bottom: 1px solid transparent; padding: 2px 0; border-radius: 0; }
  .si:hover, .si:focus { border-bottom-color: var(--line); outline: none; }
  .si.t { font-family: var(--serif); font-size: 1.22rem; font-weight: 600; line-height: 1.15; }
  .si.a { color: var(--ink-soft); font-size: .9rem; }
  .sel { background: var(--chip); border: 0; border-radius: 999px; padding: 5px 12px; font-size: .84rem; font-weight: 600; margin-top: 6px; }
  .tag.warn { background: rgba(176,84,79,.14); color: var(--danger); }
  .dbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
  .err-line { color: var(--danger); font-size: .88rem; margin: 12px 2px 0; }
  .dt { border-top: 1px solid var(--line); padding: 4px 0; }
  .dt:last-of-type { border-bottom: 1px solid var(--line); }
  .dt > summary { list-style: none; cursor: pointer; padding: 14px 0; font-family: var(--serif); font-size: 1.4rem; font-weight: 500; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .dt > summary::-webkit-details-marker { display: none; }
  .dt > summary::after { content: "+"; font-family: var(--sans); font-size: 1.2rem; color: var(--ink-soft); }
  .dt[open] > summary::after { content: "–"; }
  .dsum { font-family: var(--sans); font-size: .8rem; font-weight: 500; color: var(--ink-soft); margin-left: auto; }
  .dbody { padding: 2px 0 18px; }
  .dupe { background: rgba(185,119,47,.14); color: var(--ink); border-radius: 14px; padding: 10px 14px; font-size: .9rem; margin: -6px 0 16px; }
  .dupe:empty { display: none; }
  .quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
  .trio { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
  .pace { font-size: .92rem; margin: 12px 0 0; }
  .pace:empty { display: none; }
  .timer { display: flex; align-items: center; gap: 12px; background: var(--voice-soft); border-radius: 16px; padding: 12px 14px; margin-top: 14px; flex-wrap: wrap; }
  .timer .clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.3rem; color: var(--voice); }
  .timer .pill { margin-left: auto; }
  .timer input { width: 90px; }
  .tagrow2 { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
  .tchip { display: inline-flex; align-items: center; gap: 6px; background: rgba(185,119,47,.14); color: var(--accent); font-weight: 600; font-size: .86rem; border-radius: 999px; padding: 5px 6px 5px 12px; border: 0; }
  .tchip i { font-style: normal; opacity: .7; width: 18px; height: 18px; display: grid; place-items: center; }
  .mchip { border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 999px; padding: 6px 13px; font-size: .86rem; font-weight: 500; }
  .mchip[aria-pressed="true"] { background: var(--voice); border-color: var(--voice); color: var(--bg); }
  .wrap-row { display: flex; gap: 8px; flex-wrap: wrap; }
  .own button { flex: 1 1 auto; }
  .fpanel { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 18px; }
  .fgroup { margin-bottom: 14px; }
  .fgroup:last-of-type { margin-bottom: 4px; }
  .badge { display: inline-block; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; margin-left: 6px; padding: 0 5px; }
  .pricerow { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; padding: 7px 0; border-top: 1px solid var(--line); }
  .pricerow:first-child { border-top: 0; }
  .good { color: #4F7F5F; font-weight: 600; }
  .ser { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 0; }
  .ser:first-child { border-top: 0; padding-top: 2px; }
  .ser strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; display: block; line-height: 1.15; }
  .ser span { font-size: .86rem; color: var(--ink-soft); display: block; }
  .own-banner { border-radius: 14px; padding: 12px 14px; margin: 14px 0; font-size: .94rem; }
  .own-banner.yes { background: rgba(79,127,95,.16); }
  .own-banner.maybe { background: rgba(185,119,47,.16); }
  .own-banner.no { background: var(--chip); }
  .bar-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .bar-row .scan-drop { padding: 22px 16px; }
  .typed { display: flex; gap: 8px; margin-top: 14px; }
  .typed input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; }
  .linkrow { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
  .linkrow a { display: inline-block; text-decoration: none; background: var(--chip); color: var(--ink); font-weight: 600; font-size: .9rem; border-radius: 999px; padding: 9px 16px; }
  .linkrow a.main { background: var(--accent); color: var(--accent-ink); }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.78); } }
  @keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .stage > .view { animation: settle .5s ease both; }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- standalone additions ---------- */
.auth { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); overflow-y: auto; }
.auth[hidden] { display: none; }
.auth-card { width: min(380px, 100%); display: grid; gap: 12px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .sub { margin: 0 0 8px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sh { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; margin: 0 0 10px; }
.sugg-item { display: flex; gap: 12px; align-items: center; }
.sugg-item .stext { min-width: 0; font-size: 1rem; color: var(--ink); }
.sthumb { flex: none; width: 38px; height: 56px; object-fit: cover; border-radius: 3px; background: var(--chip); display: block; }

#lock { z-index: 60; }
