/* YYC Schedules: one stylesheet, phone first. */
:root{
  --bg:#f4f6f7;--surface:#fff;--surface-2:#eef2f3;--line:#dde3e6;--text:#16222b;--muted:#5d6b75;
  --brand:#0f6b6d;--brand-ink:#fff;--brand-soft:#e1f1f0;
  --ok:#1f7a4d;--ok-soft:#e3f4ea;--warn:#9a5b00;--warn-soft:#fff3dc;--bad:#b42318;--bad-soft:#fde8e6;
  --radius:12px;--radius-s:8px;--shadow:0 1px 2px rgba(16,24,32,.06),0 2px 8px rgba(16,24,32,.05);
  --font:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0f1519;--surface:#172026;--surface-2:#1e2930;--line:#2b3840;--text:#e6edf1;--muted:#9aa9b2;
  --brand:#4fc1bb;--brand-ink:#05211f;--brand-soft:#143533;
  --ok:#5fd394;--ok-soft:#123323;--warn:#f0b549;--warn-soft:#3a2b0d;--bad:#ff8a7e;--bad-soft:#3d1714;
  --shadow:none;color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0f1519;--surface:#172026;--surface-2:#1e2930;--line:#2b3840;--text:#e6edf1;--muted:#9aa9b2;
  --brand:#4fc1bb;--brand-ink:#05211f;--brand-soft:#143533;
  --ok:#5fd394;--ok-soft:#123323;--warn:#f0b549;--warn-soft:#3a2b0d;--bad:#ff8a7e;--bad-soft:#3d1714;
  --shadow:none;color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.45 var(--font)}
h1{font-size:1.5rem;margin:0 0 .25rem;letter-spacing:-.01em}
h2{font-size:1.1rem;margin:0 0 .75rem}
h3{font-size:1rem;margin:0}
p{margin:.25rem 0 .75rem}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--brand)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.muted{color:var(--muted)}.small{font-size:.85rem}.center{text-align:center}
.warn-text{color:var(--warn)}.bad-text{color:var(--bad)}
.boot{padding:2rem;text-align:center;color:var(--muted)}

/* Buttons and inputs */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:40px;padding:.45rem .95rem;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface);cursor:pointer;font-weight:600;text-decoration:none;color:var(--text);white-space:nowrap}
.btn:hover{background:var(--surface-2)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn-primary{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.btn-primary:hover{background:var(--brand);filter:brightness(1.08)}
.btn-danger{background:var(--bad);border-color:var(--bad);color:#fff}
.btn-ghost{border-color:transparent;background:transparent}
.btn-danger-ghost{border-color:transparent;background:transparent;color:var(--bad)}
.btn-small{min-height:32px;padding:.25rem .65rem;font-size:.875rem}
.btn-block{width:100%}
.icon-btn{width:40px;height:40px;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface);cursor:pointer;font-size:1.25rem;line-height:1}
.link-btn{border:0;background:none;padding:0;color:var(--brand);font-weight:600;cursor:pointer;text-decoration:underline}
:focus-visible{outline:3px solid color-mix(in srgb,var(--brand) 55%,transparent);outline-offset:2px}
label{display:flex;flex-direction:column;gap:.3rem;font-weight:600;font-size:.9rem;margin-bottom:.85rem}
input:not([type=checkbox]):not([type=color]),select,textarea{width:100%;min-height:42px;padding:.5rem .65rem;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface);font-weight:400}
input[type=checkbox]{width:20px;height:20px;accent-color:var(--brand);flex:none}
input[type=color]{width:56px;height:42px;padding:2px;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface)}
.check-row{flex-direction:row;align-items:flex-start;gap:.6rem;font-weight:400}
.num-row{flex-direction:row;align-items:center;justify-content:space-between;gap:1rem;font-weight:400}
.num-row input{max-width:110px}
fieldset{border:1px solid var(--line);border-radius:var(--radius-s);padding:.75rem .9rem .25rem;margin:0 0 1rem}
legend{font-weight:700;padding:0 .35rem}
.form-row{display:flex;flex-wrap:wrap;gap:0 .75rem}.form-row>label{flex:1 1 140px}.form-row>.grow{flex:3 1 220px}
.form-error{color:var(--bad);font-weight:600}
.hint{color:var(--muted);font-size:.85rem}

