
/* Layout: ivory canvas, compact header, one expandable capture card, one coral action, category tiles, icon tab bar. */
:root {
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #faf7f0;
  --surface: #ffffff;
  --ink: #242438;
  --muted: #5f5f78;
  --line: #e7e2d6;
  --coral: #ff715b;
  --on-coral: #242438;
  --lilac: #b9a5f4;
  --lime: #c8ef8d;
  --soft: #f1ecdf;
  --focus: #5b3fd0;
  --c-task: #b9a5f4;
  --c-event: #ffa090;
  --c-meeting: #c8ef8d;
  --c-reminder: #f6d878;
  --c-idea: #a6dbe9;
  --mo-head: #b9a5f4;
  --mo-line: #8f78e0;
  --mo-face: #fff4e2;
  --mo-ink: #242438;
  --tabs-h: 66px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17172a; --surface: #222239; --ink: #faf7f0; --muted: #b4b2c8; --line: #34344f; --soft: #2a2a45; --focus: #c4b5ff;
    --mo-face: #fff4e2; --mo-ink: #242438;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17172a; --surface: #222239; --ink: #faf7f0; --muted: #b4b2c8; --line: #34344f; --soft: #2a2a45; --focus: #c4b5ff;
  --mo-face: #fff4e2; --mo-ink: #242438;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 6px calc(var(--tabs-h) + 30px);
}
.wrap { max-width: 560px; margin: 0 auto; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 22px; font-weight: 600; }
p { margin: 0; }
.sub { color: var(--muted); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .mo-s { width: 30px; height: 34px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.4px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink); }
.iconbtn:hover { background: var(--soft); }
.iconbtn svg { width: 22px; height: 22px; }
.sync { font-size: 12px; color: var(--muted); text-align: right; }

.mo { display: block; width: 100%; height: 100%; overflow: visible; }
.mo .eye-open, .mo .eye-wide, .mo .eye-sort, .mo .eye-done, .mo .m-smile, .mo .m-o, .mo .m-grin, .mo .ear { display: none; }
.mo[data-state="ready"] .eye-open, .mo[data-state="ready"] .m-smile { display: inline; }
.mo[data-state="listening"] .eye-wide, .mo[data-state="listening"] .m-o, .mo[data-state="listening"] .ear { display: inline; }
.mo[data-state="sorting"] .eye-sort, .mo[data-state="sorting"] .m-smile { display: inline; }
.mo[data-state="done"] .eye-done, .mo[data-state="done"] .m-grin { display: inline; }
.mo .eye-open { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97.5% { transform: scaleY(0.1); } }
.mascot { transform-origin: 50% 92%; }
.mascot.sorting { animation: scrub 1s ease-in-out infinite; }
.mascot.done { animation: hop .5s ease-out 1; }
@keyframes scrub { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-10px); } 100% { transform: translateY(0); } }

.hero { display: flex; align-items: center; gap: 14px; padding-block: 14px 14px; }
.hero .mascot { width: 76px; height: 86px; flex: none; }
.hero p { margin-top: 4px; font-size: 18px; }

