/* ScaleMastery — Fuaran Music base styles + component recipes.
 *
 * Loaded AFTER brand-tokens.css and site.css so component classes here
 * take precedence on pages that opt in via `.sm-page` on <body>. Page
 * authors compose with semantic class names (e.g. `.sm-card`,
 * `.sm-btn-primary`) emitted via the StyleKit helpers.
 *
 * Geometry is square — 0 radius, no shadows. Separation is by hairline
 * + surface tint only. This is intentional per the brand identity.
 */

/* Note: Bravura (the SMuFL music font) is NOT loaded here in v1.
 * Verovio embeds its own font glyphs directly in the SVG it emits, so
 * the engraved staff renders correctly without an external @font-face.
 * The brand chrome (root picker, keyboard labels) uses Unicode glyphs
 * ♯ ♭ in IBM Plex Mono — they render acceptably. If we later add
 * notation glyphs in custom SVG elsewhere, vendor Bravura then.
 */

/* ── Body baseline for design-system pages ─────────────────────── */
.sm-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sm-font-mono);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}

.sm-page ::selection {
  background: var(--accent);
  color: #FAFAF8;
}

.sm-page a {
  color: var(--loch);
}

/* Thin custom scrollbar for the library rail */
.sm-page nav.sm-rail::-webkit-scrollbar       { width: 6px; }
.sm-page nav.sm-rail::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }
.sm-page nav.sm-rail::-webkit-scrollbar-track { background: transparent; }


/* ── Typography primitives ─────────────────────────────────────── */

/* Display — EB Garamond italic 500. Used for the wordmark, scale
 * titles ("C Ionian"), and intro statements. */
.sm-display {
  font-family: var(--sm-font-display);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  margin: 0;
  color: var(--ink);
}

.sm-display-lg   { font-size: 52px; }
.sm-display-md   { font-size: 28px; line-height: 1.16; color: var(--ink-body); }
.sm-display-sm   { font-size: 23px; letter-spacing: -0.02em; }

/* Mono — IBM Plex Mono. Used for everything structural. */
.sm-mono { font-family: var(--sm-font-mono); margin: 0; }

/* Eyebrow — small uppercase label in loch or ink-mute. */
.sm-eyebrow {
  font-family: var(--sm-font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--loch);
}

/* Mono utility classes for inline use */
.sm-mono-sm  { font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; }
.sm-mono-md  { font-size: 11px;   font-weight: 500; letter-spacing: 0.16em; }
.sm-mono-lg  { font-size: 12px;   font-weight: 500; letter-spacing: 0.30em; }
.sm-mono-body{ font-size: 13px;   font-weight: 400; }
.sm-upper    { text-transform: uppercase; }

.sm-ink       { color: var(--ink); }
.sm-ink-body  { color: var(--ink-body); }
.sm-ink-mute  { color: var(--ink-mute); }
.sm-loch      { color: var(--loch); }
.sm-accent    { color: var(--accent); }


/* ── Rule (1px divider) ────────────────────────────────────────── */
.sm-rule      { height: 1px; background: var(--rule); }
.sm-rule-soft { height: 1px; background: var(--rule-soft); }
.sm-divider-v { width: 1px; align-self: stretch; background: var(--rule); }


/* ── Card ──────────────────────────────────────────────────────── */
.sm-card {
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  padding: 26px;
  /* No radius, no shadow — deliberate. */
}
.sm-card-deep { background: var(--paper-deep); }
.sm-card-tight { padding: 18px; }
.sm-card-snug  { padding: 0; }


/* ── Tag ───────────────────────────────────────────────────────── */
.sm-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--sm-font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  color: var(--ink-mute);
}
.sm-tag-on {
  border-color: var(--accent);
  color: var(--accent);
}
.sm-tag-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--accent);
  margin-right: 7px;
}


/* ── Buttons ───────────────────────────────────────────────────── */
.sm-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--sm-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: none;
  padding: 11px 20px 11px 17px;
  /* No radius, no shadow. */
}

.sm-btn-primary {
  background: var(--accent);
  color: #FAFAF8;
}
/* Play / Stop icon-and-label swap is JS-driven via direct inline
 * style assignment in scale-hydrate.js — see the setPlayingUi /
 * setIdleUi functions. The initial server-rendered shape hides the
 * stop pair via inline style="display:none". JS toggling beats any
 * class-vs-inline-style specificity contest. */
/* While samples download, dim the button + show wait cursor. */
.sm-btn-primary.loading { opacity: 0.55; cursor: progress; }
.sm-btn-primary[disabled] { cursor: not-allowed; }
.sm-btn-secondary {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 11px 16px;
}


