/* Kopi Rider Team – styles. Phone first, big buttons, calm colours. */
:root {
  --bg: #FFFEFB;
  --ink: #1F1C1B;
  --ink-2: #5F5853;
  --ink-3: #8C847E;
  --line: #E9E3DB;
  --line-2: #D9D1C7;
  --card: #FFFFFF;
  --soft: #F7F3EE;
  --ok: #1E8E3E;  --ok-bg: #E7F5EB;
  --warn: #D96B00; --warn-bg: #FFF2E0;
  --bad: #D93025; --bad-bg: #FDECEA;
  --info-bg: #EEF3FB;
  --ev-before: #34A853; --ev-during: #F4B400; --ev-after: #EA4335;
  --radius: 14px;
  --radius-s: 9px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(31, 28, 27, .05), 0 4px 18px rgba(31, 28, 27, .06);
  --font-head: 'Bodoni Moda', 'Bodoni 72', Didot, 'Times New Roman', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; min-height: 100vh;
  overflow-x: hidden; /* never a sideways page on a phone (wide tables scroll inside their own box) */
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: .005em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .7em; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 30px; height: 30px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nw { flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { font-family: var(--font-head); font-size: 2.2rem; letter-spacing: .04em; opacity: .85; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 254, 251, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; min-height: 56px;
}
.brand { font-family: var(--font-head); font-size: 1.3rem; font-weight: 600; letter-spacing: .03em; text-decoration: none; white-space: nowrap; }
.topbar .title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: transparent; cursor: pointer; color: var(--ink); flex: none;
}
.iconbtn:hover { background: var(--soft); }
.badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad);
  color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
}
.layout { flex: 1; display: flex; min-height: 0; }
.sidenav { display: none; }
main.content { flex: 1; min-width: 0; padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1500px; width: 100%; margin: 0 auto; }
main.content.narrow { max-width: 720px; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 254, 251, .97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); display: flex; padding: 4px 4px env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h);
  text-decoration: none; color: var(--ink-3); font-size: .72rem; font-weight: 600; border-radius: 12px;
}
.bottomnav a.on { color: var(--ink); }
.bottomnav a.on .icon { stroke-width: 2.3; }
@media (min-width: 960px) {
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 2px; width: 220px; flex: none; padding: 14px 10px; border-right: 1px solid var(--line);
    position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto;
  }
  .sidenav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
  .sidenav a:hover { background: var(--soft); }
  .sidenav a.on { background: var(--ink); color: #fff; }
  .sidenav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
  main.content { padding-bottom: 40px; }
}

