/* Automated App - Woody's Wild West look: black + sepia with orange #ff990a accents */
:root {
  --black: #000; --ink: #0d0a07; --panel: #17110b; --panel2: #221910;
  --sepia: #f3e6cf; --sepia-dim: #b9a688; --tan: #8a6a45; --line: #3a2c1c;
  --orange: #ff990a; --orange-dk: #d97e00; --red: #ff6b5a; --green: #8fd18f;
  --radius: 10px; --serif: "Rockwell", "Roboto Slab", "Georgia", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--sepia); font-family: var(--sans); font-size: 17px; line-height: 1.5;
  background: radial-gradient(ellipse at top, #2a1d10 0%, #0d0a07 55%, #000 100%) fixed;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
a { color: var(--orange); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--orange); color: #000; padding: 6px 10px; z-index: 10; }
h1, h2, h3 { font-family: var(--serif); color: var(--sepia); line-height: 1.2; letter-spacing: .01em; }
h1 { font-size: 1.9rem; margin: .2em 0 .5em; }
h2 { font-size: 1.35rem; }
.accent { color: var(--orange); }
.muted { color: var(--sepia-dim); } .fine { font-size: .85rem; color: var(--sepia-dim); text-align: center; }
.err { color: var(--red); }

.site-header { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 14px 20px 10px;
  border-bottom: 3px solid var(--orange); background: #000; }
.brand img { display: block; width: 104px; height: auto; }
.topnav { display: none; gap: 22px; }
.topnav a { color: var(--sepia); text-decoration: none; font-family: var(--serif); font-size: 1.05rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
.topnav a:hover { border-color: var(--orange); color: var(--orange); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 18px 16px 32px; }
.hero { text-align: center; padding: 18px 4px 6px; }
.hero .lead { color: var(--sepia-dim); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }
.cards { display: grid; gap: 16px; margin: 22px 0; }
.card { display: block; padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  color: var(--sepia); text-decoration: none; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--orange); }
.card-primary { background: linear-gradient(160deg, #2b1f12, #120d08); border-color: var(--tan); }
.card h2 { margin-top: 0; color: var(--orange); }
.steps { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px 12px; }
.steps li { margin: .4em 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 14px 0; }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.btn { display: inline-block; background: var(--orange); color: #000; font-weight: 700; border: 2px solid var(--orange);
  border-radius: 8px; padding: 12px 20px; text-decoration: none; cursor: pointer; font-size: 1rem; font-family: var(--sans); margin: 4px 2px; }
.btn:hover { background: var(--orange-dk); border-color: var(--orange-dk); }
.btn-ghost { background: transparent; color: var(--orange); }
.btn-ghost:hover { background: rgba(255,153,10,.12); }
.btn-block { display: block; width: 100%; margin-top: 18px; font-size: 1.1rem; padding: 14px; }
.btn-sm { padding: 6px 12px; font-size: .9rem; }

.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 16px; margin: 0 0 16px; }
.form legend { font-family: var(--serif); color: var(--orange); padding: 0 6px; font-size: 1.1rem; }
.form label { display: block; margin: 14px 0 5px; font-weight: 600; }
.form input, .form select, .form textarea { width: 100%; padding: 12px; font-size: 16px; color: var(--sepia);
  background: var(--ink); border: 1px solid var(--tan); border-radius: 8px; font-family: var(--sans); }
.form input::placeholder, .form textarea::placeholder { color: #7a6650; }
.form [aria-invalid="true"] { border-color: var(--red); }
.form input[type="date"] { color-scheme: dark; }
.form.inline { margin-top: 14px; }
.req { color: var(--orange); } .opt { color: var(--sepia-dim); font-weight: 400; font-size: .9em; }
.hint { margin: 4px 0 0; font-size: .85rem; color: var(--sepia-dim); }
.field-error { margin: 4px 0 0; color: var(--red); font-size: .9rem; }
.row2 { display: grid; gap: 0 14px; }
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.alert { background: rgba(255,107,90,.12); border: 1px solid var(--red); color: #ffd2cb; padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.notice { background: rgba(143,209,143,.1); border: 1px solid var(--green); padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.conf { font-family: var(--serif); font-size: 2rem; color: var(--orange); letter-spacing: .08em; margin: .2em 0; user-select: all; }
.status-card { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.steps { list-style: none; display: flex; padding: 0; margin: 14px 0 16px; cursor: default; user-select: none; }
.step { flex: 1; position: relative; text-align: center; font-size: .82rem; color: var(--sepia-dim); opacity: .6; }
.step::before { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; border-top: 1px solid var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { position: relative; z-index: 1; display: block; width: 18px; height: 18px; margin: 0 auto 4px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); font-size: 12px; line-height: 16px; }
.step.done, .step.current { opacity: 1; color: var(--sepia); }
.step.done .dot { color: var(--orange); border-color: var(--orange); font-weight: 700; }
.step.done::before { border-top-color: var(--orange); }
.step.current::before { border-top-color: var(--orange); }
.step.current .dot { border-color: var(--orange); }
.step.current .lbl { font-weight: 700; color: var(--sepia); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.placeholder { border: 2px dashed var(--tan); border-radius: var(--radius); padding: 16px; }

.site-footer { text-align: center; color: var(--sepia-dim); font-size: .9rem; padding: 10px 16px 24px; }
.rule { display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 0 auto 10px; color: var(--orange); }
.rule::before, .rule::after { content: ""; flex: 1; border-top: 1px solid var(--tan); }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #000; border-top: 2px solid var(--orange);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabbar a { flex: 1; text-align: center; color: var(--sepia); text-decoration: none; font-size: .75rem; padding: 7px 0 8px; }
.tabbar a span { display: block; font-size: 1.25rem; color: var(--orange); line-height: 1.2; }

/* proof sheet on screen */
.btn-big { font-size: 1.15rem; padding: 14px 22px; text-align: center; }
.btn-prints { background: #f3e6cf; border-color: #f3e6cf; color: #000; }
.btn-prints:hover { background: #fff; border-color: #fff; }
.sheet-actions { display: grid; gap: 10px; margin: 16px 0; }
.sheet-previews { display: grid; gap: 14px; margin: 14px 0; }
.sheet-page { display: block; text-decoration: none; text-align: center; }
.sheet-page img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #000; }
.status-card .center, .center { text-align: center; }
.spinner { display: inline-block; width: .9em; height: .9em; border: 2px solid var(--orange); border-right-color: transparent;
  border-radius: 50%; vertical-align: -2px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (min-width: 560px) { .sheet-actions { grid-template-columns: 1fr 1fr; } }

/* admin */
.admin .wrap { max-width: 1280px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--tan); color: var(--sepia); text-decoration: none; font-size: .85rem; }
.chip.on { background: var(--orange); color: #000; border-color: var(--orange); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--orange); font-weight: 600; }
.tbl.small { font-size: .85rem; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: .8rem; background: var(--panel2); border: 1px solid var(--tan); white-space: nowrap; }
.st-sent { border-color: var(--green); color: var(--green); }
.st-ready { border-color: var(--orange); color: var(--orange); }
.st-needs_review, .st-not_found { border-color: var(--red); color: var(--red); }
.agents .agent { padding: 8px 12px; border-radius: 8px; margin: 6px 0; border: 1px solid var(--line); font-size: .9rem; }
.agents .ok { border-left: 4px solid var(--green); } .agents .stale { border-left: 4px solid var(--red); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 0; }
.kv dt { color: var(--sepia-dim); } .kv dd { margin: 0; word-break: break-word; }
code { color: var(--orange); font-size: .9em; word-break: break-all; }
.grid2 { display: grid; gap: 0 16px; }
.preview { max-width: 100%; width: 420px; border: 1px solid var(--line); border-radius: 6px; display: block; margin: 10px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.timeline li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.timeline time { color: var(--sepia-dim); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .site-header { justify-content: space-between; padding: 14px 32px 10px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2.3rem; }
  .hero h1 { font-size: 2.7rem; }
  .panel { padding: 26px 30px; }
}