/* ── Segmented control ──────────────────────────────────────── */
.sm-seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.sm-seg button {
  cursor: pointer;
  padding: 7px 13px;
  font-family: var(--sm-font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: transparent;
  border: none;
}
.sm-seg button + button { border-left: 1px solid var(--rule); }
.sm-seg button.on {
  background: var(--ink);
  color: #FAFAF8;
}


/* ── Tempo slider ───────────────────────────────────────────── */
.sm-tempo-input {
  width: 108px;
  height: 3px;
  accent-color: var(--accent);
}


/* ── Header ──────────────────────────────────────────────────── */
.sm-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.sm-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 13px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ── Page layout grid ────────────────────────────────────────── */
.sm-page-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px;
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 40px;
}
@media (max-width: 880px) {
  .sm-page-grid {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 28px;
  }
  /* Library rail + side ad slot don't fit the narrow column layout —
     the sticky rail steals scroll space and the sidebar ad sits empty.
     Hide both below the breakpoint; navigation is still reachable via
     the breadcrumb + Discover hub. */
  nav.sm-rail,
  .sm-library-rail,
  #ad-slot-sidebar {
    display: none;
  }
}

.sm-stage {
  display: flex;
  flex-direction: column;
  gap: 20px;
}


/* ── Library rail ────────────────────────────────────────────── */
nav.sm-rail {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
}
.sm-rail-family { margin-bottom: 22px; }
.sm-rail-family-hint {
  display: block;
  font-family: var(--sm-font-mono);
  font-size: 9.5px;
  color: var(--ink-mute);
  opacity: 0.55;
  margin-top: 4px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.sm-rail-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  font-family: var(--sm-font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-body);
  text-decoration: none;
  transition: background .12s ease;
}
.sm-rail-row:hover { background: var(--rule-soft); }
.sm-rail-row.on {
  background: var(--rail-on);
  border-left-color: var(--accent);
  font-weight: 500;
  color: var(--ink);
}
.sm-rail-count {
  font-size: 9px;
  color: var(--ink-mute);
  opacity: 0.7;
}


/* ── Root picker (12 chromatic chips) ────────────────────────── */
.sm-root-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.sm-root-chip {
  cursor: pointer;
  min-width: 40px;
  padding: 9px 4px 8px;
  font-family: var(--sm-font-mono);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  color: var(--ink);
  line-height: 1.1;
  transition: all .12s ease;
  text-decoration: none;
  display: inline-block;
}
.sm-root-chip.black {
  background: var(--paper-deep);
  color: var(--ink-mute);
}
.sm-root-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #FAFAF8;
}
.sm-root-chip-alt {
  display: block;
  font-size: 8.5px;
  opacity: 0.5;
  margin-top: 2px;
}
.sm-root-chip.on .sm-root-chip-alt { opacity: 0.8; }


/* ── Engraved stave card ─────────────────────────────────────── */
/* A plain paper-bright surface for the Verovio SVG to sit on.
 * Deliberately does NOT touch the engraving itself — no notehead
 * colouring, no active-note halo, no glyph restyling. The engraver
 * has its own visual idiom that we don't fight. Just gives the
 * SVG a card to live in. */
.sm-stave-card {
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  padding: 28px 24px;
  overflow-x: auto;
}
.sm-stave-card svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}


/* ── Keyboard card ───────────────────────────────────────────── */
.sm-keyboard-card {
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  padding: 24px;
}
.sm-keyboard-wrap {
  position: relative;
  background: var(--keybed);
  padding: 12px 16px 8px;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Fretboard card ──────────────────────────────────────────── */
/* Same outer-card treatment as the keyboard. The inner "fretboard
 * wrap" uses a warmer paper-deep tone — sits closer to wood/satin
 * than the keyboard's keybed colour, but stays inside the brand
 * palette. The accent rule along the top mirrors the keyboard's
 * keybed accent line. */
.sm-fretboard-card {
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  padding: 24px;
}
.sm-fretboard-wrap {
  position: relative;
  background: var(--paper-deep);
  padding: 16px 20px;
  max-width: 760px;
  margin: 0 auto;
}
.sm-fretboard-wrap::before {
  /* 2px accent rule along the top — matches the keyboard pattern */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
}
.sm-keyboard-wrap::before {
  /* 2px accent rule along the top of the keybed */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
}
.sm-keyboard-wrap svg {
  display: block;
  width: 100%;
  max-width: 510px;
  margin: 0 auto;
}


/* ── Page footer ──────────────────────────────────────────────── */
.sm-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
  padding: 22px 32px;
  max-width: 1240px;
  margin: 40px auto 0;
  font-family: var(--sm-font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}


/* ── Save-to-favourites star ──────────────────────────────────── */
.sm-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  font-family: var(--sm-font-mono);
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease;
}
.sm-save-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Label-toggle row (note names / scale degrees / solfège) ─── */
.sm-label-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.sm-label-toggle-row [data-label-toggle] {
  padding: 5px 10px;
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  font-family: var(--sm-font-mono);
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.04em;
}
.sm-label-toggle-row [data-label-toggle][aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-bright);
}

