:root {
  color-scheme: light;
  --page: #f3f4f6;
  --surface: #fff;
  --ink: #222a34;
  --muted: #4e5866;
  --line: #d3dae3;
  --blue: #3e5e8c;
  --blue-hover: #304b73;
  --blue-tint: #ecf1f8;
  --nav: #263349;
  --focus: #376aa4;
  --accent: #335d87;
  --accent-soft: #e5edf9;
  --accent-wash: #f2f6fc;
  --accent-on-dark: #bfdbfc;
  --content-width: 1160px;
  --gutter: clamp(16px, 4vw, 38px);
  font-family: Arial, "Helvetica Neue", sans-serif;
  background: var(--page);
  color: var(--ink);
}
[data-tone="teal"] { --accent: #206359; --accent-soft: #deeee9; --accent-wash: #f1f7f5; --accent-on-dark: #8ed9cc; }
[data-tone="sage"] { --accent: #42633d; --accent-soft: #e6efe2; --accent-wash: #f5f8f2; --accent-on-dark: #b7d7a7; }
[data-tone="amber"] { --accent: #79531d; --accent-soft: #f6ead5; --accent-wash: #fbf8ef; --accent-on-dark: #f5d298; }
[data-tone="plum"] { --accent: #64517a; --accent-soft: #ede6f3; --accent-wash: #f8f5fb; --accent-on-dark: #ddc6f0; }
[data-tone="clay"] { --accent: #8b4a3e; --accent-soft: #f4e5df; --accent-wash: #fbf5f2; --accent-on-dark: #f0b5a2; }
[data-tone="red"] { --accent: #8c3027; --accent-soft: #f8e1dc; --accent-wash: #fdf3f0; }
* { box-sizing: border-box; }
.icon { display: block; flex: none; width: 1em; height: 1em; }
.icon-tile { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
body { margin: 0; min-width: 0; }
a { color: var(--blue); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; z-index: 5; inset: 8px auto auto 12px; transform: translateY(-150%); background: var(--surface); padding: 10px; }
.skip:focus { transform: none; }

.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner, .navigation, .main { max-width: var(--content-width); margin-inline: auto; }
.header-inner { min-height: 78px; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.15rem; font-weight: 600; line-height: 1.14; }
.brand small { font-size: .81rem; color: var(--muted); margin-top: 5px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; background: var(--blue); flex: none; }
.brand-mark i { position: relative; width: 17px; height: 21px; border: 1.5px solid #fff; border-radius: 2px; }
.brand-mark i::before { content: ""; position: absolute; top: -3px; left: 3px; right: 3px; height: 5px; background: #fff; border-radius: 1px; }
.brand-mark i::after { content: ""; position: absolute; width: 7px; height: 4px; top: 7px; left: 3px; border: solid #fff; border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg); }
.identity { display: flex; align-items: center; gap: 14px; font-size: .85rem; min-width: 0; }
.identity a { font-weight: 600; }
.private { color: var(--blue-hover); background: var(--blue-tint); border: 1px solid var(--line); font-weight: 600; font-size: .75rem; padding: 7px 10px; flex: none; }
.signout { border: 0; color: var(--blue); background: transparent; font: inherit; font-weight: 600; min-height: 44px; padding: 0 4px; cursor: pointer; white-space: nowrap; }
.signout:hover { text-decoration: underline; }
.navigation-bar { background: var(--nav); }
.navigation { display: flex; padding-inline: var(--gutter); }
.navigation a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 49px; padding: 10px 17px 7px; border-bottom: 3px solid transparent; color: #ecf0f6; font-size: .89rem; font-weight: 600; text-decoration: none; text-align: center; }
.navigation .icon { color: var(--accent-on-dark); font-size: 17px; }
.navigation a:hover { background: #364761; }
.navigation a[aria-current] { color: #fff; background: #354966; border-bottom-color: var(--accent-on-dark); }
.navigation a:focus-visible { outline-color: #c5ddff; outline-offset: -4px; }

.main { padding: clamp(25px, 4vw, 42px) var(--gutter) 56px; }
.auth-main { min-height: calc(100svh - 79px); display: grid; justify-items: center; align-content: center; gap: 4px; }
.auth-card { width: min(100%, 440px); padding: clamp(24px, 5vw, 36px); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--blue); }
.auth-card .page-head { margin: 0 0 13px; padding: 0; border: 0; }
.auth-card h1 { font-size: clamp(1.65rem, 5vw, 2rem); }
.auth-card > p { color: var(--muted); margin-bottom: 23px; }
.auth-card .button { width: 100%; }
.install-link { display: block; width: fit-content; margin: 18px auto 0; }
.install-guide { width: min(100%, 500px); margin-inline: auto; }
.install-guide .page-head { margin-bottom: 14px; }
.install-guide h2 { margin-bottom: 6px; }
.install-guide ol { margin: 0 0 18px; padding-inline-start: 1.4em; line-height: 1.55; }
.install-guide ol li + li { margin-top: 4px; }
.install-icon { display: block; border-radius: 20%; margin-bottom: 18px; }
#install-app { margin-bottom: 20px; }
.install-promotion[hidden] { display: none; }
@media (display-mode: standalone) { .install-promotion { display: none; } }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); font-weight: 600; line-height: 1.14; margin-bottom: 0; overflow-wrap: anywhere; }
h2 { margin-bottom: 15px; font-size: 1.2rem; font-weight: 600; line-height: 1.25; }
h3 { font-size: 1rem; margin-top: 16px; }
p { line-height: 1.55; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin: 0 0 21px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.eyebrow { font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; margin: 0 0 8px; color: var(--blue); }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 18px 26px; padding: clamp(19px, 4vw, 34px); background: linear-gradient(110deg, var(--accent-soft), #f8f7f2); border-inline-start: 4px solid var(--accent); margin-bottom: 16px; }
.hero .eyebrow { color: var(--accent); }
.hero-copy { min-width: 0; }
.hero h1 { font-size: clamp(1.95rem, 5vw, 3rem); }
.hero p:not(.eyebrow) { color: var(--muted); margin: 10px 0 0; }
.hero .actions { flex-shrink: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.workflow-links { margin-bottom: 16px; }
.panel .workflow-links { margin: 10px 0 0; }
.closeout-counts { margin-bottom: 14px; }
.closeout-counts .badge { white-space: normal; }
.badge.closeout-waiting { background: #e9edf1; color: #455260; }
.badge.closeout-hazard { background: #f6ead5; color: #79531d; }
.badge.closeout-ready { background: #ede6f3; color: #64517a; }
.badge.closeout-uploaded { background: #dcefe2; color: #22503f; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 15px; border: 1px solid transparent; border-radius: 2px; background: var(--blue); color: #fff; font: inherit; font-size: .9rem; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.button .icon { font-size: 17px; }
.button:hover { background: var(--blue-hover); }
.button.secondary { color: var(--blue-hover); background: var(--surface); border-color: #aab9ce; }
.button.secondary:hover { background: #e3eaf4; border-color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 20px; }
.stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 14px 16px; min-height: 76px; align-content: center; background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0; }
.stat:hover { background: var(--accent-wash); }
.stat:focus-visible { outline-offset: -4px; }
.stat strong { color: var(--accent); font-size: 1.8rem; line-height: 1.05; }
.stat-label { grid-column: 1 / -1; color: var(--muted); font-weight: 600; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }
.stat .icon-tile { grid-column: 2; grid-row: 1; }
.dashboard-grid,.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dashboard-grid { margin-top: 18px; }
.workgroup-jobs { padding: 0; }
.workgroup-jobs-heading { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 9px 12px; list-style: none; cursor: pointer; font-weight: 600; color: var(--accent); background: var(--accent-wash); }
.workgroup-jobs-heading:hover { background: var(--accent-soft); }
.workgroup-jobs-heading::-webkit-details-marker { display: none; }
.workgroup-jobs-heading::after { content: ''; width: 7px; height: 7px; margin-inline-end: 2px; flex: none; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.workgroup-jobs[open] > .workgroup-jobs-heading::after { transform: rotate(45deg); }
.workgroup-name { min-width: 0; overflow-wrap: anywhere; }
.workgroup-job-count { margin-inline-start: auto; flex: none; color: var(--muted); font-size: .85rem; font-weight: 400; }
.workgroup-jobs + .workgroup-jobs { margin-top: 10px; }
.stack { display: grid; gap: 16px; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); padding: clamp(15px, 2.5vw, 22px); }
.panel > h2 { margin: 0 0 14px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 9px; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 108px; flex: 1; }
.field { display: grid; gap: 7px; margin: 0 0 14px; color: var(--ink); font-size: .89rem; font-weight: 600; min-width: 0; }
input:not([type=checkbox]),select,textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #8e9aab; border-radius: 2px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; font-weight: 400; }
input[type=file] { font-size: .85rem; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); margin: 0 0 14px; min-width: 0; }
legend { font-weight: 600; font-size: .89rem; }
.check { display: flex; align-items: start; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--line); min-height: 44px; line-height: 1.45; overflow-wrap: anywhere; }
.check + .field { margin-top: 14px; }
.check:last-child { border-bottom: 0; }
.check input { accent-color: var(--blue); width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.check-heading { margin: 16px 0 3px; color: var(--blue-hover); }
.check-heading s, .check-na { color: var(--muted); }
.check-na-label { flex: 0 0 auto; border: 1px solid var(--line); background: var(--page); padding: 2px 5px; font-size: .75rem; }
.guide-preview, .guide-notes { margin: 14px 0; border: 1px solid var(--line); }
.guide-preview summary, .guide-notes summary { padding: 12px; color: var(--blue-hover); cursor: pointer; font-weight: 600; line-height: 1.4; }
.guide-preview summary span { color: var(--muted); font-size: .85rem; font-weight: 400; margin-inline-start: 6px; }
.guide-pages { display: grid; gap: 14px; padding: 8px; background: var(--page); }
.guide-pages figure { margin: 0; }
.guide-pages img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--surface); }
.guide-pages figcaption { margin-top: 3px; text-align: center; font-size: .8rem; color: var(--muted); }
.guide-notes p { padding: 0 12px 12px; }
.delegate-card-list { max-height: 380px; overflow-y: auto; }
#guest-link, #guest-message { margin-bottom: 12px; }
#share-guest[hidden] { display: none; }
.reminder-card { margin-bottom: 10px; }
.record-list, .plain-list, .timeline { list-style: none; margin: 0; padding: 0; }
.record-list li + li, .plain-list li + li, .timeline li + li { border-top: 1px solid var(--line); }
.record-list + .button, .record-list + form, .empty + form { margin-top: 14px; }
.record { padding: 11px 0; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--ink); }
.record:hover .record-title { text-decoration: underline; text-underline-offset: .19em; }
.record > div { min-width: 0; }
.record-title, .record-meta { display: block; overflow-wrap: anywhere; }
.record-title { color: var(--blue-hover); font-weight: 600; line-height: 1.35; }
.record-meta { color: var(--muted); font-size: .81rem; margin-top: 4px; line-height: 1.45; }
.record-end { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 5px; }
.chevron, .download { color: var(--blue); font-size: 1.3rem; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 2px; background: #ebeff4; color: #344564; font-size: .75rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.badge.submitted,.badge.in_progress { background: #e3ecfa; color: #294f7a; }
.badge.approved,.badge.closed { color: #22503f; background: #dcefe2; }
.badge.returned { background: #faf0d4; color: #694900; }
.badge.urgent,.badge.overdue { background: #f8e5e0; color: #82341e; }
.job-record-end { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.job-statuses { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.job-record-end .job-statuses { justify-content: end; }
.job-statuses .badge { border-inline-start: 3px solid currentColor; border-radius: 4px; padding: 5px 8px; font-size: .8125rem; }
.job-statuses .draft { background: #e9edf1; color: #455260; }
.job-statuses .open { background: #deeee9; color: #206359; }
.job-statuses .overdue { background: #f8e1dc; color: #8c3027; }
.job-statuses .submitted { background: #ede6f3; color: #64517a; }
.job-meta { display: flex; gap: 9px 17px; flex-wrap: wrap; margin: -4px 0 19px; color: var(--muted); font-size: .87rem; }
.back { display: inline-flex; min-height: 44px; align-items: center; font-size: .88rem; font-weight: 600; text-decoration: none; margin-bottom: 2px; }
.back:hover { text-decoration: underline; }
.text-block { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.text-block:last-child, .muted:last-child { margin-bottom: 0; }
.muted,.empty { color: var(--muted); font-size: .88rem; }
.empty { padding: 12px; background: #f2f5f9; border-inline-start: 2px solid #bbc9dc; line-height: 1.45; }
.plain-list li, .timeline li { padding: 9px 0; overflow-wrap: anywhere; }
.timeline li div { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.timeline li small, .timeline time { color: var(--muted); font-size: .78rem; }
.timeline p { margin: 4px 0 0; font-size: .87rem; }
details { padding: 8px 0; }
summary { cursor: pointer; padding: 4px 0; min-height: 43px; }
summary .record-meta { padding-left: 16px; }
.notice { border: 1px solid #b8c9e0; border-inline-start: 3px solid var(--blue); background: var(--blue-tint); color: #283f60; padding: 11px 14px; margin: 0 0 16px; font-weight: 600; }
#plan + .panel > .button { margin-bottom: 14px; }
.panel > .text-block + .button { margin-top: 4px; }
[data-code-label][hidden] { display: none; }

@media (max-width: 840px) {
  .hero { display: grid; align-items: start; }
  .navigation a { padding-inline: 11px; }
}
@media (max-width: 660px) {
  .header-inner { min-height: 66px; padding-block: 9px; gap: 9px; }
  .navigation { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding-inline: 0; }
  .navigation a { min-height: 44px; padding: 9px 5px 6px; font-size: .83rem; border-right: 1px solid #46546a; }
  .navigation a:nth-child(3n) { border-right: 0; }
  .navigation a:nth-child(n+4) { border-top: 1px solid #46546a; }
  .dashboard-grid,.detail-grid { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .identity a { display: block; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .identity { gap: 6px; }
}
@media (max-width: 470px) {
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat { min-height: 65px; padding: 11px; }
  .page-head { align-items: start; flex-wrap: wrap; }
  .identity a { max-width: 53px; }
  .brand { gap: 8px; }
  .brand strong { font-size: .98rem; }
  .brand small { font-size: .72rem; margin-top: 4px; }
  .brand-mark { width: 36px; height: 36px; }
  .private { padding: 5px 6px; font-size: .7rem; text-align: center; max-width: 90px; }
  .record-end { max-width: 41%; }
  .record-end .badge { white-space: normal; text-align: center; }
}

.job-downloads { margin-bottom: 18px; }
.download-row { padding: 0 0 13px; }
.detail-list { display: grid; gap: 9px; margin: 0 0 14px; }
.detail-list div { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.detail-list dt { font-weight: 600; }
.detail-list dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.assessment-form { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.assessment-form .actions { margin-top: 10px; }
.assessment-upload summary { color: var(--blue); font-weight: 600; padding-block: 11px; }
.assessment-upload form { margin-top: 7px; }
.badge.pending { background: #e3ecfa; color: #294f7a; }
.badge.signed_off { background: #dcefe2; color: #22503f; }
.button:disabled { cursor: default; background: #e2e6ed; color: #4e5866; }
.dc85-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
@media (max-width: 660px) {
  .dc85-fields { grid-template-columns: minmax(0,1fr); gap: 0; }
}
