.session-button {
  border: 1px solid var(--border);
  background: transparent;
  color: #b8cedc;
  cursor: pointer;
  font-size: 10px;
  border-radius: 7px;
  padding: 7px 10px;
}
.session-button.authenticated { color: var(--mint); border-color: rgba(86,211,177,.3); }
.compact-empty { padding: 55px 20px; margin-top: 0; }
.import-card { margin-bottom: 12px; }
.import-card.review { border-color: rgba(255,151,103,.3); }
.import-meta h2 { font-size: 15px; margin: 0 0 5px; }
.import-meta p { font-size: 10px; color: var(--muted); margin: 0; }
.import-issues {
  grid-column: 2/-1;
  margin: 0;
  padding: 10px 13px;
  background: rgba(255,151,103,.06);
  border-radius: 8px;
  list-style: none;
}
.import-issues li { font-size: 9px; color: #f0b293; margin: 4px 0; }
.status-review,.status-failed { font-size: 9px; padding: 6px 9px; border-radius: 20px; }
.status-review { color: var(--orange); background: rgba(255,151,103,.09); }
.status-failed { color: #ff7b7b; background: rgba(255,90,90,.09); }
.upload-status { display: none; font-size: 10px; padding: 10px 12px; border-radius: 8px; margin: -5px 0 12px; }
.upload-status.show { display: block; background: rgba(0,166,200,.08); color: #a8eafa; }
.upload-status.error { display: block; background: rgba(255,90,90,.08); color: #ffadad; }
.login-form { display: grid; gap: 12px; margin-top: 22px; }
.login-form label { font-size: 9px; color: var(--muted); display: grid; gap: 6px; }
.login-form input { border: 1px solid var(--border); background: rgba(0,0,0,.18); border-radius: 9px; padding: 12px; color: white; outline: none; }
.login-form input:focus { border-color: var(--cyan); }
.form-error { min-height: 18px; color: #ff9c9c; font-size: 9px; margin-top: 9px; }
.demo-hint { display: block; text-align: center; color: var(--muted); font-size: 8px; margin-top: 11px; }
.replace-device-button { display: none; width: 100%; margin-top: 3px; border: 1px solid rgba(255,174,91,.38); background: rgba(255,151,103,.1); color: #ffd1b8; border-radius: 9px; padding: 11px; font-size: 10px; font-weight: 750; cursor: pointer; }
.replace-device-button.show { display: block; }
.replace-device-button:disabled { opacity: .55; cursor: wait; }
.mobile-nav { display: none; }
.roster-loading,.roster-error { padding: 28px; color: var(--muted); font-size: 11px; }
.roster-error { color: #ffadad; }
.roster-empty { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.roster-empty>span { font-size: 30px; color: var(--cyan2); }
.roster-empty h2 { font-size: 16px; margin: 0 0 5px; }
.roster-empty p { color: var(--muted); font-size: 10px; margin: 0; }
.real-roster,.import-preview { margin-bottom: 18px; }
.duty-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr)); gap: 10px; margin-top: 20px; }
.duty-card { position: relative; display: grid; gap: 6px; min-height: 132px; padding: 14px; border-radius: 10px; background: rgba(255,255,255,.025); border: 1px solid var(--border); overflow: hidden; }
.duty-card:before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--mint); }
.duty-card.night:before { background: var(--purple); }
.duty-card.rest:before { background: #637b8d; }
.duty-card time { font-size: 9px; color: var(--muted); }
.duty-card strong { font-size: 22px; color: var(--white); }
.duty-card span { font-size: 10px; color: #c6d8e3; }
.duty-card small { font-size: 9px; color: var(--cyan2); margin-top: auto; }
.preview-table { display: grid; gap: 1px; margin-top: 18px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.preview-row { display: grid; grid-template-columns: 150px 75px 1fr 45px; gap: 12px; align-items: center; padding: 11px 13px; background: rgba(0,0,0,.11); font-size: 10px; }
.preview-row time,.preview-row small { color: var(--muted); }
.preview-row b { color: var(--cyan2); }
.preview-row span small { display: block; margin-top: 3px; color: #76dff1; font-size: 8px; }
.review-note { color: var(--orange); font-size: 9px; }
.imports-history { margin-top: 26px; }
.inline-login { margin-top: 12px; }
.confirm-import:disabled { opacity: .55; cursor: wait; }
.duty-date { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.holiday-badge { color: #ffd27a; background: rgba(255,191,79,.1); border: 1px solid rgba(255,191,79,.2); border-radius: 20px; padding: 3px 5px; font-size: 7px; font-style: normal; white-space: nowrap; }
.holidays-panel { margin-bottom: 18px; }
.holiday-legend { color: #ffd27a; font-size: 20px; }
.holiday-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 8px; margin-top: 18px; }
.holiday-card { display: grid; gap: 5px; border: 1px solid rgba(255,191,79,.14); border-radius: 9px; background: rgba(255,191,79,.04); padding: 12px; }
.holiday-card time { color: #ffd27a; font-size: 9px; }
.holiday-card b { font-size: 10px; line-height: 1.35; }
.holiday-card small { color: var(--muted); font-size: 8px; }
.holiday-card.observed { border-color: rgba(86,211,177,.16); background: rgba(86,211,177,.035); }
.holiday-card.observed time { color: var(--mint); }
.holiday-card.observance { opacity: .72; }
.monthly-roster { padding: 0; overflow: hidden; margin-bottom: 18px; border-color: rgba(77,205,235,.34); background: #071d2e; box-shadow: 0 24px 65px rgba(0,7,14,.42); }
.calendar-scroll { overflow: hidden; }
.calendar-scroll-inner { min-width: 100%; }
.month-toolbar { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 72px; padding: 12px 20px; background: linear-gradient(105deg,#0b607d 0%,#124d68 50%,#0b607d 100%); border-bottom: 2px solid rgba(108,224,247,.48); box-shadow: inset 0 -8px 20px rgba(0,15,27,.2); }
.month-toolbar h2 { min-width: 210px; text-align: center; font-size: 21px; text-transform: capitalize; margin: 0; }
.month-nav { border: 1px solid rgba(255,255,255,.15); background: rgba(1,27,43,.24); color: white; font-size: 30px; line-height: 1; cursor: pointer; padding: 3px 13px 7px; border-radius: 8px; }
.month-nav:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); }
.month-today { margin-left: 12px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #f2fbff; border-radius: 7px; padding: 8px 12px; font-size: 9px; cursor: pointer; }
.calendar-weekdays,.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekdays { background: #0c4c68; border-top: 1px solid rgba(255,255,255,.12); border-bottom: 3px solid #49cce8; }
.calendar-weekdays span { padding: 12px 4px; text-align: center; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .17em; border-right: 2px solid rgba(146,226,245,.22); text-shadow: 0 2px 3px rgba(0,0,0,.55); }
.calendar-weekdays span:last-child { border-right: 0; }
.calendar-weekdays span:nth-last-child(-n+2) { color: #fff0c9; background: #704b19; }
.month-grid { gap: 3px; padding: 3px; background: #2c6e87; border-bottom: 2px solid #3eaecb; }
.calendar-cell { min-width: 0; min-height: 108px; display: flex; flex-direction: column; gap: 7px; padding: 9px; text-align: left; color: white; background: #0a263a; border: 0; cursor: pointer; transition: .15s; }
.calendar-cell:nth-child(n+8):nth-child(-n+14),.calendar-cell:nth-child(n+22):nth-child(-n+28),.calendar-cell:nth-child(n+36):nth-child(-n+42) { background-color: #17435b; }
.calendar-cell:hover { background-color: #25627a!important; box-shadow: inset 0 0 0 2px #83e9ff; }
.calendar-cell.outside { background: repeating-linear-gradient(135deg,#03121e,#03121e 9px,#071d2b 9px,#071d2b 18px)!important; cursor: default; opacity: 1; }
.calendar-cell.weekend:not(.outside) { background-color: #263748!important; box-shadow: inset 0 4px 0 rgba(240,173,67,.36); }
.calendar-cell.weekend .calendar-number { color: #fff0c8; background: #6a481c; border-color: #bc8132; }
.calendar-cell.selected { position: relative; z-index: 1; box-shadow: inset 0 0 0 4px #63e4ff,0 0 22px rgba(55,210,241,.3); background-color: #275b70!important; }
.calendar-cell.today .calendar-number { width: 27px; height: 27px; display: grid; place-items: center; margin: -3px 0 0 -3px; border-radius: 50%; background: #eef7fb; color: #092238; font-weight: 800; }
.calendar-cell.has-holiday { background-image: linear-gradient(145deg,rgba(255,191,79,.14),transparent 58%); }
.calendar-cell.has-day:not(.selected) { box-shadow: inset 6px 0 #00b8ed; }
.calendar-cell.has-night:not(.selected) { box-shadow: inset 6px 0 #f06472; }
.calendar-cell.has-rest:not(.selected) { box-shadow: inset 6px 0 #6685bd; }
.calendar-cell.has-leave:not(.selected) { box-shadow: inset 6px 0 #f19b27; }
.calendar-cell.has-active-rest:not(.selected) { box-shadow: inset 6px 0 #8c6be2; }
.calendar-cell.has-holiday:not(.selected):not(.has-day):not(.has-night):not(.has-rest):not(.has-leave):not(.has-active-rest) { box-shadow: inset 6px 0 #e4aa46; }
.calendar-number { width: 30px; height: 26px; display: grid; place-items: center; color: #f1f8fb; background: #18465f; border: 1px solid #367895; border-radius: 6px; font-size: 14px; font-weight: 850; text-shadow: 0 1px 2px rgba(0,0,0,.42); }
.calendar-tags { display: grid; gap: 4px; margin-top: auto; min-width: 0; }
.calendar-tag { text-align: center; }
.calendar-tag.long { letter-spacing: 0; }
@media (max-width: 520px) { .calendar-tag { padding: 6px 2px; letter-spacing: 0; text-overflow: clip; } .calendar-tag.long { font-size: 9px; } }
.calendar-tag { display: block; min-height: 27px; border-radius: 5px; padding: 6px 8px; color: white; font-size: 10px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #1c9fc9; box-shadow: 0 3px 9px rgba(0,0,0,.35); letter-spacing: .04em; border: 1px solid rgba(255,255,255,.24); }
.calendar-tag.day { background: #00aee2; }
.calendar-tag.night { background: #ef5d6b; }
.calendar-tag.rest { background: #5978ad; }
.calendar-tag.leave { background: #e89120; }
.calendar-tag.active-rest { background: #8060d5; }
.calendar-tag.holiday { background: #8c621e; color: #fff2c9; border: 1px solid #e3aa48; font-size: 9px; }
.calendar-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; padding: 13px 18px; border-top: 1px solid rgba(119,180,215,.2); background: #092338; color: #b7cad6; font-size: 9px; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.calendar-legend i { width: 22px; height: 8px; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.calendar-legend i.day { background: #089fcf; }.calendar-legend i.night { background: #eb6b75; }.calendar-legend i.rest { background: #486894; }.calendar-legend i.leave { background: #d49435; }.calendar-legend i.active-rest { background: #8060d5; }.calendar-legend i.holiday { background: #e0a643; }
.calendar-detail { margin: 0 18px 14px; border: 1px solid var(--border); border-radius: 9px; background: rgba(0,0,0,.12); overflow: hidden; }
.calendar-detail-date { padding: 12px 14px; background: rgba(255,255,255,.035); color: #d7e8f1; font-size: 11px; text-transform: capitalize; }
.calendar-detail-items { display: flex; flex-wrap: wrap; gap: 9px; padding: 13px; }
.detail-item { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.detail-item>span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: rgba(0,166,200,.13); color: var(--cyan2); font-size: 9px; font-weight: 800; }
.detail-item.night>span { background: rgba(235,107,117,.12); color: #ff9ba3; }.detail-item.rest>span { background: rgba(72,104,148,.2); color: #a9c1e1; }.detail-item.leave>span { background: rgba(212,148,53,.14); color: #ffd18a; }.detail-item.active-rest>span { background: rgba(128,96,213,.2); color: #cbbcff; }.detail-item.holiday>span { background: rgba(224,166,67,.12); color: #ffd27a; }
.detail-item b,.detail-item small { display: block; }.detail-item b { font-size: 10px; }.detail-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.detail-empty { color: var(--muted); font-size: 9px; }
.holiday-source-note { padding: 0 18px 15px; color: #68889b; font-size: 8px; }
@media (max-width: 760px) {
  /* Keep focused auth controls at iOS Safari's no-auto-zoom threshold. */
  .login-modal .login-form input,
  .login-modal .login-form select { font-size: 16px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .session-button { padding: 6px 8px; }
  .import-card { grid-template-columns: auto 1fr; }
  .import-issues { grid-column: 1/-1; }
  .preview-row { grid-template-columns: 1fr auto; }
  .preview-row span { grid-column: 1; }
  .preview-row small { grid-column: 2; grid-row: 1; }
  .import-preview .panel-head { align-items: flex-start; gap: 12px; }
  .import-preview .primary { padding: 9px 11px; }
  .month-toolbar { min-height: 56px; gap: 5px; padding: 7px 8px; }
  .month-toolbar h2 { min-width: 145px; font-size: 16px; }
  .month-today { display: none; }
  .month-nav { font-size: 28px; }
  .monthly-roster { width: calc(100% + 36px); max-width: none!important; margin-left: -18px; margin-right: -18px; border-left: 0; border-right: 0; border-radius: 0; }
  .calendar-scroll-inner { min-width: 0; width: 100%; }
  .calendar-weekdays span { font-size: 8px; padding: 7px 2px; letter-spacing: .08em; }
  .month-grid { gap: 2px; padding: 2px; }
  .calendar-cell { min-height: 64px; padding: 4px 3px; gap: 3px; }
  .calendar-number { width: 24px; height: 21px; border-radius: 5px; font-size: 11px; }
  .calendar-cell.today .calendar-number { width: 24px; height: 24px; }
  .calendar-tag { min-height: 19px; font-size: 8px; padding: 2px; text-align: center; }
  .calendar-tag.holiday { font-size: 0; min-height: 5px; padding: 0; background: #d7a342; border: 0; }
  .calendar-legend { justify-content: flex-start; gap: 9px; padding: 11px 10px; font-size: 8px; }
  .calendar-detail { margin: 0 10px 10px; }
  .holiday-source-note { padding: 0 10px 12px; }
  .mobile-nav { position: fixed; inset: auto 0 0 0; z-index: 45; display: grid; grid-template-columns: repeat(5,1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(4,22,35,.96); border-top: 1px solid rgba(89,207,234,.35); box-shadow: 0 -12px 34px rgba(0,5,10,.48); backdrop-filter: blur(18px); }
  .mobile-nav-item { position: relative; min-width: 0; min-height: 52px; border: 0; border-radius: 10px; background: transparent; color: #7f9bad; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
  .mobile-nav-item span { font-size: 20px; line-height: 1; }
  .mobile-nav-item small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 8px; font-weight: 700; white-space: nowrap; }
  .mobile-nav-item.active { color: #e9fbff; background: linear-gradient(145deg,rgba(0,174,220,.25),rgba(0,174,220,.09)); box-shadow: inset 0 0 0 1px rgba(75,219,246,.24); }
  .mobile-nav-item.active span { color: #58ddf7; }
  .mobile-nav-item i { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 15px; height: 15px; padding: 0 4px; border-radius: 10px; background: #16b7d7; color: #032334; display: grid; place-items: center; font-size: 7px; font-style: normal; font-weight: 900; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); left: 14px; right: 14px; text-align: center; }
  .modal-backdrop { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 390px) {
  .mobile-nav-item small { font-size: 7px; }
  .mobile-nav-item span { font-size: 18px; }
}
.import-kind { display: grid; gap: 6px; margin-top: 18px; font-size: 10px; color: var(--muted); }
.import-kind select { font: inherit; font-size: 12px; color: var(--white); background: rgba(0,166,200,.06); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; }
.calendar-tag.leave.planned,.calendar-tag.active-rest.planned { opacity: .78; border-style: dashed; }

/* Holiday marker sits next to the date number, away from the shift chips. */
.calendar-head { display: flex; align-items: center; gap: 5px; min-width: 0; }
.calendar-holiday { min-width: 0; display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 5px; background: rgba(140,98,30,.85); border: 1px solid #e3aa48; color: #fff2c9; font-size: 9px; font-weight: 800; line-height: 1.1; }
.calendar-holiday i { font-style: normal; color: #ffd27a; }
.calendar-holiday span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme="light"] .calendar-holiday { background: #fbecd3; border-color: #e9c48a; color: #7a4d10; }
html[data-theme="light"] .calendar-holiday i { color: #c98a1c; }
@media (max-width: 760px) {
  .calendar-head { gap: 3px; }
  .calendar-holiday { padding: 2px 4px; font-size: 10px; }
  .calendar-holiday span { display: none; }
}

/* Colleagues on duty in the day detail. */
.calendar-crew { padding: 0 13px 13px; border-top: 1px solid var(--border); }
.crew-title { padding: 12px 0 4px; color: #d7e8f1; font-size: 11px; font-weight: 800; }
.crew-subtitle { margin: 8px 0 5px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.crew-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 7px; }
.crew-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crew-person>div { min-width: 0; }
.crew-code { flex: none; min-width: 36px; height: 30px; padding: 0 4px; display: grid; place-items: center; border-radius: 7px; background: rgba(0,166,200,.13); color: var(--cyan2); font-size: 9px; font-weight: 800; }
.crew-person.supervisor .crew-code { background: rgba(224,166,67,.14); color: #ffd27a; }
.crew-person b,.crew-person small { display: block; }
.crew-person b { font-size: 11px; }
.crew-person small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.crew-role { margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: rgba(224,166,67,.18); color: #ffd27a; font-size: 8px; font-style: normal; font-weight: 800; }
.crew-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.crew-group { margin: 0 0 9px; }
.crew-group-head { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 6px; }
.crew-group-head b { color: #ffd27a; font-size: 10px; font-weight: 800; }
.crew-group-head small { color: var(--muted); font-size: 9px; }
.crew-others { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }
.crew-others summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--cyan2); font-size: 10px; font-weight: 800; }
.crew-others summary::-webkit-details-marker { display: none; }
.crew-others summary span { color: var(--muted); font-weight: 700; }
.crew-others[open] summary { margin-bottom: 4px; }
html[data-theme="light"] .crew-group-head b { color: #9a6a12; }
html[data-theme="light"] .crew-title { color: #10283b; }
html[data-theme="light"] .crew-person.supervisor .crew-code,html[data-theme="light"] .crew-role { color: #9a6a12; }
