/* Anwesenheit — design tokens and components.
   One idea carries the design: the school day as a time band. Everything else stays quiet. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/Inter-Regular.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/Inter-Medium.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/static/fonts/Inter-SemiBold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/static/fonts/Inter-Bold.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 600; font-style: normal; font-display: swap; src: url("/static/fonts/InterDisplay-SemiBold.woff") format("woff"); }

:root {
  color-scheme: light;
  --canvas: #EDF0F2;
  --surface: #FFFFFF;
  --surface-2: #F6F8F9;
  --line: #D9DFE4;
  --line-soft: #E8ECEF;
  --ink: #15202B;
  --ink-2: #3E4A56;
  --muted: #5D6975;
  --brand: #0E6B5C;
  --brand-ink: #0A4D42;
  --brand-tint: #E3F1EE;
  --on-brand: #FFFFFF;

  --ok: #1E7D46;    --ok-bg: #DDF2E5;
  --late: #8A5A00;  --late-bg: #FBEFD3;
  --part: #A3470F;  --part-bg: #FCE6D7;
  --miss: #B3261E;  --miss-bg: #FADDDB;
  --exc: #3F4BC4;   --exc-bg: #E3E6FB;
  --abs: #44505C;   --abs-bg: #E6E9EC;

  --band-lesson: #E3E8EC;
  --band-present: #1E7D46;
  --band-open: #63B488;
  --band-refused: #B3261E;
  --band-now: #15202B;

  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);
}

/* Theme: follows the device unless the person picks Hell or Dunkel (html[data-theme]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0E151A;
    --surface: #151E25;
    --surface-2: #1A242C;
    --line: #2A3640;
    --line-soft: #222D36;
    --ink: #E7ECEF;
    --ink-2: #C3CDD4;
    --muted: #93A1AC;
    --brand: #3DB596;
    --brand-ink: #7FD6C0;
    --brand-tint: #16332D;
    --on-brand: #06231D;
    --ok: #6FD39A;   --ok-bg: #173527;
    --late: #E9BE5C; --late-bg: #3A2E12;
    --part: #F09A62; --part-bg: #3D2516;
    --miss: #F2867F; --miss-bg: #3D1C1A;
    --exc: #A9B1FF;  --exc-bg: #24284D;
    --abs: #B5C0C9;  --abs-bg: #26313A;
    --band-lesson: #24303A;
    --band-present: #4CC283;
    --band-open: #2E7D57;
    --band-refused: #F2867F;
    --band-now: #E7ECEF;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0E151A;
  --surface: #151E25;
  --surface-2: #1A242C;
  --line: #2A3640;
  --line-soft: #222D36;
  --ink: #E7ECEF;
  --ink-2: #C3CDD4;
  --muted: #93A1AC;
  --brand: #3DB596;
  --brand-ink: #7FD6C0;
  --brand-tint: #16332D;
  --on-brand: #06231D;
  --ok: #6FD39A;   --ok-bg: #173527;
  --late: #E9BE5C; --late-bg: #3A2E12;
  --part: #F09A62; --part-bg: #3D2516;
  --miss: #F2867F; --miss-bg: #3D1C1A;
  --exc: #A9B1FF;  --exc-bg: #24284D;
  --abs: #B5C0C9;  --abs-bg: #26313A;
  --band-lesson: #24303A;
  --band-present: #4CC283;
  --band-open: #2E7D57;
  --band-refused: #F2867F;
  --band-now: #E7ECEF;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; }
h1 { font: 600 26px/1.2 var(--font-display); letter-spacing: -0.015em; }
h2 { font-size: 15px; line-height: 1.35; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-ink); }
.num, time, .t { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--r-sm); }
.seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 2px; background: var(--surface-2); }
.seg button { border: 0; min-height: 34px; padding: 0 14px; background: transparent; color: var(--ink-2); border-radius: 6px; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(10, 20, 30, .08), 0 0 0 1px var(--line); }
::selection { background: var(--brand-tint); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- controls ---------- */
.btn, button {
  font: 500 14px/1 var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); min-height: 40px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease;
}
.btn:hover, button:hover { background: var(--surface-2); border-color: #C6CED5; color: var(--ink); }
.btn:active, button:active { transform: translateY(0.5px); }
button:disabled { opacity: .5; cursor: default; }
.btn.primary, button.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover, button.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: var(--on-brand); }
.btn.quiet, button.quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover, button.quiet:hover { background: var(--surface-2); }
button.danger, .btn.danger { color: var(--miss); }
button.danger:hover { border-color: var(--miss); background: var(--miss-bg); }
.btn.sm, button.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.linkbtn {
  background: none; border: 0; padding: 0; min-height: 0; color: var(--brand); font: inherit; font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; cursor: pointer;
}
.linkbtn:hover { background: none; color: var(--brand-ink); }

