:root{
  --smd-ink:#24140b;
  --smd-muted:#6d5a48;
  --smd-gold:#d6a84f;
  --smd-gold-deep:#704b09;
  --smd-cream:#fffaf0;
  --smd-soft:#fff8ed;
  --smd-panel:#fff;
  --smd-dark:#2a1408;
  --smd-dark-2:#4b260f;
  --smd-line:rgba(42,20,8,.12);
  --smd-line-strong:rgba(42,20,8,.18);
  --smd-shadow:0 18px 50px rgba(42,20,8,.08);
}
.speedway-module-directory-page{background:var(--smd-cream);color:var(--smd-ink)}
.speedway-module-directory-page .shell{width:min(calc(100% - 32px),1180px);max-width:1180px;margin-inline:auto}
.module-hero{
  display:grid;grid-template-columns:minmax(0,1.5fr) minmax(320px,.6fr);gap:28px;align-items:center;
  padding:34px 0 20px
}
.module-hero h1{max-width:790px;margin:.2rem 0 .75rem;font-size:clamp(2.5rem,4.15vw,3.8rem);line-height:.98;letter-spacing:-.05em}
.module-hero .lead{max-width:780px;font-size:clamp(1rem,1.25vw,1.15rem);line-height:1.5;color:var(--smd-muted)}
.module-hero .actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:18px}
.module-hero-panel{
  display:grid;grid-template-rows:repeat(3,auto);gap:7px;padding:9px;border:1px solid var(--smd-line);
  border-radius:22px;background:rgba(255,255,255,.92);box-shadow:var(--smd-shadow)
}
.module-hero-panel div{
  display:flex;flex-direction:column;justify-content:center;min-height:74px;padding:13px 15px;border-radius:15px;background:var(--smd-soft)
}
.module-hero-panel strong{font-size:1.7rem;letter-spacing:-.035em;color:var(--smd-ink)}
.module-hero-panel span{margin-top:3px;color:var(--smd-muted);font-size:.8rem;line-height:1.3}

