:root {
  --bg: #070b14;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, rgba(47, 211, 255, .09), transparent 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(255, 182, 39, .06), transparent 60%);
  --surface: #0d1424;
  --surface-2: #121b30;
  --surface-3: #18233d;
  --border: #1d2944;
  --border-2: #2a3a5e;
  --text: #e7eefb;
  --muted: #8b9bbb;
  --faint: #5d6d8f;

  --blue: #2fd3ff;
  --blue-2: #5b8cff;
  --blue-dim: rgba(47, 211, 255, .12);
  --blue-glow: 0 0 18px rgba(47, 211, 255, .45);
  --amber: #ffb627;
  --amber-dim: rgba(255, 182, 39, .13);
  --amber-glow: 0 0 18px rgba(255, 182, 39, .45);
  --red: #ff5d73;
  --red-dim: rgba(255, 93, 115, .13);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, .13);
  --violet: #a78bfa;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --topbar-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.has-modal { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.neon { color: var(--blue); text-shadow: var(--blue-glow); }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* ── Top bar ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 max(20px, env(safe-area-inset-left));
  background: rgba(7, 11, 20, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: inset 0 0 12px rgba(47, 211, 255, .15); }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.brand-mark circle, .brand-mark path:last-child { stroke: var(--blue); filter: drop-shadow(0 0 3px rgba(47, 211, 255, .8)); }
.brand-mark path:first-of-type { stroke: var(--amber); filter: drop-shadow(0 0 3px rgba(255, 182, 39, .8)); }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.brand-name b { font-weight: 800; color: var(--blue); }

.nav { display: flex; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--blue); background: var(--blue-dim); }
.nav-link .short { display: none; }
.nav-ext { color: var(--amber); }
.nav-ext:hover { color: var(--amber); background: var(--amber-dim); }
.nav-ext .ext-i { width: 13px; height: 13px; opacity: .7; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); white-space: nowrap; }
.badge .i { width: 14px; height: 14px; }
.badge.pro { color: var(--amber); border-color: rgba(255, 182, 39, .4); background: var(--amber-dim); box-shadow: 0 0 14px rgba(255, 182, 39, .15); }
.badge.free { color: var(--muted); }
.badge.free .up { color: var(--amber); margin-left: 2px; }
.badge.free:hover { border-color: var(--amber); }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); position: relative; transition: all .15s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm .i { width: 16px; height: 16px; }
.bell { border-color: var(--border); background: var(--surface); }
.bell .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: #1a1000; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: var(--amber-glow); }
.bell-wrap { position: relative; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(360px, calc(100vw - 32px)); max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell-list { list-style: none; margin: 0; padding: 6px; }
.bell-list li { display: flex; gap: 10px; padding: 10px; border-radius: 10px; }
.bell-list li:hover { background: var(--surface-2); }
.bell-list p { font-size: 13.5px; }
.bell-list time { font-size: 12px; color: var(--faint); }
.pip { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--blue); }
.t-soon .pip { background: var(--amber); }
.t-critical .pip { background: var(--red); }
.bell-empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.bell-empty .i { width: 28px; height: 28px; margin-bottom: 8px; }
.bell-empty span { font-size: 13px; color: var(--faint); }

/* ── Layout ─────────────────────────────── */
main { max-width: 1440px; margin: 0 auto; padding: 24px 20px 64px; outline: none; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 14px; }
.panel-title .i { color: var(--blue); }
.sub-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 20px 0 6px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { margin-top: 4px; }

