:root {
  --bg: #0e1020; --bg2: #171a30; --card: #1d2140; --line: #2c3160;
  --text: #f3f2ff; --muted: #9a9fc4; --accent: #ffb547; --accent2: #ff7a59;
  --pink: #ec297b; --good: #47e0a0; --warn: #ffb547; --bad: #ff5d73;
  --radius: 16px; --shadow: 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; background: radial-gradient(1200px 600px at 50% -10%, #23275a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
main { max-width: 860px; margin: 0 auto; padding: 8px 20px 64px; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); }
h2 { font-size: 1.5rem; margin-top: 36px; }
h3 { font-size: 1.1rem; }
p { line-height: 1.55; }
a { color: var(--pink); }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.hidden { display: none !important; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 62ch; }

/* header */
.top { max-width: 860px; margin: 0 auto; padding: 18px 20px 6px; display: flex;
  align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text);
  text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand .mark { width: 17px; height: 30px; display: block; }
/* Morty x Puzzol Creative. The methodology is theirs, so their mark sits
   beside ours rather than in the footer alone. */
.top .cross { color: var(--muted); font-size: .95rem; font-weight: 400;
  margin: 0 -2px 0 2px; user-select: none; }
.partner { display: flex; align-items: center; text-decoration: none;
  margin-right: auto; }
.partner img { display: block; height: 30px; width: auto;
  /* the logo is drawn for white paper; lift it slightly on the dark ground */
  filter: brightness(1.12) saturate(1.05); }
.partner:hover img, .partner:focus-visible img { filter: brightness(1.28) saturate(1.1); }
.lockup { color: var(--muted); font-size: .8rem; border: 1px solid var(--line);
  background: var(--bg2); border-radius: 999px; padding: 5px 11px; }

/* buttons */
button { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .08s, border-color .2s, background .2s; }
button:active { transform: scale(.99); }
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #1a1200; border: none; font-weight: 700; display: block; width: 100%;
  margin: 22px 0 0; font-size: 1.05rem; }
button.narrow { width: auto; display: inline-block; }
button.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.linkish { background: none; border: none; color: var(--pink); text-decoration: underline;
  cursor: pointer; padding: 0; box-shadow: none; font-size: inherit; }
.btn-link { display: inline-block; margin-top: 10px; background: var(--pink); color: #fff;
  text-decoration: none; font-weight: 700; padding: 13px 20px; border-radius: var(--radius); }

/* drop zone */
.drop { margin: 26px 0 10px; border: 2px dashed var(--line); border-radius: 20px;
  background: rgba(29,33,64,.45); padding: 40px 20px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; }
.drop:hover, .drop:focus { border-color: var(--pink); outline: none; }
.drop.over { border-color: var(--pink); background: rgba(236,41,123,.10); }
.drop-icon { font-size: 1.9rem; color: var(--pink); line-height: 1; }
.drop-main { font-size: 1.2rem; font-weight: 700; margin-top: 10px; }
.drop-sub { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.paste-line { color: var(--muted); font-size: .92rem; }
#pasteBox textarea { width: 100%; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-family: ui-monospace,
  SFMono-Regular, Menlo, monospace; font-size: .85rem; }

.reassure { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 20px; }
.reassure ul { color: var(--muted); line-height: 1.6; padding-left: 20px; margin: 0; }
.reassure li { margin-bottom: 9px; }

/* controls */
.grid-controls { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 18px 0; }
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl > span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.ctl small { color: var(--muted); font-size: .78rem; }
select, input[type=number] { font: inherit; background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.with-prefix { display: flex; align-items: center; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; padding-left: 12px; }
.with-prefix em { color: var(--muted); font-style: normal; }
.with-prefix input { border: none; background: none; padding-left: 6px; }
.inputs-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 14px 0 6px; }

/* preview table */
.preview-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(23,26,48,.6); }
table.preview { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.preview th, table.preview td { text-align: left; padding: 9px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line); }
table.preview th { color: var(--muted); font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em; }
table.preview tr:last-child td { border-bottom: none; }
table.preview td.bad { color: var(--bad); }

/* notes and warnings */
.note { border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-size: .92rem;
  line-height: 1.5; border: 1px solid var(--line); background: var(--bg2); }
.note b { display: block; margin-bottom: 3px; }
.note.high { border-color: rgba(255,93,115,.55); background: rgba(255,93,115,.10); }
.note.medium { border-color: rgba(255,181,71,.5); background: rgba(255,181,71,.08); }
.note.good { border-color: rgba(71,224,160,.45); background: rgba(71,224,160,.08); }

/* headline */
.headline { margin: 26px 0 8px; padding: 30px 24px; border-radius: 22px; text-align: center;
  background: linear-gradient(150deg, rgba(236,41,123,.18), rgba(255,122,89,.10));
  border: 1px solid rgba(236,41,123,.4); }
.headline-label { color: var(--muted); font-size: .9rem; text-transform: uppercase;
  letter-spacing: .09em; font-weight: 700; }
.headline-value { font-size: clamp(2.4rem, 10vw, 4rem); font-weight: 800; letter-spacing: -.03em;
  margin: 8px 0 6px; line-height: 1; }
.headline-note { color: var(--muted); font-size: .95rem; max-width: 52ch; margin: 0 auto;
  line-height: 1.5; }

/* metric cards */
.section-block { margin-top: 26px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; }
.card .k { color: var(--muted); font-size: .85rem; font-weight: 600; line-height: 1.35; }
.card .v { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.card .v.nodata { font-size: 1.15rem; color: var(--muted); font-weight: 600; }
.card .d { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.card.hero-card { border-color: rgba(236,41,123,.45); }
.card .v.pink { color: var(--pink); }
.card .v.good { color: var(--good); }
.card .v.warn { color: var(--warn); }

/* workings */
.workings { margin-top: 30px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(23,26,48,.5); }
.workings summary { cursor: pointer; padding: 14px 16px; font-weight: 700; }
.workings > div { padding: 0 16px 16px; }
.workings table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.workings td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.workings td:first-child { color: var(--muted); padding-right: 16px; }
.workings td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.workings h4 { margin: 18px 0 4px; font-size: .95rem; }
.workings code { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-size: .84rem; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.cta { margin-top: 40px; padding: 24px; border-radius: 20px; background: var(--bg2);
  border: 1px solid var(--line); }
.cta p { color: var(--muted); }
.cta-link { font-weight: 700; }

footer { max-width: 860px; margin: 0 auto; padding: 24px 20px 50px; color: var(--muted);
  font-size: .85rem; border-top: 1px solid var(--line); }
footer p { margin: 6px 0; }

@media (max-width: 520px) {
  .headline { padding: 22px 16px; }
  .top .lockup { display: none; }
  .partner img { height: 25px; }
}
