:root {
  --bg: #f4f6f8;
  --card: #fff;
  --ink: #17202b;
  --muted: #738091;
  --line: #e5e9ef;
  --navy: #17314f;
  --navy2: #244a72;
  --green: #dff3e5;
  --green-ink: #16633b;
  --yellow: #fff0bd;
  --yellow-ink: #7b5a00;
  --red: #f9dfdc;
  --red-ink: #a12a21;
  --bluebg: #edf3f8;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(24, 42, 63, .08);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.management-mode,
body.planning-mode,
body.viewer-mode { background: #e9edf2; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f0b540;
  outline-offset: 3px;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; z-index: 100; padding: 12px; border-radius: 10px; background: #fff; }

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 92px;
  background: var(--bg);
}

.app-shell--wide { max-width: 1500px; padding-bottom: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(225, 230, 237, .8);
  background: rgba(244, 246, 248, .94);
  backdrop-filter: blur(16px);
}

.toprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: grid; gap: 2px; color: var(--ink); }
.brand:hover { color: var(--navy); }
.brand-title { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}
.account { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.account form { margin: 0; }
.role-label { margin-top: 10px; }

.desktop-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.desktop-nav a {
  padding: 8px 11px;
  border-radius: 10px;
  color: #536276;
  font-size: 12px;
  font-weight: 750;
}
.desktop-nav a:hover { background: var(--bluebg); color: var(--navy); }
.employee-mode .desktop-nav { display: none; }

.content {
  min-height: calc(100vh - 120px);
  padding: 14px 14px 0;
}
.wide { max-width: none; }
.app-shell--wide .content { max-width: none; padding: 24px 28px 48px; }

h1, h2, h3, h4 { color: var(--ink); }
h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.14; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 16px; line-height: 1.25; letter-spacing: -.015em; }
h3 { margin: 0; font-size: 14px; }
h4 { margin: 0; font-size: 13px; }
p { margin: 7px 0; color: var(--muted); }
small { color: var(--muted); }

.pagehead,
.sectionhead,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pagehead { margin: 3px 2px 13px; }
.pagehead > div { min-width: 0; }
.pagehead > .button { flex: 0 0 auto; }
.sectionhead,
.section-title { margin: 18px 2px 9px; }
.sectionhead > h2,
.section-title > h2,
.section-title > h3 { margin: 0; }
.intro { margin: 0 2px 12px; font-size: 12px; line-height: 1.5; }

