/* Wally Roster. Layout follows the familiar Deputy pattern (dark top bar, lavender pill
   controls, team column on the left, green published shift cards). Wally's own palette. */
:root {
  --nav: #1b1464;
  --nav-ink: #ffffff;
  --primary: #3a2bb8;
  --primary-ink: #ffffff;
  --pill: #eeecfb;
  --pill-ink: #2a2270;
  --bg: #f6f6fa;
  --card: #ffffff;
  --ink: #1d1b36;
  --muted: #6c6a84;
  --line: #e7e6f0;
  --line-2: #d8d6e6;
  --good: #3fa35a;
  --good-bg: #e2f5dd;
  --good-line: #93d08a;
  --unpub-bg: #eeeef2;
  --unpub-line: #c9c8d4;
  --amber: #c98a00;
  --amber-bg: #fff3d1;
  --bad: #d64545;
  --bad-bg: #fde8e7;
  --unav-bg: #efedfd;
  --unav-line: #bdb6f3;
  --unav-ink: #4a3fb3;
  --purple: #6b3fd6;
  --sel: #4b2aa6;
  --r-lead: #e0529c;
  --r-floor: #f08c3a;
  --r-onlines: #4a7be0;
  --radius: 10px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* layout rules (grid/flex) must not un-hide things */
body { margin: 0; background: var(--bg); color: var(--ink); }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 14px 0 8px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: default; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 16px; }
.error { color: var(--bad); min-height: 1.1em; }
.warn-text { color: var(--amber); }
.spacer { flex: 1; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Buttons */
.primary { background: var(--primary); color: var(--primary-ink); border-radius: 8px; padding: 8px 14px; font-weight: 600; text-decoration: none; display: inline-block; text-align: center; }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.primary.block { display: block; width: 100%; padding: 12px; font-size: 15px; }
.ghost { background: transparent; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 14px; }
.danger { background: var(--bad); color: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 600; }
.pill { background: var(--pill); color: var(--pill-ink); border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill:hover:not(:disabled):not(.static) { filter: brightness(.97); }
.pill.static { cursor: default; }
.pill.icon { padding: 7px 10px; }
.pill.on { background: var(--primary); color: #fff; }
.pill.ok { background: var(--good-bg); color: #1f6b30; }
.pill.warn { background: var(--amber-bg); color: #7a5300; }
.pill-group { display: inline-flex; gap: 2px; }
.pill-select { background: var(--pill); color: var(--pill-ink); border: 0; border-radius: 8px; padding: 5px 8px; font-weight: 600; font-size: 13px; }
.link-plain { color: var(--primary); text-decoration: underline; padding: 0 4px 0 0; font-size: 13px; }
.link-btn { color: var(--bad); text-decoration: underline; padding: 0 4px; font-size: 13px; }
.ico { width: 14px; height: 14px; fill: currentColor; }
select, input[type=number], input[type=time], input[type=password], input[type=text], input[type=email], input[type=tel], input[type=date], input[type=search], input:not([type]), textarea {
  border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; background: #fff;
}
textarea { font: inherit; color: inherit; width: 100%; box-sizing: border-box; resize: vertical; }

/* Top navigation */
.nav { background: var(--nav); color: var(--nav-ink); display: flex; align-items: center; gap: 12px 14px; padding: 0 16px; min-height: 52px; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.nav-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.brand { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand img { height: 22px; width: auto; display: block; }
.brand span { font-size: 17px; font-weight: 500; letter-spacing: -.2px; opacity: .85; line-height: 1; }
.nav-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs a { white-space: nowrap; }
.nav-tabs a { color: rgba(255,255,255,.8); text-decoration: none; padding: 16px 12px; font-weight: 600; border-bottom: 3px solid transparent; }
.nav-tabs a:hover { color: #fff; }
.nav-tabs a.on { color: #fff; border-bottom-color: #fff; }
.nav-btn { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 500; font-size: 13px; }
.nav-btn:hover { color: #fff; }
.nav-user { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* Page */
.page { padding: 14px 16px 40px; max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.page-head { display: flex; align-items: center; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.banner { border-radius: var(--radius); padding: 10px 14px; }
.banner.warn { background: var(--amber-bg); color: #6b4a00; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.tb-left, .tb-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(20,16,70,.14); padding: 6px; z-index: 15; display: grid; min-width: 210px; }
.menu-list[hidden] { display: none; }
.menu-list button { text-align: left; padding: 8px 10px; border-radius: 6px; }
.menu-list button:hover { background: var(--pill); }

/* Insights */
.insights { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ins-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.ins-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 11px; color: var(--muted); }

/* Schedule grid */
.grid-card { padding: 0; overflow: hidden; }
table.sched { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1060px; table-layout: fixed; }
.sched th, .sched td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.sched th:last-child, .sched td:last-child { border-right: 0; }
.sched thead th { background: #fbfbfd; padding: 8px; text-align: left; position: sticky; top: 0; z-index: 2; }
.sched .who { width: 200px; position: sticky; left: 0; background: #fff; z-index: 3; }
.sched thead .who { z-index: 4; background: #fbfbfd; }
.sched .corner input { width: 100%; }
.dh { font-size: 13px; color: var(--pill-ink); display: flex; align-items: center; gap: 6px; }
.dh b { font-weight: 800; }
.ds { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }
th.day.today { box-shadow: inset 0 3px 0 var(--primary); }
th.day.hl, td.cell.hl { background: #fffbe8; }
.warn-dot { color: var(--bad); font-size: 11px; font-weight: 700; cursor: help; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; margin-top: 4px; margin-right: 3px; }
.tag.ph { background: #efe4fb; color: var(--purple); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.who-in { display: flex; align-items: center; gap: 8px; padding: 8px; width: 100%; text-align: left; border-radius: 0; }
button.who-in:hover { background: #f8f8fc; }
.who-txt { display: grid; min-width: 0; }
.who-name { font-weight: 700; color: var(--pill-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { font-size: 12px; color: var(--muted); }
.row-sel .who { box-shadow: inset 3px 0 0 var(--sel); }
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.open-av { background: #fde3ee; color: #c2266f; font-size: 16px; }
.cover-row td { background: #fcfcfe; }
td.cover { padding: 6px 6px 4px; }
td.cover svg { display: block; width: 100%; height: 34px; }
.cover-btn { display: block; width: 100%; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.cover-btn:hover, .cover-btn:focus-visible { outline: 2px solid var(--pill); outline-offset: 2px; }
table.guide td:not(:first-child), table.guide th:not(:first-child) { text-align: right; }
table.guide td { white-space: nowrap; }
table.guide tr.short td { background: var(--amber-bg); }
#guideBody, #lookaheadBody { min-width: 0; }
.da { font-size: 11px; color: var(--good); font-weight: 600; }
.la-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.la-controls input { margin-left: 6px; }
.la-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.la-day { padding: 8px 0; border-bottom: 1px solid var(--line); }
.la-day ul { margin: 4px 0 0; padding-left: 0; list-style: none; font-size: 13px; }
.la-day li { margin: 3px 0; }
.la-date { font-weight: 700; color: var(--primary); background: none; border: 0; padding: 0; margin-right: 8px; cursor: pointer; text-decoration: underline; }
.la-week { margin-bottom: 10px; }
.la-week-head { display: flex; gap: 8px; align-items: center; margin: 10px 0 2px; }
.pill.static.warn { background: var(--amber-bg); color: #6b4a00; }
.la-to { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; } /* a grid item: let the tables scroll instead of widening the dialog */
.closed-cell { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 0; }
td.cell { padding: 5px 5px 26px; position: relative; min-height: 58px; }
td.cell.closed { background: repeating-linear-gradient(135deg, #fafafc, #fafafc 6px, #f3f3f7 6px, #f3f3f7 12px); }
td.cell .add { position: absolute; left: 5px; right: 5px; bottom: 4px; height: 20px; border-radius: 6px; color: var(--muted); opacity: 0; font-size: 16px; line-height: 18px; }
td.cell:hover .add, td.cell .add:focus { opacity: 1; background: var(--pill); color: var(--pill-ink); }

/* Shift cards */
.shift { display: block; width: 100%; text-align: left; border-radius: 6px; padding: 5px 7px 5px 9px; margin-bottom: 4px; position: relative; border: 1px solid var(--unpub-line); background: var(--unpub-bg); box-shadow: inset 3px 0 0 var(--role-c, var(--r-floor)); }
.shift.r-lead { --role-c: var(--r-lead); }
.shift.r-floor { --role-c: var(--r-floor); }
.shift.r-onlines { --role-c: var(--r-onlines); }
.shift.pub { background: var(--good-bg); border-color: var(--good-line); }
.shift.empty { background: #fff; border-color: var(--line-2); }
.shift.empty.pub { background: var(--good-bg); }
.shift.sel { background: var(--sel); border-color: var(--sel); color: #fff; }
.shift.sel .sa { color: rgba(255,255,255,.8); }
.shift:hover { filter: brightness(.97); }
.shift .st { display: block; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.shift .sa { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stags { display: flex; gap: 3px; justify-content: flex-end; margin-top: 2px; }
.stag { font-size: 9px; font-weight: 800; letter-spacing: .3px; border-radius: 3px; padding: 1px 4px; }
.stag.grey { background: #6c6a84; color: #fff; }
.stag.amber { background: var(--amber); color: #fff; }
.stag.purple { background: var(--purple); color: #fff; }
.sw { position: absolute; top: 3px; right: 5px; color: var(--bad); font-size: 10px; }
.leave { border-radius: 6px; padding: 6px 8px; font-size: 12px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.leave.inline { display: inline-block; padding: 2px 8px; margin: 0 4px 0 0; }
.l-leave { background: var(--bad-bg); color: #9b2c25; border: 1px solid #f2b0ab; }
.l-unav { background: var(--unav-bg); color: var(--unav-ink); border: 1px solid var(--unav-line); }

/* Status bar */
.statusbar { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.sb-item { display: inline-flex; align-items: center; gap: 6px; }
.sb-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid transparent; }
.sb-dot.empty { background: #fff; border-color: var(--line-2); }
.sb-dot.unpub { background: var(--unpub-bg); border-color: var(--unpub-line); }
.sb-dot.pub { background: var(--good-bg); border-color: var(--good-line); }
.sb-dot.amber { background: var(--amber); }
.sb-dot.bad { background: var(--bad); }
.sb-dot.unav { background: var(--unav-bg); border-color: var(--unav-line); }

/* Warnings */
.checks-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.checks h3 { margin: 0; }
.filters { display: flex; gap: 12px; font-size: 13px; }
.flags { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.flags li { display: grid; grid-template-columns: 80px 70px 1fr; gap: 8px; align-items: start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.flags li:hover { background: #f6f6fb; }
.sev { font-size: 10px; font-weight: 800; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; text-align: center; }
.sev.block { background: var(--bad-bg); color: var(--bad); }
.sev.warn { background: var(--amber-bg); color: #8a5e00; }
.sev.info { background: #eeeff3; color: var(--muted); }
.seen { font-size: 11px; font-weight: 700; margin-left: 4px; }
.seen.yes { color: var(--good); }
.seen.no { color: var(--muted); font-weight: 500; }

/* Lists: people, change log, timesheets */
table.list { border-collapse: collapse; width: 100%; font-size: 13px; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.inactive td { opacity: .55; }
.person { display: inline-flex; align-items: center; gap: 8px; }
.links { white-space: nowrap; }

/* Timesheets */
.ts-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; align-items: start; }
.ts-team { padding: 6px; display: grid; gap: 2px; }
.ts-member { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; text-align: left; width: 100%; }
.ts-member:hover { background: #f6f6fb; }
.ts-member.on { background: var(--pill); }
.ts-member .tick { margin-left: auto; color: var(--good); font-weight: 800; }
.tabs-row { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); margin: -4px -4px 8px; padding: 0 4px; }
.tab { padding: 10px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.on { color: var(--pill-ink); border-bottom-color: var(--primary); }
.count { background: #eeeff3; border-radius: 10px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
table.tsheet tr.grp td { background: #f7f7fb; font-weight: 700; color: var(--pill-ink); }
.spill { border-radius: 12px; padding: 2px 9px; font-size: 12px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.spill.ok { color: #1f7a38; border-color: var(--good-line); background: #f1faef; }
.spill.pend { color: #8a5e00; border-color: #f0d38a; background: #fffaeb; }
.spill.live { color: var(--primary); border-color: #c6c0f3; background: #f4f2fe; }
.spill.bad { color: var(--bad); border-color: #f2b0ab; background: #fff5f4; }
.spill.sched { color: var(--muted); border-color: var(--line-2); background: #fafafc; }
.flagchip { display: inline-block; font-size: 11px; color: #8a5e00; background: var(--amber-bg); border-radius: 4px; padding: 1px 6px; margin: 1px 2px 1px 0; }
td.acts { white-space: nowrap; text-align: right; }

/* Dialogs */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(20,16,70,.25); }
dialog.wide { width: min(980px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(20,16,70,.35); }
.dlg { padding: 18px; display: grid; gap: 12px; }
.dlg h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.fields { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 10px; align-items: center; }
.fields.two { grid-template-columns: 160px minmax(0, 1fr); }
.fields.three { grid-template-columns: 60px auto auto; justify-content: start; }
.fields.four { grid-template-columns: 50px auto auto auto; justify-content: start; }
.fields.unav-add { grid-template-columns: auto auto auto 1fr auto; }
ul.unav { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.preview { display: grid; gap: 4px; }
.msg-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.msg-head { display: flex; align-items: center; gap: 8px; }
.msg-card pre { white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: #f7f7fb; padding: 10px; border-radius: 8px; margin: 8px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--nav); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; font-size: 14px; box-shadow: 0 8px 24px rgba(20,16,70,.3); }

/* Team member view (Me) */
.me { max-width: 560px; }
.me-hello { font-size: 20px; font-weight: 800; }
.me-today { display: grid; gap: 10px; }
.me-date { font-weight: 700; color: var(--pill-ink); display: flex; justify-content: space-between; }
.me-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.today-shift { border-radius: 10px; padding: 12px 14px; background: var(--good-bg); border: 1px solid var(--good-line); box-shadow: inset 4px 0 0 var(--role-c, var(--r-floor)); display: grid; }
.today-shift.r-lead, .my-shift.r-lead { --role-c: var(--r-lead); }
.today-shift.r-onlines, .my-shift.r-onlines { --role-c: var(--r-onlines); }
.today-shift .st { font-size: 20px; font-weight: 800; }
.today-shift .sa { color: var(--muted); }
.clock-btn { width: 100%; padding: 16px; border-radius: 12px; font-size: 18px; font-weight: 800; color: #fff; }
.clock-btn.start { background: var(--good); }
.clock-btn.end { background: var(--bad); }
.on-shift { margin: 0; font-size: 15px; }
.clock-note { margin: 0; background: var(--amber-bg); color: #6b4a00; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.week-card.unseen { border-color: #d4b106; box-shadow: 0 0 0 1px #f0d38a; }
.wc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wc-head h2 { margin: 0; }
ul.my-shifts { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 6px; }
.my-shift { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 8px 10px; background: var(--good-bg); border: 1px solid var(--good-line); border-radius: 10px; box-shadow: inset 4px 0 0 var(--role-c, var(--r-floor)); }
.my-shift.past { opacity: .6; }
.my-shift.is-today { outline: 2px solid var(--primary); }
.ms-day { display: grid; text-align: center; font-size: 18px; font-weight: 800; color: var(--pill-ink); line-height: 1.1; }
.ms-day b { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.ms-body { display: grid; }
.ms-body .st { font-weight: 700; font-size: 15px; }
.ms-body .sa { color: var(--muted); font-size: 12px; }
.with { font-size: 12px; color: var(--pill-ink); }
.with.alone { color: var(--muted); }
.with span { white-space: nowrap; }
.today-shift .with { font-size: 14px; margin-top: 4px; }
button.gotit { margin: 6px 0 8px; }
details summary { cursor: pointer; font-weight: 600; margin-top: 6px; color: var(--pill-ink); }
table.team { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.team th { text-align: left; width: 58px; vertical-align: top; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.team td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.team td span { display: inline-block; margin: 0 8px 4px 0; }
table.team .me { font-weight: 800; }
table.team .open-cover { color: var(--muted); font-style: italic; }
ul.recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
ul.recent li { display: grid; grid-template-columns: 1fr 1.3fr .6fr .9fr; gap: 6px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Self-service and requests (step 4) */
.badge { background: #ff5a8a; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 800; margin-left: 4px; }
ul.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.req-list > li { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.req-list > li:last-child { border-bottom: 0; }
.rq-what { font-weight: 600; }
.rq-status { font-size: 13px; color: var(--muted); }
.st-approved .rq-status { color: var(--good); font-weight: 600; }
.st-declined .rq-status, .st-expired .rq-status { color: var(--bad); }
.rq-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.rq-head { display: flex; gap: 8px; align-items: center; }
.rq-checks { display: flex; flex-wrap: wrap; gap: 4px; }
.flagchip.block { background: var(--bad-bg); color: var(--bad); }
li.req-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
ul.req-list > li.req-card:last-child { border-bottom: 1px solid var(--line); }
ul.hands { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
ul.hands > li { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Standing jobs: the Me page and the clock-out prompt */
ul.job-list { list-style: none; margin: 0; padding: 0; display: grid; }
li.job { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
li.job:last-child { border-bottom: 0; }
.job-tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; display: grid; place-items: center; padding: 0; font-weight: 700; }
button.job-tick:hover { border-color: var(--primary); }
.job-tick.on { background: var(--good); border-color: var(--good); color: #fff; }
.job-tick.no { background: var(--amber-bg); border-color: var(--amber-bg); color: #7a5300; }
.job-body { display: grid; gap: 2px; min-width: 0; }
.job-name { font-weight: 600; }
.job-why { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.job-why[hidden] { display: none; }
.st-done .job-name { color: var(--muted); }
.jobs-today details { margin-top: 8px; }
.job-line { font-weight: 600; }

/* Standing jobs: the Jobs page */
.jobs-week { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.jobs-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.jobs-day { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.jobs-day.today { border-color: var(--primary); }
.jobs-day h3 { margin: 0 0 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
ul.jr-list { list-style: none; margin: 0; padding: 0; }
.jr { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); }
.jr-name { font-weight: 600; }
.jr-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.jr-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.jr select { max-width: 150px; }
.jr.done .jr-state { color: var(--good); font-weight: 600; }
.jr.missed .jr-state { color: var(--bad); font-weight: 600; }
.jr.couldnt .jr-state { color: #7a5300; font-weight: 600; }
.jr.nobody select { color: var(--bad); border-color: var(--bad); }
.req-row.off { opacity: .55; }
.job-days { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.job-days .opt { display: inline-flex; gap: 4px; align-items: center; }
.jobs-start { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
li.req-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.needs-you { border-color: #d4b106; box-shadow: 0 0 0 1px #f0d38a; }
.req-note { font-size: 12px; color: #8a5e00; font-weight: 600; }
button.cant { justify-self: start; font-size: 12px; padding: 2px 0 0; }
label.opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
label.opt select { max-width: 100%; }
.avail { display: grid; gap: 6px; margin: 6px 0 10px; }
.av-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.av-day { width: 36px; font-weight: 700; color: var(--pill-ink); }
.av-times { display: inline-flex; align-items: center; gap: 6px; }
.av-times[hidden], .av-row [data-av="note"][hidden] { display: none; }
.av-row [data-av="note"] { flex: 1; min-width: 120px; }
.leave.soft { border-style: dashed; font-weight: 500; font-size: 11px; padding: 3px 6px; }
details.card > summary { font-size: 16px; margin: 0; }
details.card[open] > summary { margin-bottom: 8px; }
.leave-strip { display: grid; gap: 6px; border-color: var(--good-line); }

/* Login */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--nav); }
.login-card { background: #fff; border-radius: 14px; padding: 26px; width: min(380px, 100%); display: grid; gap: 12px; }
.login-card h1 { color: var(--nav); display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 20px; }
.login-card h1 img { height: 30px; width: auto; }
.login-card label { display: grid; gap: 6px; }
.login-card button[type=submit], .login-card #codeBtn { background: var(--primary); color: #fff; border-radius: 8px; padding: 10px; font-weight: 700; }
.login-card form { display: grid; gap: 10px; }

@media (max-width: 900px) {
  .insights { grid-template-columns: 1fr; }
  .ts-layout { grid-template-columns: 1fr; }
  .ts-team { display: flex; overflow-x: auto; }
  .ts-member { min-width: 170px; }
}
@media (max-width: 640px) {
 li.req-row { grid-template-columns: 1fr; }
  .page { padding: 10px 10px 32px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-name, .nav-btn#auditBtn { display: none; }
 .nav { padding-top: 8px; }
 .nav-tabs { order: 3; flex-basis: 100%; margin: 0 -8px; }
 .nav-tabs a { padding: 10px 7px 11px; font-size: 13px; }
  .flags li { grid-template-columns: 64px 1fr; }
  .flags li .msg { grid-column: 1 / -1; }
  .fields.two { grid-template-columns: 1fr; }
  .fields.unav-add, .fields.four { grid-template-columns: 1fr 1fr; }
}

/* D349: home-screen app card, missed clocks. */
.app-card { border-color: #c6c0f3; box-shadow: 0 0 0 1px #e4e0fb; }
.app-card.done { border-color: var(--line); box-shadow: none; }
.app-card .steps { margin: 6px 0 8px; padding-left: 20px; line-height: 1.7; }
.ios-share { vertical-align: -3px; color: var(--primary); }
.clock-note.ok { background: #f1faef; color: #1f6b33; margin-top: 8px; }
.me-today .clock-note { margin-top: 8px; }
.claim-line { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.flagchip.ask { background: #f4f2fe; color: var(--primary); }
.bell { font-size: 12px; }
#hoursDlg [hidden] { display: none; }

/* API keys in Settings (D452). The key itself is shown once, so it needs to be easy to copy. */
.key-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.key-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 8px 10px; background: var(--pill); border-radius: 8px; }
.key-list li > .muted { grid-column: 1; }
.key-list li > button { grid-column: 2; grid-row: 1 / span 2; }
.key-list li.revoked { opacity: .55; }
.key-list code, .key-new code { font-size: 12px; }
.key-new { margin-top: 10px; padding: 10px; border-radius: 8px; background: var(--good-bg); display: grid; gap: 8px; justify-items: start; }
.key-new p { margin: 0; font-size: 13px; }
.key-new code { word-break: break-all; user-select: all; background: #fff; padding: 6px 8px; border-radius: 6px; }
.pill.danger { background: var(--bad); color: #fff; }

/* Today: who is on, for the whole team */
.today-page { max-width: 560px; }
.td-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.td-head h1 { margin: 0; font-size: 22px; }
.td-date { font-weight: 700; color: var(--pill-ink); }
.td-head .me-clock { margin-left: auto; }
.td-sum { margin: 6px 0 10px; color: var(--muted); }
.td-sum b { color: var(--good); }
.td-card { padding-top: 10px; }
.td-scale { position: relative; height: 16px; margin: 0 13px 6px; font-size: 11px; color: var(--muted); }
.td-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.td-scale span.first { transform: none; }
.td-scale span.last { transform: translateX(-100%); }
ul.td-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.td-row { --role-c: var(--r-floor); display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--unpub-bg); border: 1px solid var(--line-2); box-shadow: inset 4px 0 0 var(--role-c); }
.td-row.r-lead { --role-c: var(--r-lead); }
.td-row.r-onlines { --role-c: var(--r-onlines); }
.td-row.on { background: var(--good-bg); border-color: var(--good-line); }
.td-row.done { opacity: .6; }
.td-row.empty { background: var(--card); border-style: dashed; }
.td-row.mine { outline: 2px solid var(--primary); }
.td-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.td-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.td-who b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-you { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--pill); border-radius: 6px; padding: 1px 6px; }
.td-state { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.td-row.on .td-state { color: var(--good); }
.td-when { font-weight: 700; }
.td-when .muted { font-weight: 400; }
.td-bar { position: relative; height: 8px; border-radius: 4px; background: var(--line); margin: 2px 0; }
.td-bar span { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--role-c); }
.td-row.empty .td-bar span { background: repeating-linear-gradient(45deg, var(--line-2) 0 4px, transparent 4px 8px); border: 1px solid var(--line-2); }
.td-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.td-breaks { font-size: 12px; color: var(--muted); }
