:root {
  color-scheme: light;
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e2e8f0;
  --border-strong: #cfd8e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --primary: #1a6fe8;
  --primary-hover: #155bc2;
  --primary-soft: #e8f1fd;
  --danger: #c9372c;
  --danger-soft: #fdeeec;
  --ok: #16723a;
  --ok-soft: #e2f5e8;
  --today: #f1f7ff;
  --chip-text: #1f2937;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .28);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }
:focus-visible { outline: 3px solid #8fbcf8; outline-offset: 2px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border: 1px solid var(--border-strong);
  background: var(--surface); border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 500; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: #f1c5c0; background: var(--danger-soft); }
.btn-danger:hover { background: #fbe2df; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 14px; }
.btn.is-active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 26px; flex: 1; min-width: 0; letter-spacing: -.01em; }
.brand svg { width: 36px; height: 36px; color: #334155; flex: none; }
.weeknav { display: flex; gap: 8px; }
.top-actions { flex: 1; display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px 0 6px;
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 10px; cursor: pointer;
}
.profile-btn:hover { background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--c); display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: var(--chip-text); border: 1px solid rgba(15,23,42,.08);
}
.profile-name { font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); width: 280px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 6px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: none; background: none;
  border-radius: 8px; cursor: pointer; text-align: left; min-height: 40px;
}
.menu-item:hover:not(:disabled) { background: var(--surface-2); }
.menu-item:disabled { cursor: not-allowed; color: var(--muted); }
.menu-item .mi-name { flex: 1; }
.menu-item[aria-checked="true"] { background: var(--primary-soft); }
.menu-sep { border-top: 1px solid var(--border); margin: 6px 4px; }
.menu-note { font-size: 12px; color: var(--muted); padding: 6px 10px 6px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 1px solid rgba(15,23,42,.12); flex: none; display: inline-block; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.tag-muted { background: #eef1f5; color: var(--muted); }

/* ---------- Tabs / sub bar ---------- */
.subbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 24px 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 10px 28px; border: none; border-radius: 8px 8px 0 0; background: #e8ecf2; cursor: pointer;
  font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}
.tab:hover { background: #dfe5ee; }
.tab.is-active { background: var(--primary); color: #fff; }
.tab.is-inactive:not(.is-active) { color: var(--muted); background: #eef1f5; }
.tab-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: rgba(15,23,42,.1); }
.tab.is-active .tab-badge { background: rgba(255,255,255,.25); }

/* ---------- Calendar ---------- */
.cal-layout { display: flex; gap: 20px; padding: 20px 24px 28px; align-items: flex-start; }
.cal-main { flex: 1; min-width: 0; }
.notice {
  background: #fff8e6; border: 1px solid #f3dfa6; color: #6b4e00; padding: 10px 14px; border-radius: 10px;
  margin-bottom: 14px; font-size: 14px;
}
.weeks { position: relative; display: flex; gap: 16px; overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x proximity; }
.week {
  flex: 0 0 330px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; scroll-snap-align: start;
}
.week.is-current { border-color: #9cc3f7; box-shadow: 0 0 0 1px #9cc3f7, var(--shadow); }
.week-head { padding: 14px 18px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: relative; }
.week-head h2 { margin: 0; font-size: 21px; font-weight: 700; }
.week-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.badge { position: absolute; top: 15px; right: 14px; font-size: 12px; background: var(--primary-soft); color: var(--primary); padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.day { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; border-top: 1px solid var(--border); min-height: 76px; }
.week-head + .day { border-top: none; }
.day-label { padding: 10px 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.wd { font-weight: 600; font-size: 14px; }
.dt { color: var(--muted); font-size: 13px; }
.today-pill { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 999px; padding: 1px 7px; width: max-content; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; align-content: center; align-items: center; }
.plus-cell { padding: 10px 10px 10px 0; display: flex; align-items: center; }
.plus {
  width: 36px; height: 36px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; cursor: pointer;
  display: grid; place-items: center; color: var(--text-2);
}
.plus:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.plus:disabled { opacity: .3; cursor: not-allowed; background: transparent; }
.day.is-today { background: var(--today); }
.day.is-today .day-label { box-shadow: inset 3px 0 0 var(--primary); }
.day.is-beyond { background: repeating-linear-gradient(135deg, #fafbfd 0 8px, #f2f4f8 8px 16px); }
.day.is-beyond .wd, .day.is-beyond .dt { color: #9aa6b6; }
.chip {
  border: 1px solid rgba(15,23,42,.07); background: var(--c); color: var(--chip-text);
  padding: 6px 12px; border-radius: 7px; font-size: 14px; font-weight: 500; cursor: pointer; max-width: 100%;
  text-align: left; line-height: 1.25; min-height: 34px; overflow-wrap: anywhere;
}
.chip:hover { filter: brightness(.96); box-shadow: 0 1px 4px rgba(15,23,42,.14); }
.chip.is-inactive-person { border: 1px dashed rgba(15,23,42,.4); }
.scroll-hint { color: var(--muted); font-size: 13px; text-align: right; padding: 2px 4px 0; }

.side { flex: 0 0 260px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 6px; font-size: 19px; }
.panel p { margin: 0; }
.legend-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: none; padding: 0; cursor: pointer; font-size: 18px; font-weight: 700; text-align: left; min-height: 32px; }
.legend-toggle svg { transition: transform .15s; }
.legend:not(.is-open) .legend-toggle svg { transform: rotate(180deg); }
.legend-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.legend-list li { display: flex; align-items: center; gap: 12px; }
.legend-list .swatch { width: 30px; height: 22px; }
.swatch { display: inline-block; width: 34px; height: 24px; border-radius: 6px; background: var(--c); border: 1px solid rgba(15,23,42,.08); flex: none; }
.admin-link { display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer; font-weight: 600; font-size: 15px; text-align: left; }
.admin-link:hover { background: var(--surface-2); }
.admin-link .grow { flex: 1; }
.demo-note { font-size: 12px; color: var(--muted); padding: 0 4px; }

/* ---------- Admin ---------- */
.admin { max-width: 1320px; margin: 0 auto; padding: 24px; }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-size: 30px; }
.admin-head p { margin: 4px 0 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 20px; }
.card-head p { margin: 3px 0 0; font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-grid > .card { margin-bottom: 20px; }
.admin-grid--wide { grid-template-columns: 2fr 3fr; }
.table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable th { text-align: left; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 10px 12px; font-size: 13px; }
.rtable td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.rtable tr.is-inactive td { color: var(--muted); }
.rtable .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pname { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 6px; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.off { background: #eef1f5; color: var(--muted); }
.guard-note { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }
.switch {
  position: relative; width: 44px; height: 26px; border-radius: 999px; border: none; cursor: pointer;
  background: #cfd6df; padding: 0; flex: none; transition: background .15s;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { left: 21px; }
.switch[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.access-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.access-top label { font-weight: 600; }
.access-top select { flex: 1; max-width: 340px; }
.access-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.access-list li { border-top: 1px solid var(--border); }
.access-list li:first-child { border-top: none; }
.access-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; min-height: 42px; }
.access-list label:hover { background: var(--surface-2); }
.access-list .grow { flex: 1; }
.access-head { display: flex; justify-content: space-between; padding: 9px 12px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.invite-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.invite-form .full { grid-column: 1 / -1; }
.empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.log-filter { display: flex; align-items: center; gap: 8px; }
.log-filter select { min-height: 36px; }
.log-scroll { max-height: 420px; overflow-y: auto; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label, fieldset.field > legend { font-weight: 600; font-size: 15px; }
fieldset.field { border: none; padding: 0; margin: 0 0 16px; }
fieldset.field > legend { padding: 0; margin-bottom: 2px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
}
textarea.input { min-height: 70px; resize: vertical; }
select.input { padding-right: 32px; }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.datebtn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer; text-align: left;
}
.datebtn .grow { flex: 1; font-weight: 500; }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; min-height: 44px; }
.stepper button { border: none; background: var(--surface-2); cursor: pointer; font-size: 20px; display: grid; place-items: center; }
.stepper button:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper input { border: none; border-left: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); text-align: center; width: 100%; min-width: 0; font-weight: 600; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.readout { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); font-weight: 500; flex-wrap: wrap; }
.readout .sub { color: var(--muted); font-weight: 400; font-size: 14px; }
.readout.is-error { border-color: #eab0aa; background: var(--danger-soft); color: var(--danger); }
.person-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.check:hover { background: var(--surface-2); }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin: 0; }
.check .sub { font-size: 12px; color: var(--muted); }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 4px; }
.form-info { color: #6b4e00; background: #fff8e6; border: 1px solid #f3dfa6; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; }
.pal {
  width: 40px; height: 40px; border-radius: 10px; background: var(--c); border: 1px solid rgba(15,23,42,.1); cursor: pointer; position: relative; display: grid; place-items: center;
}
.pal[aria-checked="true"] { outline: 3px solid var(--primary); outline-offset: 2px; }
.pal .used { position: absolute; right: 3px; bottom: 3px; width: 8px; height: 8px; border-radius: 50%; background: rgba(15,23,42,.45); }
.picker { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #fff; box-shadow: var(--shadow); margin-top: 4px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.picker-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.pw { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.pd { border: none; background: none; border-radius: 8px; min-height: 36px; cursor: pointer; font-size: 14px; }
.pd:hover:not(:disabled) { background: var(--primary-soft); }
.pd.out { color: #9aa6b6; }
.pd.today { box-shadow: inset 0 0 0 1px var(--primary); }
.pd.sel { background: var(--primary); color: #fff; font-weight: 700; }
.pd:disabled { color: #c9d1db; cursor: not-allowed; text-decoration: line-through; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 580px;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
}
.modal.modal-sm { max-width: 460px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 8px; }
.modal-head h2 { margin: 0; font-size: 25px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); }
.modal-body { padding: 12px 24px 8px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 16px 24px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.modal-foot .btn { min-height: 44px; padding: 0 18px; }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 14px; pointer-events: auto; animation: tin .18s ease-out; }
.toast.err { background: #8f1f17; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
.mobile-only { display: none !important; }
@media (max-width: 1180px) {
  .cal-layout { flex-direction: column; }
  .side { position: static; flex: none; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .side > * { flex: 1 1 240px; }
  .legend-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 1000px) {
  .admin-grid, .admin-grid--wide { grid-template-columns: 1fr; gap: 0; }
  .weeknav .btn-label-long { display: none; }
}
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: revert !important; }
  .topwrap { position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 6px rgba(15,23,42,.06); }
  .topbar { padding: 8px 16px; }
  .brand { font-size: 21px; gap: 10px; }
  .brand svg { width: 28px; height: 28px; }
  .profile-btn { min-height: 40px; }
  .profile-name { max-width: 110px; }
  .subbar { padding: 8px 16px 10px; }
  .tabs { margin-bottom: 10px; }
  .tab { border-radius: 8px; flex: 1 1 0; justify-content: center; padding: 8px 10px; }
  .weeknav.mobile-only { display: grid !important; grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .weeknav .btn { min-height: 44px; padding: 0 10px; }
  .cal-layout { padding: 14px 16px 24px; gap: 14px; }
  .weeks { display: block; overflow: visible; padding: 0; }
  .week { margin-bottom: 16px; }
  .week-head { padding: 12px 16px; }
  .day { grid-template-columns: 112px minmax(0, 1fr) auto; min-height: 56px; }
  .day-label { padding: 8px 8px 8px 14px; }
  .chips { padding: 8px; }
  .plus-cell { padding: 8px 10px 8px 0; }
  .plus { width: 44px; height: 40px; }
  .side { flex-direction: column; }
  .side > * { flex: none; width: 100%; }
  .side .panel-cabin { display: none; }
  .legend-list { grid-template-columns: 1fr 1fr; }
  .legend:not(.is-open) .legend-list { display: none; }
  .admin { padding: 16px; }
  .admin-head { flex-direction: column-reverse; }
  .admin-head h1 { font-size: 26px; }
  .card { padding: 16px; }
  .table-wrap { border: none; border-radius: 0; overflow: visible; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; padding: 6px 0; }
  .rtable td { border: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 12px; text-align: right; overflow-wrap: anywhere; }
  .rtable td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  .rtable td.actions { justify-content: flex-end; }
  .rtable td.actions::before { display: none; }
  .log-scroll { max-height: none; }
  .invite-form { grid-template-columns: 1fr; }
  .access-top { flex-direction: column; align-items: stretch; }
  .access-top select { max-width: none; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none !important; border-radius: 16px 16px 0 0; max-height: 94vh; max-height: 94dvh; }
  .modal-head { padding: 18px 16px 6px; }
  .modal-body { padding: 10px 16px 6px; }
  .modal-foot { padding: 12px 16px 16px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal-foot .spacer { display: none; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .person-list { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .day { grid-template-columns: 92px minmax(0, 1fr) auto; }
  .weeknav .btn-label { display: none; }
}

/* ---------- Innlogging og passord (ikke i prototypen) ---------- */
.splash { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 28px 28px 24px;
}
.auth-brand { font-size: 24px; margin-bottom: 22px; }
.auth-brand svg { width: 32px; height: 32px; }
.auth-card h1 { margin: 0 0 18px; font-size: 24px; }
.auth-lead { margin: -8px 0 18px; color: var(--text-2); }
.auth-submit { width: 100%; min-height: 46px; margin-top: 8px; }
.auth-card .hint { margin-top: 16px; }
.auth-card .field .hint { margin-top: 0; }
.auth-card .form-error { margin-bottom: 8px; }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 4px 10px 8px; font-weight: 600; }
.menu-user .mi-name { flex: 1; overflow-wrap: anywhere; }
.status.warn { background: #fff4d6; color: #7a5600; }
.swatch-sm { width: 22px; height: 16px; border-radius: 5px; }
.pw-row { display: flex; gap: 8px; }
.pw-row .input { flex: 1; min-width: 0; }
.pw-row .btn { min-height: 44px; }
.mono, .secret { font-family: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; letter-spacing: .02em; }
.secret {
  font-size: 22px; font-weight: 600; text-align: center; padding: 14px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px dashed var(--border-strong); user-select: all; overflow-wrap: anywhere;
}
@media (min-width: 768px) { .table-wrap { overflow-x: auto; } }
@media (max-width: 767px) { .auth-card { padding: 22px 18px 20px; } }
@media (max-width: 767px) { .menu-item.mobile-only { display: flex !important; } }
