@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  --bg: #08080c;
  --surface: #101018;
  --surface2: #17171f;
  --surface3: #1e1e28;
  --border: #262633;
  --border-bright: #3a3a4d;
  --accent: #a855f7;
  --accent-dim: #7c3aed33;
  --accent2: #f97316;
  --accent2-dim: #f9731633;
  --drop-marker: #ffb000;
  --text: #ededf5;
  --muted: #6f6f88;
  --muted-dim: #4a4a5c;
  --grid-line: #ffffff05;
  --header-bg: rgba(8, 8, 12, 0.92);
  --accent-contrast: #05050a;
  --accent-hover: #b968ff;

  accent-color: var(--accent);
  color-scheme: dark;
}

:root[data-theme="nord"] {
  --bg: #2e3440;
  --surface: #3b4252;
  --surface2: #434c5e;
  --surface3: #4c566a;
  --border: #596579;
  --border-bright: #6b7890;
  --accent: #88c0d0;
  --accent-dim: #88c0d033;
  --accent2: #d08770;
  --accent2-dim: #d0877033;
  --drop-marker: #bf616a;
  --text: #eceff4;
  --muted: #b0bacb;
  --muted-dim: #8793a8;
  --grid-line: #ffffff05;
  --header-bg: rgba(46, 52, 64, 0.94);
  --accent-contrast: #2e3440;
  --accent-hover: #a2d4e2;
}

:root[data-theme="dracula"] {
  --bg: #191a21;
  --surface: #22232c;
  --surface2: #2b2c37;
  --surface3: #383945;
  --border: #41424f;
  --border-bright: #595b6d;
  --accent: #50fa7b;
  --accent-dim: #50fa7b33;
  --accent2: #ff79c6;
  --accent2-dim: #ff79c633;
  --drop-marker: #f1fa8c;
  --text: #f8f8f2;
  --muted: #b6b6c4;
  --muted-dim: #777887;
  --grid-line: #ffffff05;
  --header-bg: rgba(25, 26, 33, 0.94);
  --accent-contrast: #191a21;
  --accent-hover: #7dffa5;
}

:root[data-theme="gruvbox"] {
  --bg: #1d2021;
  --surface: #282828;
  --surface2: #3c3836;
  --surface3: #504945;
  --border: #504945;
  --border-bright: #665c54;
  --accent: #fabd2f;
  --accent-dim: #fabd2f33;
  --accent2: #fe8019;
  --accent2-dim: #fe801933;
  --drop-marker: #83a598;
  --text: #ebdbb2;
  --muted: #bdae93;
  --muted-dim: #928374;
  --grid-line: #ffffff05;
  --header-bg: rgba(29, 32, 33, 0.94);
  --accent-contrast: #1d2021;
  --accent-hover: #ffd35a;
}

:root[data-theme="catppuccin"] {
  --bg: #1e1e2e;
  --surface: #242438;
  --surface2: #313244;
  --surface3: #45475a;
  --border: #45475a;
  --border-bright: #585b70;
  --accent: #cba6f7;
  --accent-dim: #cba6f733;
  --accent2: #fab387;
  --accent2-dim: #fab38733;
  --drop-marker: #a6e3a1;
  --text: #cdd6f4;
  --muted: #a6adc8;
  --muted-dim: #7f849c;
  --grid-line: #ffffff05;
  --header-bg: rgba(30, 30, 46, 0.94);
  --accent-contrast: #1e1e2e;
  --accent-hover: #ddc0ff;
}

:root[data-theme="tokyo-night"] {
  --bg: #16161e;
  --surface: #1f2335;
  --surface2: #24283b;
  --surface3: #2f3549;
  --border: #3b4261;
  --border-bright: #565f89;
  --accent: #7aa2f7;
  --accent-dim: #7aa2f733;
  --accent2: #ff9e64;
  --accent2-dim: #ff9e6433;
  --drop-marker: #f7768e;
  --text: #c0caf5;
  --muted: #a9b1d6;
  --muted-dim: #737aa2;
  --grid-line: #ffffff05;
  --header-bg: rgba(22, 22, 30, 0.94);
  --accent-contrast: #16161e;
  --accent-hover: #9bb7ff;
}

