/* Remonti. Work-order aesthetic: paper greys, hairline rules, monospace data.
   No webfonts, no gradients, no rounded blobs. Everything on a 4px rhythm. */

:root {
  --paper: #eeeeeb;
  --surface: #ffffff;
  --surface-sunk: #f6f6f3;
  --ink: #16181a;
  --ink-2: #3d4247;
  --muted: #74797e;
  --rule: #d9d9d3;
  --rule-strong: #b5b5ad;

  --accent: #0c5460;
  --accent-hover: #093f48;
  --accent-soft: #e4eef0;

  --tone-neutral: #6b7075;
  --tone-progress: #2c6a8c;
  --tone-waiting: #9a6b0c;
  --tone-ready: #2b7a4b;
  --tone-done: #4a5a52;
  --tone-cancelled: #a33a31;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --radius: 3px;
  --shadow: 0 1px 2px rgba(22, 24, 26, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.011em; line-height: 1.2; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Small uppercase field label, the recurring structural device. */
.label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 5px;
}

.hint { font-size: 12.5px; color: var(--muted); }
.muted { color: var(--muted); }
.empty-value { color: var(--rule-strong); }

/* ---------- layout ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 5px;
}
.brand-shop {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  border-left: 1px solid var(--rule);
  padding-left: 10px;
  margin-left: 2px;
}
.topnav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topnav a, .topnav button {
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: var(--radius);
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.topnav a:hover, .topnav button:hover { background: var(--surface-sunk); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--surface-sunk); font-weight: 550; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; }
.wrap-narrow { max-width: 720px; }

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head .spacer { margin-left: auto; }
.page-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.backlink {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ---------- panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel-head h2 { font-size: 14px; }
.panel-body { padding: 16px; }
.panel-body-tight { padding: 12px 16px; }

.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.stack-16 > * + * { margin-top: 16px; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-sunk); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-block { width: 100%; }
.btn-small { font-size: 13px; padding: 5px 10px; }
.btn-link {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  font-size: 13.5px;
}
.btn-link:hover { background: none; text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 2px; }
.tabs a {
  font-size: 13.5px;
  padding: 6px 12px;
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
}
.tabs a:hover { background: var(--surface); text-decoration: none; }
.tabs a[aria-current="page"] {
  background: var(--surface);
  border-color: var(--rule);
  color: var(--ink);
  font-weight: 550;
}

/* ---------- table ---------- */

.table-scroll { overflow-x: auto; }
table.jobs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.jobs th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 500;
  padding: 9px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-sunk);
  white-space: nowrap;
}
table.jobs td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
table.jobs tbody tr:last-child td { border-bottom: 0; }
table.jobs tbody tr:hover { background: #fafaf8; }
.job-no {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cell-strong { font-weight: 550; }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); }
.cell-right { text-align: right; }
.cell-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---------- status chip ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  padding: 3px 9px 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  background: currentColor;
  flex: none;
}
.chip span { color: var(--ink); }
.chip-neutral { color: var(--tone-neutral); }
.chip-progress { color: var(--tone-progress); }
.chip-waiting { color: var(--tone-waiting); }
.chip-ready { color: var(--tone-ready); }
.chip-done { color: var(--tone-done); }
.chip-cancelled { color: var(--tone-cancelled); }

/* ---------- definition rows ---------- */

.dl { margin: 0; }
.dl > div { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.dl > div:first-child { padding-top: 0; }
.dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.dl dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 4px;
}
.dl dd { margin: 0; }
.dl dd.pre { white-space: pre-wrap; }

.spec-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.price-pair { display: flex; gap: 28px; flex-wrap: wrap; }
.price-value { font-family: var(--font-mono); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.notes-internal {
  background: var(--surface-sunk);
  border-left: 2px solid var(--rule-strong);
  padding: 10px 12px;
  white-space: pre-wrap;
  font-size: 14px;
}

/* ---------- forms ---------- */

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="url"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
}
input[type="file"] { font-size: 13px; }
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2374797e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-money { font-family: var(--font-mono); }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.field-row-3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1fr; }
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.check:last-child { border-bottom: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--rule);
  background: var(--surface-sunk);
  border-radius: 0 0 var(--radius) var(--radius);
}
.fieldset-legend {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding: 0;
  margin-bottom: 10px;
}
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset:last-of-type { margin-bottom: 0; }

