/* =========================================================
   Scheduling Agent: light, friendly, productivity-app look
   Surfaces: white cards on a soft gray canvas
   Accent:   purple, used for actions and selection
   Shape:    rounded cards (16px), pill buttons and chips
   ========================================================= */
:root {
  color-scheme: light;
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F9FAFC;
  --hover: #F1F2F7;
  --line: #E5E7EF;
  --line-2: #D6D9E3;
  --text: #1C1D24;
  --muted: #5D6170;
  --faint: #676B7B;
  --input-hover: #C3C7D4;
  --logo-a: #6F707C; --logo-b: #24252C;
  --switch-off: #D5D8E2;

  /* accent family: set from the chosen theme color by app.js */
  --accent: #6A58D6;
  --accent-ink: #4E3DB8;
  --accent-soft: #EFECFF;
  --accent-soft-2: #E4DFFF;
  --accent-line: #D7D0FB;
  --accent-wash: #FBFAFF;
  --on-accent: #FFFFFF;
  --glow1: #ECE8FF;
  --glow2: #E3F1FF;

  --ok: #1F8A55;   --ok-soft: #E4F5EC;  --ok-line: #CBEBD9;
  --warn: #A86200; --warn-soft: #FFF2DE; --warn-line: #F6DDB2; --warn-ink: #7A4A06;
  --bad: #C2384F;  --bad-soft: #FDE8EC; --bad-line: #F6C9D2;
  --under: #E4A23A;
  --off-bg: #F1F1F4; --win-bg: #EAF1FF; --win-line: #CFDDFA; --win-ink: #2C5DB0;
  --chip-bg: rgba(255,255,255,.85); --chip-line: rgba(0,0,0,.06);
  --slot-bg: rgba(255,255,255,.4); --slot-line: rgba(0,0,0,.16);
  --scrim: rgba(20, 22, 40, 0.28);
  --toast-bg: #22232B; --toast-fg: #FFFFFF;
  --no-bg: #3A3B45; --no-fg: #FFFFFF;

  /* shift and avatar colors */
  --p0-bg: #EFECFF; --p0-fg: #5442C2; --p0-bd: #D9D2FB;
  --p1-bg: #E3F5EA; --p1-fg: #24704A; --p1-bd: #C6E8D3;
  --p2-bg: #FFEEDD; --p2-fg: #9E5612; --p2-bd: #F8D9B6;
  --p3-bg: #E3EEFF; --p3-fg: #2B5BAE; --p3-bd: #C8DAF9;
  --p4-bg: #FFE7EF; --p4-fg: #AE3762; --p4-bd: #F7CADA;
  --p5-bg: #FFF6CF; --p5-fg: #806300; --p5-bd: #F0E19C;
  --p6-bg: #E2F5F7; --p6-fg: #1E6F7A; --p6-bd: #C2E6EA;
  --p7-bg: #F1F1F4; --p7-fg: #4A4D57; --p7-bd: #DDDEE4;
  --p8-bg: #F4EFE7; --p8-fg: #6E5B42; --p8-bd: #E4D9C8;

  --r-lg: 16px; --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 40, 0.05), 0 4px 14px rgba(20, 22, 40, 0.05);
  --shadow-lg: 0 10px 40px rgba(20, 22, 40, 0.16);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --top: 60px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111217;
  --surface: #191A21;
  --surface-2: #1E1F27;
  --hover: #262732;
  --line: #2B2D38;
  --line-2: #393B48;
  --text: #ECEDF2;
  --muted: #A6A9B7;
  --faint: #878A99;
  --input-hover: #4A4D5C;
  --logo-a: #F0F0F4; --logo-b: #9A9AA6;
  --switch-off: #3A3C49;
  --ok: #5CCB8F;   --ok-soft: #173326;  --ok-line: #24503A;
  --warn: #F0B35A; --warn-soft: #362812; --warn-line: #5A4220; --warn-ink: #F6CF93;
  --bad: #F07A8E;  --bad-soft: #3A1A21; --bad-line: #5E2A35;
  --under: #E0A14A;
  --off-bg: #22232C; --win-bg: #1B2740; --win-line: #2A3B5E; --win-ink: #9DBDF5;
  --chip-bg: rgba(0,0,0,.22); --chip-line: rgba(255,255,255,.06);
  --slot-bg: rgba(0,0,0,.12); --slot-line: rgba(255,255,255,.18);
  --scrim: rgba(0, 0, 0, 0.5);
  --toast-bg: #ECEDF2; --toast-fg: #111217;
  --no-bg: #ECEDF2; --no-fg: #111217;
  --p0-bg: #262241; --p0-fg: #B9AEFF; --p0-bd: #393160;
  --p1-bg: #19302A; --p1-fg: #86D7AB; --p1-bd: #25473C;
  --p2-bg: #35261A; --p2-fg: #F4B27A; --p2-bd: #4F3824;
  --p3-bg: #1A2740; --p3-fg: #93B8F7; --p3-bd: #283B5F;
  --p4-bg: #36202A; --p4-fg: #F59EBD; --p4-bd: #522E3D;
  --p5-bg: #332D16; --p5-fg: #E9D27A; --p5-bd: #4C4322;
  --p6-bg: #172F33; --p6-fg: #85D3DD; --p6-bd: #23464C;
  --p7-bg: #24252D; --p7-fg: #B5B8C4; --p7-bd: #353744;
  --p8-bg: #2B2721; --p8-fg: #D2C3AA; --p8-bd: #403930;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- buttons, inputs, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent-soft-2); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 12px; gap: 4px; }
