/* Midnight Aurora — deep navy, electric blue, cyan, violet, mint & amber accents */
:root, [data-theme="dark"] {
  --bg: #060a16; --card: rgba(15, 23, 44, .72); --card-solid: #0e1630; --raise: #151f3d; --sheet: #0b1226;
  --line: rgba(143, 163, 255, .14); --line2: rgba(143, 163, 255, .3); --track: rgba(143, 163, 255, .13);
  --text: #eaf0ff; --muted: #92a0c6; --faint: #5f6d94;
  --blue: #5b8cff; --cyan: #22d3ee; --violet: #9b6bff; --mint: #34e0a1; --amber: #fbbf24; --rose: #fb7185;
  --shadow: 0 22px 50px -24px rgba(0, 0, 0, .8); --nav: rgba(8, 13, 28, .86);
  --g1: rgba(91, 140, 255, .26); --g2: rgba(155, 107, 255, .2); --g3: rgba(34, 211, 238, .14);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef2fc; --card: rgba(255, 255, 255, .86); --card-solid: #fff; --raise: #e9eefb; --sheet: #f6f8ff;
  --line: rgba(40, 60, 130, .12); --line2: rgba(40, 60, 130, .26); --track: rgba(40, 60, 130, .1);
  --text: #101a36; --muted: #51608a; --faint: #8794b8;
  --blue: #3567f0; --cyan: #0897b5; --violet: #7442f5; --mint: #0aa876; --amber: #c98300; --rose: #dc3b57;
  --shadow: 0 18px 40px -22px rgba(30, 50, 120, .4); --nav: rgba(255, 255, 255, .9);
  --g1: rgba(91, 140, 255, .22); --g2: rgba(155, 107, 255, .14); --g3: rgba(34, 211, 238, .14);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--text); font: 15px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(900px 520px at 8% -8%, var(--g1), transparent 60%), radial-gradient(760px 480px at 100% 0%, var(--g2), transparent 60%), radial-gradient(700px 520px at 50% 115%, var(--g3), transparent 60%);
  background-attachment: fixed;
}
body.noscroll { overflow: hidden; }
h1, h2, h3, h4, .hero b, .stat b, .calc-i b, .mini-stats b, .rt { font-family: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif; letter-spacing: -.01em; }
h1 { font-size: 26px; margin: 0; line-height: 1.15; }
h2 { font-size: 21px; margin: 0; } h3 { font-size: 17px; margin: 0; } h4 { font-size: 15px; margin: 0; }
p { margin: 0; } button { font: inherit; color: inherit; cursor: pointer; } input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); } .fine { font-size: 12.5px; margin: 8px 0; } .grow { flex: 1; min-width: 0; }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 10px; }

/* ---------- layout ---------- */
.shell { min-height: 100dvh; }
.side { display: none; }
.main { width: 100%; max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 16px calc(104px + env(safe-area-inset-bottom)); }
.bnav {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 7px; border-radius: 24px;
  background: var(--nav); border: 1px solid var(--line2); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.nav-i { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 7px; border: 0; border-radius: 18px; background: none; color: var(--muted); font-size: 11.5px; font-weight: 600; transition: background .2s, color .2s; }
.nav-i.on { color: var(--text); background: linear-gradient(135deg, rgba(91, 140, 255, .28), rgba(155, 107, 255, .26)); box-shadow: inset 0 0 0 1px var(--line2); }
.nav-i.on .ic { color: var(--cyan); }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hello { font-size: 22px; } .top p { font-size: 13px; }
.today-line { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; margin: -4px 0 14px 2px; }
.homegrid { display: grid; gap: 14px; } .homegrid > section { display: grid; gap: 14px; align-content: start; min-width: 0; }
.sec { margin: 24px 2px 12px; font-size: 18px; } .sec2 { margin: 18px 0 8px; color: var(--muted); font-size: 13px; font-weight: 700; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100dvh; padding: 26px 18px; border-right: 1px solid var(--line); background: rgba(6, 10, 22, .35); backdrop-filter: blur(14px); }
  [data-theme="light"] .side { background: rgba(255, 255, 255, .5); }
  .main { max-width: 1120px; padding: 34px 38px 60px; } .bnav { display: none; }
  .homegrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 18px; } .homegrid > section { gap: 18px; }
  .brand { display: flex; gap: 12px; align-items: center; } .brand b { display: block; font-family: 'Space Grotesk'; font-size: 18px; } .brand span { font-size: 12px; color: var(--muted); }
  .side-nav { display: grid; gap: 4px; }
  .side .nav-i { flex-direction: row; gap: 12px; padding: 12px 14px; font-size: 14.5px; justify-content: flex-start; }
  .me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
  .me b { display: block; font-size: 14px; } .me span { font-size: 12px; color: var(--muted); }
  .subgrid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(140deg, rgba(91, 140, 255, .2), rgba(155, 107, 255, .12) 55%, rgba(34, 211, 238, .1)), var(--card); border-color: var(--line2); }
