:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eceee8;
  --ink: #1b1f1d;
  --ink-2: #545b57;
  --ink-3: #868d89;
  --line: #dcdfd8;
  --accent: #0f6b5a;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe9;
  --red: #b42318;
  --red-soft: #fde8e6;
  --amber: #a15c00;
  --amber-soft: #fff1d6;
  --blue: #1d4ed8;
  --blue-soft: #e3ebff;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .05);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514; --surface: #1a1e1c; --surface-2: #232826; --ink: #e9ece9; --ink-2: #b2b9b4; --ink-3: #7d857f;
    --line: #2d3330; --accent: #3fb59c; --accent-ink: #08201a; --accent-soft: #173a32;
    --red: #ff7b6e; --red-soft: #3a1a17; --amber: #f2b45a; --amber-soft: #36290f; --blue: #8fb0ff; --blue-soft: #1b2540;
    --shadow: 0 1px 2px rgb(0 0 0 / .4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 16px 10px; display: grid; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.brand h1 { font-size: 18px; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand h1 .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-grid; place-items: center; color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.who { display: flex; gap: 8px; align-items: center; }
.who select { padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); max-width: 210px; }
.who select.missing { border-color: var(--red); background: var(--red-soft); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.sync.ok .dot { background: #22a06b; }
.sync.warn .dot { background: var(--amber); }
.sync.err .dot { background: var(--red); }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 260px; position: relative; }
.search input { width: 100%; padding: 10px 12px 10px 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 7px 11px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.chip b { font-variant-numeric: tabular-nums; color: var(--ink); margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] b { color: var(--bg); }
.controls select { padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }

/* ---------- list ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 12px 16px 120px; }
.banner { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.banner.err { background: var(--red-soft); color: var(--red); }
.thead, .row { display: grid; grid-template-columns: 96px 78px minmax(160px, 1.6fr) minmax(90px, .8fr) 100px 76px 92px 100px 104px; gap: 10px; align-items: center; padding: 0 14px; }
.thead { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; }
.thead button { background: none; border: 0; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; }
.list { display: grid; gap: 6px; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 54px; padding-top: 8px; padding-bottom: 8px; }
.row .acct { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--ink-3); font-size: 12px; }
.row .mono { font-family: var(--mono); font-size: 13px; }
.cell-muted { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14px; border-radius: 8px; padding: 4px 8px; display: inline-block; text-align: center; min-width: 74px; }
.od.over { background: var(--red-soft); color: var(--red); }
.od.soon { background: var(--amber-soft); color: var(--amber); }
.od.ok { background: var(--surface-2); color: var(--ink-2); font-weight: 500; }
.od.none { background: transparent; color: var(--ink-3); font-weight: 500; border: 1px dashed var(--line); }
.cov { font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 3px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); display: inline-block; }
.cov.pm { background: var(--accent-soft); color: var(--accent); }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; display: inline-block; margin-top: 2px; }
.tag.pending { background: var(--blue-soft); color: var(--blue); }
.tag.failed { background: var(--red-soft); color: var(--red); }
.tag.wo { background: var(--surface-2); color: var(--ink-2); }
.done-btn { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 650; padding: 9px 12px; border-radius: 10px; width: 100%; }
.done-btn:active { transform: translateY(1px); }
.empty { text-align: center; color: var(--ink-3); padding: 40px 0; }

@media (max-width: 900px) {
  .thead { display: none; }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "acct od" "meta meta" "last btn"; gap: 6px 10px; padding: 12px 14px; }
  .row .c-acct { grid-area: acct; min-width: 0; }
  .row .c-od { grid-area: od; justify-self: end; }
  .row .c-meta { grid-area: meta; display: flex !important; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: 13px; }
  .row .c-last { grid-area: last; font-size: 13px; color: var(--ink-2); align-self: center; }
  .row .c-btn { grid-area: btn; }
  .row .c-btn .done-btn { width: auto; padding: 10px 18px; }
  .row .c-code, .row .c-city, .row .c-prod, .row .c-serial, .row .c-cov { display: none; }
}
@media (min-width: 901px) { .row .c-meta { display: none; } }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 20; }
.sheet { position: fixed; z-index: 21; left: 50%; bottom: 0; transform: translateX(-50%); width: min(520px, 100%); background: var(--surface); border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgb(0 0 0 / .2); max-height: 92vh; overflow: auto; }
@media (min-width: 700px) { .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 18px; } }
.sheet h2 { margin: 0 0 2px; font-size: 18px; }
.sheet .sub { color: var(--ink-2); font-size: 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 14px 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field input, .field select, .field textarea { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); width: 100%; }
.field textarea { min-height: 64px; resize: vertical; }
.sheet .actions { display: flex; gap: 8px; margin-top: 6px; }
.sheet .actions button { flex: 1; padding: 13px; border-radius: 12px; font-weight: 650; border: 1px solid var(--line); background: var(--surface); }
.sheet .actions .primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); flex: 2; }
.err-text { color: var(--red); font-size: 14px; min-height: 18px; margin: 4px 0; }
.hist { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; font-size: 13px; color: var(--ink-2); }
.hist ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 14px 12px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; z-index: 30; box-shadow: var(--shadow); width: max-content; max-width: calc(100% - 32px); }
.toast button { background: transparent; color: var(--bg); border: 1px solid rgb(255 255 255 / .35); border-radius: 8px; padding: 6px 10px; font-weight: 650; }
@media (prefers-color-scheme: dark) { .toast button { border-color: rgb(0 0 0 / .3); } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: min(360px, 100%); box-shadow: var(--shadow); }
.login h1 { font-size: 20px; margin: 0 0 4px; }
.login p { color: var(--ink-2); margin: 0 0 16px; font-size: 14px; }
.login button { width: 100%; padding: 12px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 650; }

/* ---------- admin ---------- */
.adm { max-width: 1240px; margin: 0 auto; padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card .k { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.card .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .v.small { font-size: 14px; font-weight: 500; }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 12px; font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.st { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); }
.st.synced { background: var(--accent-soft); color: var(--accent); }
.st.synced-warning, .st.retry { background: var(--amber-soft); color: var(--amber); }
.st.failed { background: var(--red-soft); color: var(--red); }
.st.waiting, .st.pending { background: var(--blue-soft); color: var(--blue); }
h2.sec { font-size: 15px; margin: 22px 0 8px; }

/* layout fixes */
.search { min-width: 0; }
@media (max-width: 900px) { .search { flex: 1 1 100%; } }
@media (min-width: 901px) { .row .c-last > .sub:first-child { display: none; } .row .c-last { white-space: nowrap; font-size: 14px; } }
.top-inner { grid-template-columns: minmax(0, 1fr); }
.controls, .chips { min-width: 0; max-width: 100%; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }

.ms-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; text-decoration: none; }
.ms-btn:hover { background: var(--surface-2); }
.or { text-align: center; color: var(--ink-3); font-size: 13px; margin: 14px 0; }

.od.ready { background: var(--accent-soft); color: var(--accent); }
.od.exp { background: transparent; color: var(--ink-2); font-weight: 500; border: 1px solid var(--line); }
.od-sub { margin-top: 3px; text-align: center; min-width: 74px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .row .c-od { text-align: right; } .od-sub { text-align: right; } }
#regWarn { margin: 0 0 12px; }

/* ---------- Kongsberg checklist ---------- */
.cl { position: fixed; inset: 0; z-index: 25; background: var(--bg); display: flex; flex-direction: column; }
@media (min-width: 760px) { .cl { left: 50%; transform: translateX(-50%); width: 720px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.cl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cl-head h2 { margin: 0; font-size: 17px; }
.cl-x { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 50%; font-size: 15px; flex: none; }
.cl-body { flex: 1; overflow-y: auto; padding: 12px 16px 24px; -webkit-overflow-scrolling: touch; }
.cl-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.cl-progress .bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.cl-progress .bar span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.btn-wide { width: 100%; padding: 12px; border-radius: 12px; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; margin-bottom: 14px; }
.cl-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.cl-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #0b2d3c; color: #fff; }
.cl-sec-h b { font-size: 12.5px; letter-spacing: .03em; text-transform: uppercase; }
.cl-sec-h button { border: 1px solid rgb(255 255 255 / .35); background: transparent; color: #fff; border-radius: 8px; padding: 5px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cl-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 10px 8px 12px; border-top: 1px solid var(--line); }
.cl-item:first-of-type { border-top: 0; }
.cl-item .lbl { font-size: 14.5px; line-height: 1.3; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); min-width: 52px; height: 42px; font-weight: 700; color: var(--ink-3); font-size: 15px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"].ok { background: var(--accent); color: var(--accent-ink); }
.seg button[aria-pressed="true"].na { background: var(--ink-2); color: var(--bg); }
.cl-h { font-size: 14px; margin: 18px 0 8px; }
.cl-ta, .cl-in { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.cl-ta { min-height: 90px; resize: vertical; }
.cl-in { margin-bottom: 8px; }
.sig { position: relative; height: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; touch-action: none; }
.sig canvas { width: 100%; height: 100%; display: block; border-radius: 12px; }
.sig-clear { position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 9px; font-size: 12px; }
.sig-hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.sig::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 30px; border-bottom: 1px dashed var(--line); pointer-events: none; }
.cl-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
.cl-actions { display: flex; gap: 8px; margin-top: 6px; }
.cl-actions button { flex: 1; padding: 13px; border-radius: 12px; font-weight: 650; border: 1px solid var(--line); background: var(--surface); }
.cl-actions .primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); flex: 1.6; }
.cl-actions button:disabled { opacity: .55; }
.tag.cl-miss { background: var(--amber-soft); color: var(--amber); }
.tag.cl-ok { background: var(--accent-soft); color: var(--accent); }
.sheet .btn-cl { width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }

.cl-open .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }

/* checklist steps + time */
.cl-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 8px 0 0; font-size: 12px; flex-wrap: wrap; }
.cl-steps li { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); }
.cl-steps li[aria-current="step"] { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.cl-sec-h .sec-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cl-sec-h .sec-btns button[aria-pressed="true"] { background: #fff; color: #0b2d3c; border-color: #fff; }
.cl-note { background: var(--blue-soft); color: var(--blue); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 0 0 6px; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.time-grid input { font-size: 18px; font-variant-numeric: tabular-nums; }
.linkish { border: 0; background: none; color: var(--ink-2); text-decoration: underline; font-size: 13px; padding: 8px 0 0; display: block; margin: 0 auto; }
#clActions2 #clBack { flex: .8; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.brand { gap: 10px 14px; }
.brand h1 { margin-right: auto; }

/* ---------- calendar ---------- */
#calView { max-width: 1240px; margin: 0 auto; padding: 12px 16px 120px; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-nav button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; min-width: 38px; height: 36px; font-weight: 600; padding: 0 10px; }
.cal-nav h2 { font-size: 17px; margin: 0 0 0 6px; }
.cal-side { display: flex; align-items: center; gap: 10px; }
.primary-sm { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 9px; padding: 9px 14px; font-weight: 650; }
.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cal-grid { display: grid; min-width: 760px; }
.cal-grid .hd { padding: 8px 10px; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-grid .hd.today { color: var(--accent); font-weight: 700; }
.cal-grid .hd:first-child { border-left: 0; }
.cal-grid .tech { padding: 10px; font-weight: 650; font-size: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.cal-grid .tech.me { background: var(--accent-soft); color: var(--accent); }
.cal-grid .tech .sub { font-weight: 400; font-size: 11px; }
.cal-grid .cell { min-height: 92px; padding: 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cal-grid .cell.today { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cal-grid .cell.can:hover { background: var(--surface-2); cursor: pointer; }
.cal-grid .cell .add { opacity: 0; border: 1px dashed var(--line); background: transparent; color: var(--ink-3); border-radius: 8px; font-size: 12px; padding: 4px; margin-top: auto; }
.cal-grid .cell.can:hover .add, .cal-grid .cell .add:focus-visible { opacity: 1; }
.ev-chip { text-align: left; border: 0; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink); border-radius: 7px; padding: 5px 7px; font-size: 12px; line-height: 1.25; width: 100%; }
.ev-chip b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-chip .t { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ev-chip.other { border-left-color: var(--ink-3); background: var(--surface-2); color: var(--ink-2); }
.ev-chip.pending { border-left-style: dashed; background: var(--blue-soft); }
.ev-chip.failed { border-left-color: var(--red); background: var(--red-soft); }
.ev-chip.overdue { border-left-color: var(--red); }
.cal-agenda { display: none; }
.cal-h { font-size: 15px; margin: 22px 0 8px; }
.to-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tp { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.tp b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp .sub { grid-column: 1; font-size: 12.5px; }
.tp button { grid-row: 1 / span 2; grid-column: 2; }
.plan-row { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 0 10px; }
#planMachine { width: 100%; margin-top: 6px; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.danger { background: var(--red-soft) !important; color: var(--red) !important; border-color: transparent !important; }
.tag.plan { background: var(--accent-soft); color: var(--accent); }
.sheet .btn-plan { width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; }
@media (max-width: 900px) {
  .cal-wrap { display: none; }
  .cal-agenda { display: grid; gap: 10px; }
  .ag-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .ag-day header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--surface-2); font-weight: 650; font-size: 14px; }
  .ag-day header.today { background: var(--accent-soft); color: var(--accent); }
  .ag-day header button { border: 0; background: transparent; color: var(--accent); font-weight: 650; }
  .ag-list { display: grid; gap: 6px; padding: 8px; }
  .ag-empty { color: var(--ink-3); font-size: 13px; padding: 2px 4px; }
  .ev-chip .who { float: right; font-weight: 700; color: var(--ink-2); }
  .tabs { order: 3; }
}

.busy { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 8px; }
.busy.conflict { background: var(--amber-soft); color: var(--amber); }
.busy.free { background: var(--accent-soft); color: var(--accent); }
.busy ul { margin: 4px 0 0; padding-left: 18px; }
.plan-row > .field, .plan-row input { min-width: 0; }
@media (max-width: 520px) { .plan-row { grid-template-columns: 1fr 1fr; } .plan-row > .field:first-child { grid-column: 1 / -1; } }

/* calendar periods + roles */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 11px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
#calTech { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 0 8px; font-weight: 600; max-width: 170px; }
.cal-side { flex-wrap: wrap; }
.cal-grid.dense { min-width: 1100px; }
.cal-grid.dense .cell { min-height: 74px; padding: 4px; }
.cal-grid.dense .ev-chip { padding: 4px 5px; font-size: 11px; }
.cal-grid.dense .ev-chip b { font-size: 11.5px; }
.cal-grid.dense .hd { padding: 8px 4px; font-size: 11px; }
.cal-grid .hd.wkstart, .cal-grid .cell.wkstart { border-left: 2px solid var(--ink-3); }
.cal-month { display: grid; min-width: 760px; }
.cal-month .hd { padding: 8px 10px; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-month .wk { padding: 8px 6px; font-size: 11px; color: var(--ink-3); border-bottom: 1px solid var(--line); text-align: center; }
.cal-month .mcell { min-height: 112px; padding: 5px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-month .mcell.out { background: var(--surface-2); }
.cal-month .mcell.out .dn { color: var(--ink-3); }
.cal-month .mcell.today .dn { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; }
.cal-month .mcell.can { cursor: pointer; }
.cal-month .mcell.can:hover { background: var(--surface-2); }
.cal-month .dn { font-size: 12px; font-weight: 650; align-self: flex-start; }
.cal-month .ev-chip { padding: 3px 6px; font-size: 11px; }
.cal-month .ev-chip b { display: inline; font-size: 11.5px; }
.cal-month .ev-chip .who { font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.cal-month .more { font-size: 11px; color: var(--ink-2); border: 0; background: transparent; text-align: left; padding: 0 2px; }
.ag-day.empty-day header { font-weight: 500; color: var(--ink-2); background: transparent; }
.ag-day.empty-day .ag-list { display: none; }
.role-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--blue-soft); color: var(--ink-2); }
@media (max-width: 900px) {
  .month-wrap { display: none !important; }
  .cal-side { width: 100%; }
}
table.people input:not([type=checkbox]) { width: 100%; min-width: 180px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px; }
table.people input[type=checkbox] { width: 18px; height: 18px; }
table.people tfoot td { background: var(--surface-2); }
