/* Benchmarks: the big device cards on /iphone and /mac, and the /benchmarks page.
   In memory = blue; from storage (bigger than memory, Plus) = amber → violet, the
   colours the /iphone page already used for storage. Built by iphone-page/benchlab.py,
   driven by assets/js/bench-card.js and assets/js/benchmarks.js. */
:root { --sto-a: #ff9f0a; --sto-b: #8e44ec; --sto-grad: linear-gradient(90deg, var(--sto-a), var(--sto-b)); }

.bx-cards { display: grid; gap: 2rem; margin-top: 2rem; }
.bx { position: relative; padding: clamp(1.1rem, 3vw, 2rem); border-radius: 28px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 50px -30px rgba(0, 0, 0, .35); scroll-margin-top: 5rem; }
.bx-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between; }
.bx-kicker { margin: 0 0 .2rem; font: 600 .8rem/1.2 var(--font-sys); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bx-title { margin: 0; font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.15; }
.bx-blurb { margin: .45rem 0 0; max-width: 46rem; color: var(--muted); font-size: .95rem; }
.bx-legend { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .8rem; color: var(--body); }
.bx-key { display: inline-flex; align-items: center; gap: .45rem; }
.bx-key::before { content: ""; width: 26px; height: 8px; border-radius: 99px; background: var(--accent); }
.bx-key--sto::before { background: var(--sto-grad); }

/* device tabs */
.bx-devs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0 1.1rem; }
.bx-devs button { display: grid; gap: .1rem; min-height: 48px; padding: .45rem .95rem; border: 0; border-radius: 14px; text-align: left; cursor: pointer;
  font: inherit; color: var(--body); background: var(--cloud); box-shadow: inset 0 0 0 1px var(--line); }
