/* TonePush shares TonePush Editor's face: dark graphite panels, the amber
   of a lit footswitch, Inter for words and Plex Mono for readings. The web
   leans on that so a tone looks the same here as it does in the app. */
:root {
  color-scheme: dark;

  --bg: #121418;
  --bg-deep: #0d0f12;
  --panel: #1a1d23;
  --raised: #22262e;
  --hover: #2a2f38;
  --line: #2a2e36;
  --line-strong: #3a404b;
  --wire: #4a505c;

  --text: #e4e6ea;
  --text-soft: #c3c8d0;
  --muted: #8f97a4;

  --accent: #d8a83b;
  --accent-bright: #f0c25a;
  --accent-ink: #1a1405;
  --accent-soft: rgba(216, 168, 59, 0.12);
  --hot: #ff8c10;
  --ok: #58b46e;
  --danger: #e8664a;

  --radius: 14px;
  --radius-small: 9px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
  --width: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);

  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/inter-latin-4e2eddab.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("/assets/plex-mono-latin-a1d610bf.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(216, 168, 59, 0.07), transparent 70%),
    radial-gradient(50rem 30rem at -10% 10%, rgba(95, 155, 224, 0.05), transparent 70%),
    var(--bg);
  font: 16px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  width: min(var(--width), 100%);
  margin: 0 auto;
  padding: 2rem var(--gutter) 5rem;
  flex: 1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--text); letter-spacing: -0.025em; line-height: 1.12; text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 650; }
code { font-family: var(--mono); font-size: 0.85em; word-break: break-all; color: var(--text-soft); }
::selection { color: var(--accent-ink); background: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede { color: var(--text-soft); font-size: 1.12rem; }

/* ---------- Buttons ---------- */

.button,
input[type="submit"],
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 24px -12px rgba(216, 168, 59, 0.7);
  font: 650 0.95rem/1.2 var(--font);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover,
input[type="submit"]:hover {
  color: var(--accent-ink);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 12px 28px -12px rgba(216, 168, 59, 0.85);
}

.button:active, input[type="submit"]:active { transform: translateY(0); }

.button-secondary {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--raised);
  box-shadow: none;
}

.button-secondary:hover {
  border-color: var(--wire);
  color: var(--text);
  background: var(--hover);
  box-shadow: none;
}

.button-small { min-height: 2.2rem; padding: 0.4rem 0.85rem; font-size: 0.85rem; }