/* ── Sticky-bottom mobile play bar ────────────────────────────── */
@media (max-width: 720px) {
  body.sm-page {
    padding-bottom: 78px;
  }
  .sm-mobile-play-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--paper-deep);
    border-top: 1px solid var(--rule);
    padding: 12px 16px env(safe-area-inset-bottom) 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 -2px 12px rgba(28,31,37,0.08);
  }
  .sm-mobile-play-bar .sm-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
  }
}
@media (min-width: 721px) {
  .sm-mobile-play-bar {
    display: none;
  }
}

/* ── Print-friendly mode ──────────────────────────────────────── */
@media print {
  /* Hide chrome that isn't part of the practice surface. */
  .sm-header,
  .sm-footer,
  #ad-slot-footer,
  #ad-slot-sidebar,
  .sm-mobile-play-bar,
  .sm-library-rail,
  .sm-save-btn,
  #sm-print-button,
  .sm-label-toggle-row,
  #scale-playback,
  .sm-fretboard-card,
  .sm-keyboard-card,
  nav[aria-label="Breadcrumb"] {
    display: none !important;
  }
  body, .sm-page, main {
    background: #fff !important;
    color: #000 !important;
    font-family: var(--sm-font-mono);
  }
  .sm-page-grid {
    display: block !important;
  }
  .sm-stage {
    max-width: 100% !important;
  }
  .sm-stave-card {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
  details[open] summary,
  details summary {
    pointer-events: none;
  }
  details {
    page-break-inside: avoid;
  }
  a {
    color: #000 !important;
    text-decoration: none !important;
  }
  @page {
    margin: 1.5cm;
  }
}



/* ── Anchor-jump offset for sticky header (T1) ────────────────── */
html {
  scroll-padding-top: 88px;
}

/* ── Phase 14d.1: notation cursor + click-to-seek ─────────────── */
/*
 * `.sm-cursor-active` highlights the currently-sounding `<g>` in the
 * engraved Verovio SVG. Toggled by scale-hydrate.js's
 * CursorController in lock-step with the audio queue. Verovio paints
 * notes with `fill`/`stroke` on the leaf SVG primitives (notehead,
 * stem, ledger lines), which are nested children of the `<g id="…">`
 * the timemap addresses — so we recolour both the addressed `<g>`
 * itself and every descendant.
 *
 * `.sm-cursor-target` is the brief click-to-seek pulse: a 200ms
 * keyframe animation applied when the user clicks a note. The
 * fallback colour (#e57373) ships before `--coral` lands in
 * brand-tokens.css; the var() resolves cleanly either way.
 */
.sm-cursor-active {
  fill: var(--loch);
  stroke: var(--loch);
  transition: fill 80ms ease, stroke 80ms ease;
}
.sm-cursor-active * {
  fill: var(--loch);
  stroke: var(--loch);
}
.sm-cursor-target {
  fill: var(--coral, #e57373);
  stroke: var(--coral, #e57373);
  animation: sm-cursor-pulse 200ms ease-out forwards;
}
@keyframes sm-cursor-pulse {
  0%   { transform: scale(1.0);  opacity: 1.0; }
  60%  { transform: scale(1.15); opacity: 0.9; }
  100% { transform: scale(1.0);  opacity: 1.0; }
}

/* ── Phase 14c.x: fretboard + keyboard audio-synced highlights ──── */
/*
 * The audio-highlights.js module animates fretboard dots
 * (`<g data-midi="N">` inside `#sm-fretboard-svg-wrap`) and primary
 * keyboard keys (`<g data-pc-primary="true">` inside
 * `#sm-keyboard-svg-wrap`) in lock-step with the audio attack
 * envelope. The animation itself is Web-Animations-API driven — the
 * module passes the exact note duration per event so the fade tracks
 * the audio envelope without per-duration CSS keyframes.
 *
 * These rules add the *baseline* transform-origin + transition so
 * the JS-driven animation has a sensible origin and a clean
 * fall-back if WAAPI is unavailable (rare; all modern browsers ship
 * it). The drop-shadow + scale-up are inlined by the WAAPI keyframes.
 */
#sm-fretboard-svg-wrap [data-midi],
#sm-keyboard-svg-wrap [data-pc] {
  transform-origin: center center;
  transform-box: fill-box;
  will-change: transform, opacity, filter;
}

/* Class-toggle layer — unmissable on/off signal that supplements the
 * Web-Animations API fade. The animateElement() helper adds
 * `.sm-highlight-active` for the full note duration; the WAAPI runs
 * on top for the smooth attack-and-decay curve. This pair ensures
 * the highlight is visible even on browsers where WAAPI filter
 * animations on SVG <g> get optimised away. */
#sm-fretboard-svg-wrap .sm-highlight-active rect,
#sm-fretboard-svg-wrap .sm-highlight-active circle {
  fill: var(--accent) !important;
  stroke: var(--accent) !important;
  stroke-width: 2.5 !important;
}
#sm-fretboard-svg-wrap .sm-highlight-active text {
  fill: #FAFAF8 !important;
  font-weight: 700 !important;
}
#sm-keyboard-svg-wrap .sm-highlight-active rect {
  fill: var(--accent) !important;
  stroke: var(--accent) !important;
  stroke-width: 2 !important;
}
#sm-keyboard-svg-wrap .sm-highlight-active text {
  fill: #FAFAF8 !important;
  font-weight: 700 !important;
}

