:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --ink: #172126;
  --muted: #657179;
  --line: #d9e0e4;
  --brand: #9b1c31;
  --brand-dark: #6e1020;
  --accent: #175f72;
  --shadow: 0 14px 34px rgba(28, 42, 48, .09);
  --radius: 18px;
  --radius-sm: 10px;
  --max: 1240px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--accent); }
img, canvas { max-width: 100%; display: block; }
button, input, select { font: inherit; }
.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 100; background: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand strong { display: block; letter-spacing: .08em; font-size: .95rem; }
.brand small { display: block; color: var(--muted); font-size: .72rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--brand); display: grid; place-items: center; position: relative; overflow: hidden; }
.brand-mark span { position: absolute; border: 1px solid var(--brand); border-radius: 50%; }
.brand-mark span:nth-child(1) { width: 8px; height: 8px; background: var(--brand); }
.brand-mark span:nth-child(2) { width: 18px; height: 18px; }
.brand-mark span:nth-child(3) { width: 28px; height: 28px; }
.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav a { text-decoration: none; color: #435057; padding: 9px 10px; border-radius: 8px; font-size: .92rem; }
.primary-nav a:hover, .primary-nav a.active { color: var(--brand-dark); background: #f8ebee; }
.primary-nav .nav-github { margin-left: 5px; border: 1px solid var(--line); }
.nav-toggle { display: none; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; }
.hero { background: linear-gradient(135deg, #ffffff 0%, #f3f6f7 62%, #e9eff1 100%); border-bottom: 1px solid var(--line); }
.hero-grid { min-height: 470px; display: grid; grid-template-columns: 1.18fr .82fr; align-items: center; gap: 70px; padding-block: 76px; }
.eyebrow { margin: 0 0 10px; color: var(--brand); text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 750; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.025em; }
h1 { font-size: clamp(2.8rem, 6vw, 5.6rem); margin: 0; max-width: 850px; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); margin: 0 0 14px; }
h3 { font-size: 1.18rem; margin: 0 0 8px; }
.lede { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: #4f5d64; max-width: 760px; margin: 22px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 11px 15px; text-decoration: none; font-weight: 700; cursor: pointer; }
.btn-primary { color: #fff; background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.stat-board { background: #182329; color: #fff; border-radius: 26px; padding: 24px; box-shadow: var(--shadow); }
.stat-board .radar-rings { min-height: 210px; border-radius: 16px; position: relative; overflow: hidden; background: radial-gradient(circle at 48% 53%, rgba(255,255,255,.9) 0 2px, transparent 3px), repeating-radial-gradient(circle at 48% 53%, transparent 0 28px, rgba(255,255,255,.12) 29px 30px), linear-gradient(155deg,#234f5a,#182329 70%); }
.stat-board .radar-rings:after { content:""; position:absolute; left:48%; top:53%; width:45%; height:1px; transform-origin:left center; transform:rotate(-28deg); background:linear-gradient(90deg,rgba(255,255,255,.7), transparent); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.stat-row strong { display: block; font-size: 1.3rem; }
.stat-row span { color: #bdc9ce; font-size: .8rem; }
.section { padding-block: 72px; }
.section-tight { padding-block: 42px; }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 26px; }
.section-head p { max-width: 680px; color: var(--muted); margin: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 4px 18px rgba(29,42,48,.035); }
.card p { color: var(--muted); margin: 8px 0 16px; }
.card-link { text-decoration: none; font-weight: 700; }
.kicker-number { font-size: .74rem; color: var(--brand); font-weight: 800; letter-spacing: .12em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 18px rgba(29,42,48,.04); }
.page-hero { padding-block: 52px 36px; background: #fff; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 4.3rem); }
.page-hero .lede { margin-top: 12px; }
.notice { border: 1px solid #e6c9cf; background: #fff5f6; color: #5e2932; padding: 14px 16px; border-radius: 11px; }
.notice code { color: #4d1821; }
.prose { max-width: 850px; }
.prose p, .prose li { color: #4f5d64; }
.prose h2 { margin-top: 44px; font-size: 1.8rem; }
.prose h3 { margin-top: 30px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th, .data-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 14px; vertical-align: top; }
.data-table th { font-size: .77rem; text-transform: uppercase; letter-spacing: .06em; color: #68757b; background: #f8fafb; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.code { padding: 12px 14px; background: #152025; color: #e8eef0; border-radius: 9px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.meta-box { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 15px; }
.meta-box span { display:block; color:var(--muted); font-size:.76rem; text-transform:uppercase; letter-spacing:.05em; }
.meta-box strong { display:block; font-size:1.2rem; margin-top:4px; }
.site-footer { margin-top: 70px; background: #172126; color: #dce4e7; padding-block: 42px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer-grid p { color: #9fb0b7; max-width: 480px; }
.footer-grid strong { display: block; color: #fff; margin-bottom: 9px; }
.footer-grid a { display:block; color:#bdc9ce; text-decoration:none; margin:6px 0; }
/* Explorer */
.explorer-shell { width: min(calc(100% - 28px), 1500px); margin: 26px auto 0; display:grid; grid-template-columns: 290px minmax(0,1fr); gap:18px; }
.filters { padding: 18px; position: sticky; top: 94px; align-self:start; max-height: calc(100vh - 112px); overflow:auto; }
.filter-group { margin-bottom: 15px; }
.filter-group label { display:block; font-size:.78rem; color:#5d686e; font-weight:700; margin-bottom:6px; }
.filter-group select, .filter-group input { width:100%; border:1px solid #cfd8dc; border-radius:9px; background:#fff; padding:9px 10px; color:var(--ink); }
.filter-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.filter-actions { display:flex; gap:8px; }
.filter-actions .btn { flex:1; padding:9px 10px; }
.explore-tag-filter { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfb; }
.explore-tag-filter summary { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; cursor: pointer; color: #445159; font-size: .78rem; font-weight: 750; }
.explore-tag-filter summary span { color: var(--muted); font-size: .72rem; font-weight: 500; white-space: nowrap; }
.explore-tag-grid { display: grid; gap: 7px; max-height: 240px; overflow-y: auto; padding: 2px 10px 11px; }
.explore-tag-grid label { display: flex; align-items: flex-start; gap: 7px; color: #48555c; font-size: .79rem; line-height: 1.3; cursor: pointer; }
.explore-tag-grid input { flex: 0 0 auto; margin: 2px 0 0; }
.subjective-filter-tags label { font-style: italic; }
.filter-subheading { margin: 18px 0 2px; color: #5d686e; font-size: .78rem; font-weight: 800; }
.exclude-tag-help { margin-top: 0; margin-bottom: 10px; }
.exclude-tag-filter { border-color: #e5c9cf; background: #fffafa; }
.exclude-tag-filter summary { color: #71303d; }
.results-panel { min-width:0; }
.explore-toolbar { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:14px 16px; border-bottom:1px solid var(--line); }
.results-status { color:var(--muted); font-size:.9rem; }
.view-switch { display:flex; gap:4px; padding:3px; background:#edf1f3; border-radius:9px; }
.view-switch button { border:0; background:transparent; padding:7px 10px; border-radius:7px; cursor:pointer; color:#536168; }
.view-switch button.active { background:#fff; color:var(--brand-dark); box-shadow:0 1px 4px rgba(0,0,0,.08); }
.results-body { padding:16px; min-height:540px; }
.event-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(205px,1fr)); gap:13px; }
.event-card { border:1px solid var(--line); border-radius:13px; background:#fff; overflow:hidden; cursor:pointer; transition:.15s transform,.15s box-shadow; }
.event-card:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(23,33,38,.09); }
.radar-frame { background:#f3f5f6; aspect-ratio:1/1; display:grid; place-items:center; overflow:hidden; }
.event-preview-image { display:block; width:auto; height:auto; max-width:100%; max-height:100%; object-fit:contain; object-position:center; image-rendering:auto; }
.preview-unavailable { color:var(--muted); font-size:.78rem; padding:16px; text-align:center; }
.event-card-info { padding:11px 12px 12px; }
.event-card-info strong { display:block; font-size:.88rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.event-card-info .sub { display:flex; justify-content:space-between; gap:8px; margin-top:5px; color:var(--muted); font-size:.78rem; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding:3px 7px; font-size:.69rem; font-weight:750; background:#edf2f4; color:#405058; }
.badge.tor { background:#f9e6ea; color:#812034; }
.badge.hail { background:#e6f3ef; color:#236350; }
.badge.wind { background:#e8eef8; color:#355b86; }
.pagination { display:flex; justify-content:center; align-items:center; gap:8px; padding:20px 0 6px; }
.pagination button { border:1px solid var(--line); background:#fff; border-radius:8px; padding:7px 11px; cursor:pointer; }
.pagination button:disabled { opacity:.45; cursor:not-allowed; }
#map-view { height: 650px; border-radius:12px; overflow:hidden; }
.hidden { display:none !important; }
.empty-state { min-height:420px; display:grid; place-items:center; text-align:center; color:var(--muted); padding:30px; }
.spinner { width:34px; height:34px; border-radius:50%; border:3px solid #dce4e7; border-top-color:var(--brand); animation:spin .7s linear infinite; margin:0 auto 12px; }
@keyframes spin { to { transform:rotate(360deg); } }
.event-modal { width:min(900px,calc(100% - 28px)); border:0; border-radius:18px; padding:0; box-shadow:0 30px 80px rgba(0,0,0,.3); }
.event-modal::backdrop { background:rgba(10,17,20,.67); backdrop-filter:blur(3px); }
.modal-layout { display:grid; grid-template-columns:1.05fr .95fr; }
.modal-media-panel { min-width:0; display:flex; flex-direction:column; gap:10px; padding:12px; background:#f3f5f6; }
.modal-media-toggle { display:flex; justify-content:center; gap:6px; }
.modal-media-toggle button { border:1px solid #cbd3d8; border-radius:999px; padding:7px 11px; background:#fff; color:#3e4a51; cursor:pointer; font:inherit; font-size:.82rem; }
.modal-media-toggle button.active { border-color:var(--brand); background:var(--brand); color:#fff; }
.modal-media-toggle button:disabled { cursor:not-allowed; opacity:.45; }
.modal-image { flex:1; background:#f3f5f6; min-height:430px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.modal-preview-image { display:block; width:auto; height:auto; max-width:100%; max-height:72vh; object-fit:contain; object-position:center; }
.modal-content { padding:26px; position:relative; }
.modal-close { position:absolute; top:12px; right:12px; width:36px; height:36px; border-radius:50%; border:1px solid var(--line); background:#fff; cursor:pointer; }
.modal-content h2 { padding-right:35px; font-size:1.55rem; overflow-wrap:anywhere; }
.event-meta { margin-top:20px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.event-meta div { border-top:1px solid var(--line); padding-top:8px; }
.event-meta span { display:block; font-size:.7rem; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.event-meta strong { font-size:.9rem; }
.event-table-row { cursor:pointer; }
.event-table-row:hover { background:#f8fafb; }
.popup-open-button { margin-top:6px; cursor:pointer; }
.download-card { display:grid; grid-template-columns:1fr auto; gap:16px; align-items:center; padding:18px 20px; border-bottom:1px solid var(--line); }
.download-card:last-child { border-bottom:0; }
.download-card p { margin:4px 0 0; color:var(--muted); font-size:.88rem; }
.class-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.class-card { background:#fff; border:1px solid var(--line); border-radius:13px; padding:18px; }
.class-card code { display:inline-block; color:var(--brand); margin-bottom:7px; }
.tutorial-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.tutorial-step { position:relative; padding:24px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.tutorial-step > span { display:grid; place-items:center; width:32px; height:32px; margin-bottom:14px; border-radius:50%; background:var(--brand); color:#fff; font-weight:800; }
.tutorial-step p, .tutorial-panel p, .tutorial-panel li { color:var(--muted); }
.tutorial-panel { padding:24px; }
.tutorial-panel h2 { font-size:1.65rem; }
.tutorial-label-list { display:grid; gap:8px; padding-left:0; list-style:none; }
.tutorial-label-list li { display:flex; align-items:center; gap:9px; }
.tutorial-tag-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:16px; }
.tutorial-tag-list span { padding:5px 8px; border-radius:999px; background:#edf2f4; color:#405058; font-size:.78rem; }
.subjective-tutorial-tags span { font-style:italic; }
@media (max-width: 950px) {
  .primary-nav { display:none; position:absolute; top:68px; right:20px; flex-direction:column; align-items:stretch; background:#fff; border:1px solid var(--line); border-radius:12px; padding:8px; box-shadow:var(--shadow); min-width:220px; }
  .primary-nav.open { display:flex; }
  .nav-toggle { display:block; }
  .hero-grid, .split { grid-template-columns:1fr; gap:35px; }
  .hero-grid { padding-block:50px; }
  .cards { grid-template-columns:1fr; }
  .meta-grid { grid-template-columns:1fr 1fr; }
  .explorer-shell { grid-template-columns:1fr; }
  .filters { position:static; max-height:none; }
  .modal-layout { grid-template-columns:1fr; }
  .modal-image { min-height:320px; }
  .class-grid { grid-template-columns:1fr 1fr; }
  .tutorial-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 620px) {
  .shell { width:min(calc(100% - 26px),var(--max)); }
  .hero-grid { padding-block:38px; }
  .stat-row { grid-template-columns:1fr; }
  .meta-grid, .class-grid { grid-template-columns:1fr; }
  .tutorial-grid { grid-template-columns:1fr; }
  .footer-grid { grid-template-columns:1fr; }
  .explorer-shell { width:min(calc(100% - 14px),1500px); }
  .explore-toolbar { align-items:flex-start; flex-direction:column; }
  .event-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .event-card-info .sub { display:block; }
}
.notice-error { border-color:#c84a4a; background:#fff4f4; }

/* SVRIMG2 v1.3 map behavior */
.map-wrap { position: relative; }
.map-status {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafb;
  color: var(--muted);
  font-size: .84rem;
}
.map-popup-note { color: #68757b; font-size: .78rem; }

/* Version-1 locked filter controls */
.filters select:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  background-color: #f3f4f6;
}

/* Version 1.10.1: web-consensus display and filters */
.field-help {
  margin: .45rem 0 0;
  font-size: .76rem;
  line-height: 1.4;
  color: var(--muted);
}
.consensus-filter-help {
  margin-top: -7px;
  margin-bottom: 15px;
}
.web-consensus-line {
  margin-top: 7px;
}
.badge.web-consensus {
  background: #e6f3ef;
  color: #245f50;
}
.badge.web-consensus-tie {
  background: #fff1d6;
  color: #76530b;
}
.badge.web-consensus-pending {
  background: #edf1f3;
  color: #5b686e;
}
.consensus-panel {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.consensus-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}
.consensus-empty {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}
.consensus-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 13px;
}
.consensus-summary-grid > div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafb;
}
.consensus-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.consensus-summary-grid strong {
  display: block;
  margin-top: 3px;
  font-size: .86rem;
  overflow-wrap: anywhere;
}
.vote-list {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  font-size: .82rem;
  border-bottom: 1px solid var(--line);
}
.vote-row:last-child { border-bottom: 0; }
.vote-row span { color: #4f5d64; }
.vote-row strong { font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .consensus-summary-grid { grid-template-columns: 1fr; }
}

/* v1.10.2: Labels page cards are direct links into the filtered Explorer. */
.class-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 13px;
}
.class-card-link .class-card {
  height: 100%;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.class-card-link:hover .class-card,
.class-card-link:focus-visible .class-card {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: 0 8px 22px rgba(20, 36, 44, .10);
}
.class-card-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 32%, transparent);
  outline-offset: 3px;
}
.class-card-action {
  display: inline-block;
  margin-top: 10px;
  color: var(--brand);
  font-size: .82rem;
  font-weight: 700;
}
