:root {
  --bg: #071226;
  --bg-2: #0a1830;
  --bg-page-start: #071226;
  --bg-page-end: #05101f;
  --bg-glow-left: #11254b;
  --bg-glow-right: #0d2042;
  --panel: #0b172b;
  --panel-2: #0f1d34;
  --panel-muted: rgba(7,18,38,.55);
  --panel-strong: rgba(11,28,55,.95);
  --panel-strong-2: rgba(7,18,38,.98);
  --line: #243a5f;
  --line-soft: rgba(154,176,209,.14);
  --text: #e5eefc;
  --muted: #9ab0d1;
  --accent: #22c55e;
  --accent-dark: #062812;
  --accent-2: #7bff9e;
  --blue: #67b3ff;
  --blue-soft: rgba(103,179,255,.08);
  --good: #d4ffe1;
  --danger: #ffc7c7;
  --chip-bg: rgba(103,179,255,.08);
  --chip-border: #27415f;
  --chip-text: #d8e8ff;
  --header-border: rgba(154,176,209,.08);
  --card-bg-start: rgba(16,31,56,.97);
  --card-bg-end: rgba(7,18,38,.99);
  --card-shadow: rgba(0,0,0,.25);
  --input-bg: #071121;
  --toggle-bg: rgba(9, 20, 40, 0.82);
  --toggle-border: rgba(154,176,209,.16);
  --toggle-text: var(--muted);
  --toggle-active-bg: #67b3ff;
  --toggle-active-text: #071226;
  --board-light: #dbe8fb;
  --board-dark: #27415f;
  --board-rim: rgba(103,179,255,.22);
  --concept-link: inherit;
  --concept-link-border: rgba(157, 208, 255, 0.45);
  --concept-link-hover: #cfe6ff;
  --concept-link-hover-border: rgba(157, 208, 255, 0.95);
  --metric-tag: #8fc7ff;
  --score-card-border: #2d4a73;
  --action-bg: rgba(7,18,38,.55);
  --error-bg: rgba(180,30,50,.12);
  --error-border: rgba(220,90,110,.35);
  --coverage-border: rgba(103,179,255,.18);
  --coverage-bg: rgba(103,179,255,.06);
  --coverage-text: #b9cbe4;
  --spinner-ring: #1f2c45;
  --progress-bg: #071121;
  --chart-bg: #071224;
  --chart-grid: #1c3153;
  --chart-axis: #27415f;
  --chart-text: #94a3b8;
  --chart-line: #67b3ff;
  --chart-line-soft: #f1b95b;
  --chart-line-soft-opacity: 0.42;
  --chart-dot: #22c55e;
  --chart-dot-stroke: #d4ffe1;
  --chart-last10-dot: #f59e0b;
  --chart-last10-stroke: #fff4d6;
  --chart-win-dot: #a855f7;
  --chart-win-stroke: #f3ddff;
  --chart-loss-dot: #ef4444;
  --chart-loss-stroke: #ffd6d6;
  --chart-better-text: #7aa7dd;
  --chart-history-raw: #f1b95b;
  --chart-history-actual: #67b3ff;
  --chart-history-fitted: #22c55e;
}

html[data-theme="chess"] {
  --bg: #26211b;
  --bg-2: #2d241d;
  --bg-page-start: #0f1012;
  --bg-page-end: rgb(48, 52, 58);
  --bg-glow-left: rgba(148, 111, 81, 0.10);
  --bg-glow-right: rgba(240, 217, 181, 0.04);
  --panel: #312822;
  --panel-2: #3a2f28;
  --panel-muted: rgba(41, 33, 28, 0.72);
  --panel-strong: rgba(54, 44, 37, 0.95);
  --panel-strong-2: rgba(35, 28, 23, 0.98);
  --line: #5f5143;
  --line-soft: rgba(240, 217, 181, 0.12);
  --text: #d9d0c4;
  --muted: #b8aa96;
  --accent: #d9a441;
  --accent-dark: #22180a;
  --accent-2: #f3c56a;
  --blue: #d9a441;
  --blue-soft: rgba(217,164,65,.12);
  --good: #cfe0a5;
  --danger: #f2a3a0;
  --chip-bg: linear-gradient(180deg, rgba(240,217,181,.18), rgba(148,111,81,.20));
  --chip-border: #7b6048;
  --chip-text: #efe2cc;
  --header-border: rgba(240,217,181,.08);
  --card-bg-start: rgba(62, 50, 42, 0.97);
  --card-bg-end: rgba(38, 31, 26, 0.99);
  --card-shadow: rgba(0,0,0,.34);
  --input-bg: #1d1814;
  --toggle-bg: rgba(28, 22, 18, 0.84);
  --toggle-border: rgba(240,217,181,.16);
  --toggle-text: #c7b39a;
  --toggle-active-bg: #946f51;
  --toggle-active-text: #f4e6d0;
  --board-light: #f0d9b5;
  --board-dark: #946f51;
  --board-rim: rgba(240, 217, 181, 0.18);
  --concept-link: #ead8bc;
  --concept-link-border: rgba(240, 217, 181, 0.48);
  --concept-link-hover: #fff1db;
  --concept-link-hover-border: rgba(240, 217, 181, 0.9);
  --metric-tag: #d9c09a;
  --score-card-border: #7f654d;
  --action-bg: rgba(33, 27, 22, 0.7);
  --error-bg: rgba(117, 38, 32, 0.28);
  --error-border: rgba(214, 116, 93, 0.38);
  --coverage-border: rgba(240,217,181,.18);
  --coverage-bg: rgba(240,217,181,.08);
  --coverage-text: #ddc9ad;
  --spinner-ring: #5c4a3a;
  --progress-bg: #201913;
  --chart-bg: #000000;
  --chart-grid: #3a3123;
  --chart-axis: #5c4c36;
  --chart-text: #b8aa96;
  --chart-line: #bf811d;
  --chart-line-soft: #d9c09a;
  --chart-line-soft-opacity: 0.4;
  --chart-dot: #22c55e;
  --chart-dot-stroke: #d4ffe1;
  --chart-last10-dot: #e1b866;
  --chart-last10-stroke: #f2d38f;
  --chart-win-dot: #c084fc;
  --chart-win-stroke: #f3ddff;
  --chart-loss-dot: #f08a7f;
  --chart-loss-stroke: #ffe0dc;
  --chart-better-text: #e1b866;
  --chart-history-raw: #d9c09a;
  --chart-history-actual: #bf811d;
  --chart-history-fitted: #cfe0a5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, var(--bg-glow-left), transparent 32%),
    radial-gradient(circle at top right, var(--bg-glow-right), transparent 24%),
    linear-gradient(180deg, var(--bg-page-start) 0%, var(--bg-page-end) 100%);
  color: var(--text);
}

.app-header {
  padding: 14px 28px 12px;
  border-bottom: 1px solid var(--header-border);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

@media (max-width: 700px) {
  .app-header {
    padding: 12px 18px 10px;
  }
}

.app-header {
  padding: 16px 28px;
  border-bottom: 1px solid var(--header-border);
}

.app-header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.brand-mark-text {
  padding-right: 24px;
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.05;
  background: linear-gradient(
    180deg,
    #fff7bf 0%,
    #ffd84f 32%,
    #d59616 68%,
    #7b4b06 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
  text-shadow:
    0 1px 0 rgba(255,255,255,.18),
    0 2px 0 rgba(85,48,0,.32),
    0 8px 16px rgba(0,0,0,.42);
}

@media (max-width: 700px) {
  .brand-mark-text {
    padding-right: 12px;
    font-size: clamp(28px, 8vw, 38px);
  }
}

.concept-link {
  color: var(--concept-link);
  text-decoration: none;
  border-bottom: 1px dotted var(--concept-link-border);
}

.concept-link:hover {
  color: var(--concept-link-hover);
  border-bottom-color: var(--concept-link-hover-border);
}

.info-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.35rem;
  border: 1px solid var(--concept-link-border);
  border-radius: 999px;
  color: var(--concept-link);
  font-size: 0.72rem;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.info-badge:hover,
.info-badge:focus {
  color: var(--concept-link-hover);
  border-color: var(--concept-link-hover-border);
  outline: none;
}

.info-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--concept-link-border);
  background: var(--panel-strong-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 15;
}

.info-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--panel-strong-2);
  border-right: 1px solid var(--concept-link-border);
  border-bottom: 1px solid var(--concept-link-border);
}

.info-badge:hover .info-tooltip,
.info-badge:focus .info-tooltip,
.info-badge:focus-within .info-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.info-badge-status .info-tooltip {
  left: auto;
  right: 0;
  top: calc(100% + 10px);
  bottom: auto;
  transform: translateY(-6px);
}

.info-badge-status .info-tooltip::after {
  left: auto;
  right: 3px;
  top: auto;
  bottom: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid var(--concept-link-border);
  border-top: 1px solid var(--concept-link-border);
}

.info-badge-status:hover .info-tooltip,
.info-badge-status:focus .info-tooltip,
.info-badge-status:focus-within .info-tooltip {
  transform: translateY(0);
}

.info-badge-value-note {
  margin-left: 0.25rem;
  border-color: rgba(251, 191, 36, 0.78);
  color: #facc15;
}

.info-badge-value-note:hover,
.info-badge-value-note:focus {
  border-color: rgba(251, 191, 36, 1);
  color: #fde68a;
}

.info-badge-value-note .info-tooltip {
  border-color: rgba(251, 191, 36, 0.62);
}

.info-badge-value-note .info-tooltip::after {
  border-right-color: rgba(251, 191, 36, 0.62);
  border-bottom-color: rgba(251, 191, 36, 0.62);
}

.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.shell-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