/* ---------- notices ---------- */

.notice {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--tone-ready);
  background: var(--surface);
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.notice-error { border-left-color: var(--tone-cancelled); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.empty-state { padding: 44px 20px; text-align: center; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin-bottom: 16px; }

/* ---------- customer link box ---------- */

.linkbox {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-sunk);
}
.linkbox input {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 10px;
  min-width: 0;
}
.linkbox input:focus { box-shadow: none; }
.copy-status { font-size: 12.5px; color: var(--tone-ready); min-height: 18px; margin-top: 6px; }

/* ---------- status timeline (internal) ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 14px;
}
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 8px; height: 8px; background: var(--rule-strong); margin-top: 6px; }
.timeline li:last-child .dot { background: var(--accent); }
.timeline time { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ============ public customer page ============ */

.track-page {
  background: var(--paper);
  min-height: 100vh;
  padding: 20px 16px 40px;
}
.ticket {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(22, 24, 26, 0.08);
  overflow: hidden;
}
/* Perforated top edge: the one decorative flourish, and it earns its place
   because this page is the digital version of the paper repair slip. */
.ticket-perf {
  height: 8px;
  background-image: repeating-linear-gradient(90deg, var(--rule-strong) 0 5px, transparent 5px 10px);
  background-size: 10px 1px;
  background-repeat: repeat-x;
  background-position: 0 4px;
}
.ticket-head {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--rule);
}
.shop-id { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.shop-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.shop-name {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
}
.ticket-item { font-size: 21px; font-weight: 650; letter-spacing: -0.012em; }
.ticket-no {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* The status block is the signature element: a solid stamped panel, the one
   thing the customer opened the link for. */
.status-block {
  padding: 20px;
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--rule);
  border-left: 4px solid var(--tone);
}
.status-block.tone-neutral { --tone: var(--tone-neutral); }
.status-block.tone-progress { --tone: var(--tone-progress); }
.status-block.tone-waiting { --tone: var(--tone-waiting); }
.status-block.tone-ready { --tone: var(--tone-ready); }
.status-block.tone-done { --tone: var(--tone-done); }
.status-block.tone-cancelled { --tone: var(--tone-cancelled); }
.status-name {
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.015em;
  color: var(--tone);
  margin: 2px 0 6px;
}
.status-text { color: var(--ink-2); font-size: 14.5px; }
.status-updated {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
}

.ticket-section { padding: 18px 20px; border-bottom: 1px solid var(--rule); }
.ticket-section:last-child { border-bottom: 0; }

.track { list-style: none; margin: 0; padding: 0; }
.track li {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 0 0 14px;
  position: relative;
}
.track li:last-child { padding-bottom: 0; }
/* Rail connecting the nodes. */
.track li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--rule);
}
.track li.is-done:not(:last-child)::before { background: var(--tone-ready); }
.node {
  width: 16px;
  height: 16px;
  border: 2px solid var(--rule-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  color: #fff;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
.is-done .node { background: var(--tone-ready); border-color: var(--tone-ready); }
.is-current .node { background: var(--tone-progress); border-color: var(--tone-progress); }
.is-current.tone-waiting .node { background: var(--tone-waiting); border-color: var(--tone-waiting); }
.is-current.tone-ready .node { background: var(--tone-ready); border-color: var(--tone-ready); }
.is-current.tone-cancelled .node { background: var(--tone-cancelled); border-color: var(--tone-cancelled); }
.is-current.tone-done .node { background: var(--tone-done); border-color: var(--tone-done); }
.track .step-name { font-size: 14.5px; color: var(--muted); padding-top: 1px; }
.is-done .step-name { color: var(--ink-2); }
.is-current .step-name { color: var(--ink); font-weight: 620; }
.track time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  padding-top: 3px;
  white-space: nowrap;
}

.price-rows { display: grid; gap: 8px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.price-row .label { margin: 0; }
.price-row .amount { font-family: var(--font-mono); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.shop-contact { font-size: 14px; color: var(--ink-2); }
.shop-contact div + div { margin-top: 3px; }
.shop-contact a { word-break: break-word; }
.ticket-foot {
  max-width: 480px;
  margin: 14px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 0 8px;
}

/* ---------- landing ---------- */

.landing-nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.landing-nav .topnav { margin-left: auto; }
.hero {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 48px;
  align-items: start;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  max-width: 17em;
}
.hero-sub { font-size: 17px; color: var(--ink-2); max-width: 30em; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.hero-note { font-size: 13px; color: var(--muted); }
.hero-demo { }
.hero-demo .label { text-align: center; margin-bottom: 10px; }

.steps {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 56px;
}
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); }
.step-card { background: var(--surface); padding: 18px; }
.step-card .step-no {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.step-card h3 { margin-bottom: 5px; font-size: 15px; }
.step-card p { font-size: 14px; color: var(--muted); }

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- auth screens ---------- */

.auth-wrap { max-width: 400px; margin: 0 auto; padding: 48px 20px 64px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h1 { font-size: 21px; margin-bottom: 4px; }
.auth-alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.demo-creds {
  margin-top: 14px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface);
}
.demo-creds .mono { font-size: 12.5px; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .cols, .grid-2, .grid-3, .hero, .steps-grid, .field-row-3 { grid-template-columns: 1fr; }
  .hero { gap: 32px; padding-bottom: 36px; }
  .hero h1 { font-size: 27px; }
  .steps-grid { gap: 1px; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .wrap { padding: 16px 14px 48px; }
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .brand-shop { display: none; }
  .page-head { align-items: flex-start; }
  .page-head .spacer { margin-left: 0; width: 100%; }
  .page-head .btn { width: 100%; }
  .field-row { grid-template-columns: 1fr; }

  /* The jobs table becomes stacked records. Repair number and status stay on
     one line, because that pair is what the shop scans for. */
  table.jobs thead { display: none; }
  table.jobs, table.jobs tbody, table.jobs tr, table.jobs td { display: block; width: 100%; }
  table.jobs tr {
    border-bottom: 1px solid var(--rule);
    padding: 12px 14px;
    position: relative;
  }
  table.jobs tr:last-child { border-bottom: 0; }
  table.jobs td { border: 0; padding: 0; }
  table.jobs td + td { margin-top: 4px; }
  table.jobs td.cell-status { position: absolute; top: 12px; right: 14px; margin: 0; }
  table.jobs td.cell-open { margin-top: 10px; }
  table.jobs td.cell-open .btn { width: 100%; }
  table.jobs td.cell-no { padding-right: 130px; }
}

@media print {
  body { background: #fff; }
  .topbar, .topnav, .btn, .linkbox, .site-foot { display: none !important; }
  .panel { border-color: #ccc; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:active { transform: none; }
}

/* ============ printable protocol ============ */
/* Sized for A4. Everything here is black on white with real rules, because a
   protocol is a document the customer signs, not a screen. */

.doc-page { background: var(--paper); padding: 16px 16px 48px; }

.doc-toolbar {
  max-width: 210mm;
  margin: 0 auto 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.doc-warning {
  max-width: 210mm;
  margin: 0 auto 12px;
  font-size: 12.5px;
  color: var(--tone-waiting);
  border-left: 3px solid var(--tone-waiting);
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius);
}

.doc {
  max-width: 210mm;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 16mm 14mm;
  color: #000;
  font-size: 12px;
  line-height: 1.45;
}

.doc-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.doc-shop { display: flex; gap: 10px; align-items: flex-start; flex: 1; }
.doc-logo { width: 40px; height: 40px; object-fit: contain; }
.doc-shop-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.doc-shop-meta { font-size: 11px; color: #333; margin-top: 3px; }
.doc-ident { text-align: right; flex: none; max-width: 62mm; }
.doc-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.25;
}
.doc-no { font-family: var(--font-mono); font-size: 17px; font-weight: 700; margin-top: 4px; }
.doc-date { font-size: 11px; color: #333; }

.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.doc-box {
  border: 1px solid #000;
  padding: 8px 10px;
  margin-bottom: 10px;
  break-inside: avoid;
}
.doc-grid .doc-box { margin-bottom: 0; }
.doc-grid { margin-bottom: 10px; }

.doc-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #444;
  margin-bottom: 4px;
}
.doc-value { font-size: 13px; font-weight: 650; }
.doc-sub { font-size: 11px; color: #333; }
.doc-text { min-height: 30px; white-space: pre-wrap; }

/* Ruled blank space, for what gets written by hand at the counter. */
.doc-rules { display: block; padding-top: 6px; }
.doc-rules span {
  display: block;
  border-bottom: 1px dotted #666;
  height: 17px;
}

.doc-price-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px dotted #999;
  font-size: 12px;
}
.doc-price-rows > div:last-child { border-bottom: 0; }
.doc-price-rows strong { font-size: 13px; font-variant-numeric: tabular-nums; }

.doc-track { display: flex; gap: 12px; align-items: flex-start; }
.doc-track > div:first-child { flex: 1; min-width: 0; }
.doc-url { font-size: 11px; font-weight: 600; word-break: break-all; margin-top: 4px; }
.doc-qr { flex: none; width: 24mm; }
.doc-qr svg { width: 100%; height: auto; display: block; }

.doc-terms ol { margin: 0; padding-left: 16px; font-size: 10.5px; color: #222; }
.doc-terms li { margin-bottom: 2px; }

.doc-declaration { font-size: 11.5px; margin: 10px 0 0; }

.doc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr 34mm;
  gap: 14px;
  margin-top: 18mm;
}
.doc-sign-line { display: block; border-bottom: 1px solid #000; margin-bottom: 4px; }
.doc-signatures .doc-label { margin: 0; }
.doc-foot { font-size: 10px; color: #555; margin-top: 10px; text-align: center; }

@media (max-width: 640px) {
  .doc { padding: 12px; border: 0; }
  .doc-head { flex-direction: column; gap: 10px; }
  .doc-ident { text-align: left; max-width: none; }
  .doc-grid, .doc-signatures { grid-template-columns: 1fr; }
  .doc-signatures { margin-top: 24px; gap: 20px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  .doc-page { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .doc {
    max-width: none;
    border: 0;
    padding: 0;
    margin: 0;
    font-size: 10.5pt;
  }
  .doc-box { border-color: #000; }
  a { color: #000; text-decoration: none; }
}

/* ---------- internal work card ---------- */
/* Read at arm's length on a bench, so the repair number is large and the
   status is unmissable. Denser than the customer protocol, no signatures. */

.card { padding: 12mm; }

.card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.card-no-value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.card-status-value {
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  border: 2px solid #000;
  padding: 3px 8px;
  display: inline-block;
  margin-bottom: 3px;
}
.card-qr { width: 22mm; text-align: center; }
.card-qr svg { width: 100%; height: auto; display: block; }
.card-qr-caption {
  display: block;
  font-size: 7.5px;
  color: #444;
  line-height: 1.25;
  margin-top: 3px;
}

/* Technician notes are the reason this sheet exists, so they get the emphasis. */
.card-notes { border-width: 2px; }
.card-notes .doc-text { font-size: 13px; min-height: 40px; }

.card-history { list-style: none; margin: 0; padding: 0; font-size: 10.5px; }
.card-history li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  border-bottom: 1px dotted #bbb;
}
.card-history li:last-child { border-bottom: 0; }

.card-rules span { height: 21px; }
.card-foot { text-transform: uppercase; letter-spacing: 0.06em; font-size: 9px; }

@media (max-width: 640px) {
  .card-head { grid-template-columns: 1fr auto; }
  .card-qr { grid-column: 2; grid-row: 1; }
}
