:root {
  --bg: #0b1020;
  --bg-elev: #121a2f;
  --bg-card: #151e36;
  --border: rgba(148, 163, 184, 0.18);
  --text: #f1f5fb;
  --text-body: #e8eef8;
  --text-muted: #a8b4c8;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.15);
  --loc: #34d399;
  --loc-bg: rgba(52, 211, 153, 0.12);
  --why: #fbbf24;
  --why-bg: rgba(251, 191, 36, 0.1);
  --line: #2a3655;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Devanagari", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 72px;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --text-body: #1e293b;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --loc: #059669;
  --loc-bg: rgba(5, 150, 105, 0.1);
  --why: #b45309;
  --why-bg: rgba(180, 83, 9, 0.08);
  --line: #dbe3f0;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(91, 140, 255, 0.22), transparent 60%),
    radial-gradient(700px 360px at 90% 0%, rgba(52, 211, 153, 0.12), transparent 55%);
  z-index: 0;
}
[data-theme="light"] .bg-glow {
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(37, 99, 235, 0.12), transparent 60%),
    radial-gradient(700px 360px at 90% 0%, rgba(5, 150, 105, 0.08), transparent 55%);
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--loc));
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
}
.brand h1 {
  margin: 0;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tagline {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.updated {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.theme-btn {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn:disabled { opacity: 0.55; cursor: wait; }

.refresh-btn .refresh-icon {
  display: inline-block;
  line-height: 1;
  transition: transform 0.35s ease;
}
.refresh-btn.is-loading .refresh-icon {
  animation: refresh-spin 0.8s linear infinite;
}
@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

.auto-refresh-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.refresh-option[aria-checked="true"] .auto-refresh-dot {
  background: var(--loc);
  box-shadow: 0 0 0 3px var(--loc-bg);
}

.toolbar {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem 0 0.5rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  font-weight: 600;
}

/* Time filter: segmented pill groups (range + digest slot) */
.time-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-width: 0; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--border); background: var(--bg-elev);
  border-radius: 999px; max-width: 100%;
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 0.82rem;
  padding: 0.28rem 0.75rem; border-radius: 999px; cursor: pointer;
  white-space: nowrap; flex: none; transition: 0.15s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.range-custom { display: inline-flex; align-items: center; gap: 0.4rem; }
.range-custom[hidden] { display: none; }
.range-custom input {
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  border-radius: 999px; padding: 0.3rem 0.7rem; font: inherit; font-size: 0.82rem;
  color-scheme: dark; outline: none;
}
.range-custom input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.range-sep { color: var(--text-muted); }
[data-theme="light"] .range-custom input { color-scheme: light; }
@media (max-width: 600px) {
  .time-filter { flex-wrap: nowrap; flex-direction: column; align-items: stretch; }
  .seg { align-self: flex-start; }
  .range-custom input { flex: 1; min-width: 0; }
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font: inherit;
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-wrap input::placeholder { color: var(--text-muted); }

.status {
  min-height: 1.25rem;
  margin: 0.25rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Top map band retired — per-card mini maps on all viewports */
.map-band, .map-hint { display: none !important; }
.map { display: none; }
.list {
  max-width: 1100px;
  margin-inline: auto;
  padding-bottom: 2.5rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  --rail-x: 12px; /* shared center for line + dots */
}
@media (min-width: 640px) {
  .timeline { --rail-x: 16px; }
}
.timeline::before {
  content: "";
  position: absolute;
  left: var(--rail-x);
  top: 0.5rem;
  bottom: 1rem;
  width: 2px;
  transform: translateX(-50%);
  background: var(--line);
}

.item {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 1.15rem;
  scroll-margin-top: calc(var(--header-h) + var(--filter-h, 0px) + 1.5rem);
}
@media (min-width: 640px) {
  .item { padding-left: 2.75rem; }
}

.item::before {
  content: "";
  position: absolute;
  left: var(--rail-x);
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  z-index: 1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.item.active::before {
  border-color: var(--loc);
  box-shadow: 0 0 0 5px var(--loc-bg);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  transform: translateY(-1px);
}
.item.active .card {
  border-color: color-mix(in srgb, var(--loc) 55%, var(--border));
  box-shadow: 0 0 0 2px var(--loc-bg), var(--shadow);
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}
.loc {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--loc-bg);
  color: var(--loc);
  border-radius: 8px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.time {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.source {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

.card h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.05rem, 2.4vw, 1.18rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: 0.01em;
}
.card h2 a {
  color: inherit;
  text-decoration: none;
}
.card h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary {
  margin: 0;
  max-width: 46em;
  color: var(--text-body);
  font-size: 1.02rem;
  line-height: 1.78;
  letter-spacing: 0.01em;
  font-weight: 400;
}
/* CJK body needs a bit more tracking + leading */
:lang(zh) .summary,
:lang(ja) .summary,
:lang(ko) .summary,
html[lang="zh-CN"] .summary,
html[lang="ja-JP"] .summary,
html[lang="ko-KR"] .summary {
  line-height: 1.85;
  letter-spacing: 0.04em;
}

.why {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--why-bg);
  border-left: 3px solid var(--why);
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
  max-width: 46em;
}
.why strong {
  color: var(--why);
  font-weight: 700;
  margin-right: 0.3rem;
}
:lang(zh) .why,
:lang(ja) .why,
:lang(ko) .why,
html[lang="zh-CN"] .why,
html[lang="ja-JP"] .why,
html[lang="ko-KR"] .why {
  line-height: 1.8;
  letter-spacing: 0.03em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.85rem;
}
.tag {
  font-size: 0.78rem;
  color: color-mix(in srgb, var(--text-body) 82%, var(--text-muted));
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

/* Leaflet */
.leaflet-container {
  font-family: var(--font);
  background: var(--bg-elev);
}
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--bg-card); }
.leaflet-popup-content {
  margin: 0.85rem 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}
.leaflet-popup-content .popup-loc {
  display: inline-block;
  background: var(--loc-bg);
  color: var(--loc);
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.leaflet-popup-content .popup-title {
  font-weight: 650;
  font-size: 0.95rem;
  margin: 0 0 0.45rem;
  line-height: 1.35;
}
.leaflet-popup-content .popup-title a {
  color: inherit;
  text-decoration: none;
}
.leaflet-popup-content .popup-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.leaflet-popup-content .popup-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.leaflet-popup-content .popup-link {
  display: inline-block;
  margin-top: 0.55rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.leaflet-popup-content .popup-link:hover { text-decoration: underline; }
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--bg-card) 88%, transparent) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }

.hotspot-marker { background: transparent; border: none; }
.hotspot-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 2px 8px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.hotspot-marker.active .hotspot-pin {
  background: var(--loc);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--loc-bg), 0 2px 10px rgba(0,0,0,0.4);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0.25rem 0; }
.site-footer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
}
.muted { opacity: 0.85; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

@media (max-width: 640px) {
  .header-inner { align-items: flex-start; }
  .map { height: 240px; }
}

/* Card layout: text + mini map (all viewports) */
.card-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.card-text {
  min-width: 0;
  padding-inline-end: 0.15rem;
}
.card-map {
  display: block;
  height: 140px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #aad3df;
  z-index: 0;
  flex: none;
}
.card-map .leaflet-control-attribution { font-size: 9px !important; padding: 0 4px; }

/* Mobile: sticky filters that can collapse into a FAB */
@media (max-width: 900px) {
  .filter-sticky {
    position: sticky;
    top: var(--header-h);
    z-index: 1050;
    background: var(--bg);
    margin-inline: -0.5rem;
    padding: 0 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
    max-height: min(70vh, calc(100dvh - var(--header-h) - 1rem));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.18s ease, border-color 0.18s ease, margin 0.18s ease;
  }
  .filter-sticky .status { margin: 0.1rem 0 0; padding-bottom: 0.55rem; }
  .filter-sticky.is-collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom-color: transparent;
    pointer-events: none;
    overflow: hidden;
  }
  .item { scroll-margin-top: calc(var(--header-h) + 1rem); }
  body.filters-collapsed .item { scroll-margin-top: calc(var(--header-h) + 0.75rem); }
}

.filter-fab {
  position: fixed;
  inset-inline-end: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 1100;
  display: none;
  align-items: center;
  gap: 0.4rem;
  height: 2.75rem;
  padding: 0 1rem 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow), 0 8px 24px rgba(0,0,0,0.28);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-fab:hover { border-color: var(--accent); color: var(--accent); }
.filter-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) {
  .filter-fab:not([hidden]) { display: inline-flex; }
}

@media (min-width: 901px) {
  .filter-sticky {
    position: sticky;
    top: var(--header-h);
    z-index: 1050;
    background: var(--bg);
    margin-inline: -1rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.9rem;
  }
  .filter-sticky .status { margin: 0.1rem 0 0; padding-bottom: 0.55rem; }
  .item { scroll-margin-top: calc(var(--header-h) + var(--filter-h, 150px) + 1rem); }
  .card-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.35rem;
    align-items: stretch;
  }
  .card-text { padding-inline-end: 0.35rem; }
  .card-map {
    height: auto;
    min-height: 200px;
  }
  .filter-fab { display: none !important; }
}