.hero-ring { flex: none; margin: 0 auto; } .hero-side { flex: 1; min-width: 200px; display: grid; gap: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; } .quick { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--raise); border: 1px solid var(--line); color: var(--muted); }
.pill.good { color: var(--mint); border-color: rgba(52, 224, 161, .4); background: rgba(52, 224, 161, .1); }
.pill.warn { color: var(--amber); border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); }
.pill.bad { color: var(--rose); border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .1); }
.pillrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { position: relative; overflow: hidden; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 1px; }
.stat::after { content: ''; position: absolute; right: -22px; top: -22px; width: 70px; height: 70px; border-radius: 50%; background: var(--ac); opacity: .18; filter: blur(2px); }
.stat small { color: var(--muted); font-size: 12px; font-weight: 600; } .stat b { font-size: 28px; line-height: 1.1; } .stat i { font-style: normal; font-size: 11.5px; color: var(--faint); }
.s1 { --ac: var(--blue); } .s2 { --ac: var(--mint); } .s3 { --ac: var(--rose); } .s4 { --ac: var(--cyan); }
.banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .38); color: var(--text); }
.banner .ic { color: var(--rose); margin-top: 2px; } .banner p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.banner.soft { background: rgba(251, 191, 36, .09); border-color: rgba(251, 191, 36, .38); } .banner.soft .ic { color: var(--amber); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.mini-stats > div { background: var(--raise); border: 1px solid var(--line); border-radius: 14px; padding: 9px 10px; display: grid; }
.mini-stats b { font-size: 21px; line-height: 1.1; } .mini-stats small { font-size: 11.5px; color: var(--muted); font-weight: 600; } .mini-stats i { font-style: normal; font-size: 11px; color: var(--faint); }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 15px; padding: 12px 18px; font-weight: 700; transition: transform .12s, filter .2s, background .2s; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { color: #fff; background: linear-gradient(135deg, #4f7cff, #8b5cf6); box-shadow: 0 12px 26px -12px rgba(110, 100, 255, .9); } .btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: var(--raise); border-color: var(--line2); }
.btn.danger { color: #fff; background: linear-gradient(135deg, #f43f5e, #fb7185); } .btn.danger-o { color: var(--rose); border-color: rgba(251, 113, 133, .5); background: rgba(251, 113, 133, .07); }
.btn.wide { width: 100%; margin-top: 10px; } .btn.lg { padding: 15px 20px; font-size: 16px; }
.iconbtn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; border: 1px solid var(--line); background: var(--raise); }
.iconbtn.sm { width: 34px; height: 34px; border-radius: 11px; } .iconbtn.ghosty { opacity: .45; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line2); background: var(--raise); font-size: 12.5px; font-weight: 700; color: var(--text); }
.chipbtn.on { border-color: var(--cyan); color: var(--cyan); }
.lbl { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--raise); outline: none; min-width: 0; }
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .18); } .input.lg { padding: 15px 16px; font-size: 17px; }
input[type="range"] { width: 100%; accent-color: var(--cyan); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--raise); border: 1px solid var(--line); }
.seg button { flex: 1; display: inline-flex; gap: 7px; justify-content: center; align-items: center; padding: 10px 8px; border: 0; border-radius: 12px; background: none; font-weight: 700; color: var(--muted); font-size: 13.5px; }
.seg button.on { color: #fff; background: linear-gradient(135deg, #4f7cff, #8b5cf6); } .seg.lg button { padding: 14px; font-size: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; border: 1px solid var(--line2); background: var(--raise); font-weight: 700; font-size: 13px; color: var(--muted); }
.chip.on { color: var(--text); border-color: var(--sc, var(--cyan)); background: color-mix(in srgb, var(--sc, var(--cyan)) 18%, transparent); }
.targetrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .targetrow .input { width: 96px; }
.addrow { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 8px; } @media (min-width: 560px) { .addrow { grid-template-columns: 150px 1fr auto; } }
.errtxt { color: var(--rose); font-size: 13px; font-weight: 600; margin: 10px 0; }
.dfield { display: grid; gap: 4px; } .dfield small { color: var(--muted); font-size: 11.5px; font-weight: 700; } .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- date nav & sessions ---------- */
.datenav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.dn-mid { flex: 1; text-align: center; display: grid; min-width: 120px; } .dn-mid b { font-family: 'Space Grotesk'; font-size: 17px; } .dn-mid span { color: var(--muted); font-size: 12.5px; }
.datenav.slim { justify-content: space-between; margin: 4px 0 12px; font-size: 12.5px; }
.daybar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .daytools { display: flex; gap: 8px; flex-wrap: wrap; }
.sessions { display: grid; gap: 10px; }
.sess { display: flex; gap: 12px; padding: 13px; border-radius: 18px; border: 1px solid var(--line); background: var(--raise); position: relative; overflow: hidden; transition: border-color .25s, background .25s; }
.sess::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc); }
.sess.present { border-color: rgba(52, 224, 161, .45); background: linear-gradient(90deg, rgba(52, 224, 161, .1), var(--raise)); }
.sess.absent { border-color: rgba(251, 113, 133, .45); background: linear-gradient(90deg, rgba(251, 113, 133, .1), var(--raise)); }
.sess.cancelled { border-style: dashed; border-color: rgba(251, 191, 36, .5); opacity: .88; }
.sess-time { width: 58px; flex: none; display: grid; align-content: start; gap: 2px; padding-left: 4px; } .sess-time b { font-family: 'Space Grotesk'; font-size: 15px; } .sess-time span { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.sess-main { flex: 1; min-width: 0; } .sess-title { font-weight: 700; margin-bottom: 6px; }
.sess-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.tag { display: inline-flex; gap: 4px; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--card-solid); border: 1px solid var(--line); color: var(--muted); }
.tag.code { color: var(--sc); border-color: color-mix(in srgb, var(--sc) 45%, transparent); } .tag.lab { color: var(--violet); } .tag.th { color: var(--cyan); }
.st { display: inline-flex; gap: 4px; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; }
.st.p { color: var(--mint); background: rgba(52, 224, 161, .13); } .st.a { color: var(--rose); background: rgba(251, 113, 133, .13); } .st.c { color: var(--amber); background: rgba(251, 191, 36, .13); } .st.u { color: var(--muted); background: var(--card-solid); border: 1px dashed var(--line2); }
.mk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mk button { display: inline-flex; gap: 5px; align-items: center; justify-content: center; padding: 9px 4px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card-solid); font-weight: 700; font-size: 12.5px; color: var(--muted); transition: transform .12s, background .2s, color .2s; }
.mk button:active { transform: scale(.94); }
.mk .p.on { color: #04281b; background: var(--mint); border-color: var(--mint); } .mk .a.on { color: #3a0612; background: var(--rose); border-color: var(--rose); } .mk .c.on { color: #3a2a00; background: var(--amber); border-color: var(--amber); }
.mk.sm { grid-template-columns: repeat(3, 38px); gap: 5px; } .mk.sm button { padding: 8px 0; }
.hint { font-size: 12.5px; color: var(--muted); }
.brk, .free { display: flex; gap: 9px; align-items: center; padding: 9px 12px; border-radius: 14px; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); } .brk span, .free span { margin-left: auto; font-size: 11.5px; } .free { opacity: .75; }
.brk b, .free b { font-family: 'Space Grotesk'; color: var(--faint); }
.empty { text-align: center; padding: 26px 14px; display: grid; gap: 8px; justify-items: center; }
.empty h3 { font-size: 18px; } .empty p { color: var(--muted); max-width: 340px; }
.empty-ic { width: 66px; height: 66px; border-radius: 22px; display: grid; place-items: center; color: var(--cyan); background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(155, 107, 255, .16)); border: 1px solid var(--line2); }
.empty-mini { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 8px; border: 1px dashed var(--line); border-radius: 14px; }
.orph { margin-top: 14px; padding: 12px; border: 1px dashed var(--line2); border-radius: 16px; } .orph p { font-size: 12px; margin: 2px 0 8px; }
.orow { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; } .orow > div { flex: 1; } .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; } .dot.lg { width: 14px; height: 14px; display: inline-block; margin-right: 10px; }