.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: 14px 16px 10px; box-shadow: 0 1px 0 rgba(36, 36, 56, .04); }
.card:focus-within { border-color: var(--ink); }
.card textarea { display: block; width: 100%; min-height: 64px; max-height: 46vh; border: 0; outline: 0; resize: none; background: transparent; font-size: 18px; line-height: 1.5; padding: 0; overflow-y: auto; }
.card textarea::placeholder { color: var(--muted); }
.card .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 6px; }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.mic { flex: none; height: 56px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--lilac); color: #242438; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.mic svg { width: 22px; height: 22px; }
.mop { flex: 1; height: 56px; border: 0; border-radius: 999px; background: var(--coral); color: var(--on-coral); font-weight: 700; font-size: 19px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.mop svg { width: 22px; height: 22px; }
.mop:hover, .mic:hover { filter: brightness(.96); }
.mop:active, .mic:active { transform: scale(.98); }
button[disabled] { opacity: .5; cursor: default; }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 12px; min-height: 22px; text-wrap: balance; }
.link { background: none; border: 0; color: var(--ink); font-weight: 500; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.tagline { text-align: center; color: var(--muted); font-size: 14px; margin-top: 4px; }

.btn { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; font-weight: 700; padding: 8px 16px; font-size: 15px; min-height: 40px; }
.btn:hover { border-color: var(--ink); }
.btn.fill { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.quiet { color: var(--muted); }
.btn.warn { color: #b3261e; border-color: #b3261e; }
:root[data-theme="dark"] .btn.warn { color: #ff9a8f; border-color: #ff9a8f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.warn { color: #ff9a8f; border-color: #ff9a8f; } }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.sect { margin: 26px 2px 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.tile { --tc: var(--c-idea); border: 0; border-radius: 18px; background: var(--tc); color: #242438; padding: 12px; text-align: left; display: grid; gap: 2px; min-height: 76px; align-content: space-between; }
.tile b { font-family: var(--font-display); font-size: 26px; line-height: 1; }
.tile span { font-weight: 700; font-size: 14px; }

.result { margin-top: 22px; }
.rhead { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.rhead .mascot { width: 44px; height: 50px; flex: none; }
.rhead h2 { font-size: 20px; }
.rhead p { color: var(--muted); font-size: 14px; }
.grp { margin-top: 18px; }
.grp h3 { font-size: 15px; font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { --tc: var(--ink); flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; font-weight: 700; padding: 6px 14px; font-size: 15px; min-height: 40px; display: flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--tc); border-color: var(--ink); color: #242438; }
.chip[aria-pressed="true"]::before { content: "\2713"; font-weight: 700; }
.chip:not([data-all])[aria-pressed="false"]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tc); border: 1px solid var(--ink); }
.chip[data-all][aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.item { --tc: var(--c-idea); display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px 12px 12px 8px; margin-bottom: 10px; position: relative; }
.item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 0 4px 4px 0; background: var(--tc); }
.item.done .title { text-decoration: line-through; color: var(--muted); }
.check { flex: none; width: 32px; height: 32px; margin: 2px 0 0 6px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; display: grid; place-items: center; padding: 0; color: #242438; }
.item.done .check { background: var(--lime); }
.body { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; min-height: 40px; }
.title { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.pill { background: var(--tc); color: #242438; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.pill.soft { background: var(--soft); color: var(--ink); }
.pill.nudge { background: transparent; color: var(--ink); border: 1.5px dashed var(--muted); }
.step { margin-top: 8px; background: var(--soft); border-radius: 12px; padding: 7px 10px; font-size: 14px; }
.cal { flex: none; border: 1.5px solid var(--line); background: transparent; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); padding: 0; }
.cal svg { width: 20px; height: 20px; }

.start { background: var(--ink); color: var(--bg); border-radius: 22px; padding: 18px; margin: 4px 0 6px; }
.start .k { font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: var(--lime); }
.start .t { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; margin: 6px 0 8px; overflow-wrap: anywhere; }
.start .s { font-size: 15px; margin-bottom: 14px; opacity: .9; }
.start .row { margin-top: 0; }
.start .btn { background: var(--lime); color: #242438; border-color: var(--lime); }
.start .btn.quiet { background: transparent; color: var(--bg); border-color: rgba(250, 247, 240, .4); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .mascot { width: 84px; height: 95px; margin: 0 auto 10px; }
.empty .row { justify-content: center; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1.5px solid var(--line);
  padding: 6px max(10px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
.tabs .in { max-width: 560px; margin: 0 auto; display: flex; gap: 6px; }
.tab { position: relative; flex: 1; border: 0; background: transparent; border-radius: 16px; padding: 6px 4px 5px; font-weight: 500; font-size: 13px; color: var(--muted); display: grid; justify-items: center; gap: 1px; min-height: 54px; }
.tab svg { width: 24px; height: 24px; }
.tab .ico-on { display: none; }
.tab[aria-current="page"] { background: var(--lilac); color: #242438; font-weight: 700; }
.tab[aria-current="page"] .ico-on { display: block; }
.tab[aria-current="page"] .ico-off { display: none; }
.tab[aria-current="page"]::after { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 3px; background: #242438; }
.badge { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 20px; height: 20px; background: var(--lime); color: #242438; border: 1.5px solid #242438; border-radius: 999px; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

dialog { border: 1.5px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); padding: 20px; width: min(520px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(23, 23, 42, .55); }
dialog h2 { margin-bottom: 4px; }
dialog p { color: var(--muted); font-size: 15px; margin-top: 8px; }
dialog label { display: block; font-weight: 700; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
dialog input { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); padding: 10px 12px; min-height: 44px; }
dialog .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog .btns { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
dialog .btns .grow { flex: 1; }
.types { display: flex; flex-wrap: wrap; gap: 8px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 18px; font-weight: 500; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100vw - 32px); display: flex; gap: 14px; align-items: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { background: none; border: 0; padding: 0; color: var(--lime); font-weight: 700; text-decoration: underline; }
.fly { animation: land .45s ease-out both; }
@keyframes land { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.iconbtn.rec{}
.mic.on { background: var(--coral); animation: pulse 1.6s ease-in-out infinite; }
.mic.starting { opacity: .7; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,113,91,.5); } 50% { box-shadow: 0 0 0 10px rgba(255,113,91,0); } }
.hint.err { color: #b3261e; }
.hint.live { color: var(--ink); font-weight: 700; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.sets { display:grid; gap:10px; margin-top:12px; }
.sets .btn { text-align:left; border-radius:16px; }
body { padding-top: max(6px, env(safe-area-inset-top, 0px)); }
.center { text-align: center; }
.badge[hidden] { display: none; }
