/* with icons — the shared style picker (site/STYLE-PICKER.md, js/style-picker.js).
   The compact row (.sp-row) and the full picker (.sp-layer: a centred modal on desktop, a full-height sheet on phones).
   Calm by design: neutral plates, one ink ring for the selected style, a single small dot for new styles. */

.sp-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* ───────── tiles (shared) ───────── */
.sp-t {
  --sp-plate: calc(var(--sp-s, 32px) + 16px);
  appearance: none; border: 0; background: none; margin: 0; padding: 2px 0 0; font: inherit; color: var(--ink);
  display: inline-flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer;
  width: calc(var(--sp-plate) + 12px); min-height: 44px; border-radius: 14px;
  -webkit-tap-highlight-color: transparent; position: relative;
}
.sp-plate {
  width: var(--sp-plate); height: var(--sp-plate); border-radius: 14px; display: grid; place-items: center;
  background: var(--paper-2, #F3EEE6); box-shadow: inset 0 0 0 1px var(--rule);
  transition: box-shadow .16s var(--e-out, ease-out), background-color .16s var(--e-out, ease-out), transform .16s var(--e-out, ease-out);
}
:root[data-theme="dark"] .sp-plate { background: var(--paper-3, #1C2029); }
/* scoped to tiles: chrome.css's search preview has its own .sp-ic (a dotted card), which must not leak in here */
.sp-ic[data-sp-st] {
  width: var(--sp-s, 32px); height: var(--sp-s, 32px); display: grid; place-items: center; color: var(--ink);
  aspect-ratio: auto; max-height: none; border-radius: 0; background: none; flex: none;
}
.sp-ic[data-sp-st] > svg { width: 100%; height: 100%; display: block; overflow: visible; }
.sp-skel { width: 72%; height: 72%; border-radius: 30%; background: var(--rule); opacity: .55; display: block; }
html:not(.reduced) .sp-ic.is-wait .sp-skel { animation: sp-pulse 1.2s ease-in-out infinite alternate; }
@keyframes sp-pulse { from { opacity: .35 } to { opacity: .7 } }
.sp-n {
  font-size: 11.5px; line-height: 14px; font-weight: 550; color: var(--muted); letter-spacing: .005em;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 4px;
}
.sp-new { width: 6px; height: 6px; border-radius: 50%; background: var(--sun, #FFD23F); box-shadow: 0 0 0 1.5px var(--paper); flex: none; }
@media (hover: hover) and (pointer: fine) {
  .sp-t:hover .sp-plate { background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-strong), 0 6px 16px -10px rgba(17, 19, 24, .35); }
  .sp-t:hover .sp-n { color: var(--ink); }
}
.sp-t:active .sp-plate { transform: scale(.96); }
.sp-t.is-on .sp-plate { background: var(--card); box-shadow: inset 0 0 0 2px var(--ink); }
.sp-t.is-on .sp-n { color: var(--ink); font-weight: 700; }
.sp-t:focus, .sp-t:focus-visible { outline: none; box-shadow: none; }
.sp-t:focus-visible .sp-plate { outline: 2px solid var(--focus-ring, #111318); outline-offset: 2px; box-shadow: inset 0 0 0 1px var(--rule-strong), 0 0 0 5px var(--focus-halo, #FFD23F); }
.sp-t.is-on:focus-visible .sp-plate { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 5px var(--focus-halo, #FFD23F); }
.sp-t[hidden] { display: none; }

/* ───────── the compact row ───────── */
.sp-row { display: flex; align-items: flex-start; gap: 4px; min-height: calc(var(--sp-s, 32px) + 40px); }
.sp-row .sp-all { width: auto; min-width: calc(var(--sp-s, 32px) + 28px); margin-left: 4px; padding-left: 2px; padding-right: 2px; }
.sp-row .sp-all .sp-plate { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule-strong); border-style: dashed; color: var(--ink); }
.sp-row .sp-all .sp-n { color: var(--ink); font-weight: 650; }
@media (hover: hover) and (pointer: fine) { .sp-row .sp-all:hover .sp-plate { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); } }
@media (max-width: 640px) {
  .sp-row { gap: 2px; }
  .sp-row .sp-t { width: calc(var(--sp-plate) + 6px); }
  .sp-row .sp-all { min-width: 0; width: calc(var(--sp-plate) + 10px); margin-left: 2px; }
  .sp-all-x { display: none; }
}

/* the "good for" tip */
.sp-tip {
  position: fixed; left: 0; top: 0; z-index: 1300; pointer-events: none; max-width: 260px;
  padding: 7px 10px; border-radius: 10px; background: var(--ink); color: var(--paper);
  font-size: 12.5px; line-height: 1.35; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5);
  opacity: 0; transition: opacity .12s ease-out;
}
.sp-tip b { display: block; font-weight: 700; margin-bottom: 1px; }
.sp-tip.is-on { opacity: 1; }

/* ───────── the full picker ─────────
   Desktop: a centred modal (header with search · a group rail · the list · a footer that says what the hovered style is good for).
   Phones: a full-height sheet (header · sticky search · group tabs · the list). Tiles keep their size while drawings load. */
.sp-layer { position: fixed; inset: 0; z-index: 1200; font-family: var(--font-sans, system-ui, sans-serif); color: var(--ink); --sp-fade: 1; }
.sp-scrim {
  position: absolute; inset: 0; background: rgba(12, 13, 17, .44); opacity: 0;
  transition: opacity .24s var(--e-out, ease-out);
}
:root[data-theme="dark"] .sp-scrim { background: rgba(0, 0, 0, .62); }
.sp-layer.is-pop .sp-scrim { -webkit-backdrop-filter: blur(3px) saturate(.9); backdrop-filter: blur(3px) saturate(.9); }
.sp-layer.is-in .sp-scrim { opacity: var(--sp-fade); }
.sp-layer.is-out .sp-scrim { opacity: 0; transition-duration: .16s; }

.sp-panel {
  position: absolute; display: flex; flex-direction: column; background: var(--card); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule), var(--shadow-l, 0 40px 80px -36px rgba(17, 19, 24, .42)), 0 2px 10px -2px rgba(17, 19, 24, .14);
  outline: none; overflow: hidden;
}
/* desktop: centred, roomy, grows out of the control that opened it */
.sp-layer.is-pop .sp-panel {
  inset: 0; margin: auto; width: min(1080px, calc(100vw - 48px)); height: min(860px, calc(100vh - 48px)); height: min(860px, calc(100dvh - 48px));
  border-radius: 24px; opacity: 0; transform: translateY(10px) scale(.97);
  transition: opacity .2s var(--e-out, ease-out), transform .28s var(--e-out, ease-out);
}
.sp-layer.is-pop.is-in .sp-panel { opacity: 1; transform: none; }
.sp-layer.is-pop.is-out .sp-panel { opacity: 0; transform: scale(.985); transition-duration: .14s; }
/* phones: a sheet from the bottom, as tall as the screen */
.sp-layer.is-sheet .sp-panel {
  left: 0; right: 0; bottom: 0; top: max(8px, env(safe-area-inset-top, 0px)); border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%); transition: transform .34s var(--e-drawer, cubic-bezier(.32, .72, 0, 1));
}
.sp-layer.is-sheet.is-in .sp-panel { transform: none; }
.sp-layer.is-sheet.is-out .sp-panel { transform: translateY(100%); transition-duration: .24s; }
.sp-layer.is-sheet .sp-panel.is-drag { transition: none; }
html.reduced .sp-panel, html.reduced .sp-scrim { transition: none !important; }
html.reduced .sp-layer .sp-panel { transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .sp-layer .sp-panel { transform: none !important; transition: opacity .12s linear !important; }
  .sp-layer.is-sheet .sp-panel { opacity: 0; }
  .sp-layer.is-sheet.is-in .sp-panel { opacity: 1; }
}

.sp-grip { display: grid; place-items: center; height: 20px; flex: none; cursor: grab; touch-action: none; }
.sp-grip span { width: 40px; height: 5px; border-radius: 3px; background: var(--rule-strong); }

/* header: title + what the tiles show · search · close */
.sp-head {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 360px) auto; align-items: center; gap: 16px;
  padding: 18px 18px 16px 28px; border-bottom: 1px solid var(--rule);
}
.sp-ht { min-width: 0; }
.sp-h { margin: 0; font-family: var(--font-display, inherit); font-size: 22px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sub { margin: 3px 0 0; font-size: 13px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-x {
  appearance: none; border: 0; background: var(--paper-2); color: var(--ink); width: 44px; height: 44px;
  border-radius: 999px; display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background-color .15s ease-out, transform .15s var(--e-out, ease-out);
}
:root[data-theme="dark"] .sp-x { background: var(--paper-3); }
.sp-x:hover { background: var(--rule); }
.sp-x:active { transform: scale(.94); }
.sp-x:focus-visible { outline: 2px solid var(--focus-ring, #111318); outline-offset: 2px; }

.sp-find { position: relative; min-width: 0; }
.sp-find svg { position: absolute; left: 14px; top: 50%; margin-top: -9px; color: var(--muted); pointer-events: none; }
.sp-q {
  width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px 0 42px; border-radius: 999px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--paper-2); border: 1px solid transparent; outline: none;
  transition: border-color .15s ease-out, background-color .15s ease-out, box-shadow .15s ease-out;
}
:root[data-theme="dark"] .sp-q { background: var(--paper-3); }
.sp-q::placeholder { color: var(--muted); opacity: 1; }
.sp-q:focus, .sp-q:focus-visible { background: var(--card); border-color: var(--ink); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 9%, transparent); }
.sp-q::-webkit-search-cancel-button { cursor: pointer; }

/* body: group rail + list */
.sp-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 208px minmax(0, 1fr); }
.sp-nav { min-height: 0; overflow-y: auto; padding: 18px 12px; border-right: 1px solid var(--rule); background: color-mix(in srgb, var(--paper-2) 45%, var(--card)); scrollbar-width: thin; }
.sp-navl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-navl li[hidden] { display: none; }
.sp-go {
  appearance: none; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 12px;
  border-radius: 12px; font-size: 14px; font-weight: 600; text-align: left; position: relative;
  transition: background-color .15s ease-out, color .15s ease-out;
}
.sp-go-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-go-n { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; opacity: .8; }
.sp-go:hover { color: var(--ink); background: var(--paper-2); }
:root[data-theme="dark"] .sp-go:hover { background: var(--paper-3); }
.sp-go.is-on { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--rule), 0 1px 2px rgba(17, 19, 24, .06); }
.sp-go.is-on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink); }
.sp-go:focus-visible { outline: 2px solid var(--focus-ring, #111318); outline-offset: -2px; }

.sp-scroll { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 32px; scrollbar-width: thin; outline: none; }
.sp-l { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.sp-uses { padding: 0 0 4px; }
.sp-uses[hidden] { display: none; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sp-chip {
  appearance: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--card); cursor: pointer;
  border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0 14px; min-height: 36px; line-height: 1;
  transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out, transform .15s var(--e-out, ease-out);
}
.sp-chip:hover { border-color: var(--ink); }
.sp-chip:active { transform: scale(.97); }
.sp-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sp-chip:focus-visible { outline: 2px solid var(--focus-ring, #111318); outline-offset: 2px; }
@media (pointer: coarse) { .sp-chip { min-height: 40px; } }

/* sections: a header (title, count, one-line blurb) over a grid of big tiles */
.sp-sec { padding-top: 24px; }
.sp-sec[hidden] { display: none; }
.sp-sec.is-group { border-top: 1px solid var(--rule); margin-top: 26px; }
.sp-layer.is-searching .sp-sec.is-group { border-top: 0; margin-top: 0; padding-top: 4px; }
.sp-layer.is-searching .sp-sec.is-group ~ .sp-sec.is-group:not([hidden]) { padding-top: 24px; }
.sp-sh { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; margin-bottom: 14px; min-width: 0; }
.sp-gh { margin: 0; font-family: var(--font-display, inherit); font-size: 17px; line-height: 1.25; font-weight: 750; letter-spacing: -.012em; }
.sp-count {
  font-size: 12px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 999px; background: var(--paper-2); line-height: 1.3;
}
:root[data-theme="dark"] .sp-count { background: var(--paper-3); }
.sp-blurb { flex-basis: 100%; margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); max-width: 70ch; }

.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 16px 6px; justify-items: center; }
.sp-card { --sp-plate: 92px; width: 100%; max-width: 120px; gap: 8px; padding: 0; border-radius: 22px; }
.sp-card .sp-plate { width: var(--sp-plate); height: var(--sp-plate); border-radius: 22px; position: relative; }
.sp-card .sp-n { font-size: 13px; line-height: 16px; font-weight: 600; color: var(--ink-2, var(--ink)); }
.sp-card.is-on .sp-n { color: var(--ink); font-weight: 750; }
@media (hover: hover) and (pointer: fine) {
  .sp-card:hover .sp-plate {
    background: var(--card); transform: translateY(-2px);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sp-c, var(--ink)) 55%, var(--rule-strong)), 0 14px 26px -16px color-mix(in srgb, var(--sp-c, var(--ink)) 75%, transparent);
  }
  .sp-card.is-on:hover .sp-plate { box-shadow: inset 0 0 0 2px var(--ink), 0 14px 26px -16px color-mix(in srgb, var(--sp-c, var(--ink)) 75%, transparent); }
}
.sp-card:active .sp-plate { transform: scale(.97); }
.sp-card.is-on .sp-plate { background: var(--card); box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.sp-tag {
  position: absolute; top: 7px; left: 7px; font-style: normal; font-size: 9.5px; line-height: 1; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 999px; background: var(--sun, #FFD23F); color: #111318; pointer-events: none;
}
.sp-check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); box-shadow: 0 0 0 2px var(--card); pointer-events: none;
}
.sp-t.is-match .sp-plate { box-shadow: inset 0 0 0 1px var(--rule-strong), 0 0 0 3px var(--sun, #FFD23F); }
.sp-t.is-match.is-on .sp-plate { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px var(--sun, #FFD23F); }
.sp-t.is-first::after {
  content: 'Top pick'; position: absolute; top: calc(var(--sp-plate, 48px) - 9px); left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 1;
  font-size: 10px; font-weight: 750; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--ink); color: var(--paper);
}
.sp-sec[data-sp-sec="best"] .sp-grid { padding-top: 6px; }
.sp-empty { margin: 40px 0 12px; color: var(--muted); font-size: 14.5px; text-align: center; }
.sp-empty[hidden] { display: none; }
.sp-try { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* footer: the hovered / focused style in words, the caller's actions */
.sp-foot {
  flex: none; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 18px 9px 28px;
  border-top: 1px solid var(--rule); background: var(--card);
}
.sp-say { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; color: var(--muted); display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.sp-say b { color: var(--ink); font-weight: 750; font-size: 14.5px; flex: none; }
.sp-say i { font-style: normal; font-size: 11.5px; font-weight: 650; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--paper-2); flex: none; }
:root[data-theme="dark"] .sp-say i { background: var(--paper-3); }
.sp-say span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sp-keys { flex: none; margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sp-keys kbd {
  font: inherit; font-size: 11px; font-weight: 650; display: inline-block; min-width: 20px; padding: 2px 5px; margin: 0 1px; text-align: center;
  border-radius: 6px; background: var(--paper-2); box-shadow: inset 0 -1px 0 var(--rule-strong), inset 0 0 0 1px var(--rule); color: var(--ink);
}
:root[data-theme="dark"] .sp-keys kbd { background: var(--paper-3); }
@media (pointer: coarse), (max-width: 860px) { .sp-keys { display: none; } }
.sp-act {
  appearance: none; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--ink); background: var(--paper-2); cursor: pointer;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0 16px; min-height: 40px; white-space: nowrap; flex: none;
}
.sp-act:hover { border-color: var(--ink); }
.sp-act.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sp-act:focus-visible { outline: 2px solid var(--focus-ring, #111318); outline-offset: 2px; }

/* mid-size screens: a slimmer rail */
@media (max-width: 900px) {
  .sp-body { grid-template-columns: 176px minmax(0, 1fr); }
  .sp-head { grid-template-columns: minmax(0, 1fr) minmax(180px, 280px) auto; padding-left: 22px; }
  .sp-scroll { padding: 18px 20px 28px; }
}

/* ── phones: the sheet ── */
.sp-layer.is-sheet .sp-head {
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'ht x' 'find find'; gap: 10px 8px;
  padding: 0 12px 10px 18px; border-bottom: 0;
}
.sp-layer.is-sheet .sp-ht { grid-area: ht; touch-action: none; }
.sp-layer.is-sheet .sp-x { grid-area: x; }
.sp-layer.is-sheet .sp-find { grid-area: find; margin-right: 4px; }
.sp-layer.is-sheet .sp-h { font-size: 20px; }
.sp-layer.is-sheet .sp-body { display: flex; flex-direction: column; }
.sp-layer.is-sheet .sp-nav {
  flex: none; overflow-x: auto; overflow-y: hidden; padding: 0 12px 10px; border-right: 0; border-bottom: 1px solid var(--rule);
  background: none; scrollbar-width: none;
}
.sp-layer.is-sheet .sp-nav::-webkit-scrollbar { display: none; }
.sp-layer.is-sheet .sp-navl { flex-direction: row; gap: 6px; width: max-content; }
.sp-layer.is-sheet .sp-go {
  width: auto; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; gap: 6px;
  border: 1px solid var(--rule-strong); color: var(--ink);
}
.sp-layer.is-sheet .sp-go:hover { background: none; }
.sp-layer.is-sheet .sp-go.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: none; }
.sp-layer.is-sheet .sp-go.is-on::before { display: none; }
.sp-layer.is-sheet .sp-go.is-on .sp-go-n { color: var(--paper); }
.sp-layer.is-sheet .sp-scroll { flex: 1 1 auto; padding: 14px 12px 28px; }
.sp-layer.is-sheet .sp-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 10px -12px 0; padding: 0 12px 2px; }
.sp-layer.is-sheet .sp-chips::-webkit-scrollbar { display: none; }
.sp-layer.is-sheet .sp-chip { flex: none; }
.sp-layer.is-sheet .sp-sec { padding-top: 20px; }
.sp-layer.is-sheet .sp-sec.is-group { margin-top: 20px; }
.sp-layer.is-sheet .sp-gh { font-size: 16px; }
.sp-layer.is-sheet .sp-blurb { font-size: 13px; }
.sp-layer.is-sheet .sp-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 14px 4px; }
.sp-layer.is-sheet .sp-card { --sp-plate: 76px; gap: 6px; }
.sp-layer.is-sheet .sp-card .sp-plate { border-radius: 18px; }
.sp-layer.is-sheet .sp-card .sp-n { font-size: 12.5px; }
.sp-layer.is-sheet .sp-tag { top: 5px; left: 5px; font-size: 8.5px; padding: 3px 5px; }
.sp-layer.is-sheet .sp-check { top: 4px; right: 4px; width: 20px; height: 20px; }
.sp-layer.is-sheet .sp-say, .sp-layer.is-sheet .sp-keys { display: none; }
.sp-layer.is-sheet .sp-foot { padding: 8px 12px; min-height: 0; }
.sp-layer.is-sheet .sp-foot:not(:has(.sp-act)) { display: none; }
.sp-layer.is-sheet .sp-foot { gap: 8px; }
.sp-layer.is-sheet .sp-act { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 12px; white-space: normal; line-height: 1.2; font-size: 13px; }

