/* Репетитор — cool neutrals, ink text, blue = paid/positive, orange = debt. */

:root {
  --bg: #EEF2F4;
  --surface: #FCFDFD;
  --surface-2: #E3E9ED;
  --surface-3: #F4F7F9;
  --ink: #0F1D2B;
  --ink-2: #475767;
  --muted: #5A6876;
  --faint: #6A7886;
  --line: #DCE3E8;
  --line-2: #E6EBEF;
  --line-3: #C9D3DA;
  --blue: #2A66B8;
  --blue-hover: #1E4F93;
  --link: #2A66B8;
  --blue-ink: #1E4F93;
  --blue-tint: #E2ECF8;
  --blue-soft: #F1F6FC;
  --orange: #D9772B;
  --orange-ink: #A24F0E;
  --orange-tint: #FCEADB;
  --zero-tint: #E6EBEF;
  --paid-chip: #E9F0F8;
  --paid-chip-ink: #1E3350;
  --hero: #0F1D2B;
  --hero-ink: #F3F6F8;
  --hero-muted: #B4C2CF;
  --hero-line: #4A6178;
  --hero-neg: #FF9D5C;
  --hero-pos: #8EC2FF;
  --rink: #3E6FA8;
  --dark-btn: #0F1D2B;
  --on-dark-btn: #FFFFFF;
  --shadow: 0 1px 2px rgba(15, 29, 43, .14);
  --shadow-lg: 0 18px 48px rgba(15, 29, 43, .22);
  --backdrop: rgba(8, 15, 22, .45);
  --radius: 20px;
  --font: Onest, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --display: Unbounded, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B141D;
    --surface: #121E2A;
    --surface-2: #1B2A37;
    --surface-3: #16232F;
    --ink: #E8EEF3;
    --ink-2: #B7C4CF;
    --muted: #97A7B5;
    --faint: #8595A4;
    --line: #243442;
    --line-2: #1E2D3A;
    --line-3: #33475A;
    --blue: #2F6CC0;
    --blue-hover: #3A7AD1;
    --link: #86B6F2;
    --blue-ink: #93BCF3;
    --blue-tint: #17314F;
    --blue-soft: #132536;
    --orange: #E58A44;
    --orange-ink: #F4AE78;
    --orange-tint: #3B2515;
    --zero-tint: #1F2E3B;
    --paid-chip: #182C40;
    --paid-chip-ink: #CFE0F3;
    --hero: #172B3E;
    --hero-line: #3D5670;
    --rink: #5A8CC8;
    --dark-btn: #E8EEF3;
    --on-dark-btn: #0F1D2B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
    --backdrop: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* fixed section colours for marks and dots: each section gets one by its
   place in the list (sec-c0 … sec-c5, then again) */
:root { --sec-in: #2A66B8; --sec-c0: #2A66B8; --sec-c1: #5B4BC4; --sec-c2: #0E7F74; --sec-c3: #B8581A; --sec-c4: #AE3772; --sec-c5: #587319; }
@media (prefers-color-scheme: dark) { :root { --sec-in: #5B93DB; --sec-c0: #5B93DB; --sec-c1: #8A7FE0; --sec-c2: #3FB8A9; --sec-c3: #E08A4E; --sec-c4: #E07AAE; --sec-c5: #9DBA55; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
h1, h2, h3, p { margin: 0; }
small { font-size: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.hint.center { text-align: center; margin-top: 18px; }
.neg { color: var(--orange-ink); }
.pos { color: var(--blue-ink); }
.boot { min-height: 100dvh; }

/* ---------- layout ---------- */

.shell { min-height: 100dvh; }
.main {
  padding: calc(var(--safe-top) + 14px) 16px calc(96px + var(--safe-bottom));
  max-width: 760px;
  margin: 0 auto;
}
.main-students { padding-bottom: calc(160px + var(--safe-bottom)); }
.sidebar { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px 6px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; font-size: 11px; font-weight: 500; color: var(--ink-2); text-decoration: none;
}
.tab.on { color: var(--link); font-weight: 600; }

.fab-bar {
  position: fixed; left: 50%; transform: translateX(-50%); width: min(100%, 760px); z-index: 19;
  bottom: calc(62px + var(--safe-bottom));
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.main:not(.main-students) .fab-bar, .student .fab-bar { display: none; }

@media (min-width: 900px) {
  .tabbar, .fab-bar { display: none !important; }
  .sidebar {
    display: flex; flex-direction: column; gap: 22px;
    position: fixed; top: 0; bottom: 0; left: 0; width: 232px; z-index: 10;
    padding: calc(var(--safe-top) + 26px) 16px 24px;
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .brand { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -.01em; padding: 0 8px; color: var(--ink); text-decoration: none; }
  .side-actions { display: grid; gap: 8px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px;
    color: var(--ink-2); text-decoration: none; font-weight: 500;
  }
  .side-link:hover { background: var(--surface-3); }
  .side-link.on { background: var(--blue-tint); color: var(--blue-ink); font-weight: 600; }
  .main { margin-left: 232px; max-width: none; padding: calc(var(--safe-top) + 28px) 36px 48px; }
  .main-students { padding-bottom: 48px; }
  .main-settings, .main-reports { max-width: calc(1100px + 232px); }
}

/* ---------- common ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.h1 { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -.01em; line-height: 1.15; overflow-wrap: anywhere; }
h2 { font-size: 17px; font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.flat { overflow: hidden; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, opacity .15s;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:not(:disabled):hover { background: var(--blue-hover); }
.btn.dark { background: var(--dark-btn); color: var(--on-dark-btn); }
.btn.ghost { background: var(--surface); border-color: var(--line-3); color: var(--ink); }
.btn.ghost:not(:disabled):hover { background: var(--surface-3); }
.btn.big { width: 100%; min-height: 54px; }
.btn.wide { width: 100%; justify-content: flex-start; }
.btn.danger-text { color: var(--orange-ink); }
.btn.armed { background: var(--orange-tint); border-color: var(--orange); white-space: normal; font-size: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.stack { display: grid; gap: 8px; }
.top-gap { margin-top: 8px; }
.link-btn { border: 0; background: none; color: var(--link); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-3); color: var(--ink); text-decoration: none;
}
.icon-btn.ghost { background: transparent; border-color: transparent; color: var(--link); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg-btn {
  min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px;
}
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-count { color: var(--muted); font-weight: 500; }
.seg.small { margin: 0 16px 8px; }
.seg.small .seg-btn { min-height: 36px; }

.pill { font-family: var(--display); font-size: 13px; font-weight: 600; padding: 7px 10px; border-radius: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.neg { background: var(--orange-tint); color: var(--orange-ink); }
.pill.pos { background: var(--blue-tint); color: var(--blue-ink); }
.pill.zero { background: var(--zero-tint); color: var(--ink-2); }
.pill.low { background: transparent; color: var(--orange-ink); box-shadow: inset 0 0 0 1.5px var(--orange); }
.tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 6px; }
.tag.neg { background: var(--orange-tint); color: var(--orange-ink); }
.tag.part { background: transparent; color: var(--orange-ink); box-shadow: inset 0 0 0 1.5px var(--orange); }
.tag.wait { background: var(--surface-2); color: var(--ink-2); }
.tag + .tag { margin-left: 4px; }
.empty-line { padding: 18px 16px; color: var(--muted); font-size: 15px; }

/* ---------- students ---------- */

.summary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  padding: 16px 18px; margin-bottom: 14px; color: var(--ink); text-decoration: none;
}
.sum-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sum-col.sep { padding-left: 14px; border-left: 1px solid var(--line-2); }
.sum-col .lbl { font-size: 13px; color: var(--muted); }
.sum-col .num { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sum-col .num.neg { color: var(--orange-ink); }
.sum-col .sub { font-size: 12px; color: var(--muted); }
.search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; margin-bottom: 12px;
  border-radius: 14px; background: var(--surface-2); color: var(--muted);
}
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font-size: 16px; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.list { margin-top: 12px; overflow: hidden; }
.srow {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 64px;
  color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-2);
}
.srow:first-child { border-top: 0; }
.srow:hover { background: var(--surface-3); }
.srow.sel { background: var(--blue-soft); }
.avatar {
  width: 40px; height: 40px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
  background: var(--blue-tint); color: var(--blue-ink);
}
.avatar.neg { background: var(--orange-tint); color: var(--orange-ink); }
.avatar.zero, .avatar.arch { background: var(--zero-tint); color: var(--ink-2); }
.avatar.low { background: var(--surface); color: var(--orange-ink); box-shadow: inset 0 0 0 1.5px var(--orange); }
.srow-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.srow-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fab-bar .btn { min-height: 52px; box-shadow: var(--shadow); }
.empty-card { padding: 22px 20px; display: flex; flex-direction: column; gap: 10px; }
.empty-card p { color: var(--ink-2); line-height: 1.5; }

.pane-detail { display: none; }
@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .pane-detail {
    display: block; position: sticky; top: 20px;
    max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
    border-radius: var(--radius); scrollbar-width: thin;
  }
  .pane-detail .student { max-width: 720px; }
  .detail-empty {
    min-height: 420px; border: 1.5px dashed var(--line-3); border-radius: var(--radius);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    color: var(--muted); text-align: center; padding: 32px;
  }
  .detail-empty .rink { width: 140px; height: 140px; stroke: var(--line-3); }
  .detail-empty .rink .dot { fill: var(--line-3); }
  .detail-empty p { max-width: 320px; }
}

/* ---------- student ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; margin: -6px -8px 2px; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px; font-weight: 500; text-decoration: none; color: var(--link); }
.student-head { display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 16px; }
.name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.student-head .sub { color: var(--muted); font-size: 14px; }
.student-head .note { color: var(--ink-2); font-size: 14px; background: var(--surface-2); padding: 8px 12px; border-radius: 12px; white-space: pre-line; }
.student .arch-btn { margin-top: 16px; justify-content: center; }
.contacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
}
.chip-link.add { color: var(--link); border-style: dashed; border-color: var(--line-3); background: transparent; }

.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 18px;
  background: var(--hero); color: var(--hero-ink); display: flex; flex-direction: column; gap: 8px;
}
.hero > * { position: relative; }
.hero .rink { position: absolute; right: -96px; top: -70px; width: 280px; height: 280px; stroke: var(--rink); opacity: .55; }
.hero .rink .dot { fill: var(--rink); }
.hero-lbl { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-muted); }
.hero-num { font-family: var(--display); font-size: clamp(34px, 11vw, 46px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero.neg .hero-num { color: var(--hero-neg); }
.hero.pos .hero-num { color: var(--hero-pos); }
.hero-sub { font-size: 15px; color: var(--hero-muted); }
.hero-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.hero-btn {
  min-height: 60px; border-radius: 14px; border: 1px solid var(--hero-line); background: transparent; color: var(--hero-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 600;
}
.hero-btn.light { background: #FCFDFD; border-color: #FCFDFD; color: #0F1D2B; }
.hero-btn:not(.light):hover { background: rgba(255, 255, 255, .06); }

.coll, .hist { margin-top: 16px; overflow: hidden; }
.coll-head {
  width: 100%; border: 0; background: transparent; text-align: left; color: var(--ink);
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
}
.ico-box { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-tint); color: var(--blue-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.coll-head .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.coll-head .t { font-size: 16px; font-weight: 600; }
.coll-head .s { font-size: 13px; color: var(--muted); }
.coll-head .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.coll-head .num { font-family: var(--display); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chev { color: var(--muted); display: flex; transition: transform .2s; }
.chev.up { transform: rotate(180deg); }
.coll-body { border-top: 1px solid var(--line-2); }

.erow {
  width: 100%; border: 0; border-top: 1px solid var(--line-2); background: transparent; color: var(--ink); text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 58px;
}
.coll-body .erow:first-child, .card.flat .erow:first-child, .settings-grid .group-title + .erow { border-top: 0; }
.erow:hover { background: var(--surface-3); }
.edate { width: 46px; display: flex; flex-direction: column; flex-shrink: 0; }
.edate b { font-size: 15px; font-weight: 600; }
.edate small { color: var(--muted); }
.emain { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; font-size: 14px; line-height: 1.3; }
.emain small { color: var(--muted); }
.eright { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.eright small { color: var(--muted); white-space: nowrap; }
.eamt { font-family: var(--display); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eamt.pay { color: var(--blue-ink); }
.row-btn {
  width: 100%; border: 0; border-top: 1px solid var(--line-2); background: transparent; color: var(--link);
  min-height: 50px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; padding: 0 16px;
}
.row-btn.center { justify-content: center; }

/* ---------- journal ---------- */

.journal-head { align-items: center; flex-wrap: nowrap; }
@media (max-width: 899px) {
  .journal-head .h1 { font-size: 24px; }
  .journal-head .icon-btn { width: 40px; height: 40px; }
  .journal-head .month-name { min-width: 0; font-size: 15px; }
  .journal-tools { margin-bottom: 8px; }
  .journal-tools .legend { font-size: 12px; gap: 10px; }
  .journal-tools .check-inline { min-height: 36px; font-size: 13px; }
  .grid-wrap { max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 250px); }
}
.month-sw { display: flex; align-items: center; gap: 6px; }
.month-name { font-weight: 600; min-width: 132px; text-align: center; }
.journal-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { font-style: normal; pointer-events: none; min-height: 22px !important; min-width: 0 !important; padding: 0 6px !important; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; }
.check-inline input, .check-row input, .prow input { width: 20px; height: 20px; accent-color: var(--blue); margin: 0; flex-shrink: 0; }
.pad-x { padding: 0 16px 8px; }

.grid-wrap {
  overflow: auto; max-height: calc(100dvh - var(--safe-top) - 200px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overscroll-behavior: contain;
}
@media (min-width: 900px) { .grid-wrap { max-height: calc(100dvh - 190px); } }
.grid { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; }
.grid th, .grid td { padding: 0; border-bottom: 1px solid var(--line-2); border-left: 1px solid var(--line-2); background: var(--surface); }
.grid thead th {
  position: sticky; top: 0; z-index: 3; text-align: left; padding: 8px 10px; min-width: 96px;
  border-bottom: 1px solid var(--line-3); vertical-align: bottom;
}
.grid thead th a { display: block; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.grid .gbal { display: block; font-size: 12px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }
.gbal.zero { color: var(--muted); }
.grid tbody th, .grid tfoot th, .grid .corner {
  position: sticky; left: 0; z-index: 2; border-left: 0; text-align: left; white-space: nowrap;
  padding: 0 10px; font-weight: 500; min-width: 88px;
}
.grid .corner { z-index: 4; color: var(--muted); font-size: 13px; font-weight: 600; }
.grid tbody th { height: 30px; }
.grid tbody th b { font-weight: 600; }
.grid tbody th small { color: var(--muted); margin-left: 6px; }
.grid tbody th em { font-style: normal; color: var(--blue-ink); font-size: 11px; font-weight: 700; margin-left: 6px; }
.grid tr.we th, .grid tr.we td { background: var(--surface-3); }
.grid tr.today th, .grid tr.today td { background: var(--blue-soft); }
.grid tr.mon th, .grid tr.mon td { border-top: 1px solid var(--line-3); }
.grid tr.future th b, .grid tr.future th small { color: var(--faint); }
.grid tr.meta th { font-size: 12px; color: var(--ink-2); height: 38px; }
.grid tr.meta td { padding: 0 10px; }
.grid tr.meta th, .grid tr.meta td { background: var(--surface-3); }
.grid tr.tops th { color: var(--blue-ink); font-weight: 600; }
.grid tr.tops td { padding: 0; border-bottom-color: var(--line-3); }
.mval { font-variant-numeric: tabular-nums; font-size: 13px; }
.mval.zero { color: var(--muted); }
.mval.strong { font-family: var(--display); font-weight: 600; }
.grid tfoot th, .grid tfoot td { position: sticky; bottom: 0; z-index: 2; height: 46px; border-top: 1px solid var(--line-3); background: var(--surface-3); }
.grid tfoot th { z-index: 3; font-weight: 700; }
.grid tfoot td { padding: 0 10px; }
.topcell {
  width: 100%; min-height: 44px; border: 0; background: transparent; text-align: left; padding: 4px 10px;
  display: flex; flex-direction: column; justify-content: center; color: var(--ink);
}
.topcell b { color: var(--blue-ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.topcell small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.topcell .dash { font-size: 13px; }
.grid td .cell { margin: 0 6px; }
.cell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 24px; min-width: 44px; padding: 0 8px; border: 0; border-radius: 7px;
  font-size: 13px; font-weight: 600; font-style: normal; font-variant-numeric: tabular-nums; color: var(--paid-chip-ink); background: var(--paid-chip);
}
.grid td .cell { width: calc(100% - 12px); min-height: 26px; justify-content: flex-start; }
.cell.debt { background: var(--orange-tint); color: var(--orange-ink); }
.cell.part { background: var(--surface); color: var(--orange-ink); box-shadow: inset 0 0 0 1.5px var(--orange); }
.cell.empty { background: transparent; }
.cell.empty:hover { background: var(--blue-soft); }
.cell sup { font-size: 10px; margin-left: 2px; }
.cell.haspay::after { content: ""; position: absolute; right: 5px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 99px; background: var(--blue); }

/* ---------- reports ---------- */

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { padding: 14px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.kpi .lbl { font-size: 13px; color: var(--muted); }
.kpi .num { font-family: var(--display); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi.warn { background: var(--orange-tint); border-color: transparent; grid-column: span 2; }
.kpi.warn .lbl, .kpi.warn .sub { color: var(--orange-ink); }
.kpi.warn .num { color: var(--orange-ink); }
.kpi .sub { font-size: 13px; font-weight: 600; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi.warn { grid-column: auto; } }
.report-grid { display: grid; gap: 14px; }
@media (min-width: 1100px) { .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-grid > :last-child { grid-column: span 2; } }
.report-grid .card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; align-items: end; height: 200px; border-bottom: 1px solid var(--line-3); padding-bottom: 0; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; position: relative; }
.bar-val { font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { width: 70%; max-width: 56px; background: var(--blue); border-radius: 4px 4px 0 0; }
.bar.cur { background: var(--surface); box-shadow: inset 0 0 0 2px var(--blue); }
.bar-lbl { position: absolute; bottom: -24px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chart .bars { margin-bottom: 26px; }
.chart-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.keys { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.keys span { display: flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key.paid, .seg-paid { background: var(--blue); }
.key.debt, .seg-debt { background: var(--orange); }
.hbar { display: grid; grid-template-columns: 72px minmax(0, 1fr) 70px; align-items: center; gap: 10px; min-height: 32px; color: var(--ink); text-decoration: none; }
.hbar-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { display: flex; gap: 2px; height: 14px; }
.hbar-track i { display: block; height: 100%; }
.hbar-track i:first-child { border-radius: 4px 0 0 4px; }
.hbar-track i:last-child { border-radius: 0 4px 4px 0; }
.hbar-track i:only-child { border-radius: 4px; }
.hbar-val { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
table.simple td { padding: 9px 8px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
table.simple tr:last-child td { border-bottom: 0; }
table.simple .r { text-align: right; white-space: nowrap; }
table.simple tr.dim td { color: var(--muted); }

/* ---------- settings ---------- */

.settings-grid { display: grid; gap: 14px; }
/* two columns that fill from the top, so a short card leaves no hole under it */
@media (min-width: 1100px) {
  .settings-grid { display: block; columns: 2; column-gap: 14px; }
  .settings-grid > * { break-inside: avoid; margin-bottom: 14px; }
  .settings-grid > .tt-settings { column-span: all; }
}
.settings-grid > .card:not(.pad) { overflow: hidden; }
.group-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px 6px; border-top: 1px solid var(--line-2); }
.card-head + .group-title { border-top: 0; padding-top: 0; }

/* ---------- forms ---------- */

.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-3);
  background: var(--surface); color: var(--ink); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
}
select.input { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235A6876' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea.input { resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.input.money { font-family: var(--display); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }
.input.money.big { font-size: 30px; min-height: 60px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 400; color: var(--muted); }
.fgroup { display: flex; flex-direction: column; gap: 8px; }
.flabel { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.flabel.row { display: flex; justify-content: space-between; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink-2); }
.flabel.row > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.flabel.row .muted { font-weight: 400; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 13px;
  border-radius: 12px; border: 1px solid var(--line-3); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 600; white-space: nowrap;
}
.chip[aria-pressed="true"] { border: 2px solid var(--blue); background: var(--blue-tint); padding: 0 12px; }
.chip.wide { white-space: normal; text-align: left; padding: 10px 14px; line-height: 1.3; font-weight: 500; color: var(--blue-ink); border-style: dashed; }
/* the whole chip opens the calendar: the invisible date input covers it
   (iOS keeps a native min size for date inputs, so it is reset here) */
.date-chip { position: relative; overflow: hidden; cursor: pointer; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-width: 100%; margin: 0; padding: 0; border: 0; cursor: pointer; -webkit-appearance: none; appearance: none; display: block; font-size: 16px; }
.date-chip input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tcard {
  min-height: 58px; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--line-3); background: var(--surface);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; color: var(--ink);
}
.tcard b { font-size: 14px; font-weight: 600; line-height: 1.25; }
.tcard small { color: var(--ink-2); font-size: 12.5px; }
.tcard[aria-pressed="true"] { border: 2px solid var(--blue); background: var(--blue-tint); padding: 8px 11px; }
.plist { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.prow { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 52px; border-top: 1px solid var(--line-2); cursor: pointer; }
.prow:first-child { border-top: 0; }
.prow.on { background: var(--blue-soft); }
.pname { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnow { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.after { font-size: 13px; font-weight: 700; white-space: nowrap; min-width: 0; font-variant-numeric: tabular-nums; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-3); cursor: pointer; }
.check-row input { margin-top: 2px; }
.check-row span { display: flex; flex-direction: column; gap: 2px; }
.check-row small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.check-row.warn { background: var(--orange-tint); }
.check-row.warn small { color: var(--ink-2); }
.preview { padding: 14px 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; }
.preview.pos { background: var(--blue-tint); }
.preview.neg { background: var(--orange-tint); }
.preview .lbl { font-size: 13px; color: var(--ink-2); }
.pv-num { font-family: var(--display); font-size: 22px; font-weight: 600; }
.pv-text { font-size: 14px; line-height: 1.45; color: var(--ink); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; line-height: 1.45; }
.banner.neg { background: var(--orange-tint); color: var(--orange-ink); font-weight: 600; }
.banner.pos { background: var(--blue-tint); color: var(--blue-ink); font-weight: 600; }
.form-err { color: var(--orange-ink); font-size: 14px; font-weight: 600; min-height: 0; }
.form-err:empty { display: none; }
.foot-row { display: flex; gap: 10px; justify-content: space-between; }
.foot-row .btn { flex: 1; }
.send-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn.send { background: var(--surface); border-color: var(--line-3); color: var(--ink); }
.btn.send.wa, .btn.send.tg { background: var(--blue); border-color: var(--blue); color: #fff; }
.file-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 140px; border: 1.5px dashed var(--line-3); border-radius: 16px; color: var(--link); font-weight: 600; cursor: pointer;
}
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- sheet ---------- */

#sheet-host { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#sheet-host.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fade .2s ease-out; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100dvh - var(--safe-top) - 12px);
  display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  animation: up .26s cubic-bezier(.2, .8, .2, 1); outline: none;
}
.sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-3); margin: 8px auto 0; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 6px 18px; flex-shrink: 0; }
.sheet-head h2 { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { flex-shrink: 0; padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.sheet-foot:empty { display: none; }
.sheet-body form { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 700px) {
  .sheet {
    left: 50%; top: 50%; bottom: auto; width: min(560px, calc(100vw - 48px)); max-height: min(88dvh, 860px);
    transform: translate(-50%, -50%); border-radius: 22px; animation: pop .2s ease-out;
  }
  .sheet.wide { width: min(720px, calc(100vw - 48px)); }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 14px; }
  .sheet-foot { border-radius: 0 0 22px 22px; padding-bottom: 14px; }
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }

/* ---------- login, offline, toast ---------- */

.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-top) + 24px) 20px 24px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-family: var(--display); font-size: 28px; font-weight: 600; }
.login-mark { width: 72px; height: 72px; border-radius: 18px; display: block; }
.offline-bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 8px) 16px 8px; background: var(--orange-tint); color: var(--orange-ink); font-size: 14px; font-weight: 600;
}
.offline-bar span { flex: 1; }
.offline-bar.sync { background: var(--blue-tint); color: var(--blue-ink); }
@media (min-width: 900px) { .offline-bar { margin-left: 232px; } }
.toast {
  position: fixed; left: 50%; bottom: calc(130px + var(--safe-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--dark-btn); color: var(--on-dark-btn); font-size: 15px; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--orange-ink); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 32px; left: calc(50% + 116px); } }

/* ---------- sections ---------- */

.sec-mark, .dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 99px; background: var(--sec-in); }
.dot { width: 10px; height: 10px; }
.sec-c0 > .sec-mark, .dot.sec-c0, .cnt.sec-c0 { background: var(--sec-c0); }
.sec-c1 > .sec-mark, .dot.sec-c1, .cnt.sec-c1 { background: var(--sec-c1); }
.sec-c2 > .sec-mark, .dot.sec-c2, .cnt.sec-c2 { background: var(--sec-c2); }
.sec-c3 > .sec-mark, .dot.sec-c3, .cnt.sec-c3 { background: var(--sec-c3); }
.sec-c4 > .sec-mark, .dot.sec-c4, .cnt.sec-c4 { background: var(--sec-c4); }
.sec-c5 > .sec-mark, .dot.sec-c5, .cnt.sec-c5 { background: var(--sec-c5); }
.sec-eyebrow { color: var(--blue-ink); }

/* phone and iPad portrait: switcher at the top of every section page */
.secbar {
  display: flex; gap: 2px; padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none;
  border-radius: 14px; background: var(--surface-2);
}
.secbar::-webkit-scrollbar { display: none; }
.secbar-item {
  flex: 1 0 auto; min-height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; padding: 0 6px;
}
@media (max-width: 420px) { .secbar-item { font-size: 13px; padding: 0 4px; gap: 4px; } }
.secbar-item.sec-workouts.on { color: var(--sec-work); }
.secbar-item.on { background: var(--surface); color: var(--blue-ink); font-weight: 700; box-shadow: var(--shadow); }
.secbar-item.sec-schedule.on { color: var(--ink); }
@media (min-width: 900px) { .secbar { display: none; } }

@media (min-width: 900px) {
  .side-sections { display: flex; flex-direction: column; gap: 2px; }
  .side-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 12px 6px; }
  .side-nav .side-title { padding-top: 0; }
  .side-sec {
    display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 10px 0 12px; border-radius: 12px;
    color: var(--ink-2); text-decoration: none; font-weight: 600;
  }
  .side-sec span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
  .side-sec small { color: var(--muted); font-size: 13px; }
  .side-sec:hover { background: var(--surface-3); }
  .side-sec.on { background: var(--surface-2); color: var(--ink); }
  .side-sec.sec-schedule .sec-mark { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); border-radius: 2px; }
  .side-link.bottom { margin-top: auto; }
  .sidebar { overflow-y: auto; }
}

/* ---------- home ---------- */

.home-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1180px; } .home-grid > .tz-card { grid-column: 1 / -1; } }
.home-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; color: var(--ink); text-decoration: none; }
.home-card:hover { border-color: var(--line-3); }
.home-top { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.home-top .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-top b { font-size: 18px; font-weight: 700; color: var(--ink); }
.home-top small { font-size: 13px; color: var(--muted); }
.home-ico { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #E2ECF8; color: #1E4F93; }
.home-card[class*="sec-c"] .home-ico { background: color-mix(in srgb, var(--hc) 14%, var(--surface)); color: var(--hc); }
.home-card.sec-c0 { --hc: var(--sec-c0); } .home-card.sec-c1 { --hc: var(--sec-c1); } .home-card.sec-c2 { --hc: var(--sec-c2); }
.home-card.sec-c3 { --hc: var(--sec-c3); } .home-card.sec-c4 { --hc: var(--sec-c4); } .home-card.sec-c5 { --hc: var(--sec-c5); }
.home-card.sec-schedule .home-ico { background: var(--zero-tint); color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .home-ico { background: #17314F; color: #93BCF3; }
}
.home-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat.wide { grid-column: 1 / -1; gap: 8px; }
.stat small { font-size: 12px; color: var(--muted); }
.stat b { font-family: var(--display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat b.small { font-family: var(--font); font-size: 15px; font-weight: 700; }
.today-row { display: flex; align-items: center; gap: 10px; font-size: 15px; min-width: 0; }
.today-row b { font-family: var(--font); font-size: 15px; font-weight: 600; }
.today-row span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tag.bonus { margin: 0 0 0 8px; vertical-align: 2px; background: var(--blue-tint); color: var(--blue-ink); }
.bonus-line { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--blue-ink); background: var(--blue-tint); padding: 6px 10px; border-radius: 10px; }
.back.inline { margin: -8px 0 4px -8px; }
.orig { color: var(--faint) !important; font-size: 12px; }
.rate-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.rate-row:first-of-type { border-top: 0; }
.rate-row .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rate-row b { font-variant-numeric: tabular-nums; }
.chip-link.cur-chip { cursor: default; }

/* ---------- schedule ---------- */

.seg.small-seg { display: flex; padding: 3px; gap: 2px; border-radius: 12px; }
.seg.small-seg .seg-btn { min-height: 36px; padding: 0 12px; text-decoration: none; }
.month-sw.center { justify-content: space-between; margin-bottom: 12px; }
.month-sw.center .month-name { flex: 1; }
@media (min-width: 900px) { .month-sw.center { justify-content: flex-start; } .month-sw.center .month-name { flex: 0 0 auto; min-width: 200px; } }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.wday {
  min-height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink); text-decoration: none; padding: 0; width: 100%;
}
.wday small { font-size: 11px; font-weight: 600; color: var(--muted); }
.wday b { font-size: 17px; font-weight: 700; }
.wday.today { border: 2px solid var(--ink); }
.wdots { display: flex; gap: 3px; height: 7px; }
.wdots .dot { width: 7px; height: 7px; }
.sched-legend { margin: 0 2px 14px; }
.legend i.dot { min-height: 0 !important; padding: 0 !important; width: 10px; height: 10px; }
.sched-day { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; scroll-margin-top: 16px; }
.sched-day h2 { margin: 4px 2px 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sched-day h2.today { color: var(--ink); }
.sched-row {
  width: 100%; border: 0; border-top: 1px solid var(--line-2); background: transparent; color: var(--ink); text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 54px;
}
.sched-row:first-child { border-top: 0; }
.sched-row:hover { background: var(--surface-3); }
.sched-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sched-row b { font-size: 15px; font-weight: 600; }
.sched-row small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row .amt { font-family: var(--display); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sched-empty { color: var(--muted); font-size: 14px; margin: 0 2px 14px; scroll-margin-top: 16px; }
.sched-empty b { font-weight: 600; color: var(--ink-2); }
.card.dashed { background: transparent; border: 1.5px dashed var(--line-3); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; padding: 8px; margin-bottom: 12px; }
.mcal-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0 6px; text-transform: uppercase; }
.mcal-day {
  min-height: 58px; border-radius: 10px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink); text-decoration: none;
}
.mcal-day:not(.empty):hover { background: var(--surface-3); }
.mcal-day b { font-size: 15px; font-weight: 600; }
.mcal-day.today b { background: var(--ink); color: var(--surface); border-radius: 99px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.mcal-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.cnt { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #2A66B8; }
@media (min-width: 900px) { .mcal-day { min-height: 76px; } }

/* ---------- payments in another currency ---------- */

.seg.cur-seg .seg-btn { min-height: 42px; font-size: 15px; }
.conv { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-2); margin-top: -8px; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-top .link-btn { min-height: 36px; font-size: 14px; }
.conv-rate { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.conv-res { font-size: 15px; font-variant-numeric: tabular-nums; }
.conv-res b { color: var(--blue-ink); }
.conv small { font-size: 12px; }
.orig-line { color: var(--faint); font-size: 13px; }

/* ---------- TimeTree (test) ---------- */
:root { --tt: #2E9E6A; --tt-tint: #DDF3E8; --tt-ink: #1C6B46; }
@media (prefers-color-scheme: dark) { :root { --tt: #4CC08A; --tt-tint: #173628; --tt-ink: #8FE0B8; } }
.tag.tt { margin: 0; background: var(--tt-tint); color: var(--tt-ink); white-space: nowrap; }
.dot.tt { background: transparent; box-shadow: inset 0 0 0 2px var(--tt); }
.cnt.tt { background: var(--tt); }
.stime { flex: 0 0 42px; font-family: var(--display); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.sched-row.tt b { color: var(--ink-2); }
.sched-row.tt.late small { color: var(--orange-ink); }
.card.tt-status { flex-direction: row; align-items: center; gap: 12px; }
.tt-status .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tt-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: inset 3px 0 0 var(--tt); }
.tt-banner .grow { flex: 1; }
.tt-card { overflow: hidden; }
.tt-card .sched-row:first-of-type { border-top: 1px solid var(--line); }
.tt-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 14px; }
.tt-title { font-size: 20px; font-weight: 700; }
.flabel.small { margin: 8px 0 4px; font-size: 11px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
.tt-settings h2 .tag.tt { vertical-align: 3px; margin-left: 6px; }
.tt-settings h3 { font-size: 15px; margin: 16px 0 2px; }
.tt-map { display: flex; flex-direction: column; margin-top: 6px; }
.tt-map-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.tt-map-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tt-map-row small { color: var(--muted); font-size: 13px; }
.tt-cals { gap: 6px; }
.tt-cal-row { display: flex; align-items: center; gap: 10px; }
.tt-cal-row .grow { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tt-cal-row select { flex: 0 0 160px; }
.sched-row.tt.unknown { padding-top: 6px; padding-bottom: 6px; }
.sched-row.tt.unknown .ut { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row.tt.unknown .stime { color: var(--muted); font-weight: 500; }
.tt-guess { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding: 12px 14px; margin: 4px 0 12px; border-radius: 12px; background: var(--surface-2); }
.tt-guess .flabel { grid-column: 1 / -1; }
.tt-guess b { font-size: 16px; }
.tt-guess span:last-child { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.btn-pair { display: inline-flex; gap: 8px; }

/* ---------- settings: TimeTree folded ---------- */
.settings-grid .tt-settings { grid-column: 1 / -1; }
.tt-settings summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.tt-settings summary::-webkit-details-marker { display: none; }
.tt-settings summary h2 { margin: 0; }
.tt-settings summary .muted { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-settings summary svg { flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.tt-settings[open] summary { margin-bottom: 12px; }
.tt-settings[open] summary svg { transform: rotate(180deg); }
.btn.wide.center { justify-content: center; }

/* ---------- lesson reports ---------- */
.sheet { --acc: var(--sec-in); }
.rep-head { display: flex; flex-direction: column; gap: 2px; margin: 0 0 14px; }
.rep-head b { font-size: 18px; }
.rep-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rep-grade-line { margin: 4px 0 0; color: var(--ink-2); }
.rep-grade-line b { font-family: var(--display); font-size: 18px; }
.rep-grade { display: flex; align-items: baseline; gap: 6px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); margin-bottom: 14px; }
.rep-grade .flabel { flex: 1; }
.rep-grade b { font-family: var(--display); font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rep-grade small, .rep-tile small, .rs-val small, .eamt small { color: var(--muted); font-weight: 500; }
.rep-scores { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.rep-score { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.rs-label { font-size: 14px; color: var(--ink-2); }
.rs-val { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.rs-track { grid-column: 1 / -1; position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); }
.rs-track i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--acc); }
.rs-last { position: absolute; top: -3px; width: 2px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.rep-text { margin-bottom: 12px; }
.rep-text p { margin: 4px 0 0; white-space: pre-line; line-height: 1.45; }
.rep-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.rep-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.rep-tile b { font-family: var(--display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rep-tile small { font-size: 12px; }
.rep-trend { margin: 0 0 16px; }
.rep-trend svg { width: 100%; height: auto; display: block; margin-top: 6px; overflow: visible; }
.rep-trend .grid { stroke: var(--line); stroke-width: 1; }
.rep-trend .ax { fill: var(--muted); font-size: 10px; }
.rep-trend .line { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rep-trend .dot { fill: var(--acc); stroke: var(--surface); stroke-width: 2; }
.rep-trend .hit { fill: transparent; }
.rep-trend .pt { cursor: pointer; }
.rep-trend .pt:hover .dot, .rep-trend .pt:focus .dot { r: 6.5; }
.rep-list .erow { border-top: 1px solid var(--line); }
.rep-link { width: 100%; text-align: left; }
@media (max-width: 420px) { .rep-tile b { font-size: 22px; } }

/* ---------- reports window: tabs and cards ---------- */
:root { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --rp-up: #1c7a4a; --rp-down: #b4561a; --rp-focus: #fdf1e8; --rp-gold: #fff6dd; }
@media (prefers-color-scheme: dark) { :root { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --rp-up: #5fd39a; --rp-down: #f0a36b; --rp-focus: #3a2415; --rp-gold: #3a3214; } }
.rp-tabs { position: sticky; top: -1px; z-index: 2; margin-bottom: 12px; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-2); }
.rp-body { display: flex; flex-direction: column; gap: 12px; }
.rp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.rp-card h3 { margin: 0 0 2px; font-size: 16px; }
.rp-sub { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.rp-body > .rep-tiles { margin-bottom: 0; }
.rp-focus { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--rp-focus); margin-bottom: 14px; }
.rp-focus > b { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--rp-down); font-variant-numeric: tabular-nums; }
.rp-focus strong { display: block; font-size: 16px; }
.rp-focus small { color: var(--muted); font-size: 13px; }
.rp-arrows { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 12px; align-items: center; font-size: 14px; }
.rp-pct { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rp-delta { font-size: 13px; font-weight: 700; min-width: 60px; text-align: right; }
.rp-delta.up { color: var(--rp-up); } .rp-delta.down { color: var(--rp-down); }
.rp-meter { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); position: relative; margin: -2px 0 4px; }
.rp-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--acc); }
.rp-chart { width: 100%; height: auto; display: block; overflow: visible; }
.rp-chart text { font-size: 10px; fill: var(--muted); font-family: inherit; }
.rp-chart .lbl { fill: var(--ink-2); font-size: 11.5px; }
.rp-chart .val { fill: var(--ink); font-weight: 700; font-size: 11px; }
.rp-chart .grid { stroke: var(--line); stroke-width: 1; }
.rp-chart .c1 { fill: var(--c1); } .rp-chart .c2 { fill: var(--c2); } .rp-chart .c3 { fill: var(--c3); } .rp-chart .c4 { fill: var(--c4); }
.rp-chart .hit { fill: transparent; cursor: pointer; }
.rp-chart .hit:hover { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.rp-chart .dumb { stroke: var(--acc); stroke-width: 2; }
.rp-chart .was { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.rp-chart .now { fill: var(--acc); stroke: var(--surface); stroke-width: 2; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.rp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.rp-legend .c1 { background: var(--c1); } .rp-legend .c2 { background: var(--c2); } .rp-legend .c3 { background: var(--c3); } .rp-legend .c4 { background: var(--c4); }
.rp-legend .was { background: var(--surface); box-shadow: inset 0 0 0 2px var(--muted); border-radius: 99px; }
.rp-legend .now, .rp-legend .acc { background: var(--acc); }
.rp-legend .now { border-radius: 99px; }
.rp-legend .tick { width: 3px; background: var(--ink); }
.rp-phr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-bottom: 12px; }
.rp-phr .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-2); position: relative; }
.rp-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--c2); }
.rp-dates { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.chip-date { border: 1px solid var(--line-3); background: var(--surface); border-radius: 99px; padding: 2px 9px; font-size: 12px; color: var(--ink-2); }
.chip-date:hover { background: var(--surface-3); }
.rp-rec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.rp-rec > div, .rp-rec > button { background: var(--surface-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 1px; border: 0; text-align: left; color: var(--ink); }
.rp-rec b { font-family: var(--display); font-size: 24px; font-variant-numeric: tabular-nums; }
.rp-rec small { color: var(--muted); font-size: 12px; }
.rp-rec b small { font-size: 14px; }
.rp-rec .wide { grid-column: 1 / -1; flex-direction: row; gap: 12px; align-items: center; background: var(--rp-gold); cursor: pointer; }
.rp-rec .wide > span:last-child { display: flex; flex-direction: column; }
.rp-rec .wide b { font-size: 30px; }
.rp-rec .medal { font-size: 28px; }
.rp-miles { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.rp-miles li { display: flex; gap: 8px; } .rp-miles small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.rp-private { margin: -4px 0 12px; font-size: 12px; font-weight: 700; color: var(--rp-down); }
.rp-cmp { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: baseline; margin-bottom: 12px; font-size: 14px; }
.rp-cmp .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-cmp small { color: var(--muted); font-weight: 500; }
.rp-track { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--surface-2); position: relative; }
.rp-track i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--acc); }
.rp-track b { position: absolute; top: -4px; width: 3px; height: 18px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); }
.rp-list { padding: 14px 0 0; overflow: hidden; }
.rp-list h3 { padding: 0 14px 8px; }
.rp-months { margin-bottom: 12px; display: flex; overflow-x: auto; }
.rp-cardwrap img { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; border-radius: 22px; box-shadow: 0 6px 24px rgba(20, 20, 60, .18); }
.rp-tabs { box-shadow: 0 -14px 0 10px var(--bg); }
.rp-card .rp-legend + .rp-sub { margin-top: 10px; margin-bottom: 0; }
@media (min-width: 900px) {
  .rp-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .rp-body > .rep-tiles, .rp-body > .rp-list, .rp-body > .rp-sub, .rp-body > .rp-months, .rp-body > .rp-cardwrap { grid-column: 1 / -1; }
}
.hint.warn { color: var(--orange-ink); font-weight: 600; background: var(--orange-tint); padding: 8px 12px; border-radius: 12px; margin: -4px 0 12px; }

/* ---------- birthdays ---------- */
:root { --bday: #fff3d6; --bday-ink: #6b4a00; --bday-line: #f3d58a; }
@media (prefers-color-scheme: dark) { :root { --bday: #3a2f12; --bday-ink: #ffd982; --bday-line: #6b5520; } }
.bday-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 10px 12px 14px; border-radius: 16px; background: var(--bday); border: 1px solid var(--bday-line); color: var(--bday-ink); animation: fade .3s ease-out; }
.bday-banner .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bday-banner b { font-size: 15px; }
.bday-banner .bday-names { font-size: 15px; }
.bday-banner a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.bday-banner small { color: inherit; opacity: .8; }
.bday-ico { font-size: 28px; line-height: 1; }
.bday-close { flex-shrink: 0; width: 36px; height: 36px; border-radius: 99px; border: 0; background: rgba(0, 0, 0, .06); color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.bday-close:hover { background: rgba(0, 0, 0, .12); }
.bday-line { margin: 0; font-size: 14px; color: var(--ink-2); }
.bday-fields { display: grid; grid-template-columns: minmax(92px, 1fr) minmax(0, 1.4fr) minmax(84px, 1fr); gap: 8px; max-width: 440px; }
.bday-fields .input { min-width: 0; }

/* ---------- missing reports: full-screen red notice ---------- */
.nag { position: fixed; inset: 0; z-index: 200; overflow-y: auto; background: #b0121d; background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.06) 0 18px, transparent 18px 36px); color: #fff; padding: calc(24px + var(--safe-top, 0px)) 20px calc(32px + var(--safe-bottom, 0px)); animation: fade .2s ease-out; }
.nag-close { position: fixed; top: calc(14px + var(--safe-top, 0px)); right: 14px; width: 48px; height: 48px; border-radius: 99px; border: 2px solid rgba(255,255,255,.7); background: rgba(0,0,0,.18); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.nag-close:hover { background: rgba(0,0,0,.32); }
.nag-inner { max-width: 640px; margin: 0 auto; padding-top: 40px; }
.nag-sign { width: 64px; height: 64px; border-radius: 99px; background: #fff; color: #b0121d; font: 800 44px/64px var(--display, system-ui); text-align: center; margin-bottom: 18px; box-shadow: 0 0 0 8px rgba(255,255,255,.18); }
.nag h1 { margin: 0 0 8px; font: 800 30px/1.15 var(--display, system-ui); letter-spacing: .02em; }
.nag-sub { margin: 0 0 20px; font-size: 15px; opacity: .9; }
.nag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nag-list a { display: block; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); color: #fff; font-size: 16px; text-decoration: underline; text-decoration-color: rgba(255,255,255,.55); text-underline-offset: 3px; }
.nag-list a:hover, .nag-list a:focus { background: rgba(255,255,255,.22); }
.nag-list b { font-weight: 800; }
.nag-date { font-variant-numeric: tabular-nums; font-weight: 700; }
html.nag-open, html.nag-open body { overflow: hidden; }
@media (min-width: 900px) { .nag h1 { font-size: 40px; } .nag-inner { padding-top: 70px; } }

/* ---------- time in other cities (home) ---------- */
:root { --tz-day: #d9e8fb; --tz-night: #8fbcf0; --tz-dawn: #2a66b8; }
@media (prefers-color-scheme: dark) { :root { --tz-day: #2a4c75; --tz-night: #101d2b; --tz-dawn: #8ab8f0; } }
.tz-card { padding: 16px; }
.home-grid > .tz-card { max-width: none; }
.tz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tz-head h2 { margin: 0; font-size: 17px; }
.tz-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tz-names { padding: 0 2px 6px; }
.tz-names span { font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; color: var(--ink-2); }
.tz-box { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.tz-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 0 2px; }
.tz-scroll::-webkit-scrollbar { display: none; }
.tz-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.tz-hour { height: 40px; }
.tz-hour span { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 36px; margin-top: 2px; border-radius: 8px; background: var(--tz-day); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.05; }
.tz-hour span.night { background: var(--tz-night); }
.tz-hour span.dawn { box-shadow: inset 0 3px 0 var(--tz-dawn); }
.tz-hour small { font-size: 9px; font-weight: 800; letter-spacing: .06em; color: var(--tz-dawn); }
.tz-frame { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); pointer-events: none; }
.tz-frame > .tz-cols { height: 46px; margin: 0 2px; padding: 0; background: var(--surface); border: 2px solid var(--blue); border-radius: 12px; box-shadow: 0 4px 16px rgba(15, 30, 60, .22); align-items: center; }
.tz-frame > .tz-cols span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.tz-frame small { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.tz-frame small.other { color: var(--orange-ink); }
.tz-frame b { font-family: var(--display); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .tz-names span { font-size: 13px; }
  .tz-frame b { font-size: 20px; }
}
.nag-sec { font-style: normal; font-size: 12px; margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.2); text-decoration: none; display: inline-block; }

/* ---------- the student's own view ---------- */

.stu { --acc: var(--sec-in); }
.stu .main.stu-main { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.stu-main > .page-head { margin-bottom: 2px; }
.stu-head { align-items: center; flex-wrap: nowrap; }
.stu-head .eyebrow { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; }
.stu-main .list { margin-top: 0; }
.stu-main .group-title:first-child, .stu-first { border-top: 0; }
.stu-next { gap: 10px; }
.stu-when { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.stu-when .emain b { font-size: 16px; }
.stu-when .emain small { font-size: 14px; }
.stu-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 8px 10px; border-radius: 14px; background: var(--blue); color: #fff; line-height: 1.05; }
.stu-day b { font-family: var(--display); font-size: 24px; font-weight: 600; }
.stu-day small { font-size: 12px; opacity: .9; }
.stu-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stu-tile { gap: 4px; color: var(--ink); text-decoration: none; min-width: 0; }
.stu-tile b { font-family: var(--display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stu-tile b.stu-money { font-size: 22px; }
.stu-tile small { color: var(--muted); font-size: 13px; }
.stu-quote { gap: 6px; color: var(--ink); text-decoration: none; }
.stu-quote p { line-height: 1.45; }
.stu-quote .link-btn { min-height: 32px; padding: 0; }
.stu-main a.erow { text-decoration: none; }
.stu-chip { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.stu-chip.paid { background: var(--blue-tint); color: var(--blue-ink); }
.stu-chip.part { background: var(--orange-tint); color: var(--orange-ink); }
.stu-chip.debt { background: var(--orange); color: #fff; }
.stu-chip.plan { background: var(--blue-tint); color: var(--blue-ink); }
.stu-rep .rs-label small { font-size: 12px; }
.stu .rp-cardwrap { margin: 4px 0 8px; }
.stu .rp-cardwrap img { max-width: 360px; }
@media (min-width: 900px) {
  .stu .tabbar.stu-tabbar { display: grid !important; left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; }
  .stu .main.stu-main { padding-bottom: calc(110px + var(--safe-bottom)); }
}
.acc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.acc-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.acc-row.off { opacity: .6; }
.acc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-top b { flex: 1; min-width: 0; font-size: 16px; }
.acc-pw { font: 600 15px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 5px 9px; border-radius: 8px; user-select: all; }
.acc-on { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-height: 36px; }
.acc-on input { width: 20px; height: 20px; accent-color: var(--blue); }
.acc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-btns .btn { min-height: 40px; padding: 0 12px; font-size: 14px; }
.acc-btns .btn.armed { white-space: normal; }

/* ---------- «База тренировок» ---------- */

:root { --sec-work: #1B8A6B; }
@media (prefers-color-scheme: dark) { :root { --sec-work: #3CBF97; } }
.sec-workouts > .sec-mark { background: var(--sec-work); }
.home-card.sec-workouts .home-ico { background: #DDF3EC; color: #146B53; }
@media (prefers-color-scheme: dark) { .home-card.sec-workouts .home-ico { background: #123A30; color: #7FDDBF; } }

/* ---------- section overview (wide screens, no student picked) ---------- */
.ov { display: flex; flex-direction: column; gap: 14px; }
.ov-hint { color: var(--muted); font-size: 14px; padding: 2px 4px; }
.ov-card .card-head { padding-bottom: 8px; }
.ov-card .card-head .muted { font-size: 13px; }
.ov-card .erow .avatar { width: 36px; height: 36px; font-size: 15px; }
.tr-time { font-variant-numeric: tabular-nums; min-width: 44px; }
.home-card .home-body { flex: 1; align-content: start; }
a.erow { text-decoration: none; color: var(--ink); }

/* ---------- link to the lessons ---------- */
.chip-link.meet-chip.on { background: var(--blue-tint); color: var(--blue-ink); border-color: transparent; font-weight: 600; }
.stu-meet { justify-content: center; margin: 12px 0 0; text-decoration: none; }

/* ---------- «Перечень тем» ---------- */
.tp-row.arch .emain > span:first-child { color: var(--muted); }
.tp-row .eright small { white-space: nowrap; }
.tp-secs { display: grid; gap: 14px; }
@media (min-width: 900px) { .tp-secs { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.tp-sec-head { text-decoration: none; color: inherit; }
.tp-sec-head .muted { display: inline-flex; align-items: center; gap: 4px; }
.tp-pick { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tp-pick summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 48px; }
.tp-pick summary::-webkit-details-marker { display: none; }
.tp-pick summary .flabel { margin: 0; flex-shrink: 0; }
.tp-pick .tp-sum { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-pick summary svg { flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.tp-pick[open] summary svg { transform: rotate(180deg); }
.tp-pick .plist { padding: 0 8px 4px; max-height: 320px; overflow-y: auto; }
.tp-pick .hint { padding: 0 14px; }
.tp-new { display: flex; gap: 8px; padding: 8px 12px 12px; }
.tp-new .input { flex: 1; min-width: 0; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-chips i { font-style: normal; font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }

/* ---------- time of a lesson, the student's zone ---------- */
.time-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.time-row .input { width: 140px; }
.tz-line { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); font-size: 14px; }
.etime { font-variant-numeric: tabular-nums; }

/* ---------- the grade in a report ---------- */
.rep-grade-pick { display: flex; flex-direction: column; gap: 10px; }
.rep-grade-pick .seg { max-width: 260px; }
.grade-chips { display: grid; gap: 6px; }
.grade-chips.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 320px; }
.grade-chips.g10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.grade-chips .chip { justify-content: center; padding: 0; min-height: 44px; font-size: 16px; font-weight: 700; }
.grade-chips .chip[aria-pressed="true"] { padding: 0; }
.tabbar.stu-tabbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tz-line svg { flex-shrink: 0; margin-top: 2px; }