/* ---------- history / calendar ---------- */
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .cal-h b { font-family: 'Space Grotesk'; font-size: 16px; }
.cal-w, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; } .cal-w span { text-align: center; font-size: 11px; color: var(--faint); font-weight: 700; padding: 4px 0; }
.cell { aspect-ratio: 1 / 1; min-height: 42px; border: 1px solid transparent; border-radius: 13px; background: var(--raise); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; color: var(--text); }
.cell.blank { background: none; pointer-events: none; } .cell b { font-size: 13.5px; font-weight: 700; } .cell.today { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); } .cell.hol { background: rgba(155, 107, 255, .14); }
.dots { display: flex; gap: 3px; height: 6px; } .d { display: inline-block; width: 6px; height: 6px; border-radius: 50%; } .d.p { background: var(--mint); } .d.a { background: var(--rose); } .d.c { background: var(--amber); } .d.u { border: 1.5px solid var(--faint); } .d.h { background: var(--violet); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 11.5px; color: var(--muted); } .legend span { display: inline-flex; gap: 6px; align-items: center; }
.searchbox { position: relative; margin-bottom: 8px; } .searchbox .ic { position: absolute; left: 13px; top: 13px; color: var(--muted); } .searchbox .input { padding-left: 40px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; } .filters select:first-child { grid-column: 1 / -1; }
.dh { display: flex; gap: 8px; align-items: center; margin: 14px 0 6px; font-size: 13px; color: var(--muted); } .dh b { font-family: 'Space Grotesk'; color: var(--text); }
.hrow { display: flex; gap: 10px; align-items: center; padding: 10px 10px 10px 0; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); margin-bottom: 6px; cursor: pointer; overflow: hidden; }
.hrow.static { cursor: default; } .hrow .bar, .brow .bar, .lrow .bar { align-self: stretch; width: 4px; border-radius: 4px; background: var(--sc); margin-right: 2px; }
.hr-m { flex: 1; min-width: 0; display: grid; } .hr-m b { font-size: 14px; } .hr-m span { font-size: 12px; color: var(--muted); }

