:root {
  color-scheme: light;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color: #172941;
  background: #f4f7fb;
  --muted: #5a6b80;
  --line: #dce5ee;
  --navy: #11243c;
  --accent: #194c7c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; }
:focus-visible { outline: 3px solid #4582bd; outline-offset: 3px; }
.masthead { background: var(--navy); color: white; border-bottom: 3px solid #7daee1; }
.mast-inner { max-width: 1480px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 64px); height: 68px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 800; font-size: 16px; letter-spacing: .14em; line-height: 1.05; }
.brand-sub { display: block; margin-top: 5px; color: #b6cce1; font-size: 9px; letter-spacing: .28em; }
.brand-mark { display: grid; justify-items: start; gap: 3px; width: 32px; transform: skewX(-24deg); }
.brand-mark i { display: block; height: 5px; width: 28px; background: #eef7ff; border-radius: 1px; }
.brand-mark i:nth-child(2) { width: 22px; background: #9bc7f0; }
.brand-mark i:nth-child(3) { width: 12px; background: #70a9db; }
.mode-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #e7f1fb; padding: 8px 12px; border: 1px solid #4a617a; border-radius: 7px; font-size: 13px; font-weight: 600; }
.mode-link:hover { background: #24415f; }
.lock-icon { position: relative; display: inline-block; width: 11px; height: 8px; border: 1px solid currentColor; border-radius: 2px; margin-top: 4px; }
.lock-icon::before { content: ""; position: absolute; top: -6px; left: 2px; width: 5px; height: 6px; border: 1px solid currentColor; border-radius: 4px 4px 0 0; }
.page { max-width: 1480px; padding: clamp(24px, 4vw, 54px) clamp(18px, 4vw, 64px) 22px; margin: 0 auto; }
.title-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.eyebrow { display: flex; align-items: center; gap: 7px; text-transform: uppercase; font-size: 10px; letter-spacing: .14em; font-weight: 800; color: #3b6185; }
.sample-dot, .legend-dot { border-radius: 50%; width: 7px; height: 7px; flex: 0 0 auto; background: #5a94c9; }
h1 { margin: 6px 0; font-size: clamp(34px, 4vw, 48px); line-height: 1.07; letter-spacing: -.045em; font-weight: 750; }
h2, h3, p { margin: 0; }
.title-row p { color: var(--muted); font-size: 15px; margin-top: 9px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stats:has(#bonus-stat:not([hidden])) { grid-template-columns: repeat(4, 1fr); }
.stat { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: white; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.stat strong { display: block; font-size: 23px; font-weight: 750; line-height: 1.1; }
.stat div span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-icon { position: relative; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px; background: #eaf2fb; color: #315e8b; display: grid; place-content: center; font-size: 18px; }
.people-icon::before { content: ""; position: absolute; left: 13px; top: 8px; width: 7px; height: 7px; border: 1.4px solid; border-radius: 50%; }
.people-icon::after { content: ""; position: absolute; left: 9px; top: 17px; width: 15px; height: 8px; border: 1.4px solid; border-radius: 7px 7px 2px 2px; }
.cal-icon::before { content: ""; position: absolute; inset: 10px 8px 8px; border: 1.4px solid; border-radius: 3px; }
.cal-icon::after { content: ""; position: absolute; inset: 14px 9px auto; border-top: 1.4px solid; }
.bonus-icon { background: #fff4e4; color: #794d18; font-weight: 700; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 9px #19385808; }
.schedule-panel { overflow: clip; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; padding: 17px 18px 12px; }
.week-nav { display: flex; gap: 9px; align-items: center; }
.week-nav h2 { font-size: clamp(15px, 2.3vw, 20px); letter-spacing: -.025em; }
.timezone { color: var(--muted); font-size: 11px; margin: 5px 0 0 37px; }
.icon-button { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #2c4c70; font-size: 21px; line-height: 1; padding: 0 0 3px; }
.icon-button:hover, .button:hover { background: #eaf2fb; }
.filters, .actions { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.filters label, .form-grid label, .login-panel label { display: grid; gap: 4px; font-size: 11px; font-weight: 650; color: #455b72; }
select, input, textarea { width: 100%; border: 1px solid #cad7e4; color: #1b3048; border-radius: 6px; background: white; padding: 7px 9px; min-height: 34px; font-size: 12px; }
.filters select { width: min(140px, 32vw); }
.view-toggle { display: inline-flex; padding: 2px; border-radius: 7px; background: #edf2f8; min-height: 34px; }
.view-toggle button, .sections button { color: #445a71; border: 0; background: transparent; padding: 5px 10px; border-radius: 5px; font-weight: 650; font-size: 12px; }
.view-toggle button[aria-pressed="true"] { color: #1c4f7c; background: white; box-shadow: 0 1px 3px #1d3b5525; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 15px; padding: 0 18px 12px; color: var(--muted); font-size: 11px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { background: var(--stripe, #5a94c9); }
.tone-0 { --stripe: #3874b4; --card: #eaf3ff; --ink: #23558a; }
.tone-1 { --stripe: #bc7a2a; --card: #fff4e4; --ink: #794d18; }
.tone-2 { --stripe: #3d927c; --card: #e7f6f0; --ink: #246955; }
.tone-3 { --stripe: #9167bd; --card: #f3ebfb; --ink: #68458e; }
.tone-4 { --stripe: #bd6071; --card: #fbedf0; --ink: #874353; }
.tone-5 { --stripe: #667c94; --card: #ecf1f6; --ink: #405972; }
.scroll-grid { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 890px; font-size: 12px; }
th, td { text-align: left; border-bottom: 1px solid #e4ebf2; border-right: 1px solid #e4ebf2; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { padding: 9px 8px; background: #eef3f9; color: #4b6078; font-size: 11px; font-weight: 650; }
thead th strong { display: block; color: #253e58; font-size: 13px; margin-top: 2px; }
thead .is-today { background: #deebfa; }
th:first-child { width: 148px; }
tbody th { background: #fcfdff; padding: 8px 10px; }
tbody th small, .day-worker small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); font-weight: 500; }
td { padding: 5px; height: 64px; vertical-align: top; background: #fff; }
td.is-today { background: #f5f9fe; }
.shift { text-align: left; display: grid; gap: 2px; width: 100%; min-height: 49px; border: 0; border-left: 3px solid var(--stripe); border-radius: 5px; background: var(--card); color: #263c52; padding: 5px 6px; margin: 0 0 4px; font-size: 10px; line-height: 1.2; }
.shift:last-child { margin-bottom: 0; }
button.shift:hover { box-shadow: inset 0 0 0 1px var(--stripe); }
.shift strong { color: var(--ink); font-size: 10.5px; font-weight: 750; }
.shift .time { font-variant-numeric: tabular-nums; }
.shift .lunch { font-variant-numeric: tabular-nums; font-weight: 650; }
.day-off-label { display: inline-block; max-width: 100%; margin: 2px 0 4px; border: 1px solid #dce5ee; border-radius: 5px; background: #eef3f9; color: #455c73; padding: 4px 6px; font-size: 10px; line-height: 1.2; font-weight: 700; }
.day-off-label.worked { border-color: #edd5ad; background: #fff4e4; color: #794d18; }
button.day-off-label:hover { border-color: currentColor; }
.off { color: #62758c; display: inline-flex; align-items: center; font-size: 12px; min-height: 44px; padding: 0 7px; }
button.off { border: 1px dashed transparent; background: transparent; border-radius: 5px; width: 100%; }
button.off:hover { border-color: #b5c9db; color: #22496c; }
.day-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 10px 12px; background: #eef3f9; border-block: 1px solid var(--line); }
.day-picker button { background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 6px 2px; color: #4b6078; font-size: 10px; }
.day-picker button strong { display: block; font-size: 16px; margin-top: 2px; }
.day-picker button[aria-pressed="true"] { color: #fff; background: #24577f; }
.day-row { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr; align-items: start; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.day-row:last-child { border-bottom: 0; }
.day-worker { font-size: 13px; padding-top: 5px; font-weight: 700; }
.empty { padding: 28px 18px; color: var(--muted); font-size: 14px; }
.button { border: 1px solid #c5d3e3; border-radius: 7px; background: white; color: #254968; padding: 8px 12px; font-size: 12px; font-weight: 700; min-height: 35px; }
.primary { background: #194d7b; border-color: #194d7b; color: #fff; }
.primary:hover:not(:disabled) { background: #123c62; }
.danger { color: #a03344; }
.status-pill { align-self: center; font-size: 12px; color: #246955; font-weight: 650; padding: 4px 6px; }
.status-pill.dirty { color: #8a551a; }
.notice { margin-bottom: 14px; padding: 11px 13px; border-radius: 7px; background: #e7f3ed; color: #245943; font-size: 13px; }
.notice.error, .form-error { color: #923243; }
.notice.error { background: #fbecef; }
.sections { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 0 0 17px; }
.sections button { border-radius: 0; border-bottom: 2px solid transparent; padding: 9px 12px; }
.sections button[aria-pressed="true"] { color: #1c4f7c; border-bottom-color: #2d6ca0; }
#lists-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.list-card { padding: 14px; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.list-card h2 { font-size: 16px; }
.list-card ul { list-style: none; margin: 8px 0 0; padding: 0; }
.list-card li { display: flex; align-items: center; justify-content: space-between; gap: 7px; border-top: 1px solid var(--line); padding: 6px 0; font-size: 13px; }
.list-card li button { font-size: 11px; min-height: 27px; padding: 4px 7px; }
.list-card small { color: var(--muted); }
dialog { width: min(480px, calc(100% - 26px)); max-height: calc(100% - 26px); border: 1px solid var(--line); border-radius: 12px; padding: 20px; color: #172941; box-shadow: 0 16px 48px #0c233a45; }
dialog::backdrop { background: #0c223b66; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; gap: 10px; }
.dialog-heading h2 { font-size: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.full { grid-column: 1 / -1; }
.form-grid select, .form-grid input { min-height: 37px; }
.form-grid .checkbox-field { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.checkbox-field input { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--accent); }
.checkbox-field span { color: var(--muted); font-weight: 500; }
.form-grid textarea { resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions .danger { margin-right: auto; }
.form-error { min-height: 18px; margin: 0 0 7px; font-size: 12px; }
.login-panel { padding: 19px; width: min(100%, 420px); }
.login-panel h2 { margin-bottom: 10px; font-size: 20px; }
.login-panel input { margin-bottom: 9px; }
.footer { max-width: 1480px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 64px) 20px; font-size: 11px; color: #576b80; }
.footer span { padding: 0 4px; }
@media (max-width: 760px) {
  .mast-inner { height: 57px; }
  .title-row { align-items: start; flex-direction: column; margin-bottom: 18px; }
  .stats { gap: 6px; margin-bottom: 12px; }
  .stats:has(#bonus-stat:not([hidden])) { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 8px; gap: 0; }
  .stat-icon { display: none; }
  .stat strong { font-size: 20px; }
  .stat div span { font-size: 10px; }
  .toolbar { padding: 12px; gap: 9px; }
  .legend { padding: 0 12px 10px; }
  .filters { width: 100%; }
  .filters label { flex: 1 1 75px; min-width: 0; }
  .filters select { width: 100%; }
  .scroll-grid th:first-child { position: sticky; left: 0; z-index: 1; }
  #lists-panel { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .filters { gap: 5px; }
  .view-toggle button { padding-inline: 6px; }
  .form-grid { grid-template-columns: 1fr; }
}