.card,
.duty-card,
.detail-sheet,
.admin-box,
.editor-day,
.plan-version {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card { margin-bottom: 10px; padding: 15px; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.hero {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--navy), var(--navy2));
  color: #fff;
  box-shadow: var(--shadow);
}
.hero .small { color: #d5e1ed; font-size: 11px; }
.hero h2 { margin: 4px 0 10px; color: #fff; font-size: 21px; }
.hero-duty {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}
.hero-duty strong { display: block; font-size: 16px; }
.hero-duty span { color: #dce6f0; font-size: 11px; }
.hero-duty .right { text-align: right; }

.pill,
.badge,
.chip,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.pill,
.badge { margin: 1px; padding: 5px 8px; font-size: 10px; }
.chip { margin: 1px; padding: 8px 10px; border: 1px solid var(--line); background: #fff; color: #3c4c5e; font-size: 11px; }
.tag { padding: 5px 7px; background: var(--bluebg); color: var(--navy); font-size: 10px; }
.green, .APPROVED { background: var(--green); color: var(--green-ink); }
.yellow, .PENDING { background: var(--yellow); color: var(--yellow-ink); }
.red, .REJECTED { background: var(--red); color: var(--red-ink); }
.blue { background: var(--bluebg); color: var(--navy); }
.closed, .CANCELLED, .DRAFT { background: #edf0f3; color: #657080; }

.cards2,
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.cards2 { margin-top: 10px; }
.stat { min-height: 134px; padding: 13px; }
.stat .label,
.metric span { color: var(--muted); font-size: 10px; font-weight: 750; }
.stat .value,
.metric strong { display: block; margin-top: 4px; color: var(--ink); font-size: 24px; font-weight: 850; letter-spacing: -.04em; }
.stat .sub,
.metric p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.progress,
.meter,
.staffbar { height: 6px; overflow: hidden; border-radius: 999px; background: #ecf0f3; }
.progress { margin-top: 9px; }
.progress span,
.meter i,
.staffbar span { display: block; height: 100%; border-radius: inherit; background: var(--navy2); }
.staffbar .g { background: #56a970; }
.staffbar .y { background: #ddb23e; }
.staffbar .r { background: #d95d55; }

.quick,
.admin-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.quick a,
.quick button,
.admin-actions a,
.admin-actions button {
  min-height: 74px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.quick .ico,
.admin-actions .ico { display: block; margin-bottom: 5px; font-size: 20px; line-height: 1; }
.admin-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-actions a { display: block; text-align: left; }

.list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.listrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--line); }
.listrow:last-child { border-bottom: 0; }
.listrow strong { display: block; color: var(--ink); font-size: 12px; }
.listrow small { display: block; margin-top: 2px; font-size: 10px; line-height: 1.35; }

.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 13px;
  border: 0;
  border-radius: 13px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.button:hover,
.btn:hover { background: #102946; }
.button.secondary,
.btn.light { background: #edf1f5; color: #32465b; }
.button.secondary:hover,
.btn.light:hover { background: #dfe7ee; }
.btn.full { width: 100%; margin-top: 13px; }
.quiet { border: 0; background: transparent; color: var(--navy2); font-size: 11px; font-weight: 750; text-decoration: none; }
.quiet:hover { color: var(--navy); text-decoration: underline; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0; }
.toolbar form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.notice,
.info-strip {
  margin: 10px 0;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--bluebg);
  color: #30475f;
  font-size: 11px;
  line-height: 1.4;
}
.notice { border: 1px solid #dbe5ef; }
.notice p { color: #30475f; }
.message { margin: 0 0 10px; padding: 11px 12px; border-radius: 13px; background: var(--green); color: var(--green-ink); font-size: 12px; }
.message.error { background: var(--red); color: var(--red-ink); }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); }

.form { max-width: 100%; }
.form-card { padding: 15px; }
.form p { margin: 0 0 13px; }
.form label,
.form-card label { display: block; margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.form input:not([type=checkbox]):not([type=hidden]),
.form select,
.form textarea,
.form-card input,
.form-card select,
.form-card textarea,
input[type=date],
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid #dce2e8;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}
.form select[multiple] { min-height: 150px; }
.form textarea,
.form-card textarea { min-height: 94px; resize: vertical; }
.form input[type=checkbox] { width: auto; margin-right: 6px; accent-color: var(--navy); }
.form .helptext { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.errorlist { margin: 0 0 8px; padding: 9px 12px; border-radius: 10px; background: var(--red); color: var(--red-ink); font-size: 11px; }
.form > .button + .button { margin-top: 8px; }

.mobile-home .pagehead { display: none; }
.mobile-home .hero { margin-top: 0; }
.home-change { margin-top: 10px; }

.calendar-page .pagehead { align-items: center; }
.calendar-page .pagehead h1 { font-size: 17px; }
.calendar { max-width: none; padding: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; color: var(--muted); font-size: 10px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekdays { padding-bottom: 2px; color: #8a94a1; font-size: 9px; font-weight: 800; text-align: center; }
.weekdays b { font-weight: 800; }
.day {
  position: relative;
  display: flex;
  min-width: 0;
  height: 55px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e4e8ee;
  border-radius: 9px;
  background: #fff;
  text-align: center;
}
.day.outside { opacity: .32; }
.day strong { position: absolute; z-index: 4; top: 3px; left: 4px; padding: 1px 3px; border-radius: 4px; background: rgba(255, 255, 255, .78); color: var(--ink); font-size: 9px; }
.day .half { min-height: 0; flex: 1; border-top: 1px solid rgba(255,255,255,.9); color: transparent; font-size: 0; }
.day .half:first-of-type { border-top: 0; }
.day .half.green { background: var(--green); }
.day .half.yellow { background: var(--yellow); }
.day .half.red { background: var(--red); }
.day .half.closed { background: #edf0f3; }
.day.today { outline: 2px solid var(--navy); outline-offset: 1px; }
.leave-line { position: absolute; z-index: 6; top: 50%; right: 2px; left: 2px; height: 4px; transform: translateY(-50%); border-radius: 99px; background: var(--navy); }
.leave-line.PENDING { opacity: .35; }
.calendar-detail { margin-top: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-cell { padding: 9px; border-radius: 11px; background: #f7f9fb; }
.detail-cell b { display: block; font-size: 10px; }
.detail-cell span { color: var(--muted); font-size: 10px; line-height: 1.3; }

.service-list { display: grid; gap: 9px; }
.duty-card { padding: 13px; }
.duty-card .date { margin-bottom: 8px; color: var(--ink); font-size: 12px; font-weight: 850; }
.duty-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 12px; }
.duty-line:first-of-type { border-top: 0; }
.duty-line span { color: var(--muted); }
.duty-line strong { text-align: right; }
.duty-line small { display: block; font-size: 10px; }

.timeline { position: relative; padding-left: 19px; }
.timeline::before { position: absolute; top: 6px; bottom: 9px; left: 5px; width: 2px; background: #dfe5eb; content: ""; }
.event { position: relative; padding: 0 0 15px 5px; }
.event::before { position: absolute; top: 4px; left: -18px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); content: ""; }
.event.pending::before { background: #d59b19; }
.event.approved::before { background: #3b9662; }
.event.rejected::before { background: #d95d55; }
.event.draft::before { background: #8b96a3; }
.event strong { display: block; color: var(--ink); font-size: 12px; }
.event small { display: block; margin-top: 2px; font-size: 10px; line-height: 1.4; }
.event .event-actions { margin-top: 6px; }

.profile-grid { display: grid; gap: 0; }
.data-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: 0; }
.data-row .k { color: var(--muted); font-size: 11px; font-weight: 700; }
.data-row .v { color: var(--ink); font-size: 12px; font-weight: 750; text-align: right; }
.tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.plan-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 11px 12px; border-radius: 14px; background: var(--bluebg); }
.plan-header strong { display: block; font-size: 12px; }
.plan-header small { display: block; margin-top: 2px; font-size: 10px; }
.week-plan { overflow: hidden; margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; }
.plan-row { display: grid; grid-template-columns: 70px 1fr; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-row > div { padding: 10px; }
.plan-row .dayname { background: #f7f9fb; color: var(--ink); font-size: 11px; font-weight: 800; }
.plan-row .times { color: #415064; font-size: 11px; line-height: 1.45; }
.locknote { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.plan-version { margin-top: 9px; padding: 12px; }
.plan-version.current { border-color: #b9d4c2; background: #f7fcf9; }
.plan-version .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-version strong { font-size: 12px; }
.plan-version small { display: block; margin-top: 3px; font-size: 10px; }

.admin-home .pagehead { display: none; }
.admin-home .hero { margin-top: 0; }
.admin-grid { margin-top: 10px; }
.admin-box { min-height: 100px; padding: 12px; box-shadow: none; }
.admin-box .big { margin-top: 4px; color: var(--ink); font-size: 22px; font-weight: 850; }
.admin-box small { font-size: 10px; }
.admin-box .staffbar { margin-top: 8px; }

.request-row { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; padding: 12px; }
.request-row > div:nth-child(2) { flex: 1; }
.request-row h3 { font-size: 12px; }
.request-row p { margin: 2px 0 0; font-size: 10px; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.team-grid .card { margin-bottom: 0; padding: 13px; }
.team-grid .avatar { margin-bottom: 9px; }
.team-grid h2 { font-size: 14px; }
.team-grid p { font-size: 10px; }
.actions { display: grid; gap: 6px; margin-top: 12px; color: var(--navy2); font-size: 11px; font-weight: 750; }
.actions form { margin: 0; }

.staffing-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0; padding: 14px; border-radius: var(--radius); }
.staffing-banner > strong { font-size: 14px; }
.staffing-banner > div { display: flex; flex-wrap: wrap; gap: 9px; }
.staffing-banner span { font-size: 10px; }
.staffing-banner b { display: block; font-size: 17px; }
.board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.board-grid .card { margin-bottom: 0; padding: 13px; }
.board-grid h2 { margin-top: 3px; font-size: 14px; }
.board-grid p { margin: 4px 0; font-size: 11px; }
.board-grid .provider { color: var(--navy2); font-size: 12px; font-weight: 750; }
.week-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.week-strip .card { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 7px; font-size: 9px; }
.week-strip .badge { justify-content: center; margin: 0; padding: 4px 2px; font-size: 8px; }

.table-wrap { overflow: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #edf3f8; color: #4d5c6d; font-size: 10px; }
.plan-table { min-width: 820px; }
.plan-table td { min-width: 128px; }
.plan-table th:first-child { min-width: 140px; }
.plan-table hr { border: 0; border-top: 1px solid var(--line); }

.planning-pagehead { align-items: flex-end; }
.week-navigation { display: flex; align-items: center; gap: 6px; }
.planning-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.staffing-legend { display: flex; flex-wrap: wrap; gap: 13px; color: #536276; font-size: 11px; font-weight: 750; }
.staffing-legend strong { color: var(--navy); font-size: 10px; text-transform: uppercase; }
.staffing-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.green { background: #3b9662; }
.legend-dot.yellow { background: #d59b19; }
.legend-dot.red { background: #d95d55; }
.legend-dot.over { background: #efd98b; }

.weekly-planner-wrap {
  overflow: auto;
  border: 1px solid #dbe2ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.weekly-planner {
  display: grid;
  min-width: 1180px;
  grid-template-columns: 126px repeat(5, minmax(205px, 1fr));
  background: #dfe5ec;
  gap: 1px;
}
.planner-corner,
.planner-dayhead,
.planner-period-label,
.planner-service-spacer,
.planner-lab-label { background: #f5f7fa; }
.planner-corner,
.planner-dayhead {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 62px;
  padding: 11px 13px;
}
.planner-corner { left: 0; display: flex; align-items: flex-end; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.planner-dayhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; background: #fff; }
.planner-dayhead strong { color: var(--navy); font-size: 18px; }
.planner-dayhead span { color: var(--muted); font-size: 11px; font-weight: 750; }
.planner-dayhead.is-today { box-shadow: inset 0 4px 0 #f0b540; }

.planner-period-label,
.planner-lab-label {
  position: sticky;
  z-index: 3;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
  padding: 15px 13px;
  color: var(--navy);
}
.planner-period-label strong,
.planner-lab-label strong { font-size: 13px; }
.planner-period-label span,
.planner-lab-label span { color: var(--muted); font-size: 9px; font-weight: 700; }
.planner-service-spacer { position: sticky; z-index: 3; left: 0; min-height: 54px; }

.planner-duty {
  display: grid;
  min-height: 54px;
  grid-template-columns: 55px 1fr;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  background: #edf3f8;
}
.planner-duty .duty-period { color: #647386; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.planner-duty a { display: grid; min-width: 0; padding: 5px 7px; border-radius: 8px; color: var(--navy); font-size: 10px; }
.planner-duty a:hover { background: #fff; }
.planner-duty strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.planner-duty small { color: var(--muted); font-size: 8px; }
.planner-duty.is-filled { background: #e7f0f7; }
.planner-duty.is-disabled { display: flex; color: #98a2ae; font-size: 9px; font-weight: 700; }

.week-work-block {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  padding: 9px;
  background: #fff;
}
.week-work-block.status-green { background: #eef9f2; box-shadow: inset 0 4px 0 #3b9662; }
.week-work-block.status-yellow { background: #fff8df; box-shadow: inset 0 4px 0 #d59b19; }
.week-work-block.status-red { background: #fdf0ee; box-shadow: inset 0 4px 0 #d95d55; }
.week-work-block.status-closed,
.week-work-block.is-closed { background: #f3f5f7; color: #929ca8; box-shadow: inset 0 4px 0 #aab3bd; }
.week-work-block.is-closed { align-items: center; justify-content: center; font-size: 10px; font-weight: 750; }
.work-block-status { display: flex; justify-content: space-between; gap: 8px; padding: 2px 3px 8px; color: #637184; font-size: 9px; font-weight: 750; }
.work-block-status .status-word { color: var(--ink); font-weight: 850; }
.planner-area-groups { display: grid; align-content: start; gap: 5px; }
.planner-area {
  overflow: hidden;
  border: 1px solid rgba(199, 209, 220, .78);
  border-radius: 9px;
  background: rgba(255, 255, 255, .82);
}
.planner-area summary {
  display: grid;
  min-height: 31px;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 6px 7px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.planner-area summary::-webkit-details-marker { display: none; }
.planner-area summary:hover { filter: brightness(.985); }
.planner-area summary strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.planner-area .area-chevron { color: currentColor; font-size: 16px; font-weight: 900; line-height: .8; transition: transform .14s ease; }
.planner-area[open] .area-chevron { transform: rotate(90deg); }
.planner-area .area-count {
  min-width: 36px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}
.planner-area.status-green summary { background: #eef9f2; color: #22653f; box-shadow: inset 3px 0 0 #3b9662; }
.planner-area.status-yellow summary { background: #fff8df; color: #76530a; box-shadow: inset 3px 0 0 #d59b19; }
.planner-area.status-red summary { background: #fdf0ee; color: #8f312b; box-shadow: inset 3px 0 0 #d95d55; }
.planner-area.status-over summary { background: #fffdf3; color: #725d25; box-shadow: inset 3px 0 0 #efd98b; }
.planner-area.status-neutral summary { background: #edf1f5; color: #697789; }
.planner-area .planner-people { display: grid; align-content: start; gap: 4px; padding: 5px; border-top: 1px solid rgba(199, 209, 220, .62); }
.planner-person {
  display: grid;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(199, 209, 220, .72);
  border-radius: 9px;
  background: rgba(255, 255, 255, .8);
}
.planner-person:hover { border-color: #8da8c1; background: #fff; box-shadow: 0 3px 10px rgba(23, 49, 79, .08); }
.planner-person strong { overflow: hidden; color: var(--ink); font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.planner-person small { overflow: hidden; color: #4f6174; font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.planner-person .person-time { color: #8894a2; font-size: 8px; }
.planner-add { margin-top: 7px; padding: 6px; border: 1px dashed #aab8c7; border-radius: 8px; color: var(--navy2); font-size: 9px; font-weight: 800; text-align: center; }
.planner-add:hover { background: rgba(255, 255, 255, .72); }
.work-block-reason { margin: auto 2px 0; padding-top: 8px; color: #6d5632; font-size: 8px; line-height: 1.35; }
.status-red .work-block-reason { color: var(--red-ink); }
.planner-empty { display: block; padding: 9px 5px; color: #8b96a3; font-size: 9px; font-style: italic; }

.planner-lab-label { min-height: 170px; background: var(--navy); color: #fff; }
.planner-lab-label span { color: #c8d6e4; }
.planner-lab-cell { min-height: 170px; padding: 9px; background: #f1f5f8; }
.lab-entry { display: grid; grid-template-columns: 27px 1fr; gap: 7px; margin-bottom: 4px; padding: 6px; border-radius: 8px; background: #fff; }
.lab-entry:hover { box-shadow: 0 3px 10px rgba(23, 49, 79, .08); }
.lab-entry .block-code { display: grid; place-items: center; border-radius: 6px; background: var(--bluebg); color: var(--navy2); font-size: 8px; font-weight: 900; }
.lab-entry strong,
.lab-entry small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-entry strong { font-size: 10px; }
.lab-entry small { color: var(--muted); font-size: 8px; }
.planning-help { margin: 10px 2px 0; color: var(--muted); font-size: 10px; }

.plan-block,
.editor-day {
  margin-top: 9px;
  padding: 11px;
}
.plan-block { display: grid; gap: 8px; }
.plan-block h3 { font-size: 12px; }
fieldset { margin: 10px 0; padding: 11px; border: 1px dashed #d8dee6; border-radius: 12px; background: #f8fafc; }
legend { padding: 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
fieldset label { display: inline-flex; align-items: center; margin: 3px 8px 3px 0; color: #475465; font-size: 10px; font-weight: 750; }

dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
details summary { cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 750; }
details p { font-size: 11px; }
pre { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 11px; }

.login-layout { display: grid; gap: 18px; padding-top: 10px; }
.login-layout h1 { font-size: 30px; }
.login-art { display: none; }
.login-form { padding: 18px; }
.login-form .button { width: 100%; }

footer { display: none; }
.bottomnav {
  position: fixed;
  z-index: 50;
  bottom: 0;
  left: 50%;
  display: grid;
  width: 100%;
  max-width: 430px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(18px);
}
.bottomnav a { padding: 6px 2px 3px; color: #87919d; font-size: 9px; font-weight: 750; text-align: center; }
.bottomnav .bi { display: block; margin-bottom: 3px; font-size: 18px; line-height: 1.1; }
.bottomnav a.active { color: var(--navy); }
.fab {
  position: fixed;
  z-index: 45;
  right: max(18px, calc((100vw - 430px) / 2 + 18px));
  bottom: 86px;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 28px rgba(23, 49, 79, .28);
  font-size: 28px;
}

@media (min-width: 700px) {
  .app-shell { box-shadow: 0 0 40px rgba(23, 49, 79, .12); }
  .app-shell--wide { box-shadow: none; }
  .app-shell--wide .topbar { padding-right: 28px; padding-left: 28px; }
  .app-shell--wide .desktop-nav { padding-right: 28px; padding-left: 28px; }
  .app-shell--wide footer { display: flex; justify-content: space-between; padding: 20px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
  .app-shell--wide h1 { font-size: 32px; }
  .app-shell--wide .pagehead { margin: 4px 0 20px; }
  .app-shell--wide .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .app-shell--wide .board-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .app-shell--wide .staffing-banner { padding: 18px 20px; }
  .app-shell--wide .card { padding: 18px; }
  .app-shell--wide .form { max-width: 760px; }
}

@media (min-width: 1200px) {
  .app-shell--wide .board-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .app-shell--wide .board-grid .card { padding: 13px; }
  .app-shell--wide .board-grid h2 { font-size: 15px; }
  .app-shell--wide .board-grid .provider { font-size: 12px; }
  .app-shell--wide .board-grid .eyebrow { font-size: 9px; }
}

@media (max-width: 340px) {
  .brand-title { font-size: 20px; }
  .bottomnav a { font-size: 8px; }
  .bottomnav .bi { font-size: 16px; }
}

@media (max-width: 699px) {
  .planning-pagehead,
  .planning-actions { align-items: flex-start; flex-direction: column; }
  .planning-actions .toolbar { margin: 0; }
  .weekly-planner { min-width: 1120px; grid-template-columns: 104px repeat(5, minmax(202px, 1fr)); }
  .planner-period-label,
  .planner-lab-label { padding: 13px 9px; }
}