:root[data-theme="ayu-light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface2: #f1f2f3;
  --surface3: #e7e9eb;
  --border: #d8dadd;
  --border-bright: #b9bec4;
  --accent: #b45309;
  --accent-dim: #b4530922;
  --accent2: #d7373f;
  --accent2-dim: #d7373f22;
  --drop-marker: #345995;
  --text: #41464c;
  --muted: #707984;
  --muted-dim: #929aa3;
  --grid-line: #00000008;
  --header-bg: rgba(250, 250, 250, 0.96);
  --accent-contrast: #17191c;
  --accent-hover: #ca650c;
}

:root[data-theme="solarized-light"] {
  --bg: #fdf6e3;
  --surface: #eee8d5;
  --surface2: #e4ddc8;
  --surface3: #d6ceb9;
  --border: #d3cbb5;
  --border-bright: #b8ad92;
  --accent: #6c71c4;
  --accent-dim: #6c71c433;
  --accent2: #cb4b16;
  --accent2-dim: #cb4b1633;
  --drop-marker: #268bd2;
  --text: #073642;
  --muted: #586e75;
  --muted-dim: #839496;
  --grid-line: #002b3609;
  --header-bg: rgba(253, 246, 227, 0.96);
  --accent-contrast: #fdf6e3;
  --accent-hover: #8589d6;
}

:root[data-theme="solarized-light"],
:root[data-theme="ayu-light"] { color-scheme: light; }

* { box-sizing: border-box; }

html {
  scrollbar-color: var(--border-bright) var(--bg);
  scrollbar-width: thin;
}

body {
  margin: 0;
  background:
    linear-gradient(var(--bg), var(--bg)),
    repeating-linear-gradient(0deg, transparent, transparent 39px, var(--grid-line) 39px, var(--grid-line) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, var(--grid-line) 39px, var(--grid-line) 40px);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Open Sans", sans-serif;
  line-height: 1.55;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: "Open Sans", sans-serif; }

