/* Maqamat — studio format.
   Cool paper, near-black ink and one accent: Iznik cobalt.
   Media lives in dark rounded panels; type is large, plain and confident.
   Motion answers the visitor: hover rolls letters, the 3D maqam follows the mouse. */

:root {
  --bg: #EEF0F4;
  --bg-2: #E2E5EC;
  --card: #F8F9FB;
  --ink: #0C0E13;
  --ink-2: #4A4F5E;
  --line: #CDD2DC;
  --accent: #2340F0;          /* Iznik cobalt, electric */
  --accent-ink: #1A31C4;
  --accent-soft: rgba(35, 64, 240, .1);
  --turq: #0E8F87;
  --red: #D8401F;             /* the sounding note */
  --on-accent: #FFFFFF;
  --panel: #0C0E13;

  /* legacy names used by the diagrams */
  --paper: var(--bg);
  --paper-2: var(--bg-2);
  --cobalt: var(--accent);
  --cobalt-deep: var(--accent-ink);
  --cobalt-soft: var(--accent-soft);
  --turq-ink: #0B6F69;
  --on-cobalt: var(--on-accent);

  --sans: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Markazi Text', 'Amiri', 'Noto Naskh Arabic', Georgia, serif;
  --ui: var(--sans);

  --t-1: .875rem;
  --t0: 1.0625rem;
  --t1: 1.5rem;
  --t2: 2rem;
  --t3: clamp(2.2rem, 1.2rem + 3.4vw, 4rem);
  --t4: clamp(2.8rem, 1rem + 5.6vw, 6.25rem);
  --t5: clamp(3.2rem, .6rem + 8vw, 9rem);

  --gutter: clamp(16px, 2.8vw, 40px);
  --section: clamp(80px, 12vw, 168px);
  --radius: clamp(14px, 1.6vw, 24px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-cine: cubic-bezier(.76, 0, .24, 1);
  color-scheme: light;
}

/* Dark panels re-map the tokens, so anything inside them simply works. */
.panel {
  --bg: #0C0E13; --bg-2: #1B1E27; --card: #171A22; --ink: #F2F3F7; --ink-2: #A9AEBD; --line: #2E323D;
  --accent: #8394FF; --accent-ink: #A4B0FF; --accent-soft: rgba(131, 148, 255, .16); --turq: #3FCFC4; --turq-ink: #6FDCD3; --red: #FF6A48;
  --paper: #0C0E13; --on-accent: #0C0E13;
  background: var(--bg); color: var(--ink); border-radius: var(--radius); color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--t0)/1.6 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
:lang(ar) body, body:lang(ar) { line-height: 1.85; letter-spacing: 0; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-weight: 400; line-height: 1; margin: 0; letter-spacing: -.035em; text-wrap: balance; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9375rem; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), 1600px); margin-inline: auto; }
.measure { max-width: 34em; }
.muted { color: var(--ink-2); }
.label { font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
:lang(ar) .label { letter-spacing: 0; font-size: .875rem; text-transform: none; }
.nn { white-space: nowrap; }
.acc { display: inline-block; width: .42em; height: .92em; vertical-align: -.02em; margin-inline-start: .06em; color: currentColor; }

/* ------------------------------------------------------------ type */
.h-display { font-size: var(--t5); font-weight: 400; letter-spacing: -.045em; line-height: .95; }
.h-section { font-size: var(--t4); letter-spacing: -.04em; line-height: .98; }
.h-sub { font-size: var(--t2); letter-spacing: -.025em; line-height: 1.1; }
:lang(ar) .h-display, :lang(ar) .h-section, :lang(ar) .h-sub { letter-spacing: 0; line-height: 1.2; }
.lead { font-size: clamp(1.125rem, 1rem + .5vw, 1.5rem); line-height: 1.45; color: var(--ink-2); letter-spacing: -.01em; }
.section-head { display: grid; gap: 20px; margin-block-end: clamp(32px, 5vw, 64px); }
.section-head p { color: var(--ink-2); max-width: 36em; }
.ar-name { font-family: var(--serif); font-weight: 500; letter-spacing: 0; }

/* ------------------------------------------------------------ pills */
.btn, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 .875rem/1 var(--sans); letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  background: var(--bg-2); color: var(--ink);
  transition: background-color .35s var(--ease), color .35s var(--ease), transform .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover, .pill:hover { background: color-mix(in srgb, var(--bg-2) 82%, var(--ink)); }
.btn:active, .pill:active { transform: scale(.96); }
.btn-primary, .pill-dark { background: var(--ink); color: var(--bg); }
.btn-primary:hover, .pill-dark:hover { background: var(--accent); color: #fff; }
.btn svg, .pill svg { width: 12px; height: 12px; flex: none; }
.btn-quiet { background: transparent; padding-inline: 12px; }
.btn-quiet:hover { background: var(--bg-2); }
.pill-icon { width: 44px; padding: 0; }
.pill-icon svg { width: 16px; height: 16px; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill .dots { display: inline-flex; gap: 3px; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.text-link { font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.text-link:hover { color: var(--accent); }

.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font: 500 .875rem/1 var(--sans); color: var(--ink-2); transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ------------------------------------------------------------ letter roll (hover) */
.roll { display: inline-flex; overflow: hidden; vertical-align: bottom; line-height: 1.05; padding-bottom: .06em; margin-bottom: -.06em; }
.roll-l { display: inline-block; position: relative; white-space: pre; transition: transform .6s var(--ease-cine); transition-delay: calc(var(--i, 0) * 16ms); }
.roll-l::after { content: attr(data-l); position: absolute; inset-inline-start: 0; top: 105%; }
:is(a, button):hover .roll-l, .roll-host:hover .roll-l, :is(a, button):focus-visible .roll-l { transform: translateY(-105%); }

/* ------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 40; padding-block: 14px; view-transition-name: header; transition: transform .6s var(--ease-cine); }
.site-header.is-hidden { transform: translateY(-120%); }
.site-header .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; align-items: start; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; padding-top: 10px; }
.brand-mark { width: 24px; height: 24px; color: var(--ink); }
.brand-name { font: 500 1.125rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
:lang(ar) .brand-name { text-transform: none; letter-spacing: 0; font-family: var(--serif); font-size: 1.5rem; }
.brand-alt { font: 500 1.15rem/1 var(--serif); color: var(--ink-2); }
.hdr-tagline { font-size: clamp(1.1rem, .7rem + 1vw, 1.55rem); line-height: 1.15; letter-spacing: -.02em; max-width: 26ch; padding-top: 3px; }
:lang(ar) .hdr-tagline { letter-spacing: 0; line-height: 1.4; }
.hdr-pills { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
@media (max-width: 860px) {
  .site-header .wrap { grid-template-columns: 1fr auto; }
  .hdr-tagline, .hdr-pills .pill-cta, .hdr-pills .pill-account { display: none; }
}
@media (max-width: 400px) { .site-header .brand-alt { display: none; } }

/* Menu card (opens from the corner) */
.menu-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(12, 14, 19, .2); opacity: 0; visibility: hidden; transition: opacity .5s var(--ease), visibility 0s linear .5s; }
.menu-scrim.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.menu {
  position: fixed; z-index: 61; top: 12px; inset-inline-end: 12px; width: min(460px, calc(100% - 24px));
  background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 14px 18px 22px;
  clip-path: inset(0 0 100% 55% round var(--radius)); visibility: hidden;
  transition: clip-path .8s var(--ease-cine), visibility 0s linear .8s;
}
[dir="rtl"] .menu { clip-path: inset(0 55% 100% 0 round var(--radius)); }
.menu.is-open { clip-path: inset(0 0 0 0 round var(--radius)); visibility: visible; transition-delay: 0s; }
.menu-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.menu-links { list-style: none; margin: 0; padding: 0; }
.menu-links a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 4px; font-size: clamp(1.55rem, 1.15rem + 1.3vw, 2.1rem); letter-spacing: -.035em; line-height: 1.1; text-decoration: none; border-bottom: 1px solid var(--line); }
:lang(ar) .menu-links a { letter-spacing: 0; }
.menu-links a[aria-current="page"] { color: var(--accent); }
.menu-links a small { font-size: .75rem; letter-spacing: .08em; color: var(--ink-2); }
.menu-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.menu-foot p { font-size: .8125rem; color: var(--ink-2); max-width: 26ch; line-height: 1.5; }
.menu-foot-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.menu .menu-links li { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .7s var(--ease-cine); }
.menu.is-open .menu-links li { opacity: 1; transform: none; transition-delay: calc(.15s + var(--i, 0) * .05s); }

/* ------------------------------------------------------------ hero stage (3D maqam) */
.hero-wrap { padding-top: clamp(8px, 2vw, 24px); }
.hero-tagline-m { display: none; font-size: clamp(1.9rem, 1.2rem + 3vw, 2.6rem); line-height: 1.02; letter-spacing: -.04em; margin: 6px 0 20px; }
:lang(ar) .hero-tagline-m { letter-spacing: 0; line-height: 1.3; }
@media (max-width: 860px) { .hero-tagline-m { display: block; } }
.stage { position: relative; height: clamp(460px, 78vh, 880px); overflow: hidden; isolation: isolate; background: radial-gradient(120% 90% at 50% 38%, #1B1E29 0%, #0C0E13 72%); touch-action: pan-y; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.stage-fallback { position: absolute; inset: 14% 0 12%; display: grid; place-items: center; }
.stage-fallback .wheel-stage { width: min(78%, 520px); }
.stage.has-gl .stage-fallback { display: none; }
.stage-ui { position: absolute; inset: 0; pointer-events: none; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(16px, 2.2vw, 30px); }
.stage-top { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.stage-name { display: grid; gap: 4px; }
.stage-name b { font-weight: 400; font-size: clamp(2rem, 1rem + 2.6vw, 3.5rem); letter-spacing: -.045em; line-height: 1; transition: opacity .35s, transform .6s var(--ease-cine); }
.stage-name .ar-name { font-size: clamp(1.6rem, 1rem + 1.8vw, 2.8rem); color: var(--ink-2); line-height: 1.1; transition: opacity .35s, transform .6s var(--ease-cine); }
.stage-count { font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 8px; }
.stage-bottom { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.stage-hint { font-size: .8125rem; color: var(--ink-2); max-width: 32ch; line-height: 1.5; }
.stage-ui .pill, .stage-ui .btn { pointer-events: auto; }
.stage-notes { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-notes span { font-size: .75rem; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink-2); font-variant-numeric: tabular-nums; transition: background-color .3s, color .3s; }
.stage-notes span.is-sounding { background: var(--red); color: #fff; }
.is-switching .stage-name b, .is-switching .stage-name .ar-name { opacity: 0; transform: translateY(12px); }

.marks { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding-block: 14px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
:lang(ar) .marks { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.marks span { justify-self: center; }
.marks span:first-child { justify-self: start; }
.marks span:last-child { justify-self: end; }
.marks i { font-style: normal; font-size: 1.1rem; color: var(--ink); line-height: 1; }
@media (max-width: 860px) { .marks { grid-template-columns: repeat(3, 1fr); } .marks span:nth-child(2), .marks span:nth-child(4) { display: none; } }

/* ------------------------------------------------------------ statement */
.statement { padding-block: var(--section); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 32px; }
.statement .label { padding-top: 1.2em; }
.statement-body { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: clamp(32px, 5vw, 64px); align-items: start; }
.statement-body p { font-size: clamp(1.0625rem, 1rem + .25vw, 1.25rem); max-width: 34em; }
@media (max-width: 860px) { .statement { grid-template-columns: 1fr; } .statement-body { grid-column: 1; grid-template-columns: 1fr; } }

.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 56px); }
.section-top .label { max-width: 42ch; line-height: 1.6; }

/* ------------------------------------------------------------ featured list */
.feat { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.feat > li { border-bottom: 1px solid var(--line); }
.feat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 24px; padding: clamp(16px, 2.2vw, 30px) 0; text-decoration: none; }
.feat-tags { grid-column: 1 / -1; }
.feat-name { font-size: clamp(2.5rem, 1rem + 5.6vw, 6.5rem); letter-spacing: -.05em; line-height: 1; }
.feat-ar { font-family: var(--serif); font-size: clamp(1.9rem, 1rem + 3vw, 4.2rem); color: var(--ink-2); line-height: 1; transition: color .3s; }
.feat-row:hover .feat-ar { color: var(--accent); }
:lang(ar) .feat-name { letter-spacing: 0; line-height: 1.25; font-family: var(--serif); font-weight: 500; }
:lang(ar) .feat-ar { font-family: var(--sans); font-size: clamp(1.4rem, 1rem + 2vw, 3rem); }

/* Floating preview that follows the cursor over list rows */
.peek { position: fixed; left: 0; top: 0; z-index: 30; width: 260px; height: 260px; pointer-events: none; padding: 20px; opacity: 0; transform: translate3d(-50%, -50%, 0) scale(.5); transition: opacity .35s var(--ease); will-change: transform; }
.peek.is-on { opacity: 1; }
.peek .wheel { width: 100%; height: 100%; }
@media (pointer: coarse) { .peek { display: none; } }

/* Compact list rows (library, traditions) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(180px, 1.3fr) minmax(0, 1fr); gap: 8px 32px; align-items: center; padding: 18px 4px; text-decoration: none; transition: padding .5s var(--ease-cine); }
a.row:hover { padding-inline-start: 20px; }
.row-names { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row-names b { font-weight: 400; font-size: clamp(1.4rem, 1.1rem + .8vw, 2rem); letter-spacing: -.035em; line-height: 1.1; }
:lang(ar) .row-names b { letter-spacing: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 1.2rem + .8vw, 2.2rem); }
.row-names .alt { font: 500 1.4rem/1.1 var(--serif); color: var(--ink-2); }
:lang(ar) .row-names .alt { font: 400 1.05rem/1.1 var(--sans); }
.row-meta { font-size: .875rem; line-height: 1.5; color: var(--ink-2); }
.row-meta .nn { color: var(--ink); }
.row-seal { width: 40px; height: 40px; flex: none; }
.strip { width: 100%; height: auto; }
.strip-line { stroke: var(--line); stroke-width: 1.2; }
.strip-key { stroke: var(--ink-2); stroke-width: 1; opacity: .45; }
.strip-dot { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; transition: fill .3s; }
.strip-dot.is-tonic { fill: var(--accent); stroke: var(--accent); }
a.row:hover .strip-dot { fill: var(--ink); }
a.row:hover .strip-dot.is-tonic { fill: var(--accent); }
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } }
.trad-rows .row { grid-template-columns: minmax(170px, 1fr) minmax(0, 2fr) auto; }
.trad-rows .row p { color: var(--ink-2); max-width: 46em; }
.trad-rows .count { font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.trad-rows .is-soon b { color: var(--ink-2); }
@media (max-width: 720px) { .trad-rows .row { grid-template-columns: 1fr; } }
.more { margin-top: 28px; }

/* Rosette seals */
.ro { width: 100%; height: 100%; overflow: visible; }
.ro-spin { transform-box: view-box; transform-origin: 50% 50%; transition: transform .9s var(--ease-cine); }
.ro-mini .ro-petal { fill: var(--accent-soft); stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; }
.ro-mini .ro-eye { fill: var(--accent); }
a.row:hover .ro-spin { transform: rotate(40deg) scale(1.08); }

/* ------------------------------------------------------------ media panels */
.panel-pad { padding: clamp(20px, 3.4vw, 56px); }
.between { display: grid; gap: clamp(28px, 4vw, 48px); }
.between-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 64px; align-items: end; }
.tone-btns { display: grid; gap: 8px; justify-items: start; }
@media (max-width: 860px) { .between-top { grid-template-columns: 1fr; } }
.caption { font-size: .875rem; line-height: 1.55; color: var(--ink-2); margin-top: 16px; max-width: 48em; }

/* Ajnas */
.ajnas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.jins-btn { width: 100%; display: grid; gap: 10px; text-align: start; cursor: pointer; background: var(--card); color: var(--ink); border: 0; border-radius: 16px; padding: 18px 18px 20px; transition: background-color .35s var(--ease), color .35s var(--ease), transform .5s var(--ease-cine); }
.jins-btn:hover { background: var(--ink); color: var(--bg); transform: translateY(-4px); }
.jins-btn:hover .jins-name span { color: inherit; opacity: .7; }
.jins-btn:hover .jins-line, .jins-btn:hover .jins-key { stroke: currentColor; opacity: .35; }
.jins-btn:hover .jins-step { fill: currentColor; }
.jins-btn:hover .jins-dot { fill: var(--ink); stroke: var(--bg); }
.jins-btn:hover .jins-dot.is-tonic { fill: var(--accent); stroke: var(--accent); }
.jins-name { display: flex; align-items: baseline; gap: 10px; }
.jins-name b { font-weight: 400; font-size: 1.5rem; letter-spacing: -.03em; }
:lang(ar) .jins-name b { letter-spacing: 0; font-family: var(--serif); font-weight: 500; font-size: 1.75rem; }
.jins-name span { font: 500 1.35rem/1 var(--serif); color: var(--ink-2); }
:lang(ar) .jins-name span { font: 400 1rem/1 var(--sans); }
.jins { width: 100%; height: auto; overflow: visible; }
.jins-line, .jins-key { stroke: var(--line); stroke-width: 1.5; }
.jins-dot { fill: var(--card); stroke: var(--ink); stroke-width: 2; transform-box: fill-box; transform-origin: center; transition: fill .3s; }
.jins-dot.is-tonic { fill: var(--accent); stroke: var(--accent); }
.jins-dot.is-sounding { fill: var(--red); stroke: var(--red); animation: ping .42s var(--ease); }
.jins-step { font: 400 11.5px var(--sans); fill: var(--ink-2); font-variant-numeric: tabular-nums; }

/* CTA panel */
.cta { padding: clamp(28px, 5vw, 72px); display: grid; gap: clamp(24px, 4vw, 56px); }
.cta-big { font-size: clamp(3rem, .8rem + 9.4vw, 10.5rem); letter-spacing: -.06em; line-height: .95; text-decoration: none; display: inline-block; justify-self: start; }
:lang(ar) .cta-big { letter-spacing: 0; line-height: 1.25; }
.cta-big:hover { color: var(--accent); }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 32px; align-items: end; }
.cta-grid p { color: var(--ink-2); max-width: 34em; }
@media (max-width: 860px) { .cta-grid { grid-template-columns: 1fr; } }
.orbit { width: 100%; max-width: 460px; justify-self: end; color: var(--ink-2); }
.orbit .o-ring { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .7; }
.orbit .o-tick { stroke: currentColor; stroke-width: 1; opacity: .5; }
.orbit .o-dot { fill: var(--bg); stroke: var(--ink); stroke-width: 2; }
.orbit .o-dot.is-target { fill: var(--accent); stroke: var(--accent); }
.orbit .o-figure { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }

/* ------------------------------------------------------------ footer + keep scrolling */
.site-footer { margin-top: var(--section); padding-block: 40px 28px; border-top: 1px solid var(--line); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 28px 48px; }
.site-footer p { font-size: .875rem; color: var(--ink-2); max-width: 36em; line-height: 1.6; }
.footer-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9375rem; align-content: start; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.copyright { grid-column: 1 / -1; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); }
:lang(ar) .copyright { letter-spacing: 0; text-transform: none; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .site-footer .wrap > div:first-child { grid-column: 1 / -1; } }

.next-page { min-height: 92vh; display: grid; align-content: center; justify-items: center; gap: 18px; text-align: center; text-decoration: none; padding-block: 48px; }
.np-ring { width: 64px; height: 64px; }
.np-ring circle { fill: none; stroke-width: 2; }
.np-ring .np-track { stroke: var(--line); }
.np-ring .np-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: calc(176 - 176 * var(--np, 0)); transform: rotate(-90deg); transform-origin: center; }
.np-name { font-size: var(--t5); letter-spacing: -.055em; line-height: .95; }
:lang(ar) .np-name { letter-spacing: 0; line-height: 1.25; }
.next-page:hover .np-name { color: var(--accent); }

/* ------------------------------------------------------------ circle (2D learning diagram) */
.wheel { width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.wheel-labels, .wheel-center, .wheel-arcs, .wheel-grid { pointer-events: none; }
.wheel .tick { stroke: var(--line); stroke-width: 1; }
.wheel .tick-key { stroke: var(--ink-2); stroke-width: 1.3; opacity: .7; }
.wheel-ring { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: .35; }
.wheel .arc { fill: none; stroke-width: 4; stroke-linecap: round; }
.wheel .arc-0 { stroke: var(--accent); }
.wheel .arc-1 { stroke: var(--turq); }
.arc-label { font: 500 12.5px var(--sans); fill: var(--ink-2); }
.wheel-shape { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }
.wheel-grid, .wheel-arcs, .wheel-labels, .wheel-center { transition: opacity .32s var(--ease); }
.is-fading { opacity: 0; }
.wn { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.wn-hit { fill: transparent; }
.wn-dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; transition: fill .2s var(--ease); }
.wn.is-tonic .wn-dot, .wn:hover .wn-dot { fill: var(--accent); }
.wn:focus-visible .wn-hit { stroke: var(--accent); stroke-width: 2; }
.wn.is-octave { opacity: 0; pointer-events: none; }
.wn.is-sounding .wn-dot { fill: var(--red); stroke: var(--red); animation: ping .42s var(--ease); }
.wn.is-near .wn-dot { fill: var(--ink); stroke: var(--ink); }
.wl { color: var(--ink); transition: color .2s; }
.wl-text { font: 500 15px var(--sans); fill: currentColor; }
.wl.is-octave { display: none; }
.wl.is-sounding { color: var(--red); }
.svg-acc { color: inherit; }
.wc-ar { font: 600 40px var(--serif); fill: var(--ink); }
.wc-en { font: 400 16px var(--sans); fill: var(--ink-2); }
.ring-hit { fill: none; stroke: transparent; stroke-width: 76; pointer-events: stroke; touch-action: none; cursor: crosshair; }
.lens { opacity: 0; transition: opacity .25s var(--ease); pointer-events: none; }
.lens.is-on { opacity: 1; }
.lens-needle { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 2 4; opacity: .7; }
.lens-dot { fill: var(--ink); }
.lens-tag rect { fill: var(--ink); }
.lens-tag text { font: 500 13px var(--sans); fill: var(--bg); font-variant-numeric: tabular-nums; }
.lens.is-snap .lens-dot, .lens.is-held .lens-dot { fill: var(--red); }
.lens.is-snap .lens-tag rect { fill: var(--red); }
.lens.is-snap .lens-tag text { fill: #fff; }
.ripple { fill: none; stroke: var(--red); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ripple .9s var(--ease) forwards; pointer-events: none; }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }
@keyframes ping { from { transform: scale(1.7); } to { transform: scale(1); } }
.wheel-stage { width: 100%; touch-action: pan-y; }

/* ------------------------------------------------------------ ruler */
.ruler-wrap { position: relative; margin: 0; }
.ruler { width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.ruler-v { display: none; max-width: 420px; margin-inline: auto; }
@media (max-width: 720px) { .ruler-h { display: none; } .ruler-v { display: block; } }
.ruler .lane { stroke: var(--line); stroke-width: 1.5; }
.ruler .hit { fill: transparent; }
.rk { color: var(--ink-2); cursor: pointer; outline: none; }
.rk-tick { stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rk-text { font: 500 13px var(--sans); fill: currentColor; }
.rk:hover, .rk.is-sounding { color: var(--turq-ink); }
.rk.is-sounding .rk-tick { stroke-width: 3.5; }
.rk:focus-visible .hit, .rn:focus-visible .hit { stroke: var(--accent); stroke-width: 2; rx: 6; }
.ruler .link { stroke: var(--line); stroke-width: 1.5; }
.ruler .link.is-off { stroke: var(--turq); stroke-dasharray: 3 4; }
.ruler .dev { font: 500 12.5px var(--sans); fill: var(--turq-ink); font-variant-numeric: tabular-nums; }
.rn { color: var(--ink); cursor: pointer; outline: none; }
.rn-text { font: 600 16px var(--sans); fill: currentColor; }
.rn-cents { font: 400 12.5px var(--sans); fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.rn-dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; }
.rn.is-tonic .rn-dot, .rn:hover .rn-dot { fill: var(--accent); }
.rn.is-sounding { color: var(--red); }
.rn.is-sounding .rn-dot { fill: var(--red); stroke: var(--red); animation: ping .42s var(--ease); }

/* ------------------------------------------------------------ page heads */
.page-head { padding-block: clamp(24px, 6vw, 104px) clamp(32px, 5vw, 64px); display: grid; gap: 24px; }
.crumb { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); display: flex; gap: 10px; flex-wrap: wrap; }
:lang(ar) .crumb { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { opacity: .5; }

/* ------------------------------------------------------------ library */
.lib-controls { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; justify-content: space-between; margin-bottom: 40px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.field { display: grid; gap: 6px; font-size: .875rem; font-weight: 500; }
.field small { font-weight: 400; color: var(--ink-2); }
.field input { min-height: 48px; width: min(100%, 320px); padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 1rem; transition: border-color .25s, box-shadow .25s; }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.group { margin-bottom: 72px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.group-head p { font-size: .8125rem; color: var(--ink-2); }
.empty { padding: 32px 0; color: var(--ink-2); }
.note-soon { font-size: .9375rem; line-height: 1.6; color: var(--ink-2); padding: 18px 4px; }

/* ------------------------------------------------------------ maqam page */
.m-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 32px; }
.m-title .n-alt { font-family: var(--serif); color: var(--ink-2); font-weight: 500; letter-spacing: 0; }
:lang(ar) .m-title .n-main { font-family: var(--serif); font-weight: 500; }
:lang(ar) .m-title .n-alt { font-family: var(--sans); font-weight: 400; font-size: .6em; }
.m-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 10px; }
.m-wheel { padding: clamp(24px, 4vw, 64px); display: grid; place-items: center; }
.m-wheel .wheel-stage { width: min(100%, 620px); }
.m-side { padding: clamp(24px, 3vw, 40px); display: grid; gap: 32px; align-content: space-between; background: var(--card); border-radius: var(--radius); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; margin: 0; font-size: .9375rem; line-height: 1.5; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; }
.player { display: grid; gap: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: .9375rem; background: none; border: 0; padding: 0; text-align: start; position: relative; }
.toggle .track { width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background-color .25s var(--ease); }
.toggle .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .35s var(--ease-cine); }
[dir="rtl"] .toggle .track::after { --x: -18px; }
.toggle[aria-pressed="true"] .track, .toggle input:checked + .track { background: var(--accent); }
.toggle[aria-pressed="true"] .track::after, .toggle input:checked + .track::after { transform: translateX(var(--x, 18px)); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle input:focus-visible + .track, .toggle:focus-visible .track { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggle:focus-visible { outline: none; }
.note-octave { font-size: .875rem; color: var(--ink-2); }
@media (max-width: 960px) { .m-main { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
table.notes { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
table.notes th { text-align: start; font-weight: 500; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 0 8px 12px; border-bottom: 1px solid var(--line); }
:lang(ar) table.notes th { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
table.notes td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
table.notes .num { text-align: end; }
table.notes tr.is-sounding td { color: var(--red); }
table.notes .off { color: var(--turq-ink); }
.table-scroll { overflow-x: auto; }
.m-ajnas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.m-ajnas .jins { max-width: 340px; }
.m-ajnas .jins-name span { font: 400 .9375rem var(--sans); }
.pager { display: flex; justify-content: space-between; gap: 16px; padding-top: 32px; border-top: 1px solid var(--line); margin-top: var(--section); }
.pager a { text-decoration: none; display: grid; gap: 4px; }
.pager a span { color: var(--ink-2); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
:lang(ar) .pager a span { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.pager a b { font-weight: 400; font-size: var(--t2); letter-spacing: -.03em; }
.pager a:hover b { color: var(--accent); }
.pager .next { text-align: end; margin-inline-start: auto; }

/* Phone play bar */
.dock { display: none; }
@media (max-width: 720px) {
  .dock { display: flex; position: fixed; z-index: 35; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); gap: 6px; padding: 6px; background: rgba(12, 14, 19, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 999px; transform: translateY(150%); transition: transform .6s var(--ease-cine); }
  .dock.is-on { transform: none; }
  .dock button { flex: 1; min-height: 50px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #F2F3F7; font: 500 .8125rem var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
  .dock button svg { width: 11px; height: 11px; }
  .dock button:first-child { background: #F2F3F7; color: #0C0E13; }
  .dock button[aria-pressed="true"] { background: #2340F0; color: #fff; }
  body:has(.dock.is-on) .site-footer { padding-bottom: 96px; }
}

/* ------------------------------------------------------------ intonation lab */
.lab { padding: clamp(24px, 4vw, 56px); display: grid; gap: 28px; }
.lab-readout { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.lab-readout output { font-size: var(--t5); letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; min-width: 3ch; }
.lab-readout span { color: var(--ink-2); }
.lab-nearest { color: var(--ink-2); }
.lab-nearest b { color: var(--ink); font-weight: 500; }
.lab-scale { width: 100%; height: auto; overflow: visible; }
.lab-scale .mk-line { stroke: var(--ink-2); stroke-width: 1.5; }
.lab-scale .mk-text { font: 500 13px var(--sans); fill: var(--ink-2); }
.lab-scale .base { stroke: var(--line); stroke-width: 2; }
.lab-scale .needle line { stroke: var(--red); stroke-width: 3; stroke-linecap: round; }
.lab-scale .needle circle { fill: var(--red); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; margin: 0; touch-action: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); margin-top: -12px; border: 0; }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); border: 0; }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--accent-soft); }
.lab-marks { display: flex; flex-wrap: wrap; gap: 8px; }
.prose-rows { display: grid; border-top: 1px solid var(--line); }
.prose-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 48px; padding-block: 36px; border-bottom: 1px solid var(--line); }
.prose-row h3 { font-size: var(--t1); letter-spacing: -.025em; line-height: 1.15; }
.prose-row p { max-width: 38em; color: var(--ink-2); }
@media (max-width: 720px) { .prose-row { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ traditions */
.trad-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px 64px; padding-block: 56px; border-top: 1px solid var(--line); }
.trad-section p { color: var(--ink-2); max-width: 40em; }
.trad-section .terms { font-size: .875rem; margin-top: 16px; }
.trad-section .count { font-size: .8125rem; color: var(--ink-2); margin-top: 14px; }
.trad-section .rows .row { grid-template-columns: minmax(130px, 1fr) minmax(140px, 1.2fr); padding-block: 12px; }
@media (max-width: 860px) { .trad-section { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ ear training */
.status { display: inline-flex; align-items: center; gap: 10px; font-size: .8125rem; padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); justify-self: start; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 64px; list-style: none; margin: 0; padding: 0; }
.features h3 { font-size: var(--t1); letter-spacing: -.025em; margin-bottom: 10px; }
.features p { color: var(--ink-2); }
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }
.signup-form { display: grid; gap: 16px; max-width: 440px; }
.signup-form .field input { width: 100%; }
.signup-form .field input:user-invalid { border-color: var(--red); }
.ear-panel { padding: clamp(24px, 4vw, 56px); display: grid; place-items: center; }

/* ------------------------------------------------------------ preloader (first visit per session) */
.preload { position: fixed; inset: 0; z-index: 200; background: #0C0E13; color: #F2F3F7; display: none; place-items: center; clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease-cine); }
.js-preload .preload { display: grid; }
.preload.is-done { clip-path: inset(0 0 100% 0); }
.preload-mark { width: 44px; height: 44px; color: #F2F3F7; }
.preload-count { position: absolute; inset-inline-start: var(--gutter); bottom: 8px; font-size: clamp(4rem, 2rem + 8vw, 9rem); letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ cinematic page transitions */
/* The 3D world never cuts. The next page picks up the camera exactly where this
   one left it (world.js), so in the cross-fade the world's pixels match and only
   the page content dissolves; then the camera flies on to the new page's view
   while the new content rises in. Opacity only on the root, so nothing shifts. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .8s; animation-timing-function: var(--ease-cine); }
::view-transition-group(root) { animation-duration: .6s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }

@media (prefers-reduced-motion: no-preference) {
  /* nothing slides: the new page's content fades up out of the dark, and its
     headings resolve letter by letter (below) while the camera flies on */
  .inner main > *, .inner .next-page { animation: page-in 1.2s cubic-bezier(.3, 0, .2, 1) backwards; }
  .inner main > :nth-child(2) { animation-delay: .1s; }
  .inner main > :nth-child(n + 3) { animation-delay: .2s; }
}
@keyframes page-in { from { opacity: 0; } }

/* Split text (app.js): every letter of a heading, every word of a paragraph,
   fades in at its own moment; leaving, it all fades out together, quickly. */
[data-split] .sw { display: inline-block; white-space: nowrap; }
.js [data-split] .sx { opacity: 0; transition: opacity .25s cubic-bezier(.4, 0, .2, 1); }
.js [data-split].is-in .sx, .js .ch.is-active [data-split] .sx { opacity: 1; transition: opacity .9s cubic-bezier(.3, 0, .2, 1) var(--d, 0s); }

/* Notes bend from the piano's keys to their true pitch as a ruler scrolls in;
   big lines rise into place as they enter. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ruler .rn-bend { animation: bend linear both; animation-timeline: view(); animation-range: entry 10% cover 42%; }
    .ruler .link.is-off, .ruler .dev { animation: appear linear both; animation-timeline: view(); animation-range: cover 32% cover 46%; }
    .rise { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  }
}
@keyframes bend { from { transform: translate(var(--bx, 0px), var(--by, 0px)); } }
@keyframes appear { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(.4em); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .preload { display: none !important; }
}

/* If scripts never run, the preloader lifts itself after a moment. */
.js-preload .preload { animation: preload-safety 1ms 3.5s forwards; }
@keyframes preload-safety { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }

/* Light card for diagrams and tools */
.sheet { background: var(--card); border-radius: var(--radius); }
.stage-name [lang="ar"] { font-family: var(--serif); font-weight: 500; letter-spacing: 0; }
.stage-name [lang="en"] { font-family: var(--sans); }
.stage-name b[lang="ar"] { font-size: clamp(2.2rem, 1.2rem + 2.8vw, 3.8rem); line-height: 1.15; }
.peek, .peek * { pointer-events: none !important; }

/* Phone: the 3D maqam sits above a quiet control strip */
.stage::after { content: ""; position: absolute; inset: auto 0 0 0; height: 44%; background: linear-gradient(to bottom, rgba(12, 14, 19, 0), rgba(12, 14, 19, .82)); pointer-events: none; }
.stage-ui { z-index: 1; }
@media (min-width: 721px) { .stage::after { height: 30%; } }
@media (max-width: 720px) {
  .stage { height: min(82vh, 680px); }
  .stage-notes, .stage-hint, .stage [data-open] { display: none; }
}

/* ============================================================ the journey (home) */
/* Night tokens for the immersive home page; everything inside simply re-colours. */
.night {
  --bg: #05060A; --bg-2: #161922; --card: #0F1118; --ink: #F2F3F7; --ink-2: #A3A8B7; --line: #252935;
  --accent: #8394FF; --accent-ink: #A4B0FF; --accent-soft: rgba(131, 148, 255, .16); --turq: #3FCFC4; --turq-ink: #6FDCD3; --red: #FF6A48;
  --paper: #05060A; --on-accent: #05060A; color-scheme: dark;
}
.night .btn-primary:hover, .night .pill-dark:hover { background: var(--accent); color: #05060A; }
.world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; touch-action: pan-y; }
.night main, .night .site-footer, .night .next-page { position: relative; z-index: 1; }
.no-gl .world { display: none; }

.journey { position: relative; }
.ch { height: 220vh; pointer-events: none; }
.ch-0 { height: 160vh; }
.ch-stick { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; padding-inline: var(--gutter); }
.ch a, .ch button, .ch .chips, .ch .ch-ajnas, .ch .tone-btns { pointer-events: auto; }
.ch-copy { max-width: 31rem; display: grid; gap: 18px; justify-items: start; text-shadow: 0 0 28px rgba(5, 6, 10, .9), 0 0 2px rgba(5, 6, 10, .8); }
.ch-copy p:not(.label) { color: var(--ink-2); font-size: clamp(1rem, .95rem + .3vw, 1.2rem); line-height: 1.55; }
.ch-copy .btn, .ch-copy .chip { text-shadow: none; }
.ch-h { font-size: clamp(2.6rem, 1rem + 5vw, 6.4rem); letter-spacing: -.05em; line-height: .95; text-transform: uppercase; font-weight: 300; }
:lang(ar) .ch-h { text-transform: none; letter-spacing: 0; line-height: 1.2; font-weight: 400; }
.ch-center { justify-self: center; justify-items: center; text-align: center; max-width: 44rem; align-self: start; padding-top: 14vh; }
.ch-center .chips, .ch-center .btn-row { justify-content: center; }
.ch-readout { display: flex; align-items: baseline; gap: 12px; }
.ch-readout output { font-size: clamp(3rem, 2rem + 4vw, 6rem); letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.ch-readout span { color: var(--ink-2); font-size: .9375rem; }
.ch-ajnas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: min(100%, 360px); }
.ch-ajnas .jins-btn { background: rgba(15, 17, 24, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ch-ajnas .jins-btn:hover, .ch-ajnas .jins-btn:focus-visible { background: var(--ink); color: var(--bg); }

/* JS reveals each chapter's copy as the camera arrives (text resolves piece by
   piece, controls fade in after it); leaving, it fades out fast. No sliding.
   Without JS it simply shows. */
.journey-js .ch-copy > * { opacity: 0; transition: opacity .3s cubic-bezier(.4, 0, .2, 1); }
.journey-js .ch-copy > [data-split] { opacity: 1; }
.journey-js .ch.is-active .ch-copy > * { opacity: 1; transition: opacity 1s cubic-bezier(.3, 0, .2, 1) .45s; }
.journey-js .ch.is-active .ch-copy > [data-split] { transition-delay: 0s; }

/* Overview: a small line above, a giant cropped word below */
.ch-0 .ch-stick { align-items: start; justify-items: center; overflow: hidden; }
.ch-tag { margin-top: clamp(80px, 12vh, 140px); font-size: clamp(.9rem, .8rem + .3vw, 1.1rem); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); text-align: center; }
:lang(ar) .ch-tag { letter-spacing: 0; text-transform: none; font-size: 1.2rem; }
.ch-word { position: absolute; left: 50%; bottom: -.18em; transform: translateX(-50%); font-size: clamp(5rem, 19vw, 22rem); font-weight: 300; letter-spacing: -.06em; line-height: .8; white-space: nowrap; color: rgba(242, 243, 247, .94); pointer-events: none; transition: transform 1.2s var(--ease-cine), opacity .8s; }
:lang(ar) .ch-word { font-family: var(--serif); font-weight: 500; letter-spacing: 0; bottom: -.08em; }
.ch-0:not(.is-active) .ch-word { opacity: .25; transform: translateX(-50%) translateY(20%); }
.ch-scroll { position: absolute; inset-inline-start: var(--gutter); bottom: 28px; }
.ch-fallback { display: none; width: min(70vw, 460px); margin-top: 6vh; }
.no-gl .ch-fallback { display: block; }

/* Chapter index (right edge) */
.chapters { position: fixed; z-index: 30; inset-inline-end: var(--gutter); top: 50%; transform: translateY(-50%); transition: opacity .5s; }
.chapters ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chapters a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 6px 0; text-decoration: none; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); opacity: .55; transition: opacity .4s, color .4s; }
:lang(ar) .chapters a { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
.chapters a i { font-style: normal; font-variant-numeric: tabular-nums; }
.chapters a::after { content: ""; width: 18px; height: 1px; background: currentColor; transition: width .5s var(--ease-cine); }
.chapters a[aria-current="step"] { opacity: 1; color: var(--ink); }
.chapters a[aria-current="step"]::after { width: 36px; }
.chapters a:hover { opacity: 1; }
.journey-off .chapters { opacity: 0; pointer-events: none; }
@media (max-width: 960px) { .chapters { display: none; } }

/* After the journey the page is solid again */
.after-journey { position: relative; z-index: 1; background: var(--bg); }
.night .site-footer, .night .next-page { background: var(--bg); }

/* Phones: the helix stays centred; copy sits low, over a fade */
@media (max-width: 860px) {
  .ch-stick { align-items: end; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .ch-copy, .ch-center { max-width: none; justify-self: stretch; justify-items: start; text-align: start; padding-top: 0; align-self: end; }
  .ch-center .chips, .ch-center .btn-row { justify-content: flex-start; }
  .ch-stick::before { content: ""; position: absolute; inset: auto 0 0 0; height: 62%; background: linear-gradient(to bottom, rgba(5, 6, 10, 0), rgba(5, 6, 10, .9) 45%); pointer-events: none; }
  .ch-copy { position: relative; }
  .ch-0 .ch-stick::before { display: none; }
  .ch-h { font-size: clamp(2.2rem, 1rem + 6vw, 3.4rem); }
  .ch-ajnas { width: 100%; }
}
.night .hdr-tagline { visibility: hidden; }
/* On the journey the header floats over the 3D world instead of taking up space. */
.night .site-header { position: fixed; inset-inline: 0; top: 0; }
.ch-scroll { bottom: calc(min(19vw, 22rem) * .64 + 20px); }

/* ============================================================ every page in the night world */
/* The page itself is see-through: the fixed 3D world is the backdrop everywhere. */
html:has(> body.night) { background: #05060A; color-scheme: dark; }
body.night { background: transparent; }
.no-gl body.night { background: var(--bg); }
.world { background: #05060A; }

/* Inner pages: the header floats, so content starts below it. */
.inner main { padding-top: clamp(64px, 8vw, 88px); }

/* A quiet shade over the world on reading pages: darkest behind the text,
   lighter where the speaker sits (it is moved toward the far edge). */
.inner::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to right, rgba(5, 6, 10, .82) 0%, rgba(5, 6, 10, .55) 46%, rgba(5, 6, 10, .1) 100%);
}
[dir="rtl"] .inner::after { background: linear-gradient(to left, rgba(5, 6, 10, .82) 0%, rgba(5, 6, 10, .55) 46%, rgba(5, 6, 10, .1) 100%); }
@media (max-width: 860px) { .inner::after { background: rgba(5, 6, 10, .66); } }

/* Headlines take the journey's voice: light, upright capitals. */
.night .h-display, .night .h-section, .night .np-name { font-weight: 300; text-transform: uppercase; }
.night .h-display { letter-spacing: -.05em; }
:lang(ar) .night .h-display, :lang(ar) .night .h-section, :lang(ar) .night .np-name { text-transform: none; font-weight: 400; letter-spacing: 0; }
.inner .page-head { text-shadow: 0 0 40px rgba(5, 6, 10, .7); }
.inner .page-head .lead { color: #C3C7D3; }

/* Glass: panels let the world glow through without a costly blur. */
.inner .sheet, .inner .m-side, .inner .panel {
  background: rgba(13, 15, 22, .74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.inner .m-wheel { background: rgba(8, 9, 14, .62); }
.inner .jins-btn { background: rgba(20, 23, 32, .8); }
.inner .jins-btn:hover { background: var(--ink); }
.inner .field input { background: rgba(15, 17, 24, .8); }
.inner .site-footer { background: rgba(5, 6, 10, .86); }
.inner .next-page { background: transparent; }
.inner .peek { background: rgba(8, 9, 14, .9); }

/* ------------------------------------------------------------ speed + instrument */
.tune { display: grid; gap: 14px; width: 100%; max-width: 420px; }
.tune-speed { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 16px; }
.tune-speed label { grid-area: 1 / 1; font-size: .875rem; font-weight: 500; }
.tune-speed output { grid-area: 1 / 2; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tune-speed output b { color: var(--ink); font-weight: 500; font-size: .9375rem; }
.tune-speed input { grid-area: 2 / 1 / 3 / 3; }
.voices { display: flex; flex-wrap: wrap; gap: 6px; }
.voices .chip { min-height: 38px; padding: 0 16px; }
.tune input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p, 35%), rgba(242, 243, 247, .2) var(--p, 35%)); }
[dir="rtl"] .tune input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--accent) var(--p, 35%), rgba(242, 243, 247, .2) var(--p, 35%)); }
.tune input[type=range]::-moz-range-track { background: rgba(242, 243, 247, .2); }
.tune input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.night input[type=range]::-webkit-slider-thumb { background: var(--ink); box-shadow: 0 0 0 5px rgba(131, 148, 255, .14); transition: box-shadow .3s var(--ease); }
.night input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 8px rgba(131, 148, 255, .22); }
.player .tune { padding-block: 6px 2px; }

/* In the menu card */
.menu { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.menu-sound { display: grid; gap: 12px; margin-top: 18px; padding: 16px 4px 0; }
.menu .menu-sound { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .7s var(--ease-cine); }
.menu.is-open .menu-sound { opacity: 1; transform: none; transition-delay: .42s; }

/* On the home journey (chapter 3) */
/* One quiet glass bar: speed on the left, instrument on the right. */
.ch .tune {
  pointer-events: auto; text-shadow: none; margin-top: 6px; max-width: 560px;
  grid-template-columns: minmax(180px, 1fr) auto; align-items: center; gap: 10px 22px;
  padding: 12px 14px 12px 20px; border-radius: 22px; text-align: start;
  background: rgba(8, 9, 14, .78); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
[dir="rtl"] .ch .tune { padding: 12px 20px 12px 14px; }
.ch .tune input[type=range] { height: 32px; }
.ch-center .tune { justify-self: center; }
@media (max-width: 560px) { .ch .tune { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ chapter index (home): clickable, alive */
.chapters ol { gap: 0; }
.chapters a {
  position: relative; padding: 9px 0 9px 28px; min-height: 36px; cursor: pointer; opacity: .62;
  transition: opacity .35s var(--ease), color .35s var(--ease), transform .45s var(--ease-cine);
}
[dir="rtl"] .chapters a { padding: 9px 28px 9px 0; }
.chapters a span { transition: letter-spacing .45s var(--ease-cine); }
/* the line: a faint track that fills as you read that chapter */
.chapters a::after {
  width: 22px; height: 2px; border-radius: 1px; flex: none;
  background: linear-gradient(to right, currentColor calc(var(--p, 0) * 100%), rgba(242, 243, 247, .22) calc(var(--p, 0) * 100%));
  transition: width .6s var(--ease-cine);
}
[dir="rtl"] .chapters a::after { background: linear-gradient(to left, currentColor calc(var(--p, 0) * 100%), rgba(242, 243, 247, .22) calc(var(--p, 0) * 100%)); }
.chapters a:hover, .chapters a:focus-visible { opacity: 1; color: var(--ink); transform: translateX(-6px); }
[dir="rtl"] .chapters a:hover, [dir="rtl"] .chapters a:focus-visible { transform: translateX(6px); }
.chapters a:hover::after, .chapters a:focus-visible::after { width: 40px; }
.chapters a[aria-current="step"] { opacity: 1; }
.chapters a[aria-current="step"]::after { width: 56px; }
.chapters a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.chapters a.is-pressed i { animation: ch-press .5s var(--ease); }
@keyframes ch-press { 40% { color: var(--accent); transform: scale(1.25); } }
.chapters a i { display: inline-block; }

/* ------------------------------------------------------------ select menus (start note, combinations) */
.field select, .tonic-pick select {
  -webkit-appearance: none; appearance: none; min-height: 46px; width: 100%; padding: 0 44px 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background-color: rgba(15, 17, 24, .85); color: var(--ink); font: 400 .9375rem var(--sans); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A3A8B7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 12px 8px; background-position: right 18px center;
  transition: border-color .25s, box-shadow .25s;
}
[dir="rtl"] .field select, [dir="rtl"] .tonic-pick select { padding: 0 18px 0 44px; background-position: left 18px center; }
.field select:hover, .tonic-pick select:hover { border-color: var(--ink-2); }
.field select:focus-visible, .tonic-pick select:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.field select option, .tonic-pick select option { background: #0F1118; color: #F2F3F7; }
.tonic-pick { display: grid; gap: 6px; font-size: .875rem; font-weight: 500; max-width: 420px; }

/* ------------------------------------------------------------ combinations explorer */
.mx-classic { color: var(--ink-2); font-size: .9375rem; max-width: 46em; }
.mx-builder { display: grid; gap: 10px; }
.mx-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px 22px; align-items: end; padding: clamp(18px, 2.4vw, 30px); }
.mx-controls .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mx-controls .chip { min-height: 46px; }
.mx-help { grid-column: 1 / -1; color: var(--ink-2); font-size: .875rem; }
@media (max-width: 1100px) { .mx-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mx-controls { grid-template-columns: 1fr; } }
.mx-head { display: grid; gap: 10px; }
.mx-name { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3.2rem); font-weight: 300; letter-spacing: -.035em; line-height: 1.05; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; }
.mx-name .n-alt { font-family: var(--serif); color: var(--ink-2); font-weight: 500; letter-spacing: 0; font-size: .8em; }
:lang(ar) .mx-name { letter-spacing: 0; line-height: 1.3; font-weight: 400; }
:lang(ar) .mx-name .n-alt { font-family: var(--sans); font-size: .55em; }
.mx-notes { font-size: 1.0625rem; letter-spacing: .02em; word-spacing: .3em; }
.mx-note { display: grid; gap: 6px; color: var(--ink-2); font-size: .875rem; line-height: 1.55; max-width: 40em; }
.mx-filters { margin-top: 8px; }
.mx-filters .field { min-width: min(100%, 200px); flex: 1; }
button.row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
button.row:hover { padding-inline-start: 20px; }
button.row:hover .strip-dot { fill: var(--ink); }
button.row:hover .strip-dot.is-tonic { fill: var(--accent); }
button.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
.mx-row .row-names b { font-size: clamp(1.2rem, 1rem + .6vw, 1.6rem); }
.mx-browse .more { gap: 10px; }

/* ============================================================ ambience switch (header) */
/* A labelled pill with a small switch, so it reads as on/off at a glance. */
.pill-ambient { gap: 9px; padding: 0 14px 0 16px; }
.pill-ambient svg { width: 16px; height: 16px; }
.pill-ambient .off-slash { opacity: 0; transition: opacity .3s var(--ease); }
.pill-ambient[aria-pressed="false"] { color: var(--ink-2); }
.pill-ambient[aria-pressed="false"] .off-slash { opacity: 1; }
.mini-track { position: relative; width: 26px; height: 16px; border-radius: 999px; background: rgba(242, 243, 247, .22); flex: none; transition: background-color .3s var(--ease); }
.mini-track::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .35s var(--ease-cine); }
.pill-ambient[aria-pressed="true"] .mini-track { background: var(--accent); }
.pill-ambient[aria-pressed="true"] .mini-track::after { transform: translateX(10px); }
[dir="rtl"] .pill-ambient[aria-pressed="true"] .mini-track::after { transform: translateX(-10px); }
@media (max-width: 560px) { .pill-ambient .pill-label { display: none; } .pill-ambient { padding: 0 12px; } }
@media (max-width: 480px) { .pill-ambient svg { display: none; } .pill-ambient { padding: 0 11px; } .hdr-pills { gap: 6px; } .hdr-pills [data-menu-open] { padding: 0 15px; } }
.menu-sound .toggle { margin-top: 14px; }

/* ============================================================ drones */
.dr { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: clamp(24px, 4vw, 64px); padding: clamp(22px, 3.6vw, 52px); margin-top: clamp(28px, 4vw, 56px); background: rgba(15, 17, 24, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.dr-now { display: grid; gap: 16px; align-content: start; align-self: start; position: sticky; top: 96px; }
.dr-name { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.6rem); font-weight: 300; letter-spacing: -.04em; line-height: 1.02; }
:lang(ar) .dr-name { letter-spacing: 0; line-height: 1.2; }
.dr-notes { font-size: 1.0625rem; color: var(--ink-2); word-spacing: .35em; }
/* the two layers: a switch that says what it plays, and its volume */
.dr-layers { display: grid; gap: 10px; margin-top: 4px; }
.dr-layer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; align-items: center; padding: 8px; border-radius: 22px; background: rgba(242, 243, 247, .045); }
.dr-go { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 16px 6px 6px; border-radius: 999px; border: 0; background: var(--bg-2); color: var(--ink); cursor: pointer; font: inherit; text-align: start; transition: background-color .35s var(--ease), color .35s var(--ease), transform .25s var(--ease); }
.dr-go:active { transform: scale(.97); }
.dr-go-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); flex: none; }
.dr-go-icon svg { width: 13px; height: 13px; grid-area: 1 / 1; transition: opacity .25s var(--ease), transform .35s var(--ease-cine); }
.dr-go-icon svg + svg { opacity: 0; transform: scale(.5); }
.dr-go[aria-pressed="true"] { background: var(--accent); color: #05060A; }
.dr-go[aria-pressed="true"] .dr-go-icon { background: #05060A; color: var(--accent); }
.dr-go[aria-pressed="true"] .dr-go-icon svg:first-child { opacity: 0; transform: scale(.5); }
.dr-go[aria-pressed="true"] .dr-go-icon svg + svg { opacity: 1; transform: none; }
.dr-go-text { display: grid; gap: 3px; min-width: 0; }
.dr-go-text b { font-size: .9375rem; font-weight: 500; }
.dr-go-text span { font-size: .8125rem; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dr-vol { display: grid; grid-template-columns: minmax(0, 1fr) 2.4ch; align-items: center; gap: 10px; padding-inline-end: 8px; }
.dr-vol output { font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: end; }
.dr-vol input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) calc(var(--p, .7) * 100%), rgba(242, 243, 247, .2) calc(var(--p, .7) * 100%)); }
[dir="rtl"] .dr-vol input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--accent) calc(var(--p, .7) * 100%), rgba(242, 243, 247, .2) calc(var(--p, .7) * 100%)); }
.dr-go-row { display: flex; flex-wrap: wrap; gap: 10px; }
.dr-go-row .btn svg { width: 14px; height: 14px; }
.dr-opts { display: grid; gap: 26px; align-content: start; }
.dr-field { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.dr-field legend { padding: 0; margin-bottom: 12px; }
.dr-field .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dr-field .chip { min-height: 44px; padding: 0 22px; }
.dr-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.dr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 6px; }
.dr-key, .dr-card { display: grid; gap: 4px; align-content: center; text-align: start; min-height: 58px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font: inherit; transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.dr-key b { font-size: 1.0625rem; font-weight: 500; }
.dr-card { min-height: 76px; padding: 14px 16px; }
.dr-card b { font-size: 1rem; font-weight: 500; }
.dr-key span, .dr-card span { font-size: .75rem; color: var(--ink-2); line-height: 1.3; transition: color .3s var(--ease); }
.dr-key:hover, .dr-card:hover { border-color: var(--ink-2); }
.dr-key[aria-pressed="true"], .dr-card[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.dr-key[aria-pressed="true"] span, .dr-card[aria-pressed="true"] span { color: rgba(5, 6, 10, .65); }
.dr-key:focus-visible, .dr-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) {
  .dr { grid-template-columns: minmax(0, 1fr); }
  .dr-now { position: static; }
}
@media (max-width: 480px) { .dr-layer { grid-template-columns: minmax(0, 1fr); } }

/* Maqam page: onward links to practice and tuning files */
.m-next { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 4px; font-size: .9375rem; }

/* ============================================================ display settings (prefs.js, shared) */
.dispset { display: grid; gap: 18px; }
.dispset-f { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.dispset-f legend { padding: 0; margin-bottom: 8px; }
.dispset .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dispset .chip { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.dispset-sw { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; flex: none; }
.dispset-zoom { display: grid; grid-template-columns: auto minmax(0, 1fr) 4ch; align-items: center; gap: 12px; }
.dispset-zoom output { font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: end; }
.dispset-zoom input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) calc(var(--p, .33) * 100%), rgba(242, 243, 247, .2) calc(var(--p, .33) * 100%)); }
[dir="rtl"] .dispset-zoom input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--accent) calc(var(--p, .33) * 100%), rgba(242, 243, 247, .2) calc(var(--p, .33) * 100%)); }
.dispset-reset { justify-self: start; }