.button-disabled,
.button-disabled:hover {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.linkish {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: none;
  font: inherit;
  cursor: pointer;
}

.linkish:hover { color: var(--accent-bright); text-decoration: underline; }

/* ---------- Header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 20, 24, 0.82);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}

header.site .bar {
  width: min(var(--width), 100%);
  min-height: 4rem;
  margin: 0 auto;
  padding: 0.6rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.wordmark {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.wordmark b { color: var(--accent); font-weight: 750; }
.wordmark:hover { color: var(--text); text-decoration: none; }
.logo-mark { width: 1.9rem; height: 1.9rem; flex: none; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  font-weight: 550;
}

.primary-nav a {
  padding: 0.4rem 0.7rem;
  white-space: nowrap;
  border-radius: 8px;
  color: var(--muted);
}

.primary-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.primary-nav a.active { color: var(--text); background: var(--raised); }

/* Keep the companion app distinct from the catalog sections. */
.primary-nav .editor-link {
  margin-left: 0.5rem;
  border: 1px solid rgba(216, 168, 59, 0.45);
  color: var(--accent);
}

.primary-nav .editor-link:hover,
.primary-nav .editor-link.active { color: var(--accent-bright); border-color: var(--accent); background: var(--accent-soft); }

.header-search { flex: 1 1 11rem; min-width: 11rem; max-width: 15rem; margin-left: auto; }

.header-search input {
  width: 100%;
  height: 2.3rem;
  padding: 0 0.85rem 0 2.1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f97a4' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.7rem 50% / 0.95rem,
    var(--panel);
  font: 0.88rem var(--font);
}

.header-search input:focus { border-color: var(--accent); outline: none; background-color: var(--raised); }
.header-search + .account { margin-left: 0; }

.account {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-left: auto;
  font-size: 0.88rem;
  white-space: nowrap;
}

.account .who { color: var(--muted); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.account .who.active, .account .who:hover { color: var(--text); }
.account .signin { color: var(--text); font-weight: 600; }
.account .signin:hover { color: var(--accent); }
.account .linkish { color: var(--muted); }
.account .linkish:hover { color: var(--text); }
.account form { margin: 0; }

.mobile-nav { display: none; position: relative; }

.mobile-nav summary {
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: " +"; color: var(--muted); }
.mobile-nav[open] summary::after { content: " −"; }

.mobile-nav nav {
  width: 15rem;
  padding: 0.45rem;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: grid;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mobile-nav nav a { padding: 0.6rem 0.7rem; border-radius: 8px; color: var(--text); font-size: 0.92rem; font-weight: 550; }
.mobile-nav nav a:hover { background: var(--raised); text-decoration: none; }
.mobile-nav nav a.active { color: var(--accent); background: var(--raised); }
.mobile-nav nav .mobile-account-link { margin-top: 0.35rem; padding-top: 0.8rem; border-top: 1px solid var(--line); border-radius: 0; color: var(--accent); }

/* ---------- Footer ---------- */

footer.site { border-top: 1px solid var(--line); background: var(--bg-deep); }

.footer-inner {
  width: min(var(--width), 100%);
  margin: 0 auto;
  padding: 3rem var(--gutter) 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  gap: 2rem 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-brand p { max-width: 22rem; margin: 0.9rem 0 0; }
.footer-brand strong { color: var(--text-soft); }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.footer-links div { display: grid; align-content: start; gap: 0.45rem; }
.footer-links h2 { margin: 0 0 0.35rem; color: var(--text); font-size: 0.8rem; font-weight: 650; letter-spacing: 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-legal { grid-column: 1 / -1; margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.8rem; }

/* ---------- Flash ---------- */

.flash {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-small);
  background: var(--panel);
}

.flash-alert { border-left-color: var(--danger); }
.flash-notice { border-left-color: var(--ok); }

/* ---------- Page heads & sections ---------- */

.breadcrumbs {
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs > span:not(:last-child) { color: var(--wire); }
.breadcrumbs > span:last-child { color: var(--text-soft); }

.page-head { max-width: 50rem; margin: 0.75rem 0 2rem; }
.page-head h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 750; letter-spacing: -0.04em; line-height: 1.02; }
.page-head p:last-child { margin: 0.85rem 0 0; font-size: 1.05rem; }
.browse-head { max-width: 56rem; }

.section-head {
  margin: 0 0 1.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.section-head h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 720; }
.section-head p.muted { margin: 0.5rem 0 0; max-width: 40rem; }
.section-head > a, .section-link { flex: none; color: var(--text-soft); font-size: 0.9rem; font-weight: 600; }
.section-head > a:hover, .section-link:hover { color: var(--accent); }
.section-actions { display: flex; gap: 0.6rem; }

.discovery-section { margin: 0 0 4.5rem; }

.result-count { margin: 0 0 1rem; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; }

/* ---------- Home: hero ---------- */

.discovery-hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 5rem) 0 2.25rem;
  text-align: center;
}

.discovery-hero > .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(216, 168, 59, 0.3);
  border-radius: 999px;
  background: var(--accent-soft);
}

.discovery-hero > .eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.discovery-hero h1 {
  max-width: 15ch;
  margin: 0 auto;
  font-size: clamp(2.6rem, 7.4vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

/* Clipped gradient text only paints inside the line box, so give the
   descenders of "Play" and "pedal" room below the baseline. */
.discovery-hero h1 em {
  display: block;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  font-style: normal;
  background: linear-gradient(95deg, var(--accent-bright) 10%, var(--hot) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  max-width: 44rem;
  margin: 1.5rem auto 2rem;
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
}

.hero-search {
  position: relative;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(216, 168, 59, 0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.hero-search:focus-within { border-color: rgba(216, 168, 59, 0.7); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(216, 168, 59, 0.12); }

.search-icon { width: 1.25rem; height: 1.25rem; margin-left: 0.75rem; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }

.hero-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 3.1rem;
  padding: 0 0.5rem;
  border: 0;
  color: var(--text);
  background: transparent;
  font: 1.08rem var(--font);
  outline: none;
}

.hero-search input[type="submit"] { min-height: 3.1rem; padding-inline: 1.4rem; border-radius: 12px; }

.search-examples {
  margin: 1.1rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.search-examples > span { margin-right: 0.2rem; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }

.search-examples a {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(26, 29, 35, 0.6);
}

.search-examples a:hover { border-color: var(--wire); color: var(--text); background: var(--raised); text-decoration: none; }

/* ---------- Home: the rig ---------- */

.hero-rig { position: relative; margin: 1.5rem 0 4rem; }

.hero-rig::before {
  content: "";
  position: absolute;
  inset: 8% 10% -6%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(216, 168, 59, 0.16), transparent);
  filter: blur(30px);
}

.rig-window {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, #1c1f26, #15171c);
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  overflow: hidden;
}

.rig-head {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.rig-head p { margin: 0; }
.rig-kicker { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; }
.rig-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }

.rig-cover {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--cover);
  font-size: 0.85rem;
  font-weight: 800;
}

.rig-cta {
  margin-left: auto;
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
}

.rig-chain .chain-board { margin: 0; padding: 1.75rem 1.25rem; border: 0; border-radius: 0; }
.rig-chain .chain-path { flex-wrap: nowrap; justify-content: center; width: max-content; min-width: 100%; }
@media (min-width: 641px) {
  .rig-chain .chain-block { width: 6.6rem; }
  .rig-chain .chain-joint { width: 1.2rem; }
}

.rig-notes {
  margin: 0;
  padding: 1rem 1.25rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.rig-notes li { position: relative; padding-left: 1.2rem; }
.rig-notes strong { display: block; color: var(--text); }

.note-dot {
  position: absolute;
  top: 0.4rem;
  left: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--block-accent);
  box-shadow: 0 0 10px var(--block-accent);
}

.note-dot-off { border: 1.5px dashed var(--muted); background: transparent; box-shadow: none; }

/* ---------- Home: steps ---------- */

.discovery-steps {
  margin: 0 0 4.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
}

.discovery-steps li {
  padding: 1.35rem;
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(26, 29, 35, 0.55);
}

.step-number { color: var(--accent); font-family: var(--mono); font-size: 0.8rem; }
.discovery-steps strong { display: block; margin-bottom: 0.3rem; font-size: 1.05rem; }
.discovery-steps small { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

/* ---------- Home: ways in ---------- */

.link-list.way-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  border: 0;
}

.link-list.way-grid a.way {
  min-height: 15rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.link-list.way-grid a.way:hover { border-color: var(--line-strong); background: var(--raised); transform: translateY(-2px); }
.link-list.way-grid a.way small { margin-top: 0.35rem; }
.way-go { margin-top: auto; color: var(--accent); font-size: 0.88rem; font-weight: 600; }

.way-art {
  height: 4.5rem;
  padding: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  gap: 0.35rem;
  border-radius: 10px;
  background:
    linear-gradient(var(--bg-deep), var(--bg-deep)) padding-box,
    linear-gradient(135deg, var(--line-strong), transparent) border-box;
  border: 1px solid transparent;
  overflow: hidden;
}

.way-crumb { padding: 0.2rem 0.5rem; border-radius: 6px; color: var(--text-soft); background: var(--raised); font-size: 0.75rem; font-weight: 600; }
.way-crumb-on { color: var(--accent-ink); background: var(--accent); }
.way-arrow { color: var(--wire); }
.way-chip { padding: 0.18rem 0.5rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-soft); font-size: 0.72rem; }
.way-chip:nth-child(2) { border-color: rgba(63, 184, 178, 0.55); color: #8fd8d3; }
.way-chip:nth-child(4) { border-color: rgba(157, 128, 227, 0.55); color: #c4b4f0; }

.way-art-pulse { flex-wrap: nowrap; justify-content: center; gap: 0.3rem; }
.way-art-pulse span { width: 0.35rem; border-radius: 3px; background: var(--accent); opacity: 0.8; }
.way-art-pulse span:nth-child(1) { height: 30%; }
.way-art-pulse span:nth-child(2) { height: 70%; }
.way-art-pulse span:nth-child(3) { height: 100%; background: var(--hot); }
.way-art-pulse span:nth-child(4) { height: 55%; }
.way-art-pulse span:nth-child(5) { height: 25%; }

.way-art-filters { flex-wrap: nowrap; }
.way-art-filters span { flex: 1; padding: 0.3rem 0.4rem; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--muted); font-size: 0.72rem; text-align: center; }
.way-art-filters span:first-child { border-color: var(--accent); color: var(--accent); }

/* ---------- Home: devices ---------- */

.link-list.device-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  border: 0;
}

.link-list.device-tiles a {
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.link-list.device-tiles a:hover { border-color: var(--line-strong); background: var(--raised); }

.device-meter {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) var(--share), var(--line) var(--share));
}

/* ---------- Home: chain explainer ---------- */

.chain-explainer {
  margin: 0 0 4.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(30rem 20rem at 100% 0%, rgba(95, 155, 224, 0.08), transparent 70%),
    var(--panel);
}

.chain-explainer h2 { margin: 0 0 1rem; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 760; letter-spacing: -0.04em; }
.chain-explainer-copy > p { margin: 0 0 1.25rem; color: var(--text-soft); }

.explainer-list { margin: 0; padding: 0; display: grid; gap: 0.7rem; list-style: none; color: var(--muted); font-size: 0.93rem; }
.explainer-list li { padding-left: 1.4rem; position: relative; }
.explainer-list li::before { content: ""; position: absolute; left: 0; top: 0.55rem; width: 0.7rem; height: 2px; background: var(--accent); }
.explainer-list strong { color: var(--text); }

.category-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; }

.legend-item {
  padding: 0.75rem 0.5rem 0.6rem;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--block-accent) 35%, transparent);
  border-radius: 11px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--block-accent) 8%, var(--bg-deep));
  font-size: 0.74rem;
  font-weight: 550;
  text-align: center;
}