/* ---------- analytics ---------- */
.ring .rt { fill: var(--text); font-weight: 700; } .ring .rs { fill: var(--muted); font-weight: 600; } .ring.good { --rg1: var(--cyan); --rg2: var(--mint); } .ring.warn { --rg1: #fbbf24; --rg2: #fb923c; } .ring.bad { --rg1: #fb7185; --rg2: #f43f5e; } .ring.mute { --rg1: var(--faint); --rg2: var(--faint); }
.arc.anim { animation: ringin 1s cubic-bezier(.2, .8, .2, 1); } @keyframes ringin { from { stroke-dashoffset: var(--c); } }
.chartwrap { position: relative; } .trend { width: 100%; height: auto; touch-action: pan-y; } .ax { fill: var(--muted); font-size: 11px; font-family: 'Plus Jakarta Sans', sans-serif; }
.tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; padding: 7px 11px; border-radius: 12px; background: var(--card-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); display: grid; font-size: 11.5px; text-align: center; color: var(--muted); } .tip b { color: var(--text); font-family: 'Space Grotesk'; font-size: 15px; }
.hbars { display: grid; gap: 6px; } .hbar { display: grid; grid-template-columns: 74px 1fr 48px; gap: 10px; align-items: center; padding: 7px 4px; border: 0; background: none; text-align: left; border-radius: 12px; } .hbar:hover { background: var(--raise); }
.hb-l { display: grid; line-height: 1.2; } .hb-l b { color: var(--sc); font-size: 13.5px; } .hb-l i { font-style: normal; color: var(--faint); font-size: 11px; }
.hb-t { position: relative; height: 12px; border-radius: 99px; background: var(--track); } .hb-f { display: block; height: 100%; border-radius: 99px; transition: width .6s; }
.hb-f.good, .col-bar .good { background: linear-gradient(90deg, var(--cyan), var(--mint)); } .hb-f.warn, .col-bar .warn { background: linear-gradient(90deg, #fbbf24, #fb923c); } .hb-f.bad, .col-bar .bad { background: linear-gradient(90deg, #fb7185, #f43f5e); } .hb-f.mute { background: var(--faint); }
.hb-m { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .7; border-radius: 2px; } .hb-v { text-align: right; font-weight: 800; font-size: 13px; font-family: 'Space Grotesk'; }
.cols { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; align-items: end; height: 170px; } .col { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; position: relative; outline-offset: 0; } .col small { text-align: center; font-size: 10.5px; color: var(--muted); }
.col-bar { position: relative; border-radius: 10px; background: var(--track); overflow: hidden; display: flex; align-items: flex-end; } .col-bar span { display: block; width: 100%; border-radius: 10px 10px 0 0; transition: height .6s; }
.col-target { display: none; }
.col:hover::after, .col:focus::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 5px 9px; font-size: 11px; font-weight: 700; border-radius: 9px; background: var(--card-solid); border: 1px solid var(--line2); z-index: 3; margin-bottom: 4px; }
.subgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.subcard { text-align: left; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); display: grid; gap: 8px; position: relative; overflow: hidden; } .subcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sc); }
.sc-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; } .sc-top b { font-family: 'Space Grotesk'; font-size: 17px; color: var(--sc); display: block; } .sc-top small { font-size: 11px; color: var(--muted); line-height: 1.25; display: block; max-width: 92px; }
.sc-mid { font-size: 12.5px; color: var(--muted); font-weight: 600; } .sc-bot { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; } .sc-bot b { color: var(--text); }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .calc-i { background: var(--raise); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 2px; align-content: start; }
.calc-i small { color: var(--muted); font-size: 12px; font-weight: 700; } .calc-i b { font-size: 32px; line-height: 1.1; background: linear-gradient(135deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; } .calc-i p { font-size: 12.5px; color: var(--muted); }
.catblock { padding: 14px 0; border-bottom: 1px solid var(--line); } .cb-h { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; } .cb-h > div:last-child { flex: 1; min-width: 0; } .cb-h h4 { margin-bottom: 4px; }
.pbar { position: relative; height: 10px; border-radius: 99px; background: var(--track); margin: 6px 0 12px; } .pbar span { display: block; height: 100%; border-radius: 99px; } .pbar span.good { background: linear-gradient(90deg, var(--cyan), var(--mint)); } .pbar span.warn { background: linear-gradient(90deg, #fbbf24, #fb923c); } .pbar span.bad { background: linear-gradient(90deg, #fb7185, #f43f5e); } .pbar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .75; }

/* ---------- settings ---------- */
.kv { margin: 0; display: grid; gap: 10px; } .kv div { display: grid; gap: 1px; } .kv dt { font-size: 12px; color: var(--muted); font-weight: 700; } .kv dd { margin: 0; font-weight: 600; }
.lrow { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); } .lrow:last-child { border-bottom: 0; } .lrow > div { flex: 1; display: grid; min-width: 0; } .lrow > div span { font-size: 12.5px; color: var(--muted); } .lrow.tt { padding: 8px 0; }
.daytabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; } .daytabs button { flex: 1; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); font-weight: 700; font-size: 13px; color: var(--muted); } .daytabs button.on { color: #fff; background: linear-gradient(135deg, #4f7cff, #8b5cf6); border-color: transparent; }

/* ---------- sheets, dialogs, toasts ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(2, 5, 14, .66); backdrop-filter: blur(4px); animation: fade .2s; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--sheet); border: 1px solid var(--line2); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); animation: rise .28s cubic-bezier(.2, .9, .3, 1); box-shadow: var(--shadow); }
.sheet-wrap.full .sheet { max-height: 96dvh; min-height: 70dvh; } .sheet-wrap.closing .sheet { transform: translateY(30px); opacity: 0; transition: .18s; } .sheet-wrap.closing .scrim { opacity: 0; transition: .18s; }
.grab { width: 42px; height: 4px; border-radius: 4px; background: var(--line2); margin: 4px auto 12px; }
.sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; } .sh-head h2 { display: flex; align-items: center; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 28px; border-bottom: 1px solid var(--line2); max-height: 88dvh; } .sheet-wrap.full .sheet { max-width: 760px; } }
.sheet-wrap.dialog { z-index: 80; align-items: center; } .sheet-wrap.dialog .sheet { max-width: 420px; border-radius: 26px; border-bottom: 1px solid var(--line2); min-height: 0; padding-top: 22px; } .sheet-wrap.dialog .grab { display: none; }
.dlg h3 { font-size: 19px; margin-bottom: 8px; } .dlg p { color: var(--muted); } .dlg-actions { display: flex; gap: 10px; margin-top: 18px; } .dlg-actions .btn { flex: 1; }
.footbar { position: sticky; bottom: -1px; margin: 16px -18px -8px; padding: 12px 18px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--sheet) 28%); } .footbar.split { display: flex; gap: 10px; } .footbar .btn { margin-top: 0; }
.stepper { display: flex; gap: 6px; margin-bottom: 12px; } .stepper span { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 7px 4px; border-radius: 99px; background: var(--raise); color: var(--faint); } .stepper .on { color: #fff; background: linear-gradient(135deg, #4f7cff, #8b5cf6); } .stepper .done { color: var(--mint); }
.bulkbar { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; top: -8px; z-index: 2; padding: 8px 0; background: var(--sheet); } .fine .ic { display: inline; vertical-align: -2px; }
.bday { border: 1px solid var(--line); border-radius: 18px; padding: 10px; margin-bottom: 10px; background: var(--raise); } .bday.hol { opacity: .55; } .bday.hol .bd-rows { pointer-events: none; }
.bd-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; } .bd-h > b { font-family: 'Space Grotesk'; } .bd-t { display: flex; gap: 6px; flex-wrap: wrap; } .chipbtn.hb.on { color: var(--violet); border-color: var(--violet); }
.brow { display: flex; gap: 10px; align-items: center; padding: 7px 0; } .br-m { flex: 1; min-width: 0; display: grid; } .br-m b { font-size: 14px; } .br-m span { font-size: 11.5px; color: var(--muted); } .br-m em { color: var(--cyan); font-style: normal; font-weight: 700; }
#toasts { position: fixed; z-index: 100; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { #toasts { bottom: 28px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 16px; background: var(--card-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); font-weight: 600; font-size: 13.5px; animation: rise .25s; max-width: 460px; transition: .3s; } .toast.out { opacity: 0; transform: translateY(8px); } .toast.err { border-color: rgba(251, 113, 133, .6); }
.toast button { border: 0; background: none; color: var(--cyan); font-weight: 800; padding: 4px 6px; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { transform: translateY(24px); opacity: 0; } }

/* ---------- onboarding ---------- */
.avatar { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 17px; font-family: 'Space Grotesk'; font-weight: 700; font-size: 18px; color: #fff; background: linear-gradient(135deg, #5b8cff, #9b6bff 60%, #22d3ee); box-shadow: 0 10px 24px -10px rgba(120, 100, 255, .9); } .avatar.sm { width: 40px; height: 40px; border-radius: 14px; font-size: 15px; }
.ob { min-height: 100dvh; display: grid; place-items: center; padding: calc(env(safe-area-inset-top) + 20px) 16px 30px; }
.ob-card { width: 100%; max-width: 440px; padding: 26px 22px; border-radius: 28px; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); backdrop-filter: blur(18px); } .ob-card.widecard { max-width: 640px; } .ob-brand { margin-bottom: 14px; } .ob-card h1 { margin-bottom: 6px; } .back { margin-bottom: 14px; }
.choices { display: grid; gap: 12px; margin-top: 18px; } @media (min-width: 620px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { text-align: left; display: grid; gap: 8px; padding: 18px; border-radius: 22px; border: 1px solid var(--line2); background: linear-gradient(145deg, rgba(91, 140, 255, .2), rgba(155, 107, 255, .12)); transition: transform .15s, border-color .2s; } .choice:hover { transform: translateY(-2px); border-color: var(--cyan); } .choice.alt { background: linear-gradient(145deg, rgba(34, 211, 238, .14), rgba(52, 224, 161, .09)); }
.choice b { font-family: 'Space Grotesk'; font-size: 18px; } .choice > span:last-child { color: var(--muted); font-size: 13.5px; } .ch-ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--cyan); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 520px) {
  .sess { flex-direction: column; gap: 6px; padding-left: 16px; }
  .sess-time { width: auto; display: flex; gap: 8px; align-items: baseline; padding-left: 0; } .sess-time span { font-size: 12px; }
}
.mk button { min-width: 0; white-space: nowrap; }
@media (max-width: 380px) { .stat b { font-size: 24px; } .mk button span { font-size: 11.5px; } .sess-time { width: 50px; } }

