:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d2430;
  --muted: #6b7280;
  --line: #e5e1d8;
  --accent: #2e6f67;
  --accent-strong: #245b55;
  --shift9: #e9f5ee;
  --shift12: #eef1fb;
  --standby: #fff4d9;
  --off: #f6eaea;
  --warn: #8a5b13;
  --warn-bg: #fff5dc;
  --danger: #9b2c2c;
  --holiday: #b0661d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 56px);
  background: #1f3d3a;
  color: white;
  align-items: flex-end;
}
.app-header h1 { margin: 4px 0 6px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.03em; }
.app-header p { margin: 0; color: #dbe7e5; max-width: 780px; }
.eyebrow { text-transform: uppercase; letter-spacing: .11em; font-size: 11px; font-weight: 800; opacity: .76; }
.header-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
.header-actions .field span { color: #dbe7e5; }
.header-actions input { background: white; color: var(--ink); }


.import-status {
  flex: 1 1 100%;
  text-align: right;
  font-size: 12px;
  color: #dbe7e5;
  min-height: 1.2em;
}
.import-status[data-kind="error"] { color: #ffd7d7; }
.import-status[data-kind="ok"] { color: #d8f4ea; }
@media (max-width: 900px) { .import-status { text-align: left; } }

main { padding: 24px clamp(14px, 3vw, 42px) 36px; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 8px 24px rgba(34, 42, 48, .035); }
.card h2 { margin: 0 0 4px; font-size: 20px; }
.card > p, .card-title-row p { color: var(--muted); margin: 0 0 16px; font-size: 13px; line-height: 1.45; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pill { background: #eef4f2; color: var(--accent-strong); border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }

.form-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.field.grow { flex: 1 1 180px; }
.field.grow-2 { flex: 2 1 220px; }
.field.compact { min-width: 155px; }
.field span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
input, select { width: 100%; border: 1px solid #d7d3c9; border-radius: 10px; padding: 9px 10px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: #8eb5af; box-shadow: 0 0 0 3px rgba(46, 111, 103, .09); }
button { border: 1px solid #d7d3c9; border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--ink); font-weight: 700; }
button:hover { background: #faf9f6; }
button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-strong); }
.align-end { align-self: flex-end; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.toggle-row input { width: auto; margin-top: 3px; }
.toggle-row span { display: flex; flex-direction: column; gap: 2px; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { color: var(--muted); line-height: 1.35; }

.table-wrap { overflow: auto; }
.compact-table-wrap { max-height: 280px; margin-top: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left; }
.data-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; background: white; }
.inline-edit { min-width: 90px; }
.icon-btn { padding: 5px 8px; border: 0; background: transparent; color: var(--danger); }

.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: #f5f3ee; border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; font-size: 12px; }
.chip button { border: 0; padding: 0 2px; background: transparent; color: var(--danger); }

.roster-card { margin-top: 18px; padding-bottom: 10px; }
.roster-title-row { align-items: center; }
.warnings { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.warning { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0d38d; border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; margin: 8px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-box { width: 14px; height: 14px; border: 1px solid #d8d8d8; border-radius: 4px; }
.legend-box.shift9 { background: var(--shift9); }
.legend-box.shift12 { background: var(--shift12); }
.legend-box.standby { background: var(--standby); border-style: dashed; }
.legend-box.off { background: var(--off); }
.legend-box.manual { background: white; border: 2px solid var(--accent); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--holiday); }

.roster-edit-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; }
.roster-edit-bar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.roster-edit-bar button { white-space: nowrap; }
.roster-edit-bar button:disabled { opacity: .48; cursor: default; }

.roster-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.roster-table { border-collapse: separate; border-spacing: 0; min-width: max-content; width: 100%; font-size: 11px; }
.roster-table th, .roster-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; text-align: center; min-width: 112px; height: 72px; vertical-align: middle; }
.roster-table thead th { position: sticky; top: 0; z-index: 3; background: #faf9f6; }
.roster-table .staff-col { position: sticky; left: 0; z-index: 2; min-width: 150px; max-width: 180px; text-align: left; background: white; font-weight: 800; }
.roster-table thead .staff-col { z-index: 4; background: #faf9f6; }
.roster-table .day-head { min-width: 112px; }
.roster-table .day-head .dow { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.roster-table .day-head .date-num { display: block; font-size: 14px; }
.roster-table .day-head .holiday-name { display: block; margin-top: 3px; color: var(--holiday); font-size: 9px; max-width: 90px; white-space: normal; line-height: 1.15; }
.roster-table td.shift-09 { background: var(--shift9); }
.roster-table td.shift-12 { background: var(--shift12); }
.roster-table td.standby { background: var(--standby); outline: 1px dashed #c49a43; outline-offset: -2px; }
.roster-table .standby-label { display: block; font-weight: 900; font-size: 10px; letter-spacing: .025em; }
.roster-table td.day-off { background: var(--off); font-weight: 900; color: #7c3f3f; }
.roster-table td.requested-off { outline: 2px solid #d9b4b4; outline-offset: -2px; }
.roster-table td.manual-edit { box-shadow: inset 0 0 0 2px var(--accent); }
.cell-editor { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 98px; }
.roster-role-select { width: 100%; min-width: 0; padding: 4px 6px; border-radius: 7px; font-size: 10px; font-weight: 800; background: rgba(255,255,255,.86); }
.roster-role-select:disabled { opacity: .78; cursor: not-allowed; }
.cell-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cell-time { display: flex; flex-direction: column; align-items: stretch; gap: 1px; color: var(--muted); font-size: 8px; }
.cell-time span { flex: 0 0 auto; }
.roster-time-input { min-width: 0; width: 100%; padding: 3px 2px; border-radius: 7px; font-size: 9px; background: rgba(255,255,255,.86); }
.cell-note, .manual-label { display: block; font-size: 9px; line-height: 1.1; color: var(--muted); }
.manual-label { color: var(--accent-strong); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.print-cell { display: none; font-weight: 800; line-height: 1.25; }
.roster-table .time { display: block; font-weight: 800; font-size: 11px; }
.roster-table .finish { display: block; color: var(--muted); margin-top: 2px; font-size: 10px; }
.roster-table tfoot td { background: #fbfaf7; font-weight: 700; color: var(--muted); height: 34px; }
.roster-table tfoot .staff-col { background: #fbfaf7; }

footer { display: flex; justify-content: space-between; gap: 16px; padding: 8px clamp(14px, 3vw, 42px) 30px; color: var(--muted); font-size: 12px; }
.danger-link { border: 0; padding: 0; background: transparent; color: var(--danger); }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; }

@media (max-width: 900px) {
  .app-header { align-items: flex-start; flex-direction: column; }
  .header-actions { justify-content: flex-start; width: 100%; }
  .setup-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .roster-edit-bar { align-items: stretch; flex-direction: column; }
  .roster-edit-bar button { width: 100%; }
}

@media print {
  body { background: white; }
  .app-header { color: black; background: white; padding: 0 0 12px; }
  .app-header p, .app-header .eyebrow { color: #555; }
  .header-actions, .setup-grid, footer, .legend, .warnings, .roster-edit-bar { display: none !important; }
  main { padding: 0; }
  .roster-card { border: 0; box-shadow: none; padding: 0; }
  .roster-wrap { overflow: visible; border: 0; }
  .roster-table { font-size: 8px; transform-origin: top left; }
  .roster-table th, .roster-table td { min-width: 50px; height: 38px; padding: 3px; }
  .cell-editor { display: none !important; }
  .print-cell { display: inline; }
  .roster-table td.manual-edit { box-shadow: none; }
  .roster-table .staff-col { min-width: 100px; }
}

.task-config-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.task-config-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.task-config-row .inline-edit { width: 100%; }
.task-number { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #f1efe9; color: var(--muted); font-size: 11px; font-weight: 800; }

.checklist-card { margin-top: 18px; }
.checklist-title-row { align-items: flex-end; }
.checklist-toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.checklist-toolbar button:disabled { opacity: .48; cursor: default; }
.checklist-summary { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 12px; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; color: var(--muted); font-size: 12px; }
.checklist-summary strong { color: var(--ink); }
.progress-text { white-space: nowrap; }
.checklist-wrap { border: 1px solid var(--line); border-radius: 12px; }
.checklist-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.checklist-table th, .checklist-table td { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.checklist-table thead th { background: #faf9f6; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.checklist-table tr:last-child th, .checklist-table tr:last-child td { border-bottom: 0; }
.checklist-table th:last-child, .checklist-table td:last-child { border-right: 0; }
.checklist-table .check-task-col { min-width: 240px; text-align: left; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 13px; }
.check-person-col { min-width: 110px; }
.task-check-label { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 9px; border: 1px solid #d7d3c9; border-radius: 9px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.task-check-label input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.task-check-label:has(input:checked) { border-color: #8eb5af; background: var(--shift9); color: var(--accent-strong); }
.task-done-row .check-task-col { text-decoration: line-through; text-decoration-color: #9ea7a4; color: #58615f; }
.task-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.task-status.done { background: var(--shift9); color: var(--accent-strong); }
.task-status.pending { background: #f1efe9; color: var(--muted); }

@media (max-width: 900px) {
  .checklist-title-row { align-items: stretch; flex-direction: column; }
  .checklist-toolbar { justify-content: flex-start; }
  .checklist-toolbar .field, .checklist-toolbar button { flex: 1 1 180px; }
  .checklist-table .check-task-col { min-width: 190px; }
}

@media print {
  .checklist-card { display: none !important; }
}

/* Cloud hosting + team portal */
.cloud-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px clamp(14px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.cloud-bar > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 190px; }
.cloud-bar strong { color: var(--ink); }
.cloud-bar #cloudStatus { color: var(--muted); font-size: 12px; }
.cloud-bar #cloudStatus[data-kind="ok"] { color: #2f6f64; }
.cloud-bar #cloudStatus[data-kind="error"] { color: var(--danger); }
.cloud-login-form { display: flex; align-items: center; gap: 8px; flex: 1 1 420px; flex-wrap: wrap; }
.cloud-login-form input { min-width: 170px; flex: 1 1 170px; }
.cloud-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.cloud-actions a { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); text-decoration: none; background: #fff; font-size: 12px; font-weight: 800; }

.team-main { max-width: 1180px; margin: 0 auto; }
.team-auth-card { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; }
.team-login-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.team-login-actions { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.cloud-status-line { min-height: 22px; color: var(--muted); font-size: 13px; }
.cloud-status-line[data-kind="error"] { color: var(--danger); }
.team-calendar-heading { margin-bottom: 14px; }
.team-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.team-day { min-width: 0; min-height: 128px; border: 1px solid var(--line); border-radius: 12px; padding: 11px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.team-day.role-morning { background: var(--shift9); }
.team-day.role-standby { background: var(--standby); }
.team-day.role-twelve { background: var(--shift12); }
.team-day.role-off { background: var(--off); }
.team-day.is-manual { box-shadow: inset 0 0 0 2px rgba(125, 90, 20, .2); }
.team-day-head { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.team-day-number { display: inline-flex; width: 28px; height: 28px; border-radius: 999px; align-items: center; justify-content: center; background: rgba(255,255,255,.7); color: var(--ink); font-size: 13px; }
.team-role { color: var(--ink); font-size: 13px; font-weight: 900; line-height: 1.35; }
.team-standby-note { color: #6f5318; font-size: 11px; line-height: 1.35; }
.team-holiday { margin-top: auto; color: var(--muted); font-size: 10px; line-height: 1.25; }
.team-manual-badge { margin-left: auto; border-radius: 999px; padding: 3px 6px; background: rgba(255,255,255,.72); color: #7b5c16; font-size: 9px; }
.team-message { padding: 14px 2px; color: var(--muted); font-size: 13px; }
.team-checklist-card { margin-top: 22px; }
.team-month-field input { min-width: 145px; }

@media (max-width: 900px) {
  .cloud-bar { align-items: stretch; }
  .cloud-actions { margin-left: 0; width: 100%; }
  .cloud-actions a, .cloud-actions button { flex: 1 1 150px; justify-content: center; }
  .team-calendar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .team-login-form { grid-template-columns: 1fr; }
  .team-login-actions { grid-column: auto; }
  .team-calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .team-day { min-height: 116px; }
  .team-header .header-actions { align-items: stretch; }
  .team-header .header-actions > * { flex: 1 1 140px; }
  .cloud-login-form { flex-direction: column; align-items: stretch; }
  .cloud-login-form input, .cloud-login-form button { width: 100%; }
}

@media print {
  .cloud-bar { display: none !important; }
}

/* Manager application stays completely hidden until cloud-admin verifies a manager session. */
#managerHeader[hidden], #managerMain[hidden], #managerFooter[hidden] { display: none !important; }

/* Mobile-first roster editor ------------------------------------------------ */
.mobile-roster { display: none; }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  main { padding: 14px 10px 28px; }
  .app-header { padding: 18px 14px; gap: 16px; }
  .app-header h1 { font-size: 28px; line-height: 1.05; }
  .app-header p { font-size: 13px; line-height: 1.45; }
  .header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
  .header-actions .field, .header-actions .import-status { grid-column: 1 / -1; }
  .header-actions button { min-height: 44px; width: 100%; }
  .import-status { text-align: left; }

  .cloud-bar { margin: 10px; padding: 12px; border-radius: 14px; gap: 10px; }
  .cloud-login-form { display: grid; grid-template-columns: 1fr; width: 100%; }
  .cloud-login-form input, .cloud-login-form button { min-height: 46px; width: 100%; }
  .cloud-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
  .cloud-actions a, .cloud-actions button { min-height: 44px; width: 100%; justify-content: center; }

  .card { border-radius: 14px; padding: 15px; }
  .card-title-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .pill { align-self: flex-start; }
  .form-grid { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .form-grid .field, .field.grow, .field.grow-2, .field.compact { min-width: 0; width: 100%; }
  .form-grid button, .align-end { width: 100%; align-self: stretch; min-height: 46px; }
  input, select, button { min-height: 44px; font-size: 16px; }
  .field span { font-size: 10px; }
  .settings-grid { gap: 10px; }
  .toggle-row { min-height: 50px; align-items: center; }
  .toggle-row input { width: 22px; height: 22px; min-height: 0; flex: 0 0 22px; }

  .compact-table-wrap { max-height: none; overflow: visible; }
  #staffTable, #staffTable tbody, #staffTable tr, #staffTable td { display: block; width: 100%; }
  #staffTable thead { display: none; }
  #staffTable tbody { display: grid; gap: 10px; }
  #staffTable tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fbfaf7; }
  #staffTable td { border: 0; padding: 5px 0; }
  #staffTable td::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  #staffTable td:nth-child(1)::before { content: 'Name'; }
  #staffTable td:nth-child(2)::before { content: 'Team login email'; }
  #staffTable td:nth-child(3)::before { content: 'Normal finish'; }
  #staffTable td:nth-child(4)::before { content: 'Actions'; }
  #staffTable .inline-edit { min-width: 0; width: 100%; }
  #staffTable .icon-btn { min-height: 44px; width: 100%; border: 1px solid #eadada; background: #fff; }

  .chip-list { gap: 8px; }
  .chip { width: 100%; justify-content: space-between; border-radius: 10px; line-height: 1.35; }
  .chip button { min-height: 36px; min-width: 36px; }

  .task-config-row { grid-template-columns: 30px minmax(0, 1fr) 44px; }
  .task-config-row .icon-btn { min-height: 44px; }

  .roster-card { padding: 14px; }
  .roster-title-row { align-items: stretch; }
  .warnings { justify-content: flex-start; }
  .warning { width: 100%; border-radius: 10px; line-height: 1.35; }
  .legend { gap: 8px 12px; }
  .legend > span { flex: 1 1 145px; }
  .roster-edit-bar { padding: 10px; }
  .desktop-roster-wrap { display: none; }
  .mobile-roster { display: block; }
  .mobile-roster-toolbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: end; margin-bottom: 10px; }
  .mobile-roster-toolbar button { width: 44px; min-height: 44px; padding: 0; font-size: 25px; line-height: 1; }
  .mobile-roster-toolbar button:disabled { opacity: .35; cursor: default; }
  .mobile-roster-summary { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; color: var(--muted); font-size: 12px; line-height: 1.4; }
  .mobile-roster-summary strong { color: var(--ink); }
  .mobile-roster-list { display: grid; gap: 10px; }
  .mobile-roster-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
  .mobile-roster-card.shift-09 { background: var(--shift9); }
  .mobile-roster-card.shift-12 { background: var(--shift12); }
  .mobile-roster-card.standby { background: var(--standby); border-style: dashed; }
  .mobile-roster-card.day-off { background: var(--off); }
  .mobile-roster-card.manual-edit { box-shadow: inset 0 0 0 2px var(--accent); }
  .mobile-roster-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: 15px; }
  .mobile-roster-card-head > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
  .mobile-roster-badge { display: inline-flex; border-radius: 999px; padding: 3px 7px; background: rgba(255,255,255,.82); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
  .mobile-roster-badge.requested { color: #7c3f3f; }
  .mobile-roster-badge.edited { color: var(--accent-strong); }
  .mobile-time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-time-grid input, .mobile-roster-card select { background: rgba(255,255,255,.92); }
  .mobile-off-note, .mobile-standby-note { color: var(--muted); font-size: 12px; line-height: 1.4; }
  .mobile-standby-note { color: #6f5318; }

  .checklist-toolbar { display: grid; grid-template-columns: 1fr; width: 100%; }
  .checklist-toolbar .field, .checklist-toolbar button { width: 100%; }
  .checklist-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .checklist-table th, .checklist-table td { padding: 10px 9px; }
  .checklist-table .check-task-col { min-width: 180px; position: sticky; left: 0; z-index: 1; background: #fff; }
  .checklist-table thead .check-task-col { z-index: 2; background: #faf9f6; }
  .task-check-label { min-height: 44px; min-width: 64px; }
  .task-check-label input { width: 24px; height: 24px; min-height: 0; }

  footer { flex-direction: column; align-items: stretch; padding: 8px 14px 24px; line-height: 1.45; }
  footer .danger-link { min-height: 44px; text-align: left; }

  .team-main { padding: 14px 10px 28px; }
  .team-auth-card { padding: 16px; }
  .team-login-actions { display: grid; grid-template-columns: 1fr; }
  .team-login-actions button { width: 100%; min-height: 46px; }
  .team-header .header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .team-header .team-month-field { grid-column: 1 / -1; }
  .team-header .header-actions button { width: 100%; }
  .team-calendar-heading { flex-direction: column; align-items: stretch; }
  .team-calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .team-day { min-height: 112px; padding: 10px; gap: 6px; }
  .team-role { font-size: 12px; }
  .team-checklist-card { padding: 14px; }
}

@media (max-width: 390px) {
  .header-actions, .cloud-actions, .team-header .header-actions { grid-template-columns: 1fr; }
  .team-calendar-grid { grid-template-columns: 1fr; }
  .team-day { min-height: 96px; }
  .mobile-time-grid { grid-template-columns: 1fr; }
}
