/* Polymathus design system. Warm cream pages, big soft white cards, black pill controls,
   lime + deep green for progress, orange flourishes. Phone = app, tablet = side pill, desktop = web app. */
:root {
  --bg: #F3EEE6; --side: #EDE6DA; --card: #FFFFFF; --soft: #F7F3EC;
  --text: #141A17; --muted: #6A6F68; --faint: #9DA098;
  --line: rgba(20,26,23,.08); --hover: rgba(20,26,23,.06);
  --ink: #141A17; --ink-text: #FFFFFF;
  --lime: #D7F25C; --green: #0F5C45; --orange: #FF6B2C; --accent: #0F5C45; --danger: #D9503F;
  --hero: #141A17; --hero-text: #FFFFFF;
  --t-idea: #FFE9A8; --t-learning: #D5E6EE; --t-journal: #D9EEDB; --t-project: #E5DAF2; --t-hot: #FAD9C1; --t-gray: rgba(20,26,23,.07);
  --nav-bg: #141A17; --nav-ic: rgba(255,255,255,.62); --nav-act-bg: #FFFFFF; --nav-act-ic: #141A17;
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 12px 32px rgba(70,50,20,.07);
  --pop: 0 14px 34px rgba(20,26,23,.28);
  --display: "Bricolage Grotesque", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: Caveat, "Segoe Script", cursive;
  --hero-grad: linear-gradient(135deg, #1B2420 0%, #141A17 100%); --t-pink: #F5E0E9; --glow: none;
  --nav-h: 64px; --canvas: var(--bg); --nav-w: 0px; --content-w: 760px;
}
:root[data-theme="dark"] {
  --bg: #000000; --side: #000000; --card: #111111; --soft: #0A0A0A; --canvas: transparent;
  --text: #F5F5F7; --muted: #A3A3AB; --faint: #6B6B73;
  --line: rgba(255,255,255,.11); --hover: rgba(255,255,255,.08);
  --ink: #F5EDE0; --ink-text: #111111; --accent: #FF8A3D; --lime: #FF8A3D; --green: #6FD39B; --orange: #FF8A3D; --danger: #FF6B6B;
  --hero: #D95A0E; --hero-text: #FFFFFF; --hero-grad: linear-gradient(135deg, #E8650F 0%, #B8420C 100%);
  --t-idea: rgba(244,184,75,.22); --t-learning: rgba(86,154,255,.24); --t-journal: rgba(77,208,176,.2); --t-project: rgba(201,221,184,.22); --t-hot: rgba(255,122,89,.26); --t-pink: rgba(255,122,190,.24); --t-gray: rgba(255,255,255,.09);
  --nav-bg: #161616; --nav-ic: rgba(255,255,255,.55); --nav-act-bg: #F26B21; --nav-act-ic: #FFFFFF;
  --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 14px 34px rgba(0,0,0,.6);
  --pop: 0 16px 38px rgba(0,0,0,.7);
  --glow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000000; --side: #000000; --card: #111111; --soft: #0A0A0A; --canvas: transparent;
    --text: #F5F5F7; --muted: #A3A3AB; --faint: #6B6B73;
    --line: rgba(255,255,255,.11); --hover: rgba(255,255,255,.08);
  --ink: #F5EDE0; --ink-text: #111111; --accent: #FF8A3D; --lime: #FF8A3D; --green: #6FD39B; --orange: #FF8A3D; --danger: #FF6B6B;
    --hero: #D95A0E; --hero-text: #FFFFFF; --hero-grad: linear-gradient(135deg, #E8650F 0%, #B8420C 100%);
    --t-idea: rgba(244,184,75,.22); --t-learning: rgba(86,154,255,.24); --t-journal: rgba(77,208,176,.2); --t-project: rgba(201,221,184,.22); --t-hot: rgba(255,122,89,.26); --t-pink: rgba(255,122,190,.24); --t-gray: rgba(255,255,255,.09);
    --nav-bg: #161616; --nav-ic: rgba(255,255,255,.55); --nav-act-bg: #F26B21; --nav-act-ic: #FFFFFF;
    --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 14px 34px rgba(0,0,0,.6);
    --pop: 0 16px 38px rgba(0,0,0,.7);
    --glow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--glow), var(--bg); background-attachment: fixed; color: var(--text); font: 500 15.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.ic { width: 22px; height: 22px; flex: none; }

/* shell */
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--canvas); position: relative; }
@media (min-width: 520px) and (max-width: 599px) { .app { border-inline: 1px solid var(--line); } }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 20px 8px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); min-height: 68px; }
.top h1 { margin: 0; font: 700 34px/1.05 var(--display); letter-spacing: -.035em; }
.top .date { font-size: 13px; color: var(--muted); font-weight: 600; }
.top .mid { flex: 1; min-width: 0; text-align: center; font: 700 18px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .l { flex: 1; min-width: 0; }
main { padding: 6px 16px 140px; }
.has-composer main { padding-bottom: 214px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--text); flex: none; }
.iconbtn:active { transform: scale(.94); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--lime); color: #1A1230; display: grid; place-items: center; font: 800 17px var(--display); overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* floating nav pill (phone) */
.tabbar { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: min(340px, calc(100% - 32px)); height: var(--nav-h); border-radius: 999px; background: var(--nav-bg); box-shadow: var(--pop); padding: 8px; }
.tabbar .nav-in { display: flex; width: 100%; height: 100%; align-items: center; justify-content: space-between; }
.tabbar .brand, .tabbar .nav-gap, .tabbar .nav-settings, .tabbar span { display: none; }
.tabbar button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; color: var(--nav-ic); transition: background .2s, color .2s; }
.tabbar button.on { background: var(--nav-act-bg); color: var(--nav-act-ic); }
.tabbar .ic { width: 22px; height: 22px; }

