/* LockedinBusiness. Navy and royal blue from the Time clock, in light and dark. Roomy by default. */
:root {
  --bg: #f2f5fb; --surface: #ffffff; --surface-2: #eaf0fb; --surface-3: #dbe5f7; --line: #c9d5ec;
  --text: #0b1630; --muted: #495c85; --navy: #0b1630; --navy-2: #13224a; --navy-line: #24386e; --navy-text: #eef3ff; --navy-dim: #9fb2db;
  --brand: #1d5fe0; --brand-soft: #e3ecfd; --brand-ink: #ffffff;
  --red: #c62a1c; --red-soft: #fdecea; --amber: #a86200; --amber-soft: #fff3dc; --green: #0b7d55; --green-soft: #e1f5ec;
  --shadow: 0 1px 2px rgba(11, 22, 48, .08), 0 6px 20px rgba(11, 22, 48, .07);
  --radius: 12px; --row-pad: 14px; --tap: 46px;
  --font: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #040b1f; --surface: #0b1630; --surface-2: #13224a; --surface-3: #1b2d5c; --line: #24386e;
  --text: #eef3ff; --muted: #9fb2db; --navy: #060e26; --navy-2: #13224a;
  --brand: #2f80ff; --brand-soft: #14295a; --brand-ink: #ffffff;
  --red: #ff6b5a; --red-soft: #3a1512; --amber: #f0b040; --amber-soft: #33270c; --green: #3ecf9a; --green-soft: #0b2e22;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
body.density-compact { --row-pad: 8px; --tap: 38px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 0; }
h3 { font-size: .8rem; margin: 0; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
.muted { color: var(--muted); } .small { font-size: .86rem; } .num { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 12px; align-content: start; } .stack.tight { gap: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.ico { display: inline-grid; width: 1.25em; height: 1.25em; flex: none; } .ico svg { width: 100%; height: 100%; }
.plain { list-style: none; margin: 0; padding: 0; }
.hide { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Buttons and inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: .88rem; border-radius: 8px; } .btn.big { min-height: 60px; font-size: 1.1rem; padding: 0 24px; }
.btn.icon { padding: 0; width: var(--tap); } .btn.sm.icon { width: 34px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: var(--tap); padding: 8px 12px; width: 100%; }
textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; }
input[type=color] { padding: 3px; width: 54px; }
.field { display: grid; gap: 5px; font-weight: 600; font-size: .92rem; } .field .hint { font-weight: 400; color: var(--muted); font-size: .84rem; }
.field .req { color: var(--red); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; min-height: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.chip.big { min-height: 52px; padding: 0 18px; } .chip[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.switch { position: relative; width: 50px; height: 30px; flex: none; } .switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); } .switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600; min-height: 40px; padding: 0 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); }

