/* Directory additions reuse the approved layout and semantic theme tokens. */
.home-scene { position: relative; isolation: isolate; overflow: clip; }
html body .reference-home .hero { padding-top: 52px; padding-bottom: 24px; }
html body .reference-home .hero h1 { font-weight: 600; letter-spacing: -.045em; }
.featured-invite { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; padding: 24px 17px; border: 0; border-radius: 0; background: transparent; }
.featured-invite h3 { margin: 0; }
.featured-invite p { max-width: 62ch; margin: 8px 0 0; font-size: .875rem; }
.featured-invite .btn { flex: none; }
html body .reference-home .featured-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 118px; border: 1px dashed var(--border); text-align: center; }
.featured-slot > span { text-decoration: underline; text-underline-offset: 3px; }
.home-leaderboard { margin-top: 24px; }
.hero-discovery { position: relative; }
.hero-atmosphere {
  position: absolute; z-index: -1; inset: 0 0 auto; height: clamp(380px, 36vw, 500px); overflow: hidden; pointer-events: none;
  background:
    radial-gradient(ellipse at 0% 22%, #8755ed73 0%, #9672ff45 25%, #aa89fa14 44%, transparent 64%),
    radial-gradient(ellipse at 100% 22%, #8755ed73 0%, #9672ff45 25%, #aa89fa14 44%, transparent 64%);
  mask-image: linear-gradient(to right, #000 0%, #000a 15%, transparent 40%, transparent 60%, #000a 85%, #000 100%),
    linear-gradient(to bottom, #000c 0%, #000 20%, #000b 58%, transparent 100%);
  mask-composite: intersect;
}
.hero-flow { position: absolute; inset-block: 0; width: 56%; }
.hero-flow-left { left: 0; }
.hero-flow-right { right: 0; transform: scaleX(-1); }
.hero-fluid {
  position: absolute; inset: -35% -55%; will-change: transform, opacity; opacity: .65;
  background:
    radial-gradient(ellipse 30% 32% at 34% 30%, #caa6fff2 0%, #ac71fac2 36%, transparent 85%),
    radial-gradient(ellipse 28% 40% at 43% 62%, #7531d0e6 0%, #9856e68c 42%, transparent 85%);
  mask-image: radial-gradient(ellipse, #000 20%, transparent 72%);
  filter: blur(18px);
}
.hero-fluid:nth-child(2) { transform: translate(8%, -10%) rotate(12deg); opacity: .5; }
.hero-atmosphere::after {
  content: ''; position: absolute; inset: 0; background: url('./hero-grain.svg') repeat; background-size: 128px 128px;
  mix-blend-mode: multiply; opacity: .32;
}
:root[data-theme="dark"] .hero-atmosphere { opacity: .78; }
:root[data-theme="dark"] .hero-atmosphere::after { mix-blend-mode: screen; opacity: .18; }
@media (max-width: 720px) {
  html body .reference-home .hero { padding-top: 40px; padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-fluid { transform: none; will-change: auto; opacity: .35; }
  .hero-fluid:nth-child(2) { display: none; }
}
.directory-status:has(> *) { margin: 16px 0 24px; }
.directory-status-actions { justify-content: center; }
.directory-placeholder { min-height: 118px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); }
.directory-ranking-empty { padding: 40px 12px; text-align: center; }
.directory-ranking-empty p { max-width: 48ch; margin: 12px auto 20px; }
.directory-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.directory-controls { margin-bottom: 20px; }
.workflow-name, .tile strong { overflow-wrap: anywhere; }
.reference-home .directory-placeholder { min-height: 118px; }
.directory-ranking-empty .icon { margin-bottom: 8px; }
/* Statuses and counts share the primary reading font. */
html body .stat strong.text-value,
html body .tile-metrics strong:not(.data-text) { font: 500 .875rem/1.45 var(--font-primary); }

html body .nav.directory-nav { display: flex; gap: 20px; padding-block: 10px; }
html body .directory-nav > .brand { justify-self: start; }
html body .directory-nav > .push { display: block; }
html body .directory-nav > .btn { margin-left: 0; white-space: nowrap; }
@media (max-width: 1100px) { html body .nav.directory-nav { gap: 12px; } }
.directory-footer { max-width: 1440px; margin: auto; padding: 24px 32px; }
.footer-main, .footer-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }
.footer-nav a { padding-block: 8px; font-size: .875rem; font-weight: 500; }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--accent-content); }
.footer-meta { border-top: 1px solid var(--divider); margin-top: 20px; padding-top: 16px; gap: 12px; }

.ranking-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.ranking-controls .directory-search { flex: 1 1 230px; max-width: none; min-width: 0; }
.ranking-controls .directory-search input[type=search] { min-height: 42px; font-size: .875rem; }
.ranking-types { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.ranking-types legend { float: left; margin: 9px 4px 0 0; }
.ranking-types label { position: relative; cursor: pointer; }
.ranking-types input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ranking-types span { display: block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: .875rem; }
.ranking-types input:checked + span { background: var(--surface-selected); border-color: var(--accent-content); color: var(--accent-content); }
.ranking-types input:focus-visible + span { outline: 3px solid var(--accent-content); outline-offset: 3px; }
.ranking-note { margin: 16px 0; padding-bottom: 16px; border-bottom: 1px solid var(--divider); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#leaderboard-results { container-type: inline-size; }
.ranking-table { white-space: normal; table-layout: fixed; }
html body .leader .ranking-table :is(th,td) { padding: 12px 6px; font-size: .875rem; vertical-align: middle; }
.ranking-col-position { width: 44px; }
.ranking-col-identity { width: 33%; }
html body .leader .ranking-table thead th { padding-block: 12px; color: var(--text-muted); font-size: .8125rem; font-weight: 400; }
html body .leader .ranking-table :is(.ranking-metric,.ranking-position) { text-align: center; font-variant-numeric: tabular-nums; }
html body .leader .ranking-table tbody tr:last-child > :is(th,td) { border-bottom: 0; }
html body .ranking-table th.ranking-identity { color: var(--text-primary); font-weight: 500; }
.ranking-identity-link, .ranking-builder-link { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ranking-identity-copy { display: block; min-width: 0; }
.ranking-name, .ranking-description { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-description { margin-top: 3px; font-weight: 400; }
.ranking-avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--avatar-fill); color: var(--avatar-text); font: 500 .8125rem/1 var(--font-primary); }
.ranking-avatar-small { width: 24px; height: 24px; font-size: .6875rem; }
.ranking-builder-link { gap: 6px; }
html body .ranking-table a:hover { color: var(--accent-content); text-decoration: underline; text-underline-offset: 3px; }
.ranking-number {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding-inline: 4px; border-radius: 8px;
  font: 400 .875rem/1 var(--font-data);
  color: color-mix(in srgb, var(--accent-content) var(--rank-strength), var(--text-muted));
  background: color-mix(in srgb, var(--accent) calc(var(--rank-strength) * .16), var(--surface-secondary));
}
.ranking-top .ranking-number { font-weight: 600; font-family: var(--font-primary); font-size: 1rem; border: 1px solid color-mix(in srgb, var(--accent) calc(var(--rank-strength) * .3), var(--border)); }
.ranking-number.ranking-first { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.ranking-unavailable { color: var(--text-muted); }
@container (max-width: 560px) {
  .ranking-table, .ranking-table tbody { display: block; }
  .ranking-table colgroup { display: none; }
  .ranking-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ranking-table tr { display: grid; grid-template-columns: 40px minmax(0,1fr) minmax(0,1fr); gap: 16px 8px; padding: 16px 4px; border-bottom: 1px solid var(--divider); }
  .ranking-table tr:last-child { border-bottom: 0; }
  html body .leader .ranking-table :is(th,td) { display: block; padding: 0; border: 0; width: auto; }
  .ranking-position { grid-row: 1; grid-column: 1; align-self: center; }
  .ranking-identity { grid-column: 2 / 4; }
  .ranking-table td:nth-child(odd):not(.ranking-position) { grid-column: 2; }
  .ranking-table td:nth-child(even):not(.ranking-position) { grid-column: 3; }
  .ranking-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--text-muted); font-size: .8125rem; }
  .ranking-builder-link { justify-content: center; }
}
.ranking-no-results { text-align: center; padding: 24px 0; }
@media (max-width: 540px) {
  html body .nav.directory-nav { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }
  html body .directory-nav > .push { display: none; }
  html body .directory-nav > .brand { font-size: 1rem; gap: 4px; }
  html body .directory-nav > .appearance-switch { grid-column: 2; grid-row: 1; margin-left: 0; }
  .directory-nav .bolt { width: 18px; height: 22px; }
  .directory-nav .appearance-switch { width: 52px; }
  .directory-nav .appearance-switch[aria-pressed=true] .appearance-thumb { transform: translateX(16px); }
  html body .directory-nav > .btn { grid-column: 3; grid-row: 1; font-size: .8125rem; padding: 7px 8px; min-height: 36px; }
  .directory-footer { padding: 24px 15px; }
  .footer-nav { gap: 20px; }
}
@media (max-width: 360px) {
  html body .nav.directory-nav { grid-template-columns: minmax(0,1fr) 52px 76px; padding-inline: 8px; gap: 6px; }
  html body .directory-nav > .brand { font-size: .9375rem; }
  html body #header .directory-nav > .btn { width: 76px; min-width: 0; padding: 6px; white-space: normal; text-align: center; font-size: .75rem; line-height: 1.15; }
}
@media (max-width: 720px) {
  .directory-placeholder { display: none; }
}
/* Provider connections use the existing typography, controls and theme tokens. */
.connector-panel { margin-block: 16px; }
.connector-form { max-width: 650px; }
.connector-form [hidden] { display: none; }
.connector-sources { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-block: 16px; }
.connector-sources label { display: flex; gap: 10px; align-items: center; padding-block: 8px; }
.connector-sources input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--accent); }
.connector-import { padding-block: 12px; border-top: 1px solid var(--border); }
.connector-panel .between { flex-wrap: wrap; gap: 12px; }
.connector-panel .actions { flex-wrap: wrap; }
.connector-panel input[type="password"], .connector-panel input[type="url"], .connector-panel select { width: 100%; min-width: 0; }

/* Keep the signed-in controls inside the existing phone header. */
@media (max-width: 480px) {
  .directory-nav .account-label { display: none; }
  html body #header .directory-nav > .account-control { width: 42px; min-width: 42px; min-height: 42px; padding: 6px; }
}
/* Preserve readable comparison columns; constrain scrolling to the table. */
.comparison-scroll .compare-grid { min-width: 560px; }
.comparison-scroll:focus-visible { outline: 2px solid var(--accent-content); outline-offset: 3px; }

/* Retained from the visual experiment: prominent icons only. */
html body .reference-home .stat .icon { border-radius: 13px 16px 12px 16px; background: var(--accent-surface); color: var(--accent-content); border: 1px solid color-mix(in srgb,var(--accent-content) 40%,var(--surface)); }

/* Full-width featured row: outside the centred content wrapper, with native touch scrolling. */
.home-scene > .reference-home:has(> .hero) { padding-bottom: 0; }
.featured-carousel { min-width: 0; margin-top: 0; }
.featured-header.wrap { max-width: 1512px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 12px; }
.featured-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.featured-heading .section-title { margin: 0; }
.featured-rail { width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; padding-block: 5px 12px; touch-action: pan-x pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.featured-rail .tile { cursor: grab; }
.featured-rail.is-dragging, .featured-rail.is-dragging * { cursor: grabbing; }
.featured-drag-hint { white-space: nowrap; }
.featured-rail::-webkit-scrollbar { display: none; }
.featured-rail:focus-visible { outline: 2px solid var(--accent-content); outline-offset: -2px; }
.featured-track, .featured-card-group { display: flex; align-items: stretch; width: max-content; }
.featured-card-group { gap: 16px; padding-right: 16px; flex: none; }
.featured-card-group .tile { flex: 0 0 clamp(270px,27vw,350px); width: clamp(270px,27vw,350px); min-height: 132px; padding: 16px; border: 1px solid var(--border); }
.featured-card-group .tile > .flex { flex-wrap: nowrap; }
.featured-card-group .tile > .flex > div { flex: 1; min-width: 0; }
html body .featured-carousel .featured-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-style: dashed; text-align: center; }
.featured-invitation-band { margin-top: 4px; background: var(--accent-surface); border-block: 1px solid var(--border); }
.featured-invitation-wrap.wrap { max-width: 1512px; padding-top: 0; padding-bottom: 0; }
@media(max-width:600px) {
 .featured-header.wrap { gap: 10px; }
 .featured-heading { gap: 10px; }
 html body .featured-heading .section-title { font-size: 1.1875rem; }
 .featured-header > .link { font-size: .8125rem; }
 .featured-card-group .tile { flex-basis: 270px; width: 270px; }
}
@media(prefers-reduced-motion:reduce) { .featured-rail { scroll-behavior: auto; } }

/* Dated evidence stays visible inside the identity column; metric cells stay centered. */
.ranking-evidence-note { display: block; margin-top: 6px; color: var(--text-muted); font-size: .75rem; font-weight: 400; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.ranking-evidence-note > span { display: block; }