/* Cards and layout */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem;box-shadow:var(--shadow);margin-bottom:1rem}
.card.empty{text-align:center;color:var(--muted);padding:2rem 1rem}
.center-page{min-height:100vh;display:grid;place-items:center;padding:1rem}
.auth-card{width:min(420px,100%)}
.brand{display:flex;align-items:center;gap:.5rem;font-weight:800}
.brand-large{font-size:1.1rem;margin-bottom:1rem;color:var(--brand)}
.logo{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:8px;background:var(--brand);color:var(--brand-ink);font-size:1rem}
.muted-link{display:block;text-align:center;margin-top:1rem;font-size:.9rem}
.qr{display:block;width:200px;height:200px;margin:.5rem auto 1rem;background:#fff;border-radius:8px}
.secret{word-break:break-all}
.recovery-codes{display:grid;grid-template-columns:1fr 1fr;gap:.4rem;padding:0;list-style:none}
.recovery-codes code{display:block;padding:.4rem;background:var(--surface-2);border-radius:6px;text-align:center}
.banner{padding:.75rem 1rem;border-radius:var(--radius-s);margin-bottom:1rem}
.banner-error{background:var(--bad-soft);color:var(--bad);font-weight:600}
.banner-warn{background:var(--warn-soft);color:var(--text)}
.banner ul{margin:.4rem 0 0;padding-left:1.1rem}

/* Shell */
.shell{min-height:100vh;padding-bottom:72px}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:.6rem;padding:.55rem 1rem;background:var(--surface);border-bottom:1px solid var(--line)}
.brand-name{white-space:nowrap}
.dept-picker{margin:0 0 0 auto;min-width:0}
.dept-picker select{min-height:36px;padding:.3rem .5rem;max-width:46vw;font-weight:600}
.save-status{display:none;font-size:.8rem;color:var(--muted);white-space:nowrap}
.user-btn{padding:.3rem .6rem;min-height:36px}
.sidebar{display:none}
.tabs{position:fixed;bottom:0;left:0;right:0;z-index:20;display:flex;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
.tab{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:.45rem .25rem .5rem;border:0;background:none;color:var(--muted);font-size:.75rem;font-weight:600;cursor:pointer}
.tab-icon{font-size:1.2rem;line-height:1}
.tab.is-active{color:var(--brand)}
.badge{position:absolute;top:4px;left:calc(50% + 6px);min-width:18px;padding:0 5px;border-radius:9px;background:var(--bad);color:#fff;font-size:.7rem;line-height:18px}
.content{padding:1rem;max-width:1400px;margin:0 auto}
@media (min-width:900px){
  .shell{padding-bottom:0;display:grid;grid-template-columns:200px 1fr;grid-template-rows:auto 1fr}
  .topbar{grid-column:1/-1}
  .save-status{display:inline}
  .phone-tabs,.more-sheet{display:none!important}
  .sidebar{display:flex;position:sticky;top:57px;align-self:start;flex-direction:column;border-right:1px solid var(--line);height:calc(100vh - 57px);overflow-y:auto;padding:.5rem .5rem 1rem;gap:.15rem;background:var(--surface)}
  .sidebar .tab{flex:none;flex-direction:row;gap:.6rem;padding:.6rem .75rem;border-radius:var(--radius-s);font-size:.95rem;justify-content:flex-start}
  .sidebar .tab.is-active{background:var(--brand-soft)}
  .sidebar .badge{position:static;margin-left:auto}
  .nav-group{display:flex;flex-direction:column;gap:.1rem;padding-top:.4rem}
  .nav-heading{margin:.5rem .75rem .2rem;font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
  .content{padding:1.25rem 1.5rem;width:100%;min-width:0}
}

/* Page header, stats, toolbar */
.page-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.75rem;margin-bottom:1rem}
.page-head>div:first-child{min-width:0}
.head-actions{display:flex;gap:.5rem;flex-wrap:wrap}
.week-nav{display:flex;align-items:center;gap:.4rem;margin:.25rem 0}
.week-label{position:relative;margin:0;font-weight:700;font-size:1rem;padding:.3rem .5rem;border-radius:6px;cursor:pointer}
.week-label input{position:absolute;inset:0;opacity:0;cursor:pointer}
.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:.6rem;margin-bottom:1rem}
@media (min-width:720px){.stats{grid-template-columns:repeat(4,1fr)}}
.stat{display:flex;flex-direction:column;gap:.1rem;padding:.7rem .85rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);text-align:left;box-shadow:var(--shadow)}
button.stat{cursor:pointer}
.stat-label{font-size:.8rem;color:var(--muted);font-weight:600}
.stat-value{font-size:1.4rem;font-weight:800;font-variant-numeric:tabular-nums}
.stat-note{font-size:.8rem;color:var(--muted)}
.stat-warn .stat-value{color:var(--warn)}.stat-bad .stat-value{color:var(--bad)}.stat-ok .stat-value{color:var(--ok)}
.problems ul,.notes ul{margin:0;padding-left:1.1rem}.problems li{margin:.3rem 0}
.notes summary{cursor:pointer;font-weight:600}
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-bottom:.75rem}
.toolbar input[type=search]{flex:1 1 160px;width:auto;min-height:38px}
.toolbar select{width:auto;min-height:38px}
.segmented{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius-s);overflow:hidden;background:var(--surface)}
.segmented button{border:0;background:none;padding:.45rem .9rem;font-weight:600;cursor:pointer;color:var(--muted)}
.segmented .is-active{background:var(--brand);color:var(--brand-ink)}
.legend{display:flex;flex-wrap:wrap;gap:.25rem .75rem;font-size:.8rem;color:var(--muted);width:100%}
.legend-item{display:inline-flex;align-items:center;gap:.3rem}.legend-item i{width:10px;height:10px;border-radius:3px}
.swatch{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:middle}

