/* GDS Time — one document, two renderings. Tokens come from _theme.html (the brand
   master); nothing here introduces a colour literal beyond the chrome bar's greys. */
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0}
body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:16px;
  line-height:1.5;-webkit-text-size-adjust:100%;
  --safe-top:env(safe-area-inset-top,0px);--safe-bot:env(safe-area-inset-bottom,0px);
  --ok-soft:color-mix(in srgb, var(--ok) 14%, transparent);
  --warn-soft:color-mix(in srgb, var(--warn) 16%, transparent);
  --err-soft:color-mix(in srgb, var(--err) 12%, transparent);
  --accent-wash:color-mix(in srgb, var(--accent) 14%, transparent);
  --radius:10px}
:root{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* --- chrome ------------------------------------------------------------- */
.chrome{background:var(--chrome);color:var(--on-chrome);
  padding:calc(8px + var(--safe-top)) 14px 8px;
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;position:sticky;top:0;z-index:100}
.chrome a.wordmark{color:var(--brand);font-weight:800;font-size:17px;letter-spacing:-.4px;
  text-decoration:none;flex-shrink:0}
.chrome .app{font-size:13px;color:#cbd5e1;flex-shrink:0}
.chrome .ver{font-size:11px;color:#7c8899;flex-shrink:0;font-variant-numeric:tabular-nums}
.chrome-right{margin-left:auto;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.chrome .who{font-size:12px;color:#94a3b8;min-width:0;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.chrome .chip{font-size:10px;text-transform:uppercase;letter-spacing:.5px;border:1px solid rgba(148,163,184,.5);
  border-radius:4px;padding:1px 5px;color:#cbd5e1}
.chrome-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;
  min-width:34px;padding:0 10px;border-radius:6px;border:1px solid rgba(148,163,184,.35);
  background:transparent;color:#e2e8f0;font-size:14px;font-weight:600;text-decoration:none;
  flex-shrink:0;line-height:1;cursor:pointer;font-family:inherit}
.chrome-btn:hover{background:rgba(148,163,184,.15)}
.chrome-btn:focus-visible{outline:2px solid #fff;outline-offset:2px}
/* theme and language look identical: they are the same kind of choice. The theme
   switch's base rules come from the master block; only the size is aligned here. */
.theme-switch button,.lang-switch .lang{padding:11px 9px;line-height:1}
.lang-switch{display:inline-flex;border:1px solid rgba(148,163,184,.35);border-radius:6px;
  overflow:hidden;flex-shrink:0}
.lang-switch .lang{border:none;background:transparent;color:#cbd5e1;font-size:11px;font-weight:600;
  cursor:pointer;text-decoration:none;text-align:center;font-family:inherit;min-width:36px;letter-spacing:.3px}
.lang-switch .lang+.lang{border-left:1px solid rgba(148,163,184,.25)}
.lang-switch .lang.on{background:var(--accent);color:#fff}
.lang-switch a.lang:hover{background:rgba(148,163,184,.15);color:#fff}
.lang-switch .lang:focus-visible{outline:2px solid #fff;outline-offset:-2px}
.menu-wrap{position:relative}
.menu{position:absolute;right:0;top:40px;background:var(--surface-raised);border:1px solid var(--border);
  border-radius:8px;min-width:200px;padding:6px;box-shadow:0 12px 32px rgba(0,0,0,.25);z-index:200;
  display:flex;flex-direction:column;gap:2px}
.menu button{border:none;background:transparent;color:var(--text);text-align:left;padding:0 12px;
  min-height:var(--tap);border-radius:6px;font:inherit;cursor:pointer}
.menu button:hover{background:var(--hover)}
.menu .switches{display:none;gap:8px;padding:6px 8px 8px;border-bottom:1px solid var(--border);margin-bottom:4px}
.menu .switches .theme-switch,.menu .switches .lang-switch{background:var(--chrome);border-radius:6px}

.review-note{background:var(--warn);color:#fff;font-size:12.5px;line-height:1.4;padding:9px 16px}
.review-note strong{text-transform:uppercase;letter-spacing:.5px;font-size:10.5px;
  border:1px solid rgba(255,255,255,.6);border-radius:4px;padding:1px 5px;margin-right:6px}

/* --- layout ------------------------------------------------------------- */
.wrap{max-width:1180px;margin:0 auto;padding:14px 14px calc(110px + var(--safe-bot))}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:20px;max-width:560px;margin:24px auto}
.card h1{margin:0 0 8px;font-size:20px}
.notice{background:var(--accent-wash);border:1px solid var(--border);border-radius:8px;
  padding:8px 12px;font-size:13px;margin:0 0 10px}
.notice.warn{background:var(--warn-soft)}
.empty{color:var(--muted);text-align:center;padding:24px 8px;margin:0}

.weekbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.weektitle{min-width:120px}
.weektitle h1{margin:0;font-size:20px;line-height:1.1}
.weekrange{font-size:12px;color:var(--muted)}
.person-pick{margin-left:auto}
.person-pick select{min-height:40px;border-radius:8px;border:1px solid var(--border);
  background:var(--surface);color:var(--text);font:inherit;padding:0 10px;max-width:220px}

/* --- controls ----------------------------------------------------------- */
.btn{min-height:var(--tap);border-radius:8px;border:1px solid var(--border);background:var(--surface);
  color:var(--text);font-size:15px;font-weight:600;padding:0 16px;cursor:pointer;font-family:inherit;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none;line-height:1}
.btn:hover{background:var(--hover)}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-primary:hover{background:color-mix(in srgb, var(--accent) 85%, #000)}
.btn-danger{color:var(--err);border-color:color-mix(in srgb, var(--err) 40%, var(--border))}
.btn-small{min-height:36px;font-size:13px;padding:0 12px}
.btn-icon{min-width:var(--tap);padding:0;font-size:22px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{
  outline:3px solid var(--accent);outline-offset:2px}
:root[data-theme="dark"] .btn:focus-visible{outline-color:#fff}
.count{background:var(--accent);color:#fff;border-radius:999px;font-size:11px;min-width:18px;
  height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}

.actions{position:fixed;left:0;right:0;bottom:0;display:flex;gap:8px;flex-wrap:wrap;
  padding:10px 14px calc(10px + var(--safe-bot));background:var(--surface);
  border-top:1px solid var(--border);z-index:50}
.actions .btn{flex:1 1 auto}

/* --- the grid ----------------------------------------------------------- */
.gridwrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.grid{border-collapse:separate;border-spacing:0;width:100%;min-width:720px;font-variant-numeric:tabular-nums}
.grid th,.grid td{border-bottom:1px solid var(--border);padding:0;vertical-align:middle}
.grid th{font-size:12px;font-weight:600;color:var(--muted);text-align:center;padding:8px 4px;
  background:var(--sunken);position:sticky;top:0;z-index:2}
.grid th.rowhead,.grid td.rowhead{position:sticky;left:0;background:var(--surface);z-index:3;
  text-align:left;min-width:190px;max-width:260px;padding:6px 10px;border-right:1px solid var(--border)}
.grid th.rowhead{background:var(--sunken);z-index:4}
.grid th .dnum{display:block;font-size:15px;color:var(--text)}
.grid th.today .dnum{color:var(--accent)}
.grid th .dreason{display:block;font-size:10px;font-weight:500;text-transform:uppercase;letter-spacing:.4px}
.grid th.off{background:color-mix(in srgb, var(--sunken) 70%, var(--border))}
.rowhead .pn{font-weight:700;font-size:13px}
.rowhead .pt{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.rowhead .cat{display:inline-block;font-size:11px;border:1px solid var(--border);border-radius:4px;
  padding:1px 6px;margin-top:3px;background:var(--sunken)}
.rowhead .cat.nb{border-style:dashed}
.rowhead .rm{float:right;border:none;background:none;color:var(--muted);cursor:pointer;font-size:16px;
  min-width:28px;min-height:28px;border-radius:6px}
.rowhead .rm:hover{background:var(--hover);color:var(--err)}
.grid td.cell{text-align:center;width:11%}
.cellbtn{width:100%;min-height:var(--tap);border:none;background:transparent;color:var(--text);
  font:inherit;font-size:15px;cursor:pointer;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:1px;padding:4px 2px}
.cellbtn:hover{background:var(--hover)}
.cellbtn .desc{font-size:10px;color:var(--muted);max-width:100%;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.cellbtn.empty{color:var(--disabled)}
.cellbtn:disabled{cursor:not-allowed;opacity:.5}
.grid td.off{background:color-mix(in srgb, var(--sunken) 60%, transparent)}
.grid tfoot td{font-weight:700;text-align:center;padding:8px 4px;background:var(--sunken);font-size:14px}
.grid tfoot td.rowhead{text-align:left}
.grid tfoot td.ok{background:var(--ok-soft)}
.grid tfoot td.warn{background:var(--warn-soft)}
.grid tfoot td .exp{display:block;font-size:10px;font-weight:500;color:var(--muted)}
.lock{font-size:11px;margin-left:3px}

/* --- day chips (mobile) ------------------------------------------------- */
.daychips{display:none;gap:4px;margin-bottom:10px}
.daychip{flex:1;min-height:var(--tap);border:1px solid var(--border);border-radius:8px;background:var(--surface);
  color:var(--text);font:inherit;font-size:12px;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:1px;cursor:pointer;padding:2px 0}
.daychip .dn{font-size:15px;font-weight:700}
.daychip.active{border-color:var(--accent);background:var(--accent-wash)}
.daychip .dot{width:7px;height:7px;border-radius:50%;background:var(--border)}
.daychip .dot.ok{background:var(--ok)}
.daychip .dot.warn{background:var(--warn)}

/* --- sheets (bottom on phones, centred dialog on desktop) ---------------- */
.sheet{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;justify-content:flex-end;
  background:rgba(0,0,0,0);pointer-events:none;transition:background .2s}
.sheet.open{background:rgba(0,0,0,.62);pointer-events:all}
.sheet-inner{background:var(--surface);border-radius:16px 16px 0 0;max-height:93dvh;display:flex;
  flex-direction:column;overflow:hidden;transform:translateY(100%);
  transition:transform .26s cubic-bezier(.32,.72,0,1);padding-bottom:var(--safe-bot)}
.sheet.open .sheet-inner{transform:translateY(0)}
.drag-h{width:36px;height:4px;border-radius:2px;background:var(--border);margin:10px auto 0;flex-shrink:0}
.sh-hdr{display:flex;align-items:flex-start;justify-content:space-between;padding:8px 14px 10px;
  border-bottom:1px solid var(--border);flex-shrink:0;position:relative}
.sh-title-block{flex:1;padding-right:36px}
.sh-jobn{font-size:12px;font-weight:700;color:var(--accent);margin-bottom:2px}
.sh-title{font-size:16px;font-weight:700;line-height:1.3}
.sh-sub{font-size:12px;color:var(--muted);margin-top:3px}
.sh-close{position:absolute;right:10px;top:6px;background:none;border:none;color:var(--muted);
  font-size:22px;min-width:36px;min-height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer}
.sh-body{padding:12px 14px;overflow:auto;display:flex;flex-direction:column;gap:12px}
.field{display:flex;flex-direction:column;gap:6px}
.field>span{font-size:12px;font-weight:600;color:var(--muted)}
.field input[type=text],.field input[type=search],.field textarea,.search{min-height:var(--tap);
  border:1px solid var(--border);border-radius:8px;background:var(--sunken);color:var(--text);
  font:inherit;padding:8px 10px;width:100%}
.field textarea{resize:vertical}
.stepper{display:flex;gap:6px;align-items:center}
.hours-input{flex:1;text-align:center;font-size:22px;font-weight:700;min-height:var(--tap);
  border:1px solid var(--border);border-radius:8px;background:var(--sunken);color:var(--text);font-family:inherit}
.quick{display:flex;gap:6px}
.quick .btn{flex:1}
.sh-actions{display:flex;gap:8px;align-items:center;padding-top:4px}
.sh-actions .spacer{flex:1}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chipbtn{min-height:38px;border-radius:999px;border:1px solid var(--border);background:var(--surface);
  color:var(--text);font:inherit;font-size:13px;padding:0 12px;cursor:pointer}
.chipbtn.on{background:var(--accent);border-color:var(--accent);color:#fff}
.picker-list{max-height:40dvh;overflow:auto;border:1px solid var(--border);border-radius:8px}
.picker-group{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);
  padding:6px 10px;background:var(--sunken);position:sticky;top:0}
.picker-item{display:block;width:100%;text-align:left;border:none;border-bottom:1px solid var(--border);
  background:transparent;color:var(--text);font:inherit;padding:8px 10px;min-height:var(--tap);cursor:pointer}
.picker-item:hover{background:var(--hover)}
.picker-item.on{background:var(--accent-wash)}
.picker-item .pn{font-weight:700;font-size:13px}
.picker-item .pt{font-size:12px;color:var(--muted);display:block}
.sugg-list{display:flex;flex-direction:column;gap:6px;max-height:50dvh;overflow:auto}
.sugg-item{display:flex;gap:10px;align-items:center;border:1px solid var(--border);border-radius:8px;
  padding:8px 10px;min-height:var(--tap)}
.sugg-item input{width:20px;height:20px}
.sugg-item .pn{font-weight:700;font-size:13px}
.sugg-item .pt{font-size:12px;color:var(--muted)}
.sugg-item .src{margin-left:auto;font-size:11px;color:var(--muted);white-space:nowrap}
.sugg-item select{min-height:36px;border-radius:6px;border:1px solid var(--border);background:var(--sunken);color:var(--text);font:inherit}

.install-banner{position:fixed;left:12px;right:12px;bottom:calc(76px + var(--safe-bot));z-index:900;
  background:var(--surface-raised);border:1px solid var(--border);border-radius:10px;padding:10px 12px;
  display:flex;gap:10px;align-items:center;font-size:13px;box-shadow:0 12px 32px rgba(0,0,0,.25)}
.install-banner span{flex:1}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(80px + var(--safe-bot));
  background:var(--chrome);color:var(--on-chrome);padding:10px 16px;border-radius:8px;font-size:14px;
  z-index:1100;max-width:90vw}
.toast.err{background:var(--err)}

/* --- sub-navigation and list pages -------------------------------------- */
.subnav{display:flex;gap:4px;padding:6px 14px 0;max-width:1180px;margin:0 auto;overflow-x:auto}
.subnav a{padding:8px 12px;border-radius:8px;text-decoration:none;color:var(--muted);font-weight:600;font-size:14px;white-space:nowrap}
.subnav a[aria-current]{background:var(--surface);color:var(--text);border:1px solid var(--border)}
.pagetitle{font-size:20px;margin:8px 0 12px}
.card.form,.form{display:flex;flex-direction:column;gap:12px}
.card{max-width:none;margin:0 0 14px}
.card h2{font-size:15px;margin:14px 0 8px}
.card h2 .muted{font-weight:500}
.muted{color:var(--muted)}
.fields{display:flex;gap:12px;flex-wrap:wrap}
.fields .field{flex:1 1 180px}
.field select,.field input[type=date]{min-height:var(--tap);border:1px solid var(--border);border-radius:8px;
  background:var(--sunken);color:var(--text);font:inherit;padding:8px 10px;width:100%}
.presets{display:flex;gap:6px;flex-wrap:wrap}
.tablewrap{overflow-x:auto}
table.list{border-collapse:collapse;width:100%;font-size:14px}
table.list th,table.list td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--border);vertical-align:top}
table.list th{font-size:12px;color:var(--muted);background:var(--sunken)}
table.list .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
table.list tr.total td{font-weight:700;background:var(--sunken)}
.grid.team td.cell.ok{background:var(--ok-soft)}
.grid.team td.cell.warn{background:var(--warn-soft)}
.grid.team td.total{font-variant-numeric:tabular-nums}
.grid.team .cellbtn{text-decoration:none}
.grid.team .rowhead a{color:var(--text);text-decoration:none}

/* --- adaptive ----------------------------------------------------------- */
@media (min-width:720px){
  .sheet{align-items:center;justify-content:center}
  .sheet-inner{width:min(560px,92vw);border-radius:14px;transform:translateY(24px) scale(.98);
    opacity:0;max-height:88vh;padding-bottom:0}
  .sheet.open .sheet-inner{transform:none;opacity:1}
  .drag-h{display:none}
  .actions{position:sticky;bottom:0;margin:12px -14px 0;left:auto;right:auto}
  .actions .btn{flex:0 0 auto}
}
@media (max-width:719.98px){
  .daychips{display:flex}
  .grid{min-width:0;width:100%;table-layout:fixed}
  .grid th.day:not(.active),.grid td.cell:not(.active),.grid tfoot td.day:not(.active){display:none}
  .grid th.rowhead,.grid td.rowhead{min-width:0;max-width:none;width:58%;position:static;overflow:hidden}
  .grid td.cell,.grid th.day,.grid tfoot td.day{width:42%}
  .grid th.rowhead{position:static}
  .cellbtn{font-size:18px}
  .cellbtn .desc{font-size:11px}
  .chrome .app,.chrome .ver{display:none}
  .chrome-right>.theme-switch,.chrome-right>.lang-switch{display:none}
  .menu .switches{display:flex;flex-wrap:wrap}
  .chrome .who{max-width:46vw}
  .theme-switch button,.lang-switch .lang{padding:11px 7px}
}
@media (prefers-reduced-motion: reduce){
  *{animation-duration:.01ms !important;transition-duration:.01ms !important}
}
