/* ---------- demo shell ---------- */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); box-shadow: var(--shadow-1); margin: 22px 0; overflow: hidden; }
.demo-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.demo-head .mono { color: var(--muted); }
@media (max-width: 480px) { .demo-head { flex-wrap: wrap; justify-content: flex-start; gap: 8px 12px; } }
.demo-body { padding: 18px; }
.demo-note { color: var(--muted); font-size: .8125rem; margin: 12px 0 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .lbl { font-size: .875rem; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 10px; }
.field output, .field .val { font-family: var(--font-mono); font-size: .875rem; color: var(--ink); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--line) var(--fill, 50%)); box-shadow: inset 0 0 0 1px var(--track-off); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--line); box-shadow: inset 0 0 0 1px var(--track-off); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; margin-top: -8px; background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-1); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
select, input[type="number"] { font: inherit; font-size: .9375rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 40px; }

/* GPI meter */
.gpi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 680px) { .gpi { grid-template-columns: 1fr; } }
.gpi-out { display: flex; flex-direction: column; gap: 10px; }
.gpi-val { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.gpi-val b { font-size: 3.5rem; line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.meter { position: relative; height: 12px; border-radius: 999px; background: var(--surface-3); overflow: visible; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); transition: width .35s var(--ease-out); }
.meter > s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--surface); border-radius: 2px; }
.meter-scale { position: relative; height: 18px; color: var(--muted); font-family: var(--font-mono); font-size: .6875rem; }
.meter-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.meter-scale span:first-child { transform: none; }
.meter-scale span.on { color: var(--ink); font-weight: 600; }
.bneck { display: grid; grid-template-columns: 52px 1fr 48px; align-items: center; gap: 10px; font-size: .8125rem; }
.bneck .bar { height: 8px; border-radius: 8px; background: var(--surface-3); position: relative; overflow: hidden; }
.bneck .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); border-radius: 8px; transition: width .35s var(--ease-out); }
.bneck .bar.limit i { background: var(--accent); }
.bneck span:last-child { font-family: var(--font-mono); text-align: right; }

/* dice demo */
.dice-picks { display: grid; gap: 8px; margin-bottom: 14px; }
.dice-pick { text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .2s, background-color .2s; }
.dice-pick:hover { border-color: var(--ink-2); }
.dice-pick[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.dice-pick b { font-size: .975rem; }
.dice-pick .mono { color: var(--muted); align-self: center; }
.dice-pick small { grid-column: 1 / -1; color: var(--ink-2); font-size: .875rem; }
@media (max-width: 480px) { .dice-pick { grid-template-columns: minmax(0, 1fr); } }
.odds { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; }
.odds-bar { flex: 1; min-width: 160px; height: 10px; border-radius: 10px; background: var(--bad-soft); overflow: hidden; position: relative; }
.odds-bar i { position: absolute; top: 0; bottom: 0; right: 0; background: var(--ok-mark); transition: width .3s var(--ease-out); }
.roll-out { min-height: 72px; display: flex; align-items: center; gap: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); }
.roll-out .big { font-family: var(--font-mono); font-weight: 600; font-size: 2.25rem; line-height: 1; min-width: 3ch; text-align: center; }
.roll-out p { margin: 0; font-size: .9375rem; color: var(--ink-2); }
.roll-out.ok { border-style: solid; border-color: color-mix(in srgb, var(--ok-mark) 50%, var(--line)); background: var(--ok-soft); }
.roll-out.fail { border-style: solid; border-color: color-mix(in srgb, var(--bad-mark) 50%, var(--line)); background: var(--bad-soft); }