body:has(.landing-page),
.landing-page-body {
  background:
    radial-gradient(ellipse at top, rgba(255, 215, 0, 0.09), transparent 58%),
    linear-gradient(180deg, #05080d 0%, #0b0f16 42%, #121826 100%);
  color: #e5e5e5;
}

html[data-theme="modern"] body:has(.landing-page),
html[data-theme="modern"] .landing-page-body {
  background:
    radial-gradient(ellipse at top, rgba(103,179,255,0.18), transparent 58%),
    linear-gradient(180deg, #050b14 0%, #0a1424 42%, #101d32 100%);
}

body:has(.landing-page) .app-header,
.landing-page-body .app-header {
  display: none;
}

.landing-page {
  width: 100%;
  min-height: 100vh;
  padding: 28px 24px 40px;
}

.landing-frame {
  max-width: 1280px;
  margin: 0 auto;
}

.landing-brand {
  display: inline-block;
  margin: 0 0 20px;
  padding-right: 24px;
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
  font-size: clamp(56px, 6vw, 80px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.gold-title,
.wordmark,
.masses {
  background: linear-gradient(
    180deg,
    #fff7bf 0%,
    #ffd84f 32%,
    #d59616 68%,
    #7b4b06 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
  text-shadow:
    0 1px 0 rgba(255,255,255,.18),
    0 2px 0 rgba(85,48,0,.32),
    0 8px 16px rgba(0,0,0,.42);
}

.landing-card {
  position: relative;
  border-radius: 24px;
  padding: 48px 56px 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.12), transparent 28%),
    linear-gradient(135deg, #2b1d0f 0%, #1b1714 45%, #0c1118 100%);
  border: 1px solid rgba(212,175,55,.35);
  box-shadow: 0 30px 80px rgba(0,0,0,.65);
}

html[data-theme="modern"] .landing-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(103,179,255,0.14), transparent 30%),
    linear-gradient(135deg, #132744 0%, #101c31 42%, #0a111c 100%);
  border-color: rgba(103,179,255,.28);
}

.landing-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -165px;
  width: 760px;
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255,196,55,.48) 0%,
    rgba(198,123,24,.24) 34%,
    transparent 72%
  );
  pointer-events: none;
  filter: blur(8px);
}

html[data-theme="modern"] .landing-card::before {
  background: radial-gradient(
    ellipse at center,
    rgba(103,179,255,.34) 0%,
    rgba(69,128,205,.18) 34%,
    transparent 72%
  );
}

.landing-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(420px, .9fr);
  column-gap: 48px;
  row-gap: 8px;
  align-items: start;
}

.landing-copy {
  width: 100%;
  max-width: 720px;
  padding-right: 12px;
  position: relative;
  z-index: 1;
}

.landing-title {
  margin: 0;
  display: grid;
  gap: 0;
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
  font-size: clamp(48px, 5.4vw, 76px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -0.015em;
  text-shadow: 0 6px 20px rgba(0,0,0,.55);
}

.landing-title span {
  display: block;
  margin-bottom: 8px;
}

.landing-title .line {
  color: #f5f3ef;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.landing-title .line-small {
  font-size: 0.5em;
  line-height: 1.05;
  margin-top: 6px;
}

.masters {
  display: block;
  margin-top: 8px;
  letter-spacing: 0.02em;
  font-weight: 800;
  background: linear-gradient(
    180deg,
    #fff7bf 0%,
    #ffd84f 32%,
    #d59616 68%,
    #7b4b06 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.masses {
  display: block;
  margin-top: 10px;
  letter-spacing: 0.02em;
  font-weight: 800;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.landing-subheadline {
  margin: 18px 0 0;
  max-width: 700px;
  white-space: normal;
  color: #d4d4d4;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.45;
}

.landing-subheadline strong {
  background: linear-gradient(180deg, #fff4b0 0%, #ffd84f 40%, #c98211 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-visual-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: 280px;
  padding-right: 0;
  position: relative;
  z-index: 1;
}

.landing-visual {
  width: min(620px, 46vw);
  height: auto;
  object-fit: contain;
  transform: translate(32px, -18px);
  filter:
    drop-shadow(0 0 36px rgba(255,205,70,.48))
    drop-shadow(0 22px 34px rgba(0,0,0,.7));
}

.landing-section-label {
  display: block;
  margin: 18px 0 12px;
  color: #f3c331;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
}

html[data-theme="modern"] .landing-section-label {
  color: #8fc7ff;
}

.landing-report-form,
.landing-password-form {
  margin-top: 0;
}

.source-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10, 12, 17, 0.56);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

html[data-theme="modern"] .source-tabs {
  border-color: rgba(103,179,255,.26);
  background: rgba(7, 17, 33, 0.56);
}

.source-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 16px;
  border: 0;
  border-right: 1px solid rgba(212,175,55,.18);
  background: rgba(12,16,24,.38);
  color: #f1eee9;
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

html[data-theme="modern"] .source-tab {
  border-right-color: rgba(103,179,255,.14);
  background: rgba(10,18,31,.52);
}

.source-tab:last-child {
  border-right: 0;
}

.source-tab:hover {
  background: rgba(38, 28, 16, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255,215,0,.12), 0 0 24px rgba(228,170,54,.09);
}

html[data-theme="modern"] .source-tab:hover {
  background: rgba(20, 39, 67, 0.66);
  box-shadow: inset 0 0 0 1px rgba(103,179,255,.18), 0 0 24px rgba(103,179,255,.12);
}

.source-tab.is-active {
  background:
    radial-gradient(circle at top, rgba(255,215,0,.12), transparent 78%),
    linear-gradient(180deg, rgba(112,80,24,.56), rgba(60,41,16,.64));
  box-shadow: inset 0 0 0 1px rgba(255,215,0,.42), 0 8px 24px rgba(0,0,0,.16);
}

html[data-theme="modern"] .source-tab.is-active {
  background:
    radial-gradient(circle at top, rgba(103,179,255,.14), transparent 78%),
    linear-gradient(180deg, rgba(35,79,138,.6), rgba(18,39,70,.72));
  box-shadow: inset 0 0 0 1px rgba(103,179,255,.38), 0 8px 24px rgba(0,0,0,.16);
}

.source-panel-stack {
  margin-top: 20px;
}

.source-panel {
  display: none;
  padding: 28px 30px;
  border-radius: 20px;
  border: 1px solid rgba(212,175,55,.26);
  background: linear-gradient(180deg, rgba(37, 29, 18, 0.72), rgba(12, 14, 20, 0.86));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

html[data-theme="modern"] .source-panel {
  border-color: rgba(103,179,255,.22);
  background: linear-gradient(180deg, rgba(12, 27, 48, 0.78), rgba(9, 17, 30, 0.88));
}

.source-panel.is-active {
  display: block;
}

.source-panel-copy h3 {
  margin: 0;
  color: #f4ead5;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

html[data-theme="modern"] .source-panel-copy h3 {
  color: #edf4ff;
}

.source-panel-copy p {
  margin: 10px 0 0;
  color: #cfc5b3;
  font-size: 16px;
  line-height: 1.55;
}

html[data-theme="modern"] .source-panel-copy p {
  color: #b7cbe8;
}

.source-panel-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-top: 20px;
}

.source-load-button {
  min-width: 240px;
  min-height: 64px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe47a 0%, #d99a24 100%);
  color: #080909;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 18px 36px rgba(0,0,0,.22);
  cursor: pointer;
}

html[data-theme="modern"] .source-load-button,
html[data-theme="modern"] .landing-generate-btn {
  background: linear-gradient(180deg, #8dccff 0%, #4f8fdc 100%);
  color: #071226;
}

.source-load-button:disabled,
.landing-generate-btn:disabled {
  cursor: not-allowed;
  opacity: .56;
  box-shadow: none;
}

.source-feedback {
  min-height: 24px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 600;
}

.source-feedback.is-loading {
  color: #f3d37b;
}

html[data-theme="modern"] .source-feedback.is-loading {
  color: #8fc7ff;
}

.source-feedback.is-success {
  color: #e7d8a8;
}

.source-feedback.is-error {
  color: #ffb4a4;
}

.source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  margin-right: 10px;
}

.icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter:
    drop-shadow(0 2px 6px rgba(0,0,0,.45))
    drop-shadow(0 0 10px rgba(255,200,60,.25));
}

.gold-fa {
  font-size: 22px;
  line-height: 1;
  background: linear-gradient(180deg, #fff4b0 0%, #ffd84f 42%, #c98211 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.45));
}

.source-tab .icon-img,
.source-tab .gold-fa {
  width: 28px;
  height: 28px;
}

.report-chip .icon-img {
  width: 22px;
  height: 22px;
}

.source-tab .gold-fa {
  font-size: 30px;
  line-height: 1;
}

.landing-input-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(310px, 0.95fr);
  gap: 18px;
  align-items: end;
}

.username-section,
.username-form,
.report-form {
  width: 100%;
  max-width: none;
  margin-top: 24px;
}

.username-fields-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: end;
  width: 100%;
}

.username-field {
  min-width: 0;
}

.field-card-full {
  width: 100%;
}

.field-label {
  color: #ece3d2;
  font-size: 16px;
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.file-input-wrapper {
  overflow: hidden;
}

.field-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  line-height: 1;
  z-index: 1;
}

.username-input {
  width: 100%;
  height: 64px;
  box-sizing: border-box;
  padding-left: 64px;
  padding-right: 22px;
  font-size: 17px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(7, 10, 14, 0.82);
  color: #ffffff;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.username-input:focus {
  border-color: rgba(212,175,55,.72);
  box-shadow: 0 0 0 3px rgba(212,175,55,.12);
}

.username-input::placeholder {
  color: rgba(229,229,229,.48);
}

.file-input {
  padding-top: 18px;
  line-height: 1.2;
}

.file-input::file-selector-button {
  margin-right: 16px;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,215,0,.14);
  color: #f4e4bb;
  font-weight: 700;
  cursor: pointer;
}

.same-user-panel {
  height: 64px;
  border-radius: 14px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 14px;
  align-items: center;
  text-align: left;
  border: 1px solid rgba(212,175,55,.78);
  background:
    linear-gradient(180deg, rgba(57, 40, 18, 0.62), rgba(17, 16, 15, 0.84));
  color: #f0ece5;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.same-user-panel i {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 24px;
}

.same-title {
  font-weight: 800;
  color: #f6c84f;
  line-height: 1.1;
}

.same-subtitle {
  font-size: 14px;
  color: #f0e6d2;
  line-height: 1.1;
}

.direct-pgn-panel {
  margin-top: 18px;
}

.loaded-sources-label {
  margin-top: 26px;
}

.loaded-sources-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.loaded-source-card {
  min-height: 110px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(212,175,55,.22);
  background: linear-gradient(180deg, rgba(43, 33, 21, 0.68), rgba(13, 15, 19, 0.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

html[data-theme="modern"] .loaded-source-card {
  border-color: rgba(103,179,255,.18);
  background: linear-gradient(180deg, rgba(16, 35, 62, 0.76), rgba(9, 17, 30, 0.86));
}

.loaded-source-card.is-ready {
  border-color: rgba(212,175,55,.44);
}

html[data-theme="modern"] .loaded-source-card.is-ready {
  border-color: rgba(103,179,255,.4);
}

.loaded-source-card.is-error {
  border-color: rgba(255,150,124,.36);
}

.loaded-source-title {
  color: #f2e8d0;
  font-size: 16px;
  font-weight: 800;
}

html[data-theme="modern"] .loaded-source-title {
  color: #edf4ff;
}

.loaded-source-summary {
  margin-top: 10px;
  color: #d8cfbc;
  font-size: 15px;
  line-height: 1.45;
}

html[data-theme="modern"] .loaded-source-summary,
html[data-theme="modern"] .loaded-sources-note {
  color: #b7cbe8;
}

.loaded-source-error {
  margin-top: 10px;
  color: #ffb4a4;
  font-size: 14px;
  line-height: 1.4;
}

.loaded-sources-note {
  margin-top: 14px;
  text-align: center;
  color: #d8cfbc;
  font-size: 15px;
}

.landing-generate-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  margin-top: 32px;
}

.report-type-summary {
  text-align: center;
  color: #e8dcc1;
  font-size: 16px;
  line-height: 1.5;
}

html[data-theme="modern"] .report-type-summary {
  color: #c8d9ee;
}

.report-type-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  width: 100%;
}

.landing-generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
  min-width: 0;
  padding: 18px 28px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe47a 0%, #d99a24 100%);
  color: #080909;
  font-size: 22px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    0 18px 36px rgba(0,0,0,.25);
  cursor: pointer;
}

.report-type-generate-btn.is-coming-soon {
  background: linear-gradient(180deg, #d7cab0 0%, #8b7756 100%);
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(8, 9, 9, .18);
  color: #080909;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

html[data-theme="modern"] .coming-soon-badge {
  background: rgba(7, 18, 38, .22);
  color: #071226;
}

.landing-button-icon {
  font-size: 22px;
  line-height: 1;
  margin-right: 2px;
  color: #080909;
  -webkit-text-fill-color: #080909;
  background: none;
  filter: none;
}

.clear-batch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  padding: 0 24px;
  border-radius: 14px;
  border: 1px solid rgba(212,175,55,.34);
  background: linear-gradient(180deg, rgba(46, 35, 22, 0.82), rgba(14, 16, 20, 0.9));
  color: #f1e4bf;
  font-size: 17px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  cursor: pointer;
}

.clear-batch-button:disabled {
  opacity: .56;
  cursor: not-allowed;
}

.report-bars {
  display: inline-flex;
  align-items: end;
  gap: 4px;
}

.report-bars i {
  display: block;
  width: 6px;
  border-radius: 2px 2px 0 0;
  background: #0c0f14;
}

.report-bars i:nth-child(1) { height: 18px; }
.report-bars i:nth-child(2) { height: 28px; }
.report-bars i:nth-child(3) { height: 22px; }

.landing-section-label-covers {
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.landing-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}

.landing-chip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.20);
  background: linear-gradient(180deg, rgba(58, 44, 27, 0.52), rgba(24, 23, 22, 0.72));
  color: #f0eee8;
  font-size: 17px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

html[data-theme="modern"] .landing-chip {
  border-color: rgba(103,179,255,.18);
  background: linear-gradient(180deg, rgba(20, 41, 72, 0.54), rgba(10, 18, 31, 0.74));
  color: #e7f0ff;
}

.landing-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 22px;
  line-height: 1;
}

