:root {
  --bg: #eef3f8;
  --card: #ffffff;
  --ink: #0e2a47;
  --text: #25394f;
  --muted: #6a7d91;
  --line: #dde6ef;
  --line-2: #eaf0f6;
  --primary: #0e2a47;
  --primary-2: #1b4a7a;
  --ice: #d9ecfb;
  --ice-2: #eef7ff;

  --ok: #12804a;
  --ok-bg: #e3f6ec;
  --ok-line: #b7e5cb;
  --short: #d42f2f;
  --short-bg: #fdeaea;
  --short-line: #f5c2c2;
  --off: #97a6b5;
  --off-bg: #f1f4f7;

  --A: #0e2a47;
  --B: #3f8fd6;

  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(14, 42, 71, .06), 0 6px 20px rgba(14, 42, 71, .05);
  --f-head: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 16px/1.5 var(--f-body);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); }
h1, h2, h3 { font-family: var(--f-head); color: var(--ink); margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 750; }
h2 { font-size: 20px; font-weight: 700; }
h2 small { font: 500 14px var(--f-body); color: var(--muted); margin-left: 6px; }
p { margin: 0; }
code { font: 500 .88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--ice-2); color: var(--ink); padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.lead { font-size: 17px; color: var(--muted); margin-top: 6px; max-width: 46em; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.t-ok { color: var(--ok); font-weight: 700; }
.t-short { color: var(--short); font-weight: 700; }
.nowrap { white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: inline; margin: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 10px clamp(14px, 3vw, 32px);
  background: var(--primary); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand .ico { width: 30px; height: 30px; padding: 5px; border-radius: 9px; background: rgba(255,255,255,.12); }
.brand strong { display: block; font: 700 16px var(--f-head); }
.brand small { display: block; font-size: 12px; opacity: .7; }
.mainnav { display: flex; gap: 2px; margin-left: auto; }
.mainnav a {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 9px;
  color: rgba(255,255,255,.78); text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.mainnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.mainnav a.on { background: rgba(255,255,255,.14); color: #fff; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px; border-radius: 99px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .uname { font-weight: 600; font-size: 14px; }
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 240px;
  background: #fff; color: var(--text); border-radius: var(--r); box-shadow: 0 12px 40px rgba(14,42,71,.2);
  padding: 8px; display: flex; flex-direction: column;
}
.usermenu-pop p { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; font-size: 14px; }
.usermenu-pop a, .usermenu-pop .linklike { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font: 500 14.5px var(--f-body); text-align: left; background: none; border: 0; cursor: pointer; width: 100%; }
.usermenu-pop a:hover, .usermenu-pop .linklike:hover { background: var(--bg); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ice); color: var(--ink); font: 700 14px var(--f-head);
}
.topbar .avatar { background: #fff; }
.avatar-lg { width: 44px; height: 44px; font-size: 18px; }

/* ---------- Layout ---------- */
.main { width: min(1160px, 100% - 28px); margin: 22px auto 60px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid rgba(14,42,71,.04); }
.card-pad { padding: clamp(16px, 2.4vw, 26px); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-title + .slots { margin-bottom: 22px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 90px; }

/* ---------- Flash ---------- */
.flash { padding: 13px 16px; border-radius: var(--r-sm); font-weight: 600; border: 1px solid; animation: flashIn .35s ease; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok-line); color: #0b5f36; }
.flash-err { background: var(--short-bg); border-color: var(--short-line); color: #9d1d1d; }
.flash-info { background: var(--ice-2); border-color: var(--ice); color: var(--ink); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px; border-radius: 10px;
  font: 650 15px var(--f-body); text-decoration: none; cursor: pointer;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: #b9c9da; background: var(--ice-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 50px; font-size: 16px; padding-inline: 22px; }
.btn-block { width: 100%; margin-top: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: var(--ice-2); }

/* ---------- Status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 4px 10px 4px 7px; border-radius: 99px; font-weight: 700; font-size: 13px;
}
.pill .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-short { background: var(--short-bg); color: var(--short); }
.pill-off { background: var(--off-bg); color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.dot.st-ok, .strip-cell.st-ok { background: var(--ok); }
.dot.st-short, .strip-cell.st-short { background: var(--short); }
.dot.st-off, .strip-cell.st-off { background: #cfd8e1; }
.lvl {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none;
  font: 800 12px var(--f-head); color: #fff; vertical-align: middle;
}
.lvl-A { background: var(--A); }
.lvl-B { background: var(--B); }
.counts { display: inline-flex; gap: 10px; font-size: 13.5px; color: var(--muted); }
.cnt b { color: var(--ink); }
.cnt-miss, .cnt-miss b { color: var(--short); font-weight: 700; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--off-bg); color: var(--muted); font-size: 12px; font-weight: 600; }
.tag-pay { background: #fff4d6; color: #8a5a00; }
.note { font-size: 13px; color: var(--muted); font-style: italic; }

/* ---------- Chips (sign-up buttons) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 10px 6px 9px; border-radius: 99px;
  font: 650 14px var(--f-body); cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s;
}
.chip:hover { border-color: #a8bdd2; }
.chip:active { transform: scale(.97); }
.chip .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.chip-need { border-color: var(--short); color: var(--short); background: var(--short-bg); }
.chip-need:hover { background: #fbd9d9; border-color: var(--short); }
.chip-on { background: var(--ok); border-color: var(--ok); color: #fff; }
.chip-on:hover { background: #0e6a3d; border-color: #0e6a3d; }
.lvl-mini { font: 800 10.5px var(--f-head); opacity: .7; margin-left: 1px; }
.chip-demo { cursor: default; pointer-events: none; vertical-align: middle; min-height: 28px; padding: 2px 9px 2px 6px; font-size: 13px; }
.chip-big { min-height: 44px; font-size: 15px; padding: 8px 16px 8px 12px; }

/* ---------- Login ---------- */
.is-guest .main { width: 100%; margin: 0; }
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 20% 10%, #24578c 0%, #0e2a47 55%, #081a2d 100%);
  display: flex; align-items: flex-end; padding: clamp(28px, 5vw, 64px);
}
.rink { position: absolute; inset: 0; opacity: .55; }
.rink span { position: absolute; border: 2px solid rgba(217, 236, 251, .22); border-radius: 50%; }
.rink span:nth-child(1) { width: 140%; height: 90%; left: -20%; top: -30%; }
.rink span:nth-child(2) { width: 110%; height: 70%; left: -5%; top: -18%; border-style: dashed; }
.rink span:nth-child(3) { width: 80%; height: 50%; left: 10%; top: -6%; }
.login-hero-text { position: relative; max-width: 30em; }
.login-hero h1 { color: #fff; font-size: clamp(38px, 5.4vw, 64px); line-height: 1; margin: 12px 0 18px; }
.login-hero .eyebrow { color: #a9cdef; }
.login-hero p { color: rgba(255,255,255,.8); font-size: 17px; }
.login-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.login-points li { display: flex; gap: 10px; align-items: center; color: #e6f2fd; font-weight: 500; }
.login-points .ico { color: #7ee2a8; stroke-width: 2.8; }
.login-form { padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 560px; width: 100%; margin: 0 auto; }
.login-form h2 { font-size: 26px; margin-bottom: 4px; }
.demo-box { padding: 18px; border-radius: var(--r); border: 1.5px dashed #b8cde2; background: rgba(255,255,255,.5); }
.demo-grid { display: grid; gap: 8px; margin: 8px 0 10px; }
.demo-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  font: inherit; color: var(--text); transition: border-color .15s, transform .1s, box-shadow .15s;
}
.demo-btn:hover { border-color: var(--primary-2); box-shadow: var(--shadow); }
.demo-btn > span:nth-child(2) { flex: 1; }
.demo-btn strong { font-family: var(--f-head); font-size: 16px; color: var(--ink); }
.demo-btn em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--primary-2); background: var(--ice-2); padding: 1px 7px; border-radius: 99px; margin-left: 4px; }
.demo-btn small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 650; }
.field legend { margin-bottom: 6px; padding: 0; }
input, select, textarea {
  font: 16px var(--f-body); color: var(--text);
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(63,143,214,.18); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--primary); flex: none; }
textarea { resize: vertical; line-height: 1.5; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.hint { font-weight: 500; color: var(--muted); font-size: 13px; min-height: 1em; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; align-items: start; }
.form-grid.narrow { max-width: 620px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .form-grid.cols-3 { grid-template-columns: 1fr; } }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--text); cursor: pointer; }
.check span { padding-top: 1px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.field-inline input, .field-inline select { width: auto; }
.search { max-width: 320px; }
.search-sm { max-width: 260px; min-height: 38px; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; max-height: 280px; overflow: auto; padding: 4px 2px; }
.ratio-sentence { font-size: 18px; line-height: 2.4; color: var(--ink); }
.num { width: 76px; display: inline-block; text-align: center; font-weight: 700; margin: 0 4px; }
.num-wide { width: 90px; display: inline-block; }
.daybox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 14px; background: var(--bg); border-radius: 10px; }
.daybox strong { min-width: 80px; }
.daybox label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.daybox input { width: auto; }
.danger { border: 1px solid var(--short-line); }

/* ---------- Segmented controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a, .seg label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; text-decoration: none; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--muted);
}
.seg a:hover, .seg label:hover { color: var(--ink); }
.seg a.on, .seg label:has(input:checked) { background: var(--primary); color: #fff; }
.seg a.on small { color: rgba(255,255,255,.7); }
.seg small { font-size: 12px; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg .ico { width: 16px; height: 16px; }
.seg-lg a { padding: 10px 16px; font-size: 15px; }
.toggle-past { font-size: 14px; font-weight: 600; margin-left: auto; }

/* ---------- Welcome & health ---------- */
.welcome { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 20px 24px; background: linear-gradient(120deg, #fff 0%, var(--ice-2) 100%); border: 1px solid var(--ice); }
.steps { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.steps a, .steps > li > span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.steps a:hover { text-decoration: underline; }
.steps b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; }
.welcome-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.health-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 18px; }
.health-title { font-size: clamp(30px, 4vw, 44px); display: flex; align-items: center; gap: 10px; }
.health-title.ok { color: var(--ok); }
.health-title.short { color: var(--short); }
.health-title .ico { width: 38px; height: 38px; stroke-width: 2.6; }
.health-meter {
  --p: 50;
  flex: none; width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, #fff 76%, transparent 78% 100%), conic-gradient(var(--ok) calc(var(--p) * 1%), var(--short-bg) 0);
}
.health-meter span { font: 800 24px var(--f-head); color: var(--ink); line-height: 1; }
.health-meter small { font-size: 12px; color: var(--muted); }

.strip { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.strip-cell { width: 18px; height: 30px; border-radius: 4px; transition: transform .12s; }
a.strip-cell:hover { transform: scaleY(1.18); }
.strip-month { font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 0 2px 0 8px; letter-spacing: .04em; }
.strip-month:first-child { margin-left: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 650; text-decoration: none; }

.next-when { display: block; text-decoration: none; margin: 4px 0 10px; }
.next-when .when strong { font-size: 24px; }
.next-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 8px; }
.next .chips { margin-top: 14px; }
.when { display: flex; flex-direction: column; min-width: 0; }
.when strong { font: 700 16.5px var(--f-head); color: var(--ink); }
.when small { color: var(--muted); font-size: 13.5px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--bg); text-decoration: none; color: var(--text); transition: background .15s; }
.quick a:hover { background: var(--ice); }
.quick .ico { width: 22px; height: 22px; color: var(--primary-2); margin-top: 2px; }
.quick strong { display: block; color: var(--ink); font-size: 15px; }
.quick small { color: var(--muted); font-size: 13px; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stats > div { flex: 1; min-width: 100px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.stats b { display: block; font: 800 28px var(--f-head); color: var(--ink); }
.stats span { color: var(--muted); font-size: 13.5px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.feed li:last-child { border: 0; }
.feed small { color: var(--muted); white-space: nowrap; }
.mini-list { list-style: none; margin: 4px 0 0; padding: 0; }
.mini-list li { border-bottom: 1px solid var(--line-2); }
.mini-list li:last-child { border: 0; }
.mini-list a, .mini-list > li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; text-decoration: none; }
.mini-list a > li, .mini-list li:has(a) { padding: 0; }
.who { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--ink); }
.empty { display: flex; gap: 12px; align-items: center; padding: 18px; border-radius: 12px; background: var(--bg); color: var(--muted); }
.empty .ico { width: 26px; height: 26px; color: var(--ok); }
.empty strong { color: var(--ink); }

/* ---------- Rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); border-left: 5px solid var(--off);
  background: #fff;
}
.row.st-ok { border-left-color: var(--ok); }
.row.st-short { border-left-color: var(--short); background: linear-gradient(90deg, #fff6f6, #fff 40%); }
.row.is-past { opacity: .6; }
.row-main { flex: 1; min-width: 240px; display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; text-decoration: none; color: inherit; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.row-actions { justify-content: flex-end; }

/* ---------- Calendar ---------- */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.month { padding: 16px; }
.month-title { font-size: 20px; margin-bottom: 12px; }
.month-title small { font-weight: 500; }
.month-block .month-title { margin-bottom: 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  position: relative; display: flex; gap: 10px; align-items: center;
  padding: 10px; border-radius: 11px; text-decoration: none; color: var(--text);
  border: 1.5px solid transparent; transition: transform .12s, box-shadow .12s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-w6 { grid-column: 1; }
.tile-w0 { grid-column: 2; }
.tile.st-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.tile.st-short { background: var(--short-bg); border-color: var(--short-line); }
.tile.st-off { background: var(--off-bg); color: var(--muted); }
.tile.is-past { opacity: .55; }
.tile.is-today { box-shadow: 0 0 0 3px var(--primary-2); }
.tile-date { display: flex; flex-direction: column; align-items: center; width: 38px; flex: none; }
.tile-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.tile-date b { font: 800 22px var(--f-head); color: var(--ink); line-height: 1; }
.tile-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.tile-status { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.tile.st-ok .tile-status { color: var(--ok); }
.tile.st-short .tile-status { color: var(--short); }
.tile-counts { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.tile-counts .cnt-miss { color: var(--short); }
.tile-mine {
  position: absolute; top: 6px; right: 6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; background: var(--primary); color: #fff; font: 800 11px var(--f-head);
}

/* ---------- Course page ---------- */
.crumbs { display: flex; justify-content: space-between; align-items: center; }
.crumbs > a { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; text-decoration: none; }
.crumbs-nav { display: flex; gap: 6px; }
.course-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  padding: clamp(18px, 3vw, 28px); border-radius: var(--r); color: var(--ink);
  background: var(--off-bg); border: 1px solid var(--line);
}
.course-head.st-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.course-head.st-short { background: var(--short-bg); border-color: var(--short-line); }
.course-head h1 { font-size: clamp(28px, 4vw, 42px); }
.course-note { margin-top: 8px; font-weight: 600; }
.course-status { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.course-status .pill { font-size: 16px; padding: 7px 14px 7px 10px; background: #fff; }
.course-status .pill .ico { width: 18px; height: 18px; }
.course-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.slot { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px; border-radius: 11px; }
.slot-full { background: var(--bg); }
.slot-empty { border: 2px dashed var(--short-line); color: var(--short); font-weight: 650; background: #fffafa; }
.slot-empty .lvl { opacity: .45; }
.slot-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slot-name strong { color: var(--ink); font-size: 15px; }
.slot-name small { color: var(--muted); font-size: 12.5px; }
.slot .icon-btn { width: 30px; height: 30px; border: 0; }
.slot .icon-btn:hover { color: var(--short); background: var(--short-bg); }
.helpers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.helpers li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); }
.helpers li.is-need { border-color: var(--short-line); background: #fffafa; }
.helpers li.is-on { border-color: var(--ok-line); background: var(--ok-bg); }
.helpers-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.helpers li > form { flex: 1 0 100%; padding-left: 44px; }
.helpers-txt strong { color: var(--ink); display: flex; align-items: center; gap: 6px; }
.helpers-txt small { color: var(--muted); font-size: 13px; }
.contacts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.summary { cursor: pointer; margin: 0; }

/* ---------- Schedule grid (mes) ---------- */
.kid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kid { display: flex; align-items: center; gap: 12px; }
.kid > div:nth-child(2) { flex: 1; min-width: 0; }
.kid strong { font: 700 17px var(--f-head); color: var(--ink); }
.kid small { display: block; color: var(--muted); font-size: 13px; }
.kid-stats { display: flex; gap: 12px; text-align: center; }
.kid-stats span { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; }
.kid-stats b { font: 800 22px var(--f-head); color: var(--ink); }
.sched { overflow-x: auto; }
.sched-table { width: 100%; border-collapse: collapse; }
.sched-table th { position: sticky; top: 0; background: #fff; text-align: left; font-size: 13px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.sched-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.sched-table td a { text-decoration: none; }
.sched-table .c { text-align: center; }
.sched-table tr.st-short td:first-child { box-shadow: inset 4px 0 0 var(--short); }
.sched-table tr.st-ok td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.sched-table tr.st-off { color: var(--muted); }
.sched-month td { background: var(--bg); font: 700 13px var(--f-head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 14px; }
.tick {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: #9fb0c1; transition: all .12s;
}
.tick .ico { width: 20px; height: 20px; stroke-width: 2.6; }
.tick:hover { border-color: var(--primary-2); color: var(--primary-2); }
.tick-need { border-color: var(--short); color: var(--short); background: var(--short-bg); }
.tick-on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick-on:hover { background: #0e6a3d; color: #fff; }
.tick-demo { width: 28px; height: 28px; border-radius: 8px; vertical-align: middle; pointer-events: none; }
.tick-demo .ico { width: 15px; height: 15px; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table td a { text-decoration: none; }
.table .cb { width: 36px; }
.table .r { text-align: right; }
.table tr.is-off td { opacity: .5; }
.table tbody tr:has(input:checked) td { background: var(--ice-2); }
.tr-month td { background: var(--bg); font: 700 12.5px var(--f-head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 7px 12px; }
.pickers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.pickers .chip { min-height: 32px; font-size: 13.5px; }
.bulk { position: relative; }
.bulk.card { padding: 6px 0 0; }
.bulkbar {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--primary); color: #fff; box-shadow: 0 14px 40px rgba(14,42,71,.35);
  animation: flashIn .2s ease;
}
.bulkbar[hidden] { display: none; }
.bulkbar select, .bulkbar input { width: auto; min-width: 200px; border-color: transparent; }
.bulkbar [data-field="times"] { display: inline-flex; align-items: center; gap: 6px; }
.bulkbar [data-field="times"][hidden] { display: none; }
.bulkbar [data-field="times"] input { min-width: 0; }
.bulkbar .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.bulk-count b { font-size: 18px; }

/* ---------- Import ---------- */
.import-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.cols em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--short); margin-left: 4px; }
.creds { border: 2px solid var(--ok-line); }

/* ---------- Guide ---------- */
.guide { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.guide-step { overflow: hidden; display: flex; flex-direction: column; }
.guide-vis { height: 120px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: linear-gradient(135deg, var(--ice-2), var(--ice)); }
.guide-vis .arrow { font-size: 22px; color: var(--muted); }
.big-ico .ico { width: 46px; height: 46px; color: var(--primary-2); stroke-width: 1.6; }
.strip-demo .strip-cell { width: 14px; height: 36px; }
.slots-demo { grid-template-columns: 1fr 1fr; width: 100%; max-width: 320px; }
.slots-demo .slot { min-height: 46px; background: #fff; }
.grid-demo { display: grid; grid-template-columns: repeat(2, 36px); gap: 6px; }
.grid-demo .tick-demo { width: 34px; height: 26px; }
.guide-txt { padding: 18px 20px 20px; position: relative; }
.guide-no { position: absolute; top: -18px; left: 18px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font: 800 16px var(--f-head); border: 3px solid #fff; }
.guide-txt h2 { margin: 8px 0 6px; font-size: 19px; }
.guide-txt p { color: var(--text); font-size: 15px; }
.faq h2 { margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line-2); padding: 12px 0; }
.faq details:last-child { border: 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.faq details p { margin-top: 8px; }
.example { padding: 10px 14px; border-radius: 10px; background: var(--bg); font-size: 15px; }

/* ---------- Policy ---------- */
.policy-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.prose { font-size: 16.5px; line-height: 1.65; max-width: 72ch; }
.prose h2 { margin: 26px 0 8px; font-size: 21px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 6px 0 12px; padding-left: 22px; }
.prose li { margin: 4px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .course-grid, .import-grid, .policy-grid, .grid-2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: 340px; }
}
@media (max-width: 820px) {
  .topbar { padding: 8px 14px; }
  .brand small { display: none; }
  .usermenu { margin-left: auto; }
  .usermenu .uname { display: none; }
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    overflow-x: auto; justify-content: space-around; gap: 0;
    box-shadow: 0 -6px 20px rgba(14,42,71,.06);
  }
  .mainnav a { flex: 1 1 0; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11px; color: var(--muted); min-width: 50px; white-space: nowrap; }
  .mainnav a .ico { width: 22px; height: 22px; }
  .mainnav a.on { background: var(--ice-2); color: var(--ink); }
  .mainnav a:hover { background: var(--ice-2); color: var(--ink); }
  .main { margin-bottom: 100px; }
  .quick { grid-template-columns: 1fr; }
  .health-head { flex-direction: column-reverse; align-items: flex-start; }
  .health-meter { width: 84px; height: 84px; }
  .strip-cell { width: 14px; height: 26px; }
  .course-status { align-items: flex-start; text-align: left; }
  .toggle-past { margin-left: 0; }
  .search { max-width: none; }
}
@media (max-width: 520px) {
  .main { width: calc(100% - 20px); margin-top: 14px; gap: 14px; }
  .tiles { grid-template-columns: 1fr; }
  .tile-w6, .tile-w0 { grid-column: auto; }
  .months { grid-template-columns: 1fr; }
  .row-main { min-width: 0; }
  .welcome { padding: 16px; }
  .bulkbar select, .bulkbar input { min-width: 0; flex: 1 1 160px; }
  .guide { grid-template-columns: 1fr; }
  .sched-table th, .sched-table td { padding: 8px 8px; }
  .sched-table .when small { display: none; }
}

@media print {
  .topbar, .mainnav, .foot, .toolbar, .head-actions, .bulkbar, .page-head, form, .flash { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
  .creds { display: block !important; }
  .main > *:not(.creds) { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