/* Week grid */
.grid-wrap{overflow:auto;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);max-height:calc(100vh - 150px)}
.grid{border-collapse:separate;border-spacing:0;width:100%;min-width:900px;font-size:.85rem}
.grid th,.grid td{border-bottom:1px solid var(--line);border-right:1px solid var(--line);padding:0;vertical-align:top}
.grid thead th{position:sticky;top:0;z-index:2;background:var(--surface-2);padding:.5rem;text-align:left;font-weight:700}
.grid thead th.is-today{color:var(--brand);box-shadow:inset 0 -3px 0 var(--brand)}
.day-date{color:var(--muted);font-weight:500}
.grid .col-person{position:sticky;left:0;z-index:1;background:var(--surface);min-width:150px;max-width:190px;padding:.5rem .6rem;text-align:left}
.grid thead .col-person{z-index:3;background:var(--surface-2)}
.person-name{display:block;font-weight:700}
.person-meta{font-size:.75rem;color:var(--muted);font-weight:500}
.col-total{padding:.5rem;text-align:right;white-space:nowrap;min-width:70px}
.ot-note{display:block;color:var(--warn);font-size:.75rem}
.cell{min-width:110px}
.cell.is-off{background:repeating-linear-gradient(135deg,transparent 0 6px,var(--surface-2) 6px 8px)}
.cell.has-problem{background:var(--bad-soft)}
.cell-btn{display:flex;flex-direction:column;gap:3px;width:100%;min-height:52px;padding:4px;border:0;background:none;cursor:pointer;text-align:left}
.cell-btn:hover{background:color-mix(in srgb,var(--brand) 8%,transparent)}
.cell-empty{margin:auto;color:var(--muted);opacity:.6}
.chip{display:flex;flex-wrap:wrap;align-items:center;gap:0 .35rem;padding:3px 6px;border-radius:6px;border-left:4px solid var(--role);background:color-mix(in srgb,var(--role) 14%,var(--surface));font-size:.78rem;line-height:1.3}
.chip-time{font-weight:700;font-variant-numeric:tabular-nums}
.chip-role{color:var(--muted)}
.chip-flag{margin-left:auto;padding:0 4px;border-radius:4px;background:var(--warn-soft);color:var(--warn);font-size:.68rem;font-weight:800}
.chip-flag-bad{background:var(--bad);color:#fff}
.chip-bad{outline:2px solid var(--bad);outline-offset:-1px}
.chip-leave{border-left-color:var(--muted);background:var(--surface-2);font-weight:600}
.grid tfoot td,.grid tfoot th{position:sticky;bottom:0;background:var(--surface-2);padding:.5rem;font-weight:700;font-variant-numeric:tabular-nums}
.grid tfoot .is-short{color:var(--warn)}
.short-note{display:block;font-size:.75rem}
.needs td{padding:3px}
.need-input{min-height:36px!important;text-align:right;border-color:transparent!important;background:transparent!important}
.need-input:focus{border-color:var(--brand)!important;background:var(--surface)!important}

/* Day view (phones) */
.day-tabs{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:.75rem}
.day-tabs button{position:relative;display:flex;flex-direction:column;align-items:center;padding:.4rem 0;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface);cursor:pointer;font-weight:700;font-size:.8rem}
.day-tabs .is-active{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.day-tabs .is-active .day-date{color:inherit}
.dot-warn{position:absolute;top:4px;right:4px;width:7px;height:7px;border-radius:50%;background:var(--warn)}
.day-summary{margin:.25rem 0 .75rem}
.list-title{margin:1rem 0 .4rem;font-size:.9rem}
.day-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.day-row{display:flex;align-items:center;gap:.75rem;width:100%;padding:.6rem .75rem;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface);text-align:left;cursor:pointer}
li.day-row{cursor:default}
.day-row .person-name{flex:0 0 38%;min-width:0}
.day-row-body{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
.day-row.has-problem{border-color:var(--bad);background:var(--bad-soft)}
.day-row.is-me{border-color:var(--brand);background:var(--brand-soft)}

/* Team */
.subtabs{display:flex;gap:.25rem;overflow-x:auto;margin-bottom:1rem;border-bottom:1px solid var(--line)}
.subtabs button{border:0;background:none;padding:.6rem .8rem;font-weight:600;color:var(--muted);cursor:pointer;border-bottom:3px solid transparent;white-space:nowrap}
.subtabs .is-active{color:var(--brand);border-bottom-color:var(--brand)}
.subtabs-full button{flex:1}
.search-wide{margin-bottom:.75rem}
.people-list,.simple-list,.request-list,.name-list,.plain-list{list-style:none;margin:0;padding:0}
.people-list{display:grid;gap:8px}
@media (min-width:900px){.people-list{grid-template-columns:repeat(auto-fill,minmax(320px,1fr))}}
.person-card{display:flex;align-items:center;gap:.75rem;width:100%;padding:.75rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);text-align:left;cursor:pointer}
.person-card:hover{border-color:var(--brand)}
.avatar{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:50%;background:var(--brand-soft);color:var(--brand);font-weight:800;font-size:.85rem}
.person-main{display:flex;flex-direction:column;gap:.15rem;min-width:0;flex:1}
.role-tags{display:flex;flex-wrap:wrap;gap:4px}
.role-tag{padding:1px 7px;border-radius:10px;border:1px solid var(--role);font-size:.75rem;font-weight:600}
.chev{color:var(--muted);font-size:1.4rem}
.simple-list li{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.6rem 0;border-bottom:1px solid var(--line)}
.simple-list li:last-child{border-bottom:0}
.leave-list{background:var(--surface)}
.two-col,.settings-grid{display:grid;gap:1rem}
@media (min-width:900px){.two-col,.settings-grid{grid-template-columns:1fr 1fr}}
.check-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:0 .75rem}
.avail-wrap{overflow-x:auto}
.avail{border-collapse:collapse;font-size:.85rem;width:100%}
.avail th,.avail td{padding:.35rem;text-align:center;border-bottom:1px solid var(--line)}
.avail tbody th{text-align:left;font-weight:600;white-space:nowrap}
.plain-list li{padding:.25rem 0}
.plain-list li::before{content:"• ";color:var(--muted)}
.rules fieldset{margin-bottom:.75rem}
.big-code{font-size:2.2rem;font-weight:800;letter-spacing:.3em;text-align:center;font-family:ui-monospace,monospace}

