/* Customer-facing styles. Tokens come from /static/tokens.css, generated
   from pipeline/theme.py — the same table the operator console and the
   client deliverable use, so all three read as one product.

   Mobile-first on purpose: customers open a delivered model on a phone. */

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 660px; margin: 0 auto; padding: 20px 18px 64px; }

header.top {
  display: flex; align-items: baseline; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--grid); margin-bottom: 22px;
}
.brand { font-weight: 650; letter-spacing: -.01em; text-decoration: none;
         color: var(--text-primary); }
.brand-sub { color: var(--muted); font-size: 13px; }

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -.02em; }
h2 { font-size: 15px; margin: 26px 0 8px; }
p  { margin: 0 0 12px; color: var(--text-secondary); }
.lede { font-size: 17px; color: var(--text-secondary); }
a { color: var(--series-1); }

.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin: 14px 0;
}
.muted { color: var(--muted); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* One status vocabulary, mirroring the console: colour never ships alone,
   a glyph always accompanies it (accessible without hue). */
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip[data-tone="good"]    { background: var(--good); color: #fff; }
.chip[data-tone="warn"]    { background: var(--warning); color: #0b0b0b; }
.chip[data-tone="bad"]     { background: var(--critical); color: #fff; }
.chip[data-tone="accent"]  { background: var(--accent-soft); color: var(--series-1); }
.chip[data-tone="neutral"] { border: 1px solid var(--border); color: var(--text-secondary); }

button, .btn {
  display: inline-block; width: 100%; padding: 13px 18px;
  font: inherit; font-weight: 600; text-align: center; text-decoration: none;
  border: 0; border-radius: 8px; cursor: pointer;
  background: var(--series-1); color: #fff;
}
button:disabled { background: var(--muted); cursor: not-allowed; }
.btn.secondary { background: none; color: var(--series-1);
                 border: 1px solid var(--border); }

.namefield { display: block; margin: 0 0 16px; }
.namefield > span { display: block; font-size: 14px; }
.namefield > span:last-child { color: var(--muted); font-size: 12px;
                               margin-top: 4px; }
.namefield input {
  width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit;
  color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px;
}

/* Upload */
.drop {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 26px 18px; text-align: center; background: var(--surface-1);
}
.drop.over { border-color: var(--series-1); background: var(--accent-soft); }
input[type=file] { display: none; }
.files { list-style: none; margin: 12px 0 0; padding: 0; }
.files li {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--grid); font-size: 14px;
}
.files .name { flex: 1; overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--series-1);
           transition: width .2s; }
.files .rm {
  width: auto; padding: 0 8px; background: none; color: var(--muted);
  font-size: 20px; line-height: 1; border-radius: 6px;
}
.files .rm:hover { color: var(--critical); background: var(--accent-soft); }

/* Facts table — capture readings, quality checks, downloads */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
     padding: 4px 8px 4px 0; border-bottom: 1px solid var(--grid); }
td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--grid);
     color: var(--text-secondary); }
td:first-child { color: var(--text-primary); }
/* Sizes and readings are single tokens — wrapping "184 MB" across two lines
   reads as a layout bug. */
td.num, th.num { white-space: nowrap; text-align: right; }

.price { font-size: 34px; font-weight: 650; letter-spacing: -.02em;
         color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* Progress through the pipeline, in the customer's language */
.steps { list-style: none; margin: 10px 0 0; padding: 0; }
.steps li { display: flex; gap: 10px; padding: 5px 0; color: var(--muted);
            font-size: 14px; }
.steps li .glyph { width: 16px; flex-shrink: 0; }
.steps li.done { color: var(--text-secondary); }
.steps li.active { color: var(--text-primary); font-weight: 600; }

details { margin-top: 14px; }
summary { cursor: pointer; color: var(--series-1); font-size: 14px;
          font-weight: 500; }
.notice { border-left: 3px solid var(--warning); padding: 2px 0 2px 12px;
          margin: 10px 0; }
.notice.bad { border-color: var(--critical); }

.site-foot { margin-top: 40px; padding-top: 14px;
  border-top: 1px solid var(--grid); font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }
