:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --bg: #f6f7f9; --surface: #fff; --surface-soft: #eef1f5; --ink: #1d2430; --muted: #747d8c; --line: #e4e7ec;
  --accent: #2f63ed; --accent-dark: #214dc5; --danger: #d84a43; --danger-soft: #fff0ee; --warning: #a96609;
  --warning-soft: #fff6e6; --success: #27835b; --success-soft: #edf8f1; --shadow: 0 16px 44px rgba(24,33,48,.08);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { min-height: 44px; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47,99,237,.26); outline-offset: 2px; }
[hidden] { display: none !important; }
.app-shell { width: min(100%, 520px); min-height: 100svh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 18px calc(104px + env(safe-area-inset-bottom)); }
.boot-screen { display: flex; min-height: 74vh; align-items: center; justify-content: center; gap: 14px; }
.boot-screen div:last-child { display: grid; gap: 3px; }
.boot-screen span { color: var(--muted); font-size: 14px; }
.brand-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 15px; color: #fff; background: var(--accent); font-size: 21px; font-weight: 850; box-shadow: 0 12px 26px rgba(47,99,237,.24); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.topbar h1 { margin: 2px 0 4px; font-size: 29px; line-height: 1.08; letter-spacing: -.035em; }
.topbar p { margin: 0; color: var(--muted); font-size: 15px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.role-button { display: inline-flex; width: auto; min-height: 42px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); font-size: 13px; font-weight: 750; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 15px; background: #e9edf3; }
.segmented button { min-height: 44px; border: 0; border-radius: 12px; color: #596273; background: transparent; font-weight: 720; }
.segmented button.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 10px rgba(30,38,52,.07); }
.segmented em { margin-left: 5px; color: var(--danger); font-style: normal; }
.point-list { overflow: hidden; margin-top: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.point-row { position: relative; border-bottom: 1px solid var(--line); }
.point-row:last-child { border-bottom: 0; }
.point-row.is-problem::before { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--danger); content: ""; }
.point-summary { display: grid; grid-template-columns: minmax(0,1fr) auto 24px; gap: 12px; width: 100%; min-height: 78px; align-items: center; padding: 15px 16px 15px 18px; border: 0; color: inherit; text-align: left; background: transparent; }
.point-copy { min-width: 0; }
.point-copy strong { display: block; overflow: hidden; margin-bottom: 5px; font-size: 17px; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.point-copy span { display: block; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; min-height: 30px; align-items: center; padding: 0 10px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 12px; font-weight: 760; white-space: nowrap; }
.status-pill.danger { color: var(--danger); background: var(--danger-soft); }
.status-pill.warning { color: var(--warning); background: var(--warning-soft); }
.chevron { color: #87909e; transition: transform .2s ease; }
.point-row.is-open .chevron { transform: rotate(180deg); }
.point-detail { display: none; padding: 0 16px 17px 18px; }
.point-row.is-open .point-detail { display: block; }
.alert-box { display: flex; gap: 11px; margin-bottom: 14px; padding: 13px; border-radius: 14px; color: #74342f; background: var(--danger-soft); font-size: 13px; line-height: 1.45; }
.alert-box [data-lucide] { flex: 0 0 auto; color: var(--danger); }
.action-stack { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr); gap: 9px; }
.action-stack .primary { padding-inline: 10px; font-size: 13px; white-space: nowrap; }
.primary, .secondary, .danger-button { min-height: 48px; padding: 0 15px; border-radius: 14px; font-weight: 780; }
.primary { border: 1px solid var(--accent); color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { border: 1px solid #ccd2dc; color: var(--ink); background: var(--surface); }
.danger-button { border: 1px solid #f1c2bd; color: var(--danger); background: var(--danger-soft); }
.primary:disabled, .secondary:disabled { cursor: not-allowed; opacity: .5; }
.panel { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 9px 28px rgba(24,33,48,.055); }
.panel h2, .panel h3 { margin: 0; letter-spacing: -.02em; }
.panel h2 { font-size: 21px; }
.panel h3 { font-size: 17px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.metric { padding: 13px 11px; border-radius: 14px; background: var(--surface-soft); }
.metric span { display: block; min-height: 30px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.metric strong { display: block; margin-top: 6px; font-size: 22px; letter-spacing: -.03em; }
.decision-list { display: grid; gap: 9px; }
.decision { display: grid; grid-template-columns: 1fr auto; gap: 10px; width: 100%; align-items: center; min-height: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-align: left; background: var(--surface); }
.decision:not(article) { cursor: pointer; }
.decision:not(article):active { background: #f7f9fc; }
.decision b { display: block; margin-bottom: 4px; font-size: 14px; }
.decision span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.decision button { width: 44px; min-height: 44px; border: 0; border-radius: 13px; color: var(--accent); background: #eef3ff; }
.task-arrow { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; color: var(--accent); background: #eef3ff; }
.shift-hero { overflow: hidden; padding: 19px; border-radius: 22px; color: #fff; background: linear-gradient(145deg,#315fe0,#2449ae); box-shadow: 0 18px 42px rgba(36,73,174,.24); }
.shift-hero .eyebrow { color: #cbd8ff; }
.shift-hero h2 { margin: 8px 0 5px; font-size: 25px; letter-spacing: -.035em; }
.shift-hero p { margin: 0 0 18px; color: #dce5ff; font-size: 14px; }
.shift-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 17px; }
.shift-meta span { padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.13); font-size: 12px; }
.photo-field { display: block; padding: 13px; border: 1px dashed rgba(255,255,255,.48); border-radius: 14px; text-align: center; cursor: pointer; }
.photo-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.shift-hero .primary { width: 100%; margin-top: 10px; border-color: #fff; color: #2146a3; background: #fff; }
.location-help { display: grid; gap: 7px; margin-top: 12px; padding: 12px; border-radius: 14px; background: rgba(15,33,83,.27); font-size: 12px; line-height: 1.35; }.location-help span { color: #e1e9ff; }.location-help .secondary { min-height: 42px; border: 0; color: #2146a3; background: #fff; }
.schedule-list { display: grid; gap: 8px; }
.schedule-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.schedule-item:last-child { border-bottom: 0; }
.schedule-date { display: grid; min-height: 50px; place-items: center; border-radius: 13px; background: var(--surface-soft); font-size: 12px; font-weight: 800; }
.schedule-item b { display: block; font-size: 14px; }
.schedule-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.calendar-weekdays, .manager-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-weekdays { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 750; text-align: center; }
.manager-calendar { overflow: hidden; }
.calendar-blank { min-height: 57px; }
.calendar-day { position: relative; display: grid; min-height: 57px; align-content: center; justify-items: center; gap: 2px; padding: 5px 1px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); }
.calendar-day b { font-size: 14px; }.calendar-day span { color: var(--muted); font-size: 9px; font-weight: 700; }.calendar-day em { position: absolute; top: 3px; right: 4px; color: var(--accent); font-size: 9px; font-style: normal; font-weight: 850; }.calendar-day.is-today { border-color: var(--accent); background: #eff4ff; }.calendar-day.has-issue { border-color: #f0c5bf; background: var(--danger-soft); }
.auth-page { display: grid; min-height: calc(100svh - 130px); align-content: center; }
.auth-page .brand-mark { margin-bottom: 24px; }
.auth-page h1 { max-width: 320px; margin: 0; font-size: 36px; line-height: 1.03; letter-spacing: -.045em; }
.auth-page > p { max-width: 340px; margin: 14px 0 27px; color: var(--muted); line-height: 1.5; }
.auth-card { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 7px; font-size: 18px; }
.auth-card p { margin: 0 0 15px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.text-button { width: fit-content; padding: 10px 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.field { display: grid; gap: 7px; margin: 12px 0; color: #565f6e; font-size: 12px; font-weight: 720; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #cfd5df; border-radius: 13px; color: var(--ink); background: #fff; }
.empty-state { display: grid; justify-items: start; gap: 10px; padding: 24px 0; }
.empty-state h2 { margin: 0; font-size: 23px; }
.empty-state p { max-width: 330px; margin: 0; color: var(--muted); line-height: 1.5; }
.state-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 16px; color: var(--accent); background: #eaf0ff; }
.bottom-nav { position: fixed; z-index: 8; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(var(--nav-count, 4),1fr); width: min(100%,520px); margin: auto; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); }
.bottom-nav button { display: grid; min-height: 54px; place-items: center; align-content: center; gap: 4px; border: 0; border-radius: 13px; color: #858d9a; background: transparent; font-size: 10px; font-weight: 720; }
.bottom-nav button.is-active { color: var(--accent); background: #f0f4ff; }
.bottom-nav svg { width: 20px; height: 20px; }
.system-banner { position: sticky; z-index: 20; top: 0; padding: max(9px,env(safe-area-inset-top)) 14px 9px; color: #67460c; text-align: center; background: #fff0c9; font-size: 12px; }
.toast { position: fixed; z-index: 30; right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); left: 18px; max-width: 484px; margin: auto; padding: 13px 15px; border-radius: 14px; color: #fff; background: #222b38; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #873b36; }
.bottom-sheet { width: min(calc(100% - 18px),502px); max-height: 78svh; margin: auto auto 9px; padding: 20px; border: 0; border-radius: 24px; color: var(--ink); background: var(--surface); }
.bottom-sheet::backdrop { background: rgba(22,27,36,.38); backdrop-filter: blur(3px); }
.bottom-sheet h2 { margin: 0 0 7px; font-size: 22px; }
.bottom-sheet p { margin: 0 0 15px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.sheet-actions { display: grid; gap: 9px; }
.today-screen .topbar { margin-bottom: 28px; }
.today-screen .topbar h1 { font-size: 36px; }
.attention-card, .help-card { display: grid; width: 100%; border: 0; color: inherit; text-align: left; }
.attention-card { grid-template-columns: 54px minmax(0,1fr) 24px; gap: 14px; align-items: center; min-height: 132px; padding: 22px 18px; border-radius: 22px; background: #fff0ee; }
.attention-card > svg, .help-card > svg:last-child { width: 22px; color: #6f7783; }
.attention-icon { display: grid; width: 50px; height: 50px; place-items: center; border: 3px solid #d84940; border-radius: 50%; color: #d84940; }
.attention-icon svg { width: 26px; height: 26px; }
.attention-card b, .attention-card strong, .attention-card small { display: block; }
.attention-card b { margin-bottom: 7px; color: #d84940; font-size: 14px; font-weight: 680; }
.attention-card strong { margin-bottom: 5px; font-size: 23px; line-height: 1.15; letter-spacing: -.025em; }
.attention-card small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.today-section { margin-top: 28px; }
.today-section > h2 { margin: 0 0 10px; color: #596171; font-size: 20px; letter-spacing: -.02em; }
.today-section > h2 em { margin-left: 7px; color: var(--danger); font-style: normal; }
.today-section > h2 span { display: inline-grid; min-width: 30px; min-height: 30px; margin-left: 7px; place-items: center; border-radius: 50%; color: #5d6470; background: #e9ecf1; font-size: 14px; }
.today-section .point-list { margin-top: 0; border-radius: 22px; }
.empty-list-note { padding: 18px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); background: var(--surface); font-size: 13px; line-height: 1.45; }
.problem-list .point-row.is-problem::before { width: 5px; }
.problem-list .point-summary { min-height: 92px; }
.problem-list .point-copy strong { font-size: 20px; }
.problem-list .point-detail { padding-left: 20px; }
.all-points .point-summary { min-height: 82px; }
.all-points .point-copy strong { font-size: 18px; }
.point-row .chevron { transform: none; }
.point-row.is-open .chevron { transform: rotate(90deg); }
.help-card { grid-template-columns: 34px minmax(0,1fr) 22px; gap: 12px; align-items: center; margin-top: 24px; padding: 16px; border-radius: 18px; color: var(--accent); background: #eef4ff; }
.help-card > svg:first-child { width: 26px; height: 26px; }
.help-card b, .help-card small { display: block; }
.help-card b { margin-bottom: 3px; font-size: 15px; }
.help-card small { color: #66748a; font-size: 12px; }
body:has(.today-screen) .bottom-nav { position: static; width: 100%; margin-top: 20px; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.calm-card { display: flex; align-items: center; gap: 13px; padding: 20px; border-radius: 20px; color: var(--success); background: var(--success-soft); }
.calm-card svg { width: 30px; height: 30px; }
.calm-card strong, .calm-card span { display: block; }.calm-card span { margin-top: 3px; color: #5f756b; font-size: 13px; }
.support-link { display: grid; place-items: center; text-decoration: none; }

.onboarding { display: flex; min-height: calc(100svh - 126px); flex-direction: column; }
.story-progress { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; margin-bottom: 24px; }
.story-progress span { height: 4px; border-radius: 99px; background: #dfe3ea; }
.story-progress span.is-done { background: var(--accent); }
.onboarding-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 850; letter-spacing: .08em; }
.onboarding-brand .brand-mark { width: 36px; height: 36px; border-radius: 12px; font-size: 16px; }
.story-copy { margin-top: clamp(42px, 10vh, 88px); }
.story-copy h1 { max-width: 390px; margin: 9px 0 12px; font-size: clamp(34px, 9vw, 47px); line-height: .98; letter-spacing: -.052em; }
.story-copy p { max-width: 390px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.story-form { display: grid; gap: 8px; margin-top: 28px; }
.story-form .field { margin: 3px 0; }
.story-form .field input, .story-form .field select { min-height: 54px; border-radius: 15px; font-size: 16px; }
.story-form > .primary, .story-complete { width: 100%; min-height: 56px; margin-top: 8px; border-radius: 16px; }
.story-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.story-share { width: 100%; margin-top: 12px; }
.onboarding-save { margin: auto 0 0; padding-top: 24px; color: var(--muted); text-align: center; font-size: 12px; }
.readiness-list { display: grid; gap: 10px; margin-top: 28px; }
.readiness-row { display: flex; min-height: 58px; align-items: center; gap: 12px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); font-weight: 700; }
.readiness-row svg { color: var(--muted); }.readiness-row.is-ready svg { color: var(--success); }

@media (max-width: 440px) {
  .today-screen .topbar { gap: 8px; }
  .today-screen .topbar h1 { font-size: 34px; }
  .today-screen .role-button { padding-inline: 10px; font-size: 12px; }
}

@media (min-width: 700px) {
  .app-shell { padding-top: 34px; }
  .bottom-nav { bottom: 16px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
}
@media (min-width: 900px) {
  .app-shell { width: min(calc(100% - 260px), 1120px); min-height: 100vh; margin: 0 32px 0 228px; padding: 48px 36px 80px; }
  .app-shell:has(.auth-page), .app-shell:has(.onboarding) { width: min(100% - 48px, 600px); margin: 0 auto; padding-inline: 24px; }
  .topbar { align-items: center; margin-bottom: 30px; }
  .topbar h1 { font-size: 38px; }
  .bottom-nav { top: 32px; right: auto; bottom: auto; left: 24px; grid-template-columns: 1fr; width: 180px; padding: 10px; border-radius: 22px; }
  body:has(.today-screen) .bottom-nav { position: fixed; width: 180px; margin-top: 0; }
  .bottom-nav button { grid-template-columns: 28px 1fr; justify-items: start; padding: 0 14px; font-size: 13px; }
  .bottom-nav button span { text-align: left; }
  .panel { padding: 24px; }
  .metric-grid { gap: 14px; }.metric { padding: 18px; }.metric strong { font-size: 30px; }
  .today-screen { max-width: 880px; }
  .today-screen .topbar h1 { font-size: 42px; }
  .attention-card { min-height: 150px; padding: 26px; }
  .all-points .point-summary { min-height: 92px; }
  .admin-logout { position: absolute; top: 54px; right: 40px; }
}
