/* Studio Tracker styles. Tokens, fonts and components follow the team-project-tracker.html demo. */
:root {
  /* Layout: one simple page per role. Admin sees a filter row and a plain list of project rows; members see a short list of their own project cards with a big days-left tile. */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EDF0F5;
  --line: #DCE2EA;
  --fg: #17202C;
  --muted: #566475;
  --accent: #3447D1;
  --accent-fg: #FFFFFF;
  --accent-soft: #E4E8FB;
  --ok: #17693A;
  --ok-bg: #DDF2E5;
  --warn: #8A4B00;
  --warn-bg: #FCEBC8;
  --bad: #A3201C;
  --bad-bg: #FBE0DD;
  --neutral-bg: #E6EAF0;
  --dev-bg: #E4E8FB; --dev-fg: #2F3FB8;
  --des-bg: #F6E3F0; --des-fg: #8A2A6A;
  --aso-bg: #DDEFF2; --aso-fg: #0F5F70;
  --mod-bg: #E3F1DB; --mod-fg: #2F6B1F;
  --push-bg: #1E2631; --push-fg: #F1F4F8; --push-muted: #A9B4C2; --push-ico: #6F82FF;
  --push-warn: #F2C36B; --push-bad: #FF9B94;
  --overlay: rgba(15, 22, 32, .5);
  --shadow: 0 10px 30px rgba(20, 30, 45, .16);
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E131A; --surface: #161D27; --surface-2: #202A37; --line: #2A3544;
    --fg: #E7ECF2; --muted: #98A6B8;
    --accent: #8E9CFF; --accent-fg: #0E131A; --accent-soft: #232B52;
    --ok: #7FD8A1; --ok-bg: #173424; --warn: #F2C36B; --warn-bg: #3A2C10; --bad: #FF9B94; --bad-bg: #43201E;
    --neutral-bg: #232D3A;
    --dev-bg: #232B52; --dev-fg: #AEB9FF; --des-bg: #3A2133; --des-fg: #F0A8D8; --aso-bg: #12333B; --aso-fg: #8ED6E6; --mod-bg: #1F3319; --mod-fg: #A5DB8F;
    --push-bg: #222B38; --overlay: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E131A; --surface: #161D27; --surface-2: #202A37; --line: #2A3544;
  --fg: #E7ECF2; --muted: #98A6B8;
  --accent: #8E9CFF; --accent-fg: #0E131A; --accent-soft: #232B52;
  --ok: #7FD8A1; --ok-bg: #173424; --warn: #F2C36B; --warn-bg: #3A2C10; --bad: #FF9B94; --bad-bg: #43201E;
  --neutral-bg: #232D3A;
  --dev-bg: #232B52; --dev-fg: #AEB9FF; --des-bg: #3A2133; --des-fg: #F0A8D8; --aso-bg: #12333B; --aso-fg: #8ED6E6; --mod-bg: #1F3319; --mod-fg: #A5DB8F;
  --push-bg: #222B38; --overlay: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 56px;
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1120px; margin: 0 auto; }
.narrow { max-width: 820px; margin: 0 auto; }
.lead { color: var(--muted); margin-top: 4px; }

/* Top bar */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; flex: none; }
.brand b { font-family: var(--font-display); font-size: 19px; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 13px; }
.bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }

/* Controls */
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 9px 16px; min-height: 40px; border-radius: 9px; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: 14px; }
.btn.quiet-danger { color: var(--bad); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
select, input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%; min-width: 0; min-height: 42px;
}
select.compact { width: auto; }

/* Page structure */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 10px 0; color: var(--muted); font-weight: 600; font-size: 16px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 24px 0 16px; }
.page-head h1 { font-size: 30px; }
.head-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Filter chips */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.filters .grow { flex: 1; min-width: 4px; }

