:root{font:16px/1.5 system-ui,sans-serif;color:#172833;background:#eef3f5;--ink:#102b32;--accent:#bdf08c;--border:#d6e0e3}
*{box-sizing:border-box}
body{margin:0}
[hidden]{display:none!important}
header{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--ink);padding:14px max(16px,calc((100vw - 1120px)/2));color:white}
header a{color:inherit;text-decoration:none}
#brand{font-size:1.1rem;font-weight:800}
nav{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
nav a{padding:9px 11px;border-radius:8px}
nav a[aria-current]{background:var(--accent);color:var(--ink);font-weight:700}
main{max-width:1152px;margin:auto;padding:20px 16px max(32px,env(safe-area-inset-bottom));overflow-wrap:anywhere}
h1{font-size:clamp(1.9rem,5vw,3.1rem);line-height:1.1;margin:0 0 16px;letter-spacing:-.045em}
h2{font-size:1.15rem;margin:0 0 8px}
p{margin:4px 0 10px}
.panel{background:white;border:1px solid var(--border);border-radius:15px;padding:18px;margin-bottom:14px;min-width:0}
.login{max-width:460px;margin:40px auto 0}
.dashboard,.columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.stat{font-size:2.1rem;color:#174f43}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0 14px}
.toolbar h1,.toolbar h2{margin:0}
button,input,select{font:inherit;color:inherit;min-height:44px;border:1px solid #aebfc3;border-radius:8px;padding:8px 12px;background:white;max-width:100%}
button{font-weight:650;cursor:pointer}
button:hover{background:#eaf4ef}
.primary{background:var(--accent);border-color:#85b964;color:var(--ink)}
:focus-visible{outline:3px solid #29755d;outline-offset:3px}
label{display:block;font-weight:650;margin-bottom:12px}
label:not(.inline)>input,label>select{display:block;width:100%;margin-top:5px;min-width:0}
.inline{display:flex;align-items:center;gap:8px}
.inline input{min-height:auto;width:20px;height:20px}
.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin-bottom:16px}
.calendar button{padding:4px;line-height:1.18}
.calendar button[aria-pressed=true]{background:var(--ink);color:white}
.calendar small{display:block;font-size:.7rem;font-weight:500}
.weekday{text-align:center;font-size:.83rem;color:#415964}
.entry{padding:10px 0;border-bottom:1px solid var(--border)}
.entry:last-child{border-bottom:0}
.entry button,article button{margin:4px 6px 0 0}
.muted{color:#48616a}
.warning{color:#8e3c13;font-weight:700}
#status:not(:empty){background:#eff7d5;border-left:4px solid #597e37;padding:9px 12px;border-radius:4px}
@media(max-width:620px){
  header{align-items:flex-start;flex-direction:column;gap:8px}
  nav{width:100%}
  nav a{font-size:.9rem;padding-inline:7px;min-height:44px;display:inline-flex;align-items:center}
  .dashboard,.columns{grid-template-columns:minmax(0,1fr)}
  .calendar{gap:3px}
  .calendar small{font-size:.61rem}
  .toolbar button{padding-inline:8px}
  .toolbar h2{text-align:center}
}

.schedule-key{display:flex;align-items:center;gap:8px}
.schedule-key span{width:14px;height:14px;background:#2171c7;border-radius:4px}
.calendar-day{min-width:0;border:1px solid var(--border);background:#fff;border-radius:8px;padding:8px}
.calendar-day h3{font-size:.95rem;margin:0 0 6px}
.calendar-today{border:2px solid #29755d}
.calendar-crew{border-top:1px solid var(--border);margin-top:8px;padding-top:6px}
.calendar-crew h4{font-size:.88rem;margin:0}
.calendar-day .entry{font-size:.86rem;padding:6px;margin:5px 0;overflow-wrap:anywhere}
.calendar-day .entry p{margin:4px 0}
.calendar-day button{font-size:.8rem;max-width:100%;min-height:36px}
.calendar-day .shift-open{background:#e8f3ff;border:1px solid #8ebced;border-left:4px solid #2171c7;border-radius:5px;color:#163b64}
.calendar-day .shift-open .muted{color:#175892;font-weight:700}
@media(max-width:900px){
  .calendar{grid-template-columns:minmax(0,1fr);gap:10px}
  .calendar>span{display:none}
  .calendar-day{padding:12px}
  .calendar-day button{min-height:44px;padding:7px 10px}
}

.schedule-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.schedule-toolbar h2{margin:0}
.crew-board{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:white}
.crew-board th,.crew-board td{vertical-align:top;padding:7px;border-bottom:1px solid var(--border);border-right:1px solid var(--border)}
.crew-board thead th{background:var(--ink);color:white;font-size:.8rem;text-align:left}
.crew-board th:first-child{width:6rem}
.crew-board tbody th{background:#e5eef0;text-align:left;font-size:.86rem}
.crew-board tr:last-child td,.crew-board tbody tr:last-child th{border-bottom:0}
.crew-board tr > :last-child{border-right:0}
.crew-board thead .schedule-today{background:#296451}
.crew-board .entry,.mobile-day .entry{font-size:.83rem;padding:7px;margin:0 0 4px}
.crew-board .entry p,.mobile-day .entry p{margin:2px 0}
.entry p:empty{display:none}
.crew-board button,.mobile-day button{font-size:.78rem;padding:4px 6px}
.crew-board button{min-height:30px}
.shift-open{background:#e7f2ff;border:1px solid #92bde9;border-left:3px solid #2171c7;border-radius:5px;color:#163b64}
.crew-board .shift-open:last-child,.mobile-day .shift-open:last-child{border-bottom:1px solid #92bde9}
.add-slot{background:#f5f8f9}
.mobile-day h3,.schedule-group h4{margin:0 0 8px}
.schedule-group{margin-top:12px;border-top:1px solid var(--border);padding-top:8px}
.mobile-day .schedule-today{color:#296451}

.crew-board th,.crew-board td{padding:5px 6px}
.crew-board tbody tr:nth-child(even) td{background:#f6f9fa}
.shift-line{font-size:.82rem;line-height:1.35;padding:5px 0;border-bottom:1px solid var(--border)}
.shift-line:last-child{border-bottom:0}
.shift-line summary{cursor:pointer;list-style:none;overflow-wrap:anywhere}
.shift-line summary::-webkit-details-marker{display:none}
.shift-line summary:hover{text-decoration:underline}
.shift-line[open] summary{font-weight:700}
.open-line summary{color:#175892;font-weight:700}
.shift-actions{margin-top:6px;padding:6px;border-radius:6px;background:#edf3f5}
.shift-actions p{margin:2px 0}
.crew-board .shift-actions button{margin:3px 3px 0 0}
.week-picker{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-bottom:12px}
.week-picker button{font-size:.75rem;padding:4px 2px;line-height:1.15}
.week-picker button[aria-pressed=true]{background:var(--ink);color:white}
.mobile-day .shift-line summary{min-height:44px;display:flex;align-items:center;font-size:.95rem}
