:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #203548;
  background: #f3f6f9;
  --ink: #172e42;
  --muted: #586d7e;
  --border: #dce4eb;
  --accent: #116d72;
  --accent-dark: #0d5559;
  --accent-soft: #eaf5f3;
  --cream: #eaf5f3;
  --surface: #fff;
  --danger: #9c3d36;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
a { color: #17626d; text-underline-offset: 3px; }
a:hover { color: #0c4751; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #4c9da7;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.045em; font-weight: 700; }
h2 { font-size: 1.125rem; line-height: 1.4; letter-spacing: -.02em; font-weight: 650; }
h3 { font-size: 1rem; line-height: 1.4; font-weight: 650; }
small { font-size: .8125rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* The navigation distinguishes daily work from account setup. */
.shell { display: grid; grid-template-columns: 238px minmax(0,1fr); min-height: 100vh; }
.shell > aside { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #142d40; color: #edf5f7; display: flex; flex-direction: column; padding: 30px 18px 20px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px; text-decoration: none; color: #f5fafb; font-weight: 700; font-size: 1.3rem; letter-spacing: -.045em; }
.brand:hover { color: white; }
.brand small { display: block; color: #b2c7d2; font-size: .75rem; letter-spacing: .015em; font-weight: 400; margin-top: 2px; }
.brandmark { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 40px; border: 1px solid #507286; background: #244a5e; border-radius: 10px; color: #c2e7df; font-size: 1.45rem; }
.brandmark svg { width: 23px; height: 23px; }
.shell > aside nav { display: grid; gap: 5px; margin-top: 38px; }
.nav-group { display: grid; gap: 5px; }
.nav-group + .nav-group { margin-top: 23px; padding-top: 22px; border-top: 1px solid #365164; }
.nav-heading { color: #96afbf; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; padding: 0 14px 9px; }
.shell > aside nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 7px; color: #c8d7e0; font-size: .9375rem; font-weight: 500; text-decoration: none; min-height: 45px; }
.shell > aside nav a:hover { color: white; background: #213f53; }
.shell > aside nav a.active, .shell > aside nav a[aria-current="page"] { color: white; background: #2b5063; box-shadow: none; }
.nav-icon { display: inline-flex; flex: 0 0 19px; width: 19px; height: 19px; opacity: .9; }
.nav-icon svg, svg.nav-icon { width: 19px; height: 19px; }
.account { margin-top: auto; display: flex; gap: 10px; align-items: center; border-top: 1px solid #365164; padding: 20px 4px 0; font-size: .8125rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; display: grid; place-items: center; color: #daf1eb; background: #315469; font-size: .8125rem; font-weight: 650; }
.account form { margin-left: auto; }
.signout { color: #e0edf1; background: transparent; border: 0; min-width: 34px; min-height: 36px; border-radius: 5px; font-size: 1.2rem; }
.signout:hover { background: #29485b; }
main { min-width: 0; }
.topbar { padding: 0 clamp(22px,3.5vw,54px); min-height: 67px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); background: #fff; font-size: .8125rem; color: var(--muted); }
.topbar > div { display: flex; align-items: center; gap: 12px; }
.barline { width: 14px; height: 11px; border-top: 2px solid #668392; border-bottom: 2px solid #668392; }
.crumb { color: #94a8b6; }
.team { color: #5c7080; font-weight: 500; }
.work { padding: 36px clamp(22px,3.5vw,54px) 72px; max-width: 1560px; margin: auto; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.pagehead > div:first-child { min-width: 0; }
.pagehead p { color: var(--muted); margin-top: 8px; font-size: .9375rem; max-width: 72ch; }
.page-kicker { margin-bottom: 8px; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; flex-shrink: 0; }
.breadcrumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .875rem; margin-bottom: 18px; }
.breadcrumb a { color: #546f81; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Common surfaces and controls. */
.primary, .secondary, .smallbtn, .linkbutton {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: 7px; min-height: 42px;
  padding: 9px 15px; line-height: 1.35; font-size: .875rem; font-weight: 600; text-decoration: none;
}
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); color: white; }
.secondary, .smallbtn { border-color: #c5d2dc; background: #fff; color: #29495d; }
.secondary:hover, .smallbtn:hover { background: #f4f8fa; border-color: #9ab4c3; color: var(--ink); }
.smallbtn { min-height: 36px; padding: 7px 11px; font-size: .875rem; }
.linkbutton { min-height: 36px; padding: 6px 5px; background: transparent; color: #17626d; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
button.danger, .danger-button { color: var(--danger); border-color: #e1c4c0; background: #fff; }
.icon { border: 1px solid transparent; background: #edf3f6; color: #415d70; width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; flex: 0 0 auto; }
.icon:hover { background: #dfe9ef; }
.panel, .settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.panel { margin-bottom: 22px; overflow: hidden; }
.panelhead, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.panelhead > h2, .section-head > h2 { flex: 1 1 auto; }
.panelbody, .section-body { padding: 24px; }
.panelhead p, .section-head p { color: var(--muted); font-size: .875rem; margin-top: 5px; font-weight: 400; }
.rowflex { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.more { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { text-align: left; padding: 17px 20px; border-bottom: 1px solid #e7edf2; vertical-align: middle; }
th { font-size: .75rem; line-height: 1.4; color: #5a7183; background: #f7f9fb; font-weight: 650; letter-spacing: .025em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfcfd; }
td strong { color: var(--ink); font-weight: 600; }
td small { display: block; color: var(--muted); margin-top: 3px; font-size: .8125rem; }
td .more { flex-wrap: wrap; }
.table-title { color: var(--ink); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: #edf2f6; color: #536b7d; padding: 5px 9px; border-radius: 5px; line-height: 1.35; }
.ready { background: #e7f3ec; color: #2d694c; }
.attention { background: #fff0da; color: #855418; }
.busy { background: #e7f0fa; color: #365c85; }
.ready:before, .attention:before, .busy:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge { display: inline-block; background: #edf3f7; border-radius: 5px; color: #4a6578; padding: 4px 8px; font-size: .75rem; }
.status-line, .inline-status { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-size: .875rem; color: var(--muted); }
.muted, .smallmeta { color: var(--muted); font-size: .875rem; }
.blank, .empty-state { color: var(--muted); padding: 32px 26px; line-height: 1.65; font-size: .9375rem; }
.empty-state h3 { color: var(--ink); margin-bottom: 8px; }
.empty-state p { max-width: 66ch; margin-bottom: 16px; }
.workerstatus, .callout { padding: 16px 18px; background: #eaf3f8; border: 1px solid #cfdfeb; border-radius: 8px; font-size: .875rem; color: #3a566d; margin-bottom: 22px; }
.workerstatus { background: #fff4e2; border-color: #efd9b5; color: #805b2a; }
.callout strong { display: block; color: #24495e; margin-bottom: 4px; }
.callout p + p { margin-top: 8px; }
.callout.warning { background: #fff5e5; border-color: #efdcc0; color: #77552d; }
.callout.warning strong { color: #77552d; }
.errorline { max-width: 340px; color: var(--danger); overflow-wrap: anywhere; }
#notice, #formerror, .section-error { background: #e7f3ed; color: #255f4b; border: 1px solid #c7e1d3; border-radius: 7px; padding: 12px 15px; margin-bottom: 20px; font-size: .875rem; }
#formerror, .section-error { background: #fff0ed; color: #9c3d36; border-color: #edcac4; }
#formerror { margin: 8px 26px; }

/* An overview that leads to work, rather than repeating every setting. */
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 21px 23px; background: white; border: 1px solid var(--border); border-radius: var(--radius); }
.stat label, .stat > span { margin: 0; color: var(--muted); font-size: .8125rem; font-weight: 550; }
.stat strong { display: block; font-size: 2.2rem; line-height: 1.2; font-weight: 650; letter-spacing: -.055em; margin: 10px 0 5px; }
.stat small { color: var(--muted); font-size: .8125rem; }
.summary { border: 1px solid #bcd9d4; border-radius: var(--radius); background: #eef7f5; padding: 23px 25px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.summary h2 { color: #214c50; font-size: 1.2rem; }
.summary p { color: #526d73; font-size: .875rem; margin-top: 7px; }
.summary a { flex-shrink: 0; font-size: .875rem; font-weight: 600; }
.overview-grid, .two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.two .panel, .overview-grid .panel { margin: 0; }
.minirow { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.minirow:last-child { border: 0; }
.action-list, .activity-list { display: grid; gap: 0; }
.action-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.action-item:last-child { border-bottom: 0; }
.action-item p, .action-item small { display: block; color: var(--muted); font-size: .875rem; margin-top: 4px; }
.activity-list > * { padding: 14px 0; border-bottom: 1px solid var(--border); }
.activity-list > *:last-child { border: 0; }

/* Client context remains visible while moving between setup sections. */
.workspace-tabs, .section-tabs { display: flex; gap: 5px; flex-wrap: wrap; padding: 0; margin: 0 0 25px; border-bottom: 1px solid #cfdce5; }
.workspace-tabs a, .workspace-tabs button, .section-tabs a, .section-tabs button { display: inline-flex; align-items: center; min-height: 49px; padding: 11px 17px; margin-bottom: -1px; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: #576e7e; text-decoration: none; font-size: .875rem; font-weight: 550; }
.workspace-tabs a:hover, .section-tabs a:hover { color: var(--accent); background: #eaf1f5; }
.workspace-tabs .active, .workspace-tabs [aria-current="page"], .section-tabs .active, .section-tabs [aria-current="page"], .section-tabs [aria-selected="true"] { color: #145f65; border-bottom-color: var(--accent); font-weight: 650; background: transparent; }
.client-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px 28px; padding: 20px 24px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: white; }
.client-summary dl { display: flex; flex-wrap: wrap; gap: 18px 35px; margin: 0; }
.client-summary dl > div { min-width: 130px; }
.client-summary dt { color: var(--muted); font-size: .75rem; margin-bottom: 5px; }
.client-summary dd { margin: 0; color: var(--ink); font-size: .875rem; font-weight: 550; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.client-toolbar, .filters { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; padding: 19px 24px; border-bottom: 1px solid var(--border); }
.client-toolbar label, .filters label { margin-bottom: 0; }
.client-toolbar > label:first-child { flex: 1 1 280px; }
.client-toolbar input[type="search"], .filters input { max-width: 390px; }
.client-toolbar select, .filters select { width: auto; min-width: 180px; }
.filters input { flex: 1 1 240px; margin-top: 0; }
.filters select { margin-top: 0; }
.client-name { font-size: .9375rem; color: var(--ink); text-decoration: none; font-weight: 650; }
.client-name:hover { color: var(--accent); text-decoration: underline; }
.client-list { min-width: 0; }
.client-list table td:first-child { min-width: 190px; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; align-items: start; }
.settings-stack { display: grid; gap: 24px; }
.settings-card { position: relative; }
.settings-card .section-head { display: block; background: #fbfcfd; border-radius: var(--radius) var(--radius) 0 0; }
.settings-card .section-head h2 + p { max-width: 66ch; margin-top: 6px; }
.settings-card .section-body > p { margin-bottom: 18px; }
.settings-card .section-body > p:last-child { margin-bottom: 0; }
.settings-card .section-body > .callout:last-child { margin-bottom: 0; }
.settings-card .section-body > .callout:first-child { margin-top: 0; }
.settings-card form { margin: 0; }
.settings-card .section-body > form > label:last-of-type { margin-bottom: 22px; }
.settings-card .section-body > dl { margin: 0 0 20px; }
.settings-card .section-body > dl dt { color: var(--muted); font-size: .8125rem; margin-top: 14px; }
.settings-card .section-body > dl dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.form-grid, .pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.form-grid > .full, .form-grid > .wide, .form-grid > .span-full { grid-column: 1 / -1; }
.form-section { padding-bottom: 23px; margin-bottom: 23px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { margin-bottom: 0; border-bottom: 0; }
.form-section h3 { margin-bottom: 14px; }
.form-section p { margin-bottom: 15px; color: var(--muted); font-size: .875rem; }
.form-footer { position: static; background: #fff; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 24px -24px -24px; padding: 17px 24px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.form-footer .field-hint, .form-footer .muted { margin: 0 auto 0 0; flex: 1 1 180px; }
.form-footer .primary, .form-footer .secondary { flex-shrink: 0; }
label { display: block; margin-bottom: 18px; font-size: .875rem; font-weight: 600; color: #304b5f; }
input, select, textarea { display: block; width: 100%; padding: 11px 12px; border-radius: 6px; border: 1px solid #bacbd7; color: var(--ink); background: white; margin-top: 7px; font-size: .9375rem; line-height: 1.45; min-height: 44px; }
input::placeholder, textarea::placeholder { color: #728898; opacity: 1; }
input:read-only { background: #f2f6f9; color: #596f80; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235b7487' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea { min-height: 132px; resize: vertical; }
textarea[name="rules"], textarea[name="wording"] { min-height: 230px; line-height: 1.7; }
.field-hint, .hint { margin: 7px 0 18px; color: var(--muted); font-size: .8125rem; font-weight: 400; line-height: 1.6; }
label .field-hint { display: block; margin-bottom: 0; }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: 18px; height: 18px; min-height: 0; margin: 0 8px 0 0; vertical-align: -3px; accent-color: var(--accent); }
.weekday-options, .pairs { display: flex; gap: 9px; flex-wrap: wrap; margin: 8px 0 20px; }
.weekday-options label { display: inline-flex; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafc; margin: 0; font-size: .875rem; font-weight: 500; }
.weekday-options label:has(input:checked) { background: #eaf5f3; border-color: #a8cec6; color: #155a59; }
.weekday-options input { width: 16px; height: 16px; margin-right: 7px; }
.pairs label { font-weight: 450; margin-bottom: 5px; }
.shift-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 14px; align-items: end; padding: 16px; background: #f6f9fb; border: 1px solid #e0e8ef; border-radius: 8px; margin-bottom: 12px; }
.shift-row label { margin: 0; }
.shift-row button { min-height: 44px; }
.date-row, .excluded-date-row { display: flex; align-items: end; gap: 12px; margin-bottom: 12px; max-width: 420px; }
.date-row input, .excluded-date-row input { flex: 1 1 auto; min-width: 0; }
.date-row button, .excluded-date-row button { min-height: 44px; }
.settings-card details { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; }
.settings-card details summary { color: #456477; font-weight: 550; font-size: .875rem; cursor: pointer; }
.settings-card details table { margin-top: 12px; }
.settings-card details p { margin-top: 12px; }
.setup-steps { display: flex; list-style: none; gap: 0; margin: 0 0 26px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: white; overflow: hidden; }
.setup-steps li { flex: 1 1 0; display: flex; align-items: center; gap: 10px; padding: 17px 22px; color: #6d8190; font-size: .875rem; border-right: 1px solid var(--border); }
.setup-steps li:last-child { border-right: 0; }
.setup-steps li > span:first-child { display: inline-grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid #cbd9e2; border-radius: 50%; font-size: .75rem; }
.setup-steps li.active, .setup-steps li[aria-current="step"] { background: #eaf5f3; color: #195c61; font-weight: 650; }
.setup-steps li.active > span:first-child, .setup-steps li[aria-current="step"] > span:first-child { color: white; border-color: var(--accent); background: var(--accent); }
.setup-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(230px,1fr); align-items: start; gap: 26px; }
.setup-help { background: #e9f0f5; border-radius: 10px; padding: 24px; color: #456175; font-size: .875rem; }
.setup-help h3 { color: #244c62; margin-bottom: 12px; }
.setup-help p + p { margin-top: 14px; }
.setup-help ul { margin: 14px 0 0; padding-left: 20px; }
.setup-help li + li { margin-top: 10px; }
.team-intro { color: var(--muted); padding: 20px 24px; font-size: .9375rem; border-bottom: 1px solid var(--border); }

/* Small task dialogs remain, while client settings live on full pages. */
dialog { padding: 0; border: 1px solid var(--border); border-radius: 13px; width: min(640px,calc(100vw - 32px)); max-height: 90dvh; color: var(--ink); box-shadow: 0 24px 110px #0c24364d; overflow-y: auto; }
dialog::backdrop { background: #122c3f80; backdrop-filter: blur(2px); }
.dialoghead { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 26px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 3; }
#fields { padding: 24px 26px 2px; }
.dialogfoot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px 22px; position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); z-index: 3; }
.seg { display: flex; gap: 4px; background: #edf2f6; border: 1px solid #e0e7ee; border-radius: 8px; padding: 4px; margin: 0 0 22px; }
.seg button { border: 0; flex: 1; background: transparent; padding: 10px; color: #5b7181; border-radius: 5px; font-size: .875rem; }
.seg button.sel { background: white; color: var(--ink); box-shadow: 0 1px 4px #18324a1a; font-weight: 600; }
#preview:not(:empty) { margin: 12px 26px 18px; padding: 14px 16px; background: #eaf5f3; color: #2b605b; font-size: .875rem; border: 1px solid #cde5df; border-radius: 7px; }

/* Evidence is readable without competing with settings navigation. */
.shiftchecks { margin-top: 14px; padding: 14px 16px; border-left: 3px solid #679b91; background: #f0f7f5; max-width: 34rem; white-space: normal; font-size: .8125rem; }
.shiftcase { margin: 10px 0; overflow-wrap: anywhere; }
.shiftcase p { margin: 8px 0 10px; }
.learning { padding: 26px; border-bottom: 1px solid var(--border); }
.learning:last-child { border-bottom: none; }
.learninghead { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.learning h3 { font-size: 1.125rem; margin: 6px 0 10px; }
.learningtext { white-space: pre-wrap; line-height: 1.7; max-width: 80ch; }
.learning details { margin: 18px 0; }
.learning summary { cursor: pointer; color: #235d73; font-size: .875rem; }
.learning blockquote { margin: 18px 0; padding: 5px 18px; border-left: 3px solid #83afa3; line-height: 1.6; color: #365563; }
.learning blockquote small { display: block; color: var(--muted); margin-top: 9px; }
.learning .more { margin-top: 20px; }

/* Authentication pages share the same visual language. */
.auth { min-height: 100vh; display: grid; place-items: center; background: #edf3f7; padding: 25px; }
.authbox { width: min(430px,100%); background: white; border: 1px solid var(--border); border-radius: 14px; padding: 36px; box-shadow: 0 15px 50px #16344a0a; }
.wordmark { font-size: .875rem; color: var(--accent); font-weight: 700; }
.authbox h1 { font-size: 1.9rem; margin: 15px 0 24px; }
.authbox p { color: var(--muted); margin-bottom: 22px; }
.authbox .primary { width: 100%; margin-top: 5px; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 210px minmax(0,1fr); }
  .shell > aside { padding: 26px 13px 18px; }
  .work { padding-left: 26px; padding-right: 26px; }
  .settings-grid { grid-template-columns: 1fr; }
  .overview-grid, .two { grid-template-columns: 1fr; }
  .settings-card .section-body { max-width: none; }
  .setup-layout { grid-template-columns: minmax(0,1fr) 240px; gap: 20px; }
  .client-summary dl { gap: 16px 24px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 184px minmax(0,1fr); }
  .brand { font-size: 1.13rem; gap: 9px; padding: 0 5px; }
  .brandmark { width: 32px; height: 35px; flex-basis: 32px; font-size: 1.2rem; }
  .brand small { font-size: .6875rem; }
  .shell > aside nav a { padding-left: 11px; gap: 9px; font-size: .875rem; }
  .pagehead { align-items: flex-start; }
  .pagehead .page-actions { max-width: 190px; justify-content: flex-end; }
  .stats { gap: 10px; }
  .stat { padding: 18px; }
  .stat strong { font-size: 1.9rem; }
  .stat small { font-size: .75rem; }
  .setup-layout { grid-template-columns: 1fr; }
  .setup-help { padding: 20px; }
  .setup-steps li { padding: 15px 13px; gap: 7px; font-size: .8125rem; }
  .form-grid { gap: 15px; }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .shell > aside { position: static; height: auto; padding: 17px 18px 14px; overflow: visible; }
  .brand { font-size: 1.25rem; padding: 0; }
  .brand small { font-size: .75rem; }
  .brandmark { display: none; }
  .shell > aside nav { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 20px; }
  .nav-group { display: flex; flex-wrap: wrap; gap: 3px; }
  .nav-group + .nav-group { margin: 0; padding: 0; border: 0; }
  .nav-heading { display: none; }
  .shell > aside nav a { min-height: 39px; padding: 8px 11px; font-size: .8125rem; white-space: nowrap; gap: 7px; }
  .nav-icon, .nav-icon svg, svg.nav-icon { width: 16px; height: 16px; flex-basis: 16px; }
  .account { margin-top: 15px; padding-top: 13px; font-size: .75rem; }
  .account .avatar { width: 25px; height: 25px; flex-basis: 25px; font-size: .6875rem; }
  .account .signout { min-height: 27px; font-size: 1rem; }
  .topbar { display: none; }
  .work { padding: 27px 18px 50px; }
  .pagehead { flex-wrap: wrap; gap: 18px; margin-bottom: 23px; }
  .pagehead p { font-size: .875rem; }
  .pagehead .page-actions { max-width: none; justify-content: flex-start; }
  h1 { font-size: 1.85rem; }
  .page-actions { width: 100%; }
  .page-actions .primary { flex: 1 1 auto; }
  .breadcrumb { font-size: .8125rem; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .stat { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 17px 19px; }
  .stat label, .stat > span { font-size: .875rem; }
  .stat strong { grid-column: 2; grid-row: 1 / 3; margin: 0 0 0 15px; font-size: 1.8rem; }
  .stat small { margin-top: 3px; font-size: .8125rem; }
  .summary { display: block; padding: 21px; }
  .summary a { display: inline-block; margin-top: 14px; }
  .panelhead, .section-head { padding: 19px 20px; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .panelhead h2 { font-size: 1.0625rem; }
  .panelbody, .section-body { padding: 20px; }
  .settings-grid, .settings-stack { gap: 20px; }
  .form-grid, .pair { grid-template-columns: minmax(0,1fr); gap: 0; }
  .form-grid > * { grid-column: 1 !important; }
  .form-footer { margin: 22px -20px -20px; padding: 16px 20px; gap: 9px; }
  .form-footer .field-hint, .form-footer .muted { flex-basis: 100%; }
  .form-footer .primary { flex: 1 1 auto; }
  .workspace-tabs, .section-tabs { gap: 0; margin-bottom: 22px; }
  .workspace-tabs a, .workspace-tabs button, .section-tabs a, .section-tabs button { padding: 10px 12px; min-height: 45px; font-size: .8125rem; }
  .client-summary { padding: 19px 20px; }
  .client-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; width: 100%; }
  .client-summary dl > div { min-width: 0; }
  .client-summary dd { font-size: .8125rem; }
  .summary-actions { width: 100%; }
  .summary-actions .primary { flex: 1 1 auto; }
  .client-toolbar, .filters { padding: 18px 20px; gap: 12px; }
  .client-toolbar > label, .filters > label { flex: 1 1 100%; }
  .client-toolbar input[type="search"], .filters input { max-width: none; }
  .client-toolbar select, .filters select { flex: 1 1 100%; min-width: 0; width: 100%; }
  .shift-row { padding: 13px; gap: 10px; }
  .shift-row button { padding-left: 8px; padding-right: 8px; font-size: .75rem; }
  .weekday-options { gap: 7px; }
  .weekday-options label { padding: 8px 10px; }
  .setup-steps { border-radius: 8px; }
  .setup-steps li { display: grid; align-content: start; justify-items: start; padding: 12px 10px; font-size: .75rem; line-height: 1.4; }
  .setup-layout { gap: 20px; }
  th, td { padding: 15px 17px; }
  .action-item { padding: 19px 20px; align-items: flex-start; flex-wrap: wrap; }
  .learning { padding: 22px 20px; overflow-wrap: anywhere; }
  .learninghead { gap: 12px; }
  .learning h3 { font-size: 1.0625rem; }
  .team-intro { padding: 19px 20px; font-size: .875rem; }
  dialog { width: calc(100vw - 22px); max-height: 94dvh; border-radius: 11px; }
  .dialoghead { padding: 18px 20px; }
  #fields { padding: 20px 20px 2px; }
  .dialogfoot { padding: 15px 20px 18px; }
  #preview:not(:empty), #formerror { margin-left: 20px; margin-right: 20px; }
  .auth { padding: 18px; }
  .authbox { padding: 28px 25px; }
}
@media (max-width: 390px) {
  .work { padding-left: 13px; padding-right: 13px; }
  .shell > aside { padding-left: 13px; padding-right: 13px; }
  .shift-row { grid-template-columns: 1fr 1fr; }
  .shift-row button { grid-column: 1 / -1; justify-self: start; min-height: 34px; }
  .client-summary dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Details shared by client setup and the section-based workspace. */
.nav-icon { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.topbar .breadcrumb { margin: 0; }
.pagehead .page-kicker { margin: 0 0 8px; font-size: .6875rem; letter-spacing: .1em; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -70px; padding: 10px 15px; background: white; color: var(--ink); border: 2px solid var(--accent); border-radius: 6px; }
.skip-link:focus { top: 12px; }
a.stat { text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: #9abcc2; background: #fcfefe; }
.connection-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.connection-summary .muted { font-size: .8125rem; }
.connection-summary p { margin-top: 5px; font-size: .9375rem; }
.connection-tools { margin: 0 0 23px; padding-bottom: 23px; border-bottom: 1px solid var(--border); }
#cw-connection .form-footer { margin-bottom: 0; }
.connection-options { margin-top: 0 !important; border-top: 0 !important; }
.danger-button { display: inline-flex; align-items: center; justify-content: center; border-style: solid; border-width: 1px; border-radius: 6px; min-height: 38px; padding: 8px 12px; font-size: .875rem; font-weight: 550; }
.danger-button:hover { background: #fff5f2; }
.save-state { margin-right: auto; font-size: .8125rem; color: var(--muted); }
fieldset.form-section { min-width: 0; padding: 0 0 23px; margin-left: 0; margin-right: 0; border: 0; border-bottom: 1px solid var(--border); }
fieldset.form-section legend { padding: 0; font-size: 1rem; font-weight: 650; margin-bottom: 13px; color: var(--ink); }
.check-field { display: flex; align-items: flex-start; font-weight: 500; line-height: 1.55; }
.check-field input { flex: 0 0 18px; margin-top: 3px; }
.excluded-row { grid-template-columns: minmax(0,1fr) auto; max-width: 430px; }
.history-details > summary { cursor: pointer; padding: 20px 24px; color: #395f73; font-size: .9375rem; font-weight: 600; }
.history-details .section-body { padding-top: 0; }
.history-details h3 { margin: 20px 0 12px; }
.history-details h3:first-child { margin-top: 0; }
.back-link { display: inline-block; margin-bottom: 18px; font-size: .875rem; color: #526f80; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.setup-help dl { margin: 24px 0; }
.setup-help dt { font-size: .75rem; color: #607889; margin-top: 14px; }
.setup-help dd { margin: 3px 0 0; color: #2d4f65; font-weight: 550; overflow-wrap: anywhere; }
.setup-help p { line-height: 1.7; }
.setup-steps li.complete { color: #2f7169; }
.setup-steps li.complete > span:first-child { background: #e9f5ee; border-color: #add2c5; }
.audit-client-name { font-size: 1.1rem !important; font-weight: 650; color: var(--ink) !important; margin-bottom: 5px !important; }
@media (max-width: 700px) {
 .save-state { flex-basis: 100%; }
 .connection-summary { gap: 14px; }
 .history-details > summary { padding: 19px 20px; }
}
@media (max-width: 390px) {
 .excluded-row { grid-template-columns: minmax(0,1fr) auto; }
 .excluded-row button { grid-column: auto; }
}

/* Section saves stay after their fields; they must never cover an input. */
.form-grid > :only-child { grid-column: 1 / -1; }
.coverage-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 26px; margin-top: 20px; }
.coverage-grid > * { min-width: 0; }
.coverage-grid .form-section { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.coverage-grid .coverage-hours { padding-right: 25px; border-right: 1px solid var(--border); }
.coverage-policy .form-section + .form-section { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--border); }
.coverage-policy .callout { margin-bottom: 0; }
.coverage-grid .weekday-options { gap: 7px; }
.coverage-grid .weekday-options label { padding: 8px 10px; font-size: .875rem; }
.coverage-grid .shift-row { gap: 10px; padding: 13px; }
.coverage-grid .shift-row button { padding-left: 8px; padding-right: 8px; }
.coverage-grid .shift-row label { font-size: .875rem; }
@media (max-width: 1100px) {
 .coverage-grid { grid-template-columns: minmax(0,1fr); gap: 24px; }
 .coverage-grid .coverage-hours { padding-right: 0; border-right: 0; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
}
.management-summary strong { color: var(--ink); font-size: 1rem; }
.management-summary p { color: var(--muted); font-size: .875rem; margin-top: 4px; }
.management-editor > form { margin-top: 22px; }
.field-with-action { display: flex; align-items: flex-end; gap: 10px; min-width: 0; }
.field-with-action > label { flex: 1 1 auto; min-width: 0; }
.field-with-action > button { margin-bottom: 18px; min-height: 44px; flex-shrink: 0; }

/* Form labels and task-critical states remain readable at narrow widths. */
main:focus { outline: none; }
.client-summary dt, .connection-summary .muted { font-size: .875rem; }
.status { font-size: .875rem; }
th { font-size: .875rem; }
@media (max-width: 700px) {
 .workspace-tabs a, .workspace-tabs button, .section-tabs a, .section-tabs button { font-size: .875rem; }
 .shell > aside nav a { font-size: .875rem; }
 .client-summary { padding: 17px 20px; }
 .client-summary dl { display: grid; grid-template-columns: 1fr; gap: 12px; }
 .client-summary dl > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
 .client-summary dt { margin: 0; flex: 1 1 auto; }
 .client-summary dd { font-size: .875rem; text-align: right; max-width: 57%; }
 .coverage-grid .shift-row button { font-size: .875rem; }
}

/* Standalone page controls align with the page and the outer table edge. */
#content > .client-toolbar {
  padding: 0 0 22px;
  border-bottom: 0;
  align-items: flex-end;
  gap: 20px;
}
#content > .client-toolbar > .search-field { flex: 0 1 440px; max-width: none; }
#content > .client-toolbar input[type="search"] { max-width: none; }
#content > .client-toolbar > label:not(.search-field) { flex: 0 1 265px; }
#content > .client-toolbar select { width: 100%; }
#content > .team-intro { padding: 0; margin: 0 0 22px; border-bottom: 0; }

/* New-client setup has a single reading column, without a competing recap. */
.client-onboarding { width: 100%; max-width: 880px; }
.client-onboarding .setup-layout, .setup-layout.single-column { display: block; }
.client-onboarding .settings-card { width: 100%; }
.client-onboarding .setup-steps { margin-bottom: 24px; }
.client-onboarding .section-body { padding: 28px; }
.client-onboarding .form-footer { margin: 26px -28px -28px; padding: 18px 28px; }
.client-onboarding .form-footer > :first-child { margin-right: auto; }

/* Consistent agency and product identity at every viewport size. */
.brand { gap: 11px; letter-spacing: -.035em; }
.brandmark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 10px; background: #285368; border-color: #507b8e; }
.brandmark svg { display: block; width: 26px; height: 26px; }
.brand-name, .brand-copy strong, .brand-text strong { display: block; font-size: 1.15rem; font-weight: 750; line-height: 1.15; letter-spacing: -.035em; }
.brand-subtitle, .brand-copy small, .brand-text small, .brand small { color: #b8d0da; font-size: .8125rem; font-weight: 450; line-height: 1.35; letter-spacing: .01em; margin-top: 4px; }

/* The newest report is a direct entry point; detailed evidence stays behind its disclosure. */
.latest-report {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  border: 1px solid #bed9d6;
  border-radius: var(--radius);
  background: #f9fdfc;
  padding: 24px 26px;
  margin-bottom: 24px;
}
.latest-report-main { min-width: 0; }
.latest-report-main h2 { color: #244c51; font-size: 1.3rem; margin: 5px 0 8px; }
.latest-report-main > small, .latest-report-label { font-size: .8125rem; color: #52776f; font-weight: 600; }
.latest-report-main p { color: #506a72; font-size: .875rem; margin-top: 5px; }
.latest-report-main .status-line { margin-top: 12px; }
.latest-report-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.latest-report-actions a { white-space: nowrap; }
.report-details { margin-top: 10px; min-width: 0; }
.report-details > summary {
  display: list-item;
  color: #426b80;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 550;
  line-height: 1.5;
  padding: 5px 0;
}
.report-details[open] > summary { margin-bottom: 14px; }
.report-detail-meta {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px 22px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7f9fb;
  margin: 0 0 18px;
  font-size: .875rem;
}
.report-detail-meta > div { min-width: 0; }
.report-detail-meta dt { color: var(--muted); font-size: .8125rem; margin-bottom: 4px; }
.report-detail-meta dd { margin: 0; color: var(--ink); }
.report-detail-meta p, .report-detail-meta small { margin: 0; }
.report-details .shiftchecks { margin-top: 0; max-width: none; background: transparent; border-left: 0; padding: 0; }
.report-details .shiftchecks > strong { display: block; font-size: 1rem; margin-bottom: 15px; }
.report-details .shiftcase {
  padding: 19px 20px;
  margin: 0 0 14px;
  background: #f3f8f7;
  border: 1px solid #d5e4df;
  border-radius: 8px;
  color: #335b5a;
  font-size: .875rem;
}
.report-details .shiftcase > a { font-weight: 650; }
.report-details .shiftcase > small { display: block; margin-top: 5px; color: #5a7378; }
.report-details .shiftcase p { margin: 14px 0; line-height: 1.65; }
.report-details .shiftcase p:last-child { margin-bottom: 0; }
.report-details .shiftcase strong { color: #284d50; }
.report-details .shiftchecks > small { color: var(--muted); font-size: .8125rem; }

@media (max-width: 900px) {
  .latest-report { align-items: flex-start; }
  .latest-report-actions { flex-direction: column; align-items: stretch; }
  .brandmark { width: 34px; height: 36px; flex-basis: 34px; }
  .brandmark svg { width: 24px; height: 24px; }
  .brand-name, .brand-copy strong, .brand-text strong { font-size: 1.0625rem; }
}
@media (max-width: 700px) {
  #content > .client-toolbar { gap: 14px; padding-bottom: 20px; }
  #content > .client-toolbar > .search-field, #content > .client-toolbar > label:not(.search-field) { flex: 1 1 100%; }
  .client-onboarding { max-width: none; }
  .client-onboarding .section-body { padding: 20px; }
  .client-onboarding .form-footer { margin: 24px -20px -20px; padding: 17px 20px; }
  .brandmark { display: grid; width: 38px; height: 38px; flex-basis: 38px; }
  .brand-name, .brand-copy strong, .brand-text strong { font-size: 1.125rem; }
  .latest-report { display: block; padding: 22px 20px; }
  .latest-report-main h2 { font-size: 1.1875rem; }
  .latest-report-actions { flex-direction: row; margin-top: 20px; justify-content: flex-start; }
  .latest-report-actions .primary { flex: 1 1 100%; }
  .report-detail-meta { grid-template-columns: 1fr; padding: 16px; gap: 12px; }
  .report-details .shiftcase { padding: 17px 16px; }
}
.latest-report-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 11px; color: #526e74; font-size: .875rem; }
#report-modal { width: min(850px,calc(100vw - 32px)); }
#report-modal .report-details { padding: 24px 26px; margin: 0; }
.report-summary-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 22px; color: var(--muted); font-size: .875rem; }
.report-detail-section + .report-detail-section { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 24px; }
.report-detail-section h3 { margin-bottom: 15px; }
.shiftcase-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 13px; }
.shiftcase-head a { font-weight: 650; }
.shiftcase-head .status { font-size: .875rem; }
.evidence-quote { margin: 16px 0; padding: 16px 18px; border: 1px solid #d8e4e1; border-left: 3px solid #84b1a6; border-radius: 0 6px 6px 0; background: white; color: #294e54; }
.evidence-quote p { margin: 0 !important; }
.evidence-quote footer { margin-top: 10px; color: #637a83; font-size: .875rem; }
@media (max-width: 700px) {
 #report-modal { width: calc(100vw - 22px); }
 #report-modal .report-details { padding: 20px; }
 .latest-report-meta { gap: 6px 14px; }
 .evidence-quote { padding: 14px; }
 .shiftcase-head { align-items: flex-start; }
}

/* Long selected values must shrink inside the layout, not widen a mobile page. */
.form-grid > *, .pair > *, .shift-row > *, .coverage-grid > *, label { min-width: 0; }
.form-grid input, .form-grid select, .form-grid textarea, .pair input, .pair select { max-width: 100%; }
.overview-grid { margin-bottom: 24px; }
.panel > .latest-report { margin: 0; border: 0; border-radius: 0; }
.report-detail-actions + .report-detail-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.history-options { padding: 18px 24px; border-top: 1px solid var(--border); background: #fbfcfd; }
.history-options label { margin: 0; }
.filters > .search-field { flex: 1 1 320px; min-width: 220px; max-width: 440px; }
.filters > .search-field input { width: 100%; max-width: none; margin-top: 7px; }
.filters > label:not(.search-field) { flex: 0 1 220px; min-width: 180px; }
@media (max-width: 700px) {
 .filters > .search-field, .filters > label:not(.search-field) { flex: 1 1 100%; min-width: 0; max-width: none; }
 .history-options { padding: 17px 20px; }
 .report-detail-actions + .report-detail-section { margin-top: 22px; padding-top: 22px; }
}

.report-action-confirm p { margin: 0 0 16px; }
.report-action-confirm p:last-child { margin-bottom: 8px; }