/* Project rows (admin) */
.ptype { color: var(--muted); font-size: 14px; }
.remark { margin-top: 8px; padding: 7px 10px; background: var(--surface-2); border-radius: 8px; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.remark b { color: var(--fg); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; }
.who .nm { font-weight: 500; line-height: 1.2; }
.who .jb { color: var(--muted); font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.job-dev { background: var(--dev-bg); color: var(--dev-fg); }
.job-des { background: var(--des-bg); color: var(--des-fg); }
.job-aso { background: var(--aso-bg); color: var(--aso-fg); }
.job-mod { background: var(--mod-bg); color: var(--mod-fg); }
.jobchip { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; vertical-align: 1px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.muted-tag { color: var(--muted); font-size: 14px; }
.pill { display: inline-block; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.upcoming { background: var(--neutral-bg); color: var(--muted); }
.pill.in_progress { background: var(--accent-soft); color: var(--accent); }
.pill.completed { background: var(--ok-bg); color: var(--ok); }
.pill.removed { background: var(--neutral-bg); color: var(--muted); }

/* Team cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.dim { opacity: .65; }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-head .nm { font-weight: 600; line-height: 1.25; }
.card-head .em { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.sect-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini li { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.mini .t { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.mini .sub { color: var(--muted); font-size: 13px; }
.none { color: var(--muted); font-size: 14.5px; }
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.notif-row b { display: block; font-size: 14.5px; }
.notif-row .sub { color: var(--muted); font-size: 13px; }
.switch { width: 46px; height: 26px; border-radius: 999px; border: 0; background: var(--muted); position: relative; flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--accent-fg); }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }

/* Member view */
.hello { margin: 20px 0 4px; font-size: 34px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 20px 0 6px; }
.notice .txt { flex: 1; min-width: 220px; }
.notice b { display: block; }
.notice span { color: var(--muted); font-size: 14.5px; }
.bar-track { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-cap { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* Board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 180px; border: 2px solid transparent; }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 0; }
.col-head h2 { font-family: var(--font-body); font-size: 13.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.col-head .count { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.col-body { display: flex; flex-direction: column; gap: 8px; }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; box-shadow: 0 1px 1px rgba(20, 30, 45, .06); }
.bcard:hover { border-color: var(--accent); }
.bcard.dragging { opacity: .45; }
.btype { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.btitle { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; line-height: 1.3; }
.bmeta { display: flex; flex-wrap: wrap; gap: 6px; }
.bdates { font-size: 13px; color: var(--muted); }
.bfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bfoot .who .nm { font-size: 14px; }
.link { border: 0; background: transparent; color: var(--accent); font-weight: 600; padding: 4px 6px; font-size: 14px; border-radius: 6px; }
.link:hover { text-decoration: underline; background: var(--accent-soft); }
.col-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 14px 6px; }
.kvs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 0; }
.kv dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kv dd { margin: 3px 0 0; }
.modal .remark { margin-top: 0; }
.mini li.rem-item { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.acts2 { display: flex; gap: 6px; flex-wrap: wrap; }
.menu-wrap { position: relative; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--fg); padding: 0; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--surface-2); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu-head span { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.menu .mi:hover { background: var(--surface-2); }
.menu .mi.out { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.alert-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.strip-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input.search { width: 240px; max-width: 100%; }
input[type="time"] { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 42px; max-width: 170px; }
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.card-title { font-size: 20px; margin-bottom: 4px; }
.card-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.field .lbl { font-size: 14px; font-weight: 600; }
.day-row { display: flex; flex-wrap: wrap; gap: 8px; }
.daychip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 600; min-width: 58px; }
.daychip:hover { border-color: var(--accent); }
.daychip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(3, minmax(270px, 1fr)); overflow-x: auto; padding-bottom: 8px; }
}

/* Login */
.login { min-height: 80vh; display: grid; place-items: center; padding-block: 24px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 28px; }
.hint { color: var(--muted); font-size: 13.5px; }

/* Modal and forms */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: min(540px, 100%); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal h2 { font-size: 24px; }
.modal p.body { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 12px; }
.field label { font-size: 14px; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.calc { background: var(--surface-2); border-radius: 9px; padding: 9px 12px; font-family: var(--font-mono); font-size: 13.5px; margin-bottom: 12px; }
.form-error { color: var(--bad); min-height: 1.3em; font-size: 14px; margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Notification mock and toasts */
.push-root { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(390px, calc(100vw - 32px)); z-index: 60; }
.push { background: var(--push-bg); color: var(--push-fg); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.1); animation: slide .25s ease-out; }
.push-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--push-muted); margin-bottom: 8px; }
.push-ico { width: 18px; height: 18px; border-radius: 5px; background: var(--push-ico); display: grid; place-items: center; color: #fff; }
.push-head .x { margin-left: auto; background: transparent; border: 0; color: var(--push-muted); font-size: 20px; line-height: 1; padding: 0 4px; }
.push h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.push ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.push li.warn { color: var(--push-warn); }
.push li.bad { color: var(--push-bad); }
.toast-root { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--fg); color: var(--bg); padding: 11px 16px; border-radius: 9px; font-size: 14.5px; box-shadow: var(--shadow); animation: slide .2s ease-out; }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .push, .toast { animation: none; } }

.foot { color: var(--muted); font-size: 13px; margin-top: 30px; }

/* Tablet and phone: each project row becomes a small card */
@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
  .seg { flex-wrap: wrap; }
  .hello { font-size: 28px; }
  .page-head h1 { font-size: 26px; }
  .modal { padding: 18px; }
}