::selection { background: var(--accent); color: var(--accent-contrast); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shell { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.shell-wide { max-width: 1960px; }

header {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  z-index: 20;
}

header .header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  width: 100%;
  max-width: none;
  padding: 0 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.logo {
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}
.logo span { color: var(--accent); }

.crumbs {
  color: var(--muted);
  font-size: 12px;
  font-family: "Open Sans", sans-serif;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumbs a:hover { color: var(--accent); }
.crumb-sep { color: var(--muted-dim); }

.header-right { grid-column: 3; justify-self: end; min-width: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.header-links { display: flex; gap: 8px; }
.header-link {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.header-link:hover { color: var(--accent); border-color: var(--accent); }

.header-settings {
  grid-column: 2;
  justify-self: center;
  position: relative;
  z-index: 30;
}

.settings-toggle {
  display: block;
  cursor: pointer;
  list-style: none;
}

.settings-toggle::-webkit-details-marker { display: none; }
.settings-toggle::marker { content: ''; }

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 232px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.settings-title {
  padding: 6px 9px 8px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.theme-option:hover,
.theme-option[aria-pressed="true"] {
  background: var(--surface2);
  border-color: var(--border-bright);
}

.theme-swatch {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid var(--border-bright);
  border-radius: 50%;
}

.theme-option[data-theme-choice="midnight"] .theme-swatch { background: linear-gradient(135deg, #101018 50%, #a855f7 50%); }
.theme-option[data-theme-choice="nord"] .theme-swatch { background: linear-gradient(135deg, #3b4252 50%, #88c0d0 50%); }
.theme-option[data-theme-choice="dracula"] .theme-swatch { background: linear-gradient(135deg, #191a21 50%, #50fa7b 50%); }
.theme-option[data-theme-choice="gruvbox"] .theme-swatch { background: linear-gradient(135deg, #282828 50%, #fabd2f 50%); }
.theme-option[data-theme-choice="catppuccin"] .theme-swatch { background: linear-gradient(135deg, #242438 50%, #cba6f7 50%); }
.theme-option[data-theme-choice="tokyo-night"] .theme-swatch { background: linear-gradient(135deg, #1f2335 50%, #7aa2f7 50%); }
.theme-option[data-theme-choice="ayu-light"] .theme-swatch { background: linear-gradient(135deg, #ffffff 50%, #b45309 50%); }
.theme-option[data-theme-choice="solarized-light"] .theme-swatch { background: linear-gradient(135deg, #eee8d5 50%, #6c71c4 50%); }

.theme-welcome {
  width: min(700px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-bright);
}

.theme-welcome::backdrop { background: rgba(0, 0, 0, 0.72); }
.theme-welcome h2 { margin: 0 0 6px; font-size: 18px; }
.theme-welcome p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.theme-welcome-content { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: stretch; }
.theme-welcome-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; }
.theme-welcome .theme-option { min-height: 40px; background: var(--surface2); border-color: var(--border); }
.theme-preview { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; background: var(--bg); border: 1px solid var(--border); }
.theme-preview-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.theme-preview-top > span span { color: var(--accent); }
.theme-preview-top b { color: var(--accent); font-weight: 600; }
.theme-preview-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border-bright); }
.theme-preview-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.theme-preview-rate { color: var(--accent); font-size: 24px; font-weight: 700; line-height: 1.1; }
.theme-preview-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.theme-color-chip { height: 20px; border: 1px solid var(--border-bright); }
.theme-color-bg { background: var(--bg); }
.theme-color-surface { background: var(--surface2); }
.theme-color-accent { background: var(--accent); }
.theme-color-warning { background: var(--accent2); }
.theme-preview-button { padding: 6px 10px; background: var(--accent); color: var(--accent-contrast); font-size: 11px; font-weight: 700; text-align: center; }
.theme-confirm { width: 100%; margin-top: 16px; }

@media (max-width: 1160px) {
  header .header-inner { row-gap: 12px; }
  .header-left { grid-column: 1 / -1; grid-row: 1; justify-content: space-between; }
  .header-settings { grid-column: 2; grid-row: 2; }
  .header-right { grid-column: 1 / -1; grid-row: 3; justify-self: center; margin-left: 0; justify-content: center; }
}

@media (max-width: 640px) {
  header .header-inner { padding: 0 12px; }
  .header-left { justify-content: center; flex-wrap: wrap; gap: 8px 16px; }
  .header-left .crumbs { justify-content: center; }
  .header-right { width: 100%; flex-direction: column; }
  .header-search { width: min(100%, 360px); }
  .header-search .search-input { width: 100%; }
  .header-links { justify-content: center; flex-wrap: wrap; }
  .theme-welcome { padding: 18px; }
  .theme-welcome-content { grid-template-columns: 1fr; }
  .theme-welcome-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.search-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  padding: 7px 12px;
  width: 240px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search-input:focus { outline: none; border-color: var(--accent); background: var(--surface3); }
.search-input::placeholder { color: var(--muted-dim); }

.risk-banner {
  background: var(--accent2-dim);
  border-top: 1px solid var(--accent2);
  border-bottom: 1px solid var(--accent2);
  color: var(--text);
  font-size: 13px;
  padding: 10px 0;
}
.risk-banner .shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.risk-icon {
  color: var(--accent2);
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  flex-shrink: 0;
}
.risk-texts { min-width: 0; text-align: center; }
.risk-banner [data-banner-text] { display: none; }
.risk-banner [data-banner-text].active { display: inline; animation: banner-in 0.45s ease; }

@keyframes banner-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .risk-banner [data-banner-text].active { animation: none; }
}

footer { width: 100%; display: flex; justify-content: center; gap: 10px; align-items: center; flex-wrap: wrap; }
footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--muted);
  font-size: 13px;
  margin-top: 56px;
}
footer .mono { color: var(--accent); }
footer .footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 0 20px;
}
footer .footer-note { grid-column: 2; text-align: center; }
footer .footer-privacy { grid-column: 3; justify-self: end; color: var(--muted); }
footer .footer-privacy:hover { color: var(--accent); }
footer .mono a { color: var(--accent); }
@media (max-width: 760px) {
  footer .footer-inner { display: flex; justify-content: center; flex-wrap: wrap; }
}

main { padding: 40px 0 64px; flex: 1; width: 100%; }

h1 {
  font-family: "Open Sans", sans-serif;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
h2 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
}
a.card:hover { background: var(--surface2); border-color: var(--border-bright); }
a.card:hover .name { color: var(--accent); }

.card img { width: 100%; height: 150px; object-fit: contain; padding: 12px; margin-bottom: 12px; background: var(--surface2); border: 1px solid var(--border); filter: saturate(0.85); }
.card .name { font-weight: 600; transition: color 0.15s ease; margin-bottom: 3px; }
.card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; font-family: "Open Sans", sans-serif; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "Open Sans", sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 7px;
  line-height: 1.4;
  background: var(--surface2);
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--muted-dim); flex-shrink: 0; }
.pill.stable { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-dim); }
.pill.stable::before { background: var(--accent); }
.pill.unstable { color: var(--accent2); border-color: var(--accent2-dim); background: var(--accent2-dim); }
.pill.unstable::before { background: var(--accent2); }
.pill.on { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-dim); }
.pill.on::before { background: var(--accent); }
.pill.off { color: var(--muted-dim); border-color: var(--border); background: transparent; }
.pill.off::before { background: var(--muted-dim); }

.tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; }

.report-rate {
  font-family: "Open Sans", sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.stars { display: inline-flex; align-items: center; gap: 1px; font-size: 15px; line-height: 1; white-space: nowrap; }
.star { color: var(--muted-dim); }
.star.on { color: var(--accent); }
.stars-count { color: var(--muted); font-family: "Open Sans", sans-serif; font-size: 11px; margin-left: 6px; }

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-bright);
  padding: 18px 20px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.entry:hover { border-left-color: var(--accent); background: var(--surface2); }
.entry .name { font-weight: 600; font-size: 15px; }
.entry .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; font-family: "Open Sans", sans-serif; }
.entry .notes { color: var(--muted); font-size: 13px; margin-top: 10px; max-width: 65ch; line-height: 1.6; white-space: pre-wrap; }

.entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.entry-head .meta { margin-bottom: 0; }

.versions { background: var(--surface2); border: 1px solid var(--border); margin-top: 14px; }
.versions summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  color: var(--muted);
  list-style: none;
  user-select: none;
}
.versions summary::-webkit-details-marker { display: none; }
.versions summary:hover { color: var(--text); }
.versions-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.versions[open] .versions-arrow { transform: rotate(90deg); }
.versions[open] summary { border-bottom: 1px solid var(--border); }
.versions-rates { color: var(--accent); }
.version-scroll { overflow-x: auto; padding: 0 14px 6px; }
.version-table { width: 100%; border-collapse: collapse; margin: 0; }
.version-table th {
  text-align: left;
  font-family: "Open Sans", sans-serif;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.version-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 13px; }
.version-table tr:last-child td { border-bottom: none; }
.vt-name { font-weight: 600; }
.vt-comment {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 4px;
  max-width: 42ch;
  line-height: 1.5;
  white-space: pre-wrap;
}
.vt-rate { white-space: nowrap; }
.vt-flags { display: flex; flex-wrap: nowrap; gap: 5px; }
.vt-num { font-family: "Open Sans", sans-serif; white-space: nowrap; }
.vt-none { color: var(--muted-dim); }
.vt-stars { white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-family: "Open Sans", sans-serif;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 700; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-contrast); }
.btn.danger:hover { border-color: var(--accent2); color: var(--accent2); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.3; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--border); color: var(--text); background: var(--surface2); }

form { display: flex; flex-direction: column; gap: 16px; }

.field label {
  display: block;
  font-family: "Open Sans", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  width: 100%;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface3);
}
.field textarea { font-family: "Open Sans", sans-serif; min-height: 110px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 5px; }

input[required]:user-invalid {
  border-color: var(--accent2);
  background: var(--accent2-dim);
}
input[required]:user-valid {
  border-color: var(--accent-dim);
}

.file-current {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: inline-block;
}
.file-current .mono { color: var(--text); }
.file-picked {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim);
  display: none;
}

.checks { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.checks label { display: flex; align-items: center; gap: 7px; cursor: pointer; }

.version-editor { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.version-row {
  border: 1px solid var(--border);
  background: var(--surface2);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.version-row-top { display: flex; gap: 8px; align-items: center; }
.version-row-top .v-name { flex: 2 1 0; min-width: 0; }
.version-row-top .v-rate { flex: 1 1 0; min-width: 0; }
.version-row-top .v-prate { flex: 1 1 0; min-width: 0; }
.version-row-top input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  font-family: "Open Sans", sans-serif;
  font-size: 13px;
}
.version-row-top input:focus, .vf input:focus, .vf select:focus {
  outline: none;
  border-color: var(--accent);
}
.version-row-fields { display: flex; gap: 14px; flex-wrap: wrap; }
.version-row textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  font-family: "Open Sans", sans-serif;
  font-size: 13px;
  resize: vertical;
  min-height: 44px;
}
.version-row textarea:focus { outline: none; border-color: var(--accent); }
.vf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "Open Sans", sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.vf input, .vf select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
  font-family: "Open Sans", sans-serif;
}
.vf input { width: 120px; }

.legend {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 13px;
}
.legend-title {
  font-family: "Open Sans", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-dim);
  margin-bottom: 10px;
}
.legend-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }

.filter-bar { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chip.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

.empty {
  border: 1px dashed var(--border);
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-family: "Open Sans", sans-serif;
}

.maker-description { color: var(--muted); font-size: 14px; margin: -14px 0 28px; max-width: 65ch; line-height: 1.6; white-space: pre-wrap; }

.flash {
  border-left: 2px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  font-family: "Open Sans", sans-serif;
}

.row-order { display: flex; flex-direction: column; gap: 2px; }
.row-order .btn { padding: 2px 8px; line-height: 1.2; }

.section-label {
  font-family: "Open Sans", sans-serif;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .header-right { width: 100%; margin-left: 0; }
  .header-search { width: 100%; }
  .search-input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-topbar form { margin-left: auto; }

.admin-tabs { display: flex; gap: 4px; }
.admin-tabs a {
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.admin-tabs a:hover { color: var(--text); background: var(--surface2); }
.admin-tabs a.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

.admin-flex { display: flex; gap: 20px; align-items: flex-start; }
.admin-flex .browse-columns { flex: 0 1 1400px; min-width: 0; }

.admin-editor-side {
  width: 440px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-list-panel { flex: 1; min-width: 0; }
.content-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.entry-name-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr-badge {
  font-family: "Open Sans", sans-serif;
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim);
  padding: 2px 7px;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .admin-flex { flex-direction: column; }
  .admin-flex .browse-columns { flex: none; width: auto; }
  .admin-editor-side { position: static; width: 100%; max-height: none; }
}

.home-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.home-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.home-nav-btn span { font-weight: 400; font-size: 12px; color: var(--muted); font-family: "Open Sans", sans-serif; }
.home-nav-btn:hover { background: var(--surface2); color: var(--accent); border-color: var(--border-bright); }

.stats-section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-family: "Open Sans", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.stats-tz { color: var(--muted-dim); text-transform: none; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats-grid.secondary { margin-top: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); padding: 18px 20px; display: flex; flex-direction: column; gap: 5px; }
.stat-value { font-family: "Open Sans", sans-serif; font-size: 26px; font-weight: 700; color: var(--accent); }
.stats-grid.secondary .stat-value { font-size: 20px; }
.stat-label { color: var(--muted); font-size: 12px; font-family: "Open Sans", sans-serif; display: flex; align-items: center; gap: 6px; }
.stat-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

@media (max-width: 640px) {
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 20px; }
  .stats-grid.secondary .stat-value { font-size: 16px; }
}

.announcement { border: 1px solid var(--border); background: var(--surface); padding: 18px 20px; margin-bottom: 14px; }
.announcement-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.announcement-title { font-weight: 600; font-size: 15px; }
.announcement-date { color: var(--muted); font-size: 11px; }
.announcement-body { font-size: 14px; line-height: 1.6; overflow-wrap: break-word; }
.announcement-body a, .faq-answer a { color: var(--accent); text-decoration: underline; }
.announcement-body a:hover, .faq-answer a:hover { color: var(--accent-hover); }
.announcement-body img, .faq-answer img { max-width: 100%; height: auto; display: block; margin: 10px 0; border: 1px solid var(--border); }
.announcement-body ul, .faq-answer ul { margin: 10px 0; padding-left: 22px; }
.announcement-body li, .faq-answer li { margin-bottom: 4px; }
.bbcode-quote { border-left: 2px solid var(--accent); background: var(--surface2); padding: 10px 14px; margin: 10px 0; }
.bbcode-code { font-family: "Open Sans", sans-serif; font-size: 13px; background: var(--surface2); border: 1px solid var(--border); padding: 12px 14px; margin: 10px 0; overflow-x: auto; white-space: pre; }
.bbcode-hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

.faq-item { border: 1px solid var(--border); background: var(--surface); margin-bottom: 10px; }
.faq-item summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: '[+]'; font-family: "Open Sans", sans-serif; color: var(--accent); font-size: 12px; }
.faq-item[open] summary::before { content: '[-]'; }
.faq-item summary:hover { color: var(--accent); }
.faq-answer { padding: 2px 18px 16px; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: break-word; }

.otdfilter { border: 1px solid var(--border); background: var(--surface); padding: 18px 20px; margin-bottom: 14px; }
.otdfilter-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.otdfilter-name { font-weight: 600; font-size: 15px; }
.otdfilter-body { font-size: 14px; line-height: 1.6; overflow-wrap: break-word; }
.otdfilter-body a { color: var(--accent); text-decoration: underline; }
.otdfilter-body a:hover { color: var(--accent-hover); }
.otdfilter-body img { max-width: 100%; height: auto; display: block; margin: 10px 0; border: 1px solid var(--border); }
.otdfilter-body ul { margin: 10px 0; padding-left: 22px; }
.otdfilter-body li { margin-bottom: 4px; }
.otdfilter-meta { color: var(--muted); font-size: 11px; margin-top: 10px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .browse-columns { grid-template-columns: 1fr; }
  .browse-pane { min-height: 260px; max-height: 420px; }
}

@media (max-width: 640px) {
  .home-nav { grid-template-columns: 1fr; }
}

.browse-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  scroll-margin-top: 84px;
}

.browse-pane {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.browse-pane-header {
  font-family: "Open Sans", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface3);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.browse-list {
  overflow-y: auto;
  scrollbar-color: var(--border-bright) var(--surface);
  scrollbar-width: thin;
  flex: 1;
}

.browse-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background 0.1s ease;
}
.browse-row:hover { background: var(--surface2); }
.browse-row.active { background: var(--accent-dim); border-left: 2px solid var(--accent); }
.browse-row-name { flex: 1; font-weight: 500; }
.browse-count { color: var(--muted); font-family: "Open Sans", sans-serif; font-size: 11px; }
.browse-thumb { width: 32px; height: 32px; object-fit: cover; flex-shrink: 0; background: var(--surface2); }
.browse-thumb-empty { display: inline-block; border: 1px dashed var(--border); }

.browse-entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.browse-entry-info { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.browse-entry-info .stars { margin-top: 4px; }
.browse-versions { color: var(--muted); font-family: "Open Sans", sans-serif; font-size: 11px; }
.browse-row .browse-row-name:hover { color: var(--accent); }

.entry-group-label {
  font-family: "Open Sans", sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 8px 14px 6px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.browse-empty {
  padding: 24px 14px;
  color: var(--muted-dim);
  font-size: 12px;
  font-family: "Open Sans", sans-serif;
  text-align: center;
}

.browse-add {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-direction: row;
}
.browse-add input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  font-family: "Open Sans", sans-serif;
  font-size: 13px;
}
.browse-add input:focus { outline: none; border-color: var(--accent); }



.editor-panel {
  border: 1px solid var(--accent);
  background: var(--surface);
  padding: 20px;
  scroll-margin-top: 84px;
}
.editor-panel-header {
  font-family: "Open Sans", sans-serif;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.search-form { position: relative; display: block; }

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  z-index: 40;
  max-height: 340px;
  overflow-y: auto;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active { background: var(--accent-dim); }
.suggest-item img, .suggest-thumb { width: 38px; height: 38px; object-fit: cover; flex-shrink: 0; background: var(--surface3); }
.suggest-thumb { display: inline-block; border: 1px dashed var(--border); }
.suggest-info { display: flex; flex-direction: column; min-width: 0; }
.suggest-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-sub { font-family: "Open Sans", sans-serif; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

mark { background: var(--accent-dim); color: var(--accent); padding: 0 2px; }

.card-via { color: var(--accent2); font-size: 11px; margin-top: 2px; }

.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-count { color: var(--accent); font-family: "Open Sans", sans-serif; margin-left: 6px; }

.pane-link { color: var(--accent); font-size: 11px; white-space: nowrap; }
.pane-link:hover { text-decoration: underline; }

.editor-photo { max-height: 120px; max-width: 100%; border: 1px solid var(--border); display: block; margin-bottom: 10px; }

.file-current a { color: var(--text); }
.file-current a:hover { color: var(--accent); }

.lb-scroll { overflow-x: auto; }
.lb-list { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; min-width: 780px; }
.lb-head, .lb-row { display: grid; grid-template-columns: 40px 108px minmax(0, 1fr) 96px 96px 88px 72px 92px; gap: 10px; align-items: center; }
.lb-head {
  font-family: "Open Sans", sans-serif;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 12px;
}
.lb-row { background: var(--surface2); border: 1px solid var(--border); padding: 10px 12px; }
.lb-row.lb-top { border-color: var(--border-bright); }
.lb-rank { font-weight: 700; color: var(--muted); font-family: "Open Sans", sans-serif; }
.lb-top .lb-rank { color: var(--accent); }
.lb-name { display: block; font-weight: 600; }
.lb-sub { display: block; font-size: 12px; color: var(--muted); font-family: "Open Sans", sans-serif; margin-top: 2px; }
.lb-sub a { color: var(--muted); }
.lb-sub a:hover { color: var(--accent); }
.lb-cell { font-family: "Open Sans", sans-serif; font-size: 13px; white-space: nowrap; }
.lb-none { color: var(--muted); }
.lb-link { text-align: right; }

.side-rail { display: none; }

@media (min-width: 1464px) {
  main.main-with-rails {
    position: relative;
    min-height: 640px;
  }
  .side-rail {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: calc(50% - 520px);
    pointer-events: none;
  }
  .side-rail-left { left: 0; }
  .side-rail-right { right: 0; }

  .rail-frame {
    pointer-events: auto;
    width: 160px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
