:root {
  --pine-950: #14161c;
  --pine-900: #17181d;
  --pine-800: #21242c;
  --pine-700: #3a352e;
  --pine-100: #f3ece0;
  --pine-50: #fbf8f1;
  --amber-600: #c98f14;
  --amber-500: #f0ac28;
  --amber-100: #fdf1d7;
  --ink: #1b1916;
  --muted: #8a8275;
  --canvas: #fbf8f1;
  --paper: #fffdf8;
  --line: #e9e0cf;
  --danger: #9a543b;
  --danger-soft: #f6e7df;
  --info: #5b7fb0;
  --info-soft: #e7edf6;
  --success: #5d9a6c;
  --success-soft: #e7f0e6;
  --shadow-sm: 0 2px 6px rgba(40,30,10,.04), 0 18px 38px -24px rgba(40,30,10,.24);
  --shadow-lg: 0 4px 10px rgba(40,30,10,.06), 0 28px 56px -28px rgba(40,30,10,.32);
  --radius-sm: 13px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --focus: 0 0 0 3px rgba(240,172,40,.44);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 "Plus Jakarta Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h1, h2 { font-family: "Cormorant Garamond", Georgia, serif; letter-spacing: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.35rem); line-height: 1.1; margin-bottom: 8px; }
h2 { font-size: 1.45rem; line-height: 1.2; }
h3 { font-size: 1rem; line-height: 1.3; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; background: var(--paper); color: var(--pine-900); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.connection-banner { position: fixed; inset: 0 0 auto; z-index: 150; min-height: 42px; padding: 10px 18px; background: var(--danger); color: white; text-align: center; font-weight: 700; }
.connection-banner span:first-child { margin-right: 8px; }

.auth-view {
  min-height: 100vh;
  padding: max(28px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
  display: grid;
  place-content: center;
  gap: 28px;
  background: linear-gradient(135deg, #f1ede2 0%, #fbf8f1 56%, #f8eccb 100%);
}
.auth-brand, .rail-brand { display: flex; align-items: center; gap: 12px; color: var(--pine-950); }
.auth-brand { justify-self: center; }
.auth-brand strong, .rail-brand strong { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.28rem; line-height: 1.05; }
.auth-brand small, .rail-brand small { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 3px; }
.brand-glyph { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--paper); color: var(--amber-600); font: 700 1.8rem/1 Georgia, serif; box-shadow: 0 3px 12px rgba(20,16,8,.18); }
.brand-glyph.small { width: 38px; height: 38px; border-radius: 11px; font-size: 1.35rem; }
.auth-card { width: min(440px, calc(100vw - 40px)); padding: clamp(24px, 5vw, 38px); background: rgba(255,253,248,.97); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.auth-intro { margin-bottom: 26px; }
.auth-intro p:not(.eyebrow) { color: var(--muted); margin-bottom: 0; }
.eyebrow { margin-bottom: 7px; color: var(--amber-600); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.11em; text-transform: uppercase; }
label { display: block; margin: 18px 0 7px; font-weight: 700; font-size: 0.86rem; }
input, textarea, select { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--ink); background: #fff; border: 1px solid #ddd1ba; border-radius: var(--radius-sm); }
textarea { resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: var(--pine-700); }
input[aria-invalid="true"] { border-color: var(--danger); background: #fff8f7; }
.password-field { position: relative; }
.password-field input { padding-right: 65px; }
.field-action { position: absolute; right: 5px; top: 5px; min-width: 54px; min-height: 36px; border: 0; background: transparent; color: var(--pine-700); font-weight: 700; border-radius: 7px; }
.button { min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 800; cursor: pointer; transition: transform 150ms ease, background 150ms ease, border-color 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: 0.58; }
.button.primary { background: var(--pine-900); color: white; }
.button.primary:hover:not(:disabled) { background: var(--pine-800); }
.button.secondary { background: white; border-color: var(--line); color: var(--pine-900); }
.button.secondary:hover:not(:disabled) { border-color: var(--pine-700); }
.button.preview { margin-top: 16px; border: 1px dashed var(--amber-600); color: #86510e; background: #fff8e9; }
.button.full { width: 100%; margin-top: 22px; }
.text-button, .back-button { min-height: 44px; border: 0; padding: 10px 4px; background: transparent; color: var(--pine-700); font-weight: 700; cursor: pointer; }
.back-button { margin-bottom: 9px; }
.code-destination { padding: 12px 14px; background: var(--pine-50); border-radius: 10px; color: var(--pine-800); }
.code-input { text-align: center; font-size: 1.35rem; letter-spacing: 0.35em; font-weight: 700; }
.form-message { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-weight: 700; }
.auth-footnote { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.76rem; text-align: center; }
.walkthrough-link { min-height: 44px; margin-top: 5px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--pine-700); border-radius: 8px; font-size: .78rem; font-weight: 800; text-align: center; text-decoration: none; }
.walkthrough-link:hover { color: var(--pine-950); text-decoration: underline; text-underline-offset: 3px; }

.portal { min-height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.rail { position: sticky; top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px; padding: 20px 16px; display: flex; flex-direction: column; border-radius: var(--radius-lg); background: linear-gradient(180deg,#14161c 0%,#0e1013 100%); box-shadow: 0 20px 44px -28px rgba(20,16,8,.6); color: white; overflow: hidden auto; }
.rail-brand { color: white; padding: 0 8px 25px; }
.rail-brand small { color: var(--amber-500); font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.rail-nav { display: grid; gap: 4px; overflow-y: auto; }
.nav-button { width: 100%; min-height: 48px; padding: 10px 13px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 13px; background: transparent; color: #bdbec5; text-align: left; font-weight: 600; cursor: pointer; transition: background 150ms ease, color 150ms ease, transform 150ms ease; }
.nav-button:hover { background: rgba(255, 255, 255, 0.07); color: white; }
.nav-button.active { background: var(--amber-500); color: var(--ink); box-shadow: 0 12px 22px -12px rgba(240,172,40,.58); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.nav-icon svg, .icon-button svg, .shortcut-icon svg, .state-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { min-width: 20px; margin-left: auto; padding: 1px 6px; border-radius: 999px; background: var(--amber-500); color: var(--pine-950); text-align: center; font-size: 0.7rem; }
.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12); }
.demo-badge { display: inline-flex; margin: 0 8px 10px; padding: 4px 8px; border-radius: 4px; background: var(--amber-100); color: #6c430d; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.user-card { width: 100%; min-height: 58px; padding: 8px; display: flex; gap: 10px; align-items: center; border: 0; border-radius: 10px; background: transparent; color: white; text-align: left; cursor: pointer; }
.user-card:hover { background: rgba(255,255,255,.07); }
.user-card strong, .user-card small { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { color: #8a8d97; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--amber-500); color: var(--ink); font-weight: 800; }
.quiet-button { width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: transparent; color: #abc0b9; text-align: left; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.quiet-button:hover { color: white; background: rgba(255,255,255,.07); }

.portal-column { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; min-height: 86px; padding: 16px clamp(20px, 4vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(180deg,rgba(251,248,241,.96),rgba(251,248,241,.82)); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(233,224,207,.84); }
.topbar h1 { margin: 0; font-size: 1.75rem; }
.date-line { margin: 0 0 2px; color: var(--muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.topbar-tools { display: flex; gap: 9px; align-items: center; }
.icon-button { position: relative; width: 44px; min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.notice-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber-500); }
.staff-main { width: min(1280px, 100%); margin: 0 auto; padding: 28px clamp(20px, 4vw, 48px) 60px; }

.staff-home-intro { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.staff-home-intro h2 { margin: 0 0 4px; font-size: clamp(2.2rem, 4vw, 3.25rem); line-height: .98; }
.staff-home-intro p:last-child { margin: 0; color: var(--muted); }
.shift-card { min-height: 150px; margin-bottom: 18px; padding: clamp(24px, 4vw, 34px); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #fff; background: linear-gradient(145deg,#212126,#161619); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.shift-card h2 { margin: 0 0 5px; color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.shift-card p:not(.eyebrow) { margin: 0; color: #bdbec5; }
.shift-card .eyebrow { color: var(--amber-500); }
.shift-action { flex: 0 0 auto; min-width: 150px; min-height: 48px; color: var(--ink); background: var(--amber-500); border-radius: 999px; }
.staff-shortcuts { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.shortcut-card { min-width: 0; min-height: 118px; padding: 18px; display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 13px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); text-align: left; cursor: pointer; transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease; }
.shortcut-card:hover { transform: translateY(-2px); border-color: #ddd1ba; box-shadow: var(--shadow-lg); }
.shortcut-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--amber-600); background: var(--amber-100); border-radius: 13px; }
.shortcut-card strong, .shortcut-card small { display: block; overflow: hidden; text-overflow: ellipsis; }
.shortcut-card strong { font-size: 1rem; }
.shortcut-card small { margin-top: 4px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.shortcut-card b { color: var(--muted); font-size: 1.1rem; }
.schedule-card { padding: clamp(20px,3vw,28px); }
.schedule-card .card-head h2 { margin-bottom: 2px; font-size: 1.8rem; }
.empty-state.compact { min-height: 215px; box-shadow: none; border-style: dashed; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-intro h2 { font-size: clamp(1.55rem, 3vw, 2rem); margin-bottom: 5px; }
.page-intro p { margin-bottom: 0; color: var(--muted); }
.status-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.status-pill.success { color: var(--success); background: var(--success-soft); border-color: transparent; }
.status-pill.alert { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.status-pill.warning { color: #86510e; background: var(--amber-100); border-color: transparent; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.8fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.card { min-width: 0; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card.dark { background: var(--pine-900); color: white; border-color: transparent; }
.card.dark h2, .card.dark h3 { color: white; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.card-head h2, .card-head h3 { margin-bottom: 2px; }
.card-head p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.card.dark .card-head p { color: #bcd0c9; }
.next-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.next-action h2 { margin-bottom: 6px; font-size: 1.4rem; }
.next-action p { margin-bottom: 0; color: #c6d7d1; }
.next-action .button { flex: 0 0 auto; background: var(--amber-500); color: var(--pine-950); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric { padding: 15px; background: var(--pine-50); border-radius: 11px; }
.metric strong { display: block; font: 700 1.45rem/1.1 "Cormorant Garamond", Georgia, serif; color: var(--ink); }
.metric span { display: block; margin-top: 5px; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.schedule-list, .ticket-list, .checklist, .notice-list, .timeline { margin: 0; padding: 0; list-style: none; }
.schedule-item { display: grid; grid-template-columns: 74px 4px minmax(0, 1fr); gap: 13px; padding: 12px 0; border-top: 1px solid var(--line); }
.schedule-item:first-child { border-top: 0; padding-top: 0; }
.schedule-item time { font-weight: 800; color: var(--pine-900); }
.schedule-bar { border-radius: 99px; background: var(--amber-500); }
.schedule-item h3 { margin: 0 0 2px; }
.schedule-item p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.schedule-item button { justify-self: start; margin-top: 6px; }
.link-button { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--pine-700); font-weight: 800; cursor: pointer; }
.link-button:hover { color: var(--pine-950); text-decoration: underline; text-underline-offset: 3px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .search-input { min-width: min(260px, 100%); flex: 1; }
.segmented { display: inline-flex; min-height: 44px; padding: 3px; background: #e5e4dd; border-radius: 10px; }
.segmented button { min-height: 38px; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.segmented button.active { background: var(--paper); color: var(--pine-900); box-shadow: var(--shadow-sm); }
.ticket-list { display: grid; gap: 12px; }
.ticket-card { display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 17px; background: var(--paper); border: 1px solid rgba(23,56,47,.1); border-radius: 13px; box-shadow: var(--shadow-sm); }
.priority-bar { height: 100%; min-height: 78px; border-radius: 99px; background: var(--pine-100); }
.priority-bar.urgent { background: var(--danger); }
.priority-bar.high { background: var(--amber-500); }
.ticket-card h3 { margin: 0 0 4px; font-size: 1.04rem; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--muted); font-size: 0.78rem; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 18px; }
.ticket-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 0; }
.detail-grid div { padding: 13px; background: var(--pine-50); border-radius: 10px; }
.detail-grid dt { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.detail-grid dd { margin: 4px 0 0; font-weight: 700; }
.workflow { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.workflow .button.current { background: var(--amber-100); color: #6f460f; border-color: transparent; }
.note-form textarea { min-height: 96px; }
.dropzone { margin-top: 13px; padding: 22px 16px; display: grid; place-items: center; gap: 7px; border: 2px dashed #9eb2aa; border-radius: 12px; background: var(--pine-50); text-align: center; cursor: pointer; }
.dropzone.dragging { border-color: var(--amber-600); background: #fff7e8; }
.dropzone strong { color: var(--pine-900); }
.dropzone span { color: var(--muted); font-size: .78rem; }
.photo-preview { margin-top: 12px; display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.photo-preview img { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; }

.calendar-shell { overflow: hidden; }
.calendar-week { min-width: 700px; display: grid; grid-template-columns: 70px repeat(5, 1fr); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.calendar-scroll { overflow-x: auto; padding-bottom: 4px; }
.calendar-cell { min-height: 90px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-cell:nth-child(6n) { border-right: 0; }
.calendar-head { min-height: auto; color: var(--muted); font-size: .72rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-hour { color: var(--muted); font-size: .7rem; }
.calendar-event { display: block; width: 100%; padding: 8px; border: 0; border-left: 3px solid var(--amber-500); border-radius: 7px; background: var(--pine-50); color: var(--pine-900); text-align: left; font-size: .72rem; font-weight: 700; cursor: pointer; }
.agenda-list { display: grid; gap: 10px; }
.agenda-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 15px; align-items: center; padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }

.checklist { display: grid; gap: 10px; }
.check-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.check-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid #aab7b1; border-radius: 50%; color: white; font-weight: 800; }
.check-item.done .check-mark { border-color: var(--success); background: var(--success); }
.check-item h3 { margin: 0 0 2px; }
.check-item p { margin: 0; color: var(--muted); font-size: .78rem; }

.notice-list { display: grid; gap: 9px; }
.notice-item { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 13px; align-items: start; padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; }
.notice-item.unread { border-color: #e6bd77; }
.notice-marker { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--line); }
.notice-item.unread .notice-marker { background: var(--amber-500); }
.notice-item h3 { margin: 0 0 2px; }
.notice-item p { margin: 0; color: var(--muted); font-size: .8rem; }
.preference-list { display: grid; gap: 10px; }
.preference-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.preference-row:last-child { border-bottom: 0; }
.preference-row p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { display: block; width: 48px; height: 28px; border-radius: 99px; background: #b7bfbb; transition: background 150ms; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform 150ms; }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.switch input:disabled + span { opacity: .6; cursor: not-allowed; }

.empty-state, .error-state, .loading-state { min-height: 260px; padding: 40px 20px; display: grid; place-content: center; justify-items: center; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.state-icon { width: 54px; height: 54px; margin-bottom: 14px; display: grid; place-items: center; border-radius: 50%; background: var(--pine-50); color: var(--pine-700); font-size: 1.5rem; }
.error-state .state-icon { color: var(--danger); background: var(--danger-soft); }
.empty-state p, .error-state p { max-width: 440px; color: var(--muted); }
.skeleton { width: min(520px, 80vw); height: 14px; margin: 7px 0; border-radius: 7px; background: linear-gradient(90deg, #e2e3df 25%, #f2f3ef 45%, #e2e3df 65%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton.short { width: min(310px, 60vw); }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 15px; border-radius: 10px; background: var(--pine-950); color: white; box-shadow: var(--shadow-lg); font-weight: 700; }
.confirm-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgba(12,28,24,.48); }
.confirm-dialog form { padding: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.button-stack { display: grid; gap: 8px; }
.recovery-codes { margin-top: 14px; padding: 14px; border: 1px solid var(--gold-300); border-radius: 12px; background: var(--gold-50); }
.recovery-codes ol { margin: 10px 0; padding-left: 28px; columns: 2; }
.recovery-codes code { font-size: .82rem; }
.recovery-codes p { margin: 0; color: var(--muted); font-size: .78rem; }
.mobile-nav { display: none; }

@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; } }

@media (max-width: 960px) {
  .portal { grid-template-columns: 96px minmax(0, 1fr); }
  .rail { padding-inline: 10px; margin-left: 10px; }
  .rail-brand { justify-content: center; padding-inline: 0; }
  .rail-brand > span:last-child, .nav-button > span:not(.nav-icon):not(.nav-count), .rail-foot .user-card > span:not(.avatar), .quiet-button { display: none; }
  .nav-button { justify-content: center; padding-inline: 6px; }
  .nav-count { position: absolute; transform: translate(13px, -13px); }
  .user-card { justify-content: center; }
  .dashboard-grid, .ticket-layout { grid-template-columns: 1fr; }
  .staff-shortcuts { grid-template-columns: 1fr; }
  .shortcut-card { min-height: 92px; }
}

@media (max-width: 700px) {
  body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .portal { display: block; }
  .rail { display: none; }
  .topbar { min-height: 76px; padding: 12px 16px; }
  .date-line { font-size: .65rem; }
  .topbar h1 { font-size: 1.4rem; }
  .staff-main { padding: 22px 15px 40px; }
  .mobile-nav { position: fixed; z-index: 60; inset: auto 0 0; min-height: calc(74px + env(safe-area-inset-bottom)); padding: 8px 8px max(8px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: rgba(255,253,248,.98); border-top: 1px solid var(--line); box-shadow: 0 -12px 30px rgba(40,30,10,.09); backdrop-filter: blur(14px); }
  .mobile-nav .nav-button { min-height: 56px; padding: 5px 3px; display: grid; grid-template-rows: 24px auto; justify-items: center; align-content: center; gap: 3px; color: var(--muted); border-radius: 12px; font-size: .65rem; font-weight: 700; }
  .mobile-nav .nav-button.active { background: var(--amber-100); color: var(--ink); box-shadow: none; }
  .mobile-nav .nav-icon, .mobile-nav .nav-icon svg { width: 22px; height: 22px; }
  .mobile-nav .nav-button > span:nth-child(2) { display: block; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .page-intro h2 { font-size: 1.5rem; }
  .staff-home-intro { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .staff-home-intro h2 { font-size: 2.35rem; }
  .shift-card { min-height: 0; align-items: flex-start; flex-direction: column; }
  .shift-card .shift-action { width: 100%; }
  .staff-shortcuts { grid-template-columns: 1fr; gap: 10px; }
  .shortcut-card { min-height: 82px; padding: 14px; grid-template-columns: 42px minmax(0,1fr) auto; }
  .shortcut-icon { width: 42px; height: 42px; }
  .next-action { align-items: flex-start; flex-direction: column; }
  .next-action .button { width: 100%; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
  .metric { padding: 12px 9px; }
  .metric strong { font-size: 1.15rem; }
  .schedule-item { grid-template-columns: 64px 3px minmax(0, 1fr); gap: 10px; }
  .ticket-card { grid-template-columns: 4px minmax(0, 1fr); }
  .ticket-actions { grid-column: 2; justify-content: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
  .agenda-row { grid-template-columns: 75px 1fr; }
  .agenda-row > :last-child { grid-column: 2; justify-self: start; }
  .check-item { grid-template-columns: 32px minmax(0, 1fr); }
  .check-item > :last-child { grid-column: 2; justify-self: start; }
  .notice-item { grid-template-columns: 9px minmax(0,1fr); }
  .notice-item > :last-child { grid-column: 2; justify-self: start; }
  .toast-region { left: 15px; right: 15px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .recovery-codes ol { columns: 1; }
}

@media (max-width: 390px) {
  .topbar-tools { gap: 5px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { display: flex; align-items: center; justify-content: space-between; }
  .auth-card { width: calc(100vw - 24px); padding: 24px 18px; }
  .ticket-title-row { flex-direction: column; }
  .mobile-nav .nav-button { font-size: .6rem; }
}