/* ---------- Banners ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-s); margin-bottom: 12px; font-size: .92rem; }
.banner.offline { background: #2E2A28; color: #fff; }
.banner.test { background: #FFF7D6; border: 1px dashed #C9A227; }
.banner.info { background: var(--info-bg); }
.banner.warn { background: var(--warn-bg); }
.banner.bad { background: var(--bad-bg); }
.banner.ok { background: var(--ok-bg); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card h2, .card h3 { margin-bottom: .5em; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(5, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .num { font-family: var(--font-head); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.tile .lbl { font-size: .8rem; color: var(--ink-2); }
.tile.bad .num { color: var(--bad); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 600; text-decoration: none;
  white-space: nowrap; transition: transform .05s, background .15s;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #3a3532; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn .count { background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .78rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span, .field > label.lbl { font-weight: 600; font-size: .9rem; }
.field .help { font-size: .8rem; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: #fff;
  font-size: 16px; /* no zoom on iPhone */
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.input.bad { border-color: var(--bad); background: var(--bad-bg); }
.input.time { width: 6.2em; text-align: center; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.grid2 > *, .grid3 > * { min-width: 0; }
.input { min-width: 0; max-width: 100%; }
.grid3 { display: grid; gap: 0 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 48px; height: 28px; border-radius: 14px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::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,.2); transition: left .15s; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { left: 23px; }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.err { color: var(--bad); font-weight: 600; font-size: .9rem; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; }
.palette button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.palette button.on { box-shadow: 0 0 0 3px var(--ink); }

/* ---------- Status colours ---------- */
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.orange { background: var(--warn); } .dot.red { background: var(--bad); }
.dot.closed, .dot.away { background: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: .78rem; font-weight: 600; background: var(--soft); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn, .pill.orange, .pill.waiting { background: var(--warn-bg); color: var(--warn); }
.pill.bad, .pill.red, .pill.declined { background: var(--bad-bg); color: var(--bad); }
.pill.approved { background: var(--ok-bg); color: var(--ok); }
.pill.dark { background: var(--ink); color: #fff; }
.problems { list-style: none; padding: 0; margin: 6px 0 0; }
.problems li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: .9rem; }
.problems li .icon { width: 18px; height: 18px; margin-top: 1px; }
.problems li.red { color: var(--bad); } .problems li.orange { color: var(--warn); }

/* ---------- Week plan ---------- */
.plan-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.plan {
  display: grid; grid-template-columns: 132px repeat(7, minmax(128px, 1fr)) 104px; min-width: 1150px; position: relative;
}
.plan .h, .plan .c, .plan .n, .plan .tot { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.plan .h { position: sticky; top: 0; z-index: 3; background: #fff; padding: 8px 8px 6px; border-top: 5px solid var(--line); min-height: 96px; }
.plan .h.ok { border-top-color: var(--ok); } .plan .h.orange { border-top-color: var(--warn); } .plan .h.red { border-top-color: var(--bad); }
.plan .h.closed, .plan .h.away { border-top-color: var(--ink-3); background: #FAF8F5; }
.plan .h.today { background: #FFFBEF; }
.plan .h .d1 { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.plan .h .d1 a { text-decoration: none; }
.plan .h .hol { font-size: .74rem; color: #8A5A00; font-weight: 600; }
.plan .h .lbls { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.plan .h .note { width: 100%; border: 1px dashed transparent; border-radius: 6px; font-size: .78rem; padding: 2px 4px; background: transparent; margin-top: 4px; color: var(--ink-2); }
.plan .h .note:hover { border-color: var(--line-2); }
.plan .h .note:focus { border-style: solid; border-color: var(--ink); outline: none; background: #fff; color: var(--ink); }
.plan .h .chk { font-size: .72rem; margin-top: 3px; line-height: 1.25; }
.plan .h .chk.orange { color: var(--warn); } .plan .h .chk.red { color: var(--bad); } .plan .h .chk.ok { color: var(--ok); }
.plan .corner { position: sticky; left: 0; z-index: 4; }
.plan .n {
  position: sticky; left: 0; z-index: 2; background: #fff; padding: 8px 8px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  border-left: 6px solid var(--pc, var(--line));
}
.plan .n .nm { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.plan .n .rl { font-size: .72rem; color: var(--ink-3); }
.plan .n.inactive { opacity: .55; }
.plan .c { padding: 5px; min-height: 74px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; position: relative; }
.plan .c:hover { background: #FCFAF7; }
.plan .c.closed, .plan .c.away { background: repeating-linear-gradient(135deg, #FBF9F6, #FBF9F6 8px, #F5F1EB 8px, #F5F1EB 16px); }
.plan .c.past { background-color: #FCFBF9; }
.plan .c .add { margin-top: auto; align-self: flex-start; font-size: .75rem; color: var(--ink-3); opacity: 0; padding: 2px 4px; }
.plan .c:hover .add { opacity: 1; }
.plan .tot { padding: 6px 8px; font-size: .8rem; display: flex; flex-direction: column; justify-content: center; gap: 1px; background: #FDFCFA; }
.plan .tot b { font-variant-numeric: tabular-nums; }
.plan .tot .bad { color: var(--bad); font-weight: 700; }
.plan .group { grid-column: 1 / -1; padding: 6px 10px; font-size: .75rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; background: var(--soft); border-bottom: 1px solid var(--line); position: sticky; left: 0; }
.chip {
  --pc: #888; --pcs: rgba(136,136,136,.12);
  border-radius: 8px; padding: 4px 7px; background: var(--pcs); border-left: 4px solid var(--pc); font-size: .8rem; line-height: 1.25;
  cursor: pointer; position: relative; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: 100%;
}
.chip .t1 { font-weight: 700; display: flex; align-items: center; gap: 4px; }
.chip .t2 { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.chip.leave { background: repeating-linear-gradient(135deg, #fff, #fff 6px, var(--pcs) 6px, var(--pcs) 12px); border-left-style: dashed; }
.chip.sick { border-left-color: var(--ink-3); }
.chip.bad { box-shadow: inset 0 0 0 2px var(--bad); background: var(--bad-bg); }
.chip.bad .t1 { color: var(--bad); }
.chip.changed::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #2563EB; }
.chip.waiting { background: #fff; border: 1.5px dotted var(--ink-3); border-left: 4px dotted var(--pc); color: var(--ink-2); cursor: default; }
.chip.cant { background: #EFEDEA; border-left-color: #A9A29B; color: var(--ink-2); cursor: default; }
.chip.open { background: #fff; border: 1.5px dashed var(--ink-2); border-left: 4px dashed var(--ink-2); }
.chip .reason { font-size: .72rem; color: var(--bad); font-weight: 600; }
.evbar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; margin: 3px 0 2px; background: #eee; position: relative; }
.evbar span { display: block; height: 100%; }
.evbar span.gap { background: #fff; }
.plan-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 8px; font-size: .8rem; color: var(--ink-2); }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.week-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 8px; }
.week-head h1 { margin: 0; }
.status-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }

/* ---------- Week plan on a phone: one day at a time ---------- */
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; min-height: 46px; padding: 8px 6px; }
.actions4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.actions4 .btn { flex-direction: column; gap: 3px; padding: 6px 2px; min-height: 60px; font-size: .7rem; line-height: 1.15; white-space: normal; text-align: center; position: relative; border-radius: 12px; }
.actions4 .btn .count { position: absolute; top: 4px; right: 4px; }
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 10px; position: sticky; top: 57px; z-index: 5; background: var(--bg); padding: 6px 0; }
.dchip { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; min-height: 60px; border-top: 4px solid var(--line); }
.dchip .dn { font-size: .68rem; color: var(--ink-2); font-weight: 600; }
.dchip .dd { font-size: 1.05rem; font-weight: 800; }
.dchip .dot { width: 8px; height: 8px; }
.dchip.ok { border-top-color: var(--ok); } .dchip.orange { border-top-color: var(--warn); } .dchip.red { border-top-color: var(--bad); }
.dchip.closed, .dchip.away { border-top-color: var(--ink-3); background: #FAF8F5; }
.dchip.today .dn { color: var(--ink); text-decoration: underline; }
.dchip.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.dchip.sel .dn { color: #fff; }
.daycard { border-top: 5px solid var(--line); }
.daycard.ok { border-top-color: var(--ok); } .daycard.orange { border-top-color: var(--warn); } .daycard.red { border-top-color: var(--bad); }
.daycard.closed, .daycard.away { border-top-color: var(--ink-3); }
.evline { display: block; text-decoration: none; padding: 8px 10px; border-radius: 10px; background: var(--soft); margin-top: 6px; }
.evline .dot { margin-right: 6px; }
.grouplabel { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 16px 2px 6px; }
.prow {
  display: grid; grid-template-columns: 1fr 52px; grid-template-rows: auto auto; gap: 4px 8px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-left: 7px solid var(--pc, var(--line)); border-radius: 14px; padding: 9px 8px 9px 12px; margin-bottom: 8px;
}
.prow.inactive { opacity: .55; }
.prow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; grid-column: 1; }
.prow-chips { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.prow-chips .chip { width: auto; min-width: 46%; flex: 1 1 46%; padding: 7px 9px; font-size: .86rem; }
.addbtn { grid-column: 2; grid-row: 1 / span 2; width: 52px; height: 52px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: var(--soft); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.addbtn:active { background: var(--line); }

/* Tables become cards on a phone */
@media (max-width: 759px) {
  table.tbl.stack, table.tbl.stack tbody, table.tbl.stack tr, table.tbl.stack td { display: block; width: 100%; }
  table.tbl.stack thead { display: none; }
  table.tbl.stack tr { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; padding: 6px 10px; background: #fff; }
  table.tbl.stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 10px; text-align: right; }
  table.tbl.stack td.num { text-align: right; }
  table.tbl.stack td::before { content: attr(data-label); font-weight: 600; color: var(--ink-2); text-align: left; flex: none; max-width: 48%; }
  table.tbl.stack td.first { font-size: 1.02rem; font-weight: 700; justify-content: flex-start; }
  table.tbl.stack td.first::before { content: none; }
  table.tbl.stack td { flex-wrap: wrap; }
  table.tbl.stack td > div, table.tbl.stack td > span { min-width: 0; max-width: 100%; }
  table.tbl.stack .flag { white-space: normal; text-align: left; }
  table.tbl.stack tr.hl { background: var(--warn-bg); }
  table.tbl.stack tr.hl td { background: transparent; }
  .tbl-wrap.stackwrap { border: 0; background: transparent; overflow: visible; }
  main.content { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 1.5rem; }
  .card { padding: 14px 12px; }
  .toolbar .btn { padding: 8px 12px; }
  .dv-row, .dv-hours { grid-template-columns: 88px 1fr; }
  .dv { min-width: 0; }
  .dv-row .nm { font-size: .8rem; }
  .dv-hours .ticks span:nth-child(odd) { display: none; }
  .modal { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.daylist { list-style: none; margin: 0; padding: 0; }
.daylist li { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.daylist li:last-child { border-bottom: 0; }
.daylist .dd { width: 76px; flex: none; font-weight: 700; font-size: .9rem; }
.daylist .dd small { display: block; font-weight: 500; color: var(--ink-3); }
.daylist li.today { background: #FFFBEF; border-radius: 8px; }
.person { display: inline-flex; align-items: center; gap: 6px; }
.person .dot { width: 10px; height: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); position: sticky; top: 0; background: #fff; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.hl td { background: var(--warn-bg); }
table.tbl .diff { color: var(--warn); font-weight: 700; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ---------- Clock ---------- */
.clock-card { text-align: center; padding: 18px 16px 20px; }
.clock-card .state { font-size: .95rem; color: var(--ink-2); margin-bottom: 10px; }
.bigbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 120px; border-radius: 22px;
  border: 0; cursor: pointer; font-family: var(--font-body); font-size: 2rem; font-weight: 800; letter-spacing: .02em; color: #fff;
  background: var(--ink); box-shadow: 0 8px 24px rgba(31,28,27,.22); text-transform: uppercase; padding: 18px;
}
.bigbtn small { font-size: .95rem; font-weight: 600; text-transform: none; opacity: .85; margin-top: 4px; letter-spacing: 0; }
.bigbtn.in { background: #1E7B34; }
.bigbtn.break { background: #B05A00; }
.bigbtn.out { background: #1F1C1B; }
.bigbtn[disabled] { background: #CFC8C0; box-shadow: none; cursor: default; }
.bigbtn:active:not([disabled]) { transform: scale(.985); }
.clock-full { min-height: calc(100vh - 140px); display: flex; flex-direction: column; justify-content: center; gap: 16px; max-width: 520px; margin: 0 auto; }
.clock-full .bigbtn { min-height: 38vh; font-size: 2.6rem; }
.clock-full .state { text-align: center; font-size: 1.05rem; }
.clock-time { font-family: var(--font-head); font-size: 3rem; text-align: center; font-variant-numeric: tabular-nums; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 340px; margin: 0 auto; }
.pinpad button { min-height: 68px; font-size: 1.7rem; font-weight: 700; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.pindots { display: flex; justify-content: center; gap: 14px; margin: 14px 0; }
.pindots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.pindots i.on { background: var(--ink); }
.namebtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 18px; border-radius: 16px; border: 1px solid var(--line); background: #fff; font-size: 1.25rem; font-weight: 700; cursor: pointer; border-left: 10px solid var(--pc); }

/* ---------- Next shift card / event card ---------- */
.next { border-left: 8px solid var(--pc, var(--ink)); }
.next .when { font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; }
.next .what { font-size: 1.25rem; font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .92rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.evcard .evhead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.evcard .evtype { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.timeline { margin: 12px 0 6px; }
.timeline .bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; }
.timeline .ticks { position: relative; height: 34px; font-size: .72rem; color: var(--ink-2); margin-top: 3px; }
.timeline .ticks span { position: absolute; transform: translateX(-50%); text-align: center; white-space: nowrap; line-height: 1.15; }
.timeline .ticks span b { display: block; font-variant-numeric: tabular-nums; color: var(--ink); }
.evtimes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; font-size: .9rem; margin: 8px 0; }
.evtimes div { display: flex; gap: 8px; }
.evtimes b { font-variant-numeric: tabular-nums; min-width: 3.2em; }

/* ---------- Day view ---------- */
.dayview { overflow-x: auto; }
.dv { position: relative; min-width: 760px; }
.dv-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); }
.dv-row .nm { font-weight: 700; font-size: .9rem; padding-right: 8px; display: flex; align-items: center; gap: 6px; }
.dv-track { position: relative; height: 44px; }
.dv-bar { position: absolute; top: 9px; height: 18px; border-radius: 5px; background: var(--pc); }
.dv-act { position: absolute; top: 31px; height: 5px; border-radius: 3px; background: var(--ink); }
.dv-lines { position: absolute; left: 130px; right: 0; top: 0; bottom: 0; pointer-events: none; }
@media (max-width: 759px) { .dv-lines { left: 88px; } }
.dv-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--ink-3); pointer-events: none; z-index: 1; }
.dv-line span { position: absolute; top: -18px; left: 4px; font-size: .7rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.dv-hours { display: grid; grid-template-columns: 130px 1fr; font-size: .72rem; color: var(--ink-3); }
.dv-hours .ticks { position: relative; height: 20px; }
.dv-hours .ticks span { position: absolute; transform: translateX(-50%); }
.dv-count { position: absolute; top: 10px; height: 24px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; border-right: 1px solid var(--line); }
.dv-count.z { background: var(--bad-bg); color: var(--bad); }
.dv-count.one { background: var(--warn-bg); }

/* ---------- Calendar (requests) ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { font-size: .72rem; text-align: center; color: var(--ink-3); font-weight: 700; padding: 4px 0; }
.cal button {
  min-height: 46px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .95rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; padding: 2px;
}
.cal button small { font-size: .6rem; font-weight: 600; }
.cal button.easy { background: var(--ok-bg); border-color: #BFE3C9; }
.cal button.hard { background: var(--warn-bg); border-color: #F4CFA0; }
.cal button.closed { background: #EEE; color: var(--ink-3); }
.cal button.sel { outline: 3px solid var(--ink); outline-offset: -1px; }
.cal button[disabled] { opacity: .35; cursor: default; }
.cal .empty { min-height: 46px; }

/* ---------- Modal / sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(31, 28, 27, .42); display: flex; align-items: flex-end; justify-content: center; animation: fade .12s ease-out; }
@media (min-width: 700px) { .overlay { align-items: center; padding: 20px; } }
.modal {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 40px rgba(0,0,0,.18); animation: up .16s ease-out;
}
.modal.wide { max-width: 860px; }
@media (min-width: 700px) { .modal { border-radius: 20px; } }
.modal .mhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.modal .mhead h2 { margin: 0; }
.modal .mfoot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; position: sticky; bottom: -18px; background: var(--bg); padding: 10px 0 0; }
.modal .mfoot .btn { flex: 1 1 140px; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-grid .btn { justify-content: flex-start; text-align: left; white-space: normal; min-height: 54px; flex-direction: column; align-items: flex-start; gap: 0; }
.menu-grid .btn small { font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; animation: up .16s ease-out; }
.toast.bad { background: var(--bad); }
.toast.ok { background: #1E6B33; }

/* ---------- Login ---------- */
.login { max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 28px) 16px 40px; }
.login .logo { width: 132px; height: 132px; margin: 0 auto 8px; border-radius: 50%; }
.login h1 { text-align: center; font-size: 2.1rem; }
.langswitch { display: flex; justify-content: center; margin: 4px 0 18px; }
.howto { display: grid; gap: 12px; }
.howto .stepimg { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.howto .stepimg svg { width: 100%; height: auto; }
.howto ol { margin: 6px 0 0; padding-left: 22px; }
.howto li { margin-bottom: 6px; }

/* ---------- Misc ---------- */
.empty { text-align: center; color: var(--ink-2); padding: 28px 10px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notice.unread .ntitle { font-weight: 800; }
.notice .ntime { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.histrow { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.histrow .ht { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.histrow .reason { color: var(--bad); font-weight: 600; }
.histday { font-weight: 700; margin: 18px 0 2px; }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
details.card > summary::after { content: '+'; font-size: 1.4rem; color: var(--ink-3); }
details.card[open] > summary::after { content: '–'; }
details.card[open] > summary { margin-bottom: 12px; }
kbd { font-family: inherit; background: var(--soft); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--soft); margin: 1px 2px 1px 0; white-space: nowrap; }
.flag.check { background: var(--warn-bg); color: var(--warn); }
.flag.late { background: var(--bad-bg); color: var(--bad); }
.flag.okf { background: var(--ok-bg); color: var(--ok); }

/* ---------- Print: one A4 landscape page ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; font-size: 10px; }
  .topbar, .sidenav, .bottomnav, .toolbar, .no-print, .banner, .toasts, .plan-foot .no-print, .warnings-box { display: none !important; }
  main.content { padding: 0; max-width: none; }
  .print-only { display: block; }
  .print-title { font-family: var(--font-head); font-size: 18px; margin: 0 0 4px; }
  .plan-wrap { overflow: visible; border: 0; }
  .plan { min-width: 0; width: 100%; grid-template-columns: 90px repeat(7, 1fr) 62px; }
  .plan .h { min-height: 0; padding: 3px 4px; position: static; }
  .plan .h .note { border: 0; font-size: 8px; }
  .plan .h .add-ev, .plan .c .add { display: none; }
  .plan .n { position: static; padding: 3px 5px; }
  .plan .c { min-height: 0; padding: 2px; }
  .chip { font-size: 8.5px; padding: 2px 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chip.changed::after { display: none; }
  .plan .h, .evbar span, .plan .n, .dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .week-head h1 { font-size: 16px; }
}