/* Requests */
.request-list{display:grid;gap:.6rem}
.request{display:flex;flex-wrap:wrap;gap:.75rem;align-items:flex-start;justify-content:space-between;margin:0}
.request-main{flex:1 1 240px;min-width:0}
.request-main h3{margin:.35rem 0 .1rem}
.request-actions{display:flex;gap:.5rem}
.quote{font-style:italic;color:var(--muted)}
.pill{display:inline-block;padding:2px 9px;border-radius:999px;background:var(--surface-2);font-size:.75rem;font-weight:700}
.pill-time-off{background:var(--brand-soft);color:var(--brand)}
.pill-shift-swap{background:var(--warn-soft);color:var(--warn)}
.pill-approved{background:var(--ok-soft);color:var(--ok)}
.pill-declined{background:var(--bad-soft);color:var(--bad)}
.pill-pending{background:var(--warn-soft);color:var(--warn)}
.pill-warn{background:var(--warn-soft);color:var(--warn)}
.check-list{list-style:none;padding:0}
.check-list li{padding:.35rem 0 .35rem 1.6rem;position:relative}
.check-list li::before{position:absolute;left:0;font-weight:800}
.check-list .ok::before{content:"✓";color:var(--ok)}
.check-list .warn::before{content:"!";color:var(--warn)}
.check-list .bad::before{content:"✕";color:var(--bad)}

