:root { color-scheme: dark; --bg:#0b0b0a; --surface:#161513; --line:#38332a; --text:#f4f0e7; --muted:#aaa196; --gold:#cba24a; --teal:#56b6a4; --error:#d87868; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
button { font: inherit; cursor: pointer; }
.wrap { width: min(1120px, calc(100% - 48px)); margin: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #100f0d; }
.topbar-inner { width: min(1180px, calc(100% - 48px)); min-height: 100px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-block: 18px; }
.brand { display: inline-block; position: relative; padding-bottom: 8px; color: var(--text); font-size: 28px; font-weight: 700; text-decoration: none; }
.brand::after { content:""; position:absolute; left:0; bottom:0; width:38px; height:3px; background:var(--gold); }
.brand-credit { margin: 5px 0 0; color: var(--gold); font-size: 10px; font-weight: 700; }
.subpage-actions { margin-top: 7px; }
[hidden] { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.top50-state { min-height: 65vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.top50-state > span { width: 40px; height: 40px; border: 1px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
.top50-state > p { margin: 18px 0 0; color: var(--muted); }
.top50-state h1 { margin: 0 0 9px; font-size: 36px; }
.top50-state button { min-height: 40px; margin-top: 18px; border: 1px solid var(--gold); border-radius: 5px; background: #2b2212; color: var(--text); padding: 0 16px; }
.top50-hero { padding: 70px 0 52px; border-bottom: 1px solid var(--line); }
.top50-hero h1 { margin: 0 0 18px; font-family: Georgia, "Songti SC", serif; font-size: 52px; line-height: 1.15; }
.top50-hero p:last-child { max-width: 680px; margin: 0; color: #c8c0b4; font-size: 16px; line-height: 1.75; }
.sorting-notice { border-bottom: 1px solid #665631; background: #211b10; }
.sorting-notice-inner { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(340px, 1.1fr); align-items: center; gap: 45px; min-height: 132px; }
.sorting-notice-inner > div { border-left: 4px solid var(--gold); padding-left: 20px; }
.sorting-notice span { display: block; margin-bottom: 8px; color: var(--gold); font-size: 10px; font-weight: 800; }
.sorting-notice strong { display: block; color: #f2dfb4; font-family: Georgia, "Songti SC", serif; font-size: 28px; }
.sorting-notice p { margin: 0; color: #d0c4aa; font-size: 14px; line-height: 1.75; }
.top50-map-section { padding-top: 58px; }
.top50-map-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.top50-map-heading h2 { margin: 0; font-size: 27px; }
.top50-map-heading > p { margin: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.district-filters { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 14px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.district-filters button { min-height: 39px; flex: none; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 0 13px; font-size: 12px; }
.district-filters button span { margin-left: 4px; color: #6f6960; font-size: 9px; }
.district-filters button:hover { color: var(--text); }
.district-filters button.is-active { border-bottom-color: var(--gold); color: var(--gold); font-weight: 800; }
.top50-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; min-height: 510px; border: 1px solid var(--line); background: var(--surface); }
.map-frame { position: relative; min-width: 0; min-height: 510px; border-right: 1px solid var(--line); background: #11110f; }
#top50-map { position: absolute; inset: 0; }
.map-state { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: #11110f; color: var(--muted); font-size: 12px; }
.map-locate { position: absolute; z-index: 2; top: 14px; right: 14px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #6b5934; border-radius: 4px; background: #161513; padding: 0; box-shadow: 0 2px 9px #0008; transition: border-color .15s,background .15s; }
.map-locate:hover { border-color: var(--gold); background: #241d10; }
.map-locate:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.map-locate:disabled { cursor: wait; opacity: .65; }
.map-locate span { position: relative; width: 15px; height: 15px; border: 2px solid var(--gold); border-radius: 50%; }
.map-locate span::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--gold); }
.map-locate span::after { content: ""; position: absolute; inset: -5px 5px; border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
.map-locate.is-located { border-color: #39796e; background: #11231f; }
.map-locate.is-located span { border-color: var(--teal); }
.map-locate.is-located span::before { background: var(--teal); }
.map-locate.is-located span::after { border-color: var(--teal); }
.map-location-message { position: absolute; z-index: 2; top: 14px; right: 62px; max-width: min(260px, calc(100% - 82px)); min-height: 38px; display: flex; align-items: center; margin: 0; border-radius: 4px; background: #161513e8; color: #d8d1c6; padding: 8px 11px; box-shadow: 0 2px 8px #0005; font-size: 11px; line-height: 1.4; }
.user-location-marker { width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 2px 9px #0008; }
.map-detail { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 25px 24px 22px; }
.map-detail-heading { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.map-detail-heading span { color: var(--gold); font-size: 10px; font-weight: 800; }
.map-detail-heading h3 { margin: 8px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.map-detail-body { align-self: start; }
.rank-detail { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.rank-detail > span, .location-detail > span { color: #817a70; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.rank-detail-value { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 10px; }
.rank-detail-value b { color: #f2dfb4; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.rank-detail-value small { color: var(--gold); font-size: 10px; font-variant-numeric: tabular-nums; }
.score-detail { padding: 17px 0 18px; border-bottom: 1px solid var(--line); }
.score-detail > span { color: #817a70; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.score-detail dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; row-gap: 10px; margin: 12px 0 0; }
.score-detail dl > div { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.score-detail dt { min-width: 0; color: #918a80; font-size: 10px; }
.score-detail dd { margin: 0; color: #ddd6ca; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.location-detail { padding-top: 17px; }
.location-detail p { margin: 8px 0 11px; color: #d0c8bc; font-size: 13px; line-height: 1.7; }
.location-detail small, .map-detail-empty { color: #817a70; font-size: 10px; }
.map-detail-empty { align-self: start; margin: 20px 0 0; }
.map-detail > a { align-self: end; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); padding-top: 16px; font-size: 11px; text-decoration: none; }
.map-detail > a:hover { color: var(--gold); }
.bar-marker { position: relative; width: 15px; height: 15px; display: block; overflow: visible; border: 2px solid #181713; border-radius: 50%; background: var(--gold); padding: 0; box-shadow: 0 2px 8px #0009; transition: width .15s,height .15s,background .15s,box-shadow .15s; }
.bar-marker:hover, .bar-marker.is-selected { width: 23px; height: 23px; border-width: 4px; background: var(--teal); box-shadow: 0 0 0 4px #56b6a430,0 3px 12px #000b; }
.bar-marker::after { content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 10px); width: max-content; max-width: 220px; visibility: hidden; border: 1px solid #6b5934; border-radius: 3px; background: #161513f2; color: #f2dfb4; padding: 7px 9px; box-shadow: 0 3px 12px #0009; font-size: 11px; font-weight: 700; line-height: 1.35; opacity: 0; overflow-wrap: anywhere; pointer-events: none; transform: translateX(-50%) translateY(3px); transition: opacity .08s,transform .08s,visibility 0s linear .08s; }
.bar-marker:hover::after, .bar-marker:focus-visible::after { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); transition-delay: 0s; }
.mobile-view-switch { display: none; }
.top50-list-section { padding: 58px 0 80px; }
.top50-list-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.top50-list-heading h2 { margin: 0; font-size: 27px; }
.top50-list-heading small { color: #756f66; font-size: 10px; }
.top50-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin: 0; border-top: 1px solid var(--line); padding: 0; list-style: none; }
.top50-list li { min-width: 0; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); color: #ddd6ca; padding: 14px 22px; line-height: 1.45; overflow-wrap: anywhere; cursor: pointer; outline: 0; transition: background .15s,color .15s; }
.top50-list li:nth-child(even) { border-left: 1px solid var(--line); padding-right: 22px; padding-left: 28px; }
.top50-list li:hover, .top50-list li.is-selected { background: #181611; color: var(--gold); }
.top50-list li:focus-visible { outline: 1px solid var(--gold); outline-offset: -2px; }
.top50-bar-main { min-width: 0; display: flex; align-items: center; gap: 14px; }
.top50-bar-rank { width: 24px; flex: none; color: var(--gold); font-size: 12px; font-variant-numeric: tabular-nums; }
.top50-bar-name { min-width: 0; font-family: Georgia, "Songti SC", serif; font-size: 17px; }
.top50-bar-meta { flex: none; display: grid; justify-items: end; gap: 4px; }
.top50-bar-district { color: var(--muted); font-size: 12px; font-weight: 700; }
.top50-bar-district.is-unmaintained { color: #756f66; font-weight: 500; }
.location-status { color: var(--teal); font-size: 9px; }
.location-status.is-pending { color: #756f66; }
.top50-list-empty { grid-column: 1 / -1; min-height: 120px !important; justify-content: center; color: var(--muted) !important; font-family: inherit !important; font-size: 13px !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; } }
@media (max-width: 720px) {
  .wrap { width: min(100% - 32px, 600px); }
  .topbar-inner { width: min(100% - 32px, 600px); min-height: 0; flex-direction: column; gap: 14px; padding-block: 16px; }
  .subpage-actions { margin-top: 0; }
  .top50-hero { padding: 48px 0 38px; }
  .top50-hero h1 { font-size: 38px; }
  .sorting-notice-inner { grid-template-columns: 1fr; gap: 18px; padding-block: 28px; }
  .sorting-notice strong { font-size: 23px; }
  .mobile-view-switch { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 28px; border: 1px solid var(--line); }
  .mobile-view-switch button { min-height: 42px; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--muted); }
  .mobile-view-switch button:last-child { border-right: 0; }
  .mobile-view-switch button.is-active { background: #241d10; color: var(--gold); font-weight: 800; }
  .top50-map-section { padding-top: 26px; }
  .top50-map-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .top50-map-layout { grid-template-columns: 1fr; min-height: 0; }
  .map-frame { min-height: 410px; border-right: 0; border-bottom: 1px solid var(--line); }
  .map-detail { min-height: 225px; }
  body:not([data-mobile-view="list"]) [data-view-panel="list"] { display: none; }
  body[data-mobile-view="list"] [data-view-panel="map"] { display: none; }
  body[data-mobile-view="list"] [data-view-panel="list"] { display: block; padding-top: 30px; }
  .top50-list-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .top50-list { grid-template-columns: 1fr; }
  .top50-list li { padding-right: 0; padding-left: 0; }
  .top50-list li:nth-child(even) { border-left: 0; padding-right: 0; padding-left: 0; }
}