/* ---------- forecast panel ---------- */
.fc { display: grid; gap: 10px; }
.fc-status { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 15px; font-size: 14.5px; border: 1px solid var(--line2); }
.fc-status.good { color: var(--mint); background: rgba(52, 224, 161, .1); border-color: rgba(52, 224, 161, .4); }
.fc-status.warn { color: var(--amber); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .4); }
.fc-status.bad { color: var(--rose); background: rgba(251, 113, 133, .1); border-color: rgba(251, 113, 133, .4); }
.fc-status.mute { color: var(--muted); background: var(--raise); }
.fc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fc-grid > div { background: var(--raise); border: 1px solid var(--line); border-radius: 13px; padding: 8px 6px; display: grid; text-align: center; min-width: 0; }
.fc-grid small { font-size: 10.5px; color: var(--muted); font-weight: 700; } .fc-grid b { font-family: 'Space Grotesk'; font-size: 19px; line-height: 1.2; } .fc-grid i { font-style: normal; font-size: 10px; color: var(--faint); }
.fc-text { font-size: 13px; color: var(--muted); }
.fc-chip { justify-self: start; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; }
.fc-chip.good { color: var(--mint); background: rgba(52, 224, 161, .13); } .fc-chip.warn { color: var(--amber); background: rgba(251, 191, 36, .13); } .fc-chip.bad { color: var(--rose); background: rgba(251, 113, 133, .13); } .fc-chip.mute { color: var(--muted); background: var(--raise); }