/* composer */
.bars { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(14px + var(--nav-h) + 12px + env(safe-area-inset-bottom)); display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.bars > * { pointer-events: auto; }
.composer { width: min(480px, 100%); display: flex; align-items: flex-end; gap: 8px; padding: 7px; background: var(--card); border: 1px solid var(--line); border-radius: 32px; box-shadow: var(--pop); }
.composer[hidden] { display: none; }
.composer textarea { scrollbar-width: none; flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; resize: none; padding: 11px 4px; max-height: 120px; line-height: 1.4; }
.composer textarea::placeholder { color: var(--faint); }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; }
.round.soft { background: var(--hover); color: var(--text); }
.round.ink { background: var(--ink); color: var(--ink-text); }
.round[hidden] { display: none; }

/* type */
h2 { margin: 30px 4px 12px; font: 700 21px/1.2 var(--display); letter-spacing: -.025em; color: var(--text); }
h3 { margin: 0; font: 700 17px/1.25 var(--display); letter-spacing: -.02em; }
p { margin: 4px 0; }
.sub { color: var(--muted); } .small { font-size: 13.5px; } .faint { color: var(--faint); font-size: 12.5px; font-weight: 600; }
.script { font: 600 22px var(--script); color: var(--orange); letter-spacing: .2px; }
.big { font: 700 40px/1 var(--display); letter-spacing: -.04em; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.55; padding: 1px 10px; border-radius: 999px; background: var(--t-gray); color: var(--text); white-space: nowrap; }
.tag.idea { background: var(--t-idea); } .tag.learning { background: var(--t-learning); } .tag.journal { background: var(--t-journal); }
.tag.project { background: var(--t-project); } .tag.hot { background: var(--t-hot); }
.tag.click { cursor: pointer; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; flex-wrap: nowrap; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 18px 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.click { cursor: pointer; transition: transform .15s; } .card.click:active { transform: scale(.99); }
.card p { color: var(--muted); font-size: 14.5px; white-space: pre-wrap; }
.empty { color: var(--muted); text-align: center; padding: 30px 16px; border: 1.5px dashed var(--line); border-radius: 28px; }
.hello { padding: 4px 4px 14px; } .hello .sub { margin-top: 2px; }
.card.sel { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }

/* buttons + fields */
.btn { white-space: nowrap; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 14.5px; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.btn.accent { background: var(--lime); color: #141A17; border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); padding: 7px 10px; }
.btn.good { color: var(--green); } .btn.bad { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 17px 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--ink-text); font: 700 16.5px var(--display); letter-spacing: -.01em; box-shadow: var(--pop); }
.link { color: var(--text); font-weight: 700; background: none; border: 0; padding: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
input, select, textarea.field { width: 100%; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 13px 16px; font: inherit; outline: none; }
input:focus, select:focus, textarea.field:focus { border-color: var(--ink); }
textarea.field { min-height: 120px; resize: vertical; line-height: 1.55; }
label { display: block; font-size: 13.5px; font-weight: 700; color: var(--muted); margin: 18px 4px 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700; color: var(--muted); }
.pill.on { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.search { position: relative; margin: 6px 0 12px; }
.search .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.search input { padding-left: 46px; border-radius: 999px; box-shadow: var(--shadow); }

/* editorial home */
.datechip { display: inline-block; background: var(--ink); color: var(--ink-text); border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 700; }
.headline { font: 600 40px/1.04 var(--display); letter-spacing: -.04em; margin: 12px 0 6px; } .headline b { font-weight: 800; }

/* review card */
.flash { text-align: center; padding: 28px 22px 22px; }
.flash .q { font: 700 24px/1.2 var(--display); letter-spacing: -.03em; margin: 14px 0 20px; }
.flash .a { text-align: left; background: var(--soft); border-radius: 20px; padding: 14px 16px; margin-bottom: 16px; color: var(--muted); white-space: pre-wrap; }

/* stream timeline */
.tl { position: relative; padding-left: 42px; }
.tl::before { content: ""; position: absolute; left: 14px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line); }
.daypill { display: table; margin: 18px auto 12px; background: var(--hover); color: var(--muted); border-radius: 999px; padding: 3px 14px; font-size: 12.5px; font-weight: 700; position: relative; left: -21px; }
.entry { position: relative; margin-bottom: 12px; }
.rail { position: absolute; left: -42px; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.rail .ic { width: 17px; height: 17px; }
.ecard { background: var(--card); border-radius: 24px; padding: 15px 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.ecard h3 { font-size: 16px; margin-bottom: 4px; }
.ecard .body { color: var(--text); font-size: 15.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ecard .body.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.ecard .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.thought { border-left: 3px solid var(--orange); padding: 2px 0 2px 12px; margin: 10px 0; font-size: 14.5px; }
.q-list { margin: 10px 0 0; padding-left: 20px; } .q-list li { margin: 6px 0; }

/* journal widgets */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font: 800 28px/1.1 var(--display); letter-spacing: -.04em; } .stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; }
.cal i { aspect-ratio: 1; border-radius: 6px; background: var(--hover); } .cal i.on { background: var(--green); } .cal i.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.moods { display: flex; align-items: flex-end; gap: 5px; height: 56px; } .moods i { flex: 1; background: var(--hover); border-radius: 5px; min-height: 5px; } .moods i.on { background: var(--orange); }

/* recording */
.rec { position: fixed; inset: 0; height: 100dvh; z-index: 200; background: var(--bg); display: flex; justify-content: center; }
.rec[hidden], .sheet[hidden], .lock[hidden], .auth[hidden] { display: none; }
.rec .inner { width: min(480px, 100%); display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 24px calc(26px + env(safe-area-inset-bottom)); }
.rec .head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; font: 700 18px var(--display); text-align: center; }
.rec .stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 0; }
.wave { display: flex; align-items: center; gap: 12px; height: 150px; }
.wave i { width: 36px; border-radius: 18px; background: var(--hover); height: 44px; transition: height .3s; border: 1px solid var(--line); }
.wave i { background: var(--green); border-color: transparent; transition: height .08s linear; }
:root[data-theme="dark"] .wave i { background: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .wave i { background: var(--lime); } }
.wave i:nth-child(1) { --h: 76px; } .wave i:nth-child(2) { --h: 140px; animation-delay: .15s !important; } .wave i:nth-child(3) { --h: 104px; animation-delay: .3s !important; } .wave i:nth-child(4) { --h: 60px; animation-delay: .45s !important; }
@keyframes bob { 0%, 100% { height: 40px; } 50% { height: var(--h); } }
.timer { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer .ic { width: 14px; height: 14px; }
.live-text { max-height: 22vh; overflow: auto; width: 100%; text-align: center; color: var(--muted); font-size: 16px; padding: 0 4px; }
.rec .ctrl { display: flex; align-items: center; justify-content: space-between; }
.rec .ctrl .round { width: 58px; height: 58px; }
.rec .ctrl .pause { width: 100px; height: 58px; border-radius: 29px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; }

/* sheets, lock, sign-in */
.sheet, .lock { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,20,17,.5); }
.panel { width: min(480px, 100%); max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 32px 32px 0 0; padding: 22px 22px calc(24px + env(safe-area-inset-bottom)); }
.lock { align-items: center; background: var(--bg); }
.lock .panel { background: none; text-align: center; max-width: 320px; }
.lock input { text-align: center; font-size: 24px; letter-spacing: .4em; margin: 18px 0; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--nav-h) + 104px); transform: translateX(-50%); background: var(--ink); color: var(--ink-text); padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 700; max-width: 88vw; box-shadow: var(--pop); }
.ai-off { background: var(--t-idea); border-radius: 22px; padding: 13px 16px; margin: 0 0 12px; font-size: 14px; }
code { background: var(--hover); border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.auth { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--bg); padding: calc(24px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom)); overflow: auto; }
.auth { --serif: Fraunces, "Iowan Old Style", Georgia, serif; --sun: #F26B21; --paper: #FFF6EA; --night: #1B1B1B; overflow-x: hidden; }
.auth::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 60%; pointer-events: none; background: radial-gradient(480px 320px at 50% 20%, rgba(242,107,33,.20), transparent 70%); }
.authbox { position: relative; width: min(420px, 100%); margin: auto; display: flex; flex-direction: column; min-height: min(100%, 720px); }
.authart { position: relative; flex: 1; min-height: 290px; display: grid; place-items: center; margin-bottom: 4px; }
.cards { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cards .card-g { animation: bob 8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cards .card-g:nth-of-type(2n) { animation-duration: 10s; animation-delay: -4s; } .cards .card-g:nth-of-type(3n) { animation-duration: 12s; animation-delay: -7s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.cards .ct { font-family: var(--script); font-size: 17px; font-weight: 600; }
.cards .tie { stroke: var(--sun); stroke-width: 1.6; stroke-dasharray: 3 5; stroke-linecap: round; fill: none; opacity: .7; }
.cards .scr { stroke: var(--sun); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.authart .brandmark { position: relative; z-index: 2; width: 96px; height: 96px; border-radius: 28px; box-shadow: 0 16px 38px rgba(240,86,26,.38); }
.authbox h1 { margin: 8px 0 2px; font: 600 40px/1.04 var(--serif); letter-spacing: -.03em; }
.authbox .script { position: relative; display: inline-block; align-self: flex-start; margin: 0 0 10px; font-size: 28px; color: var(--sun); }
.authbox .script svg { position: absolute; left: 0; right: 0; bottom: -7px; width: 100%; height: 9px; }
.authbox .script path { stroke: var(--sun); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.authbox .sub { max-width: 34ch; }
.gbtn { margin: 18px 0 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 17px 22px; border: 0; border-radius: 16px; background: var(--night); color: var(--paper); font: 600 21px var(--script); box-shadow: 0 12px 28px rgba(0,0,0,.22); transition: transform .15s ease; }
:root[data-theme="dark"] .gbtn { background: var(--paper); color: var(--night); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .gbtn { background: var(--paper); color: var(--night); } }
.gbtn:active { transform: scale(.985); }
.gbtn .g { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; } .gbtn:disabled { opacity: .6; }
.gbtn .arr { color: var(--sun); width: 22px; height: 22px; }
.authfine { text-align: center; margin-inline: auto; }
@media (prefers-reduced-motion: reduce) { .cards .card-g { animation: none; } }
@media (max-height: 660px) { .authart { min-height: 200px; } .authbox h1 { font-size: 33px; } }

/* ---------- tablet: floating pill rail on the left ---------- */
@media (min-width: 600px) {
  :root { --nav-w: 104px; }
  .app { max-width: none; margin: 0; padding-left: var(--nav-w); }
  .top { padding-inline: max(28px, calc((100% - var(--content-w)) / 2 + 28px)); }
  main { max-width: var(--content-w); margin: 0 auto; padding: 6px 28px 160px; }
  .has-composer main { padding-bottom: 190px; }
  .tabbar { left: 18px; top: 50%; bottom: auto; transform: translateY(-50%); width: 68px; height: auto; padding: 10px 0; }
  .tabbar .nav-in { flex-direction: column; gap: 10px; justify-content: center; }
  .tabbar .nav-settings { display: grid; }
  .bars { left: var(--nav-w); bottom: 24px; padding: 0 24px; }
  .composer { width: min(var(--content-w), 100%); }
  .top [data-tab="settings"] { display: none; }
  .sheet { align-items: center; }
  .panel { width: min(540px, 92vw); border-radius: 32px; }
  .toast { bottom: 110px; }
  .lock .panel { width: 320px; }
  .headline { font-size: 52px; }
}

/* ---------- desktop: web-app sidebar ---------- */
@media (min-width: 1024px) {
  :root { --nav-w: 252px; --content-w: 860px; }
  .app.wide-split { --content-w: 1240px; }
  .top h1 { font-size: 38px; } .top { min-height: 88px; padding-top: 26px; }
  .tabbar { left: 0; top: 0; bottom: 0; transform: none; width: var(--nav-w); height: auto; border-radius: 0; background: var(--side); box-shadow: none; border-right: 1px solid var(--line); padding: 22px 14px 20px; }
  .tabbar .nav-in { gap: 4px; justify-content: flex-start; align-items: stretch; }
  .tabbar .brand { display: flex; align-items: center; gap: 12px; font: 800 20px var(--display); letter-spacing: -.03em; padding: 4px 12px 22px; color: var(--text); }
  .tabbar .brand img { width: 34px; height: 34px; border-radius: 10px; }
  .tabbar .nav-gap { display: block; flex: 1; }
  .tabbar span { display: inline; }
  .tabbar button { width: auto; height: 46px; border-radius: 16px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 14px; font-weight: 700; font-size: 15px; color: var(--muted); }
  .tabbar button:hover { background: var(--hover); }
  .tabbar button.on { background: var(--ink); color: var(--ink-text); }
  .tabbar .nav-settings { display: flex; }
  .headline { font-size: 60px; }
  .homegrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; align-items: start; }
  .homegrid .full { grid-column: 1 / -1; }
  .split { display: grid; grid-template-columns: 350px 1fr; gap: 36px; align-items: start; }
  .split .list { position: sticky; top: 96px; max-height: calc(100dvh - 120px); overflow: auto; padding: 0 6px 0 0; }
  .split .list h2:first-of-type { margin-top: 22px; }
  .split .detail .dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px; min-height: 48px; }
  .split .detail .dhead h2 { font-size: 30px; margin: 0; line-height: 1.2; }
  .tl { padding-left: 46px; } .rail { left: -46px; } .daypill { left: -23px; }
}
@media (hover: hover) { .card.click:hover { border-color: var(--faint); } .pill:hover { background: var(--soft); } .btn.primary:hover { filter: brightness(1.15); } }
.dmeta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 2px 4px 8px; }
.dmeta select { width: auto; min-width: 150px; padding: 8px 14px; font-size: 13.5px; font-weight: 700; border-radius: 999px; }
@media (min-width: 1024px) { .split .list .search { margin-top: 0; } .split .detail .dhead { min-height: 52px; } }

/* while recording: nothing floats over the recorder and the page behind cannot scroll */
body.recording { overflow: hidden; }
body.recording .bars, body.recording .tabbar, body.recording .toast { display: none !important; }
.spin { width: 64px; height: 64px; border-radius: 50%; border: 5px solid var(--hover); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- capture brain: kinds, hashtags, to-dos, details, map ---------- */
.tag.note { background: var(--t-project); } .tag.todo { background: var(--t-hot); } .tag.knowledge { background: var(--t-learning); }
.grow { flex: 1; min-width: 0; }
.cnt { font-size: 12px; font-weight: 700; opacity: .55; margin-left: 2px; }
.hashes { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.hash { font: 600 13px var(--font); color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.hash:hover, .hash.on { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
button.hash { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
button.hash.on { background: var(--ink); color: var(--ink-text); border-color: transparent; text-decoration: none; }
.hashrow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.hashrow::-webkit-scrollbar { display: none; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; }
.sechead h2 { margin-bottom: 12px; }

.ec { display: flex; align-items: flex-start; gap: 14px; }
.ec h3 { margin-top: 6px; } .ec p { margin: 4px 0 0; }
.card.done h3, .card.done p { text-decoration: line-through; opacity: .55; }
.chk { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--faint); background: none; display: grid; place-items: center; flex: none; color: transparent; padding: 0; margin-top: 2px; transition: background .15s, border-color .15s; }
.chk .ic { width: 16px; height: 16px; }
.chk.on { background: var(--lime); border-color: var(--lime); color: #141A17; }
.chk.big { width: 40px; height: 40px; margin: 0; }
.chk.big .ic { width: 20px; height: 20px; }
.rank { display: inline-block; font: 800 12px var(--display); background: var(--ink); color: var(--ink-text); border-radius: 999px; padding: 1px 9px; }
.due { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 10px; background: var(--t-gray); color: var(--text); white-space: nowrap; }
.due.overdue { background: #FFD6D0; color: #8E2A1C; }
.due.today { background: var(--t-hot); } .due.tomorrow { background: var(--t-idea); } .due.soon { background: var(--t-learning); } .due.ok { background: var(--t-journal); }
:root[data-theme="dark"] .due.overdue { background: #6E3630; color: #FFD6D0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .due.overdue { background: #6E3630; color: #FFD6D0; } }
.ecard.click { cursor: pointer; }

/* entry detail + capture receipt */
.detail-sheet { z-index: 62; }
.panel.tall { min-height: 62dvh; }
.dtitle { font: 700 28px/1.12 var(--display); letter-spacing: -.035em; margin: 8px 0 4px; }
.dbody { font-size: 16.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0 4px; }
.xref { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.todobox { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px; margin: 14px 0 4px; }
.todobox.done b { text-decoration: line-through; opacity: .6; }
.flashbox { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; margin-top: 14px; }
.flashbox b { display: block; margin-top: 2px; } .flashbox p { color: var(--muted); margin: 6px 0 0; }
.xlist { display: flex; flex-direction: column; gap: 8px; }
.xchip { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; font-weight: 700; }
.xchip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { margin-top: 20px; }
.insight { margin-top: 22px; background: var(--hero-grad); color: var(--hero-text); border-radius: 26px; padding: 18px 20px; }
.insight .ihead { display: flex; align-items: center; gap: 8px; font-family: var(--display); }
.insight .ic { color: var(--lime); width: 20px; height: 20px; }
.insight p { color: rgba(255,255,255,.88); font-size: 15.5px; line-height: 1.55; margin: 8px 0; }
.insight .btn.ghost { color: var(--lime); padding-left: 0; }
.deepbox { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
label.inline { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 10px 4px 0; }
label.inline input { width: 20px; height: 20px; flex: none; accent-color: var(--ink); }
.rcard { display: flex; align-items: flex-start; gap: 10px; }
.rcard h3 { margin-top: 6px; }
.insline { font-size: 13.5px !important; margin-top: 6px !important; }
.iconbtn.sm { width: 36px; height: 36px; box-shadow: none; background: var(--hover); }
.receipt { position: fixed; z-index: 24; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--nav-h) + 12px + 66px + env(safe-area-inset-bottom)); width: min(448px, calc(100% - 32px)); display: flex; align-items: center; gap: 8px; background: var(--hero-grad); color: var(--hero-text); border-radius: 24px; padding: 10px 10px 10px 18px; box-shadow: var(--pop); }
.receipt[hidden] { display: none; }
.receipt .rtext { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; opacity: .92; }
.receipt b { display: flex; align-items: center; gap: 6px; font: 700 15px var(--display); }
.receipt .ic { width: 17px; height: 17px; color: var(--lime); }
.receipt .btn.primary { background: var(--lime); color: #141A17; }
.receipt .iconbtn { background: rgba(255,255,255,.12); box-shadow: none; color: #fff; width: 38px; height: 38px; }
body.recording .receipt, body.recording .detail-sheet { display: none !important; }
#sendBtn.busy { opacity: .6; }

/* library browse panel (desktop) */
.navgroup { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 4px; }
.navrow { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; border-radius: 12px; padding: 9px 12px; font-weight: 700; color: var(--muted); }
.navrow:hover { background: var(--hover); }
.navrow.on { background: var(--ink); color: var(--ink-text); }
.navrow .cnt { opacity: .6; }
.pill .cnt { margin-left: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--faint); }
.dot.note { background: #A98BD6; } .dot.idea { background: #F2B84B; } .dot.todo { background: #FF6B2C; } .dot.journal { background: #4DAB9A; } .dot.knowledge { background: #3B82C4; }

/* map */
.mapbar { margin: 2px 0 10px; }
.mapbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.mapbar .pill { white-space: nowrap; display: inline-flex; align-items: center; }
.mapwrap { position: relative; height: calc(100dvh - 292px); min-height: 340px; border-radius: 28px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.mapwrap canvas { width: 100%; height: 100%; display: block; }
.mapzoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.mapzoom button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow); display: grid; place-items: center; }
.mapcard { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: 12px 14px; box-shadow: var(--pop); }
.mapcard[hidden] { display: none; }
.mapcard b { display: block; margin-top: 4px; }
.mapempty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--muted); pointer-events: none; }
.app.map-tab main { padding-bottom: 120px; }
@media (min-width: 600px) { .mapwrap { height: calc(100dvh - 250px); } .receipt { left: calc(50% + var(--nav-w) / 2); bottom: 98px; } .detail-sheet .panel { width: min(620px, 92vw); } }
@media (min-width: 1024px) { .mapwrap { height: calc(100dvh - 230px); } .app.map-tab { --content-w: 1240px; } }
@media (min-width: 1024px) { .split .hashrow { flex-wrap: wrap; overflow: visible; } .split .hashrow .hash { margin: 0; } }

/* ---------- v2: rewrite, English coach, prompts, spaces ---------- */
.tag.word { background: var(--t-pink); } .dot.word { background: #E07BA8; }
.due.assign { display: inline-flex; align-items: center; gap: 5px; background: var(--t-project); }

/* header: world switch */
.top .greet { min-width: 0; } .top .gname { font: 700 18px var(--display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpill { display: inline-flex; align-items: center; gap: 6px; max-width: 118px; flex: none; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); border-radius: 999px; padding: 8px 10px 8px 12px; font: 700 13px var(--font); }
.wpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.wpill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpill .ic { width: 15px; height: 15px; flex: none; opacity: .6; }
.wpill.sp { background: var(--t-project); border-color: transparent; } .wpill.sp i { background: var(--ink); }
.top { gap: 8px; }

/* avatars */
.mav { width: var(--s, 26px); height: var(--s, 26px); border-radius: 50%; background: var(--c, var(--ink)); color: #fff; display: inline-grid; place-items: center; font: 800 calc(var(--s, 26px) * .46) var(--display); flex: none; border: 2px solid var(--bg); }
.mav.more { background: var(--hover); color: var(--muted); }
.avstack { display: flex; } .avstack .mav { margin-left: -9px; } .avstack .mav:first-child { margin-left: 0; }
.spacehead { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
.brainprompt { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.brainprompt .bi { width: 44px; height: 44px; border-radius: 50%; background: var(--hero-grad); color: #fff; display: grid; place-items: center; flex: none; }
.brainprompt p { margin: 2px 0 0; }
.ec .mav { margin-top: 2px; }

/* the shared activity reads like a group chat */
.feed, .thread { display: flex; flex-direction: column; gap: 10px; }
.sys { text-align: center; font-size: 13px; color: var(--muted); padding: 2px 8px; } .sys b { color: var(--text); }
.bubrow { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.bubrow.mine { flex-direction: row-reverse; margin-left: auto; }
.bub { background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; padding: 10px 14px; font-size: 15px; box-shadow: var(--shadow); min-width: 0; overflow-wrap: anywhere; }
.bubrow.mine .bub { background: var(--ink); color: var(--ink-text); border-color: transparent; border-radius: 20px 20px 6px 20px; }
.bwho { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; } .bwho b { color: var(--text); } .bubrow.mine .bwho, .bubrow.mine .bwho b, .bubrow.mine .bwho .faint { color: inherit; opacity: .85; }
.bref { font-size: 12.5px; opacity: .75; margin-top: 4px; }
.bub .xref { color: inherit; }
.chg { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 6px; font-size: 14px; align-items: baseline; }
.chg .cf { grid-row: span 2; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .65; align-self: start; padding-top: 3px; }
.chg .cb { text-decoration: line-through; opacity: .6; } .chg .ca { font-weight: 700; }
.askrow { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.askrow input { border-radius: 999px; }
.askrow .round { width: 42px; height: 42px; }
.askrow.cmt { margin-top: 14px; }
.askans { margin-top: 12px; background: var(--soft); border-radius: 18px; padding: 12px 14px; } .askans p { color: var(--text) !important; margin: 0 0 6px; }

/* rewrite panel */
.rwbox { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.rwrow { display: flex; flex-direction: column; gap: 6px; } .rwrow .pill { padding: 6px 13px; font-size: 13.5px; }
.rwres { background: var(--soft); border-radius: 16px; padding: 12px 14px; white-space: pre-wrap; font-size: 15.5px; line-height: 1.55; }
.origlink { margin-top: 8px; display: inline-block; color: var(--muted); font-weight: 600; }
.origbox { margin-top: 8px; background: var(--soft); border-left: 3px solid var(--faint); border-radius: 10px 16px 16px 10px; padding: 10px 14px; color: var(--muted); font-size: 14.5px; } .origbox p { margin: 2px 0 8px; white-space: pre-wrap; }

/* English coach */
.english { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px; }
.eh { display: flex; align-items: center; gap: 8px; font: 700 14px var(--display); color: var(--muted); margin-bottom: 8px; } .eh .ic { width: 16px; height: 16px; color: var(--orange); }
.fix { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 6px 0; }
.fix .said { text-decoration: line-through; color: var(--muted); } .fix .arrow { color: var(--faint); } .fix b { color: var(--text); } .fix small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.wrow { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.wrow span { color: var(--muted); } .wrow small { display: block; color: var(--faint); font-size: 13px; font-style: italic; margin-top: 2px; }
.plus { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); display: grid; place-items: center; flex: none; } .plus .ic { width: 17px; height: 17px; }
.plus.on { background: var(--ink); color: var(--ink-text); border-color: transparent; }

/* journal prompts */
.prompts { padding-top: 6px; padding-bottom: 6px; }
.prow { padding: 12px 0; border-top: 1px solid var(--line); } .prow:first-child { border-top: 0; }
.prow p { color: var(--text) !important; font: 600 16.5px/1.4 var(--display); letter-spacing: -.01em; margin: 0 0 4px; }

/* the "more" menu on an entry */
.actions { position: relative; align-items: center; }
.actions .more { margin-left: auto; box-shadow: none; background: var(--hover); }
.menu { position: relative; margin: 10px 0 0 auto; width: min(260px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--pop); padding: 6px; display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: 10px; background: none; border: 0; border-radius: 14px; padding: 11px 12px; font-weight: 700; text-align: left; }
.menu button:hover { background: var(--hover); } .menu .bad { color: var(--danger); } .menu .ic { width: 18px; height: 18px; }

/* worlds + people sheets */
.wopt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 12px 14px; margin-top: 10px; }
.wopt.on { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); } .wopt small { display: block; color: var(--muted); }
.wav { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--ink); font: 800 17px var(--display); flex: none; } .wav .ic { color: var(--ink-text); }
.newspace { display: flex; gap: 8px; margin-top: 16px; } .newspace input { border-radius: 999px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); } .mrow:first-of-type { border-top: 0; }
.mrow small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; } .mrow select { width: auto; padding: 7px 10px; border-radius: 999px; font-size: 13.5px; }
.step { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; } .step .ic { width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.in-space .tabbar button.on { background: var(--nav-act-bg); }
.mapcard .grow b { display: block; }
@media (max-width: 380px) { .wpill { max-width: 92px; } }

/* opening splash: hides the app until sign-in and the first sync are settled, so nothing flashes */
.boot { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: var(--bg); transition: opacity .25s ease; }
.boot[hidden] { display: none; } .boot.out { opacity: 0; pointer-events: none; }
.boot .brandmark { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 14px 34px rgba(240,86,26,.35); animation: bootpulse 1.6s ease-in-out infinite; }
@keyframes bootpulse { 50% { transform: scale(.94); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .boot .brandmark { animation: none; } }

:root[data-theme="dark"] .auth::before { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .auth::before { display: none; } }