/* ---------- Cards, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.callout { border-radius: 10px; padding: 12px 14px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.callout.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); } .callout.red { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap;
  color: var(--pill); background: color-mix(in srgb, var(--pill) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pill) 35%, var(--surface)); }
:root[data-theme="dark"] .pill { color: color-mix(in srgb, var(--pill) 55%, #fff); background: color-mix(in srgb, var(--pill) 28%, var(--surface)); }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pill); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.due { background: var(--amber-soft); color: var(--amber); } .badge.late { background: var(--red-soft); color: var(--red); } .badge.ok { background: var(--green-soft); color: var(--green); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.tagchip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 6px; font-size: .8rem; font-weight: 600; background: color-mix(in srgb, var(--tag, var(--brand)) 13%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--tag, var(--brand)) 35%, var(--surface)); }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--av, var(--brand)); color: #fff; font-weight: 700; font-size: .8rem; flex: none; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: var(--navy-text); display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--navy-line); }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.side .brand img { max-height: 34px; max-width: 120px; border-radius: 6px; }
.side .grp { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--navy-dim); padding: 14px 10px 4px; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 9px; color: var(--navy-text); text-decoration: none; font-weight: 600; font-size: .95rem; border: 0; background: transparent; cursor: pointer; font-family: inherit; width: 100%; text-align: left; }
.nav:hover { background: var(--navy-2); } .nav[aria-current=page] { background: var(--brand); color: #fff; }
.nav .cnt { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: .74rem; padding: 1px 7px; font-weight: 700; }
:root:not([data-theme="dark"]) .nav .cnt { background: #e0392b; }
.nav.cta { background: #2f80ff; color: #fff; justify-content: center; margin: 8px 0; } .nav.cta:hover { filter: brightness(1.1); }
.side .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--navy-line); display: grid; gap: 2px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; width: 100%; max-width: 1500px; margin: 0 auto; } .page.narrow { max-width: 860px; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.tabs { display: none; }
.topbar-m { display: none; }
body.nav-topbar .shell { grid-template-columns: minmax(0, 1fr); }
body.nav-topbar .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 14px; gap: 4px; border-right: 0; border-bottom: 1px solid var(--navy-line); }
body.nav-topbar .side .brand { padding: 0 12px 0 0; } body.nav-topbar .side .grp { display: none; } body.nav-topbar .nav { width: auto; } body.nav-topbar .nav.cta { margin: 0 6px; }
body.nav-topbar .side .foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; }

/* ---------- Status counts, strip, lists ---------- */
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.count { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--brand)); cursor: pointer; font: inherit; color: var(--text); box-shadow: var(--shadow); }
.count b { font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; } .count span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.count[aria-pressed=true] { background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-color: var(--c); }
.strip { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--red); color: #fff; font-weight: 700; text-decoration: none; }
:root[data-theme="dark"] .strip { background: #a3261b; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1 1 220px; max-width: 420px; } .toolbar .search input { padding-left: 38px; } .toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tabbar { display: inline-flex; gap: 4px; border-bottom: 2px solid var(--line); } .tabbar button { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--muted); padding: 10px 16px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 44px; }
.tabbar button[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
.tlist { display: grid; gap: 8px; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: var(--row-pad) 16px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--line)); border-radius: var(--radius); color: var(--text); text-decoration: none; cursor: pointer; }
.trow:hover { border-color: var(--brand); border-left-color: var(--c, var(--brand)); } .trow[aria-current=true] { background: var(--brand-soft); border-color: var(--brand); }
.trow.red { background: var(--red-soft); border-color: var(--red); border-left-color: var(--red); }
.trow .who { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; } .trow .what { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .meta { display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; font-size: .88rem; }
.trow .no { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.prio { font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 6px; } .prio.p3 { background: var(--red-soft); color: var(--red); } .prio.p2 { background: var(--amber-soft); color: var(--amber); } .prio.p1 { background: var(--surface-2); color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: .92rem; } table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.data tr.click { cursor: pointer; } table.data tr.click:hover td { background: var(--surface-2); } table.data tr:last-child td { border-bottom: 0; }
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; min-height: 120px; border-top: 4px solid var(--c); align-content: start; }
.col.over { outline: 3px dashed var(--brand); } .col > h2 { display: flex; justify-content: space-between; font-size: .95rem; padding: 2px 4px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; display: grid; gap: 4px; color: var(--text); text-decoration: none; font-size: .92rem; }
.kcard.red { background: var(--red-soft); border-color: var(--red); } .kcard b { font-size: 1rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: 6px 8px; font-size: .74rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.cal .day { background: var(--surface); min-height: 96px; padding: 6px; display: grid; gap: 3px; align-content: start; font-size: .8rem; } .cal .day.off { background: var(--bg); color: var(--muted); } .cal .day.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .day a { display: block; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- List + panel, split view ---------- */
.listpanel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.listpanel.open { grid-template-columns: minmax(340px, 5fr) minmax(420px, 6fr); }
.listpanel > .panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.sheet-body { padding: 16px 18px 22px; display: grid; gap: 16px; }
.sheet-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 18px; display: grid; gap: 10px; border-radius: var(--radius) var(--radius) 0 0; }
.statusbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.statusbar button { border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; min-height: 46px; cursor: pointer; padding: 4px 6px; font-size: .9rem; line-height: 1.15; }
.statusbar button:last-child { border-right: 0; } .statusbar button[aria-pressed=true] { background: var(--c); color: #fff; } .statusbar button:hover:not([aria-pressed=true]) { background: var(--surface-2); }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 8px 14px; font-size: .95rem; } .kv dt { color: var(--muted); font-weight: 600; margin: 0; overflow-wrap: anywhere; } .kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.kv .nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-btn { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; padding: 0 2px; }
.section { display: grid; gap: 10px; } .section > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comment { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; } .comment .bubble { background: var(--surface-2); border-radius: 4px 12px 12px 12px; padding: 8px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment .by { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .comment .by b { color: var(--text); }
.actline { font-size: .84rem; color: var(--muted); padding: 2px 0 2px 40px; overflow-wrap: anywhere; } .actline.ovr { color: var(--amber); font-weight: 600; }
.legacy-note { background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line)); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos img, .photos .ph { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.photos button.ph { display: grid; place-items: center; cursor: pointer; color: var(--muted); font-weight: 700; }
.sigpad { position: relative; background: #fff; border: 2px dashed #9aa8b6; border-radius: 12px; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: 220px; border-radius: 12px; cursor: crosshair; }
.sigpad .line { position: absolute; left: 24px; right: 24px; bottom: 46px; border-bottom: 1.5px solid #c3ccd6; pointer-events: none; }
.sigpad .x { position: absolute; left: 24px; bottom: 50px; color: #8795a3; font-size: 1.4rem; pointer-events: none; }
body.layout-split .split3 { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 0; height: 100vh; }
body.layout-split .split3 > .mid { border-right: 1px solid var(--line); overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start; background: var(--bg); }
body.layout-split .split3 > .right { overflow-y: auto; background: var(--surface); }
body.layout-split .split3 .trow { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }

/* ---------- Home screens ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 6px; align-content: center; min-height: 132px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-bottom: 5px solid var(--c, var(--brand)); color: var(--text); text-decoration: none; box-shadow: var(--shadow); cursor: pointer; font: inherit; text-align: left; }
.tile b { font-size: 2.3rem; line-height: 1; font-variant-numeric: tabular-nums; } .tile span { font-weight: 700; font-size: 1.05rem; } .tile.cta { background: var(--brand); border-color: var(--brand); color: #fff; }
.tile.cta span { font-size: 1.3rem; }
.bench { padding: 18px; display: grid; gap: 14px; } .bench h1 { font-size: 1.8rem; } .bench .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bench .kcard { font-size: 1.12rem; cursor: pointer; } .bench .kcard b { font-size: 1.3rem; }
.who-row { display: flex; gap: 8px; flex-wrap: wrap; } .who-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: .9rem; }
.who-chip.on { background: var(--green-soft); color: var(--green); } .who-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); } .who-chip.on .dot { background: var(--green); }

/* ---------- Check-in form ---------- */
.formwrap { display: grid; gap: 14px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.q.done { padding: 10px 16px; cursor: pointer; grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: var(--surface-2); }
.q.done .sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .q.done .sum b { font-weight: 600; color: var(--muted); margin-right: 8px; }
.q.err { border-color: var(--red); } .q .errmsg { color: var(--red); font-weight: 600; font-size: .9rem; }
.q label.ql { font-weight: 700; font-size: 1.05rem; }
.hintbox { background: var(--brand-soft); border-radius: 8px; padding: 8px 12px; font-size: .9rem; white-space: pre-wrap; }
.stepname { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-top: 6px; }
.devbox { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 280px; margin: 0 auto; } .pinpad button { min-height: 58px; font-size: 1.35rem; font-weight: 700; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.pindots { display: flex; gap: 10px; justify-content: center; min-height: 22px; } .pindots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); } .pindots i.on { background: var(--brand); border-color: var(--brand); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.person { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; font-weight: 700; color: var(--text); }
.person .avatar { width: 46px; height: 46px; font-size: 1.1rem; } .person[aria-pressed=true] { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Options menu ---------- */
.opts { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.opts nav { position: sticky; top: 12px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.opts nav button { text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600; padding: 9px 12px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.opts nav button[aria-current=true] { background: var(--brand); color: var(--brand-ink); } .opts nav button:hover:not([aria-current=true]) { background: var(--surface-2); }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); } .setting:last-child { border-bottom: 0; }
.setting .lab { font-weight: 600; } .setting .help { grid-column: 1 / -1; color: var(--muted); font-size: .86rem; } .setting select { min-width: 190px; width: auto; max-width: 100%; } .setting.flash { animation: flash 1.6s ease-out; }
.setting .wide { grid-column: 1 / -1; }
@keyframes flash { 0%, 40% { background: var(--amber-soft); box-shadow: 0 0 0 8px var(--amber-soft); } 100% { background: transparent; box-shadow: none; } }
.erow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.erow.off { opacity: .6; } .erow .grab { cursor: grab; color: var(--muted); display: grid; } .erow .ctl { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.erow .body { display: grid; gap: 6px; min-width: 0; } .erow .body .row { gap: 8px; } .erow .body .row > input[type=text] { min-width: 150px; } .erow input[type=text], .erow select { min-height: 38px; }
.erow.drag { opacity: .4; } .erow.dropat { box-shadow: 0 -3px 0 var(--brand); }
.fdetail { grid-column: 1 / -1; display: grid; gap: 10px; padding: 10px 4px 4px; border-top: 1px dashed var(--line); }
.versw { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.perm-grid { overflow-x: auto; } .perm-grid table { border-collapse: collapse; font-size: .9rem; } .perm-grid th, .perm-grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; } .perm-grid th:first-child, .perm-grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); min-width: 180px; }

/* ---------- Login, toast, modal ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.login .card { width: min(560px, 100%); display: grid; gap: 16px; }
.toasts { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 460px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; border: 1px solid var(--navy-line); } .toast.err { background: #a3261b; border-color: #a3261b; }
.modal-back { position: fixed; inset: 0; background: rgba(4, 11, 31, .62); display: grid; place-items: center; padding: 16px; z-index: 60; overflow-y: auto; }
.modal { background: var(--surface); color: var(--text); border-radius: 16px; padding: 20px; width: min(560px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { width: min(820px, 100%); }
.menu { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 220px; }
.menu button, .menu a { display: flex; gap: 10px; align-items: center; min-height: 42px; padding: 0 12px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer; text-decoration: none; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface-2); } .menu .danger { color: var(--red); }

/* ---------- Narrow screens ---------- */
@media (max-width: 1099px) {
  .listpanel.open { grid-template-columns: minmax(0, 1fr); } .listpanel.open > .list { display: none; }
  .listpanel > .panel { position: static; max-height: none; }
  body.layout-split .split3 { grid-template-columns: minmax(0, 1fr); height: auto; } body.layout-split .split3.has-sheet > .mid { display: none; } body.layout-split .split3:not(.has-sheet) > .right { display: none; }
  body.layout-split .split3 > .mid { border-right: 0; }
}
@media (max-width: 819px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: 72px; }
  .side { display: none; }
  body.mnav-drawer .shell { padding-bottom: 0; }
  body.drawer-open .side { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; height: 100vh; }
  body.drawer-open::after { content: ''; position: fixed; inset: 0; background: rgba(4, 11, 31, .55); z-index: 45; }
  .topbar-m { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy); color: var(--navy-text); position: sticky; top: 0; z-index: 20; font-weight: 800; }
  .topbar-m .btn { background: transparent; color: var(--navy-text); border-color: var(--navy-line); } .topbar-m img { max-height: 28px; border-radius: 5px; }
  body.mnav-tabs .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--navy); border-top: 1px solid var(--navy-line); padding-bottom: env(safe-area-inset-bottom); }
  .tabs a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; color: var(--navy-dim); text-decoration: none; font-size: .7rem; font-weight: 700; min-height: 60px; align-content: center; position: relative; }
  .tabs a .ico { width: 24px; height: 24px; } .tabs a[aria-current=page] { color: #fff; } .tabs a.mid .ico { background: #2f80ff; color: #fff; border-radius: 50%; padding: 6px; width: 38px; height: 38px; margin-top: -16px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
  .tabs a .cnt { position: absolute; top: 4px; right: calc(50% - 22px); background: #e0392b; color: #fff; border-radius: 999px; font-size: .66rem; padding: 0 5px; }
  .page { padding: 14px 12px 28px; gap: 12px; } h1 { font-size: 1.25rem; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .count { padding: 10px 12px; } .count b { font-size: 1.5rem; }
  .board { grid-template-columns: repeat(4, minmax(240px, 80vw)); } .bench .board { grid-template-columns: minmax(0, 1fr); }
  .opts { grid-template-columns: minmax(0, 1fr); } .opts nav { position: static; display: flex; overflow-x: auto; gap: 4px; } .opts nav button { white-space: nowrap; }
  .setting { grid-template-columns: minmax(0, 1fr); } .setting select { width: 100%; }
  .erow { grid-template-columns: auto minmax(0, 1fr); } .erow .ctl { grid-column: 1 / -1; justify-content: flex-start; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  .cal .day { min-height: 64px; padding: 3px; font-size: .68rem; } .cal .dow { padding: 4px 3px; font-size: .62rem; }
  .sheet-head, .sheet-body { padding-left: 12px; padding-right: 12px; }
  .statusbar button { font-size: .78rem; min-height: 48px; }
  .modal { padding: 16px; } .toasts { bottom: 76px; }
  .listpanel > .panel { border-radius: 0; border-left: 0; border-right: 0; margin: -14px -12px 0; box-shadow: none; }
}
/* ---------- Print ---------- */
#print-root { display: none; }
@media print {
  body { background: #fff; color: #000; }
  #app, .toasts, .modal-back { display: none !important; }
  #print-root { display: block; }
}
.label-print { display: grid; grid-template-columns: auto 1fr; gap: 2.5mm; align-items: center; padding: 1.5mm 2mm; overflow: hidden; color: #000; font-family: Arial, Helvetica, sans-serif; page-break-after: always; break-after: page; }
.label-print .qr svg { display: block; }
.label-print .ln { font-size: 15pt; font-weight: 800; line-height: 1.05; text-transform: uppercase; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.label-print .fn { font-size: 10pt; font-weight: 600; }
.label-print .meta { font-size: 8pt; margin-top: 1mm; }
.sheet { color: #000; background: #fff; font: 11pt/1.4 Arial, Helvetica, sans-serif; }
.sheet h1 { font-size: 18pt; margin-bottom: 4pt; }
.sheet .hdr { display: flex; justify-content: space-between; align-items: flex-start; gap: 16pt; border-bottom: 2px solid #000; padding-bottom: 8pt; margin-bottom: 10pt; }
.sheet table { width: 100%; border-collapse: collapse; margin: 6pt 0 10pt; }
.sheet td, .sheet th { border: 1px solid #999; padding: 4pt 6pt; text-align: left; vertical-align: top; font-size: 10pt; }
.sheet .terms-print { white-space: pre-wrap; font-size: 9.5pt; border: 1px solid #999; padding: 8pt; }
.sheet .sig { margin-top: 12pt; display: flex; gap: 20pt; align-items: flex-end; }
.sheet .sig img { height: 70pt; border-bottom: 1px solid #000; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
table.plain td:first-child input[type="text"] { min-width: 210px; }
table.plain select { min-width: 170px; }

/* Nothing may push a page wider than the screen. */
.page > *, .opts > *, .setting > *, .card, .stack > *, .listpanel > * { min-width: 0; }
.setting .wide, .perm-grid, .tablewrap { max-width: 100%; }
.toolbar > * { min-width: 0; max-width: 100%; } .seg { max-width: 100%; overflow-x: auto; }
.trow .badge, .sheet-head .badge, .sheet-body .badge, .kcard .badge, .tagchip { white-space: normal; overflow-wrap: anywhere; border-radius: 10px; max-width: 100%; }
.chip.big { height: auto; padding: 8px 18px; text-align: left; border-radius: 14px; } .chip .sub { display: block; font-weight: 400; font-size: .84rem; opacity: .9; }