.btn-icon { width: 36px; padding: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); width: 100%; min-width: 0;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:hover { border-color: var(--input-hover); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.num { width: 64px; text-align: center; }
.time { width: 112px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid transparent; background: var(--hover); color: var(--muted); white-space: nowrap;
}
button.chip:hover { filter: brightness(.97); }
.chip-toggle { background: var(--surface); border-color: var(--line-2); color: var(--muted); }
.chip-toggle.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.chip .x { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-draft { background: var(--hover); color: var(--muted); }
.pill-live { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }

.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--hover); border-radius: 999px; }
.seg button { height: 30px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20,22,40,.12); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty h3 { color: var(--text); font-size: 16px; }
.empty .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .ico svg { width: 24px; height: 24px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.note svg { margin-top: 1px; color: var(--accent); }
.note-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.note-warn svg { color: var(--warn); }

/* ---------- app frame ---------- */
.frame { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: var(--top) 1fr; height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 200px; text-decoration: none; color: inherit; }
.brand .mark { /* app icon: a soft tile with a fine gold rim */
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; position: relative;
  background: linear-gradient(155deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(201, 162, 79, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -6px 12px rgba(201, 162, 79, 0.07), 0 1px 2px rgba(20, 16, 40, 0.08), 0 4px 12px -4px rgba(201, 162, 79, 0.28);
}
.brand .mark svg { /* a hair of outline in the same gradient thickens the thin swashes so they stay crisp on ordinary screens */
  width: 31px; height: 31px; display: block; stroke: url(#od-grad); stroke-width: 2.6; stroke-linejoin: round; paint-order: stroke;
}
.co { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); min-width: 0; }
.co img { height: 32px; max-width: 120px; object-fit: contain; display: block; }
.co span { font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.logo-box { width: 88px; height: 88px; border-radius: 16px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; background: var(--surface-2); overflow: hidden; flex: none; }
.logo-box img { max-width: 76px; max-height: 76px; object-fit: contain; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatch-custom { position: relative; overflow: hidden; background: conic-gradient(#e55, #eb5, #5c7, #5be, #85e, #e5b, #e55); }
.shift-colors { align-items: center; gap: 8px; }
.shift-sw { width: 30px; height: 30px; border: 2px solid; box-shadow: none; }
.shift-sw.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.shift-colors .swatch-custom { width: 30px; height: 30px; }
.shift-colors .swatch-custom.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.sw-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.sw-custom-chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.swatch-custom input { position: absolute; inset: -8px; opacity: 0; cursor: pointer; }
.phone-head .co-logo { height: 28px; max-width: 120px; object-fit: contain; display: block; margin-bottom: 6px; }
.mini-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.mini-week .lbl { font-size: 11px; font-weight: 700; color: var(--faint); text-align: center; }
.mini-week .av-cell { min-width: 0; height: 44px; font-size: 11px; line-height: 1.15; padding: 0 2px; text-align: center; }
.matrix { border-collapse: separate; border-spacing: 4px; }
.matrix th { font-size: 11px; color: var(--faint); font-weight: 700; text-align: center; }
.matrix th.rowh { text-align: left; color: var(--text); font-size: 12.5px; padding-right: 6px; white-space: nowrap; }
.mx { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: transparent; }
.mx.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mx:disabled { opacity: .25; cursor: default; }
.mx svg { width: 15px; height: 15px; }
select.tsel { width: auto; min-width: 104px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.brand b { display: block; font-size: 15px; line-height: 1.1; }
.brand small { display: block; font-size: 11px; color: var(--faint); font-weight: 500; }
.top-spacer { flex: 1; }
.viewas { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.viewas select { width: auto; }

.sidenav { padding: 12px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.navi {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: none;
  font-weight: 600; font-size: 13.5px; color: var(--muted); text-align: left; width: 100%;
}
.navi:hover { background: var(--hover); color: var(--text); }
.navi.on { background: var(--accent-soft); color: var(--accent-ink); }
.navi .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; display: grid; place-items: center; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-foot { margin-top: auto; padding: 12px 8px 4px; font-size: 11.5px; color: var(--faint); }

.main { overflow: auto; padding: 24px 28px 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { color: var(--muted); }
.page-title { display: grid; gap: 2px; margin-right: auto; }

.weeknav { display: flex; align-items: center; gap: 4px; }
.weeknav .label { font-weight: 700; font-size: 15px; padding: 0 8px; white-space: nowrap; }

/* ---------- schedule ---------- */
.sched-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; }
.day.today { border-color: var(--accent-line); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 4px; }
.day-head b { font-size: 13px; }
.day-head span { font-size: 12px; color: var(--faint); }
.shift {
  border-radius: var(--r); padding: 8px 8px 8px 10px; border: 1px solid; text-align: left; width: 100%;
  display: grid; gap: 6px; background: var(--surface); position: relative; transition: box-shadow .15s, transform .15s;
}
.shift:hover { box-shadow: 0 3px 10px rgba(20,22,40,.10); }
.shift-top { display: flex; align-items: baseline; gap: 6px; }
.shift-name { font-weight: 700; font-size: 12.5px; }
.shift-time { font-size: 11.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.shift-meta { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.need { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--chip-line); }
.need.miss { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.people-list { display: grid; gap: 4px; }
.person {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--chip-bg); color: var(--text);
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--chip-line); min-width: 0;
}
.person .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person svg { width: 13px; height: 13px; color: var(--faint); }
.person .warn { color: var(--warn); margin-left: auto; }
.person.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.open-slot { height: 26px; border-radius: 8px; border: 1.5px dashed var(--slot-line); font-size: 12px; color: var(--muted); display: flex; align-items: center; padding: 0 8px; gap: 6px; background: var(--slot-bg); }
.add-shift { border: 1.5px dashed var(--line-2); background: none; border-radius: var(--r); height: 32px; font-size: 12.5px; font-weight: 600; color: var(--faint); margin-top: auto; }
.add-shift:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.changed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

.side-col { display: grid; gap: 16px; position: sticky; top: 0; }
.side-col h3 { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.hours-row:first-of-type { border-top: 0; }
.hours-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { grid-column: 1 / -1; height: 6px; background: var(--hover); border-radius: 999px; position: relative; overflow: hidden; }
.bar .range { position: absolute; top: 0; bottom: 0; background: var(--accent-line); }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 999px; }
.bar .fill.under { background: var(--under); } .bar .fill.over { background: var(--bad); }
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.issue:first-of-type { border-top: 0; }
.issue svg { width: 15px; height: 15px; margin-top: 2px; color: var(--warn); }
.issue.bad svg { color: var(--bad); }
.issue button { all: unset; cursor: pointer; color: var(--text); font-weight: 600; }
.issue button:hover { color: var(--accent); }

/* ---------- tables (spreadsheet feel) ---------- */
.table-card { overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { white-space: nowrap; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click:hover td { background: var(--surface-2); cursor: pointer; }
.tbl .name-cell { font-weight: 600; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.who { display: flex; align-items: center; gap: 10px; }

.av-grid td.cellwrap { padding: 4px; }
.av-cell {
  width: 100%; min-width: 92px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; position: relative;
}
.av-cell:hover { border-color: var(--accent-line); }
.av-any { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.av-off { background: var(--off-bg); color: var(--muted); text-decoration: line-through; }
.av-win { background: var(--win-bg); border-color: var(--win-line); color: var(--win-ink); }
.av-none { color: var(--faint); border-style: dashed; }
.av-cell.from-pattern { border-style: dashed; font-style: italic; }   /* from their usual week: marked by shape, not by fading (keeps text readable) */
.av-cell .src { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -3px; border: 1px solid var(--line-2); }

/* ---------- shift templates ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tpl { padding: 16px; display: grid; gap: 10px; text-align: left; border-left-width: 5px; }
.tpl h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.daydots { display: flex; gap: 4px; }
.daydots span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--hover); color: var(--faint); }
.daydots span.on { background: var(--accent-soft); color: var(--accent-ink); }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 12px; color: var(--muted); }
.daypick button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- settings ---------- */
.set-list { display: grid; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row .txt { flex: 1; display: grid; gap: 2px; }
.set-row .txt b { font-size: 14px; }
.set-row .txt span { color: var(--muted); font-size: 13px; }
.set-section { margin-bottom: 20px; }
.set-section > h2 { font-size: 15px; font-weight: 700; margin: 0 0 10px 4px; }
.slider-row { display: grid; grid-template-columns: 180px 1fr 28px; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.slider-row:first-child { border-top: 0; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.soon { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }

/* ---------- drawer, modal, popover ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); z-index: 41;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out;
}
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; }
.drawer-head p { color: var(--muted); font-size: 13px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: grid; gap: 22px; align-content: start; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sec h4 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec h4 .chip { text-transform: none; letter-spacing: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.list { display: grid; gap: 6px; }
.li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { display: block; font-size: 13.5px; }
.reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rs { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--hover); color: var(--muted); }
.rs.good { background: var(--ok-soft); color: var(--ok); }
.rs.bad { background: var(--bad-soft); color: var(--bad); }
.rank-num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }

.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-head { padding: 20px 22px 8px; } .modal-head h2 { font-size: 18px; } .modal-head p { color: var(--muted); margin-top: 4px; }
.modal-body { padding: 12px 22px; display: grid; gap: 14px; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.stat b { display: block; font-size: 20px; } .stat span { font-size: 12px; color: var(--muted); }

.pop { position: fixed; z-index: 45; width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; display: grid; gap: 8px; animation: pop .12s ease-out; }
.pop-opt { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px; border: 0; background: none; font-weight: 600; font-size: 13px; text-align: left; }
.pop-opt:hover, .pop-opt.on { background: var(--hover); }
.pop-opt i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); }
.pop .times { display: flex; gap: 6px; align-items: center; padding: 0 4px; }
.pop .times .input { width: 100%; }
.pop label.chk { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); padding: 2px 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--toast-bg); color: var(--toast-fg); padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 60; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.scrim, .drawer, .modal { animation-delay: var(--ad, 0ms); }
.still, .still .modal { animation: none !important; }
body:has(.drawer) #demo-bar, body:has(.modal) #demo-bar { display: none !important; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

/* ---------- welcome + setup ---------- */
.onboard { min-height: 100vh; display: grid; place-items: start center; padding: 40px 16px 64px; background:
  radial-gradient(900px 500px at 10% -10%, var(--glow1), transparent 60%), radial-gradient(800px 500px at 110% 10%, var(--glow2), transparent 55%), var(--bg); }
.ob-card { width: min(780px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden; }
.ob-head { padding: 28px 32px 8px; display: grid; gap: 6px; }
.ob-head .brand { margin-bottom: 14px; }
.ob-head h1 { font-size: 26px; letter-spacing: -0.02em; }
.ob-head p { color: var(--muted); font-size: 15px; }
.ob-body { padding: 18px 32px 8px; display: grid; gap: 16px; }
.ob-foot { padding: 18px 32px 28px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ob-foot .spacer { flex: 1; }
.steps { display: flex; gap: 6px; padding: 0 32px; }
.steps span { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.steps span.on { background: var(--accent); }
.step-label { padding: 18px 32px 0; font-size: 12px; font-weight: 700; color: var(--accent-ink); letter-spacing: .04em; text-transform: uppercase; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { text-align: left; padding: 18px; border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; gap: 6px; }
.choice:hover { border-color: var(--accent-line); background: var(--accent-wash); }
.choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice b { font-size: 15px; } .choice span { color: var(--muted); font-size: 13px; }
.choice .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.q { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.q .txt { flex: 1; } .q .txt b { display: block; font-size: 14px; } .q .txt span { font-size: 12.5px; color: var(--muted); }
.yn { display: inline-flex; gap: 4px; }
.yn button { height: 32px; min-width: 52px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--muted); }
.yn button.on.yes { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.yn button.on.no { background: var(--no-bg); border-color: var(--no-bg); color: var(--no-fg); }
.edit-row { display: grid; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.edit-row.shift-row { grid-template-columns: minmax(110px, 1.2fr) auto auto 70px auto; }
.edit-row.team-row { grid-template-columns: minmax(120px, 1.4fr) 2fr auto auto auto; }
.edit-row .sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hrs { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.mode-tag { font-size: 13px; color: var(--muted); }

/* ---------- employee preview ---------- */
.emp-banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 13px; grid-column: 1 / -1; }
.emp-stage { min-height: calc(100vh - var(--top)); display: grid; place-items: start center; padding: 28px 16px 48px; }
.phone { width: 390px; max-width: 100%; min-height: 720px; background: var(--surface); border-radius: 36px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; }
.phone-head { padding: 22px 20px 14px; border-bottom: 1px solid var(--line); }
.phone-head small { color: var(--faint); font-weight: 600; }
.phone-head h2 { font-size: 20px; }
.phone-body { flex: 1; padding: 16px; display: grid; gap: 12px; align-content: start; }
.phone-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--surface-2); }
.phone-tabs button { border: 0; background: none; padding: 10px 4px 12px; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--faint); position: relative; }
.phone-tabs button.on { color: var(--accent); }
.phone-tabs .dot { position: absolute; top: 6px; left: 56%; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.my-shift { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid; }
.my-shift .d { width: 46px; text-align: center; } .my-shift .d b { display: block; font-size: 18px; line-height: 1.1; } .my-shift .d span { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.req-card { padding: 14px; border-radius: 16px; border: 1px solid var(--accent-line); background: var(--accent-wash); display: grid; gap: 10px; }

/* ---------- AI helper ---------- */
.helper-fab { position: fixed; right: 22px; bottom: 22px; z-index: 30; height: 48px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--text); color: var(--bg); font-weight: 600; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-lg); }
.helper { position: fixed; right: 22px; bottom: 82px; width: 340px; z-index: 31; padding: 16px; display: grid; gap: 10px; }
.helper { max-height: min(640px, calc(100vh - 110px)); grid-template-rows: auto auto 1fr auto auto; width: 372px; }
.helper .chat { display: grid; gap: 8px; align-content: start; overflow-y: auto; min-height: 140px; max-height: 380px; padding: 2px 2px 4px; }
.helper .ex-btn { text-align: left; cursor: pointer; font: inherit; font-size: 13px; }
.helper .ex-btn:hover { border-color: var(--accent); color: var(--text); }
.helper .send-row { display: flex; gap: 8px; align-items: center; } .helper .send-row .input { flex: 1; min-width: 0; } .helper .send-row .btn { flex: none; }
.bub { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.bub.me { justify-self: end; background: var(--accent); color: var(--on-accent, #fff); border-bottom-right-radius: 5px; }
.bub.ai { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bub.typing { display: flex; gap: 4px; padding: 13px 14px; }
.bub.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.1s infinite ease-in-out; }
.bub.typing i:nth-child(2) { animation-delay: .15s; } .bub.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.prop { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface); display: grid; gap: 6px; font-size: 13px; }
.prop ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; } .prop li.bad { color: var(--muted); text-decoration: line-through; }
.helper .ex { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1640px) { .sched-wrap { grid-template-columns: 1fr; } .side-col { position: static; grid-template-columns: 1fr 1fr; } .week-grid { grid-template-columns: repeat(7, minmax(128px, 1fr)); } }
@media (max-width: 860px) {
  .frame { grid-template-columns: 1fr; grid-template-rows: var(--top) auto 1fr; }
  .sidenav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .navi { width: auto; white-space: nowrap; height: 36px; }
  .nav-sep, .nav-foot { display: none; }
  .main { padding: 18px 14px 80px; }
  .brand small, .co img ~ span, .topbar.has-co .brand > span { display: none; }
  .co { padding-left: 10px; }
  .brand { min-width: 0; }
  .viewas span, .topbar .pill { display: none; }
  .brand b { font-size: 14px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .side-col { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .grid2, .choice-grid, .stats { grid-template-columns: 1fr; }
  .edit-row.shift-row, .edit-row.team-row { grid-template-columns: 1fr 1fr; }
  .ob-head, .ob-body, .ob-foot, .step-label { padding-left: 18px; padding-right: 18px; }
  .steps { padding: 0 18px; }
  .slider-row { grid-template-columns: 1fr 1fr 24px; }
  .helper { right: 12px; left: 12px; width: auto; }
}

/* ---------- print: just the week ---------- */
@media print {
  @page { size: landscape; margin: 10mm; }
  body { background: #fff; color: #000; }
  .topbar, .sidenav, .toolbar, .side-col, .helper-fab, .helper, .add-shift, .no-print, .summary { display: none !important; }
  .frame { display: block; height: auto; }
  .main { overflow: visible; padding: 0; }
  .sched-wrap { display: block; }
  .week-grid { grid-template-columns: repeat(7, 1fr); gap: 6px; overflow: visible; }
  .day { min-height: 0; box-shadow: none; break-inside: avoid; }
  .shift { box-shadow: none; break-inside: avoid; }
  .open-slot { display: none; }
  .print-title { display: block !important; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
}
.print-title { display: none; }

/* ---------- plans and trial ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface); display: grid; gap: 6px; align-content: start; }
.plan .price { font-size: 28px; font-weight: 700; letter-spacing: -.02em; } .plan .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan p { margin: 0; color: var(--muted); font-size: 13px; }
.lock-wrap { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; overflow: auto; }
.lock { width: min(560px, 100%); padding: 24px; } .lock h2 { margin: 0 0 6px; } .lock > p { margin: 0 0 4px; color: var(--muted); }
.plan { min-width: 0; overflow-wrap: anywhere; }
:root[data-theme="dark"] .brand .mark { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -8px 14px rgba(201, 162, 79, 0.08), 0 4px 14px -4px rgba(201, 162, 79, 0.3); }