input, select, textarea {
  font: 400 14px/1.4 var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); min-height: 40px; padding: 8px 12px; width: 100%;
}
input:hover, select:hover, textarea:hover { border-color: #C6CED5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); border-radius: var(--r); }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: var(--s2); font-size: 14px; color: var(--ink); cursor: pointer; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s3); }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel > .hd { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: 14px var(--s4); border-bottom: 1px solid var(--line-soft); }
.panel > .bd { padding: var(--s4); }
.panel > .bd.flush { padding: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.between { justify-content: space-between; }

.notice { display: flex; gap: var(--s2); align-items: flex-start; border-radius: var(--r); padding: 10px 12px; font-size: 14px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-soft); }
.notice.warn { background: var(--late-bg); color: var(--late); border-color: transparent; }
.notice.bad { background: var(--miss-bg); color: var(--miss); border-color: transparent; }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r);
  font-size: 14px; font-weight: 500; z-index: 50; max-width: calc(100vw - 32px);
  box-shadow: 0 8px 24px rgba(10, 20, 30, .22);
}

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.t-full { color: var(--ok); } .t-partial { color: var(--part); } .t-absent { color: var(--miss); }
.t-excused { color: var(--exc); } .t-future, .t-none { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.s-ok { background: var(--ok-bg); color: var(--ok); } .s-late { background: var(--late-bg); color: var(--late); }
.s-part { background: var(--part-bg); color: var(--part); } .s-miss { background: var(--miss-bg); color: var(--miss); }
.s-exc { background: var(--exc-bg); color: var(--exc); } .s-abs { background: var(--abs-bg); color: var(--abs); }
.s-future, .s-running, .s-none { background: var(--surface-2); color: var(--muted); }
.sev-bad { color: var(--miss); } .sev-warn { color: var(--late); } .sev-info { color: var(--exc); }

/* ---------- the day band ---------- */
.band { position: relative; height: 24px; border-radius: 4px; }
.band .zone { position: absolute; top: 2px; bottom: 2px; background: var(--band-lesson); border-radius: 3px; }
.band .zone.s-miss { background: var(--miss-bg); }
.band .zone.s-exc, .band .zone.s-abs { background: var(--exc-bg); }
.band .bar { position: absolute; top: 8px; height: 8px; background: var(--band-present); border-radius: 4px; min-width: 3px; }
.band .bar.open { background: linear-gradient(90deg, var(--band-present), var(--band-open)); }
.band .tick { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: var(--band-refused); border-radius: 1px; }
.band .now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--band-now); border-radius: 1px; }
.band.lg { height: 40px; }
.band.lg .bar { top: 14px; height: 12px; border-radius: 6px; }
.axis { position: relative; height: 18px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s4); font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; vertical-align: -1px; margin-right: 6px; border-radius: 2px; }
.legend .l-zone { width: 14px; height: 10px; background: var(--band-lesson); }
.legend .l-bar { width: 14px; height: 6px; background: var(--band-present); border-radius: 3px; vertical-align: 1px; }
.legend .l-tick { width: 2px; height: 12px; background: var(--band-refused); }
.legend .l-now { width: 2px; height: 12px; background: var(--band-now); }