/* ticket demo */
.tix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .tix { grid-template-columns: 1fr; } }
.release { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin-bottom: 8px; background: var(--surface); }
.release:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
/* a sold-out option: the radio and price dim, the "Sold out" note stays readable */
.release:has(input:disabled) { cursor: not-allowed; background: var(--surface-2); }
.release:has(input:disabled) :is(input, b, .price) { opacity: .55; }
.release.is-sold .price { text-decoration: line-through; } /* sold out, not just "at the door" */
.release input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.release b { font-size: .95rem; }
.release small { display: block; color: var(--muted); font-size: .8125rem; }
.release .price { font-family: var(--font-mono); font-weight: 600; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.1rem; line-height: 1; transition: border-color .2s, opacity .2s; }
.qty button:not([aria-disabled="true"]):hover { border-color: var(--ink); }
.qty button[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.qty output { min-width: 3ch; text-align: center; font-family: var(--font-mono); font-weight: 600; }
.tkt {
  position: relative; border-radius: 16px; overflow: hidden; color: #1b1712;
  background: #f4ead7; border: 1px solid #d9c7a6;
  --stub: 120px;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--stub);
  box-shadow: 0 18px 36px -24px rgba(0, 0, 0, .45);
  transition: transform .5s var(--ease-out), opacity .4s;
}
.tkt.is-new { animation: tkt-in .6s var(--ease-out); }
@keyframes tkt-in { from { opacity: 0; transform: translateY(14px) rotate(-1.5deg); } }
.tkt-main { padding: 16px 18px; border-right: 2px dashed #cdb894; position: relative; }
.tkt-main .brandline { font-family: var(--font-display); font-weight: 800; font-variation-settings: "wdth" 115; font-size: 1.35rem; letter-spacing: -.01em; color: #1b1712; }
.tkt-main .brandline em { font-style: normal; color: #d4451a; }
.tkt-main .ev { font-weight: 700; margin: 6px 0 2px; font-size: 1rem; color: #1b1712; }
.tkt-main .mono { color: #6b5a42; font-size: .6875rem; }
.tkt-main dl { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; }
.tkt-main dl > div { display: grid; gap: 4px; }
.tkt-main dt { font-family: var(--font-mono); font-size: .625rem; color: #6b5a42; text-transform: uppercase; letter-spacing: .06em; }
.tkt-main dd { margin: 0; font-weight: 600; font-size: .875rem; font-family: var(--font-mono); white-space: nowrap; }
.tkt-stub { padding: 12px; display: grid; place-items: center; gap: 6px; text-align: center; }
.tkt-stub svg { width: 88px; height: 88px; background: #fff; padding: 4px; border-radius: 4px; }
.tkt-stub .mono { color: #6b5a42; font-size: .625rem; }
/* The stamp lands on the stub, over the QR code it used up, and leaves the details readable. */
.tkt-stamp { position: absolute; right: calc(var(--stub) / 2); top: 50%; transform: translate(50%, -50%) rotate(-12deg) scale(1.4); opacity: 0; border: 3px solid #0f6b46; color: #0f6b46; padding: 4px 9px; border-radius: 8px; font-family: var(--font-mono); font-weight: 700; font-size: .8125rem; line-height: 1.25; letter-spacing: .08em; text-align: center; white-space: nowrap; background: #f4ead7; transition: opacity .25s, transform .35s var(--ease-out); pointer-events: none; }
.tkt.is-used .tkt-stamp { opacity: 1; transform: translate(50%, -50%) rotate(-12deg) scale(1); }
@media (max-width: 420px) {
  .tkt { --stub: 100px; }
  .tkt-main { padding: 14px 14px; }
  .tkt-stub svg { width: 72px; height: 72px; }
}
.tkt-empty { border: 1px dashed var(--line); border-radius: 16px; padding: 28px; text-align: center; color: var(--muted); font-size: .9375rem; }
.door { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.door-log { margin: 12px 0 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); display: grid; gap: 4px; }
.door-log li b { color: var(--ink); font-weight: 600; }
.door-log .ok { color: var(--ok); }
.door-log .bad { color: var(--bad); }

/* stage stepper */
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 14px 16px; border-top: 1px solid var(--line); }
.stepper button { text-align: left; border: 0; background: none; cursor: pointer; padding: 10px 2px 4px; border-top: 3px solid var(--line); display: grid; gap: 2px; color: var(--muted); transition: border-color .3s, color .3s; }
.stepper button .mono { font-size: .6875rem; }
.stepper button b { font-size: .8125rem; font-weight: 600; line-height: 1.25; color: var(--ink-2); }
.stepper button.is-done { border-top-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
/* the current stage: a heavier ink bar (done stages are orange), its name in bold */
.stepper button[aria-pressed="true"] { border-top-color: var(--ink); box-shadow: inset 0 2px 0 var(--ink); color: var(--accent-ink); }
.stepper button[aria-pressed="true"] b { color: var(--ink); font-weight: 700; }
.stepper button:not([aria-pressed="true"]):hover b { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.stepper button:not([aria-pressed="true"]):hover .mono { color: var(--ink-2); }
.stage-note { padding: 0 16px 16px; color: var(--ink-2); font-size: .9375rem; min-height: 3.2em; max-width: calc(48ch + 32px); }
.stage-note b { color: var(--ink); }
@media (max-width: 640px) { .stepper button b { display: none; } .stepper { gap: 4px; } }

/* variation demo */
.vari { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .vari { grid-template-columns: 1fr; } }
.vcard { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); }
.vcard-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.vcard-top [data-v-ref] { white-space: nowrap; }
.vcard [data-v-actions] { margin-bottom: 12px; }
.vcard h4 { font-size: 1.0625rem; margin: 0 0 4px; }
.vcard p { font-size: .9rem; color: var(--ink-2); margin: 0 0 12px; }
.vcard dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: .875rem; }
.vcard dt { color: var(--muted); }
.vcard dd { margin: 0; font-weight: 600; }
.vflow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; padding: 0; list-style: none; }
.vflow [data-s] { font-family: var(--font-mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; border-radius: 6px; color: var(--muted); border: 1px solid var(--line); }
.vflow [data-s].on { color: var(--btn-ink); background: var(--btn-bg); border-color: var(--btn-bg); }
.vflow [data-s].done { color: var(--ink-2); border-color: var(--ink-2); }
.vflow .sep { font-family: var(--font-mono); font-size: .6875rem; color: var(--muted); }
/* the two outcomes stay on one line together */
.vflow > li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.money { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.money h4 { margin: 0; padding: 12px 14px; font-size: .9375rem; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.money dl { margin: 0; }
.money div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.money div:last-child { border-bottom: 0; }
.money dt { color: var(--ink-2); }
.money dd { margin: 0; font-family: var(--font-mono); font-weight: 600; transition: color .3s; }
.money dd.flash { color: var(--accent-ink); }
.money .tot dd, .money .tot dt { color: var(--ink); font-weight: 700; }

/* voting demo */
.vote { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.vote-map { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 8px; }
.vote-map svg { width: 100%; max-width: 600px; margin: 0 auto; height: auto; overflow: visible; }
.vote-map .link { stroke: var(--track-off); stroke-width: 2; fill: none; }
.vote-map .link.ok { stroke: var(--ok-mark); }
.vote-map .link.bad { stroke: var(--bad-mark); stroke-dasharray: 6 5; }
.vote-map .link.ask { stroke: var(--info); stroke-dasharray: 2 6; stroke-linecap: round; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.vote-map .node rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.vote-map .node.home rect { stroke: var(--ink-2); stroke-width: 2; }
.vote-map .node.faulty rect { stroke: var(--warn-mark); stroke-dasharray: 4 3; }
.vote-map .node text { fill: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: 16px; }
.vote-map .node .sub { fill: var(--muted); font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .04em; }
.vote-map .node .verdict { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.vote-map .verdict.up { fill: var(--ok); }
.vote-map .verdict.down { fill: var(--bad); }
.vote-map .verdict.wait { fill: var(--muted); }
.vote-map .site rect { fill: var(--btn-bg); }
.vote-map .site text { fill: var(--btn-ink); font-weight: 700; font-size: 15px; font-family: var(--font-body); }
.vote-map .site .sub { fill: var(--btn-ink); font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; }
.vote-side { grid-template-columns: minmax(0, 1fr); }
.vote-map .site.down rect { fill: var(--bad); }
.vote-side { display: grid; gap: 12px; }
.vote-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.vote-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-weight: 600; font-size: .9375rem; }
.vote-status.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.vote-status.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.vote-status.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.vote-log { list-style: none; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2); display: grid; gap: 6px; min-height: 168px; max-height: 260px; overflow: auto; }
.vote-log li { display: grid; grid-template-columns: 48px 1fr; gap: 8px; animation: logline .3s var(--ease-out); }
.vote-log li time { color: var(--muted); }
@keyframes logline { from { opacity: 0; transform: translateX(-4px); } }

/* lifecycle diagram */
.lifecycle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; position: relative; margin: 8px 0 12px; }
.lc-step { position: relative; padding: 18px 18px 18px 0; }
.lc-step + .lc-step { padding-left: 18px; border-left: 1px dashed var(--line); }
.lc-cmd { font-family: var(--font-display); font-weight: 800; font-variation-settings: "wdth" 115; font-size: 1.5rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.lc-cmd .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--btn-bg); color: var(--btn-ink); font-family: var(--font-mono); font-size: .75rem; font-weight: 600; }
.lc-step p { color: var(--ink-2); font-size: .9375rem; margin: 10px 0 12px; }
.lc-step code { font-family: var(--font-mono); font-size: .6875rem; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 7px; border-radius: 6px; display: inline-block; word-break: break-all; }
.lc-never { font-size: .8125rem !important; color: var(--muted) !important; max-width: 66ch; }
.chart figcaption { max-width: 66ch; }
@media (max-width: 760px) { .lifecycle { grid-template-columns: 1fr; } .lc-step + .lc-step { border-left: 0; border-top: 1px dashed var(--line); padding-left: 0; } }

/* eval chart */
.chart { margin: 8px 0 24px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; padding: 0; list-style: none; font-size: .875rem; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.chart-group { margin-bottom: 18px; }
.chart-group h4 { font-size: .9375rem; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 10px; }
.chart-group h4 span { font-weight: 500; color: var(--muted); font-size: .8125rem; }
.chart-rows { position: relative; display: grid; gap: 2px; }
.chart-grid { position: absolute; inset: 0 48px 0 120px; pointer-events: none; }
.chart-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--grid); }
.chart-row { position: relative; display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 0; height: 30px; border-radius: 6px; outline-offset: 0; }
.chart-row .name { font-size: .8125rem; color: var(--ink-2); padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-row .track { position: relative; height: 22px; }
.chart-row .bar { position: absolute; left: 0; top: 0; height: 22px; border-radius: 0 4px 4px 0; transform-origin: left; transition: filter .15s; }
.chart-row .v { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-row:hover .bar, .chart-row:focus-visible .bar { filter: brightness(1.12) saturate(1.05); }
.chart-axis { position: relative; height: 16px; margin: 2px 48px 0 120px; font-family: var(--font-mono); font-size: .6875rem; color: var(--muted); }
.chart-axis span { position: absolute; transform: translateX(-50%); }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--btn-bg); color: var(--btn-ink); border-radius: 8px; padding: 8px 10px; font-size: .8125rem; box-shadow: var(--shadow-2); opacity: 0; transition: opacity .12s; max-width: 240px; }
.chart-tip.on { opacity: 1; }
.chart-tip b { display: block; font-size: 1rem; }
.chart-tip .key { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; }
details.tableview { margin-top: 6px; }
details.tableview summary { cursor: pointer; color: var(--muted); font-size: .875rem; width: max-content; }
@media (max-width: 560px) {
  .chart-row { grid-template-columns: 92px 1fr 44px; }
  .chart-grid { inset: 0 44px 0 92px; }
  .chart-axis { margin: 2px 44px 0 92px; }
}