/* ---- additions for the real app (not in the demo) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-fg); padding: 8px 12px; z-index: 100; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
.card-foot .card-actions .btn { flex: none; }
.notice .btn + .btn { margin-left: 0; }
.menu form { margin: 0; }
.temp-pw { font-family: var(--font-mono); font-size: 20px; background: var(--surface-2); padding: 14px; border-radius: 10px; text-align: center; user-select: all; letter-spacing: .04em; }
.alert { padding: 10px 12px; border-radius: 9px; font-size: 14.5px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.warn { background: var(--warn-bg); color: var(--warn); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .field { margin-bottom: 0; }
.login-card a.link { text-decoration: none; }
.plan-row { margin-bottom: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; min-height: 0; }
.modal.wide { width: min(640px, 100%); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.hint.pad { margin: -4px 0 12px; min-height: 1.3em; }
.push-lines { white-space: normal; }
.btn.block { width: 100%; }
.self-start { align-self: flex-start; }
a.link { display: inline-block; text-decoration: none; }
.min0 { min-width: 0; }
label.field > span { font-size: 14px; font-weight: 600; }
.field small { color: var(--muted); font-size: 13px; }
.setup-form { display: flex; flex-direction: column; gap: 12px; }
.setup-form .field { margin-bottom: 0; }
.login-card a.btn { text-decoration: none; text-align: center; }
.msg-groups { display: flex; flex-direction: column; gap: 14px; }
.ph-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ph { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 6px; padding: 2px 8px; font-family: var(--font-mono); font-size: 12.5px; cursor: pointer; }
.ph:hover { border-color: var(--accent); color: var(--fg); }
.field textarea { resize: vertical; }

/* Ads & Revenue sheet */
.sheet-root { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet, .sheet-root > div { display: flex; flex-direction: column; gap: 16px; }
.sheet-gate { max-width: 440px; margin: 24px auto; }
.sheet-gate form { display: flex; flex-direction: column; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.sheet-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.sheet-title { font-size: 28px; overflow-wrap: anywhere; }
.title-in { font-size: 22px; font-weight: 700; max-width: 100%; }
.sheet-tools, .month-bar, .week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sheet-sub { font-size: 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stats.small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.stat-l { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-v { font-size: 22px; font-weight: 500; margin-top: 4px; overflow-wrap: anywhere; }
.neg { color: var(--bad); }
.actual-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; }
.top-name { font-family: var(--font-display); font-size: 30px; font-weight: 700; overflow-wrap: anywhere; }
.top-body { display: flex; flex-direction: column; gap: 12px; }
.top-empty { border: 2px dashed var(--line); background: transparent; color: var(--muted); border-radius: 12px; padding: 24px; font-size: 16px; font-weight: 600; }
.top-empty:hover { border-color: var(--accent); color: var(--fg); }
.week-label { font-size: 14px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.chart .bar { fill: var(--accent); }
.table-wrap { overflow-x: auto; }
.sheet-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.sheet-table th, .sheet-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.sheet-table thead th { font-size: 13px; color: var(--muted); }
.sheet-table th[scope=row] { font-weight: 500; white-space: nowrap; }
.sheet-table .calc { background: var(--ok-bg); color: var(--ok); text-align: right; font-weight: 600; }
.sheet-table .calc.neg { color: var(--bad); background: var(--bad-bg); }
.sheet-table input.amt { width: 100%; max-width: 160px; text-align: right; font-family: var(--font-mono); }
.sheet-table input.invalid { border-color: var(--bad); }
.calc-note { margin-top: 8px; }
@media (max-width: 800px) {
  .stats, .stats.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actual-fields { grid-template-columns: 1fr; }
  .sheet-title { font-size: 22px; }
}
.sheet-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sheet-pick { font-size: 14px; font-weight: 600; color: var(--muted); }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sheet-tile { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--fg); min-width: 0; }
.sheet-tile b { font-size: 16px; overflow-wrap: anywhere; }
.sheet-tile:hover { border-color: var(--accent); }
.sheet-tile.new { border: 2px dashed var(--line); background: transparent; color: var(--muted); font-weight: 600; align-items: center; justify-content: center; min-height: 84px; }
.sheet-lock { align-self: flex-end; color: var(--muted); font-size: 12.5px; }
.sheet-note { margin-bottom: 4px; }
.back { align-self: flex-start; }