.bx-devs button b { font-size: .92rem; color: var(--ink); }
.bx-devs button small { font-size: .74rem; color: var(--muted); }
.bx-devs button:hover { background: var(--hover); }
.bx-devs button[aria-selected="true"] { background: var(--ink); box-shadow: none; }
.bx-devs button[aria-selected="true"] b { color: var(--surface); }
.bx-devs button[aria-selected="true"] small { color: var(--surface); opacity: .8; }
.bx-devs button.is-shared small::before { content: "Shared · "; color: var(--amber); font-weight: 600; }
.bx-devs button[aria-selected="true"].is-shared small::before { color: var(--sto-a); }
.bx-devs button:focus-visible, .bx-seg button:focus-visible, .bx-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* headline figures for the device */
.bx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.bx-stats > div { padding: .85rem 1rem; border-radius: 16px; background: var(--cloud); display: grid; gap: .25rem; align-content: start; }
.bx-stats b { font: 650 clamp(1.25rem, 2.4vw, 1.6rem)/1.1 var(--font-sys); color: var(--ink); font-variant-numeric: tabular-nums; }
.bx-stats b small { font-size: .62em; font-weight: 600; color: var(--muted); }
.bx-stats span { font-size: .8rem; line-height: 1.35; color: var(--muted); }
.bx-stats .is-sto { background: linear-gradient(135deg, rgba(255, 159, 10, .14), rgba(142, 68, 236, .14)); }
.bx-stats .is-sto b { background: var(--sto-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* filters + order */
.bx-tools { display: flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: space-between; align-items: center; margin: 1.2rem 0 .7rem; }
.bx-seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; padding: .25rem; border-radius: 99px; background: var(--cloud); }
.bx-seg button { min-height: 36px; display: inline-flex; align-items: center; gap: .35rem; padding: 0 .85rem; border: 0; border-radius: 99px; cursor: pointer;
  font: 600 .82rem/1 var(--font-sys); color: var(--body); background: transparent; }
.bx-seg button small { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.bx-seg button:hover { color: var(--ink); }
.bx-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.bx-seg button[data-filter="sto"][aria-pressed="true"] { color: var(--amber); }

/* the list: name | bar | figure */
.bx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.bx-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 6.5rem; gap: .35rem 1.2rem; align-items: center;
  padding: .7rem .6rem; border-radius: 12px; border-bottom: 1px solid var(--line); }
.bx-row:last-child { border-bottom: 0; }
.bx-row:hover { background: var(--cloud); }
.bx-row[hidden], .bx-panel:not(.is-open) .bx-row.is-more { display: none; }
.bx-name { margin: 0; display: grid; gap: .1rem; min-width: 0; }
.bx-name b { color: var(--ink); font-size: .95rem; overflow-wrap: anywhere; }
.bx-name span { font-size: .76rem; color: var(--muted); }
.bx-name em { font-style: normal; font-weight: 600; color: var(--amber); }
.bx-bar { display: grid; gap: .3rem; min-width: 0; }
.bx-track { position: relative; height: 10px; border-radius: 99px; background: var(--cloud-2); overflow: hidden; }
.bx-track i { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 99px; background: var(--accent);
  transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.bx-row.is-sto .bx-track i { background: var(--sto-grad); }
.bx-row[data-kind="tts"] .bx-track i, .bx-row[data-kind="stt"] .bx-track i, .bx-row[data-kind="embed"] .bx-track i { background: var(--green); }
.bx-sub { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; font-size: .74rem; color: var(--muted); }
.bx-tag { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font: 600 .7rem/1.5 var(--font-sys); background: var(--blue-tint); color: var(--link); }
.bx-tag--sto { background: var(--amber-tint); color: var(--amber); }
.bx-tag--shared { background: var(--cloud-2); color: var(--ink); }
.bx-val { margin: 0; text-align: right; display: grid; justify-items: end; font-variant-numeric: tabular-nums; }
.bx-val b { font: 650 1.25rem/1.1 var(--font-sys); color: var(--ink); }
.bx-row.is-sto .bx-val b { color: var(--amber); }
.bx-val small { font-size: .72rem; color: var(--muted); }
.bx-more { margin: .8rem 0 0; min-height: 42px; padding: 0 1.2rem; border: 0; border-radius: 99px; cursor: pointer;
  font: 600 .86rem/1 var(--font-sys); color: var(--link); background: var(--blue-tint); }
.bx-more:hover { filter: brightness(.97); }
.bx-src { margin: 1rem 0 0; font-size: .78rem; color: var(--muted); max-width: 60rem; }
.bx-empty { margin: 1rem 0; color: var(--muted); }

/* rankings */
.bx-rank { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.bx-rank h4 { margin: 0 0 .2rem; font-size: 1.05rem; }
.bx-rank > p { margin: 0 0 .9rem; font-size: .85rem; color: var(--muted); }
.bx-rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; }
.bx-rank-col { padding: .9rem 1rem; border-radius: 16px; background: var(--cloud); }
.bx-rank-h { margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .2rem .5rem; align-items: baseline; }
.bx-rank-h b { color: var(--ink); }
.bx-rank-h span { font-size: .76rem; color: var(--muted); }
.bx-rank ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.bx-rank li { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) auto; gap: .5rem; align-items: center; min-height: 34px; font-size: .88rem; }
.bx-rank li b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.bx-rank li strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.bx-pos { display: inline-grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 50%; font: 700 .74rem/1 var(--font-sys);
  background: var(--surface); color: var(--body); box-shadow: inset 0 0 0 1px var(--line); }
.bx-rank li:first-child .bx-pos { background: var(--sto-grad); color: #fff; box-shadow: none; }
.bx-rank li.is-you { color: var(--muted); }
.bx-rank li.is-you a { font-weight: 600; }
.bx-rank li.is-you .bx-pos { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); border: 0; }

/* the call to share */
.bx-cta { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 113, 227, .08), rgba(142, 68, 236, .1)); }
.bx-cta p { margin: 0; flex: 1 1 22rem; font-size: .92rem; }
.bx-cta b { color: var(--ink); }