.directory-principles{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:0 0 24px
}
.directory-principles article{
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:start;min-height:0;padding:14px 16px;border:1px solid var(--smd-line);border-radius:18px;background:var(--smd-panel)
}
.directory-principles p{margin:2px 0 0;color:var(--smd-muted);font-size:.87rem;line-height:1.45}
.access-badge{
  display:inline-flex;align-items:center;min-height:25px;padding:4px 8px;border-radius:999px;
  font-size:.7rem;font-weight:850;letter-spacing:.02em;white-space:nowrap;border:1px solid transparent
}
.access-foundation{background:rgba(214,168,79,.20);color:#704b09;border-color:rgba(214,168,79,.55)}
.access-included{background:var(--smd-cream);color:#24140b;border-color:var(--smd-line-strong)}
.access-paid_addon{background:var(--smd-dark);color:var(--smd-soft);border-color:var(--smd-dark)}

.directory-section{
  margin:8px 0 34px;padding:22px;border:1px solid var(--smd-line);border-radius:24px;background:var(--smd-panel);box-shadow:var(--smd-shadow)
}
.directory-heading{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);gap:24px;align-items:end;margin-bottom:16px}
.directory-heading h2{max-width:760px;margin:.2rem 0 0;font-size:clamp(1.6rem,2.6vw,2.35rem);line-height:1.06;letter-spacing:-.035em;color:var(--smd-ink)}
.directory-heading>p{margin:0;color:var(--smd-muted);font-size:.9rem;line-height:1.5}

.directory-controls{
  display:grid;grid-template-columns:minmax(240px,1.6fr) repeat(3,minmax(150px,.8fr)) auto;gap:10px;align-items:end;
  padding:12px;border:1px solid var(--smd-line);border-radius:18px;background:var(--smd-soft)
}
.directory-controls label{display:grid;gap:6px}
.directory-controls label>span{font-size:.72rem;text-transform:uppercase;letter-spacing:.09em;font-weight:850;color:var(--smd-muted)}
.directory-controls input,.directory-controls select,.directory-reset{
  width:100%;min-height:44px;border:1px solid var(--smd-line-strong);border-radius:12px;background:#fff;color:var(--smd-ink);
  font:inherit;padding:0 13px;outline:none
}
.directory-controls input:focus,.directory-controls select:focus,.directory-reset:focus-visible{
  border-color:var(--smd-gold);box-shadow:0 0 0 3px rgba(214,168,79,.18)
}
.directory-reset{width:auto;min-width:82px;cursor:pointer;font-weight:800;background:#fff}
.directory-resultbar{display:flex;align-items:center;gap:7px;min-height:42px;padding:0 4px;color:var(--smd-muted)}
.directory-resultbar strong{font-size:1.05rem;color:var(--smd-ink)}
.directory-resultbar a{margin-left:auto;color:var(--smd-gold-deep);font-weight:800;text-decoration:none}
.directory-resultbar a:hover,.directory-resultbar a:focus-visible{text-decoration:underline;text-underline-offset:3px}
.matrix-scroll-hint{display:none;color:var(--smd-muted);font-size:.78rem;font-weight:750}

.matrix-shell{
  position:relative;overflow:auto;max-height:min(62vh,620px);border:1px solid var(--smd-line);border-radius:18px;background:#fff;
  scrollbar-gutter:stable both-edges;overscroll-behavior:contain
}
.matrix-shell:focus-visible{outline:3px solid rgba(214,168,79,.28);outline-offset:3px}
.module-matrix{width:100%;min-width:1250px;border-collapse:separate;border-spacing:0;font-size:.88rem;color:var(--smd-ink)}
.module-matrix thead th{
  position:sticky;top:0;z-index:5;padding:13px 14px;background:var(--smd-soft);color:#6d5a48;
  border-bottom:1px solid var(--smd-line-strong);text-align:left;font-size:.72rem;text-transform:uppercase;letter-spacing:.085em;white-space:nowrap
}
.module-matrix thead th:first-child{left:0;z-index:7}
.module-matrix tbody th,.module-matrix tbody td{
  vertical-align:top;padding:15px 14px;border-bottom:1px solid var(--smd-line);background:#fff;color:var(--smd-ink);text-align:left
}
.module-matrix tbody tr:last-child th,.module-matrix tbody tr:last-child td{border-bottom:0}
.module-matrix tbody tr:hover th,.module-matrix tbody tr:hover td{background:var(--smd-cream)}
.module-matrix tbody tr[hidden]{display:none}

.module-name-cell{
  position:sticky;left:0;z-index:3;width:245px;min-width:245px;max-width:245px;
  box-shadow:8px 0 15px -14px rgba(42,20,8,.42)
}
.module-name{display:block;color:var(--smd-ink);font-size:.98rem;font-weight:850;line-height:1.25;text-decoration:none}
a.module-name:hover,a.module-name:focus-visible{color:var(--smd-gold-deep);text-decoration:underline;text-underline-offset:3px}
.module-name-cell code{
  display:block;max-width:215px;margin-top:6px;overflow-wrap:anywhere;color:#6d5a48;background:transparent;
  font-size:.69rem;line-height:1.35
}
.module-name-cell .version{display:inline-block;margin-top:7px;color:#6d5a48;font-size:.68rem}
.module-mobile-meta{display:none}

.type-pill,.matrix-chip{
  display:inline-flex;align-items:center;min-height:27px;padding:4px 8px;margin:0 4px 4px 0;
  border:1px solid var(--smd-line-strong);border-radius:8px;background:var(--smd-cream);color:#24140b;font-size:.72rem;font-weight:750;white-space:nowrap
}
.matrix-chip--delivery{background:var(--smd-soft);border-color:var(--smd-line);color:#24140b}
.module-purpose{min-width:360px;max-width:500px}
.module-purpose strong{display:block;color:var(--smd-ink);font-size:.86rem;line-height:1.45}
.module-purpose span{display:block;margin-top:7px;color:var(--smd-muted);line-height:1.45}
.module-purpose small{display:block;margin-top:8px;color:#6d5a48;line-height:1.4}
.chip-cell{min-width:205px;max-width:320px}
.matrix-muted{color:#6d5a48;font-size:.78rem;font-style:italic}
.matrix-link{display:block;margin-top:8px;color:var(--smd-gold-deep);font-size:.74rem;font-weight:850;text-decoration:none}
.matrix-link:hover,.matrix-link:focus-visible{text-decoration:underline;text-underline-offset:3px}
.status-dot{display:inline-block;width:8px;height:8px;margin:5px 7px 0 0;border-radius:50%;background:var(--smd-gold);vertical-align:top}
.matrix-empty{padding:34px;text-align:center;color:var(--smd-muted)}

.directory-note{
  display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:26px;align-items:start;
  margin:0 0 28px;padding:20px 22px;border:1px solid rgba(214,168,79,.26);border-radius:22px;
  background:linear-gradient(135deg,var(--smd-dark),var(--smd-dark-2));color:var(--smd-soft)
}
.directory-note h2{margin:.2rem 0 0;color:var(--smd-soft);font-size:clamp(1.35rem,2vw,1.85rem);line-height:1.1;letter-spacing:-.03em}
.directory-note>p{margin:0;color:#ead8b4;font-size:.9rem;line-height:1.55}
.directory-note .eyebrow{color:var(--smd-gold)}

/* Light-surface contrast ownership.
   The shared public shell also serves dark surfaces and carries high-specificity
   typography rules. The directory owns every foreground on its light matrix
   surfaces so dark-shell colours can never bleed into white/cream content. */
html body.speedway-public-shell.speedway-module-directory-page .module-hero-panel,
html body.speedway-public-shell.speedway-module-directory-page .module-hero-panel div,
html body.speedway-public-shell.speedway-module-directory-page .directory-principles article,
html body.speedway-public-shell.speedway-module-directory-page .directory-section,
html body.speedway-public-shell.speedway-module-directory-page .directory-controls,
html body.speedway-public-shell.speedway-module-directory-page .matrix-shell,
html body.speedway-public-shell.speedway-module-directory-page .module-matrix tbody th,
html body.speedway-public-shell.speedway-module-directory-page .module-matrix tbody td{
  color:var(--smd-ink)!important;
}
html body.speedway-public-shell.speedway-module-directory-page .module-hero-panel strong,
html body.speedway-public-shell.speedway-module-directory-page .directory-heading h2,
html body.speedway-public-shell.speedway-module-directory-page .module-name,
html body.speedway-public-shell.speedway-module-directory-page .module-purpose strong,
html body.speedway-public-shell.speedway-module-directory-page .directory-resultbar strong{
  color:var(--smd-ink)!important;
}
html body.speedway-public-shell.speedway-module-directory-page .module-hero-panel span,
html body.speedway-public-shell.speedway-module-directory-page .directory-principles p,
html body.speedway-public-shell.speedway-module-directory-page .directory-heading>p,
html body.speedway-public-shell.speedway-module-directory-page .directory-controls label>span,
html body.speedway-public-shell.speedway-module-directory-page .directory-resultbar,
html body.speedway-public-shell.speedway-module-directory-page .module-purpose span,
html body.speedway-public-shell.speedway-module-directory-page .module-purpose small,
html body.speedway-public-shell.speedway-module-directory-page .matrix-muted{
  color:var(--smd-muted)!important;
}
html body.speedway-public-shell.speedway-module-directory-page .module-matrix thead th{
  color:#6d5a48!important;
}
html body.speedway-public-shell.speedway-module-directory-page .type-pill,
html body.speedway-public-shell.speedway-module-directory-page .matrix-chip{
  color:#24140b!important;
}
html body.speedway-public-shell.speedway-module-directory-page .access-foundation{
  color:#704b09!important;
}
html body.speedway-public-shell.speedway-module-directory-page .access-included{
  color:#24140b!important;
}
html body.speedway-public-shell.speedway-module-directory-page .access-paid_addon{
  color:var(--smd-soft)!important;
}
html body.speedway-public-shell.speedway-module-directory-page .directory-note,
html body.speedway-public-shell.speedway-module-directory-page .directory-note h2{
  color:var(--smd-soft)!important;
}
html body.speedway-public-shell.speedway-module-directory-page .directory-note>p{
  color:#ead8b4!important;
}
html body.speedway-public-shell.speedway-module-directory-page .directory-note .eyebrow{
  color:var(--smd-gold)!important;
}

@media (max-width:940px){
  .module-hero,.directory-heading,.directory-note{grid-template-columns:1fr}
  .module-hero-panel{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none}
  .module-hero-panel div{min-height:72px}
  .directory-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
  .directory-search{grid-column:1/-1}
  .directory-reset{width:100%}
}
@media (max-width:760px){
  .speedway-module-directory-page .shell{width:min(calc(100% - 20px),1180px)}
  .module-hero{padding:22px 0 14px}
  .module-hero h1{font-size:clamp(2rem,8.6vw,2.6rem);line-height:1}
  .module-hero .lead{font-size:.98rem;line-height:1.45}
  .module-hero .actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-top:16px}
  .module-hero .actions .button{grid-column:auto!important;width:100%;min-width:0;padding-left:10px;padding-right:10px;text-align:center}
  .module-hero .actions .button:first-child{grid-column:1/-1!important}
  .module-hero-panel{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:7px}
  .module-hero-panel div{min-height:62px;padding:8px 7px}
  .module-hero-panel strong{font-size:1.4rem}
  .module-hero-panel span{font-size:.66rem;line-height:1.18}
  .directory-principles{grid-template-columns:1fr;gap:7px}
  .directory-principles article{padding:11px 12px;gap:10px}
  .directory-section{padding:12px;margin-left:0;margin-right:0;border-radius:20px}
  .directory-controls{grid-template-columns:repeat(2,minmax(0,1fr));padding:10px}
  .directory-search{grid-column:1/-1}
  .directory-resultbar{flex-wrap:wrap;gap:5px 8px;padding:6px 2px}
  .directory-resultbar a{margin-left:auto}
  .matrix-scroll-hint{display:inline-block;width:100%}
  .matrix-shell{max-height:62vh;border-radius:15px}
  .module-matrix{min-width:840px}
  .module-matrix th:nth-child(2),.module-matrix td:nth-child(2),
  .module-matrix th:nth-child(5),.module-matrix td:nth-child(5),
  .module-matrix th:nth-child(7),.module-matrix td:nth-child(7){display:none}
  .module-name-cell{width:215px;min-width:215px;max-width:215px;padding-left:12px!important;padding-right:12px!important}
  .module-name-cell code{display:none}
  .module-name-cell .version{display:none}
  .module-mobile-meta{
    display:inline-flex;margin-top:7px;padding:3px 7px;border:1px solid var(--smd-line);
    border-radius:999px;background:var(--smd-cream);color:var(--smd-muted)!important;font-size:.67rem;font-weight:800
  }
  .module-purpose{min-width:300px;max-width:330px}
  .chip-cell{min-width:170px;max-width:220px}
  .directory-note{padding:18px}
}
@media (prefers-reduced-motion:reduce){
  .speedway-module-directory-page *{scroll-behavior:auto!important;transition:none!important}
}
