@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1c1915;
  --ink-soft: #5e584e;
  --paper: #efe8dc;
  --card: #fffdf8;
  --line: #e0d5c6;
  --line-strong: #c9bba8;
  --orange: #e25c12;
  --orange-deep: #8a3410;
  --orange-wash: #fff1e6;
  --pine: #1e3328;
  --pine-ink: #f4f7f5;
  --pine-wash: #e5f0e8;
  --clay: #8d3b2a;
  --clay-wash: #f8ebe6;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04), 0 10px 28px rgba(28, 25, 21, 0.06);
  --font: "Barlow", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Barlow", sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(30, 51, 40, 0.05), transparent 180px),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}
body.gate-body { background: var(--pine); }
img { max-width: 100%; height: auto; }
a { color: var(--orange-deep); }
button, [role="button"], a, summary, label.checkline { cursor: pointer; }
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: 0;
  transform: translateY(-200%);
  background: white;
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { transform: none; top: 12px; }

.site-header {
  background: var(--pine);
  color: var(--pine-ink);
  border-bottom: 6px solid var(--orange);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--orange);
  color: #fffaf6;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: 0.01em;
}
.top-links { display: none; }
.who {
  margin-left: auto;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 0 4px 8px;
  color: inherit;
  text-decoration: none;
  text-align: right;
  line-height: 1.15;
}
.who span { display: block; font-weight: 600; }
.who small { display: block; opacity: 0.75; font-size: 0.78rem; }

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 16px 108px;
}

.flash {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 600;
}
.flash.ok { background: var(--pine-wash); color: var(--pine); }
.flash.bad { background: var(--clay-wash); color: var(--clay); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card h1, .card h2, .section-title {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0 0 8px;
}
.card h1, h1.section-title { font-size: 2.15rem; }
.card h2 { font-size: 1.55rem; }
.lede { margin: 0 0 12px; color: var(--ink-soft); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
a.stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 92px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}
a.stat strong {
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 700;
}
a.stat span { color: var(--ink-soft); font-size: 0.92rem; font-weight: 600; }
a.stat.hot { background: var(--pine); color: var(--pine-ink); border-color: var(--pine); }
a.stat.hot span { color: #d5e4da; }
a.stat.warn { background: var(--clay-wash); border-color: transparent; }
a.stat.warn strong, a.stat.warn span { color: var(--clay); }

.job-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  padding: 14px 2px;
  border-top: 1px solid var(--line);
  min-height: 72px;
}
.card .job-row:first-of-type { border-top: 0; padding-top: 4px; }
.job-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.job-row-top strong { font-size: 1.12rem; }
.job-row-mid { font-weight: 600; }
.job-row-sub { color: var(--ink-soft); font-size: 0.92rem; }
.job-row-sub em { color: var(--clay); font-style: normal; font-weight: 700; }
.job-row:active { background: #fff7ef; }

.stamp {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #f6f1e8;
  color: var(--ink);
  white-space: nowrap;
}
.stamp.s-ready { background: var(--pine-wash); color: var(--pine); }
.stamp.s-repair { background: var(--orange-wash); color: var(--orange-deep); }
.stamp.s-wait { background: var(--clay-wash); color: var(--clay); }
.stamp.s-done { background: #f3efe8; color: var(--ink-soft); }

.banner {
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--clay-wash);
  color: var(--clay);
  font-weight: 600;
}
.banner.ok { background: var(--pine-wash); color: var(--pine); }
.banner strong { display: block; font-family: var(--display); font-size: 1.4rem; font-weight: 700; }

.wo-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.wo-number {
  font-family: var(--display);
  font-weight: 700;
  font-size: 3.1rem;
  line-height: 0.85;
  letter-spacing: 0.01em;
  margin: 0;
}
.wo-kicker { margin: 0; color: var(--ink-soft); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; }
.equip { font-size: 1.2rem; font-weight: 650; margin: 8px 0 0; }
.facts { display: grid; gap: 8px; margin: 12px 0 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.facts dt { color: var(--ink-soft); font-weight: 600; }
.facts dd { margin: 0; text-align: right; font-weight: 650; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--orange);
  color: #fffaf6;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn.pine { background: var(--pine); color: var(--pine-ink); }
.btn.danger { background: var(--clay); color: #fff8f6; }
.btn.small { min-height: 44px; width: auto; padding: 8px 12px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.stack { display: grid; gap: 8px; }
.inline-form { display: grid; gap: 8px; }

label.lbl { display: block; font-weight: 700; margin: 12px 0 6px; }
.help { color: var(--ink-soft); font-size: 0.92rem; margin: 6px 0 0; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="search"], input[type="url"], select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input[type="file"] { font: inherit; width: 100%; max-width: 100%; color: var(--ink-soft); }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 700; color: var(--ink); background: white;
  min-height: 48px; padding: 10px 16px; margin-right: 12px;
  border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer;
}
.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  font-weight: 650;
}
.checkline { min-height: 44px; align-items: center; }
.checkline input { width: 28px; height: 28px; margin: 0; flex: none; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair > *, .pair-3 > * { min-width: 0; }

.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; border-radius: 12px; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper); }
.photo-grid figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 4px; }

.line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.line small { display: block; color: var(--ink-soft); font-weight: 500; }
.totals { margin-top: 8px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .due { font-family: var(--display); font-size: 2rem; font-weight: 700; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 14px; border-left: 3px solid var(--line); }
.timeline strong { display: block; }
.timeline span { color: var(--ink-soft); font-size: 0.9rem; }

.tech-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; font-weight: 700; }
.empty { color: var(--ink-soft); margin: 8px 0; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fffdf8;
  border-top: 1px solid var(--line);
  z-index: 4;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  position: relative;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}
.bottom-nav a.on { color: var(--orange-deep); }
.icon { width: 24px; height: 24px; }
.badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 26px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--orange);
  color: white;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 18px;
  text-align: center;
}