.legend-item .chain-icon { width: 1.6rem; height: 1.6rem; color: var(--block-accent); }

/* ---------- Editor CTA ---------- */

.editor-cta {
  margin: 0 0 4rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  border: 1px solid rgba(216, 168, 59, 0.28);
  border-radius: 20px;
  background:
    radial-gradient(28rem 18rem at 0% 100%, rgba(216, 168, 59, 0.14), transparent 70%),
    linear-gradient(180deg, #1c1f26, #15171c);
}

.editor-cta h2 { margin: 0 0 0.85rem; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 760; letter-spacing: -0.04em; }
.editor-cta p:not(.eyebrow) { margin: 0; color: var(--text-soft); }
.editor-cta > .button { justify-self: end; }
.editor-cta-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.contribute-cta { grid-template-columns: minmax(0, 1fr) auto; margin-top: 3rem; }

/* A drawing of the Editor, built from the same parts as the site. */
.editor-mock {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
}

.mock-titlebar { padding: 0.55rem 0.8rem; display: flex; align-items: center; gap: 0.35rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.mock-titlebar span { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line-strong); }
.mock-titlebar b { margin-left: 0.6rem; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.mock-body { display: grid; grid-template-columns: 22% 1fr; min-height: 13rem; }
.mock-sidebar { padding: 0.7rem 0.6rem; display: grid; align-content: start; gap: 0.45rem; border-right: 1px solid var(--line); background: var(--panel); }
.mock-sidebar i { height: 0.5rem; border-radius: 3px; background: var(--line); }
.mock-sidebar i.on { background: var(--accent); }
.mock-sidebar i:nth-child(odd):not(.on) { width: 75%; }
.mock-main { min-width: 0; padding: 0.9rem; display: grid; gap: 0.9rem; overflow: hidden; }
.mock-chain { display: flex; align-items: center; gap: 0.6rem; }

.mock-block {
  position: relative;
  width: 2.6rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--block-accent);
  border-radius: 8px;
  color: var(--block-accent);
  background: color-mix(in srgb, var(--block-accent) 10%, var(--bg));
}

.mock-block + .mock-block::before { content: ""; position: absolute; right: 100%; width: 0.6rem; height: 2px; background: var(--wire); }
.mock-block svg { width: 1.2rem; height: 1.2rem; }
.mock-knobs { display: flex; gap: 0.9rem; padding: 0.3rem 0; }
.mock-knobs span { width: 2.2rem; height: 2.2rem; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-right-color: var(--accent); border-radius: 50%; }
.mock-knobs span:nth-child(2) { border-right-color: var(--line-strong); }
.mock-knobs span:nth-child(4) { border-color: var(--accent); border-bottom-color: var(--line-strong); }
.mock-library { display: grid; gap: 0.4rem; }
.mock-library i { height: 0.55rem; border-radius: 3px; background: var(--line); }
.mock-library i:first-child { width: 85%; background: var(--line-strong); }
.mock-library i:last-child { width: 60%; }

.mock-status { padding: 0.55rem 0.8rem; display: flex; align-items: center; gap: 0.5rem; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 0.72rem; }
.mock-led { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.mock-status b { margin-left: auto; padding: 0.25rem 0.6rem; border-radius: 6px; color: var(--accent-ink); background: var(--accent); font-weight: 650; }

/* ---------- Publish CTA & day one ---------- */

.publish-cta {
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.publish-cta h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.publish-cta p { margin: 0; }

.day-one {
  margin: 0 0 4rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  text-align: center;
}

.day-one h2 { margin: 0 0 0.75rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.day-one p:not(.eyebrow) { max-width: 38rem; margin: 0 auto; color: var(--text-soft); }
.day-one-actions { margin-top: 1.5rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Covers ---------- */

/* A song without artwork still gets a face: a colour from its title, the
   rings of a speaker cone, and its initials. */
.tone-art, .rig-cover, .profile-mark {
  --cover:
    radial-gradient(circle at 70% 75%, rgba(0, 0, 0, 0) 0 18%, rgba(255, 255, 255, 0.06) 18.5% 19.5%, rgba(0, 0, 0, 0) 20% 31%, rgba(255, 255, 255, 0.05) 31.5% 32.5%, rgba(0, 0, 0, 0) 33%),
    linear-gradient(145deg, hsl(var(--cover-hue, 38) 55% 46%), hsl(calc(var(--cover-hue, 38) + 40) 45% 18%));
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.tone-art {
  position: relative;
  width: 3.5rem;
  aspect-ratio: 1;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--cover);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 18px -10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.tone-art span { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.tone-art:hover { text-decoration: none; }

.tone-art-small { width: 2.6rem; border-radius: 50%; }
.tone-art-small span { font-size: 0.8rem; }
.link-list a > .tone-art-small + span { flex: 1; min-width: 0; }

.tone-art-large { width: 8.5rem; border-radius: 20px; }
.tone-art-large span { font-size: 2.6rem; }

/* ---------- Song cards ---------- */

.tone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.tone-card {
  position: relative;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.tone-card:hover { border-color: var(--line-strong); background: var(--raised); transform: translateY(-2px); }

.tone-card-head { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.tone-card-head > div { min-width: 0; }
.tone-card h3 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
.tone-card h3 a { color: var(--text); }
.tone-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.tone-card h3 a:hover { color: var(--text); text-decoration: none; }
.tone-context { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.88rem; }

.tone-card-match {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--bg-deep);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.tone-card-match strong { color: var(--accent); font-weight: 600; }

.tone-card-meta {
  margin-top: auto;
  padding-top: 0.85rem;
  display: grid;
  gap: 0.7rem;
  border-top: 1px solid var(--line);
}

.device-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.device-chips a, .device-chips span {
  position: relative;
  z-index: 1;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text-soft);
  background: var(--bg-deep);
  font-size: 0.74rem;
  font-weight: 550;
  white-space: nowrap;
}

.device-chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.device-chips a.selected { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.device-chips small { margin-left: 0.15rem; color: var(--muted); font-family: var(--mono); font-size: 0.68rem; }
.device-chips a.selected small { color: var(--accent-ink); }

.card-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.card-stats > span:first-child { color: var(--text); font-size: 0.78rem; }
.card-availability { font-family: var(--font); font-weight: 600; }
.card-availability-direct { color: var(--ok); }
.card-availability-external { color: var(--accent); }
.card-availability-mixed, .card-availability-partial_direct { color: #8fd8a0; }

/* ---------- Generic link lists ---------- */

.link-list { display: grid; border-top: 1px solid var(--line); }

.link-list a {
  padding: 0.95rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  transition: background 120ms ease, padding 120ms ease;
}

.link-list a:hover { padding-inline: 0.75rem; background: var(--panel); text-decoration: none; }
.link-list a > span:last-child:not(:first-child) { color: var(--muted); }
.link-list a:hover > span:last-child:not(:first-child) { color: var(--accent); }
.link-list strong { display: block; font-weight: 620; }
.link-list small { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.86rem; }

.link-list.large { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; border-top: 0; }
.link-list.large a { padding-block: 1.05rem; }
.link-list.large strong { font-size: 1.05rem; }

/* ---------- Search & filters ---------- */

.catalog-tools { margin: 0 0 1.5rem; display: grid; gap: 0.75rem; }

.catalog-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 48rem;
}

.catalog-search input[type="search"], .tone-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 2.9rem;
  padding: 0 1rem 0 2.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f97a4' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.9rem 50% / 1.05rem,
    var(--panel);
  font: 1rem var(--font);
}

.catalog-search input[type="search"]:focus, .tone-search input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.catalog-search input[type="submit"], .tone-search input[type="submit"] { min-height: 2.9rem; }
.catalog-search-compact { margin: 0 0 2rem; max-width: 36rem; }
.search-clear { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.search-clear:hover { color: var(--text); }

.catalog-filters { max-width: 48rem; }

.catalog-filters summary,
.tone-device-menu summary,
.form-details summary,
.technical-details summary,
.search-same-title summary,
.host-file summary {
  width: fit-content;
  cursor: pointer;
  list-style: none;
}

.catalog-filters summary::-webkit-details-marker,
.tone-device-menu summary::-webkit-details-marker,
.form-details summary::-webkit-details-marker,
.technical-details summary::-webkit-details-marker,
.search-same-title summary::-webkit-details-marker,
.host-file summary::-webkit-details-marker { display: none; }

.catalog-filters summary {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel);
  font-size: 0.86rem;
  font-weight: 600;
}

.catalog-filters summary::before { content: "▸ "; color: var(--muted); }
.catalog-filters[open] summary::before { content: "▾ "; }
.catalog-filters summary span { color: var(--accent); font-weight: 500; }

.filter-fields {
  margin-top: 0.75rem;
  padding: 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.filter-fields label { display: grid; gap: 0.35rem; }
.filter-fields label > span { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.filter-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; }
.filter-actions a { color: var(--muted); font-size: 0.88rem; }
.original-filter-fields { grid-template-columns: minmax(0, 20rem) 1fr; align-items: end; }
.original-filter-fields .filter-actions { grid-column: auto; }

/* ---------- Catalog: sidebar filters beside the results ---------- */

.catalog-tabs {
  margin: -0.5rem 0 1.5rem;
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.catalog-tabs a {
  margin-bottom: -1px;
  padding: 0.65rem 0.9rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-tabs a:hover { color: var(--text); text-decoration: none; }
.catalog-tabs a.active { border-bottom-color: var(--accent); color: var(--text); }

.catalog .catalog-search { max-width: none; margin-bottom: 1.75rem; }

.catalog-layout {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: 2.25rem;
  align-items: start;
}

.catalog-sidebar {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.catalog-sidebar .catalog-filters { max-width: none; }

/* A phone gets a collapsed Filters button. Beside the results there is room,
   so the panel stays open whatever the details element says. */
@media (min-width: 901px) {
  .catalog-sidebar .catalog-filters::details-content { content-visibility: visible; block-size: auto; }
  .catalog-sidebar .catalog-filters > summary {
    width: auto;
    padding: 0 0 0.75rem;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 680;
    pointer-events: none;
  }
  .catalog-sidebar .catalog-filters > summary::before { content: none; }
  .catalog-sidebar .catalog-filters > summary span { display: none; }
}

.filter-groups { display: grid; }

.filter-group {
  min-width: 0;
  margin: 0;
  padding: 1rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.filter-group legend {
  float: left;
  width: 100%;
  margin-bottom: 0.55rem;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-options { clear: both; display: grid; gap: 0.1rem; }

.filter-options-scroll {
  max-height: 15rem;
  padding-right: 0.25rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.filter-option {
  padding: 0.38rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-option:hover { color: var(--text); background: var(--panel); }
.filter-option input { flex: none; margin: 0; accent-color: var(--accent); }
.filter-option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-option small { flex: none; color: var(--muted); font-family: var(--mono); font-size: 0.7rem; }
.filter-option:has(input:checked) { color: var(--text); background: var(--raised); font-weight: 600; }
.filter-option:has(input:checked) small { color: var(--accent); }
.filter-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

.filter-groups .filter-actions { padding-top: 1rem; border-top: 1px solid var(--line); }

.catalog-toolbar {
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.catalog-toolbar .result-count { margin: 0; color: var(--text-soft); }

.active-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.active-filter {
  padding: 0.25rem 0.4rem 0.25rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(216, 168, 59, 0.45);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.active-filter span { width: 1.1rem; height: 1.1rem; display: grid; place-items: center; border-radius: 50%; font-size: 0.9rem; line-height: 1; }
.active-filter:hover { color: var(--accent-bright); text-decoration: none; }
.active-filter:hover span { color: var(--accent-ink); background: var(--accent); }

.sort-control { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.85rem; }

.sort-control select {
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f97a4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.6rem center / 1rem,
    var(--panel);
  font: 600 0.88rem var(--font);
  appearance: none;
  cursor: pointer;
}

.sort-control select:focus { border-color: var(--accent); outline: none; }

.catalog-results { min-width: 0; }
.catalog-results .tone-grid { grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); }
.catalog-results .search-same-title { margin-top: -1rem; }

/* ---------- Search results ---------- */

.search-best, .search-suggestions, .search-tone-results { margin: 0 0 2.5rem; }

.search-best-card {
  padding: 1.35rem;
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr) auto;
  gap: 1.35rem;
  align-items: center;
  border: 1px solid rgba(216, 168, 59, 0.35);
  border-radius: 16px;
  background:
    radial-gradient(24rem 12rem at 0% 0%, rgba(216, 168, 59, 0.1), transparent 70%),
    var(--panel);
}

.search-best-card .tone-art { width: 6rem; border-radius: 16px; }
.search-best-card .tone-art span { font-size: 1.8rem; }
.search-best-card h2 { margin: 0; font-size: 1.6rem; font-weight: 720; }
.search-best-card h2 a { color: var(--text); }
.search-best-copy > p:not(.tone-context) { margin: 0.6rem 0 0.8rem; color: var(--text-soft); font-size: 0.95rem; }
.search-device .search-best-card { border-color: rgba(95, 155, 224, 0.4); background: radial-gradient(24rem 12rem at 0% 0%, rgba(95, 155, 224, 0.1), transparent 70%), var(--panel); }
.search-artist .search-best-card { border-color: rgba(157, 128, 227, 0.4); background: radial-gradient(24rem 12rem at 0% 0%, rgba(157, 128, 227, 0.1), transparent 70%), var(--panel); }

.search-suggestions { padding: 1.35rem; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.search-suggestions h2 { margin: 0 0 0.35rem; font-size: 1.4rem; }
.search-suggestions .link-list { margin-top: 1rem; }
.suggestion-recovery { margin: 1rem 0 0; color: var(--muted); font-size: 0.9rem; }

.search-same-title { margin: -1.5rem 0 2.5rem; padding: 0.9rem 1.1rem; border: 1px dashed var(--line-strong); border-radius: 12px; }
.search-same-title summary { font-size: 0.9rem; }
.search-same-title summary span { margin-left: 0.5rem; color: var(--muted); }
.search-same-title-body p { color: var(--text-soft); font-size: 0.92rem; }

.search-more-head { margin: 0 0 1.25rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.search-more-head h2 { margin: 0; font-size: 1.5rem; }
.search-more-head p.muted { margin: 0.35rem 0 0; }
.search-more-head > span { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }

.search-recovery { margin-top: 3rem; }

/* ---------- Tone lists ---------- */

.tone-list { display: grid; gap: 0.6rem; }

.tone-listing {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 150ms ease, background 150ms ease;
}

.tone-listing:hover { border-color: var(--line-strong); background: var(--raised); }
.tone-listing > div { min-width: 0; }
.tone-listing .eyebrow { margin-bottom: 0.3rem; color: var(--muted); }
.tone-listing h3 { margin: 0; font-size: 1.15rem; font-weight: 650; }
.tone-listing h3 a { color: var(--text); }
.tone-listing h3 a:hover { color: var(--accent); }
.tone-listing p { margin: 0.25rem 0 0; }
.tone-device { color: var(--accent); font-size: 0.88rem; font-weight: 550; }
.tone-description { color: var(--text-soft); font-size: 0.92rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tone-listing .muted.small { font-size: 0.8rem; }
.tone-listing .button { flex: none; }

.tone-order-note { margin: 0 0 1rem; color: var(--muted); font-size: 0.88rem; }
.tone-order-note strong { color: var(--text); }

/* ---------- Device & sort pills ---------- */

.tone-device-nav { margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tone-device-nav a {
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--panel);
  font-size: 0.82rem;
  font-weight: 550;
  white-space: nowrap;
}

.tone-device-nav a:hover { border-color: var(--wire); color: var(--text); text-decoration: none; }
.tone-device-nav a.active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.tone-device-nav span { margin-left: 0.25rem; opacity: 0.7; font-family: var(--mono); font-size: 0.7rem; }

.tone-device-menu { display: none; }
.device-prompt { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.9rem; }

.device-results-head { margin-top: 1rem; align-items: flex-end; }
.device-results-head .tone-device-nav { margin: 0; justify-content: flex-end; }
.device-availability-nav { margin-bottom: 2rem; }

.device-note {
  margin: 0 0 2rem;
  padding: 1rem 1.2rem;
  max-width: 50rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  color: var(--text-soft);
  background: var(--panel);
  font-size: 0.93rem;
}

.device-note strong { color: var(--text); }

.tone-search { margin: 0 0 1.5rem; display: flex; align-items: center; gap: 0.5rem; max-width: 40rem; }
.tone-search a { color: var(--muted); font-size: 0.88rem; }

/* ---------- Song page ---------- */

.tone-hero {
  margin: 0 0 3rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.tone-hero h1 { margin: 0; font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 780; letter-spacing: -0.045em; line-height: 1; }
.tone-hero .eyebrow { margin-bottom: 0.6rem; }
.song-summary { margin: 0.85rem 0 0; color: var(--muted); }
.song-summary strong { color: var(--text); }
.tone-hero .lede { margin: 0.75rem 0 0; font-size: 1rem; }

.tag-row { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tag {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 550;
}

.tones-head { margin-top: 0.5rem; }

.owner-actions { margin-top: 2rem; display: flex; align-items: center; gap: 1.25rem; font-size: 0.9rem; }
.owner-actions form { margin: 0; }

/* ---------- Tone page ---------- */

.tone-detail-hero {
  margin: 0 0 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem);
  gap: 2.5rem;
  align-items: start;
}

.tone-detail-hero h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.98; overflow-wrap: anywhere; }
.tone-detail-copy { padding-top: 1rem; }
.tone-kind a { color: inherit; text-decoration: underline; text-decoration-color: rgba(216, 168, 59, 0.4); text-underline-offset: 3px; }
.tone-detail-hero .lede { margin: 1rem 0 0; color: var(--muted); }
.tone-detail-hero .lede a { color: var(--text); font-weight: 600; }
.tone-detail-hero .lede a:hover { color: var(--accent); }
.tone-notes { margin: 1.25rem 0 0; padding: 1rem 1.1rem; max-width: 42rem; border-left: 2px solid var(--line-strong); color: var(--text-soft); overflow-wrap: anywhere; }
.tone-detail-copy > p.muted { margin: 1rem 0 0; }

.tone-actions {
  position: sticky;
  top: 5.5rem;
  padding: 1.35rem;
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, #1e2128, #181a20);
  box-shadow: var(--shadow);
}

.tone-action-context { margin: 0; color: var(--muted); font-size: 0.85rem; }
.tone-action-context strong { color: var(--text); }
.tone-actions .button { width: 100%; white-space: normal; }
.tone-actions > .muted.small { font-size: 0.8rem; line-height: 1.45; }

.tone-action-facts {
  margin: 0.25rem 0;
  padding: 0.75rem 0;
  display: grid;
  gap: 0.45rem;
  border-block: 1px solid var(--line);
  font-size: 0.85rem;
}

.tone-action-facts div { display: flex; justify-content: space-between; gap: 1rem; }
.tone-action-facts dt { color: var(--muted); }
.tone-action-facts dd { margin: 0; color: var(--text); font-family: var(--mono); font-size: 0.8rem; text-align: right; }

.host-file {
  margin: 0 0 3rem;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

.host-file summary { color: var(--accent); font-weight: 600; }
.host-file summary::before { content: "+ "; }
.host-file[open] summary::before { content: "− "; }
.host-file p { color: var(--text-soft); font-size: 0.93rem; }
.host-file-form { display: grid; gap: 0.75rem; }
.host-file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.author-check { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--text-soft); font-size: 0.92rem; }
.author-check input { margin-top: 0.25rem; accent-color: var(--accent); }
.preset-selection { color: var(--ok); }

.detail-columns { margin: 0 0 3.5rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.detail-columns > section { padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.detail-columns h2 { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 680; }

.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.55rem 1.5rem; font-size: 0.93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.technical-details { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.technical-details summary { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.technical-details summary::before { content: "▸ "; }
.technical-details[open] summary::before { content: "▾ "; }
.technical-details .facts { margin-top: 0.75rem; }

.dependency-list { margin: 0; padding: 0; display: grid; gap: 0.5rem; list-style: none; }
.dependency-list li { padding: 0.75rem 0.9rem; display: flex; justify-content: space-between; gap: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-deep); }
.dependency-list strong { display: block; }
.dependency-list small { color: var(--muted); }

.requirement-warning { margin: 0; padding: 0.9rem 1rem; border: 1px solid rgba(224, 120, 146, 0.4); border-radius: 10px; color: var(--text-soft); background: rgba(224, 120, 146, 0.07); font-size: 0.93rem; }
.requirement-warning strong { color: #f0a3b5; }

.version-history { margin: 0 0 3rem; }
.version-history-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.version-history-head h2 { margin: 0; font-size: 1.5rem; }
.version-history-head > p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.version-history-intro { color: var(--muted); font-size: 0.92rem; }
.version-list { display: grid; gap: 0.5rem; }

.version-row {
  padding: 0.9rem 1.1rem;
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.version-current { border-color: rgba(216, 168, 59, 0.4); }
.version-number { display: flex; align-items: center; gap: 0.5rem; font-family: var(--mono); }
.version-number span { padding: 0.1rem 0.4rem; border-radius: 5px; color: var(--accent-ink); background: var(--accent); font-family: var(--font); font-size: 0.68rem; font-weight: 650; }
.version-copy strong { font-family: var(--mono); font-size: 0.88rem; font-weight: 400; overflow-wrap: anywhere; }
.version-copy p { margin: 0.25rem 0; color: var(--text-soft); font-size: 0.9rem; }
.version-copy small { color: var(--muted); }

.audio-section, .lineage-section { margin: 0 0 3rem; }
.audio-preview { padding: 1rem; display: grid; gap: 0.6rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.audio-preview audio { width: 100%; }
.audio-preview small { display: block; color: var(--muted); }

/* ---------- Signal chain ---------- */

.chain { margin: 0 0 2.5rem; }

.chain-head { margin: 0 0 1rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.chain-title { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 720; }
.chain-summary { margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chain-summary span { padding: 0.2rem 0.55rem; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text-soft); font-family: var(--mono); font-size: 0.74rem; }

.chain-board {
  position: relative;
  margin: 0 0 0.75rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.045) 1px, transparent 1.5px) 0 0 / 16px 16px,
    linear-gradient(180deg, #16181d, #111317);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chain-path-label { margin: 0 0 0.75rem; color: var(--muted); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* A long chain wraps rather than scrolls: every block stays in view. */
.chain-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 1rem;
}

.chain-stage { display: flex; align-items: center; flex: none; }

/* The wire between two blocks, with signal running along it. */
.chain-joint {
  position: relative;
  width: 1.6rem;
  height: 2px;
  background: var(--wire);
  overflow: hidden;
}

.chain-joint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
  animation: signal 2.4s linear infinite;
}

.chain-stage:nth-child(2) .chain-joint::after { animation-delay: 0.15s; }
.chain-stage:nth-child(3) .chain-joint::after { animation-delay: 0.3s; }
.chain-stage:nth-child(4) .chain-joint::after { animation-delay: 0.45s; }
.chain-stage:nth-child(5) .chain-joint::after { animation-delay: 0.6s; }
.chain-stage:nth-child(6) .chain-joint::after { animation-delay: 0.75s; }
.chain-stage:nth-child(7) .chain-joint::after { animation-delay: 0.9s; }
.chain-stage:nth-child(8) .chain-joint::after { animation-delay: 1.05s; }
.chain-stage:nth-child(9) .chain-joint::after { animation-delay: 1.2s; }
.chain-stage:nth-child(10) .chain-joint::after { animation-delay: 1.35s; }

@keyframes signal-down {
  0% { transform: translateY(-100%); }
  40%, 100% { transform: translateY(100%); }
}

@keyframes signal {
  0% { transform: translateX(-100%); }
  40%, 100% { transform: translateX(100%); }
}

.chain-block, .chain-endpoint {
  position: relative;
  width: 7rem;
  height: 7.6rem;
  padding: 0.85rem 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  border-radius: 12px;
  text-align: center;
}

.chain-block {
  --block-accent: #8b93a1;
  border: 1.5px solid var(--block-accent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--block-accent) 16%, transparent), transparent 70%),
    #1a1d23;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 10px 24px -14px var(--block-accent);
}

.chain-icon { width: 2.4rem; height: 2.4rem; margin-bottom: auto; display: grid; place-items: center; color: var(--block-accent); }
.chain-icon svg { width: 100%; height: 100%; }

.chain-name {
  width: 100%;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 620;
  line-height: 1.2;
  overflow-wrap: anywhere;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chain-category { color: var(--block-accent); font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; }

.chain-block.bypassed {
  --block-accent: #5b626e;
  border-style: dashed;
  background: #16181d;
  box-shadow: none;
}

.chain-block.bypassed .chain-name { color: var(--muted); }
.chain-block.bypassed .chain-icon { opacity: 0.6; }
.chain-block.bypassed::after {
  content: "OFF";
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  color: var(--muted);
  background: var(--raised);
  font-family: var(--mono);
  font-size: 0.55rem;
}

.chain-endpoint {
  width: 4.6rem;
  border: 1px solid var(--line-strong);
  background: #15171c;
  justify-content: center;
  gap: 0.45rem;
}

.chain-endpoint-mark {
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--wire);
  border-radius: 50%;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.chain-output .chain-endpoint-mark { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 14px -2px rgba(216, 168, 59, 0.5); }
.chain-endpoint-name { color: var(--muted); font-size: 0.72rem; }

.chain-demo { margin: 0; }
.chain-demo figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.88rem; text-align: center; }

.chain-board-empty { overflow: visible; display: grid; gap: 1rem; justify-items: center; text-align: center; }
.chain-board-empty p { max-width: 36rem; margin: 0; color: var(--text-soft); font-size: 0.93rem; }
.chain-ghost { width: 100%; display: flex; align-items: center; justify-content: center; opacity: 0.55; }
.chain-ghost i { flex: 0 1 1.4rem; height: 2px; background: var(--wire); }
.chain-ghost .ghost-block { width: 3.4rem; height: 3.8rem; flex: none; border: 1.5px dashed var(--line-strong); border-radius: 10px; }
.chain-ghost .ghost-end { width: 2.3rem; height: 2.3rem; flex: none; display: grid; place-items: center; border: 2px solid var(--wire); border-radius: 50%; color: var(--muted); font-family: var(--mono); font-size: 0.58rem; }

@media (prefers-reduced-motion: reduce) {
  .chain-joint::after { animation: none; display: none; }
  .tone-card, .link-list a, .way, .button { transition: none; }
}

/* ---------- Empty states & pagination ---------- */

.empty-state {
  margin: 1rem 0 2rem;
  padding: 2.5rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--text-soft);
  text-align: center;
}

.empty-state h2 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.empty-state p { max-width: 36rem; margin: 0 auto; }
.empty-actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem 1.25rem; }

.pagination {
  margin: 2.5rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.pagination a, .pagination > span[aria-disabled] {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel);
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination > span[aria-disabled] { color: var(--wire); border-color: var(--line); background: transparent; }
.pagination strong { color: var(--text); }

/* ---------- Download page ---------- */

.download-top { margin: 0 0 3rem; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.download-hero { padding: clamp(2rem, 5vw, 4rem) 0 0; max-width: 52rem; }
.download-hero h1 { margin: 0; font-size: clamp(2.6rem, 5.5vw, 4rem); font-weight: 800; letter-spacing: -0.05em; line-height: 0.98; }
.download-hero .lede { margin: 1.25rem 0 2rem; }
.download-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.download-device-note { margin: 1rem 0 0; color: var(--muted); font-size: 0.92rem; }

.download-next { margin: 0 0 4rem; padding: 1.75rem; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.download-next-head { margin-bottom: 1.5rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.download-next-head h2 { margin: 0; font-size: 1.6rem; }
.download-next-head > p { margin: 0; color: var(--muted); }
.download-steps { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; list-style: none; }
.download-steps li { display: flex; gap: 0.9rem; }
.download-steps li > span { width: 2rem; height: 2rem; flex: none; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-family: var(--mono); font-size: 0.8rem; }
.download-steps p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }

.download-setup { margin: 0 0 4rem; }
.download-setup h2 { margin: 0; }
.release-version { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 0.82rem; }
.release-version strong { color: var(--accent); font-weight: 400; }

.platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.platform-grid article { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.platform-grid h3 { margin: 0; font-size: 1.2rem; }
.platform-grid p:not(.eyebrow) { margin: 0 0 1rem; color: var(--muted); font-size: 0.92rem; }
.platform-actions { margin-top: auto; display: grid; gap: 0.6rem; }
.platform-actions .button { width: 100%; }
.platform-alternative { color: var(--muted); font-size: 0.85rem; text-align: center; }
.release-help { margin: 1.25rem 0 0; color: var(--muted); font-size: 0.88rem; }
.download-page-chain { margin: 0 0 4rem; }

/* ---------- Profiles ---------- */

.profile-hero {
  margin: 0 0 3rem;
  padding: 1.75rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.profile-mark {
  width: 6.5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cover);
  font-size: 2.2rem;
  font-weight: 800;
}

.profile-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 780; letter-spacing: -0.04em; }
.profile-hero .lede { margin: 0.4rem 0 1rem; color: var(--muted); font-size: 1rem; }
.profile-stats { margin: 0; display: flex; flex-wrap: wrap; gap: 1.75rem; }
.profile-stats div { display: flex; flex-direction: column-reverse; }
.profile-stats dt { color: var(--text); font-family: var(--mono); font-size: 1.3rem; }
.profile-stats dd { margin: 0; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.profile-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-section { margin: 0 0 3.5rem; }

.gear-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.gear-card { padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.gear-card h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.profile-chips a, .profile-chips span { padding: 0.2rem 0.55rem; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text-soft); font-size: 0.78rem; }
.profile-chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Forms ---------- */

input[type="text"], input[type="email"], input[type="search"], input[type="file"], select, textarea {
  font: 1rem var(--font);
}

.tone-form input[type="text"], .tone-form input[type="email"], .tone-form select, .tone-form textarea,
.auth-form input[type="email"], .auth-form input[type="text"],
.filter-fields select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--bg-deep);
}

.filter-fields select { padding: 0.55rem 0.7rem; font-size: 0.92rem; }

.tone-form input:focus, .tone-form select:focus, .tone-form textarea:focus,
.auth-form input:focus, .filter-fields select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

input[type="file"] { color: var(--text-soft); font-size: 0.9rem; }

input[type="file"]::file-selector-button {
  margin-right: 0.8rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--raised);
  font: 600 0.88rem var(--font);
  cursor: pointer;
}

::placeholder { color: #5f6673; }

.tone-form { max-width: 48rem; display: grid; gap: 1.25rem; }

.tone-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.tone-form legend { padding: 0 0.4rem; color: var(--text); font-size: 1.1rem; font-weight: 680; }
.fieldset-help { margin: -0.4rem 0 0.25rem; color: var(--muted); font-size: 0.92rem; }
.tone-form label { display: grid; gap: 0.4rem; }
.tone-form label > span { color: var(--text-soft); font-size: 0.88rem; font-weight: 600; }
.tone-form label > span small { margin-left: 0.3rem; color: var(--muted); font-weight: 400; }
.tone-form small.muted { font-size: 0.8rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.fixed-field { padding: 0.7rem 0; }

.publish-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

.publish-choices label {
  padding: 1rem;
  display: flex !important;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-deep);
  cursor: pointer;
}

.publish-choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.publish-choices input { margin-top: 0.25rem; accent-color: var(--accent); }
.publish-choices strong { display: block; color: var(--text); }
.publish-choices small { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.85rem; font-weight: 400; }

.preset-upload {
  padding: 1.1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--bg-deep);
}

.form-details { padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.form-details summary { color: var(--text); font-weight: 620; }
.form-details summary::before { content: "+ "; color: var(--accent); }
.form-details[open] summary::before { content: "− "; }
.form-details summary span { margin-left: 0.4rem; color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.form-details-body { margin-top: 1rem; display: grid; gap: 1rem; }

.form-errors { padding: 1rem 1.2rem; border: 1px solid rgba(232, 102, 74, 0.45); border-radius: 12px; background: rgba(232, 102, 74, 0.08); }
.form-errors p { margin: 0; }
.form-errors ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.form-error-hint { color: var(--muted); font-size: 0.88rem; }

.upload-rights { margin: 0; color: var(--muted); font-size: 0.88rem; }
.form-actions { display: flex; align-items: center; gap: 1.25rem; }

.auth-form { max-width: 30rem; display: flex; gap: 0.6rem; }
.auth-form input[type="email"], .auth-form input[type="text"] { flex: 1; }

.dialog {
  max-width: 34rem;
  margin: 3rem auto;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dialog h1 { margin: 0 0 0.75rem; font-size: 2rem; }
.auth-dialog .logo-mark { width: 3rem; height: 3rem; margin-bottom: 1rem; }
.auth-dialog .auth-form { max-width: none; }
.auth-dialog > p.muted { margin: 1.25rem 0 0; }
.dialog .page-head { margin: 0 0 1.25rem; }
.dialog .page-head h1 { font-size: 2rem; }

.pairing-confirmation {
  max-width: 30rem;
  padding: 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
}

.pairing-code { margin: 0.5rem 0 1rem; color: var(--accent); font-family: var(--mono); font-size: clamp(2rem, 8vw, 3rem); letter-spacing: 0.15em; }
.pairing-confirmation form { margin-top: 1.25rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1320px) {
  .account .who { display: none; }
}

@media (max-width: 1100px) {
  .header-search { display: none; }
  .header-search + .account { margin-left: auto; }
  .link-list.way-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-list.way-grid a.way { min-height: 0; }
  .gear-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; gap: 1rem; }
  .catalog-sidebar { position: static; max-height: none; overflow: visible; }
  .catalog-sidebar .catalog-filters[open] .filter-groups { margin-top: 0.75rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  .catalog-sidebar .catalog-filters[open] .filter-group:first-child { border-top: 0; }
  .primary-nav { display: none; }
  .mobile-nav { display: block; margin-left: auto; }
  .account { margin-left: 0; }
  .header-search + .account { margin-left: 0; }
  .tone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-list.device-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain-explainer, .editor-cta, .download-top { grid-template-columns: 1fr; }
  .editor-mock { transform: none; }
  .tone-detail-hero { grid-template-columns: 1fr; }
  .tone-detail-copy { padding-top: 0; }
  .tone-actions { position: static; }
  .profile-hero { grid-template-columns: auto 1fr; }
  .profile-actions { grid-column: 1 / -1; flex-direction: row; }
  .filter-fields { grid-template-columns: repeat(2, minmax(8rem, 1fr)); }
  .footer-inner { grid-template-columns: 1fr; }
  .rig-notes { grid-template-columns: 1fr; gap: 0.75rem; }
}

@media (max-width: 640px) {
  main { padding: 1.25rem 1rem 4rem; }
  header.site .bar { padding-inline: 1rem; gap: 0.75rem; }
  .account .who { display: none; }
  .account { gap: 0.6rem; }
  .account .publish { display: none; }

  .discovery-hero { padding-top: 1.75rem; }
  .discovery-hero h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .hero-search { flex-wrap: wrap; padding: 0.4rem; }
  .hero-search input[type="search"] { flex-basis: calc(100% - 3rem); height: 2.8rem; }
  .hero-search input[type="submit"] { width: 100%; min-height: 2.8rem; }
  .rig-head { flex-wrap: wrap; }
  .rig-cta { display: none; }
  .hero-rig { margin-bottom: 3rem; }

  .discovery-steps { grid-template-columns: 1fr; gap: 0.6rem; margin-bottom: 3.5rem; }
  .discovery-steps li { grid-template-columns: 2rem 1fr; padding: 1rem; }
  .link-list.way-grid { grid-template-columns: 1fr; }
  .link-list.device-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .link-list.device-tiles a { padding: 0.85rem; }
  .category-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .legend-item { font-size: 0.68rem; }
  .publish-cta { flex-direction: column; align-items: stretch; }
  .section-head { flex-direction: column; align-items: flex-start; }

  .catalog-tabs a { padding: 0.6rem 0.55rem; font-size: 0.88rem; }
  .catalog-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .catalog-search .search-clear { grid-column: 1 / -1; justify-self: start; }
  .search-more-head { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .search-best-card { grid-template-columns: 4.5rem minmax(0, 1fr); align-items: start; gap: 1rem; padding: 1.1rem; }
  .search-best-card .tone-art { width: 4.5rem; border-radius: 12px; }
  .search-best-card .tone-art span { font-size: 1.35rem; }
  .search-best-card h2 { font-size: 1.3rem; }
  .search-best-card > .button { grid-column: 1 / -1; }
  .search-same-title > summary span { margin: 0.25rem 0 0; display: block; }
  .filter-fields, .original-filter-fields { grid-template-columns: 1fr; }
  .pagination { gap: 0.5rem; font-size: 0.78rem; }
  .pagination a, .pagination > span[aria-disabled] { padding: 0.45rem 0.6rem; }

  .tone-grid { grid-template-columns: 1fr; }
  .link-list.large { grid-template-columns: 1fr; }
  .detail-columns, .platform-grid, .gear-grid { grid-template-columns: 1fr; }

  .tone-hero, .song-hero { margin: 0 0 2rem; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 1rem; align-items: start; }
  .tone-art-large { width: 4.75rem; border-radius: 14px; }
  .tone-art-large span { font-size: 1.5rem; }
  .song-hero h1 { margin-bottom: 0.35rem; font-size: clamp(2rem, 10vw, 3rem); }
  .song-hero .song-summary { font-size: 0.88rem; line-height: 1.4; }
  .song-hero .tag-row { grid-column: 1 / -1; }

  .tone-listing { align-items: stretch; flex-direction: column; gap: 0.9rem; }
  .tones-head { align-items: stretch; }
  .tones-head .section-actions { width: 100%; justify-content: flex-start; }
  .tone-device-nav-wide.has-selection { display: none; }
  .tone-device-nav-wide.compact-on-mobile { display: none; }
  .tone-device-menu { margin: 0 0 1rem; display: block; }

  .tone-device-menu summary {
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    color: var(--text);
    background: var(--panel);
    font-size: 0.86rem;
    font-weight: 600;
  }

  .tone-device-menu summary::after { content: " +"; color: var(--muted); }
  .tone-device-menu[open] summary::after { content: " −"; }
  .tone-device-menu .tone-device-nav { margin: 0.65rem 0 0; }
  .device-results-head { align-items: stretch; }
  .device-results-head .tone-device-nav { justify-content: flex-start; }
  .tone-search { display: grid; grid-template-columns: 1fr auto; }
  .tone-search input[type="search"] { grid-column: 1 / -1; }

  .chain-head { flex-direction: column; align-items: flex-start; }
  .chain-board { padding: 1rem 0.75rem; }
  .rig-chain .chain-board { padding-inline: 1rem; }
  /* On a phone the signal runs down the screen, one block per row. */
  .chain:not(.chain-unknown) .chain-path { flex-direction: column; flex-wrap: nowrap; align-items: stretch; row-gap: 0; }
  .chain:not(.chain-unknown) .chain-stage { flex-direction: column; align-items: stretch; }
  .chain:not(.chain-unknown) .chain-joint { width: 2px; height: 0.9rem; margin-left: 1.9rem; }
  .chain:not(.chain-unknown) .chain-joint::after { background: linear-gradient(180deg, transparent, var(--accent), transparent); animation-name: signal-down; }
  .chain:not(.chain-unknown) .chain-block,
  .chain:not(.chain-unknown) .chain-endpoint {
    width: 100%;
    height: auto;
    padding: 0.6rem 0.75rem;
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
  }
  .chain:not(.chain-unknown) .chain-icon { width: 1.8rem; height: 1.8rem; margin: 0 auto; }
  .chain:not(.chain-unknown) .chain-name { -webkit-line-clamp: 1; font-size: 0.9rem; }
  .chain:not(.chain-unknown) .chain-endpoint-mark { width: 2.1rem; height: 2.1rem; }
  .chain:not(.chain-unknown) .chain-block.bypassed::after { position: static; grid-column: 3; grid-row: 1; }
  .chain:not(.chain-unknown) .chain-block.bypassed .chain-category { display: none; }
  .rig-chain .chain-block { width: 6.1rem; height: 6.8rem; }
  .rig-chain .chain-name { font-size: 0.76rem; }
  .rig-chain .chain-board { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .chain-endpoint { width: 4rem; height: 6.8rem; }
  .chain-joint { width: 1rem; }
  .chain-ghost .ghost-block { width: 2.2rem; height: 2.6rem; }

  .editor-cta, .contribute-cta { grid-template-columns: 1fr; }
  .editor-cta .button { white-space: normal; }
  .editor-cta > .button { justify-self: start; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-form { flex-direction: column; }

  .profile-hero { margin: 0 0 2.25rem; padding: 1.25rem; grid-template-columns: 4.25rem minmax(0, 1fr); align-items: start; gap: 1rem; border-radius: 16px; }
  .profile-mark { width: 4.25rem; font-size: 1.5rem; }
  .profile-hero h1 { font-size: clamp(2rem, 10vw, 2.5rem); }
  .profile-hero .lede { font-size: 0.92rem; line-height: 1.4; }
  .profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem 0.9rem; }
  .profile-stats dt { font-size: 1.05rem; }
  .profile-stats dd { font-size: 0.64rem; }
  .profile-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .profile-actions .button { padding: 0.65rem 0.5rem; font-size: 0.8rem; }

  .publish-choices { grid-template-columns: 1fr; }
  .tone-form fieldset { padding: 1.1rem; }
  .download-next { padding: 1.25rem; }
  .download-next-head { align-items: flex-start; flex-direction: column; gap: 0.65rem; }
  .download-steps { grid-template-columns: 1fr; gap: 1rem; }
  .version-history-head { align-items: start; flex-direction: column; gap: 0.3rem; }
  .version-row { grid-template-columns: 3.7rem minmax(0, 1fr); gap: 0.65rem; }
  .version-number { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
  .version-download { grid-column: 2; width: 100%; }
}