/* "put your device on the board" */
.bx-share { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.6rem; counter-reset: bxs; }
.bx-share > div { padding: 1.1rem 1.2rem; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bx-share h3 { margin: 0 0 .35rem; font-size: 1.02rem; }
.bx-share h3::before { counter-increment: bxs; content: counter(bxs); display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-right: .5rem;
  border-radius: 50%; font-size: .8rem; color: #fff; background: var(--sto-grad); vertical-align: 1px; }
.bx-share p { margin: 0; font-size: .9rem; color: var(--body); }

@media (max-width: 900px) {
  .bx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .bx { border-radius: 22px; }
  .bx-row { grid-template-columns: minmax(0, 1fr) auto; padding: .7rem .2rem; }
  .bx-name { grid-column: 1; }
  .bx-val { grid-column: 2; grid-row: 1; }
  .bx-bar { grid-column: 1 / -1; }
  .bx-devs button { flex: 1 1 calc(50% - .5rem); }
  .bx-tools { align-items: stretch; }
}

/* ── /benchmarks ─────────────────────────────────────────────────────── */
.bm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1.6rem; }
.bm-stats > div { padding: 1rem 1.1rem; border-radius: 18px; background: var(--cloud); display: grid; gap: .2rem; }
.bm-stats b { font: 650 clamp(1.4rem, 3vw, 2rem)/1.1 var(--font-sys); color: var(--ink); font-variant-numeric: tabular-nums; }
.bm-stats span { font-size: .82rem; color: var(--muted); }
.bm-tools { position: sticky; top: 60px; z-index: 5; display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: 1.6rem 0 1rem;
  padding: .7rem 0; background: var(--bg); }
.bm-search { flex: 1 1 14rem; min-height: 42px; padding: 0 1rem; border-radius: 99px; border: 1px solid var(--line-strong); font: inherit; color: var(--ink); background: var(--surface); }
.bm-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bm-list { display: grid; gap: .7rem; }
.bm-model { border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.bm-model > button { width: 100%; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.6fr) 7rem 2rem; gap: .4rem 1.2rem; align-items: center;
  padding: 1rem 1.2rem; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; background: transparent; }
.bm-model > button:hover { background: var(--cloud); }
.bm-model > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bm-mname { display: grid; gap: .15rem; min-width: 0; }
.bm-mname b { color: var(--ink); font-size: 1rem; overflow-wrap: anywhere; }
.bm-mname span { font-size: .78rem; color: var(--muted); }
.bm-best { display: grid; gap: .25rem; min-width: 0; }
.bm-best small { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.bm-best small b { color: var(--ink); font-weight: 600; }
.bm-fig { text-align: right; font-variant-numeric: tabular-nums; display: grid; justify-items: end; }
.bm-fig b { font: 650 1.3rem/1.1 var(--font-sys); color: var(--ink); }
.bm-fig small { font-size: .72rem; color: var(--muted); }
.bm-model.is-sto .bm-fig b { color: var(--amber); }
.bm-chev { width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; background: var(--cloud); color: var(--body); transition: transform .2s; }
.bm-model.is-open .bm-chev { transform: rotate(180deg); }
.bm-more { padding: 0 1.2rem 1rem; }
.bm-more .bx-row { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr) 6.5rem; }
.bm-src { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font: 600 .7rem/1.5 var(--font-sys); background: var(--cloud-2); color: var(--ink); }
.bm-src--lab { background: var(--blue-tint); color: var(--link); }
.bm-src--app { background: var(--amber-tint); color: var(--amber); }
.bm-src--node { background: rgba(48, 164, 108, .14); color: var(--green); }
.bm-board { margin-top: 1.4rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .9rem; }
.bm-note { margin: 1rem 0 0; font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) {
  .bm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bm-model > button { grid-template-columns: minmax(0, 1fr) auto; }
  .bm-mname { grid-column: 1; }
  .bm-fig { grid-column: 2; grid-row: 1; }
  .bm-best { grid-column: 1 / -1; }
  .bm-chev { display: none; }
  .bm-more .bx-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bm-tools { position: static; }
}
@media (prefers-reduced-motion: reduce) { .bx-track i, .bm-chev { transition: none; } }
.lv-k-mem { color: var(--link); }
.lv-k-sto { color: var(--amber); }
