:root {
  --paper: #f5f3ee;
  --surface: #ffffff;
  --ink: #15171a;
  --ink-2: #3b4046;
  --muted: #5c626a;
  --line: #d9d5cb;
  --line-strong: #b9b4a8;
  --accent: #1d5c45;
  --accent-hover: #164a37;
  --accent-soft: #e2ece6;
  --warn: #9a3d0c;
  --warn-soft: #f7e6d9;
  --danger: #a12622;
  --radius: 6px;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-variation-settings: "wdth" 88; font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-variation-settings: "wdth" 92; }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
strong { font-weight: 650; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.deliver :focus-visible { outline-color: #fff; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; border-radius: var(--radius); }
.skip:focus { top: 12px; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: var(--s4); }
.wordmark { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; font-variation-settings: "wdth" 85; display: flex; align-items: center; gap: var(--s2); }
.wordmark-tag { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 6px; }
nav[aria-label="Main"] { display: flex; align-items: center; gap: var(--s1); }
nav form { margin: 0; }
.nav-link {
  font: inherit; font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  background: none; border: 0; padding: 8px 10px; border-radius: var(--radius); cursor: pointer;
}
.nav-link:hover { color: var(--ink); background: rgba(21, 23, 26, 0.06); }
.site-footer { border-top: 1px solid var(--line); margin-top: var(--s9); padding: var(--s6) 0; color: var(--muted); font-size: 0.875rem; }
.footer-inner { display: flex; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
.footer-inner p { max-width: 60ch; }

/* Buttons */
.btn {
  --bg: var(--accent); --fg: #fff; --bd: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 18px; border-radius: var(--radius);
  background: var(--bg); color: var(--fg); border: 1.5px solid var(--bd);
  font: inherit; font-size: 0.9375rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { --bg: var(--accent-hover); --bd: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-ghost { --bg: transparent; --fg: var(--ink); --bd: var(--line-strong); }
.btn-ghost:hover { --bg: var(--surface); --bd: var(--ink); }
.btn-light { --bg: #fff; --fg: var(--ink); --bd: #fff; }
.btn-light:hover { --bg: var(--accent-soft); --bd: var(--accent-soft); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* Home: hero */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s8); align-items: center; padding: var(--s8) 0 var(--s9); }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.25rem); line-height: 1.0; margin: var(--s4) 0 var(--s5); }
.kicker { font-size: 0.9375rem; font-weight: 600; color: var(--accent); }
.lede { font-size: 1.1875rem; color: var(--ink-2); max-width: 54ch; margin-bottom: var(--s6); }
.fine { font-size: 0.875rem; color: var(--muted); margin-top: var(--s4); }

.example { margin: 0; }
.example figcaption { font-size: 0.8125rem; color: var(--muted); margin-bottom: var(--s2); font-family: var(--mono); }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(21, 23, 26, 0.35); }
.ticket-head { display: flex; justify-content: space-between; padding: var(--s3) var(--s5); border-bottom: 1px dashed var(--line-strong); font-size: 0.875rem; font-weight: 600; }
.ticket-body { display: grid; grid-template-columns: 96px 1fr; gap: var(--s5); padding: var(--s5); }
.ticket-fields { margin: 0; display: grid; gap: var(--s3); }
.ticket-fields dt { font-size: 0.8125rem; color: var(--muted); }
.ticket-fields dd { margin: 0; font-weight: 600; }
.ticket .timeline { padding: var(--s4) var(--s5) var(--s5); border-top: 1px solid var(--line); margin: 0; }

.shot { aspect-ratio: 9 / 17; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.shot span { display: block; background: #e3e0d8; border-radius: 2px; height: 5px; }
.shot .shot-bar { height: 8px; background: var(--line-strong); width: 50%; margin-bottom: 4px; }
.shot .shot-block { height: 34px; border-radius: 4px; margin: 4px 0; }
.w70 { width: 70%; } .w60 { width: 60%; } .w45 { width: 45%; } .w35 { width: 35%; }

/* Timeline (shared) */
.timeline { list-style: none; padding: 0; margin: 0 0 var(--s6); display: grid; grid-template-columns: repeat(4, 1fr); }
.timeline li { position: relative; padding-top: 22px; font-size: 0.875rem; display: flex; flex-direction: column; gap: 2px; padding-right: var(--s2); }
.timeline li::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 2px; background: var(--line); }
.timeline li::after { content: ""; position: absolute; top: 0; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li.done::before { background: var(--accent); }
.timeline li.done::after { background: var(--accent); border-color: var(--accent); }
.timeline li.current::after { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.t-label { font-weight: 600; color: var(--ink); }
.timeline li.todo .t-label { color: var(--muted); font-weight: 500; }
.t-time { color: var(--muted); font-family: var(--mono); font-size: 0.8125rem; min-height: 1.2em; }

/* The example ticket plays its progress once, left to right */
.timeline.play li::before { transform-origin: left; animation: fill-line 0.5s ease-out both; }
.timeline.play li::after { animation: fill-dot 0.3s ease-out both; }
.timeline.play li .t-time { animation: fade-in 0.3s ease-out both; }
.timeline.play li:nth-child(1)::after, .timeline.play li:nth-child(1) .t-time { animation-delay: 0.5s; }
.timeline.play li:nth-child(1)::before { animation-delay: 0.6s; }
.timeline.play li:nth-child(2)::after, .timeline.play li:nth-child(2) .t-time { animation-delay: 1.2s; }
.timeline.play li:nth-child(2)::before { animation-delay: 1.3s; }
.timeline.play li:nth-child(3)::after, .timeline.play li:nth-child(3) .t-time { animation-delay: 1.9s; }
.timeline.play li:nth-child(3)::before { animation-delay: 2.0s; }
.timeline.play li:nth-child(4)::after, .timeline.play li:nth-child(4) .t-time { animation-delay: 2.6s; }
.timeline.play li:nth-child(4)::before { animation-delay: 2.7s; }
.timeline li.just-done::before { transform-origin: left; animation: fill-line 0.6s ease-out; }
.timeline li.just-done::after { animation: fill-dot 0.4s ease-out, step-ping 0.9s ease-out 0.3s; }
.timeline li.just-done .t-label { animation: fade-in 0.4s ease-out; }
.status.just-changed { animation: status-flash 1.2s ease-out; }
@keyframes step-ping { 0% { box-shadow: 0 0 0 0 rgba(29, 92, 69, 0.45); } 100% { box-shadow: 0 0 0 12px rgba(29, 92, 69, 0); } }
@keyframes status-flash { 0% { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(27, 79, 138, 0.25); } 100% { transform: none; box-shadow: none; } }
@keyframes fill-line { from { transform: scaleX(0); } }
@keyframes fill-dot { from { background: var(--surface); border-color: var(--line-strong); } }
@keyframes fade-in { from { opacity: 0; } }

/* Home: how it works */
.how { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); padding: var(--s8) 0; }
.how h2 { margin-bottom: var(--s7); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s6); counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: var(--s4); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 0.875rem; color: var(--muted); margin-bottom: var(--s3); }
.steps h3 { margin-bottom: var(--s2); }
.steps p { color: var(--ink-2); }

/* Home: requirements */
.needs { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s7); padding: var(--s8) 0; }
.needs-list { margin: 0; }
.needs-list div { display: grid; grid-template-columns: 180px 1fr; gap: var(--s5); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.needs-list div:first-child { border-top: 1px solid var(--line); }
.needs-list dt { font-weight: 650; }
.needs-list dd { margin: 0; color: var(--ink-2); }

/* Home: deliver */
.deliver { background: var(--ink); color: #eceae4; padding: var(--s8) 0; margin-bottom: calc(-1 * var(--s9)); }
.deliver-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); align-items: start; }
.deliver h2 { color: #fff; margin-bottom: var(--s4); }
.deliver p { color: #c9c6be; max-width: 46ch; margin-bottom: var(--s6); }
.deliver-steps { margin: 0; padding: 0; list-style: none; counter-reset: d; }
.deliver-steps li { counter-increment: d; position: relative; padding: var(--s4) 0 var(--s4) 36px; border-bottom: 1px solid #33373c; color: #c9c6be; }
.deliver-steps li:first-child { border-top: 1px solid #33373c; }
.deliver-steps li::before { content: counter(d); position: absolute; left: 0; font-family: var(--mono); color: #8fc2a9; }
.deliver-steps strong { color: #fff; }

/* Forms */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); padding: var(--s8) 0; align-items: start; }
.split h1 { margin-bottom: var(--s4); }
.narrow { max-width: 520px; padding: var(--s8) 0; }
.narrow h1 { margin-bottom: var(--s5); }
.narrow > p { margin-bottom: var(--s5); color: var(--ink-2); }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: var(--s6); display: grid; gap: var(--s5); }
.form-wide { max-width: 760px; padding: 0; gap: 0; }
.form-wide fieldset { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: var(--s6); display: grid; gap: var(--s4); }
legend { font-weight: 700; font-size: 1.0625rem; padding: 0; display: flex; align-items: center; gap: var(--s3); float: left; width: 100%; }
legend + * { clear: both; }
.legend-n { font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
label { font-weight: 600; font-size: 0.9375rem; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.875rem; margin-left: 4px; }
.hint { font-size: 0.875rem; color: var(--muted); }
input:not([type=file]):not([type=hidden]), select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); width: 100%;
  min-height: 46px; padding: 10px 12px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: #6e737a; }
.has-error input, .has-error select, .has-error .drop { border-color: var(--danger); }
.error { color: var(--danger); font-size: 0.875rem; font-weight: 500; }
.form-error { background: #fbeae8; color: var(--danger); border-radius: var(--radius); padding: var(--s3) var(--s4); font-size: 0.9375rem; }
.form-foot { font-size: 0.9375rem; color: var(--muted); line-height: 1.8; }

.drop { display: block; border: 1.5px dashed var(--line-strong); border-radius: 8px; padding: var(--s5); cursor: pointer; font-weight: 400; transition: border-color 0.15s, background-color 0.15s; }
.drop:hover { border-color: var(--accent); background: #fafcfa; }
.drop:has(+ input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.drop-empty, .drop-filled > span { display: grid; gap: 4px; }
.drop-empty strong, .drop-name { color: var(--accent); }
.drop-filled:not([hidden]) { display: flex; gap: var(--s4); align-items: center; animation: fade-in 0.25s ease-out; }
.drop-filled img { width: 64px; height: 96px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); }
.drop-name { word-break: break-all; }

.pay-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s5) var(--s6); background: #fbfaf7; border-radius: 0 0 10px 10px; flex-wrap: wrap; }
.pay-bar strong { font-size: 1.375rem; }

.progress-list { list-style: none; padding: 0; margin: var(--s6) 0; display: grid; gap: 0; }
.progress-list li { position: relative; padding: 0 0 var(--s4) 30px; color: var(--muted); }
.progress-list li::before { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); }
.progress-list li:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 21px; bottom: 2px; width: 2px; background: var(--line); }
.progress-list li.done { color: var(--ink-2); }
.progress-list li.done::before { background: var(--accent); border-color: var(--accent); }
.progress-list li.done::after { background: var(--accent); }
.progress-list li.current { color: var(--ink); font-weight: 600; }
.progress-list li.current::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.devnote { border: 1.5px dashed var(--warn); background: var(--warn-soft); border-radius: var(--radius); padding: var(--s4); display: grid; gap: var(--s3); justify-items: start; font-size: 0.9375rem; }
.devnote a { color: var(--warn); font-weight: 600; }

/* App pages */
.page { padding: var(--s7) 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.page-head h1 { margin-top: 2px; }
.page > h1 { margin-bottom: var(--s3); }
.page > .lede { margin-bottom: var(--s6); }
.back { display: inline-block; font-size: 0.9375rem; text-decoration: none; margin-bottom: var(--s4); color: var(--ink-2); }
.back:hover { color: var(--accent); text-decoration: underline; }

.flash { margin-top: var(--s5); padding: var(--s3) var(--s4); border-radius: var(--radius); font-size: 0.9375rem; border-left: 4px solid; animation: flash-in 0.3s ease-out; }
.flash-success { background: var(--accent-soft); border-color: var(--accent); }
.flash-info { background: var(--surface); border-color: var(--ink-2); }
.flash-error { background: #fbeae8; border-color: var(--danger); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; padding: 3px 9px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-warn { color: var(--warn); background: var(--warn-soft); }
.status-open { color: #7a5a00; background: #f6efd6; }
.status-active { color: #1b4f8a; background: #e2ebf6; }
.status-done { color: var(--accent); background: var(--accent-soft); }
.status-muted { color: var(--muted); background: #ebe8e1; }

.list-title { font-size: 1.0625rem; font-variation-settings: "wdth" 100; letter-spacing: -0.01em; margin: var(--s6) 0 var(--s3); display: flex; align-items: center; gap: var(--s2); }
.count { font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; color: var(--muted); background: #ebe8e1; border-radius: 999px; padding: 1px 8px; }
.count-alert { color: #fff; background: var(--warn); }
.ticket-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ticket-row { display: grid; grid-template-columns: 90px 1fr auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s3); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background-color 0.15s; }
.ticket-row:hover { background: var(--surface); }
.ticket-row-main { display: grid; }
.ticket-row-main .muted { font-size: 0.875rem; }

.empty { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: var(--s7) var(--s6); color: var(--ink-2); }
.empty h2 { font-size: 1.25rem; margin-bottom: var(--s2); color: var(--ink); }
.empty p { max-width: 56ch; }
.aside-cta { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line); display: flex; gap: var(--s4); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.aside-cta p { max-width: 60ch; color: var(--ink-2); }

.callout { background: var(--warn-soft); border-radius: 10px; padding: var(--s5); margin-bottom: var(--s6); display: flex; gap: var(--s4); justify-content: space-between; align-items: center; flex-wrap: wrap; }
.callout-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
.callout form { margin: 0; }

.detail { display: grid; grid-template-columns: 1fr 260px; gap: var(--s7); align-items: start; }
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 160px 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.detail-shots { display: grid; gap: var(--s5); }
.detail-shot { display: grid; gap: var(--s2); text-decoration: none; font-size: 0.875rem; font-weight: 600; }
.detail-shot img { width: 100%; max-height: 460px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color 0.15s; }
.detail-shot:hover img { border-color: var(--accent); }

.pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--s8); align-items: start; }
.pay-summary h1 { margin-bottom: var(--s5); }
.pay-summary .facts { margin-bottom: var(--s5); }
.pay-summary .facts div { grid-template-columns: 130px 1fr; }
.pay-summary > p { max-width: 46ch; font-size: 0.9375rem; }
.checkout { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: var(--s3); min-height: 420px; }
.checkout-status { padding: var(--s6) var(--s4); color: var(--muted); }
.checkout-status.is-error { color: var(--danger); }

.code-box { border: 2px solid var(--ink); border-radius: 10px; padding: var(--s5); margin-bottom: var(--s6); display: grid; grid-template-columns: auto 1fr; column-gap: var(--s6); align-items: center; background: var(--surface); }
.code-label { grid-column: 1; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.code { grid-column: 1; font-family: var(--mono); font-size: 2.75rem; font-weight: 700; letter-spacing: 0.18em; line-height: 1.1; }
.code-box > p:last-child { grid-column: 2; grid-row: 1 / 3; color: var(--ink-2); max-width: 42ch; }
.inline-form { display: inline-block; margin: 0 0 0 var(--s2); }

.chat { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: var(--s6); display: flex; flex-direction: column; }
.chat-head { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.chat-head h2 { font-size: 1.0625rem; font-variation-settings: "wdth" 100; letter-spacing: -0.01em; }
.chat-log { list-style: none; margin: 0; padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s3); max-height: 360px; overflow-y: auto; }
.chat-log:empty { display: none; }
.chat-empty { padding: var(--s5); color: var(--muted); font-size: 0.9375rem; }
.msg { max-width: 78%; align-self: flex-start; }
.msg.is-new { animation: msg-in 0.2s ease-out; }
.msg-body { background: #efece5; border-radius: 12px 12px 12px 4px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: 0.75rem; color: var(--muted); margin-top: 3px; padding-inline: 4px; }
.msg-mine { align-self: flex-end; }
.msg-mine .msg-body { background: var(--accent); color: #fff; border-radius: 12px 12px 4px 12px; }
.msg-mine .msg-meta { text-align: right; }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } }
.chat-form { display: flex; gap: var(--s2); align-items: flex-end; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 44px; resize: none; line-height: 1.4; }
.chat-hint, .chat-closed { font-size: 0.8125rem; color: var(--muted); padding: 0 var(--s4) var(--s3); }
.chat-closed { padding: var(--s3) var(--s5); border-top: 1px solid var(--line); }
.chat-page .chat-log { max-height: min(60vh, 520px); }
.chat-page { max-width: 760px; }
.ticket-row-end { display: flex; align-items: center; gap: var(--s2); }
.job-chat { position: relative; overflow: visible; }
.unread-dot { position: absolute; top: -6px; right: -6px; width: 14px; height: 14px; border-radius: 50%; background: #d92d20; border: 2px solid var(--surface); animation: unread-blink 1.1s ease-in-out infinite; }
@keyframes unread-blink { 50% { opacity: 0.2; } }
.receipt.is-read { color: var(--accent); font-weight: 600; }

/* Courier */
.earnings, .stats { margin: 0 0 var(--s6); display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.earnings div, .stats div { padding: var(--s4) var(--s6) var(--s4) 0; margin-right: var(--s6); }
.earnings div + div, .stats div + div { border-left: 1px solid var(--line); padding-left: var(--s6); margin-right: 0; }
.earnings dt, .stats dt { font-size: 0.8125rem; color: var(--muted); }
.earnings dd, .stats dd { margin: 0; font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; font-variation-settings: "wdth" 90; }
.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.job { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s5); align-items: center; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; animation: fade-in 0.25s ease-out; }
.job-active { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); grid-template-columns: 64px 1fr auto; row-gap: var(--s4); }
.job-active > .job-chat { align-self: start; }
.job-active > .job-steps, .job-active > .job-actions, .job-active > .deliver-form { grid-column: 1 / -1; }
.job-active > .job-actions { justify-content: flex-start; }
.job-steps { list-style: none; margin: 0; padding: var(--s3) 0 0; border-top: 1px solid var(--line); display: flex; gap: var(--s5); font-size: 0.875rem; color: var(--muted); counter-reset: js; }
.job-steps li { counter-increment: js; display: flex; align-items: center; gap: var(--s2); }
.job-steps li::before { content: counter(js); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 0.75rem; border: 1.5px solid var(--line-strong); }
.job-steps li.done { color: var(--ink-2); }
.job-steps li.done::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: #fff; }
.job-steps li.current { color: var(--ink); font-weight: 600; }
.job-steps li.current::before { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.deliver-form { display: grid; grid-template-columns: 1fr 180px auto; gap: var(--s4); align-items: end; }
.drop-compact { padding: var(--s3) var(--s4); }
.drop-compact .drop-filled img { width: 44px; height: 60px; }
.code-input { font-family: var(--mono) !important; font-size: 1.375rem !important; letter-spacing: 0.3em; text-align: center; }
.job h3 { margin: 2px 0; font-size: 1.1875rem; }
.job-main { display: grid; gap: 2px; min-width: 0; }
.job-note { font-size: 0.9375rem; color: var(--ink-2); }
.job-actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.job-actions form { margin: 0; }
.thumb img { width: 64px; height: 92px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); }
.thumb:hover img { border-color: var(--accent); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th { text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--muted); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: #fbfaf7; }
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfaf7; }
.table form { margin: 0; }
.row-pending { box-shadow: inset 4px 0 0 var(--warn); }

.tabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; }
.tabs a { padding: var(--s3) 0; color: var(--ink-2); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: var(--s2); align-items: center; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-color: var(--ink); }
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.filters a { font-size: 0.875rem; font-weight: 500; text-decoration: none; color: var(--ink-2); padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; }
.filters a:hover { border-color: var(--ink); color: var(--ink); }
.filters a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Responsive */
@media (max-width: 900px) {
  .hero, .split, .deliver-grid, .needs { grid-template-columns: 1fr; gap: var(--s6); }
  .hero { padding: var(--s6) 0 var(--s8); }
  .example { max-width: 460px; }
  .steps { grid-template-columns: 1fr; gap: var(--s5); }
  .detail, .pay { grid-template-columns: 1fr; gap: var(--s5); }
  .checkout { padding: 0; border: 0; background: none; min-height: 0; }
  .detail-shot { max-width: 260px; order: -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .hide-sm { display: none; }
  .wordmark { white-space: nowrap; }
  nav[aria-label="Main"] { gap: 0; }
  .nav-link { font-size: 0.875rem; padding: 8px 7px; white-space: nowrap; }
  .page-head .btn-sm { width: auto; }
  .split, .narrow, .needs, .how, .deliver { padding-block: var(--s7); }
  .lede { font-size: 1.0625rem; }
  .actions .btn { flex: 1 1 100%; }
  .needs-list div, .facts div { grid-template-columns: 1fr; gap: 2px; }
  .field-row { grid-template-columns: 1fr; }
  .form { padding: var(--s5); }
  .form-wide { padding: 0; }
  .form-wide fieldset { padding: var(--s5); }
  .pay-bar { padding: var(--s5); }
  .pay-bar .btn { width: 100%; }
  .page-head .btn { width: 100%; }
  .ticket-row { grid-template-columns: 1fr auto; }
  .ticket-row .mono { grid-column: 1 / -1; margin-bottom: -10px; }
  .job { grid-template-columns: 56px 1fr; gap: var(--s4); }
  .thumb img { width: 56px; height: 80px; }
  .job-actions { grid-column: 1 / -1; justify-content: stretch; }
  .deliver-form { grid-template-columns: 1fr; }
  .job-active > .job-chat { grid-column: 1 / -1; width: 100%; }
  .msg { max-width: 88%; }
  .chat-log, .chat-head { padding-inline: var(--s4); }
  .deliver-form .btn { width: 100%; }
  .job-steps { gap: var(--s4); }
  .code-box { grid-template-columns: 1fr; }
  .code-box > p:last-child { grid-column: 1; grid-row: auto; margin-top: var(--s3); }
  .timeline li { font-size: 0.8125rem; }
  .job-actions form { flex: 1; }
  .job-actions .btn { width: 100%; }
  .earnings div, .stats div { padding: var(--s3) var(--s4) var(--s3) 0; margin-right: var(--s4); }
  .earnings div + div, .stats div + div { padding-left: var(--s4); }
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stats div, .stats div + div { border-left: 0; padding: var(--s3) 0; margin: 0; border-bottom: 1px solid var(--line); }
  .stats div:nth-child(even) { border-left: 1px solid var(--line); padding-left: var(--s4); }
  .earnings dd, .stats dd { font-size: 1.375rem; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table thead { display: none; }
  .table tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 96px 1fr; gap: var(--s3); }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; }
  .table td > * { justify-self: start; }
  .table td[data-label=""] { grid-template-columns: 1fr; padding-top: var(--s2); }
  .table td[data-label=""]::before { display: none; }
  .ticket-body { grid-template-columns: 76px 1fr; gap: var(--s4); padding: var(--s4); }
  .ticket .timeline { padding-inline: var(--s4); }
}

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