/* Humble Pie Chart quiz pages. Requires tokens.css and components.css first. */
/* Quiz page layout, shared by every platform page: ingredients panel beside the results; one column on phones. */
/* Masthead */
.top .wrap { padding-block: 26px 8px; display: grid; gap: 12px; }
h1 {
  font-family: var(--f-display); font-weight: 800; font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.02; letter-spacing: -.02em; margin: 0; max-width: 18ch; text-wrap: balance;
}
.lede { margin: 0; max-width: 62ch; color: var(--muted); font-size: 16.5px; }

.layout { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; align-items: start; padding-block: 22px 48px; }
@media (max-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; }
.eyebrow { font-family: var(--f-mono); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0; }

/* Ingredients */
.input { padding: 20px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
label, .label { font-family: var(--f-display); font-weight: 600; font-size: 15.5px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px;
}
#posts { min-height: 220px; resize: vertical; font-size: 14px; line-height: 1.45; }
input:focus-visible, textarea:focus-visible, button:focus-visible, .drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; }
.tabs button { font-family: var(--f-display); font-weight: 600; font-size: 14px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.panel { display: grid; gap: 14px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input { flex: 1; min-width: 0; accent-color: var(--accent); }
.range-row output { font-family: var(--f-mono); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; font-weight: 600; }
.btn {
  font-family: var(--f-display); font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn:hover { filter: brightness(1.08); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.drop { display: grid; place-items: center; text-align: center; gap: 4px; padding: 26px 16px; border: 2px dashed var(--rule); border-radius: 12px; cursor: pointer; background: var(--bg); position: relative; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-family: var(--f-display); font-size: 16px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.status { font-size: 13px; margin: 0; min-height: 1.4em; }
.status.err { color: var(--accent); }
.status.ok { color: var(--muted); }
.fine { font-size: 12.5px; color: var(--muted); margin: 0; }

/* Results */
.report { display: grid; gap: 18px; min-width: 0; }
.banner { font-size: 13.5px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); margin: 0; }
.summary { padding: 22px; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 640px) { .summary { grid-template-columns: minmax(0, 1fr); } .pie-wrap { max-width: 240px; } }
.pie-wrap { width: 100%; aspect-ratio: 1; }
.pie-wrap svg { width: 100%; height: 100%; display: block; }
.facts { display: grid; gap: 8px; min-width: 0; }
.subject-name { font-family: var(--f-display); font-weight: 600; font-size: 18px; margin: 0; overflow-wrap: anywhere; color: var(--muted); }
.serious { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0; }
.serious .num { font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 7vw, 64px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.serious .word { font-family: var(--f-display); font-weight: 700; font-size: 22px; }
.band-pill { justify-self: start; font-family: var(--f-mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 99px; background: var(--ink); color: var(--card); }
.headline { margin: 0; font-size: 17px; font-weight: 500; text-wrap: balance; }
.meta { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin: 0; }
.legend { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 5px; }
.legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; }
.legend .pct { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 500; }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.section-head h2 { font-family: var(--f-display); font-weight: 700; font-size: 22px; margin: 0; }
.bands { font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1180px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.trait { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 15px 15px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.trait-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.trait h3 { font-family: var(--f-display); font-weight: 700; font-size: 17px; line-height: 1.15; margin: 0; }
.flavor { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.flavor .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.score { font-family: var(--f-mono); font-weight: 600; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1; }
.bar { height: 8px; border-radius: 99px; background: var(--chill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.pill { justify-self: start; font-family: var(--f-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--rule); color: var(--muted); }
.b1 .pill { border-color: transparent; background: var(--chill); color: var(--ink); }
.b2 .pill { border-color: transparent; background: var(--hi); color: var(--on-hi); }
.b3 .pill { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.na .pill { border-style: dashed; }
.interp { margin: 0; font-size: 14.5px; white-space: pre-line; }
.stat { margin: 0; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.evidence { margin: 0; font-size: 13px; font-style: italic; color: var(--muted); border-left: 2px solid var(--rule); padding-left: 10px; overflow-wrap: anywhere; }
.evidence.plain { font-style: normal; }

.share { padding: 20px 22px; display: grid; gap: 14px; }
.share h2 { font-family: var(--f-display); font-weight: 700; font-size: 22px; margin: 0; }
.share-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 700px) { .share-cols { grid-template-columns: minmax(0, 1fr); } }
.share-cols > div { display: grid; gap: 10px; align-content: start; min-width: 0; }
.linkbox { font-family: var(--f-mono); font-size: 13px; width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; }
.fallback { font-family: var(--f-mono); font-size: 12px; min-height: 140px; }

@media (prefers-reduced-motion: no-preference) {
  .pie-wrap path { transition: opacity .2s ease; }
  .bar i { transition: width .4s ease; }
}

/* Other feeds, under the lede */
.feeds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; color: var(--muted); }
.feeds a { color: var(--ink); text-decoration: none; padding: 3px 11px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); }
.feeds a:hover { border-color: var(--ink); }
.upload-note { font-size: 13px; color: var(--muted); margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); }


/* Post my results */
.post-block { display: grid; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.post-text { width: 100%; min-height: 104px; font: inherit; font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px; resize: vertical; }
.post-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.post-buttons .btn { text-decoration: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; }