.landing-footnote {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  color: #d6c4a3;
  font-size: 18px;
}

.landing-footnote-icon {
  flex: 0 0 28px;
  font-size: 24px;
  line-height: 1;
}

.landing-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.landing-password-row input {
  min-height: 58px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(7, 10, 14, 0.82);
  color: #ffffff;
  font-size: 16px;
}

.landing-error-box {
  margin-top: 16px;
}

.card {
  background: linear-gradient(180deg, var(--card-bg-start), var(--card-bg-end));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 20px 50px var(--card-shadow);
}

.hero,
.status-card {
  max-width: 880px;
  padding: 36px;
}

.landing-hero {
  width: min(100%, 1020px);
  max-width: 1020px;
  padding: 52px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.16);
  background: linear-gradient(135deg, #2c1e0f 0%, #3b2a16 40%, #1a1f2a 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.brand {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #d4af37;
  text-transform: none;
}

.hero-title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: #f3efe7;
}

.strike {
  position: relative;
  display: inline-block;
  margin-left: 0.16em;
  color: #b7afa4;
}

.strike::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d4af37, #f6e27a);
  transform: rotate(-3deg);
}

.masses {
  display: block;
  margin-top: 8px;
  font-weight: 800;
}

.gold-text {
  background: linear-gradient(135deg, #d4af37, #f6e27a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subheadline {
  margin: 18px 0 0;
  max-width: 600px;
  color: #cfcfcf;
  font-size: 16px;
  line-height: 1.6;
}

.legend-dot {
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  margin-right:6px;
}

.legend-lifetime {
  background:#22c55e;
}

.legend-last10 {
  background:#f59e0b;
}

.legend-win {
  background: var(--chart-win-dot);
}

.legend-loss {
  background: var(--chart-loss-dot);
}

.grade-badge {
  display: inline-block;
  margin-left: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  vertical-align: middle;
}

.grade-badge-check,
.grade-badge-up {
  color: #22c55e;
}

.grade-badge-down {
  color: #ef4444;
}

.grade-badge-neutral {
  color: var(--muted);
}

.hero h1,
.report-head h1,
.status-card h1 {
  margin: 6px 0 12px;
  font-size: 62px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.report-head h1 { font-size: 68px; }

.premium-status-card h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.premium-status-card .lede {
  margin: 18px auto 28px;
  max-width: 720px;
}

.lede {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
  max-width: 980px;
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #bf811d;
}

.status-card .eyebrow {
  color: #FFD700;
}

body:has(.status-shell),
.status-page-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(255,215,0,0.08), transparent 60%),
    linear-gradient(180deg, #0b0f1a 0%, #121826 100%);
  color: #e5e5e5;
}

html[data-theme="modern"] body:has(.status-shell),
html[data-theme="modern"] .status-page-body {
  background:
    radial-gradient(ellipse at top, rgba(103,179,255,0.18), transparent 60%),
    linear-gradient(180deg, #050b14 0%, #0a1424 42%, #101d32 100%);
}

.status-shell {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 24px 56px;
}

.premium-status-card {
  position: relative;
  width: min(100%, 920px);
  max-width: 920px;
  padding: 48px;
  border-radius: 20px;
  border: 1px solid rgba(212,175,55,.35);
  background: linear-gradient(135deg, #2b1d0f 0%, #1b1714 45%, #0c1118 100%);
  box-shadow: 0 30px 80px rgba(0,0,0,.65);
}

html[data-theme="modern"] .premium-status-card {
  border-color: rgba(103,179,255,.28);
  background: linear-gradient(135deg, #132744 0%, #101c31 42%, #0a111c 100%);
}

.premium-status-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -140px;
  width: 620px;
  height: 300px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255,190,45,.38) 0%,
    rgba(196,120,20,.18) 38%,
    transparent 72%
  );
  filter: blur(6px);
  pointer-events: none;
}

html[data-theme="modern"] .premium-status-card::before {
  background: radial-gradient(
    ellipse at center,
    rgba(103,179,255,.34) 0%,
    rgba(69,128,205,.18) 38%,
    transparent 72%
  );
}

.status-card {
  text-align: center;
}

.username-label {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #f6c84f;
}

html[data-theme="modern"] .username-label {
  color: #8fc7ff;
}

.btn,
.hero-form button {
  padding: 14px 18px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.hero-form {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.landing-form {
  margin-top: 28px;
  gap: 14px;
}

.hero-form input {
  flex: 1;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 17px;
}

.landing-form input {
  background: #0d1117;
  border: 2px solid #d4af37;
  border-radius: 10px;
  padding: 14px 16px;
  color: #ffffff;
}

.landing-form input::placeholder {
  color: rgba(229, 229, 229, 0.68);
}

.hero-points {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:20px;
}

.hero-points span,
.section-badge,
.overall-pill,
.hero-chips span {
  background: var(--chip-bg);
  border:1px solid var(--chip-border);
  color: var(--chip-text);
  border-radius: 999px;
  padding: 8px 12px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.landing-form button {
  border-radius: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #d4af37, #f6e27a);
  color: #18120a;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.22);
}

.landing-coverage {
  margin-top: 28px;
}

.landing-coverage .coverage-label {
  color: #e3d1a7;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-coverage .coverage-tags {
  gap: 12px;
}

.landing-coverage .coverage-tag {
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(13, 17, 23, 0.42);
  color: #f1e3be;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

body:has(.report-shell) {
  background:
    radial-gradient(ellipse at top, rgba(103,179,255,0.16), transparent 58%),
    linear-gradient(180deg, #07111f 0%, #0d1628 42%, #132034 100%);
  color: #e5e5e5;
}

.report-shell {
  display: grid;
  gap: 22px;
}

.report-shell .card {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(103,179,255,.24);
  background: linear-gradient(135deg, #132744 0%, #101c31 42%, #0a111c 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}

.report-head {
  padding: 34px 34px 30px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
}

.report-head::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -120px;
  width: 620px;
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(103,179,255,.28) 0%,
    rgba(69,128,205,.16) 38%,
    transparent 72%
  );
  filter: blur(6px);
  pointer-events: none;
}

.report-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(103,179,255,.2);
  background: rgba(9, 20, 40, 0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.global-theme-switch {
  flex: 0 0 auto;
}

.theme-switch-label {
  padding: 0 10px 0 8px;
  color: #9ab0d1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.theme-switch-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: #9ab0d1;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.theme-switch-btn:hover {
  color: #d7e7ff;
}

.theme-switch-btn.is-active {
  background: linear-gradient(180deg, #8dccff 0%, #4f8fdc 100%);
  color: #071226;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

.hero-panel {
  min-height: 280px;
}

.hero-copy {
  flex: 1;
}

.report-head h1 {
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
  font-size: clamp(42px, 4.8vw, 64px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: #f6f0e6;
  text-shadow: 0 6px 20px rgba(0,0,0,.55);
}

.report-identity {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.report-userline {
  color: #bfd1eb;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 800;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-view-tabs {
  margin: 18px 0 4px;
}

.report-tab-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(103,179,255,.24);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(103,179,255,.07);
  color: #d8e8ff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.report-tab-state {
  color: rgba(216,232,255,.72);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-tab-button.is-active .report-tab-state {
  color: rgba(7,18,38,.72);
}

.report-tab-button.is-running .report-tab-state {
  color: #ffd6b8;
}

.report-tab-button.is-done .report-tab-state {
  color: #bbf7d0;
}

.report-tab-button.is-error .report-tab-state {
  color: #ffc7d0;
}

.report-tab-button.is-active.is-running .report-tab-state,
.report-tab-button.is-active.is-done .report-tab-state,
.report-tab-button.is-active.is-error .report-tab-state {
  color: rgba(7,18,38,.76);
}

.report-tab-button:hover {
  border-color: rgba(143,199,255,.62);
  color: #f5fbff;
}

.report-tab-button.is-active {
  background: linear-gradient(180deg, #8dccff 0%, #4f8fdc 100%);
  color: #071226;
  border-color: transparent;
}

.report-status-return {
  border-color: rgba(125, 211, 166, .36);
  background: rgba(125, 211, 166, .12);
  color: #dffbea;
}

.report-head .lede {
  color: #bfd1eb;
  max-width: 760px;
}

.overall-hero-score {
  min-width: 260px;
  text-align: left;
  border-radius: 22px;
  border: 1px solid rgba(103,179,255,.28);
  background:
    linear-gradient(135deg, rgba(255,255,255,.02), transparent 55%),
    linear-gradient(180deg, rgba(15, 34, 61, 0.96), rgba(8, 18, 34, 0.98));
  padding: 20px 18px 18px;
  box-shadow: inset 0 0 0 1px rgba(157, 208, 255, 0.08);
}

.elo-big {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin: 6px 0 8px;
}

.elo-recent {
  margin-top: 6px;
}

.recent-elo-label,
.quick-grade-actual {
  font-weight: 600;
}

.hero-elo-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.hero-elo-subvalue {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  margin-top: 2px;
}

.fundamentals-score-mini {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(157, 208, 255, 0.14);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.fundamentals-score-mini strong {
  color: #f6f0e6;
  font-size: 24px;
  line-height: 1;
}

.multi-status-card {
  width: min(100%, 1280px);
  max-width: 1280px;
}

.multi-status-tabs {
  margin: 22px 0 18px;
}

.report-tab-status {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255,255,255,.12);
  font-size: 11px;
  font-weight: 900;
}

.report-tab-status.is-running {
  background: rgba(246, 165, 107, .20);
}

.report-tab-status.is-done {
  background: rgba(125, 211, 166, .24);
}

.report-tab-status.is-error {
  background: rgba(255, 100, 120, .22);
}

.multi-status-panel {
  display: none;
}

.multi-status-panel.is-active {
  display: grid;
  gap: 14px;
}

.report-frame-region {
  display: grid;
  gap: 12px;
}

.report-frame {
  width: 100%;
  height: 76vh;
  min-height: 720px;
  border: 1px solid rgba(103,179,255,.22);
  border-radius: 12px;
  background: #071226;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.embedded-body .app-header {
  display: none;
}

.embedded-body .report-shell {
  padding-top: 20px;
}

.embedded-body .report-head {
  margin-top: 0;
}

.consolidated-report-shell {
  gap: 18px;
}

.consolidated-hero {
  min-height: 0;
  padding: 24px 30px;
}

.consolidated-top-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.consolidated-report-card {
  display: grid;
  gap: 14px;
}

.consolidated-report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.consolidated-report-card h2 {
  margin: 0;
  font-size: 20px;
}

.consolidated-stat-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.consolidated-stat-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(154,176,209,.10);
  padding-top: 9px;
}

.consolidated-stat-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.consolidated-stat-list dd {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.consolidated-grade-card {
  display: grid;
  gap: 16px;
}

.consolidated-grade-head {
  align-items: center;
}

.consolidated-category-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.consolidated-grade-pill {
  border: 1px solid rgba(103,179,255,.24);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(103,179,255,.08);
  color: #d8e8ff;
  font-size: 12px;
  font-weight: 900;
}

.consolidated-summary-table td:first-child {
  width: 34%;
  font-weight: 800;
}

.consolidated-summary-table td:nth-child(2) {
  color: var(--muted);
  font-weight: 800;
}

html[data-theme="chess"] .consolidated-grade-pill {
  border-color: rgba(212,175,55,.28);
  background: rgba(255,215,0,.08);
  color: #ead8bc;
}

.multi-status-actions {
  margin-top: 6px;
}

.score-band,
.category-band,
.metric-band {
  color: #8fc7ff;
  font-weight: 700;
  font-size: 14px;
}

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

.stat-card,
.category-card {
  padding: 18px 18px 16px;
}

.category-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-card strong,
.category-elo {
  display: block;
  font-size: 34px;
  margin-top: 10px;
  font-weight: 800;
}

.score-pair-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: baseline;
  margin: 14px 0 12px;
}

.score-pair-grid span {
  color: var(--muted);
  font-weight: 700;
}

.score-pair-grid strong {
  font-size: 24px;
  color: var(--text);
}

.count-cap-note {
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.78;
  vertical-align: middle;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.02em;
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
  color: #eef5ff;
}

.metric-legend-card {
  display: grid;
  gap: 8px;
  padding: 24px;
}

.metric-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
}

.metric-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #d4af37;
  font-size: 14px;
  font-weight: 700;
}

.metric-legend-line {
  width: 42px;
  height: 0;
  border-top: 3px solid transparent;
  border-radius: 999px;
  flex: 0 0 auto;
}

.metric-legend-line-raw {
  border-top-width: 2px;
  border-top-color: var(--chart-line-soft);
  opacity: var(--chart-line-soft-opacity);
}

.metric-legend-line-trend {
  border-top-width: 3px;
  border-top-color: var(--chart-line);
}

.section-with-summary {
  align-items: end;
}

.section-summary-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.section-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 8px;
  background: rgba(212,175,55,.08);
  color: #f5e6b6;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.section-toggle-btn:hover,
.section-toggle-btn:focus-visible {
  border-color: rgba(212,175,55,.72);
  background: rgba(212,175,55,.15);
  outline: none;
}

.section-toggle-symbol {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid currentColor;
  line-height: 1;
  font-weight: 900;
}

.metric-section-body {
  display: grid;
  gap: 14px;
}

.metric-section-body[hidden] {
  display: none;
}

.section-subtitle {
  margin: 6px 0 0;
}

.narrative-card,
.two-col > .card,
.action-card,
.methodology-card {
  padding: 24px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.insight-card {
  min-height: 100%;
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.clean-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.clean-list li:last-child {
  border-bottom: 0;
}

.factor-profile-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.factor-player-type {
  margin: 0;
  font-size: 24px;
}

.factor-player-type-description {
  margin: 0;
  max-width: 760px;
  line-height: 1.6;
}

.factor-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.factor-detail {
  border: 1px solid rgba(103,179,255,.16);
  border-radius: 16px;
  background: rgba(8, 19, 38, 0.58);
  overflow: hidden;
}

.factor-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.factor-summary::-webkit-details-marker {
  display: none;
}

.factor-summary-main {
  display: grid;
  gap: 4px;
}

.factor-label {
  font-size: 18px;
  font-weight: 700;
  color: #edf4ff;
}

.factor-percentile {
  font-size: 13px;
}

.factor-score {
  font-size: 26px;
  font-weight: 900;
  color: #8fc7ff;
  white-space: nowrap;
}

.factor-driver-list {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.factor-driver-item {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.factor-driver-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.factor-driver-tag {
  border: 1px solid rgba(103,179,255,.22);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #d8e8ff;
  background: rgba(103,179,255,.08);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.factor-driver-metrics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.factor-driver-metrics li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

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

.action-item {
  border: 1px solid rgba(103,179,255,.16);
  border-radius: 18px;
  padding: 18px;
  background: rgba(8, 19, 38, 0.58);
}

.action-item h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.metric-section {
  display: grid;
  gap: 14px;
}

.component-rollup-card {
  padding: 24px;
  border: 1px solid rgba(103,179,255,.14);
  background: rgba(8, 19, 38, 0.52);
}

.component-rollup-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  margin-bottom: 14px;
  color: #d4af37;
  font-size: 14px;
  font-weight: 700;
}

.component-rollup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 10px 16px;
  margin-top: 10px;
}

.component-rollup-item {
  display: grid;
  gap: 2px;
}

.component-rollup-item strong {
  font-size: 14px;
  color: #eef5ff;
}

.component-rollup-item span {
  font-size: 13px;
  color: var(--muted);
}

.time-curve-panel {
  padding: 22px 24px 18px;
  border: 1px solid rgba(103,179,255,.14);
  background: rgba(8, 19, 38, 0.52);
}

.time-curve-panel .section-title-row {
  margin-bottom: 12px;
}

.time-curve-panel h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.time-curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 12px;
}

.time-curve-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.time-curve-swatch {
  width: 24px;
  height: 0;
  border-top: 3px solid currentColor;
  border-radius: 999px;
  opacity: 0.9;
}

.time-distribution-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.metric-card {
  padding: 22px;
  display: grid;
  gap: 14px;
  scroll-margin-top: 24px;
  border: 1px solid rgba(103,179,255,.18);
  background:
    linear-gradient(135deg, rgba(33, 71, 122, 0.2), transparent 55%),
    linear-gradient(180deg, rgba(12, 25, 46, 0.92), rgba(7, 14, 24, 0.96));
}

.metric-card-pair-start {
  grid-column-start: 1;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.metric-head h3 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #f2ecdf;
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
}

.metric-category-tag {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8fc7ff;
}

.metric-score-stack {
  text-align: right;
}

.metric-implied {
  font-size: 40px;
  font-weight: 900;
  color: #8fc7ff;
  line-height: 1;
}

.metric-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.metric-meta > span {
  display: block;
}

.metric-notes {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.metric-notes p {
  margin: 0;
  line-height: 1.55;
}

.chart-wrap {
  margin-top: 4px;
}

.metric-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-empty {
  color: #9ab0d1;
  font-size: 14px;
  padding: 16px 0;
}

.report-shell .muted,
.report-shell .metric-meta,
.report-shell .factor-driver-metrics li,
.report-shell .section-subtitle,
.report-shell .factor-player-type-description {
  color: #9ab0d1;
}

.report-shell .stat-card strong,
.report-shell .category-elo,
.report-shell strong {
  color: #f5efe2;
}

.report-shell .hero-chips span,
.report-shell .overall-pill,
.report-shell .section-badge {
  border: 1px solid rgba(103,179,255,.22);
  background: rgba(103,179,255,.08);
  color: #d8e8ff;
}

.report-shell .summary-table th {
  color: #d8e8ff;
  background: rgba(103,179,255,.06);
}

.report-shell .summary-table td {
  color: #e6dfd1;
}

.report-shell .summary-table tr:hover td {
  background: rgba(103,179,255,.035);
}

.report-shell .concept-link {
  color: #8fc7ff;
  border-bottom-color: rgba(143,199,255,.42);
}

.report-shell .concept-link:hover {
  color: #dff0ff;
  border-bottom-color: rgba(223,240,255,.9);
}

.report-shell .btn {
  background: linear-gradient(180deg, #8dccff 0%, #4f8fdc 100%);
  color: #071226;
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 16px 28px rgba(0,0,0,.24);
}

html[data-theme="chess"] body:has(.report-shell) {
  background:
    radial-gradient(ellipse at top, rgba(255,215,0,0.08), transparent 60%),
    linear-gradient(180deg, #0b0f1a 0%, #121826 100%);
}

html[data-theme="chess"] .report-shell .card {
  border: 1px solid rgba(212,175,55,.28);
  background: linear-gradient(135deg, #2b1d0f 0%, #1b1714 45%, #0c1118 100%);
}

html[data-theme="chess"] .report-head::before {
  background: radial-gradient(
    ellipse at center,
    rgba(255,190,45,.30) 0%,
    rgba(196,120,20,.14) 38%,
    transparent 72%
  );
}

html[data-theme="chess"] .theme-switch {
  border: 1px solid rgba(212,175,55,.24);
  background: rgba(20, 18, 17, 0.86);
}

html[data-theme="chess"] .theme-switch-label,
html[data-theme="chess"] .theme-switch-btn {
  color: #c9bba0;
}

html[data-theme="chess"] .theme-switch-btn:hover {
  color: #fff2d1;
}

html[data-theme="chess"] .theme-switch-btn.is-active,
html[data-theme="chess"] .report-shell .btn {
  background: linear-gradient(180deg, #ffe47a 0%, #d99a24 100%);
  color: #080909;
}

html[data-theme="chess"] .report-tab-button {
  border-color: rgba(212,175,55,.30);
  background: rgba(255,215,0,.07);
  color: #ead8bc;
}

html[data-theme="chess"] .report-tab-button:hover {
  border-color: rgba(255,228,122,.68);
  color: #fff1db;
}

html[data-theme="chess"] .report-tab-button.is-active {
  background: linear-gradient(180deg, #ffe47a 0%, #d99a24 100%);
  color: #080909;
  border-color: transparent;
}

html[data-theme="chess"] .report-tab-state {
  color: rgba(234,216,188,.72);
}

html[data-theme="chess"] .report-tab-button.is-active .report-tab-state,
html[data-theme="chess"] .report-tab-button.is-active.is-running .report-tab-state,
html[data-theme="chess"] .report-tab-button.is-active.is-done .report-tab-state,
html[data-theme="chess"] .report-tab-button.is-active.is-error .report-tab-state {
  color: rgba(8,9,9,.70);
}

html[data-theme="chess"] .report-tab-button.is-running .report-tab-state {
  color: #ffd37a;
}

html[data-theme="chess"] .report-tab-button.is-done .report-tab-state {
  color: #d7e7a1;
}

html[data-theme="chess"] .report-status-return {
  border-color: rgba(212,175,55,.30);
  background: rgba(255,215,0,.07);
  color: #ead8bc;
}

html[data-theme="chess"] .report-userline {
  color: #d0c7b8;
}

html[data-theme="chess"] .report-head .lede {
  color: #d0c7b8;
}

html[data-theme="chess"] .overall-hero-score {
  border: 1px solid rgba(212,175,55,.34);
  background:
    linear-gradient(135deg, rgba(255,255,255,.02), transparent 55%),
    linear-gradient(180deg, rgba(50, 38, 28, 0.95), rgba(16, 18, 22, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 220, 132, 0.08);
}

html[data-theme="chess"] .score-band,
html[data-theme="chess"] .category-band,
html[data-theme="chess"] .metric-band,
html[data-theme="chess"] .factor-score,
html[data-theme="chess"] .metric-implied,
html[data-theme="chess"] .report-shell .concept-link {
  color: #f3d37b;
}

html[data-theme="chess"] .section-title-row h2,
html[data-theme="chess"] .factor-label {
  color: #f3ecdf;
}

html[data-theme="chess"] .factor-detail,
html[data-theme="chess"] .action-item {
  border: 1px solid rgba(212,175,55,.18);
  background: rgba(18, 19, 23, 0.58);
}

html[data-theme="chess"] .factor-driver-tag,
html[data-theme="chess"] .report-shell .hero-chips span,
html[data-theme="chess"] .report-shell .overall-pill,
html[data-theme="chess"] .report-shell .section-badge {
  border: 1px solid rgba(212,175,55,.24);
  background: rgba(255,215,0,.08);
  color: #efe1bc;
}

html[data-theme="chess"] .metric-card {
  border: 1px solid rgba(212,175,55,.2);
  background:
    linear-gradient(135deg, rgba(59, 43, 25, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(26, 22, 19, 0.9), rgba(12, 15, 20, 0.94));
}

html[data-theme="chess"] .metric-category-tag {
  color: #e7c97d;
}

html[data-theme="chess"] .chart-empty,
html[data-theme="chess"] .report-shell .muted,
html[data-theme="chess"] .report-shell .metric-meta,
html[data-theme="chess"] .report-shell .factor-driver-metrics li,
html[data-theme="chess"] .report-shell .section-subtitle,
html[data-theme="chess"] .report-shell .factor-player-type-description {
  color: #bdb3a0;
}

html[data-theme="chess"] .report-shell .summary-table th {
  color: #f0e3bd;
  background: rgba(255,215,0,.04);
}

html[data-theme="chess"] .report-shell .summary-table tr:hover td {
  background: rgba(255,215,0,.035);
}

html[data-theme="chess"] .summary-group {
  background: rgba(18, 19, 23, 0.48);
  border-color: rgba(212,175,55,.18);
}

html[data-theme="chess"] .summary-group[open] .summary-group-head {
  border-bottom-color: rgba(212,175,55,.18);
}

html[data-theme="chess"] .report-shell .concept-link {
  border-bottom-color: rgba(243,211,123,.42);
}

html[data-theme="chess"] .report-shell .concept-link:hover {
  color: #fff0b7;
  border-bottom-color: rgba(255,240,183,.9);
}

.footer-actions {
  display: flex;
  justify-content: flex-start;
}

.muted { color: var(--muted); }
.small { font-size: 14px; }

.status-line {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-top: 0;
  color: #d6d6d6;
}

.progress-wrap {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 200, 80, 0.12);
  overflow: hidden;
  margin-top: 24px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #fff4b0,
    #ffd84f,
    #d89a18
  );
  box-shadow:
    0 0 12px rgba(255,200,80,.45),
    0 0 24px rgba(200,120,30,.25);
  transition: width 0.4s ease;
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 8px rgba(255,200,80,.3); }
  to { box-shadow: 0 0 20px rgba(255,200,80,.6); }
}

.stage-label {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f6c84f;
}

.status-value {
  margin-top: 10px;
  font-size: 14px;
  color: #b8b8b8;
}

.error-box {
  color: var(--danger);
  background: var(--error-bg);
  border:1px solid var(--error-border);
  padding: 14px;
  border-radius: 14px;
  margin-top: 18px;
}

.empty-state {
  padding: 30px;
}

.coverage-block {
  margin-top: 22px;
}

.coverage-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.coverage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.coverage-tag {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--coverage-border);
  background: var(--coverage-bg);
  color: var(--coverage-text);
  font-size: 14px;
  font-weight: 600;
  cursor: default;
  user-select: none;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.summary-groups {
  display: grid;
  gap: 12px;
}

.summary-group {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(8, 19, 38, 0.32);
  overflow: visible;
}

.summary-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
}

.summary-group-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--concept-link-border);
  color: var(--concept-link);
  font-size: 0;
  font-weight: 800;
  letter-spacing: .04em;
}

.summary-group-head::-webkit-details-marker {
  display: none;
}

.summary-group-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.summary-group-impact {
  color: var(--accent);
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.summary-group-impact-value,
.summary-group-impact-label {
  color: var(--accent);
  font-size: inherit;
  font-weight: 700;
}

.summary-group-weight,
.summary-group-score,
.section-weight {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(157, 208, 255, 0.18);
  background: rgba(157, 208, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  white-space: nowrap;
}

.summary-group-score {
  border-color: rgba(244, 211, 94, 0.28);
  background: rgba(244, 211, 94, 0.10);
  color: var(--accent);
}

.section-weight {
  margin-left: 8px;
  vertical-align: middle;
}

.x-factor-impact {
  margin-left: 10px;
}

.summary-group-collapse-text {
  display: none;
}

.summary-group[open] .summary-group-expand-text {
  display: none;
}

.summary-group[open] .summary-group-collapse-text {
  display: inline;
}

.summary-group[open] .summary-group-head {
  border-bottom: 1px solid var(--line-soft);
}

.summary-group[open] .summary-group-toggle {
  color: var(--concept-link-hover);
  border-color: var(--concept-link-hover-border);
}

.summary-group-toggle::before {
  content: "+";
  font-size: 12px;
}

.summary-group[open] .summary-group-toggle::before {
  content: "−";
}

.summary-metric-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--concept-link-border);
}

.summary-metric-link:hover {
  color: var(--concept-link-hover);
  border-bottom-color: var(--concept-link-hover-border);
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.summary-table th,
.summary-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.summary-table th {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .02em;
}

.summary-table tr:last-child td {
  border-bottom: 0;
}

.summary-table-footer {
  margin-top: 12px;
}

.summary-table-footer td {
  background: rgba(103,179,255,.05);
}

.game-viewer-shell {
  display: grid;
  gap: 20px;
}

body:has(.game-viewer-shell) {
  background:
    radial-gradient(ellipse at top, rgba(103,179,255,0.16), transparent 58%),
    linear-gradient(180deg, #07111f 0%, #0d1628 42%, #132034 100%);
  color: #e5e5e5;
}

.game-viewer-shell .card {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(103,179,255,.24);
  background: linear-gradient(135deg, #132744 0%, #101c31 42%, #0a111c 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}

.game-viewer-hero {
  display: grid;
  gap: 16px;
  padding: 30px 32px;
}

.game-viewer-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -120px;
  width: 620px;
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(103,179,255,.28) 0%,
    rgba(69,128,205,.16) 38%,
    transparent 72%
  );
  pointer-events: none;
  filter: blur(8px);
}

.game-viewer-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.game-viewer-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.game-viewer-title-user {
  color: #d4af37;
}

.game-viewer-backlink,
.report-viewer-link {
  text-decoration: none;
}

.stat-card-link {
  display: inline-flex;
  margin-top: 16px;
  align-self: flex-start;
}

.game-viewer-debug-toggle.is-active {
  background: linear-gradient(180deg, rgba(212,175,55,.24), rgba(212,175,55,.14));
  border-color: rgba(212,175,55,.55);
  color: #fff5cf;
}

.debug-panel {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.debug-panel-head {
  margin-bottom: 0;
  padding: 2px 0 0;
}

.debug-panel-copy {
  margin: 0;
}

.debug-copy-btn {
  padding: 8px 12px;
  min-width: 0;
}

.debug-snapshot {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  color: #d9e8ff;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: 420px;
  overflow: auto;
}

.game-picker-card {
  overflow: visible;
  padding: 24px 24px 26px;
}

.game-selector {
  display: grid;
  gap: 10px;
}

.game-selector-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.game-selector-table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  padding-top: 2px;
}

.game-selector-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 9px;
  line-height: 1.15;
}

.game-selector-table th,
.game-selector-table td {
  padding: 3px 3px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.game-selector-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(22, 31, 27, .98);
}

.game-selector-table th.is-resizable {
  position: sticky;
}

.game-selector-resize-handle {
  position: absolute;
  top: 0;
  right: -2px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.game-selector-resize-handle::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 3px;
  bottom: 5px;
  width: 1px;
  background: rgba(222, 183, 82, .6);
}

.is-resizing-game-selector,
.is-resizing-game-selector * {
  cursor: col-resize !important;
  user-select: none !important;
}

.game-selector-table thead tr:nth-child(2) th {
  top: 24px;
  z-index: 2;
}

.game-selector-sort {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-selector-filter {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 20px;
  padding: 1px 3px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font: inherit;
}

.game-selector-filter option {
  color: #172016;
  background: #f8f4e8;
}

.game-selector-table th.is-compact .game-selector-filter {
  max-width: none;
}

.game-selector-table tbody tr:first-child td {
  padding-top: 9px;
}

.game-selector-row {
  cursor: pointer;
}

.game-selector-row:hover,
.game-selector-row.is-selected {
  background: rgba(222, 183, 82, .16);
}

.game-selector-row.is-selected,
.game-selector-row.is-selected:hover {
  background: rgba(20, 83, 45, .86);
}

.game-selector-row.is-selected td {
  color: #ecfdf5;
}

.game-selector-country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.game-source-link,
.game-source-label {
  font-weight: 800;
}

.game-source-link {
  color: var(--concept-link);
  text-decoration: none;
  border-bottom: 1px dotted var(--concept-link-border);
}

.game-source-link:hover {
  color: var(--concept-link-hover);
  border-bottom-color: var(--concept-link-hover-border);
}

.game-selector-flag,
.game-selector-flag-placeholder,
.game-option-flag,
.game-option-flag-placeholder {
  width: 18px;
  height: 14px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(12,28,58,.12);
  background: rgba(12,28,58,.08);
  object-fit: cover;
}

.game-viewer-main {
  display: grid;
  grid-template-columns: minmax(420px, 1.32fr) minmax(220px, .52fr) minmax(390px, 1.05fr);
  gap: 14px;
  align-items: start;
}

.board-panel,
.checklist-panel,
.opening-checklist-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.viewer-summary-panel {
  display: grid;
  gap: 0;
  padding: 0;
}

.viewer-summary-head::marker {
  content: "";
}

.viewer-summary-panel .summary-group-title {
  font-size: 18px;
  line-height: 1.15;
}

.viewer-tab-card {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.viewer-sidebar-tab-card {
  overflow: visible;
}

.viewer-tab-button[hidden],
.viewer-tab-pane[hidden] {
  display: none !important;
}

.viewer-tab-list {
  display: flex;
  gap: 6px;
  align-items: stretch;
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.025);
}

.viewer-tab-button {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(236, 227, 210, .74);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
  cursor: pointer;
}

.viewer-tab-button:hover {
  border-color: rgba(212,175,55,.3);
  color: #f4ead1;
}

.viewer-tab-button.is-active {
  border-color: rgba(212,175,55,.54);
  background: rgba(212,175,55,.13);
  color: #f6e7b0;
}

.viewer-tab-button span {
  color: rgba(236, 227, 210, .68);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.viewer-tab-pane {
  display: none;
  min-width: 0;
}

.viewer-tab-pane.is-active {
  display: block;
}

.board-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.board-meta-primary {
  display: grid;
  gap: 4px;
}

.board-meta-secondary {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.detach-game-board-btn,
.show-pawns-only-btn,
.mark-loose-pieces-btn {
  padding: 8px 12px;
  font-size: 12px;
  justify-content: center;
}

.show-pawns-only-btn.is-active,
.mark-loose-pieces-btn.is-active {
  border-color: rgba(222, 183, 82, .65);
  background: rgba(222, 183, 82, .16);
  color: var(--text);
}

.board-detail-list {
  display: grid;
  gap: 6px;
}

.board-detail-row {
  color: var(--muted);
  line-height: 1.45;
}

.board-detail-row strong {
  color: #e7f0ff;
}

.board-opponent-flag-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
}

.viewer-board-wrap {
  display: grid;
  gap: 8px;
}

.viewer-board-stage {
  display: grid;
  gap: 14px;
}

.sidebar-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.collapsible-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.collapsible-toggle-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}

.collapsible-body {
  display: none !important;
}

.collapsible-panel.is-expanded .collapsible-body {
  display: grid !important;
}

.opening-checklist-sections {
  display: grid;
  padding: 10px 12px 14px;
}

.piece-activity-panel .section-title-row h2,
.hung-pieces-panel .section-title-row h2,
.pawn-structure-panel .section-title-row h2,
.checklist-panel .section-title-row h2,
.debug-panel .section-title-row h2 {
  font-size: 18px;
  line-height: 1.15;
}

.piece-activity-panel .section-title-row {
  margin-bottom: 6px;
  padding: 6px 12px 0;
}

.hung-pieces-panel .section-title-row,
.pawn-structure-panel .section-title-row {
  margin-bottom: 6px;
  padding: 6px 12px 0;
}

.piece-activity-sections {
  display: grid;
  padding: 8px 12px 14px;
}

.tactics-tabs {
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.tactics-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tactics-tab-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.tactics-tab-counts {
  font-size: 11px;
  line-height: 1.1;
  color: rgba(236, 227, 210, 0.72);
}

.tactics-tab-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #22c55e;
  color: #05210f;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(212,255,225,.25);
}

.tactics-table {
  width: 100%;
}

.hung-pieces-table {
  width: 100%;
}

.pawn-structure-table {
  width: 100%;
  table-layout: fixed;
  font-size: 11px;
  line-height: 1.08;
  margin-bottom: 8px;
}

.pawn-structure-table-title {
  margin: 6px 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pawn-structure-table th,
.pawn-structure-table td {
  padding: 4px 5px;
  white-space: nowrap;
}

.pawn-structure-table th {
  font-size: 9px;
  line-height: 1;
  letter-spacing: .035em;
}

.pawn-structure-table th:nth-child(1),
.pawn-structure-table td:nth-child(1) {
  width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pawn-structure-table td.has-info-tooltip,
.hung-pieces-table td.has-info-tooltip {
  overflow: visible;
}

.pawn-structure-table th:nth-child(2),
.pawn-structure-table th:nth-child(3),
.pawn-structure-table th:nth-child(4),
.pawn-structure-table td:nth-child(2),
.pawn-structure-table td:nth-child(3),
.pawn-structure-table td:nth-child(4) {
  width: 10%;
  text-align: center;
}

.pawn-structure-table th:nth-child(5),
.pawn-structure-table td:nth-child(5) {
  width: 22%;
  overflow: hidden;
  text-overflow: clip;
}

.pawn-structure-table strong {
  font-size: 11px;
}

.pawn-structure-table .hung-piece-subtitle td {
  padding-top: 7px;
  padding-bottom: 4px;
  font-size: 10px;
  letter-spacing: .055em;
}

.pawn-structure-table .hung-move-list {
  flex-wrap: nowrap;
  gap: 1px 2px;
}

.pawn-structure-table .hung-move-link,
.pawn-structure-table .viewer-state-jump {
  font-size: 10px;
}

.pawn-structure-table .hung-move-separator {
  margin-right: 0;
}

.pawn-term-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  min-width: 0;
}

.pawn-term-info {
  width: .82rem;
  height: .82rem;
  min-width: .82rem;
  margin-left: 1px;
  padding: 0;
  background: transparent;
  font-size: .56rem;
  font-weight: 800;
  font-family: inherit;
}

.pawn-term-info-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.pawn-term-info .info-tooltip {
  display: grid;
  gap: 4px;
  min-width: 190px;
  max-width: 260px;
  white-space: normal;
  z-index: 30;
}

.pawn-term-info .info-tooltip strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.pawn-term-info .info-tooltip span {
  display: block;
  color: var(--muted);
}

.pawn-structure-panel .info-tooltip,
.hung-pieces-panel .info-tooltip {
  left: 0;
  right: auto;
  bottom: calc(100% + 8px);
  transform: translateY(6px);
  z-index: 100;
}

.pawn-structure-panel .info-tooltip::after,
.hung-pieces-panel .info-tooltip::after {
  left: 8px;
  transform: rotate(45deg);
}

.pawn-structure-panel .info-badge:hover .info-tooltip,
.pawn-structure-panel .info-badge:focus .info-tooltip,
.pawn-structure-panel .info-badge:focus-within .info-tooltip,
.hung-pieces-panel .info-badge:hover .info-tooltip,
.hung-pieces-panel .info-badge:focus .info-tooltip,
.hung-pieces-panel .info-badge:focus-within .info-tooltip {
  transform: translateY(0);
}

.hung-piece-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ff5f5f;
  font-weight: 900;
}

.hung-piece-alert span {
  color: #ffb4b4;
  font-size: 12px;
  font-weight: 800;
}

.hung-piece-subtitle td {
  padding-top: 14px;
  padding-bottom: 8px;
  color: #d4af37;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.035);
}

.opening-checklist-table {
  width: 100%;
  border-collapse: collapse;
}

.opening-checklist-table th,
.opening-checklist-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.opening-checklist-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.opening-check-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  font-weight: 800;
}

.opening-check-status-good {
  color: #79d98f;
}

.opening-check-status-bad {
  color: #ff7b7b;
}

.opening-check-status-grade {
  color: #d4af37;
}

.opening-info-badge {
  color: #fff;
  border-color: rgba(255,255,255,.78);
}

.opening-info-badge:hover,
.opening-info-badge:focus {
  color: #fff;
  border-color: #fff;
}

.move-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  align-content: start;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(103,179,255,.04);
  overflow: hidden;
}

.move-list-header {
  padding: 10px 10px 9px;
  border-bottom: 1px solid var(--line-soft);
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: #eef5ff;
}

.move-list-columns {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  padding: 8px 7px 6px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.02);
}

.move-list-columns-spacer {
  min-height: 1px;
}

.move-list-column-label {
  color: #d4af37;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.move-list-body {
  display: grid;
  gap: 2px;
  max-height: 760px;
  overflow: auto;
  padding: 7px 11px 7px 7px;
}

.move-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.move-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.move-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 6px;
  background: rgba(255,255,255,.02);
  color: #d9e8ff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.move-cell-san {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.move-list-deep-thought-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.move-list-deep-thought-icon .board-deep-thought-icon {
  width: 13px;
  height: 13px;
  filter: none;
}

.move-cell:hover {
  background: rgba(103,179,255,.12);
  border-color: rgba(103,179,255,.22);
}

.move-cell.is-active {
  background: linear-gradient(180deg, rgba(212,175,55,.24), rgba(212,175,55,.14));
  border-color: rgba(212,175,55,.55);
  color: #fff5cf;
}

.move-cell-empty {
  min-height: 28px;
}

.viewer-board-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: stretch;
}

.board-coords {
  display: grid;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.board-coords-top,
.board-coords-bottom {
  grid-template-columns: repeat(8, 1fr);
  padding: 0 32px;
}

.board-coords-left,
.board-coords-right {
  grid-template-rows: repeat(8, 1fr);
  align-items: center;
}

.viewer-board {
  aspect-ratio: 1 / 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 48px rgba(12,28,58,.16);
}

.viewer-square {
  position: relative;
  display: grid;
  place-items: center;
}

.viewer-square.is-light {
  background: #f1e0c5;
}

.viewer-square.is-dark {
  background: #b8895b;
}

.viewer-square.is-highlight {
  box-shadow: inset 0 0 0 4px rgba(255, 215, 0, .52);
}

.viewer-square.is-highlight.is-hung-piece {
  box-shadow: inset 0 0 0 4px rgba(255, 215, 0, .52);
}

.move-origin-time-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.move-origin-time-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(7,18,38,.74);
  color: #fff7d6;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}

.move-origin-time-overlay.is-white-move .move-origin-time-text {
  background: rgba(255,247,214,.88);
  color: #071226;
}

.move-origin-time-overlay.is-white-move .deep-thought-cog {
  stroke: #071226;
}

.board-deep-thought-icon {
  width: 23px;
  height: 23px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.32));
}

.hung-piece-board-alert {
  position: absolute;
  top: 4px;
  right: 5px;
  z-index: 4;
  display: block;
  width: 26px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 14'%3E%3Cpolygon points='1,13 13,1 25,13' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: auto;
}

.loose-piece-board-alert,
.check-board-alert {
  position: absolute;
  top: 4px;
  right: 5px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(127, 29, 29, .32);
  pointer-events: auto;
}

.check-board-alert {
  width: 20px;
  height: 20px;
  font-size: 15px;
  background: #b91c1c;
}

.viewer-piece-img.is-checkmated-king {
  transform: rotate(45deg);
  transform-origin: 50% 50%;
}

.viewer-square.is-fork-source {
  box-shadow: inset 0 0 0 4px rgba(94, 234, 212, .78);
}

.viewer-square.is-discovered-source {
  box-shadow: inset 0 0 0 4px rgba(45, 212, 191, .95);
}

.viewer-square.is-discovered-slider {
  box-shadow: inset 0 0 0 4px rgba(56, 189, 248, .9);
}

.viewer-square.is-discovered-source.is-discovered-slider {
  box-shadow:
    inset 0 0 0 4px rgba(45, 212, 191, .95),
    inset 0 0 0 8px rgba(56, 189, 248, .55);
}

.viewer-square.is-fork-destination {
  box-shadow: inset 0 0 0 4px rgba(251, 191, 36, .86);
}

.viewer-square.is-fork-target::after {
  content: "";
  position: absolute;
  inset: 15%;
  border: 3px solid rgba(248, 113, 113, .92);
  border-radius: 999px;
  pointer-events: none;
}

.viewer-board-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.fork-arrow {
  stroke: rgba(94, 234, 212, .96);
  stroke-width: 1.1;
  stroke-linecap: round;
}

.discovered-origin-arrow {
  stroke-width: .65;
}

.fork-arrowhead {
  fill: rgba(94, 234, 212, .96);
}

.viewer-piece-img {
  width: min(88%, 52px);
  height: min(88%, 52px);
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.tactic-gallery-stack {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.tactic-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.tactic-gallery-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
}

.tactic-gallery-filter {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .18);
}

.tactic-gallery-filter-btn {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  white-space: nowrap;
}

.tactic-gallery-filter-btn:hover {
  color: var(--text);
}

.tactic-gallery-filter-btn.is-active {
  background: rgba(245, 158, 11, .18);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .28);
}

.game-time-management-card {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.game-time-management-panel {
  display: grid;
  gap: 14px;
}

.time-curve-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.time-curve-mode-toggle {
  display: inline-flex;
  width: max-content;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
}

.time-curve-mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.time-curve-mode-btn.is-active {
  background: var(--accent);
  color: #1f2937;
}

.time-curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.time-curve-legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.time-curve-legend-item span {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}

.time-curve-user-key {
  background: var(--chart-line);
  height: 4px !important;
}

.time-curve-opponent-key {
  background: #ef4444;
  height: 4px !important;
}

.time-curve-material-key {
  background: #f8fafc;
  height: 4px !important;
}

.material-change-dot circle {
  fill: #f8fafc;
  stroke: #111827;
  stroke-width: 1.4;
  cursor: pointer;
}

.material-change-dot:hover circle {
  fill: #ffffff;
  stroke: #67b3ff;
  stroke-width: 2;
}

.material-metric-callout {
  cursor: pointer;
}

.material-metric-callout:hover rect {
  fill: rgba(30, 41, 59, .96);
  stroke: #fbbf24;
}

.deep-thought-marker {
  cursor: pointer;
}

.deep-thought-cog {
  fill: none;
  stroke: #f6e7b0;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.deep-thought-marker:hover .deep-thought-cog {
  stroke: #ffffff;
}

.game-sequence-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.board-game-sequence-controls {
  margin-top: 16px;
}

.time-game-sequence-controls {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.game-sequence-btn {
  min-width: 124px;
  justify-content: center;
}

.game-sequence-btn .shortcut-hint {
  margin-left: 6px;
  font-size: .78em;
  opacity: .72;
  white-space: nowrap;
}

.game-sequence-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}

.time-curve-grid {
  display: grid;
  gap: 16px;
}

.time-curve-panel {
  min-width: 0;
}

.game-time-curve-svg {
  width: 100%;
  height: auto;
  display: block;
}

.tactic-gallery-tabs {
  flex-wrap: wrap;
}

.tactic-gallery-tabs .viewer-tab-button {
  flex: 1 1 190px;
}

.tactic-gallery-card {
  display: grid;
  gap: 0;
  padding: 0;
}

.tactic-gallery-card .fork-gallery,
.tactic-gallery-tab-card .fork-gallery {
  padding: 14px 18px 18px;
}

.fork-gallery {
  display: grid;
  gap: 18px;
}

.fork-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(620px, 1fr));
  gap: 18px;
}

.fork-gallery-item {
  display: grid;
  grid-template-columns: 404px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(255,255,255,.035);
}

.fork-gallery-item.is-current {
  border-color: rgba(212,175,55,.6);
  box-shadow: 0 0 0 1px rgba(212,175,55,.18), 0 18px 38px rgba(12,28,58,.16);
}

.fork-gallery-board-wrap {
  min-width: 0;
}

.fork-gallery-board-shell {
  display: grid;
  grid-template-rows: 22px 360px 22px;
  grid-template-columns: 404px;
  width: 404px;
  height: 404px;
  padding: 0;
  border: 2px solid #000;
  background: #000;
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}

.fork-gallery-board-row {
  display: grid;
  grid-template-columns: 22px 360px 22px;
  min-width: 0;
}

.fork-gallery-coords {
  display: grid;
  align-items: center;
  justify-items: center;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.fork-gallery-files {
  grid-template-columns: repeat(8, 1fr);
  padding: 0 22px;
}

.fork-gallery-ranks {
  grid-template-rows: repeat(8, 1fr);
}

.fork-gallery-board {
  aspect-ratio: 1 / 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  width: 360px;
  height: 360px;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow: none;
}

.fork-gallery-board .viewer-square.is-highlight,
.fork-gallery-board .viewer-square.is-fork-source,
.fork-gallery-board .viewer-square.is-fork-destination {
  background: #7dd3fc;
  box-shadow: inset 0 0 0 2px #000;
}

.fork-gallery-board .viewer-square.is-fork-destination {
  background: #22c55e;
  box-shadow: inset 0 0 0 2px #000;
}

.fork-gallery-board .viewer-square.is-fork-target {
  background: #f87171;
  box-shadow: inset 0 0 0 2px #000;
}

.fork-gallery-board .viewer-square.is-fork-target::after {
  display: none;
}

.fork-gallery-board .viewer-piece-img {
  width: min(88%, 42px);
  height: min(88%, 42px);
}

.fork-gallery-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.fork-gallery-copy h3 {
  margin: 0;
  color: #eef5ff;
  font-family: "Inter Tight", "Inter", "Montserrat", system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.fork-gallery-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.fork-gallery-copy strong {
  color: #e7f0ff;
}

.viewer-state-jump {
  color: #f6e7b0;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(212,175,55,.55);
  text-underline-offset: 2px;
  cursor: pointer;
}

.viewer-state-jump:hover {
  color: #fff5cf;
  text-decoration-color: rgba(212,175,55,.9);
}

.hung-move-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  align-items: center;
}

.hung-move-separator {
  color: var(--muted);
  margin-right: 1px;
}

.fork-gallery-kicker {
  color: #d4af37;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fork-gallery-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.fork-gallery-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .035em;
  line-height: 1;
  text-transform: uppercase;
}

.fork-gallery-status.is-good {
  border-color: rgba(74, 222, 128, .42);
  background: rgba(34, 197, 94, .14);
  color: #bbf7d0;
}

.fork-gallery-status.is-warning {
  border-color: rgba(251, 191, 36, .5);
  background: rgba(245, 158, 11, .14);
  color: #fde68a;
}

.fork-gallery-status.is-neutral {
  border-color: rgba(125, 211, 252, .38);
  background: rgba(14, 165, 233, .12);
  color: #bae6fd;
}

.fork-gallery-debug {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(12,28,58,.18);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.fork-gallery-debug code {
  color: #d9e8ff;
  word-break: break-all;
}

.fork-gallery-jump {
  justify-self: start;
  margin-top: 4px;
  padding: 8px 12px;
  font-size: 13px;
}

.viewer-state-bar {
  display: grid;
  gap: 4px;
}

.viewer-state-extra {
  font-size: 12px;
  line-height: 1.35;
}

.viewer-controls {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.viewer-nav-btn {
  min-width: 0;
  justify-content: center;
  padding: 10px 12px;
}

.viewer-nav-icon-btn {
  font-size: 18px;
  font-weight: 800;
}

.viewer-nav-center-btn {
  font-weight: 800;
}

.checklist-sections {
  display: grid;
  gap: 14px;
  padding: 6px 4px 4px;
}

.checklist-group {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 18px;
  background: rgba(103,179,255,.04);
}

.checklist-group h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 14px;
}

.checklist-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.checklist-item:last-child {
  border-bottom: 0;
}

.checklist-label {
  color: var(--muted);
}

.checklist-value {
  white-space: nowrap;
}

html[data-theme="chess"] body:has(.game-viewer-shell) {
  background:
    radial-gradient(ellipse at top, rgba(255,215,0,0.08), transparent 60%),
    linear-gradient(180deg, #0b0f1a 0%, #121826 100%);
}

html[data-theme="chess"] .game-viewer-shell .card {
  border: 1px solid rgba(212,175,55,.28);
  background: linear-gradient(135deg, #2b1d0f 0%, #1b1714 45%, #0c1118 100%);
}

html[data-theme="chess"] .game-viewer-hero::before {
  background: radial-gradient(
    ellipse at center,
    rgba(255,190,45,.30) 0%,
    rgba(196,120,20,.14) 38%,
    transparent 72%
  );
}

html[data-theme="chess"] .game-viewer-shell .lede,
html[data-theme="chess"] .board-detail-row,
html[data-theme="chess"] .checklist-label,
html[data-theme="chess"] .move-number {
  color: #d0c7b8;
}

html[data-theme="chess"] .game-selector-table-wrap,
html[data-theme="chess"] .move-list-panel,
html[data-theme="chess"] .checklist-group {
  border-color: rgba(212,175,55,.18);
}

html[data-theme="chess"] .move-list-panel,
html[data-theme="chess"] .checklist-group,
html[data-theme="chess"] .game-selector-table-wrap,
html[data-theme="chess"] .opening-checklist-panel,
html[data-theme="chess"] .piece-activity-panel,
html[data-theme="chess"] .checklist-panel {
  background: rgba(240,217,181,.05);
}

@media (max-width: 980px) {
  .game-viewer-main {
    grid-template-columns: 1fr;
  }

  .move-list-body {
    max-height: 220px;
  }

  .fork-gallery-item {
    grid-template-columns: 1fr;
  }

  .fork-gallery-board-shell {
    width: min(404px, 100%);
    height: auto;
  }

  .fork-gallery-board-row,
  .fork-gallery-board {
    max-width: 360px;
  }
}

@media (max-width: 1100px) {
  .landing-grid {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }

  .landing-copy {
    padding-right: 0;
  }

  .landing-visual-wrap {
    min-height: 0;
    padding-top: 6px;
    justify-content: center;
  }

  .landing-visual {
    width: min(100%, 460px);
    transform: translate(0, -6px);
  }

  .loaded-sources-list {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .game-viewer-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .landing-page {
    padding: 18px 18px 36px;
  }

  .landing-brand {
    margin-bottom: 18px;
    font-size: clamp(44px, 12vw, 62px);
  }

  .landing-card {
    padding: 36px 22px 28px;
  }

  .landing-title {
    font-size: clamp(40px, 11vw, 56px);
  }

  .landing-title .line {
    white-space: normal;
  }

  .source-tabs {
    grid-template-columns: 1fr;
  }

  .source-tab {
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid rgba(212,175,55,.18);
    padding: 16px 18px;
    font-size: 18px;
  }

  .source-tab:last-child {
    border-bottom: 0;
  }

  .source-panel {
    padding: 22px 18px;
  }

  .source-panel-form {
    grid-template-columns: 1fr;
  }

  .source-load-button {
    width: 100%;
    min-width: 0;
  }

  .landing-input-grid,
  .landing-password-row {
    grid-template-columns: 1fr;
  }

  .username-fields-row {
    grid-template-columns: 1fr;
  }

  .same-user-panel {
    width: 100%;
    height: 52px;
  }

  .landing-generate-btn {
    width: 100%;
    min-width: 0;
    font-size: 20px;
  }

  .landing-generate-wrap {
    gap: 14px;
  }

  .report-type-buttons {
    grid-template-columns: 1fr;
  }

  .clear-batch-button {
    width: 100%;
  }

  .landing-footnote {
    margin-top: 22px;
    font-size: 16px;
    text-align: center;
    flex-wrap: wrap;
  }

  .report-head {
    flex-direction: column;
  }

  .report-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-switch {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .global-theme-switch {
    width: auto;
    justify-content: flex-start;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .report-head h1,
  .status-card h1 {
    font-size: 40px;
  }

  .status-shell {
    padding: 24px 18px 40px;
  }

  .premium-status-card {
    padding: 34px 24px;
  }

  .hero-form {
    flex-direction: column;
  }

  .elo-big {
    font-size: 48px;
  }

  .viewer-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .board-meta {
    flex-direction: column;
  }
}