/* ── Phase 14c.x: keyboard 1/2-octave toggle pill state ─────────── */
.sm-keyboard-oct-on {
  background: var(--accent);
  color: #FAFAF8 !important;
  border-color: var(--accent) !important;
}

/* ── Phase 14d.4: hover-over note inspector tooltip ───────────── */
/*
 * Single shared floating tooltip the CursorController repositions
 * on each mouseover/mousemove. Hidden by default; the
 * `.sm-cursor-tooltip-show` class fades it in over 120ms. Styled to
 * match `.sm-card` (paper-bright surface, 1px rule, mono font) so
 * it reads as part of the brand chrome.
 */
.sm-cursor-tooltip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  background: var(--paper-bright);
  color: var(--ink);
  border: 1px solid var(--rule);
  font-family: var(--sm-font-mono);
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 12px;
  display: none;
  max-width: 240px;
  box-shadow: 0 2px 8px rgba(28, 31, 37, 0.08);
}
.sm-cursor-tooltip.sm-cursor-tooltip-show {
  display: block;
  animation: sm-tooltip-fade 120ms ease-out;
}
.sm-cursor-tooltip strong {
  font-weight: 500;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.sm-cursor-tooltip span {
  display: block;
  color: var(--ink-body);
}
.sm-cursor-tooltip .sm-cursor-tooltip-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}
@keyframes sm-tooltip-fade {
  0%   { opacity: 0; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Phase 14d.8 — site-wide search modal ─────────────────────────── */
.sm-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  padding: 5px 12px;
  cursor: pointer;
  font-family: var(--sm-font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.sm-search-trigger:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.sm-search-trigger .sm-search-trigger-icon {
  font-size: 14px;
  line-height: 1;
  color: var(--accent);
}
.sm-search-trigger kbd {
  font-family: var(--sm-font-mono);
  font-size: 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 4px;
  color: var(--ink-mute);
  background: var(--paper-deep);
}
.sm-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 31, 37, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  animation: sm-search-fade 140ms ease-out;
}
.sm-search-modal[hidden] {
  display: none;
}
.sm-search-panel {
  width: 100%;
  max-width: 640px;
  background: var(--paper-bright);
  border: 1px solid var(--rule);
  box-shadow: 0 8px 32px rgba(28, 31, 37, 0.18);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
.sm-search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.sm-search-icon {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.sm-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--sm-font-mono);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.sm-search-input::placeholder {
  color: var(--ink-mute);
}
.sm-search-kbd {
  font-family: var(--sm-font-mono);
  font-size: 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 2px 6px;
  color: var(--ink-mute);
  background: var(--paper-deep);
  text-transform: lowercase;
  letter-spacing: 0.10em;
}
.sm-search-status {
  padding: 6px 18px;
  font-family: var(--sm-font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  min-height: 18px;
  border-bottom: 1px solid var(--rule);
}
.sm-search-status:empty {
  border-bottom: none;
  padding-top: 0;
  padding-bottom: 0;
  min-height: 0;
}
.sm-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.sm-search-result {
  border-bottom: 1px solid var(--rule);
}
.sm-search-result:last-child {
  border-bottom: none;
}
.sm-search-result.is-selected {
  background: var(--paper-deep);
}
.sm-search-link {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 18px;
  text-decoration: none;
  color: inherit;
}
.sm-search-kind {
  font-family: var(--sm-font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.sm-search-title {
  font-family: var(--sm-font-mono);
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-search-url {
  font-family: var(--sm-font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.sm-search-empty {
  padding: 24px 18px;
  font-family: var(--sm-font-mono);
  font-size: 13px;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.5;
}
.sm-search-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--sm-font-mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}
.sm-search-footer kbd {
  font-family: var(--sm-font-mono);
  font-size: 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1px 5px;
  color: var(--ink-mute);
  background: var(--paper-deep);
  margin: 0 2px;
}
@keyframes sm-search-fade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@media (max-width: 540px) {
  .sm-search-modal { padding: 24px 8px; }
  .sm-search-link  { grid-template-columns: 70px 1fr; }
  .sm-search-url   { display: none; }
}
