:root {
  --bg: #f3f2ef; --surface: #fff; --ink: #1f1d1a; --muted: #6a655d; --line: #d9d4cb;
  --accent: #1f4e79; --accent-ink: #fff; --good: #2f6b3a; --warn: #a66a12; --bad: #a13a2b; --code: #ece8e1; --warn-soft: #f8ecd6;
  --accent-soft: #e4ecf4;
  /* Same two faces as the landing page, so the app reads as the same product. */
  --serif: "Source Serif 4", Iowan Old Style, Palatino, Georgia, serif;
  --sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(31,29,26,.04), 0 6px 18px rgba(31,29,26,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
.top { padding: 18px 26px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; letter-spacing: -.015em; white-space: nowrap; }
.wordmark .mk { color: var(--accent); }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.sub { color: var(--muted); flex: 1 1 32ch; max-width: 52ch; font-size: 13px; line-height: 1.45; }
.tier { display: flex; gap: 8px; align-items: center; }
.layout { display: grid; gap: 18px; padding: 28px 26px 48px; max-width: 1040px; margin: 0 auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px 22px; box-shadow: var(--shadow); }
h2 { font-family: var(--serif); font-weight: 600; font-size: 17px; margin: 0 0 12px; letter-spacing: -.01em; }
.drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 34px 26px; text-align: center; position: relative; cursor: pointer; background: #fbfaf8; transition: border-color .12s, background .12s; }
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropmain { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 0; color: var(--ink); }
.dropsub { margin: 7px auto 0; color: var(--muted); font-size: 13px; max-width: 58ch; line-height: 1.5; }
.status { color: var(--muted); font-size: 13px; margin: 0; }
.status:not(:empty) { margin-top: 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
button { padding: 9px 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: background .12s, border-color .12s; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; box-shadow: var(--shadow); }
button.primary:hover { background: #17395a; border-color: transparent; }
button.link { border: 0; background: none; color: var(--accent); padding: 6px; }
button[disabled] { opacity: .5; cursor: default; }
.tablewrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
th.num, td.num { text-align: right; }
td input[type=text], td select { width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); font: inherit; font-size: 13px; }
td input.long { font-family: var(--serif); font-size: 14px; }
tr.suspect td { background: #fff9ef; }
tr.excluded td { opacity: .5; }
tr.cat td.cathead { background: var(--code); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 5px 8px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--code); color: var(--muted); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.pro { background: #e2efe4; color: var(--good); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; align-items: start; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; }
label select { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font: inherit; }
label.chk { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.checks { padding-top: 4px; }
details.after { margin-top: 14px; font-size: 14px; }
details.after summary { cursor: pointer; color: var(--accent); }
details.after ol { margin: 8px 0 0; padding-left: 20px; }
.foot { padding: 0 26px 36px; color: var(--muted); font-size: 12px; line-height: 1.55; max-width: 1040px; margin: 0 auto; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); max-width: 480px; padding: 20px 22px; }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h2 { font-size: 18px; }
dialog input[type=text] { width: 100%; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.err { color: var(--bad); min-height: 1.2em; margin: 4px 0; font-size: 13px; }

/* Link back to the landing page from the app header */
.brandlink { color: inherit; text-decoration: none; }
.brandlink:hover { text-decoration: underline; }

/* Footer links on the app page, including the route back to the studio. */
.footlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; margin-bottom: 8px; }
.footlinks a { color: var(--muted); text-decoration: none; }
.footlinks a:hover { color: var(--ink); text-decoration: underline; }
.footlinks .up { display: inline-flex; align-items: center; gap: 5px; }
.footlinks .up img { display: block; }

/* The step panels read as a sequence, so the number carries the eye. */
.panel > h2 { display: flex; align-items: center; gap: 10px; }
.step {
  flex: none; display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--sans); font-size: 12px; font-weight: 600; line-height: 1;
}

/* On a wide screen the header would otherwise stretch the tagline across the
   full width and push the licence control to the far edge. */
@media (min-width: 900px) { .tier { margin-left: auto; } }
@media (max-width: 620px) {
  /* Stacked, or the wordmark sits marooned beside a four-line paragraph. */
  .top { padding: 16px 18px; gap: 8px; flex-direction: column; align-items: flex-start; }
  .sub { flex: none; max-width: none; }
  .dropmain { font-size: 16px; }
  .layout { padding: 20px 18px 40px; }
  .panel { padding: 16px 18px 18px; }
  .foot { padding: 0 18px 30px; }
}
