:root {
  --ink: #14181C; --muted: #5B636B; --soft: #4A5159; --ground: #F4F3EF; --surface: #FFFFFF;
  --line: #D9D8D2; --line-soft: #E5E4DE; --field: #8A9097; --tint: #FAF9F6; --tint-2: #EDECE6;
  --accent: #C2410C; --accent-dark: #7C2D0A;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--ground); line-height: 1.5; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.scrollbox:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 700; text-transform: uppercase; }
h2 { font-size: 28px; letter-spacing: 0.02em; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1 1 auto; padding: 48px 40px 64px; }
.container { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
.container.wide { max-width: 1200px; }
.row { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-edit { flex: 1 1 380px; min-width: 0; }
.col-list { flex: 999 1 600px; min-width: 0; }

.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 40px; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header.admin { background: var(--ink); color: #F4F3EF; }
.site-header.admin a { color: #F4F3EF; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-admin { padding: 4px 10px; background: var(--accent); color: #fff; border-radius: 4px; font-family: var(--mono);
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; }
.header-right { display: flex; align-items: center; gap: 20px; font-size: 15px; flex-wrap: wrap; }
.header-right a { font-weight: 600; }
.site-footer { padding: 24px 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 24px; }
.inline-form { display: inline; margin: 0; }
.link-button { padding: 0; background: none; border: 0; font: inherit; font-weight: 600; color: inherit;
  text-decoration: underline; cursor: pointer; }

.eyebrow { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.hero-title { font-size: 68px; line-height: 0.98; }
.lead { font-size: 18px; line-height: 1.5; color: var(--soft); max-width: 480px; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.45; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-md { display: flex; flex-direction: column; gap: 16px; }
.split { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.split > .stack { flex: 1 1 420px; min-width: 0; }
.split > aside { flex: 1 1 340px; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 32px;
  display: flex; flex-direction: column; gap: 20px; }
.card.compact { padding: 28px; gap: 16px; }
.card.compact h2 { font-size: 24px; }
.card.dark { background: var(--ink); color: #F4F3EF; border-color: var(--ink); }
.card.dark .small { color: #C9CDD2; }
.card.attention { border: 2px solid var(--accent); }
.card.ok { background: #E3F2E7; border-color: #9CC9A8; color: #1F3D2A; padding: 20px 28px; flex-direction: row; align-items: center; gap: 16px; }
.card.narrow { max-width: 520px; }
.big-date { font-family: var(--display); font-size: 44px; line-height: 1.05; font-weight: 700; text-transform: uppercase; }

label, .label { font-size: 14px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 8px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=date], select, textarea {
  width: 100%; height: 48px; padding: 0 14px; font-family: var(--body); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--field); border-radius: 6px; }
textarea { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; }
input[type=file] { width: 100%; padding: 14px; font-family: var(--body); font-size: 14px; background: var(--tint);
  border: 1.5px dashed var(--field); border-radius: 6px; }
input[type=checkbox] { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check { display: flex; align-items: flex-start; gap: 12px; }
.check label { font-weight: 400; font-size: 15px; }
.mono { font-family: var(--mono); }
.money { display: flex; align-items: stretch; height: 48px; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; background: #fff; }
.money span { display: flex; align-items: center; padding: 0 14px; background: var(--tint-2); font-weight: 600; }
.money input { border: 0; border-radius: 0; height: 100%; font-family: var(--mono); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  font-family: var(--body); font-size: 16px; font-weight: 600; text-decoration: none; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #A8370A; color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2B3036; color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--field); min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-outline:hover { color: var(--ink); border-color: var(--ink); }
.btn-block { display: flex; width: 100%; }
.btn-disabled { background: #E8E7E1; color: var(--muted); cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.flash { padding: 14px 18px; border-radius: 6px; font-size: 15px; border: 1px solid; }
.flash.ok { background: #E3F2E7; border-color: #9CC9A8; color: #1F3D2A; }
.flash.error { background: #FBE9E7; border-color: #E0A39B; color: #7A1F12; }
.flashes { display: flex; flex-direction: column; gap: 10px; }

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #E8EAEE; color: #2B3036; white-space: nowrap; }
.pill.s0 { background: #E8EAEE; color: #2B3036; }
.pill.s1 { background: #DCE8F5; color: #17406B; }
.pill.s2 { background: #FDE3D3; color: #7C2D0A; }
.pill.s3 { background: #F6EBC4; color: #5C4300; }
.pill.s4, .pill.good { background: #D5EDDA; color: #14532D; }
.pill.warn { background: #FDE3D3; color: #7C2D0A; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.status-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.tracker { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.tracker li { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.bar { height: 8px; border-radius: 4px; background: var(--line); }
.done .bar { background: var(--ink); }
.current .bar { background: var(--accent); }
.stage-name { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.next .stage-name { font-weight: 500; color: var(--muted); }
.current .stage-name, .current .stage-note { color: var(--accent-dark); }
.stage-note { font-size: 14px; color: var(--muted); }
.current .stage-note { font-weight: 600; }

.photos { display: flex; flex-wrap: wrap; gap: 16px; }
.photos figure { flex: 1 1 160px; max-width: 260px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--tint-2); }
.photos figcaption { font-size: 14px; font-weight: 500; }
.photos form { margin: 0; }

.updates article { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 20px 0; border-top: 1px solid var(--line-soft); }
.updates article:first-of-type { margin-top: 8px; }
.updates time { flex: 0 0 170px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.updates .body { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.updates .body p { font-size: 15px; line-height: 1.55; color: #3A4149; white-space: pre-wrap; }

.filebox { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--tint); }
.filebox .grow { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.scrollbox { max-height: 220px; overflow-y: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--tint); font-size: 14px; line-height: 1.6; color: #3A4149; white-space: pre-wrap; }
dl.facts { margin: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
dl.facts div { display: flex; justify-content: space-between; gap: 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 500; text-align: right; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; background: var(--tint-2); color: #3A4149; font-size: 13px; letter-spacing: 0.04em; padding: 14px 20px; font-weight: 600; }
td { padding: 16px 20px; border-top: 1px solid var(--line-soft); }
td a { font-family: var(--mono); font-weight: 500; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toolbar input[type=search] { width: 280px; max-width: 100%; height: 44px; }
.section-break { padding-top: 20px; border-top: 1px solid var(--line-soft); }
.scroll-box-inner { display: flex; flex-direction: column; gap: 10px; }
details.card summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.hidden-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 700px) { .tracker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.main > .flashes { margin: 0 auto 24px; width: 100%; }

@media (max-width: 640px) {
  .main { padding: 32px 16px 48px; }
  .site-header, .site-footer { padding-left: 16px; padding-right: 16px; }
  .hero-title { font-size: 48px; }
  .card { padding: 22px; }
  .split { gap: 32px; }
}

/* additions: no inline styles are allowed by the Content-Security-Policy */
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; align-items: center; gap: 16px; }
.step-num { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid #9CA3AB; display: flex;
  align-items: center; justify-content: center; font-family: var(--mono); font-size: 14px; }
.step-name { font-size: 17px; }
.dark-break { border-color: #3A4149; }
.job-title { font-size: 52px; line-height: 1; }
.soft { color: var(--soft); font-size: 15px; line-height: 1.5; }
.narrow-field { max-width: 420px; }
.grow-note { flex: 1 1 220px; }
.ok-text { color: #1F3D2A; }
.paid-note { font-size: 17px; font-weight: 600; color: #14532D; }
.wrap { overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.form-grid > .small, .form-grid > .btn-row { grid-column: 1 / -1; }
form.form-grid { display: grid; }
details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 12px; }
button:disabled, input:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 640px) { .job-title { font-size: 40px; } }

/* barcode scanning and labels */
[hidden] { display: none !important; }
.site-header.admin .scan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.site-header.admin .scan input[type=search] { width: 230px; max-width: 100%; height: 40px; }
.scan-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 24, 28, 0.96); color: #fff; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; text-align: center; }
.scan-overlay video { max-width: 100%; max-height: 60vh; border-radius: 8px; background: #000; }
.label { width: 90mm; max-width: 100%; background: #fff; color: #000; border: 1px solid #000; padding: 4mm;
  display: flex; flex-direction: column; gap: 2mm; }
.label-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; }
.label-number { display: flex; align-items: baseline; gap: 8px; }
.label-number .eyebrow { color: #000; }
.label-number strong { font-size: 30px; letter-spacing: 0.06em; }
.label-barcode svg { display: block; width: 100%; height: 22mm; }
.label-meta { font-size: 12px; }
.label-foot { font-size: 11px; border-top: 1px solid #000; padding-top: 2mm; overflow-wrap: anywhere; }
@media print {
  @page { margin: 8mm; }
  body { background: #fff; }
  .site-header, .no-print, .flashes, .site-footer { display: none !important; }
  .main { padding: 0; }
  .container { gap: 0; }
}

.site-header.admin .brand { color: #F4F3EF; }
.brand-logo { height: 36px; width: auto; display: block; }
