:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e3e6eb;
  --border-strong: #cdd2da;
  --text: #0f1729;
  --text-2: #4a5568;
  --muted: #6b7686;
  --accent: #2f6feb;
  --accent-hover: #2459c9;
  --accent-soft: #eef3fe;
  --accent-text: #1d4ed8;
  --on-accent: #ffffff;
  --ok: #067647;
  --ok-soft: #e9f9ef;
  --warn: #a6540a;
  --warn-soft: #fff6e6;
  --danger: #b42318;
  --danger-soft: #fef1f0;
  --shadow: 0 1px 2px rgba(15, 23, 41, .05), 0 1px 3px rgba(15, 23, 41, .06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 41, .10);
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151b24;
    --surface-2: #1a212c;
    --border: #262f3c;
    --border-strong: #354152;
    --text: #e8ecf2;
    --text-2: #b4bdca;
    --muted: #8a95a6;
    --accent: #5b8ff9;
    --accent-hover: #7aa5ff;
    --accent-soft: #1a2640;
    --accent-text: #8fb3ff;
    --on-accent: #0b1220;
    --ok: #4ade80;
    --ok-soft: #12291c;
    --warn: #fbbf24;
    --warn-soft: #2b2112;
    --danger: #f87171;
    --danger-soft: #2d1616;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); }
button, input, textarea, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.top { border-bottom: 1px solid var(--border); background: var(--surface); }
.top-inner { max-width: 760px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; line-height: 1.1; }
.top-link { font-size: 14px; font-weight: 550; text-decoration: none; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.top-link:hover { border-color: var(--border-strong); }

main { max-width: 760px; margin: 0 auto; padding: 32px 16px 80px; }
.hero h1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; }
.hero p { margin: 0 0 28px; color: var(--text-2); font-size: 16px; }

.demo-banner { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 20px; }

/* Cards & sections */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card, .card + .actions { margin-top: 16px; }
.step-label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 14px; }

/* Type tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tile { position: relative; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.tile:last-child { grid-column: 1 / -1; }
.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tile[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tile:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-color: var(--accent); }
.tile-icon { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--accent-text); }
.tile[aria-checked="true"] .tile-icon { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.tile-icon svg { width: 18px; height: 18px; }
.tile-label { display: block; font-weight: 600; font-size: 14.5px; }
.tile-blurb { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }

/* Reveal the rest after a type is picked */
.details { display: none; }
.details.open { display: block; margin-top: 16px; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .details.open, .tile { animation: none; transition: none; } }

/* Fields */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } .card { padding: 18px; } }
.lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.opt { font-weight: 450; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="date"], input[type="url"], textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: var(--muted); opacity: .8; }
.field.invalid input, .field.invalid textarea, .field.invalid .drop { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.field.invalid .err { display: block; }

/* Segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 14px; cursor: pointer; background: var(--surface); }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* Quick date chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.rush { display: none; margin-top: 8px; font-size: 13px; color: var(--warn); background: var(--warn-soft); padding: 8px 10px; border-radius: 8px; }
.rush.show { display: block; }

/* Dropzone */
.drop { border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 20px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { color: var(--accent-text); }
.drop p { margin: 0; color: var(--text-2); font-size: 14px; }
.drop .hint { margin-top: 4px; }
.files { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; background: var(--surface); }
.files .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fsize { color: var(--muted); flex: none; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* Requester */
.who { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.who-text { color: var(--text-2); font-size: 14px; }
.who-text strong { color: var(--text); }
.link-btn { background: none; border: 0; color: var(--accent-text); cursor: pointer; padding: 0; font-weight: 550; font-size: 14px; }

/* Submit */
.actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 24px; font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--text-2); }
.form-error { color: var(--danger); font-size: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
.done { text-align: center; padding: 40px 24px; }
.done-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.done h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; }
.done p { color: var(--text-2); margin: 0 auto 22px; max-width: 440px; }
.done .actions { justify-content: center; }
.done .warn { color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 8px; font-size: 14px; }

/* Status page */
.tabs { display: flex; gap: 6px; margin: 0 0 16px; }
.tab { border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 550; cursor: pointer; color: var(--text-2); }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab .count { opacity: .7; margin-left: 4px; font-weight: 500; }
.req { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.req-head { width: 100%; text-align: left; background: none; border: 0; padding: 18px 20px; cursor: pointer; display: grid; gap: 12px; }
.req-head:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: -3px; }
.req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.req-title { font-weight: 650; font-size: 16px; line-height: 1.3; }
.req-meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pill { flex: none; font-size: 12.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.pill.wait { background: var(--warn-soft); color: var(--warn); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.new { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.track i { height: 5px; border-radius: 3px; background: var(--border); }
.track i.on { background: var(--accent); }
.track.done i.on { background: var(--ok); }
.track.wait i.on { background: var(--warn); }
.track-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: 11.5px; color: var(--muted); }
.track-labels span.cur { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .track-labels { display: none; } }
.req-body { border-top: 1px solid var(--border); padding: 16px 20px; background: var(--surface-2); display: none; }
.req.open .req-body { display: block; }
.note { padding: 10px 0; border-bottom: 1px solid var(--border); }
.note:last-child { border-bottom: 0; }
.note-head { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.note-head strong { color: var(--text-2); }
.note-text { white-space: pre-wrap; font-size: 14px; }
.empty { text-align: center; color: var(--text-2); padding: 48px 20px; }
.empty h2 { color: var(--text); margin: 0 0 6px; font-size: 20px; }
.tip { font-size: 13px; color: var(--muted); margin-top: 24px; text-align: center; }
.skeleton { height: 96px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--border); margin-bottom: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