/* Dialogs and toasts */
.dialog{border:0;border-radius:var(--radius);padding:0;width:min(560px,calc(100vw - 24px));max-height:calc(100vh - 24px);background:var(--surface);color:var(--text);box-shadow:0 10px 40px rgba(0,0,0,.25)}
.dialog-wide{width:min(820px,calc(100vw - 24px))}
.dialog::backdrop{background:rgba(10,16,20,.45)}
.dialog-form{display:flex;flex-direction:column;max-height:calc(100vh - 24px)}
.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.1rem .5rem}
.dialog-head h2{margin:0}
.dialog-head .icon-btn{border:0;font-size:1rem}
.dialog-body{padding:.25rem 1.1rem;overflow:auto}
.dialog .form-error{padding:0 1.1rem}
.dialog-actions{display:flex;flex-wrap:wrap;gap:.5rem;padding:.75rem 1.1rem 1rem;border-top:1px solid var(--line)}
.dialog-actions .spacer{flex:1}
.note{padding:.5rem .7rem;border-radius:var(--radius-s);background:var(--warn-soft)}
#toasts{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);z-index:100;display:grid;gap:.5rem;width:min(460px,calc(100vw - 24px))}
.toast{padding:.75rem 1rem;border-radius:var(--radius-s);background:var(--text);color:var(--bg);box-shadow:0 6px 20px rgba(0,0,0,.2);font-weight:600}
.toast-error{background:var(--bad);color:#fff}
@media (min-width:900px){#toasts{bottom:24px}}

/* Employee app */
.employee{min-height:100vh}
.topbar-employee .btn{margin-left:auto}
.employee-main{max-width:560px;margin:0 auto;padding:1rem}
.employee .auth-card{margin:1rem auto}
.hello{margin:.25rem 0 .75rem}
.week-switch{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.5rem}
.week-switch select{width:auto;flex:1}
.my-days{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.my-day{display:flex;gap:.9rem;padding:.75rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.my-day.is-today{border-color:var(--brand);box-shadow:inset 4px 0 0 var(--brand)}
.my-day.is-free{background:transparent}
.my-date{display:flex;flex-direction:column;align-items:center;width:42px;flex:none}
.my-dow{font-size:.75rem;color:var(--muted);font-weight:700;text-transform:uppercase}
.my-num{font-size:1.35rem;font-weight:800;line-height:1.1}
.my-body{flex:1;min-width:0}
.my-body p{margin:.1rem 0}
.my-shift strong{font-variant-numeric:tabular-nums}
.my-leave{font-weight:700;color:var(--brand)}
.changed{font-size:.8rem;color:var(--warn);font-weight:600}
.name-list{display:grid;gap:6px;margin-top:.75rem}
.name-btn{width:100%;padding:.8rem 1rem;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface);text-align:left;font-weight:600;cursor:pointer}
.name-btn:hover{border-color:var(--brand)}
.request-buttons{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin-bottom:1rem}
.request-buttons .btn{white-space:normal}
@media (max-width:520px){.shell .topbar .brand-name{display:none}.legend{display:none}.toolbar select{flex:1}}

.more-sheet{position:fixed;left:0;right:0;bottom:calc(58px + env(safe-area-inset-bottom));z-index:19;background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -8px 24px rgba(0,0,0,.12);padding:.5rem}
.more-inner{display:grid;grid-template-columns:repeat(3,1fr);gap:.25rem}
.more-inner .tab{padding:.7rem .25rem;border-radius:var(--radius-s)}
.more-inner .tab.is-active{background:var(--brand-soft)}

/* Phase 2 screens */
.stack{display:grid;gap:1rem}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin-bottom:.5rem}
.card-head h2{margin:0}
.row-actions{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
td.row-actions{display:table-cell;text-align:right}
td.row-actions .btn{margin:2px 0 2px .3rem}
.inline-label{display:inline-flex;align-items:center;gap:.4rem;font-weight:600}
.inline-label select{min-height:36px}
.nowrap{white-space:nowrap}
.split{display:grid;gap:1rem}
.split-2{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
@media (min-width:900px){.split{grid-template-columns:minmax(280px,1fr) 1.4fr;align-items:start}}
.simple-table{width:100%;border-collapse:collapse;font-size:.92rem}
.simple-table th,.simple-table td{padding:.55rem .5rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.simple-table thead th{font-size:.8rem;color:var(--muted);font-weight:700}
.grid.simple-table{min-width:760px}
.grid td.is-short{background:var(--warn-soft);color:var(--warn);padding:.5rem}
.grid td.is-covered{padding:.5rem}
.is-disabled{opacity:.55}
.pill-denied{background:var(--bad-soft);color:var(--bad)}
.hide-phone{display:none}
@media (min-width:900px){.hide-phone{display:block}}

/* Open shifts and call-outs */
.day-tabs-8{grid-template-columns:repeat(8,1fr)}
.slot-list{list-style:none;margin:0;padding:0;display:grid;gap:.4rem}
.slot{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;width:100%;padding:.65rem .8rem;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface);text-align:left;cursor:pointer}
.slot:hover{background:var(--surface-2)}
.slot.is-active{border-color:var(--brand);box-shadow:inset 3px 0 0 var(--brand)}
.slot-when{color:var(--muted);font-size:.85rem;white-space:nowrap}
.cand-list{list-style:none;margin:0;padding:0}
.cand{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.6rem 0;border-bottom:1px solid var(--line)}
.cand:last-child{border-bottom:0}
.cand-main{min-width:0}
.cand.is-blocked .cand-main{opacity:.65}
.crew{list-style:none;margin:0 0 .75rem;padding:0}
.crew li{padding:.35rem 0;border-bottom:1px solid var(--line)}

/* Week grid: groups and drag-and-drop */
.group-row th{background:var(--surface-2);color:var(--muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;padding:.3rem .6rem;text-align:left;position:static}
.chip[data-assignment]{cursor:grab;user-select:none;-webkit-user-select:none}
.chip.is-dragging{opacity:.35}
.drag-ghost{position:fixed;left:0;top:0;z-index:100;pointer-events:none;box-shadow:0 6px 18px rgba(0,0,0,.2);min-width:110px}
.cell-btn.is-drop{outline:2px dashed var(--brand);outline-offset:-3px;background:var(--brand-soft)}
.undo-bar{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);z-index:60;display:flex;align-items:center;gap:.75rem;padding:.5rem .6rem .5rem 1rem;border-radius:var(--radius);background:var(--text);color:var(--bg)}
.undo-bar .btn{min-height:32px}
@media (min-width:900px){.undo-bar{bottom:72px}}

/* Monthly plan */
.month-grid{min-width:1100px}
.month-grid thead th{text-align:center;padding:.35rem .2rem}
.month-grid th.is-weekend{background:var(--surface)}
.mcell .cell-btn{min-height:40px;align-items:center;padding:3px 2px}
.mchip{display:block;padding:1px 3px;border-radius:4px;background:var(--brand-soft);color:var(--brand);font-size:.72rem;font-weight:700;text-align:center}
.mchip-leave{background:var(--warn-soft);color:var(--warn)}

/* Hours */
.hours-grid{min-width:980px}
.hcell{padding:4px!important}
.hcell .sched{display:block;font-size:.75rem;color:var(--muted)}
.hin{display:flex;gap:3px}
.hin input{width:100%;min-width:0;padding:4px;border:1px solid var(--line);border-radius:6px;background:var(--surface)}
.hin input.ot,.hin input:nth-child(2){border-style:dashed}
.hcell.is-changed{background:var(--warn-soft)}

/* Support */
.chat-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;flex-wrap:wrap;margin-bottom:.5rem}
.chat-head h2{margin:0}
.chat-log{list-style:none;margin:0 0 .75rem;padding:0;display:grid;gap:.5rem;max-height:60vh;overflow:auto}
.msg{max-width:85%;padding:.5rem .75rem;border-radius:var(--radius);background:var(--surface-2)}
.msg p{margin:0}
.msg-agent{justify-self:end;background:var(--brand-soft)}
.msg-meta{font-size:.78rem;color:var(--muted);margin-bottom:.15rem!important}
.chat-compose{display:grid;gap:.5rem}
.chat-compose textarea{width:100%;padding:.6rem;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface)}
.ticket .chat-log{max-height:none}

/* Settings hub */
.settings-layout{display:grid;gap:1rem}
.settings-nav{display:flex;gap:.35rem;overflow-x:auto;padding-bottom:.25rem}
.settings-nav .nav-heading{display:none}
.settings-link{flex:none;padding:.45rem .8rem;border:1px solid var(--line);border-radius:999px;background:var(--surface);cursor:pointer;font-weight:600;white-space:nowrap}
.settings-link.is-active{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.settings-body{display:grid;gap:1rem;min-width:0}
.settings-body fieldset{border:1px solid var(--line);border-radius:var(--radius-s);margin:0 0 .75rem;padding:.5rem .75rem}
.settings-body details{margin:.5rem 0}
.day-checks{display:flex;flex-wrap:wrap;gap:.25rem .9rem}
@media (min-width:900px){
  .settings-layout{grid-template-columns:220px 1fr;align-items:start}
  .settings-nav{flex-direction:column;overflow:visible;position:sticky;top:72px}
  .settings-nav .nav-heading{display:block}
  .settings-link{border-radius:var(--radius-s);border-color:transparent;background:none;text-align:left}
  .settings-link:hover{background:var(--surface-2)}
  .settings-link.is-active{background:var(--brand-soft);color:var(--brand)}
}

/* Employee */
.segmented-full{display:flex;width:100%;margin:.25rem 0 .75rem}
.segmented-full button{flex:1}
.ack{border-color:var(--brand);background:var(--brand-soft)}
.ack-done{color:var(--ok);font-weight:600}
.grid-wrap+.card,.grid-wrap+section{margin-top:1rem}

/* Support chat extras */
.call-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.45rem .7rem;border-radius:var(--radius-s);background:var(--ok-soft);color:var(--ok);font-weight:600}
.call-ringing{background:var(--warn-soft);color:var(--warn);animation:ring 1.2s ease-in-out infinite}
@keyframes ring{50%{box-shadow:0 0 0 4px color-mix(in srgb,var(--warn) 25%,transparent)}}
@media (prefers-reduced-motion:reduce){.call-ringing{animation:none}}
#content>.call-bar{margin-bottom:1rem}
.file-btn{display:inline-flex;align-items:center;gap:.3rem;cursor:pointer;font-weight:600;color:var(--brand)}
.row-actions .spacer{flex:1}
.chat-form{display:grid;gap:.6rem}
.faq-row{display:flex;gap:.5rem}.faq-row input{flex:1;min-width:0}
.faq-answer{margin-top:.75rem;padding:.6rem .8rem;border-radius:var(--radius-s);background:var(--surface-2)}
.attachment-preview{display:block;max-width:100%;max-height:70vh;margin:0 auto;border-radius:var(--radius-s)}
.logo-img{object-fit:contain;background:var(--surface)}
.logo-edit{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin-top:.5rem}
.logo-preview img,.logo-preview .logo{width:44px;height:44px;border-radius:10px;object-fit:contain;border:1px solid var(--line)}

/* Person picker (type to search) */
.field{display:flex;flex-direction:column;gap:.3rem;margin-bottom:.85rem}
.field-label{font-weight:600;font-size:.9rem}
.form-row>.field{flex:1 1 140px}.form-row>.field.grow{flex:3 1 220px}
.picker{position:relative}
.picker-input{width:100%}
.picker-list{position:absolute;z-index:40;left:0;right:0;top:calc(100% + 4px);max-height:240px;overflow:auto;margin:0;padding:4px;list-style:none;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-s);box-shadow:0 8px 24px rgba(0,0,0,.15)}
.picker-list button{display:block;width:100%;padding:.5rem .6rem;border:0;border-radius:6px;background:none;text-align:left;cursor:pointer;font-weight:500}
.picker-list button:hover,.picker-list button.is-active{background:var(--brand-soft);color:var(--brand)}
.picker.is-invalid .picker-input{border-color:var(--bad);box-shadow:0 0 0 2px var(--bad-soft)}
.dialog .picker-list{position:static;box-shadow:none;margin-top:4px;max-height:200px}

/* Team seniority */
.person-item{display:flex;align-items:stretch;gap:.35rem}
.person-item .person-card{flex:1;min-width:0}
.seniority{flex:none;display:inline-grid;place-items:center;min-width:46px;height:40px;padding:0 .35rem;border-radius:10px;background:var(--brand-soft);color:var(--brand);font-weight:800;font-size:.85rem;white-space:nowrap}
.move-btns{display:flex;flex-direction:column;gap:.25rem;justify-content:center}
.move-btns .icon-btn{width:34px;height:30px;font-size:.75rem}
.move-btns .icon-btn:disabled{opacity:.3;cursor:default}
.seniority-note{flex:1 1 100%;margin:-.4rem 0 .6rem;color:var(--brand);font-weight:600;font-size:.88rem}

/* Printable weekly schedule (web/app/print.mjs) */
#print-sheet{position:fixed;inset:0;z-index:1000;overflow:auto;background:#e9edf0;padding:0 16px 32px}
body.printing{overflow:hidden}
.print-bar{position:sticky;top:0;display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:var(--surface,#fff);margin:0 -16px 16px;padding:10px 16px;border-bottom:1px solid #d5dce1}
.print-bar .spacer{flex:1}
.print-page{background:#fff;color:#1b2b33;max-width:1120px;margin:0 auto;padding:18px 20px;box-shadow:0 1px 4px rgba(0,0,0,.15);font:11px/1.3 system-ui,-apple-system,"Segoe UI",sans-serif}
.print-title{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;border-bottom:2px solid #1b2b33;padding-bottom:6px;margin-bottom:8px}
.print-title h1{font-size:18px;margin:0}
.print-title p{margin:2px 0 0}
.print-meta{color:#5b6b73}
.print-table{width:100%;border-collapse:collapse;table-layout:fixed}
.print-table th,.print-table td{border:1px solid #b9c4ca;padding:3px 4px;vertical-align:top;text-align:left}
.print-table thead th{background:#24434f;color:#fff;text-align:center;font-weight:600}
.print-table thead small{font-weight:400}
.print-table .pn{width:150px}
.print-table .ph{width:52px;text-align:right}
.print-table .ph small{display:block;color:#a24b00}
.print-table tbody th.pn{font-weight:600}
.print-table .ps{display:inline-block;min-width:34px;color:#5b6b73;font-weight:400}
.print-table tr.pg th{background:#eef2f4;text-transform:uppercase;letter-spacing:.04em;font-size:10px}
.print-table tfoot th,.print-table tfoot td{font-weight:700;background:#eef2f4}
.pe{border-left:4px solid #888;padding-left:4px;margin:1px 0}
.pe strong{display:block;white-space:nowrap}
.pe span{display:block;color:#3c4d55;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pe em{font-style:normal;font-size:9px;font-weight:700;color:#a24b00}
.pl{font-weight:600;text-align:center!important;vertical-align:middle!important}
.pl-off{color:#c00000;font-weight:800;text-align:center!important;vertical-align:middle!important}
.pl-note{font-size:9px;color:#5b6b73}
.print-legend{display:flex;flex-wrap:wrap;gap:4px 14px;margin:8px 0 0;font-size:10px}
.print-legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:4px;vertical-align:-1px}
@media (max-width:700px){.print-page{overflow-x:auto}.print-table{min-width:900px}}
@media print{
  @page{size:landscape;margin:8mm}
  body.printing>*:not(#print-sheet){display:none!important}
  body.printing{overflow:visible;background:#fff}
  #print-sheet{position:static;overflow:visible;background:#fff;padding:0}
  .print-bar{display:none}
  .print-page{box-shadow:none;max-width:none;padding:0}
  .print-page,.print-page *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .print-table tr{break-inside:avoid}
  .print-page{font-size:9.5px}.print-table th,.print-table td{padding:2px 3px}.print-title h1{font-size:15px}
  .print-table thead{display:table-header-group}
}

/* Team > Vacation calendar */
.cal-bar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin:4px 0 8px}
.cal-bar .week-nav{display:flex;align-items:center;gap:8px}
.cal-title{min-width:150px;text-align:center;font-size:1.1rem}
.cal-bar input[type=search]{max-width:200px}
.cal-wrap{overflow-x:auto}
.cal{width:100%;min-width:720px;border-collapse:collapse;table-layout:fixed;background:var(--surface,#fff)}
.cal th{padding:6px;font-size:.8rem;text-align:left;color:var(--muted,#5b6b73);border-bottom:1px solid var(--border,#d5dce1)}
.cal td{border:1px solid var(--border,#d5dce1);vertical-align:top;height:96px;padding:4px}
.cal td.cal-out{background:var(--surface-2,#f3f5f6)}
.cal td.cal-out .cal-num,.cal td.cal-out .cal-name{opacity:.55}
.cal td.cal-today{box-shadow:inset 0 0 0 2px var(--accent,#13716b)}
.cal-day{display:flex;justify-content:space-between;align-items:center;margin-bottom:3px}
.cal-num{border:0;background:none;font:inherit;font-weight:600;cursor:pointer;padding:0 4px;border-radius:4px;color:inherit}
.cal-num:hover{background:var(--surface-2,#eef2f4)}
.cal-count{font-size:.7rem;color:var(--muted,#5b6b73)}
.cal-name{display:block;width:100%;text-align:left;border:0;border-radius:4px;padding:1px 5px;margin:2px 0;font:inherit;font-size:.78rem;color:#1b2b33;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
div.cal-name{cursor:default}
.cal-print{min-width:0;font-size:10px}.cal-print td{height:70px}
@media print{.cal-print .cal-name{font-size:9px}}

/* Leave colours: one per type, same everywhere (web/app/leave-style.mjs) */
.lv{--lv:#e5e7eb;--lv-ink:#374151;--lv-edge:#6b7280;background:var(--lv)!important;color:var(--lv-ink)!important;border-left-color:var(--lv-edge)!important;font-weight:700}
.lv-vac{--lv:#fde68a;--lv-ink:#713f12;--lv-edge:#d97706}
.lv-loa{--lv:#ddd6fe;--lv-ink:#4c1d95;--lv-edge:#7c3aed}
.lv-mat{--lv:#fbcfe8;--lv-ink:#831843;--lv-edge:#db2777}
.lv-rdo{--lv:#bfdbfe;--lv-ink:#1e3a8a;--lv-edge:#2563eb}
.lv-med{--lv:#99f6e4;--lv-ink:#134e4a;--lv-edge:#0d9488}
.lv-sick{--lv:#fed7aa;--lv-ink:#7c2d12;--lv-edge:#ea580c}
.lv-sickcov{--lv:#d9f99d;--lv-ink:#365314;--lv-edge:#65a30d}
.lv-xfer{--lv:#cbd5e1;--lv-ink:#1e293b;--lv-edge:#475569}
.chip-leave.lv{justify-content:center;text-align:center}
.mchip.lv{font-weight:800}
.pl-note.lv{display:inline-block;margin-top:2px;padding:0 4px;border-radius:3px;font-size:9px}
.cell-off{margin:auto;color:#d00000;font-weight:800;letter-spacing:.04em}
.chip-hours{font-size:.72rem;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.chip .chip-hours{margin-left:auto}
.leave-legend{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.leave-legend .chip{display:inline-flex;font-size:.75rem;padding:1px 8px;border-left:4px solid}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .cell-off{color:#ff6b6b}}
:root[data-theme=dark] .cell-off{color:#ff6b6b}
.leave-legend{align-items:center}
.leave-legend .cell-off{margin:0 4px 0 0}
.leave-legend .chip{flex:0 0 auto;margin:0}

/* Team > People list */
.people-table-wrap{padding:0;overflow-x:auto}
.people-table{width:100%;border-collapse:collapse}
.people-table th,.people-table td{padding:.45rem .6rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
.people-table thead th{font-size:.78rem;color:var(--muted);font-weight:600;background:var(--surface-2)}
.people-table tr.pl-group th{background:var(--surface-2);font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}
.people-table tbody tr:not(.pl-group):hover{background:color-mix(in srgb,var(--brand) 5%,transparent)}
.people-table .pl-num{width:56px;font-weight:800;color:var(--brand);white-space:nowrap}
.people-table .pl-name .link-btn{font-weight:700;text-align:left;font-size:1rem}
.people-table .pl-status,.people-table .pl-off{white-space:nowrap;color:var(--muted)}
.people-table .pl-max{width:70px;text-align:center}
.people-table .pl-roles{font-size:.8rem;color:var(--muted)}
.role-dot{display:inline-flex;align-items:center;gap:.25rem;margin:0 .6rem .1rem 0;white-space:nowrap}
.role-dot::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--role)}
.people-table .pl-move{width:86px}
.people-table .move-btns{flex-direction:row}
.people-table .move-btns .icon-btn{width:32px;height:28px}
@media (max-width:760px){.people-table .pl-roles,.people-table .pl-max,.people-table .pl-status{display:none}}
.edit-shift{border:1px solid var(--line);border-radius:var(--radius);padding:.5rem .6rem;margin-bottom:.5rem}
.edit-shift .form-row{margin-top:.35rem}
.hcell .sched{display:flex!important;align-items:center;gap:4px;min-width:0}
.hcell .h-role{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;color:var(--text,inherit)}
.h-note-btn{margin-left:auto;flex:none;border:1px dashed var(--line);background:none;border-radius:5px;padding:0 5px;font-size:.75rem;line-height:1.4;color:var(--muted);cursor:pointer}
.h-note-btn.is-set{border-style:solid;border-color:var(--brand);background:var(--brand-soft)}
.hcell.has-note{box-shadow:inset 3px 0 0 var(--brand)}
.h-note-text{display:block;margin-top:2px;font-size:.7rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}

/* Coordinator sign-in: the logo image shows large, centred above the site name. */
.signin-brand{flex-direction:column;align-items:center;text-align:center;gap:.6rem;font-size:1.25rem}
.signin-brand .logo-img{width:auto;height:auto;max-width:min(100%,320px);max-height:140px;border-radius:0}
