:root {
  --bg: #15171b;
  --panel: #1e2127;
  --panel2: #262a31;
  --line: #343943;
  --text: #eef0f3;
  --muted: #a3a9b4;
  --lime: #c6ff1a;
  --lime-dim: #8fb816;
  --purple: #8b6cf0;
  --purple-dim: #3a2f63;
  --amber: #f2b33d;
  --red: #ff7a6b;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--lime); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(21,23,27,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 900; font-style: italic; letter-spacing: .02em; text-transform: uppercase; font-size: 18px; flex: 1; display: flex; align-items: center; gap: 8px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.brand b { color: var(--lime); }
.iconbtn { position: relative; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; font-size: 19px; }
.badge { position: absolute; top: -4px; right: -4px; background: var(--lime); color: #111; font-size: 11px; font-weight: 800; border-radius: 10px; padding: 1px 6px; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { font-style: italic; text-transform: uppercase; letter-spacing: .02em; line-height: 1.15; margin: 0 0 10px; }
h1 { font-size: 26px; font-weight: 900; }
h2 { font-size: 19px; font-weight: 850; margin-top: 22px; }
h3 { font-size: 15px; font-weight: 800; }
.sub { color: var(--muted); margin: -4px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* bottom nav */
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: #101215; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a { flex: 1; text-align: center; padding: 9px 2px 8px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; min-height: 56px; }
nav.tabs a span { display: block; font-size: 20px; line-height: 1.2; }
nav.tabs a.on { color: var(--lime); }
nav.tabs a .badge { position: static; display: inline-block; margin-left: 2px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.card.lime { border-color: var(--lime-dim); }
.card.purple { border-color: var(--purple); background: linear-gradient(0deg, var(--panel), #232036); }
.card.amber { border-color: var(--amber); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { main { max-width: 1100px; } .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } }

.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.pill.lime { background: var(--lime); color: #111; border-color: var(--lime); }
.pill.purple { background: var(--purple-dim); border-color: var(--purple); color: #e3dcff; }
.pill.amber { background: #3d2f12; border-color: var(--amber); color: #ffd98a; }
.pill.ok { background: #1f3a12; border-color: var(--lime-dim); color: var(--lime); }
.pill.grey { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-weight: 800; cursor: pointer; text-decoration: none; text-transform: uppercase; font-style: italic; letter-spacing: .02em; font-size: 14.5px; }
.btn.primary { background: var(--lime); color: #111; border-color: var(--lime); }
.btn.purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }

/* forms */
label.f { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 6px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #121418; font-size: 16px;
}
textarea { min-height: 120px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); font-weight: 800; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--lime); color: #111; border-color: var(--lime); }
.seg { display: flex; background: #121418; border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 800; cursor: pointer; font-size: 14px; }
.seg button[aria-pressed=true] { background: var(--purple); color: #fff; }

/* task card */
.task h3 { margin: 0; text-transform: none; font-style: normal; font-size: 17px; }
.task .meta { color: var(--muted); font-size: 13px; }
.check { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #121418; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 48px; cursor: pointer; margin-top: 8px; font-size: 15.5px; }
.check .box { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; font-weight: 900; color: #111; }
.check[aria-checked=true] { border-color: var(--lime-dim); }
.check[aria-checked=true] .box { background: var(--lime); border-color: var(--lime); }
.check[aria-checked=true] .lbl { color: var(--muted); text-decoration: line-through; }
.check[disabled] { cursor: default; }
.fixnote { background: #3d2f12; border: 1px solid var(--amber); border-radius: 10px; padding: 8px 12px; margin-top: 8px; color: #ffe2a6; }

/* progress */
.bar { height: 10px; background: #0f1114; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--lime); }
.bar.purple > i { background: var(--purple); }
.big { font-size: 40px; font-weight: 900; font-style: italic; line-height: 1; }
.timer { font-size: 54px; font-weight: 900; font-variant-numeric: tabular-nums; font-style: italic; color: var(--lime); text-align: center; letter-spacing: .02em; }

/* lists */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.day h3 { margin-top: 16px; color: var(--muted); }
.day.today h3 { color: var(--lime); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; }
table.t th { color: var(--muted); font-weight: 700; }

/* preview calendar */
.cal { display: grid; gap: 8px; }
.calday { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.calday .d { font-weight: 800; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.slotbtn { border: 1px solid var(--line); background: #121418; border-radius: 8px; padding: 6px 8px; margin: 3px 4px 3px 0; min-height: 36px; cursor: pointer; font-size: 13px; font-weight: 700; }
.slotbtn.c0 { border-color: var(--lime-dim); }
.slotbtn.c1 { border-color: var(--purple); }
.slotbtn.adult { color: var(--muted); }
.slotbtn.cover { border-color: var(--red); color: var(--red); }
.slotbtn.manual::after { content: " ✎"; }

/* toast & sheet */
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: #111; padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 50; max-width: 92vw; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
#toast.err { background: var(--red); color: #111; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border: 1px solid var(--line); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }

.hero { text-align: center; padding: 26px 8px 8px; }
.hero img { width: 96px; height: 96px; border-radius: 22px; }
.hero h1 { font-size: 30px; margin-top: 12px; }
.hero h1 b { color: var(--lime); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 800; letter-spacing: .08em; background: #121418; border: 1px dashed var(--lime-dim); border-radius: 10px; padding: 10px 14px; display: inline-block; user-select: all; }
.notice { background: var(--purple-dim); border: 1px solid var(--purple); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.warn { background: #3d2f12; border: 1px solid var(--amber); border-radius: 12px; padding: 10px 12px; margin: 8px 0; color: #ffe2a6; }
.err { color: var(--red); }

/* login card for printing */
.logincard { background: #fff; color: #111; border-radius: 14px; padding: 18px; border: 2px solid #111; }
.logincard h2 { color: #111; margin-top: 0; }
.logincard .code { color: #111; background: #f4f4f4; border-color: #111; }
@media print {
  body { background: #fff; padding: 0; }
  .top, nav.tabs, .noprint, #toast { display: none !important; }
  .sheet-bg { position: static; background: none; }
  .sheet { max-height: none; border: 0; background: #fff; }
  main { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: .4; } to { transform: none; opacity: 1; } }