.gate { width: min(460px, calc(100% - 28px)); margin: 28px auto 48px; }
.gate-card {
  background: var(--card);
  color: var(--ink);
  border-radius: 22px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
}
.gate .brand { margin-bottom: 18px; }
.gate .brand-kicker, .gate .brand-name { color: var(--pine-ink); }
.demo { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.demo p { margin: 0 0 8px; color: var(--ink-soft); }
.pin-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pin-input { font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; }
.pin-input::placeholder { letter-spacing: normal; font-size: 1rem; }
.pin-form .btn { margin-top: 14px; }

.print-sheet { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; max-width: 8in; }
.mast-kicker { margin: 0; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }
.mast-title { font-family: var(--display); font-size: 2.4rem; margin: 0 0 6px; line-height: 0.95; }
.ticket-no { font-family: var(--display); font-size: 4rem; line-height: 0.85; margin: 8px 0; }
.quote { margin: 0; font-size: 1.15rem; }
.history-same { box-shadow: inset 4px 0 0 var(--orange); }

@media (min-width: 900px) {
  body.gate-body {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .gate { margin: 32px auto; }
  .site-header-inner { padding: 16px 28px; }
  .top-links { display: flex; gap: 6px; align-items: center; }
  .top-links a {
    color: var(--pine-ink);
    text-decoration: none;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 999px;
  }
  .top-links a.on { background: rgba(255, 250, 246, 0.12); }
  .wrap { padding: 28px 28px 64px; }
  .bottom-nav { display: none; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .dash { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; align-items: start; }
  .job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
  .btn.fit, .stack.fit .btn { width: auto; }
  .stack.row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .pair-3 { display: grid; grid-template-columns: 1.2fr 1fr 0.7fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  @page { size: letter; margin: 0.6in; }
  .site-header, .bottom-nav, .no-print, .flash { display: none !important; }
  body { background: white; }
  .wrap { padding: 0; max-width: none; }
  .print-sheet, .card { box-shadow: none; border: none; border-radius: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
  body { font-size: 10.5pt; line-height: 1.3; }
  .print-sheet { padding: 0; }
  .print-sheet h2 { font-size: 13pt; margin: 10pt 0 4pt; }
  .print-sheet p { margin: 4pt 0; }
  .mast-title { font-size: 20pt; }
  .ticket-no { font-size: 30pt; margin: 4pt 0; }
  .facts { gap: 3pt; margin-top: 6pt; }
  .facts div { padding-top: 3pt; }
  .line { padding: 4pt 0; }
  .totals div { padding: 2pt 0; }
  .totals .due { font-size: 16pt; padding-top: 4pt; }
  .totals, .facts div, .line { break-inside: avoid; page-break-inside: avoid; }
  html, body { min-height: 0 !important; height: auto !important; }
  .skip { display: none !important; }
}