/* ── Buttons & inputs ─────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: all .15s; }
.btn:hover { border-color: var(--blue); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.sm .i { width: 16px; height: 16px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.btn.primary { background: linear-gradient(180deg, #37dbff, #1bb8e6); border-color: transparent; color: #03131c; box-shadow: 0 0 0 1px rgba(47, 211, 255, .3), 0 6px 22px -6px rgba(47, 211, 255, .7); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.amber { background: linear-gradient(180deg, #ffc54d, #ffa90f); border-color: transparent; color: #1f1300; box-shadow: 0 6px 22px -6px rgba(255, 182, 39, .8); height: 46px; font-size: 15px; }
.btn.amber:hover { filter: brightness(1.06); }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--red); border-color: rgba(255, 93, 115, .35); }
.btn.danger-ghost:hover { border-color: var(--red); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; color: var(--blue); font-weight: 600; font-size: 13px; }
.link-btn .i { width: 15px; height: 15px; transition: transform .15s; }
.link-btn:hover .i { transform: translateX(3px); }
.link-strong { background: none; border: 0; padding: 0; font-weight: 600; color: var(--text); text-align: left; }
.link-strong:hover { color: var(--blue); }
.chip { border: 1px dashed var(--border-2); background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 11px; font-size: 13px; }
.chip:hover { color: var(--blue); border-color: var(--blue); border-style: solid; }

input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 10px 12px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=date], input[type=datetime-local] { color-scheme: dark; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9bbb' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
textarea { resize: vertical; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 3px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.seg button .i { width: 16px; height: 16px; }
.seg button.on { background: var(--surface-3); color: var(--blue); box-shadow: inset 0 0 0 1px var(--border-2); }

/* ── Stats ─────────────────────────────── */
.stats { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.stat-label .i { width: 15px; height: 15px; }
.stat-num { font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-family: var(--mono); line-height: 1; }
.stat-num small { font-size: 16px; color: var(--faint); font-weight: 600; margin-left: 2px; }
.stat-sub { font-size: 13px; color: var(--faint); }
.stat-next { background: linear-gradient(135deg, rgba(47, 211, 255, .08), transparent 55%), var(--surface); border-color: rgba(47, 211, 255, .25); }
.stat-next-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-amber { border-color: rgba(255, 182, 39, .35); background: linear-gradient(135deg, var(--amber-dim), transparent 60%), var(--surface); }
.stat-amber .stat-num { color: var(--amber); text-shadow: var(--amber-glow); }
.stat .bar { margin-top: auto; }
.slots { display: flex; gap: 6px; }
.slots span { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.slots span.on { background: var(--blue); box-shadow: var(--blue-glow); }

/* ── Countdown ─────────────────────────────── */
.cd { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); color: var(--blue); }
.cd-u { display: inline-flex; align-items: baseline; gap: 1px; }
.cd-u b { font-size: 22px; font-weight: 700; text-shadow: var(--blue-glow); font-variant-numeric: tabular-nums; }
.cd-u i { font-style: normal; font-size: 12px; opacity: .6; }
.cd-state { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-weight: 600; font-size: 14px; }
.cd.u-soon, .cd.u-critical { color: var(--amber); }
.cd.u-soon .cd-u b, .cd.u-critical .cd-u b { text-shadow: var(--amber-glow); }
.cd.u-critical { animation: pulse 1.4s ease-in-out infinite; }
.cd.u-passed { color: var(--red); }
.cd.u-done { color: var(--green); }
.cd-xl .cd-u b { font-size: 34px; }
.cd-xl .cd-u i { font-size: 15px; }
.cd-md .cd-u b { font-size: 26px; }
.cd-sm .cd-u b { font-size: 14px; text-shadow: none; }
.cd-sm .cd-u i { font-size: 10px; }
.cd-sm { gap: 4px; }
@keyframes pulse { 50% { opacity: .55; } }

/* ── Toolbar & search ─────────────────────────── */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 340px; min-width: 0; }
.search > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { height: 46px; padding-left: 42px !important; font-size: 15px; background: var(--surface) !important; border-radius: 12px !important; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 440px; overflow: auto; }
.sr { width: 100%; display: flex; align-items: center; gap: 12px; justify-content: space-between; text-align: left; background: transparent; border: 0; padding: 10px 12px; border-radius: 9px; }
.sr:hover, .sr.active { background: var(--surface-3); }
.sr:disabled { opacity: .45; cursor: default; }
.sr-main { display: flex; flex-direction: column; min-width: 0; }
.sr-main b { font-weight: 600; font-size: 14px; }
.sr-main span { font-size: 12.5px; color: var(--muted); }
.sr-pills { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sr-custom { justify-content: flex-start; color: var(--blue); border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; }
.sr-custom .sr-main b { color: var(--blue); }
.sr-foot { font-size: 11.5px; color: var(--faint); padding: 6px 12px 4px; }

.round-pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; white-space: nowrap; letter-spacing: .02em; }
.r-ED { color: var(--violet); background: rgba(167, 139, 250, .14); }
.r-EA { color: var(--blue); background: var(--blue-dim); }
.r-RD { color: #8fb0ff; background: rgba(91, 140, 255, .15); }
.r-ROLLING { color: var(--green); background: var(--green-dim); }

/* ── Board ─────────────────────────────── */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: rgba(13, 20, 36, .55); border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-width: 0; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 12px; flex-wrap: wrap; }
.col-head h2 { font-size: 14px; font-weight: 700; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 10px var(--rc); }
.col-count { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 7px; }
.col-hint { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.col-body { display: flex; flex-direction: column; gap: 12px; }
.col-empty { border: 1px dashed var(--border-2); background: transparent; border-radius: 12px; padding: 22px 12px; color: var(--faint); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.col-empty:hover { color: var(--blue); border-color: var(--blue); }

.card { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; transition: border-color .15s, transform .15s; }
.card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.card:hover { border-color: var(--border-2); }
.card.is-submitted { opacity: .72; }
.card-head { display: flex; gap: 8px; align-items: flex-start; }
.card-title { flex: 1; min-width: 0; }
.card-title h3 { font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; }
.card-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-actions { display: flex; gap: 2px; margin: -4px -6px 0 0; opacity: .7; }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }
.card .cd { padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.card .cd.u-soon, .card .cd.u-critical { border-color: rgba(255, 182, 39, .35); background: linear-gradient(90deg, var(--amber-dim), transparent), var(--bg); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta .i { width: 14px; height: 14px; }
.card-meta .target { color: var(--blue); }
.card-meta .late { color: var(--amber); }
.card-notes { font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 8px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }

.progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar { display: block; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; flex: none; }
.tbar .bar, .cl-progress .bar { flex: 1; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-2), var(--blue)); box-shadow: var(--blue-glow); transition: width .35s ease; }
.bar.full > span { background: linear-gradient(90deg, #22c08a, var(--green)); box-shadow: 0 0 12px rgba(52, 211, 153, .5); }
.bar.thin { height: 4px; }
.bar.big { height: 10px; border-radius: 6px; }
.tbar { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.tbar .mono { font-size: 12.5px; color: var(--muted); width: 38px; text-align: right; }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.mini-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-2); background: var(--bg); display: grid; place-items: center; padding: 0; color: transparent; flex: none; transition: all .15s; }
.check .i { width: 14px; height: 14px; stroke-width: 3; }
.check:hover { border-color: var(--blue); }
.check.on { background: var(--green); border-color: var(--green); color: #032116; box-shadow: 0 0 10px rgba(52, 211, 153, .45); }
.check.sm { width: 18px; height: 18px; border-radius: 5px; }

.status-select { width: auto !important; height: 32px; padding: 0 30px 0 10px !important; font-size: 12.5px; font-weight: 600; border-radius: 8px !important; background-color: var(--surface-3) !important; }
.st-in_progress { color: var(--blue); }
.st-ready { color: var(--amber); }
.st-submitted { color: var(--green); }
.st-not_started { color: var(--muted); }

/* ── Tables ─────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 10px; }
.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: rgba(24, 35, 61, .45); }
.data .sub { display: block; font-size: 12.5px; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; width: 1%; }

/* ── Checklist ─────────────────────────────── */
.cl-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.cl-side { display: flex; flex-direction: column; gap: 8px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.cl-pick { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.cl-pick:hover { border-color: var(--border-2); }
.cl-pick.on { border-color: var(--accent); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.cl-pick-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cl-pick-top b { font-size: 14px; font-weight: 600; }
.cl-pick-sub { font-size: 11.5px; color: var(--faint); }
.cl-panel { position: relative; overflow: hidden; }
.cl-panel::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.cl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cl-head h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.cl-head p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.cl-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cl-progress .mono { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cat-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cat-chip { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.cat-chip b { color: var(--text); margin-left: 4px; }
.cat-chip.ok { border-color: rgba(52, 211, 153, .35); color: var(--green); }
.cat-chip.ok b { color: var(--green); }

.items td { padding: 6px 8px; }
.items .c-check { width: 40px; padding-left: 12px; }
.items input[data-field=label] { min-width: 240px; }
.cell { border-color: transparent !important; background: transparent !important; padding: 8px !important; font-size: 14px; }
.cell:hover { border-color: var(--border-2) !important; }
.cell:focus { background: var(--bg) !important; border-color: var(--blue) !important; }
select.cell { padding-right: 28px !important; font-weight: 600; font-size: 13px; width: auto; min-width: 124px; }
input.cell[type=date] { min-width: 140px; font-size: 13px; }
.items tr.is-done input[data-field=label] { text-decoration: line-through; color: var(--muted); }
.items tr.is-na { opacity: .5; }
.st-i-done { color: var(--green); }
.st-i-progress { color: var(--amber); }
.st-i-todo { color: var(--muted); }
.cat-tag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.c-transcript { color: #8fb0ff; background: rgba(91, 140, 255, .14); }
.c-rec { color: var(--violet); background: rgba(167, 139, 250, .14); }
.c-essay { color: var(--blue); background: var(--blue-dim); }
.c-scores { color: var(--amber); background: var(--amber-dim); }
.c-finaid { color: var(--green); background: var(--green-dim); }

.add-item { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.add-item select { width: 170px; flex: none; }
.add-item input { flex: 1; min-width: 0; }
.quick-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 13px; }

.matrix td { white-space: nowrap; }
.m-cell { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px; }
.m-cell .i { width: 13px; height: 13px; stroke-width: 3; }
.m-ok { color: var(--green); background: var(--green-dim); }
.m-part { color: var(--amber); background: var(--amber-dim); }
.m-none { color: var(--muted); background: var(--surface-3); }
.m-na { color: var(--faint); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; }
.legend .m-cell { font-family: var(--font); font-weight: 600; }

/* ── Alerts / settings ─────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting b { font-weight: 600; font-size: 14.5px; }
.setting p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.setting.compact { padding: 9px 0; }
.switch { position: relative; flex: none; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--border-2); transition: all .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: all .2s; }
.switch input:checked + span { background: var(--blue-dim); border-color: var(--blue); }
.switch input:checked + span::after { left: 21px; background: var(--blue); box-shadow: var(--blue-glow); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.callout { display: flex; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 12px; background: linear-gradient(135deg, var(--blue-dim), transparent 70%); border: 1px solid rgba(47, 211, 255, .25); }
.callout > .i { color: var(--blue); margin-top: 2px; }
.callout p { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.tl-soon .tl-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.tl-critical .tl-dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.tl-deadline .tl-dot { background: transparent; border: 2px solid var(--blue); }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-body b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-body span { font-size: 12.5px; color: var(--muted); }
.tl-when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tl-state { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.s-sent { color: var(--green); background: var(--green-dim); }
.s-due { color: var(--amber); background: var(--amber-dim); }
.s-scheduled { color: var(--blue); background: var(--blue-dim); }
.muted-row { opacity: .5; }
.pad { padding: 12px 0; }
.mute-list { max-height: 320px; overflow: auto; }

.plan-panel { background: radial-gradient(400px 200px at 100% 0, rgba(255, 182, 39, .1), transparent 70%), var(--surface); }
.plan-panel p { margin-bottom: 14px; }
.feat { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.feat li { display: flex; gap: 8px; align-items: center; }
.feat .i { color: var(--green); }
.scholar-panel { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: radial-gradient(500px 200px at 100% 50%, rgba(255, 182, 39, .12), transparent 70%), var(--surface); border-color: rgba(255, 182, 39, .3); }
.scholar-panel .panel-title .i { color: var(--amber); }
.scholar-copy { flex: 1 1 420px; min-width: 0; }
.scholar-copy p + p { margin-top: 8px; }

/* ── Forms ─────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--faint); margin-left: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; }
.check-field { display: flex; align-items: center; gap: 8px; height: 42px; font-size: 14px; color: var(--muted); }
.check-field input { width: 18px; height: 18px; accent-color: var(--blue); }
.round-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.round-opt { position: relative; }
.round-opt input { position: absolute; opacity: 0; }
.round-opt span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--bg); cursor: pointer; height: 100%; transition: all .15s; }
.round-opt b { font-size: 13px; }
.round-opt small { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.round-opt input:checked + span { border-color: var(--rc); box-shadow: 0 0 0 1px var(--rc), 0 0 16px -4px var(--rc); background: var(--surface-2); }
.round-opt input:checked + span b { color: var(--rc); }
.round-opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); cursor: pointer; }
.swatch.auto span { width: auto; padding: 0 12px; border-radius: 15px; background: var(--surface-3); font-size: 12px; font-weight: 600; line-height: 26px; color: var(--muted); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text), 0 0 12px var(--sw, var(--blue)); }
.swatch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }
.hint { font-size: 12.5px; color: var(--faint); }
.form-error { color: var(--red); font-size: 13px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; text-transform: uppercase; }

/* ── Modal ─────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(3, 6, 12, .72); backdrop-filter: blur(4px); animation: fade .15s; }
.modal { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: 0 30px 80px -20px #000; animation: pop .18s ease-out; }
.modal.wide { width: min(700px, calc(100vw - 32px)); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.modal-head h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-head h2 .i { color: var(--amber); }
.modal-body { padding: 16px 20px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; padding-top: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }

.upgrade { display: flex; flex-direction: column; gap: 16px; }
.upgrade-reason { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--amber); background: var(--amber-dim); border: 1px solid rgba(255, 182, 39, .3); padding: 10px 12px; border-radius: 10px; }
.price { display: flex; align-items: center; gap: 14px; }
.price b { font-family: var(--mono); font-size: 48px; font-weight: 700; color: var(--amber); text-shadow: var(--amber-glow); letter-spacing: -.04em; line-height: 1; }
.price span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--muted); }
.compare th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.compare .i { width: 16px; height: 16px; color: var(--green); }
.compare .pro-col { color: var(--amber); font-weight: 600; background: rgba(255, 182, 39, .05); }
.redeem { border-top: 1px solid var(--border); padding-top: 16px; }

/* ── Empty ─────────────────────────────── */
.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--border-2); border-radius: 18px; background: rgba(13, 20, 36, .5); }
.empty-art { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--blue-dim); color: var(--blue); box-shadow: var(--blue-glow); }
.empty-art .i { width: 32px; height: 32px; }
.empty h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 20px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Toasts ─────────────────────────────── */
#toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; background: var(--surface-2); border: 1px solid var(--border-2); border-left: 3px solid var(--blue); border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: slide .25s ease-out; transition: opacity .35s, transform .35s; }
.toast > .i { color: var(--blue); margin-top: 1px; }
.toast span { flex: 1; }
.toast .icon-btn { width: 24px; height: 24px; margin: -2px -2px 0 0; }
.toast.t-soon { border-left-color: var(--amber); }
.toast.t-soon > .i { color: var(--amber); }
.toast.t-critical { border-left-color: var(--red); background: linear-gradient(90deg, var(--red-dim), transparent 60%), var(--surface-2); }
.toast.t-critical > .i { color: var(--red); }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

#print-root { display: none; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat-next { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
  .cl-layout { grid-template-columns: 1fr; }
  .cl-side { position: static; flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .cl-pick { flex: 0 0 220px; scroll-snap-align: start; }
  .nav-link .full { display: none; }
  .nav-link .short { display: inline; }
}
@media (max-width: 720px) {
  :root { --topbar-h: 56px; }
  body { font-size: 14.5px; }
  /* backdrop-filter would make the header the containing block for the fixed bottom nav */
  .topbar { gap: 12px; padding: 0 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(7, 11, 20, .97); }
  .brand-name { font-size: 16px; }
  .badge.free .up { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    justify-content: space-around; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(9, 14, 26, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .nav-link { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; flex: 1; }
  .nav-link .i { width: 20px; height: 20px; }
  .nav-ext .ext-i { display: none; }
  .scholar-panel .btn { width: 100%; }
  main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  #toast-root { bottom: calc(76px + env(safe-area-inset-bottom)); right: 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-num { font-size: 26px; }
  .cd-xl .cd-u b { font-size: 26px; }
  .board { grid-template-columns: 1fr; }
  .col-hint { display: none; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn span, .seg button span { display: none; }
  .toolbar-actions .btn { padding: 0 12px; }
  .toolbar-actions .seg { margin-right: auto; }
  .page-head h1 { font-size: 22px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid3 .check-field { height: auto; }
  .round-grid { grid-template-columns: 1fr 1fr; }
  .modal { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; animation: sheet .22s ease-out; }
  .modal.wide { width: 100%; }
  @keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
  .add-item { flex-wrap: wrap; }
  .add-item select { width: 100%; }
  .add-item .btn span { display: none; }

  /* Tables collapse into stacked cards */
  .data thead { display: none; }
  .data, .data tbody, .data tr, .data td { display: block; width: 100%; }
  .data tr { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
  .data td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .data td[data-label]::before { content: attr(data-label); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); flex: none; }
  .data td:first-child[data-label]::before { display: none; }
  .data td:first-child { display: block; padding-right: 76px; }
  .data .row-actions { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; }
  .data tbody tr:hover td { background: transparent; }
  .items tr { padding-left: 46px; }
  .items .c-check { position: absolute; left: 12px; top: 14px; width: auto; padding: 0; }
  .items td[data-label=Item]::before { display: none; }
  .items td[data-label=Item] { padding-right: 36px; }
  .items td .cell { text-align: right; }
  .items td[data-label=Item] .cell { text-align: left; font-weight: 600; }
  .items .cell { max-width: 62%; }
  .items td[data-label=Item] .cell { max-width: none; }
  .tbar { min-width: 0; flex: 1; max-width: 200px; }
  .table-wrap { overflow: visible; }
  .panel { padding: 16px; }
}
@media (max-width: 400px) {
  .brand-name { display: none; }
  .stats { grid-template-columns: 1fr; }
  .round-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Print / PDF (Pro) ─────────────────────────── */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; color: #111; font-size: 11pt; }
  .topbar, main, #modal-root, #toast-root, .skip { display: none !important; }
  #print-root { display: block; }
  .pr-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 16px; }
  .pr-head h1 { font-size: 20pt; }
  .pr-head p { color: #444; margin-top: 4px; }
  .pr-brand { font-weight: 800; color: #0a7fa3; }
  .pr-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 9.5pt; }
  .pr-table th, .pr-table td { border: 1px solid #bbb; padding: 5px 7px; text-align: left; vertical-align: top; }
  .pr-table th { background: #eef3f8; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .04em; }
  .pr-college { break-inside: avoid-page; margin-top: 18px; }
  .pr-college h2 { font-size: 13pt; margin-bottom: 6px; }
  .pr-college h2 span { font-size: 9.5pt; font-weight: 400; color: #555; margin-left: 6px; }
  .pr-notes { font-size: 9.5pt; color: #333; }
}
