:root {
  --bg: #0E0E13;
  --card: #18181F;
  --card-2: #141419;
  --raise: #1E1E28;
  --chip: #22222B;
  --line: #2C2C3A;
  --text: #F4F4F7;
  --text-2: #C9C9D6;
  --muted: #8E8EA0;
  --dim: #6A6A7C;
  --lime: #C8F542;
  --lilac: #B4A5FF;
  --lilac-2: #C3B8FF;
  --lilac-bg: #1F1B33;
  --pink: #FF6B9A;
  --pink-2: #FF8FB2;
  --orange: #FFA24C;
  --mint: #6EE7C5;
  --p-urgent: var(--pink);
  --p-high: var(--orange);
  --p-medium: var(--lilac);
  --p-low: var(--mint);
  --display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', 'Noto Sans Devanagari', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; scrollbar-width: none; -webkit-tap-highlight-color: transparent; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); }
body { overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--lime); }
input::placeholder { color: #7E7E90; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 520px; margin: 0 auto; height: 100%; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.boot { flex: 1; display: grid; place-items: center; }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-tile { width: 36px; height: 36px; border-radius: 12px; background: var(--lime); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; transform: rotate(-8deg); }
.logo-word { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.logo-word span { color: var(--lilac); }

/* ---------- shared ---------- */
.topbar { flex: none; padding: calc(16px + var(--safe-t)) 16px 6px 20px; display: flex; align-items: center; justify-content: space-between; }
.topbar.sub { padding-left: 16px; }
.topbar-title { font-size: 15px; font-weight: 700; color: #A3A3B5; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: none; background: transparent; color: #A3A3B5; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.solid { background: var(--raise); color: var(--text); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; }
.pad { padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.h1 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.sub-line { margin: 6px 0 0; font-size: 14px; color: #A3A3B5; }
.box { background: var(--card); border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.box h2, .label { margin: 0; font-size: 12px; font-weight: 700; color: #A3A3B5; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.p-urgent { background: var(--p-urgent); } .p-high { background: var(--p-high); } .p-medium { background: var(--p-medium); } .p-low { background: var(--p-low); }
.pill { height: 40px; padding: 0 14px; border-radius: 999px; border: none; background: var(--raise); color: var(--text-2); font-size: 13px; font-weight: 700; flex: none; display: inline-flex; align-items: center; gap: 6px; }
.pill.on { background: var(--lime); color: var(--bg); }
.btn { height: 52px; border-radius: 999px; border: none; padding: 0 20px; font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-lime { background: var(--lime); color: var(--bg); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.btn-pink { background: transparent; border: 1px solid #4A2635; color: var(--pink-2); font-weight: 700; }
.btn[disabled] { opacity: .5; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; color: #A3A3B5; }
.input { height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--raise); padding: 0 16px; font-size: 16px; color: var(--text); width: 100%; }
.input:focus { outline: 2px solid var(--lilac); outline-offset: 1px; }
.help { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }
.err { color: var(--pink-2); font-size: 13px; font-weight: 600; margin: 0; }

/* ---------- home ---------- */
.hero { flex: none; padding: 6px 20px 14px; display: flex; flex-direction: column; gap: 14px; }
.review-strip { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 16px; background: var(--lilac-bg); color: #E8E4FF; text-decoration: none; font-size: 14px; }
.review-strip b { color: var(--lilac-2); }
.legend { margin: 0; padding: 0; list-style: none; display: flex; gap: 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.tabsbar { flex: none; padding: 0 8px 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--raise); }
.tabs { display: flex; gap: 22px; }
.tab { height: 44px; padding: 0; border: none; background: transparent; font-size: 15px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.tab small { font-size: 12px; font-weight: 700; color: var(--dim); }
.tab.on { color: var(--text); font-weight: 800; box-shadow: inset 0 -2px 0 var(--lime); }
.tab.on small { color: var(--lime); }
.list { padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.card { position: relative; background: var(--card); border-radius: 22px; padding: 14px 12px 12px 22px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.card .bar { position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-right: 4px; text-decoration: none; color: var(--text); }
.card-title { font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; word-break: break-word; }
.date-chip { flex: none; margin-top: 2px; padding: 3px 8px; border-radius: 8px; background: var(--chip); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.card-row { display: flex; align-items: center; gap: 4px; }
.said { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act { width: 40px; height: 40px; flex: none; border-radius: 50%; border: none; background: var(--chip); color: #B9B9C8; display: inline-flex; align-items: center; justify-content: center; }
.act.cancel { color: var(--pink-2); }
.act.done { background: var(--lime); color: var(--bg); }
.card.closed { background: var(--card-2); opacity: .6; flex-direction: row; align-items: center; gap: 10px; padding-top: 12px; }
.card.closed .card-title { font-family: var(--body); font-size: 15px; font-weight: 600; color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.closed-meta { font-size: 12px; color: var(--muted); }
.st-done { color: var(--lime); font-weight: 700; } .st-dropped { color: #B9B9C8; font-weight: 700; } .st-cancelled { color: var(--pink-2); font-weight: 700; }
.card.thinking .said::after { content: ' · understanding…'; color: var(--lilac-2); }
.card.thinking { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.empty { margin: 40px 0; text-align: center; font-size: 14px; color: var(--muted); line-height: 1.6; }

.composer { flex: none; background: #15151C; border-radius: 28px 28px 0 0; padding: 12px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.compose-row { display: flex; align-items: center; gap: 8px; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
.compose-input { width: 100%; height: 52px; padding: 0 52px 0 18px; border: none; border-radius: 26px; background: var(--raise); font-size: 16px; color: var(--text); }
.compose-input:focus { outline: 2px solid var(--line); }
.send { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--line); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.mic { width: 52px; height: 52px; flex: none; border-radius: 50%; border: none; background: var(--lime); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.mic.live { background: var(--pink); transform: scale(1.08); }
.listening { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--lilac-bg); border-radius: 16px; font-size: 13px; }
.listening .rec { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); flex: none; animation: pulse 1s infinite; }
.listening span:nth-child(2) { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-note { margin: -2px 0 0 52px; font-size: 12px; }
.custom-time { display: flex; gap: 8px; align-items: center; }
.custom-time input { height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); color: var(--text); padding: 0 10px; color-scheme: dark; }

/* ---------- detail ---------- */
.meta-line { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.status-pill { font-weight: 700; color: var(--bg); background: var(--text); padding: 4px 10px; border-radius: 999px; }
.title-edit { font-family: var(--display); font-size: 26px; font-weight: 800; background: var(--raise); border: 1px solid var(--line); border-radius: 14px; color: var(--text); padding: 8px 12px; width: 100%; }
.next-card { background: var(--lilac); color: var(--bg); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.next-card .big { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.next-card p { margin: 0; font-size: 13px; font-weight: 500; }
.next-card .opt { height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--bg); background: transparent; color: var(--bg); font-size: 13px; font-weight: 700; }
.next-card .opt.first { background: var(--bg); color: var(--text); }
.next-card input { height: 44px; border-radius: 12px; border: none; padding: 0 10px; color-scheme: light; }
.grid2 { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; font-size: 14px; }
.grid2 dt { font-size: 12px; color: #A3A3B5; }
.grid2 dd { margin: 2px 0 0; font-weight: 700; }
.prio-btn { height: 44px; margin-left: -10px; padding: 0 10px; border: none; border-radius: 999px; background: transparent; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.prio-btn small { font-size: 12px; font-weight: 600; color: var(--muted); }
.history { margin: 0; padding: 0; list-style: none; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.history li:last-child { border-bottom: none; }
.history span:last-child { color: #A3A3B5; }
.actionbar { flex: none; background: #15151C; border-radius: 28px 28px 0 0; padding: 14px 16px calc(18px + var(--safe-b)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.actionbar.one { grid-template-columns: 1fr; }

/* ---------- review ---------- */
.progress { display: grid; gap: 6px; padding-top: 4px; }
.progress span { display: block; height: 6px; border-radius: 999px; background: var(--line); }
.progress span.done { background: var(--lime); } .progress span.cur { background: var(--lilac); }
.review-card { background: var(--card); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.review-card h2 { margin: 0; font-family: var(--display); font-size: 25px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.tag { font-weight: 700; background: #262632; color: var(--text-2); padding: 4px 10px; border-radius: 999px; }
.tag.pink { background: #3A1C29; color: var(--pink-2); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* ---------- settings ---------- */
.group { background: var(--card); border-radius: 22px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row p { margin: 0; }
.row .t { font-size: 15px; font-weight: 700; }
.row .s { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.switch { width: 52px; height: 32px; flex: none; border-radius: 999px; border: none; background: var(--line); padding: 3px; display: flex; justify-content: flex-start; }
.switch span { width: 26px; height: 26px; border-radius: 50%; background: var(--muted); display: block; }
.switch[aria-checked="true"] { background: var(--lime); justify-content: flex-end; }
.switch[aria-checked="true"] span { background: var(--bg); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.time-in { height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); color: var(--text); padding: 0 8px; color-scheme: dark; }
.select { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); color: var(--text); padding: 0 10px; }
.foot { font-size: 11px; color: var(--dim); text-align: center; margin: 8px 0 0; }

/* ---------- gate (setup/login) ---------- */
.gate { flex: 1; overflow-y: auto; padding: calc(40px + var(--safe-t)) 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.pin { letter-spacing: 0.5em; text-align: center; font-size: 24px; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); font-size: 14px; font-weight: 700; padding: 12px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 90vw; text-align: center; z-index: 10; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