/* ---------- event log ---------- */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 48px 10px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.log li:first-child { border-top: 0; }
.log time { font-weight: 600; }
.log .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); align-self: center; }
.log .dot.in { background: var(--ok); } .log .dot.out { background: var(--muted); } .log .dot.warn { background: var(--late); }
.log .dot.bad { background: var(--miss); } .log .dot.void { background: var(--line); }
.log .what { font-weight: 500; }
.log .detail { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.log .void .what, .log .void .detail { text-decoration: line-through; color: var(--muted); }

.meter { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line-soft); overflow: hidden; }
.meter > div { height: 100%; background: var(--brand); }
.meter.warn > div { background: var(--late); } .meter.over > div { background: var(--miss); }

details.disclose { border-top: 1px solid var(--line-soft); }
details.disclose > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 0; font-weight: 500; font-size: 14px; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); margin-right: 4px; }
details.disclose[open] > summary::after { transform: rotate(-135deg); }
details.disclose > .inner { padding-bottom: var(--s4); }

/* ---------- phone pages ---------- */
.phone { max-width: 520px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--s3); }
.phone body, body.phone-body { font-size: 16px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 4px 2px 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; flex: none; }
.mark .icon { width: 18px; height: 18px; stroke-width: 2; }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand > span:not(.mark) > span { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }

