:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #19202a;
  --muted: #687386;
  --line: #dfe3e8;
  --accent: #173f6b;
  --accent-2: #24598d;
  --accent-soft: #eaf2f9;
  --yes: #1f6b45;
  --yes-soft: #e8f5ee;
  --warn: #7a5a10;
  --warn-soft: #fff7d8;
  --no: #8a3540;
  --no-soft: #fae9ec;
  --unknown: #626a75;
  --unknown-soft: #eef0f2;
  --shadow: 0 10px 30px rgba(17, 24, 39, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
a { color: var(--accent-2); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #c6d9ee; outline-offset: 2px; }
.skip-link { position: fixed; left: 1rem; top: .65rem; z-index: 100; transform: translateY(-180%); background: var(--accent); color: white; padding: .6rem .8rem; border-radius: .55rem; font-weight: 800; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.15rem 2rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px);
}
.brand-block { min-width: 0; }
.eyebrow { margin: 0 0 .2rem; color: var(--accent-2); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: 1.55rem; line-height: 1.1; }
.subtitle { margin: .32rem 0 0; color: var(--muted); max-width: 58rem; font-size: .9rem; }
.topbar-actions { display: flex; gap: .65rem; flex-shrink: 0; }
.button { border: 1px solid transparent; border-radius: .72rem; padding: .65rem .92rem; cursor: pointer; font-weight: 750; }
.button:disabled { opacity: .45; cursor: default; }
.button.primary { background: var(--accent); color: white; }
.button.secondary { background: var(--panel); border-color: var(--line); color: var(--ink); }
.text-button { border: 0; background: none; padding: 0; color: var(--accent-2); cursor: pointer; font-weight: 750; }
.small-muted { color: var(--muted); font-size: .82rem; margin: .2rem 0 0; }

.landing-view { width: min(1260px, calc(100% - 2rem)); margin: 0 auto; padding: 3.2rem 0 5rem; }
.hero { max-width: 860px; margin: 0 auto 3rem; text-align: center; }
.hero-kicker { margin: 0 0 .7rem; color: var(--accent-2); font-weight: 750; font-size: .84rem; }
.hero h2 { margin: 0 0 1.2rem; font-size: clamp(2.1rem, 5vw, 4rem); letter-spacing: -.04em; }
.hero-note { margin: .8rem auto 0; color: var(--muted); max-width: 680px; line-height: 1.5; }
.intent-search-wrap { position: relative; max-width: 720px; margin: 0 auto; }
.intent-search { width: 100%; border: 1px solid #cfd6de; border-radius: 1rem; padding: 1rem 1.15rem; background: white; font-size: 1.05rem; box-shadow: var(--shadow); }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + .35rem); background: white; border: 1px solid var(--line); border-radius: .9rem; box-shadow: var(--shadow); z-index: 40; overflow: hidden; text-align: left; }
.suggestion-option { width: 100%; border-bottom: 1px solid var(--line); background: white; padding: .72rem .85rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; text-align: left; }
.suggestion-option:last-child { border-bottom: 0; }
.suggestion-option:hover, .suggestion-option.active { background: var(--accent-soft); }
.suggestions strong { display: block; }
.suggestions small { display: block; color: var(--muted); margin-top: .12rem; }
.suggestion-count { color: var(--muted); font-size: .78rem; white-space: nowrap; }

.collection-browser { border-top: 1px solid var(--line); padding-top: 1.8rem; }
.collection-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.2rem; }
.collection-toolbar h2 { margin: 0; font-size: 1.35rem; }
.toolbar-controls { display: flex; gap: .7rem; }
.toolbar-controls label, .sort-control { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: .4rem; }
select { border: 1px solid var(--line); border-radius: .62rem; padding: .5rem .62rem; background: white; color: var(--ink); }
.stage-strip { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 .75rem; }
.stage-pill { border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink); padding: .45rem .75rem; cursor: pointer; }
.stage-pill.active { background: var(--accent); border-color: var(--accent); color: white; }
.popularity-note { border: 1px solid #eadb9d; background: #fffaf0; color: #62501d; border-radius: .75rem; padding: .7rem .85rem; font-size: .82rem; margin: 0 0 1rem; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: .72rem; }
.collection-card { min-height: 170px; text-align: left; border: 1px solid var(--line); border-radius: .9rem; padding: .95rem; background: white; cursor: pointer; display: flex; flex-direction: column; box-shadow: 0 1px 0 rgba(0,0,0,.02); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.collection-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #b6c7d8; }
.collection-group { color: var(--accent-2); text-transform: uppercase; letter-spacing: .05em; font-size: .64rem; font-weight: 800; }
.collection-card strong { display: block; font-size: 1.02rem; margin: .28rem 0 .35rem; }
.collection-description { color: #4d5764; font-size: .79rem; line-height: 1.4; }
.collection-metrics { margin-top: auto; padding-top: .8rem; color: var(--muted); font-size: .72rem; display: flex; flex-wrap: wrap; gap: .25rem; }
.collection-metrics b { color: var(--ink); }

.browse-header { background: white; border-bottom: 1px solid var(--line); padding: 1rem 2rem 1.15rem; }
.back-button { margin-bottom: .85rem; }
.selected-intent { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-end; }
.selected-intent h2 { margin: 0; font-size: 1.7rem; }
.selected-description { margin: .35rem 0 0; color: var(--muted); max-width: 680px; }
.collection-stats { display: grid; grid-template-columns: repeat(4, minmax(90px,1fr)); gap: .45rem; min-width: 450px; }
.collection-stats div { border: 1px solid var(--line); border-radius: .7rem; padding: .55rem .6rem; background: var(--bg); }
.collection-stats strong { display: block; font-size: 1.05rem; }
.collection-stats span { display: block; color: var(--muted); font-size: .67rem; margin-top: .08rem; }

.browse-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100vh - 190px); }
.filters { border-right: 1px solid var(--line); background: white; }
.sticky-panel { position: sticky; top: 86px; max-height: calc(100vh - 86px); overflow: auto; padding: 1.1rem 1rem 3rem; }
.search-label { display: block; font-size: .8rem; font-weight: 800; margin-bottom: .35rem; }
.search-input { width: 100%; border: 1px solid var(--line); border-radius: .7rem; padding: .72rem .8rem; background: #fff; }
.filter-toolbar { display: flex; justify-content: space-between; align-items: center; margin: .65rem 0 .4rem; }
.filter-section { padding: .9rem 0; border-top: 1px solid var(--line); }
.filter-section h3 { font-size: .86rem; margin: 0 0 .55rem; }
.hint { color: var(--muted); font-weight: 500; font-size: .7rem; margin-left: .25rem; }
.toggle-row, .check-list label { display: flex; gap: .48rem; align-items: flex-start; margin: .42rem 0; font-size: .82rem; cursor: pointer; }
.toggle-row input, .check-list input { margin-top: .14rem; }
.check-list.two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: .6rem; }
.stacked-control { display: flex; flex-direction: column; gap: .35rem; color: #3c4652; font-size: .78rem; }
.stacked-control select { width: 100%; }
.microcopy { margin: .45rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }

.content { padding: 1.2rem 1.35rem 4rem; min-width: 0; }
.notice { border: 1px solid #cad9e7; background: var(--accent-soft); border-radius: .8rem; padding: .8rem .95rem; margin-bottom: 1rem; color: #29435d; font-size: .85rem; }
.result-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 1rem 0; }
.result-header h2 { margin: 0; font-size: 1.22rem; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: .85rem; }
.card { background: white; border: 1px solid var(--line); border-radius: .9rem; padding: 1rem; display: flex; flex-direction: column; min-height: 250px; }
.card-top { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; }
.card h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.provider { color: var(--muted); font-size: .78rem; margin-top: .18rem; }
.confidence-badge { flex-shrink: 0; border: 1px solid #cad9e7; background: var(--accent-soft); color: #29435d; border-radius: 999px; padding: .28rem .48rem; font-size: .66rem; font-weight: 800; }
.description { color: #424c5a; font-size: .84rem; line-height: 1.45; margin: .72rem 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: .33rem; margin-top: auto; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .26rem .46rem; background: var(--unknown-soft); color: #4c5664; font-size: .67rem; font-weight: 700; }
.badge.yes { background: var(--yes-soft); color: var(--yes); }
.badge.pilot { background: var(--warn-soft); color: var(--warn); }
.card-evidence { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .66rem; margin-top: .68rem; }
.card-actions { display: flex; justify-content: space-between; gap: .7rem; align-items: center; margin-top: .75rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.card-actions .links { display: flex; gap: .65rem; align-items: center; }
.card-actions a, .card-actions button.link-button { border: 0; background: none; padding: 0; color: var(--accent-2); font-size: .76rem; font-weight: 750; cursor: pointer; text-decoration: none; }
.compare-toggle { font-size: .76rem; color: var(--muted); display: flex; gap: .35rem; align-items: center; }
.load-more-wrap { text-align: center; margin-top: 1.3rem; }
.empty { text-align: center; background: white; border: 1px dashed var(--line); border-radius: .9rem; padding: 3rem 1rem; color: var(--muted); grid-column: 1 / -1; line-height: 1.6; }

.dialog { border: 0; border-radius: 1rem; padding: 1.4rem; box-shadow: var(--shadow); width: min(960px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; }
.dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-close { position: sticky; top: 0; float: right; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); background: white; cursor: pointer; font-size: 1.25rem; z-index: 2; }
.detail-heading { padding-right: 2.5rem; }
.detail-heading h2 { margin: 0 0 .2rem; }
.detail-meta { color: var(--muted); font-size: .82rem; }
.detail-note { margin: 1rem 0; border: 1px solid #cad9e7; background: var(--accent-soft); border-radius: .7rem; padding: .7rem; font-size: .8rem; }
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .5rem; margin: 1rem 0; }
.fact { border: 1px solid var(--line); border-radius: .7rem; padding: .62rem; min-width: 0; }
.fact .label { display: block; color: var(--muted); font-size: .68rem; margin-bottom: .22rem; text-transform: capitalize; }
.state { font-weight: 800; font-size: .82rem; display: block; overflow-wrap: anywhere; }
.state.yes { color: var(--yes); } .state.no { color: var(--no); } .state.unknown { color: var(--unknown); } .state.unrecorded { color: #8a93a0; } .state.na { color: #7b6b53; }
.fact-confidence, .compare-confidence { display: block; color: var(--muted); font-size: .64rem; margin-top: .22rem; }
.inline-confidence { display: inline-block; margin-left: .35rem; border-radius: 999px; background: var(--unknown-soft); color: var(--muted); padding: .12rem .35rem; font-size: .66rem; }
.pilot-box { margin-top: 1rem; border: 1px solid #eadb9d; background: #fffaf0; border-radius: .8rem; padding: .9rem; }
.pilot-box h3 { margin-top: 0; }
.pilot-box dl { margin-bottom: 0; }
.pilot-box dt { font-weight: 800; font-size: .76rem; margin-top: .65rem; }
.pilot-box dd { margin: .15rem 0 0; color: #4a4f55; line-height: 1.45; font-size: .82rem; }
.compare-table-wrap { overflow: auto; }
.compare-table { border-collapse: collapse; width: 100%; min-width: 780px; font-size: .78rem; }
.compare-table th, .compare-table td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; text-align: left; vertical-align: top; }
.compare-table thead th { position: sticky; top: 0; background: white; z-index: 1; }
.compare-table thead small { display: block; color: var(--muted); font-weight: 500; margin-top: .15rem; }
.compare-table tbody th { width: 170px; color: var(--muted); font-weight: 700; }
.compare-note { background: var(--accent-soft); border-radius: .7rem; padding: .7rem; margin: .7rem 0 1rem; font-size: .8rem; }
.coverage-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); gap: .55rem; margin-top: 1rem; }
.coverage-card { border: 1px solid var(--line); border-radius: .7rem; padding: .65rem; }
.coverage-card span { color: var(--muted); font-size: .7rem; }
.coverage-card strong { display: block; font-size: .98rem; margin-top: .1rem; }

@media (max-width: 1050px) {
  .selected-intent { align-items: flex-start; flex-direction: column; }
  .collection-stats { min-width: 0; width: 100%; }
  .browse-layout { grid-template-columns: 285px minmax(0,1fr); }
}
@media (max-width: 840px) {
  .topbar { position: static; padding: 1rem; }
  .landing-view { width: min(100% - 1.5rem, 1260px); padding-top: 2rem; }
  .collection-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-controls { width: 100%; flex-wrap: wrap; }
  .toolbar-controls label { flex: 1; min-width: 180px; }
  .toolbar-controls select { flex: 1; }
  .browse-header { padding: 1rem; }
  .browse-layout { grid-template-columns: 1fr; }
  .filters { border-right: 0; border-bottom: 1px solid var(--line); }
  .sticky-panel { position: static; max-height: none; }
  .content { padding: 1rem; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; }
  .hero h2 { font-size: 2.25rem; }
  .collection-grid { grid-template-columns: 1fr; }
  .collection-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .check-list.two-col { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .result-header { align-items: flex-start; flex-direction: column; }
  .result-header .sort-control { width: 100%; }
  .result-header select { flex: 1; }
  .fact-grid { grid-template-columns: 1fr; }
  .card-evidence { flex-direction: column; }
}


/* v0.15 scalable comparison */
.compare-dialog { width: min(1240px, calc(100vw - 1.5rem)); }
.compare-toolbar { display: flex; gap: .8rem; align-items: flex-start; justify-content: space-between; margin: .7rem 0 1rem; }
.compare-toolbar .compare-note { margin: 0; flex: 1; }
.compare-table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.compare-table thead th:first-child, .compare-table tbody th { position: sticky; left: 0; background: white; z-index: 2; box-shadow: 1px 0 0 var(--line); }
.compare-table thead th:first-child { z-index: 4; }
.compare-table thead th:not(:first-child) { min-width: 190px; }
.compare-table.compact thead th:not(:first-child), .compare-table.compact td { min-width: 145px; max-width: 175px; }
.compare-resource-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .45rem; }
.compare-resource-heading > span { min-width: 0; overflow-wrap: anywhere; }
.compare-remove { flex: 0 0 auto; width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 1px solid var(--line); background: white; color: var(--muted); cursor: pointer; line-height: 1; }
.compare-remove:hover { color: var(--no); border-color: #e2b8b8; }
@media (max-width: 560px) { .compare-toolbar { flex-direction: column; } .compare-toolbar .button { width: 100%; } }


/* v0.16 non-exclusive layer-2 quick refinements */
.subtype-bar { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .85rem; }
.subtype-heading { display: flex; gap: .55rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .55rem; }
.subtype-heading strong { font-size: .9rem; }
.subtype-heading span { color: var(--muted); font-size: .76rem; }
.subtype-chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.subtype-chip { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 999px; padding: .42rem .68rem; cursor: pointer; font: inherit; font-size: .78rem; }
.subtype-chip span { color: var(--muted); margin-left: .25rem; }
.subtype-chip:hover { border-color: #9bb6ce; background: var(--accent-soft); }
.subtype-chip.active { background: var(--accent); border-color: var(--accent); color: white; }
.subtype-chip.active span { color: rgba(255,255,255,.82); }

/* Site foundation 0.1.0 */
.site-footer {
  width: min(100% - 2rem, 1260px);
  margin: 1.25rem auto 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
@media (max-width: 560px) {
  .site-footer { flex-direction: column; }
}


/* 0.1.1 launch-readiness accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .collection-card:hover { transform: none; }
}

/* RankResources 0.1.5 UI polish START */
.rr-help-target {
  cursor: help;
}

.rr-help-target:hover,
.rr-help-target:focus-visible {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.rr-context-tooltip {
  position: fixed;
  z-index: 1000;
  width: max-content;
  max-width: min(340px, calc(100vw - 20px));
  padding: 8px 10px;
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre-line;
  box-shadow: 0 6px 20px rgba(18, 30, 52, 0.18);
  pointer-events: none;
}

.rr-context-tooltip[hidden] {
  display: none;
}


.rr-refine-filter-block {
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line, #d8dee9);
}

.rr-refine-filter-block button {
  margin: 3px 4px 3px 0;
}

.rr-close-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.rr-close-glyph {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}
/* RankResources 0.1.5 UI polish END */