/* Custom language picker */
.lang-picker {
  position: relative;
  z-index: 1200;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  height: 2.25rem;
  padding: 0 0.75rem 0 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lang-btn:hover,
.lang-btn:focus-visible,
.lang-picker.open .lang-btn {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lang-btn-chevron {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.lang-picker.open .lang-btn-chevron { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  inset-inline-end: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  min-width: 10.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 1300;
}
.lang-menu[hidden] { display: none; }
.lang-option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: start;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}
.lang-option:hover,
.lang-option:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}
.lang-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

html[lang="hi-IN"] body { font-family: "Noto Sans Devanagari", "Noto Sans SC", system-ui, sans-serif; line-height: 1.75; }
html[lang="ja-JP"] body { font-family: "Noto Sans JP", "Noto Sans SC", system-ui, sans-serif; line-height: 1.75; }
html[lang="ko-KR"] body { font-family: "Noto Sans KR", "Noto Sans SC", system-ui, sans-serif; line-height: 1.75; }
html[lang="ar"] body { font-family: "Noto Sans Arabic", "Noto Sans SC", system-ui, sans-serif; line-height: 1.8; }

/* RTL mirroring */
[dir="rtl"] .timeline::before {
  left: auto;
  right: var(--rail-x);
  transform: translateX(50%);
}
[dir="rtl"] .item { padding-left: 0; padding-right: 2.25rem; }
[dir="rtl"] .item::before {
  left: auto;
  right: var(--rail-x);
  transform: translate(50%, -50%);
}
[dir="rtl"] .source { margin-left: 0; margin-right: auto; }
[dir="rtl"] .why { border-left: 0; border-right: 3px solid var(--why); border-radius: 10px 0 0 10px; }
[dir="rtl"] .leaflet-container { direction: ltr; }
[dir="rtl"] .leaflet-popup-content { direction: rtl; text-align: right; }
@media (min-width: 640px) {
  [dir="rtl"] .item { padding-right: 2.75rem; }
}

@media (max-width: 640px) {
  .header-meta { flex-wrap: wrap; gap: 0.4rem; }
  .updated { font-size: 0.72rem; white-space: normal; }
  .lang-btn { max-width: 7.5rem; padding-inline: 0.65rem; }
  .lang-btn-label { overflow: hidden; text-overflow: ellipsis; }
}

/* Refresh control: icon pill + chevron, popover with switch */
.refresh-ctl {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 999px;
  z-index: 1200;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.refresh-ctl:hover, .refresh-ctl.open { border-color: var(--accent); }
.refresh-ctl.open { box-shadow: 0 0 0 3px var(--accent-soft); }
.refresh-main, .refresh-caret {
  border: 0; background: transparent; color: var(--text);
  height: 100%; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.refresh-main { width: 2.15rem; border-radius: 999px; padding-inline-start: 0.1rem; }
.refresh-caret { width: 1.35rem; color: var(--text-muted); border-radius: 999px; padding-inline-end: 0.25rem; margin-inline-start: -0.2rem; }
.refresh-main:hover, .refresh-caret:hover { color: var(--accent); }
.refresh-main:focus-visible, .refresh-caret:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.refresh-main:disabled { cursor: wait; }
.refresh-main.is-loading .refresh-icon { animation: refresh-spin 0.8s linear infinite; color: var(--accent); }
.refresh-caret svg { transition: transform 0.15s ease; }
.refresh-ctl.open .refresh-caret svg { transform: rotate(180deg); }
.refresh-icon { transition: color 0.15s ease; }
.refresh-ctl.auto-on .refresh-main .refresh-icon { color: var(--loc); }
.refresh-pop {
  position: absolute; top: calc(100% + 0.45rem); inset-inline-end: 0;
  min-width: 13rem; padding: 0.7rem 0.8rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); z-index: 1300;
}
.refresh-pop[hidden] { display: none; }
.refresh-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.refresh-row-text { display: grid; line-height: 1.3; }
.auto-refresh-label { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.auto-refresh-hint { font-size: 0.75rem; color: var(--text-muted); }
.switch {
  position: relative; flex-shrink: 0; width: 2.4rem; height: 1.4rem;
  border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text-muted) 30%, var(--bg-elev));
  cursor: pointer; padding: 0; transition: background 0.18s ease, border-color 0.18s ease;
}
.switch-knob {
  position: absolute; top: 50%; inset-inline-start: 0.15rem;
  width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3); transform: translateY(-50%);
  transition: inset-inline-start 0.18s ease;
}
.switch[aria-checked="true"] { background: var(--loc); border-color: transparent; }
.switch[aria-checked="true"] .switch-knob { inset-inline-start: calc(100% - 1.2rem); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