.hero { padding: 20px var(--s4) var(--s4); }
.hero .greet { font-size: 14px; color: var(--muted); }
.hero .state { margin-top: 10px; font-size: 15px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.hero .state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.hero.in .state::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.hero.out .state::before { background: var(--part); }
.hero .clock { font: 600 64px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.hero .clock.dim { color: var(--muted); font-size: 40px; letter-spacing: -0.02em; }
.hero .lesson { margin-top: 12px; font-size: 14px; color: var(--ink-2); }

.actions { display: grid; gap: var(--s2); }
.tap { min-height: 68px; font-size: 19px; font-weight: 600; border-radius: var(--r-lg); width: 100%; }
.tap.secondary { min-height: 52px; font-size: 16px; font-weight: 500; }
.spinner { width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

.result { border-radius: var(--r-lg); padding: 14px var(--s4); display: flex; gap: var(--s3); align-items: center; }
.result.ok { background: var(--ok-bg); color: var(--ok); }
.result.bad { background: var(--miss-bg); color: var(--miss); }
.result.warn { background: var(--late-bg); color: var(--late); }
.result .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.result .rt { font: 600 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.result .rm { font-size: 14px; font-weight: 500; margin-top: 2px; }

.code { font: 600 22px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; text-align: center; font-variant-numeric: tabular-nums; }
ol.steps { margin: 0; padding-left: 20px; font-size: 14px; } ol.steps li { margin: 4px 0; }

/* ---------- teacher app ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s4); position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 6px; }
.side .field { padding: 0 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { justify-content: flex-start; border: 0; background: transparent; color: var(--ink-2); font-weight: 500; min-height: 38px; padding: 0 10px; gap: 10px; width: 100%; }
.nav button:hover { background: var(--surface-2); }
.nav button.on { background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; }
.side .me { margin-top: auto; border-top: 1px solid var(--line-soft); padding: var(--s3) 6px 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.side .me b { display: block; font-size: 13px; font-weight: 600; }
.side .me span { display: block; font-size: 12px; color: var(--muted); }
.content { min-width: 0; padding: var(--s5) var(--s6) var(--s7); max-width: 1320px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.pagehead .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.datectl { display: flex; gap: var(--s2); align-items: center; }
.datectl input { width: 150px; }
.datectl .icon-btn { width: 40px; padding: 0; }

.summary { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0; margin-bottom: var(--s4); }
.summary > div { padding: var(--s4) var(--s5); }
.summary > div + div { border-left: 1px solid var(--line-soft); }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); margin: 12px 0 14px; gap: 2px; }
.split > span { display: block; height: 100%; }
.split .k-full { background: var(--ok); } .split .k-partial { background: var(--part); }
.split .k-absent { background: var(--miss); } .split .k-excused { background: var(--exc); } .split .k-future { background: var(--line); }
.counts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.counts div { display: flex; flex-direction: column; }
.counts b { font: 600 24px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.counts span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.counts span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.counts .k-full span::before { background: var(--ok); } .counts .k-partial span::before { background: var(--part); }
.counts .k-absent span::before { background: var(--miss); } .counts .k-excused span::before { background: var(--exc); }
.facts { display: flex; flex-direction: column; gap: 10px; justify-content: center; height: 100%; }
.facts div { display: flex; justify-content: space-between; gap: var(--s3); font-size: 14px; color: var(--ink-2); }
.facts b { font-variant-numeric: tabular-nums; color: var(--ink); }

.work { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s4); align-items: start; }
.work > .detail { position: sticky; top: var(--s4); }

.issues { list-style: none; margin: 0; padding: 0; }
.issues li + li { border-top: 1px solid var(--line-soft); }
.issues button { width: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; justify-content: flex-start; align-items: flex-start; text-align: left; white-space: normal; padding: 10px var(--s4); gap: var(--s3); font-weight: 400; }
.issues button:hover { background: var(--surface-2); }
.issues .who { font-weight: 600; min-width: 140px; color: var(--ink); }
.issues .what { color: var(--ink-2); }
.issues .icon { margin-top: 2px; }

.board { width: 100%; border-collapse: collapse; font-size: 14px; }
.board th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px var(--s3) 6px; white-space: nowrap; }
.board th.bandcol { padding-bottom: 0; }
.board td { padding: 8px var(--s3); border-top: 1px solid var(--line-soft); vertical-align: middle; }
.board tr.sel td { background: var(--brand-tint); }
.board tbody tr:hover td { background: var(--surface-2); }
.board tbody tr.sel:hover td { background: var(--brand-tint); }
.board .name { font-weight: 600; color: var(--ink); text-decoration: none; background: none; border: 0; padding: 0; min-height: 0; font-size: 14px; text-align: left; white-space: nowrap; }
.board .name:hover { text-decoration: underline; background: none; }
.board .bandcol { width: 100%; min-width: 280px; }
.board td:first-child, .board th:first-child { padding-left: var(--s4); white-space: nowrap; }
.board td:last-child, .board th:last-child { padding-right: var(--s4); }
.unlinked { color: var(--muted); display: inline-flex; vertical-align: -3px; margin-left: 4px; position: relative; }
.unlinked::after { content: ""; position: absolute; left: 1px; right: 1px; top: 50%; height: 1.6px; background: currentColor; transform: rotate(-45deg); }
.lessonhead { position: relative; height: 34px; }
.lessonhead span { position: absolute; top: 0; bottom: 4px; border-left: 1px solid var(--line); padding: 0 4px 0 6px; font-size: 11px; line-height: 1.3; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lessonhead b { display: block; color: var(--ink-2); font-weight: 600; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.filters { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); padding: 2px; background: var(--surface-2); flex-wrap: wrap; }
.filters button { border: 0; min-height: 30px; padding: 0 10px; font-size: 13px; background: transparent; color: var(--ink-2); border-radius: 6px; }
.filters button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(10, 20, 30, .08), 0 0 0 1px var(--line); }
.tablewrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px var(--s3); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child, .table th:first-child { padding-left: var(--s4); }
.table td:last-child, .table th:last-child { padding-right: var(--s4); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s4); align-items: start; }
.ttday { padding: var(--s4); border-top: 1px solid var(--line-soft); }
.ttday:first-child { border-top: 0; }
.ttrow { display: grid; grid-template-columns: 120px 120px minmax(0, 1fr) auto; gap: var(--s2); align-items: center; margin-top: var(--s2); }
.ttrow input { min-height: 36px; }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: var(--s6) var(--s4); border: 1.5px dashed var(--line); cursor: pointer; transition: border-color .12s ease, background-color .12s ease; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-tint); }
.dropzone:focus-within { box-shadow: var(--focus); }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin-bottom: 4px; }
.dropzone .dz-icon .icon { width: 22px; height: 22px; }
.dropzone b { font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border-top: 1px solid var(--line-soft); }
.week.days6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .week.days7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week > div { background: var(--surface); padding: var(--s3); min-width: 0; }
.week h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.week h4 span { display: block; font-weight: 400; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lcard { border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 6px 6px 0; padding: 6px 8px; margin-bottom: 6px; font-size: 12.5px; line-height: 1.35; }
.lcard time { display: block; font-weight: 600; font-size: 12px; }
.lcard .subj { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.lcard .who { color: var(--ink-2); overflow-wrap: anywhere; }
.lcard .kind { color: var(--muted); font-size: 11.5px; }
.weekrow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 12px var(--s4); border-top: 1px solid var(--line-soft); }
.weekrow:first-child { border-top: 0; }
.weekrow .when { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 170px; }
.weekrow .meta { color: var(--muted); font-size: 13px; flex: 1; min-width: 180px; }
@media (max-width: 860px) { .week, .week.days6, .week.days7 { grid-template-columns: minmax(0, 1fr); } }
.settings { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: var(--s5); align-items: start; }
.subnav { position: sticky; top: var(--s4); display: flex; flex-direction: column; gap: 2px; }
.subnav a { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 7px 10px; border-radius: var(--r); }
.subnav a:hover { background: var(--surface); color: var(--ink); }
.panel > .hd p { margin-top: 2px; }
.panel > .ft { display: flex; align-items: center; justify-content: flex-end; gap: var(--s3); padding: 12px var(--s4); border-top: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.panel > .ft [data-changed] { margin-right: auto; }
.readonly input, .readonly select { background: var(--surface-2); color: var(--ink-2); }
.readonly .ft { display: none; }
.personrow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.personrow:first-child { border-top: 0; }
.personrow .who { flex: 1 1 200px; min-width: 0; }
.personrow .who b { display: block; }
.personrow .who span { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 6px; font-size: 13px; cursor: pointer; background: var(--surface); }
.chips label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-ink); }
.chips input { width: 14px; height: 14px; }
.secret { font: 600 18px/1.2 var(--font); letter-spacing: .06em; font-variant-numeric: tabular-nums; user-select: all; }
@media (max-width: 860px) { .settings { grid-template-columns: minmax(0, 1fr); } .subnav { position: static; flex-direction: row; flex-wrap: wrap; } }
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); }
.login form { width: 100%; max-width: 380px; }

@media (max-width: 1100px) {
  .work, .cols { grid-template-columns: minmax(0, 1fr); }
  .work > .detail { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side .brand { flex: 1 1 auto; min-width: 0; }
  .side .brand > span:not(.mark) > span { display: none; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px var(--s3); gap: var(--s2); border-right: 0; border-bottom: 1px solid var(--line); }
  .side .nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; gap: 4px; }
  .side .nav button { width: auto; padding: 0 10px; }
  .side .field { flex: 1; min-width: 140px; }
  .side .field .lbl { display: none; }
  .side .me { margin: 0; border: 0; padding: 0; }
  .side .me div { display: none; }
  .content { padding: var(--s4) var(--s3) var(--s6); }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .pagehead { margin-bottom: var(--s4); }
  .datectl { width: 100%; } .datectl input { flex: 1; width: auto; }
  .summary > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .summary > div { padding: var(--s4); }
  .board .bandcol { min-width: 220px; }
  .ttrow { grid-template-columns: 1fr 1fr; }
  .issues .who { min-width: 0; }
  .issues button { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
@media print {
  .side, .datectl, .filters, .detail { display: none !important; }
  .app { display: block; } body { background: #fff; }
}
