:root {
  --header-h: 104px;
  --shell-radius: 18px;
  --surface: rgba(10, 10, 10, 0.82);
  --surface-solid: #0b0b0b;
  --surface-light: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 68, 68, 0.25);
  --glow: 0 32px 60px rgba(120, 0, 0, 0.25);
  --text-main: #f9f5f5;
  --text-dim: #f0aaaa;
  --accent: #ff5959;
  --accent-strong: #c40000;
  --accent-soft: rgba(196, 0, 0, 0.18);
  --tip-bg: rgba(12, 12, 12, 0.96);
  --tip-border: rgba(196, 0, 0, 0.8);
  --tip-shadow: 0 20px 42px rgba(196, 0, 0, 0.35), 0 0 0 1px rgba(255, 80, 80, 0.35) inset;
  --tip-radius: 14px;
  --tip-padding-y: 0.85rem;
  --tip-padding-x: 1rem;
  --tip-maxw: min(380px, calc(100vw - 24px));
  --tip-gap: 12px;
  --sidebar-left-width: 288px;
  --sidebar-right-width: 232px;
  --sidebar-gap: clamp(16px, 2vw, 24px);
  --compact-sidebar-width: clamp(200px, 70vw, 280px);
  font-family: "Franklin Gothic Medium", "Franklin Gothic Demi", "Arial Black", Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% -20%, rgba(196, 0, 0, 0.22), transparent 55%),
              radial-gradient(circle at 80% -10%, rgba(128, 0, 0, 0.28), transparent 58%),
              #040404;
  color: var(--text-main);
  overflow-x: hidden;
  font-weight: 500;
}

body:not(.art-theme) nav.sidebar {
  background: linear-gradient(180deg, rgba(196, 0, 0, 0.9), rgba(38, 0, 0, 0.98));
  border-color: rgba(255, 80, 80, 0.32);
  box-shadow: 0 28px 60px rgba(196, 0, 0, 0.3);
}

/* Visual art theme palettes */
body.art-theme-african {
  --tip-bg: rgba(214, 255, 243, 0.96);
  --tip-border: rgba(36, 150, 125, 0.85);
  --tip-shadow: 0 22px 42px rgba(12, 70, 60, 0.42), 0 0 0 1px rgba(160, 255, 225, 0.5) inset;
  background: radial-gradient(circle at 18% -16%, rgba(24, 120, 108, 0.3), transparent 58%),
              radial-gradient(circle at 72% -10%, rgba(40, 100, 170, 0.25), transparent 60%),
              #061513;
}

body.art-theme-african .app-header {
  background: linear-gradient(135deg, rgba(10, 80, 70, 0.95), rgba(44, 150, 125, 0.88));
  border-bottom: 1px solid rgba(140, 230, 205, 0.42);
}

body.art-theme-african .brand-mark {
  border-color: rgba(120, 230, 205, 0.52);
}

body.art-theme-african .subnav .section-title {
  color: #ccfff4;
}

body.art-theme-african .subnav-inline-toggle {
  background: rgba(26, 120, 100, 0.3);
  border-color: rgba(130, 235, 210, 0.52);
  color: #d8fff6;
}

body.art-theme-african .subnav-inline-toggle:hover {
  background: rgba(36, 150, 125, 0.45);
  border-color: rgba(150, 245, 220, 0.6);
}

body.art-theme-african .pills a {
  background: rgba(20, 95, 82, 0.5);
  box-shadow: inset 0 0 0 1px rgba(130, 235, 210, 0.36);
  color: #eafff8;
}

body.art-theme-african .pills a:hover {
  background: rgba(36, 140, 120, 0.62);
  box-shadow: 0 12px 24px rgba(10, 70, 58, 0.4), inset 0 0 0 1px rgba(150, 245, 220, 0.5);
}

body.art-theme-african .pills a.active {
  background: linear-gradient(135deg, rgba(60, 200, 170, 0.96), rgba(24, 120, 105, 0.95));
  box-shadow: 0 16px 35px rgba(24, 120, 105, 0.48);
}

body.art-theme-african .nav-toggle {
  background: rgba(12, 70, 60, 0.64);
  border-color: rgba(120, 235, 210, 0.46);
}

body.art-theme-african nav.sidebar {
  background: linear-gradient(180deg, rgba(12, 70, 62, 0.92), rgba(3, 28, 24, 0.98));
  border-color: rgba(120, 235, 210, 0.46);
  box-shadow: 0 28px 60px rgba(6, 40, 34, 0.38);
}

body.art-theme-african .art-card-artist {
  background: rgba(30, 150, 128, 0.22);
  border-color: rgba(140, 240, 215, 0.5);
  color: #c8fff3;
}

body.art-theme-african .art-card .artwork {
  background: rgba(6, 45, 40, 0.82);
  border-color: rgba(120, 235, 210, 0.42);
}

body.art-theme-african .art-card .artwork figcaption {
  border-top: 1px solid rgba(140, 240, 215, 0.3);
  color: rgba(210, 255, 245, 0.9);
}

body.art-theme-african nav.sidebar details,
body.art-theme-african nav.sidebar .sidebar-section,
body.art-theme-african nav.sidebar .snapshot,
body.art-theme-african nav.sidebar .keywords,
body.art-theme-african nav.sidebar .grade-switcher {
  background: rgba(6, 35, 32, 0.56);
  border-color: rgba(120, 235, 210, 0.28);
}

body.art-theme-african nav.sidebar a:hover,
body.art-theme-african nav.sidebar summary:hover {
  background: rgba(38, 160, 135, 0.3);
}

body.art-theme-african .art-hero {
  background: linear-gradient(135deg, rgba(12, 78, 68, 0.92), rgba(42, 150, 124, 0.86));
  border-color: rgba(130, 240, 210, 0.4);
  box-shadow: 0 32px 70px rgba(14, 70, 60, 0.4);
}

body.art-theme-african .art-card {
  background: rgba(6, 38, 34, 0.84);
  border-color: rgba(120, 235, 210, 0.34);
  box-shadow: 0 26px 56px rgba(8, 48, 42, 0.42);
}

body.art-theme-african #vs-tooltip {
  color: #04352d;
}

body.art-theme-african #vs-tooltip .vs-tip-caption {
  color: #07483d;
}

body.art-theme-african #vs-tooltip .vs-tip-close {
  color: rgba(12, 90, 76, 0.7);
}

body.art-theme-african #vs-tooltip .vs-tip-close:hover {
  color: #04352d;
  background: rgba(12, 90, 76, 0.18);
}

body.art-theme-african .art-hero-tile {
  border-color: rgba(130, 240, 210, 0.34);
}

body.art-theme-prehistoric {
  --tip-bg: rgba(255, 214, 170, 0.97);
  --tip-border: rgba(180, 80, 20, 0.88);
  --tip-shadow: 0 22px 42px rgba(150, 70, 0, 0.42), 0 0 0 1px rgba(255, 200, 150, 0.55) inset;
  background: radial-gradient(circle at 18% -12%, rgba(210, 90, 10, 0.32), transparent 58%),
              radial-gradient(circle at 76% -16%, rgba(40, 80, 120, 0.3), transparent 60%),
              #140801;
}

body.art-theme-prehistoric .app-header {
  background: linear-gradient(135deg, rgba(120, 40, 0, 0.94), rgba(200, 120, 0, 0.86));
  border-bottom: 1px solid rgba(255, 180, 100, 0.4);
}

body.art-theme-prehistoric .brand-mark {
  border-color: rgba(255, 190, 120, 0.52);
}

body.art-theme-prehistoric .subnav .section-title {
  color: #ffe5c6;
}

body.art-theme-prehistoric .subnav-inline-toggle {
  background: rgba(180, 80, 0, 0.3);
  border-color: rgba(255, 190, 120, 0.5);
  color: #ffecd6;
}

body.art-theme-prehistoric .subnav-inline-toggle:hover {
  background: rgba(210, 110, 20, 0.45);
  border-color: rgba(255, 205, 140, 0.6);
}

body.art-theme-prehistoric .pills a {
  background: rgba(160, 70, 10, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 190, 120, 0.36);
  color: #ffeedd;
}

body.art-theme-prehistoric .pills a:hover {
  background: rgba(200, 100, 20, 0.6);
  box-shadow: 0 12px 24px rgba(120, 50, 0, 0.4), inset 0 0 0 1px rgba(255, 210, 150, 0.5);
}

body.art-theme-prehistoric .pills a.active {
  background: linear-gradient(135deg, rgba(255, 190, 100, 0.96), rgba(180, 90, 10, 0.95));
  box-shadow: 0 16px 35px rgba(180, 90, 10, 0.48);
}

body.art-theme-prehistoric .nav-toggle {
  background: rgba(110, 45, 0, 0.64);
  border-color: rgba(255, 190, 120, 0.45);
}

body.art-theme-prehistoric nav.sidebar {
  background: linear-gradient(180deg, rgba(200, 110, 20, 0.9), rgba(60, 18, 0, 0.96));
  border-color: rgba(255, 190, 120, 0.45);
  box-shadow: 0 28px 60px rgba(140, 60, 10, 0.35);
}

body.art-theme-prehistoric .art-card-artist {
  background: rgba(180, 90, 10, 0.3);
  border-color: rgba(255, 190, 120, 0.46);
  color: #ffe3c0;
}

body.art-theme-prehistoric .art-card .artwork {
  background: rgba(70, 30, 0, 0.78);
  border-color: rgba(255, 190, 120, 0.42);
}

body.art-theme-prehistoric .art-card .artwork figcaption {
  border-top: 1px solid rgba(255, 200, 140, 0.3);
  color: rgba(255, 225, 190, 0.9);
}

body.art-theme-prehistoric nav.sidebar details,
body.art-theme-prehistoric nav.sidebar .sidebar-section,
body.art-theme-prehistoric nav.sidebar .snapshot,
body.art-theme-prehistoric nav.sidebar .keywords,
body.art-theme-prehistoric nav.sidebar .grade-switcher {
  background: rgba(60, 20, 0, 0.52);
  border-color: rgba(255, 180, 120, 0.28);
}

body.art-theme-prehistoric nav.sidebar a:hover,
body.art-theme-prehistoric nav.sidebar summary:hover {
  background: rgba(200, 100, 20, 0.32);
}

body.art-theme-prehistoric .art-hero {
  background: linear-gradient(135deg, rgba(130, 45, 0, 0.92), rgba(215, 130, 20, 0.84));
  border-color: rgba(255, 190, 120, 0.4);
  box-shadow: 0 32px 70px rgba(160, 70, 10, 0.4);
}

body.art-theme-prehistoric .art-card {
  background: rgba(70, 25, 0, 0.82);
  border-color: rgba(255, 190, 120, 0.32);
  box-shadow: 0 26px 56px rgba(110, 45, 0, 0.4);
}

body.art-theme-prehistoric #vs-tooltip {
  color: #2f1605;
}

body.art-theme-prehistoric #vs-tooltip .vs-tip-caption {
  color: #4a210a;
}

body.art-theme-prehistoric #vs-tooltip .vs-tip-close {
  color: rgba(74, 33, 10, 0.68);
}

body.art-theme-prehistoric #vs-tooltip .vs-tip-close:hover {
  color: #2f1605;
  background: rgba(74, 33, 10, 0.14);
}

body.art-theme-prehistoric .art-hero-tile {
  border-color: rgba(255, 190, 120, 0.34);
}

body.art-theme-mesopotamian {
  --tip-bg: rgba(249, 229, 185, 0.97);
  --tip-border: rgba(170, 120, 50, 0.88);
  --tip-shadow: 0 22px 42px rgba(110, 80, 30, 0.38), 0 0 0 1px rgba(245, 220, 165, 0.55) inset;
  background: radial-gradient(circle at 18% -14%, rgba(210, 180, 110, 0.35), transparent 58%),
              radial-gradient(circle at 74% -12%, rgba(120, 90, 40, 0.3), transparent 60%),
              #1a1003;
}

body.art-theme-mesopotamian .app-header {
  background: linear-gradient(135deg, rgba(90, 60, 20, 0.94), rgba(170, 120, 40, 0.86));
  border-bottom: 1px solid rgba(240, 210, 140, 0.4);
}

body.art-theme-mesopotamian .brand-mark {
  border-color: rgba(240, 210, 150, 0.5);
}

body.art-theme-mesopotamian .subnav .section-title {
  color: #fbeed1;
}

body.art-theme-mesopotamian .subnav-inline-toggle {
  background: rgba(160, 120, 40, 0.28);
  border-color: rgba(240, 210, 150, 0.48);
  color: #fff6d8;
}

body.art-theme-mesopotamian .subnav-inline-toggle:hover {
  background: rgba(190, 140, 50, 0.4);
  border-color: rgba(245, 220, 160, 0.6);
}

body.art-theme-mesopotamian .pills a {
  background: rgba(130, 100, 40, 0.44);
  box-shadow: inset 0 0 0 1px rgba(240, 210, 150, 0.35);
  color: #fff4da;
}

body.art-theme-mesopotamian .pills a:hover {
  background: rgba(170, 130, 50, 0.58);
  box-shadow: 0 12px 24px rgba(110, 80, 30, 0.4), inset 0 0 0 1px rgba(245, 220, 165, 0.5);
}

body.art-theme-mesopotamian .pills a.active {
  background: linear-gradient(135deg, rgba(240, 210, 150, 0.96), rgba(170, 120, 40, 0.95));
  box-shadow: 0 16px 35px rgba(170, 120, 40, 0.48);
}

body.art-theme-mesopotamian .nav-toggle {
  background: rgba(110, 80, 30, 0.64);
  border-color: rgba(240, 210, 150, 0.4);
}

body.art-theme-mesopotamian nav.sidebar {
  background: linear-gradient(180deg, rgba(200, 170, 100, 0.88), rgba(65, 40, 10, 0.96));
  border-color: rgba(240, 210, 150, 0.42);
  box-shadow: 0 28px 60px rgba(120, 90, 30, 0.32);
}

body.art-theme-mesopotamian .art-card-artist {
  background: rgba(160, 120, 40, 0.3);
  border-color: rgba(240, 210, 150, 0.4);
  color: #fceccc;
}

body.art-theme-mesopotamian .art-card .artwork {
  background: rgba(70, 50, 20, 0.78);
  border-color: rgba(240, 210, 150, 0.36);
}

body.art-theme-mesopotamian .art-card .artwork figcaption {
  border-top: 1px solid rgba(240, 210, 150, 0.32);
  color: rgba(250, 230, 180, 0.9);
}

body.art-theme-mesopotamian nav.sidebar details,
body.art-theme-mesopotamian nav.sidebar .sidebar-section,
body.art-theme-mesopotamian nav.sidebar .snapshot,
body.art-theme-mesopotamian nav.sidebar .keywords,
body.art-theme-mesopotamian nav.sidebar .grade-switcher {
  background: rgba(60, 40, 15, 0.5);
  border-color: rgba(240, 210, 155, 0.28);
}

body.art-theme-mesopotamian nav.sidebar a:hover,
body.art-theme-mesopotamian nav.sidebar summary:hover {
  background: rgba(180, 130, 50, 0.3);
}

body.art-theme-mesopotamian .art-hero {
  background: linear-gradient(135deg, rgba(110, 80, 30, 0.92), rgba(200, 150, 50, 0.84));
  border-color: rgba(240, 210, 150, 0.4);
  box-shadow: 0 32px 70px rgba(150, 110, 40, 0.42);
}

body.art-theme-mesopotamian .art-card {
  background: rgba(65, 45, 15, 0.82);
  border-color: rgba(240, 210, 150, 0.3);
  box-shadow: 0 26px 56px rgba(110, 80, 30, 0.38);
}

body.art-theme-mesopotamian #vs-tooltip {
  color: #36240c;
}

body.art-theme-mesopotamian #vs-tooltip .vs-tip-caption {
  color: #513618;
}

body.art-theme-mesopotamian #vs-tooltip .vs-tip-close {
  color: rgba(81, 54, 24, 0.68);
}

body.art-theme-mesopotamian #vs-tooltip .vs-tip-close:hover {
  color: #36240c;
  background: rgba(81, 54, 24, 0.14);
}

body.art-theme-mesopotamian .art-hero-tile {
  border-color: rgba(240, 210, 150, 0.32);
}

body.art-theme-egyptian {
  --tip-bg: rgba(250, 233, 180, 0.97);
  --tip-border: rgba(40, 90, 150, 0.88);
  --tip-shadow: 0 22px 42px rgba(30, 70, 130, 0.38), 0 0 0 1px rgba(255, 220, 160, 0.55) inset;
  background: radial-gradient(circle at 20% -14%, rgba(200, 150, 40, 0.3), transparent 60%),
              radial-gradient(circle at 78% -10%, rgba(20, 60, 110, 0.32), transparent 62%),
              #030814;
}

body.art-theme-egyptian .app-header {
  background: linear-gradient(135deg, rgba(18, 40, 80, 0.94), rgba(190, 150, 40, 0.9));
  border-bottom: 1px solid rgba(255, 210, 110, 0.42);
}

body.art-theme-egyptian .brand-mark {
  border-color: rgba(255, 210, 130, 0.5);
}

body.art-theme-egyptian .subnav .section-title {
  color: #ffeec6;
}

body.art-theme-egyptian .subnav-inline-toggle {
  background: rgba(20, 70, 120, 0.32);
  border-color: rgba(255, 210, 130, 0.45);
  color: #fef4d2;
}

body.art-theme-egyptian .subnav-inline-toggle:hover {
  background: rgba(30, 90, 150, 0.45);
  border-color: rgba(255, 220, 150, 0.58);
}

body.art-theme-egyptian .pills a {
  background: rgba(30, 80, 140, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 130, 0.36);
  color: #fff4d4;
}

body.art-theme-egyptian .pills a:hover {
  background: rgba(40, 100, 160, 0.6);
  box-shadow: 0 12px 24px rgba(20, 70, 130, 0.4), inset 0 0 0 1px rgba(255, 225, 160, 0.5);
}

body.art-theme-egyptian .pills a.active {
  background: linear-gradient(135deg, rgba(255, 220, 140, 0.96), rgba(50, 110, 170, 0.95));
  box-shadow: 0 16px 35px rgba(40, 90, 150, 0.5);
}

body.art-theme-egyptian .nav-toggle {
  background: rgba(30, 80, 140, 0.62);
  border-color: rgba(255, 210, 130, 0.45);
}

body.art-theme-egyptian nav.sidebar {
  background: linear-gradient(180deg, rgba(25, 50, 110, 0.92), rgba(150, 110, 40, 0.9));
  border-color: rgba(255, 210, 130, 0.44);
  box-shadow: 0 28px 60px rgba(40, 60, 120, 0.32);
}

body.art-theme-egyptian .art-card-artist {
  background: rgba(40, 90, 150, 0.32);
  border-color: rgba(255, 210, 140, 0.46);
  color: #ffe8be;
}

body.art-theme-egyptian .art-card .artwork {
  background: rgba(20, 45, 95, 0.78);
  border-color: rgba(255, 210, 140, 0.38);
}

body.art-theme-egyptian .art-card .artwork figcaption {
  border-top: 1px solid rgba(255, 215, 150, 0.34);
  color: rgba(255, 235, 190, 0.9);
}

body.art-theme-egyptian nav.sidebar details,
body.art-theme-egyptian nav.sidebar .sidebar-section,
body.art-theme-egyptian nav.sidebar .snapshot,
body.art-theme-egyptian nav.sidebar .keywords,
body.art-theme-egyptian nav.sidebar .grade-switcher {
  background: rgba(16, 30, 60, 0.52);
  border-color: rgba(255, 210, 140, 0.3);
}

body.art-theme-egyptian nav.sidebar a:hover,
body.art-theme-egyptian nav.sidebar summary:hover {
  background: rgba(190, 140, 40, 0.32);
}

body.art-theme-egyptian .art-hero {
  background: linear-gradient(135deg, rgba(24, 50, 100, 0.92), rgba(220, 170, 50, 0.86));
  border-color: rgba(255, 210, 140, 0.4);
  box-shadow: 0 32px 70px rgba(30, 70, 140, 0.42);
}

body.art-theme-egyptian .art-card {
  background: rgba(18, 40, 90, 0.82);
  border-color: rgba(255, 210, 140, 0.32);
  box-shadow: 0 26px 56px rgba(24, 55, 120, 0.4);
}

body.art-theme-egyptian #vs-tooltip {
  color: #1c2d4c;
}

body.art-theme-egyptian #vs-tooltip .vs-tip-caption {
  color: #2e466a;
}

body.art-theme-egyptian #vs-tooltip .vs-tip-close {
  color: rgba(28, 45, 90, 0.7);
}

body.art-theme-egyptian #vs-tooltip .vs-tip-close:hover {
  color: #1c2d4c;
  background: rgba(28, 45, 90, 0.14);
}

body.art-theme-egyptian .art-hero-tile {
  border-color: rgba(255, 210, 140, 0.34);
}
body.art-theme-greek {
  --tip-bg: rgba(255, 212, 128, 0.97);
  --tip-border: rgba(120, 50, 180, 0.85);
  --tip-shadow: 0 22px 42px rgba(120, 40, 160, 0.42), 0 0 0 1px rgba(255, 228, 170, 0.6) inset;
  background: radial-gradient(circle at 25% -12%, rgba(255, 0, 170, 0.28), transparent 55%),
              radial-gradient(circle at 72% -14%, rgba(120, 0, 255, 0.26), transparent 60%),
              #150122;
}

body.art-theme-greek .app-header {
  background: linear-gradient(135deg, rgba(70, 0, 120, 0.94), rgba(200, 0, 180, 0.88));
  border-bottom: 1px solid rgba(255, 150, 255, 0.38);
}

body.art-theme-greek .brand-mark {
  border-color: rgba(255, 150, 255, 0.5);
}

body.art-theme-greek .subnav .section-title {
  color: #ffd9ff;
}

body.art-theme-greek .subnav-inline-toggle {
  background: rgba(180, 0, 160, 0.25);
  border-color: rgba(255, 170, 255, 0.5);
  color: #ffe4ff;
}

body.art-theme-greek .subnav-inline-toggle:hover {
  background: rgba(190, 0, 170, 0.4);
  border-color: rgba(255, 190, 255, 0.6);
}

body.art-theme-greek .pills a {
  background: rgba(150, 0, 200, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 170, 255, 0.4);
  color: #ffe6ff;
}

body.art-theme-greek .pills a:hover {
  background: rgba(190, 0, 220, 0.6);
  box-shadow: 0 12px 24px rgba(130, 0, 170, 0.4), inset 0 0 0 1px rgba(255, 200, 255, 0.5);
}

body.art-theme-greek .pills a.active {
  background: linear-gradient(135deg, rgba(255, 120, 255, 0.96), rgba(160, 0, 200, 0.95));
  box-shadow: 0 16px 35px rgba(150, 0, 200, 0.5);
}

body.art-theme-greek .nav-toggle {
  background: rgba(90, 0, 150, 0.62);
  border-color: rgba(255, 170, 255, 0.45);
}

body.art-theme-greek nav.sidebar {
  background: linear-gradient(180deg, rgba(110, 20, 190, 0.92), rgba(40, 0, 80, 0.96));
  border-color: rgba(215, 140, 255, 0.38);
  box-shadow: 0 28px 60px rgba(110, 20, 190, 0.32);
}

body.art-theme-greek .art-card-artist {
  background: rgba(160, 0, 200, 0.25);
  border-color: rgba(255, 170, 255, 0.45);
  color: #f5d9ff;
}

body.art-theme-greek .art-card .artwork {
  background: rgba(45, 0, 75, 0.75);
  border-color: rgba(255, 170, 255, 0.42);
}

body.art-theme-greek .art-card .artwork figcaption {
  border-top: 1px solid rgba(235, 170, 255, 0.3);
  color: rgba(240, 210, 255, 0.88);
}

body.art-theme-greek nav.sidebar details,
body.art-theme-greek nav.sidebar .sidebar-section,
body.art-theme-greek nav.sidebar .snapshot,
body.art-theme-greek nav.sidebar .keywords,
body.art-theme-greek nav.sidebar .grade-switcher {
  background: rgba(55, 0, 85, 0.48);
  border-color: rgba(255, 170, 255, 0.32);
}

body.art-theme-greek nav.sidebar a:hover,
body.art-theme-greek nav.sidebar summary:hover {
  background: rgba(180, 0, 210, 0.32);
}

body.art-theme-greek .art-hero {
  background: linear-gradient(135deg, rgba(60, 0, 90, 0.92), rgba(190, 0, 170, 0.84));
  border-color: rgba(255, 170, 255, 0.45);
  box-shadow: 0 32px 70px rgba(120, 0, 170, 0.4);
}

body.art-theme-greek .art-card {
  background: rgba(40, 0, 70, 0.82);
  border-color: rgba(255, 170, 255, 0.32);
  box-shadow: 0 26px 56px rgba(90, 0, 140, 0.38);
}

body.art-theme-greek #vs-tooltip {
  color: #2a0f39;
}

body.art-theme-greek #vs-tooltip .vs-tip-caption {
  color: #401553;
}

body.art-theme-greek #vs-tooltip .vs-tip-close {
  color: rgba(64, 17, 83, 0.65);
}

body.art-theme-greek #vs-tooltip .vs-tip-close:hover {
  color: #1d062b;
  background: rgba(64, 17, 83, 0.12);
}

body.art-theme-greek .art-hero-tile {
  border-color: rgba(255, 170, 255, 0.36);
}

body.art-theme-roman {
  --tip-bg: rgba(255, 226, 190, 0.97);
  --tip-border: rgba(180, 90, 50, 0.9);
  --tip-shadow: 0 22px 42px rgba(80, 40, 10, 0.36), 0 0 0 1px rgba(255, 200, 150, 0.55) inset;
  background: radial-gradient(circle at 20% -12%, rgba(0, 150, 100, 0.26), transparent 55%),
              radial-gradient(circle at 78% -16%, rgba(0, 110, 80, 0.32), transparent 60%),
              #02150f;
}

body.art-theme-roman .app-header {
  background: linear-gradient(135deg, rgba(0, 70, 45, 0.95), rgba(0, 140, 95, 0.88));
  border-bottom: 1px solid rgba(120, 255, 210, 0.32);
}

body.art-theme-roman .brand-mark {
  border-color: rgba(140, 255, 210, 0.45);
}

body.art-theme-roman .subnav .section-title {
  color: #c9ffdf;
}

body.art-theme-roman .subnav-inline-toggle {
  background: rgba(0, 120, 90, 0.24);
  border-color: rgba(120, 255, 210, 0.45);
  color: #ddffe9;
}

body.art-theme-roman .subnav-inline-toggle:hover {
  background: rgba(0, 150, 110, 0.38);
  border-color: rgba(150, 255, 220, 0.55);
}

body.art-theme-roman .pills a {
  background: rgba(0, 110, 80, 0.38);
  box-shadow: inset 0 0 0 1px rgba(120, 255, 210, 0.35);
  color: #e1ffef;
}

body.art-theme-roman .pills a:hover {
  background: rgba(0, 150, 110, 0.56);
  box-shadow: 0 12px 24px rgba(0, 90, 70, 0.38), inset 0 0 0 1px rgba(150, 255, 220, 0.5);
}

body.art-theme-roman .pills a.active {
  background: linear-gradient(135deg, rgba(0, 200, 160, 0.96), rgba(0, 130, 90, 0.95));
  box-shadow: 0 16px 35px rgba(0, 130, 90, 0.5);
}

body.art-theme-roman .nav-toggle {
  background: rgba(0, 90, 70, 0.64);
  border-color: rgba(120, 255, 210, 0.38);
}

body.art-theme-roman nav.sidebar {
  background: linear-gradient(180deg, rgba(0, 120, 80, 0.92), rgba(0, 50, 35, 0.98));
  border-color: rgba(120, 255, 210, 0.35);
  box-shadow: 0 28px 60px rgba(0, 90, 60, 0.3);
}

body.art-theme-roman .art-card-artist {
  background: rgba(0, 130, 95, 0.24);
  border-color: rgba(120, 255, 210, 0.4);
  color: #aaf5cd;
}

body.art-theme-roman .art-card .artwork {
  background: rgba(0, 55, 45, 0.74);
  border-color: rgba(120, 255, 210, 0.35);
}

body.art-theme-roman .art-card .artwork figcaption {
  border-top: 1px solid rgba(120, 255, 210, 0.28);
  color: rgba(210, 255, 235, 0.9);
}

body.art-theme-roman nav.sidebar details,
body.art-theme-roman nav.sidebar .sidebar-section,
body.art-theme-roman nav.sidebar .snapshot,
body.art-theme-roman nav.sidebar .keywords,
body.art-theme-roman nav.sidebar .grade-switcher {
  background: rgba(0, 70, 55, 0.46);
  border-color: rgba(120, 255, 210, 0.26);
}

body.art-theme-roman nav.sidebar a:hover,
body.art-theme-roman nav.sidebar summary:hover {
  background: rgba(0, 130, 95, 0.3);
}

body.art-theme-roman .art-hero {
  background: linear-gradient(135deg, rgba(0, 60, 40, 0.9), rgba(0, 140, 90, 0.82));
  border-color: rgba(120, 255, 210, 0.38);
  box-shadow: 0 32px 70px rgba(0, 120, 90, 0.38);
}

body.art-theme-roman .art-card {
  background: rgba(0, 55, 45, 0.82);
  border-color: rgba(120, 255, 210, 0.28);
  box-shadow: 0 26px 56px rgba(0, 100, 75, 0.36);
}

body.art-theme-roman #vs-tooltip {
  color: #2c180d;
}

body.art-theme-roman #vs-tooltip .vs-tip-caption {
  color: #4b2a17;
}

body.art-theme-roman #vs-tooltip .vs-tip-close {
  color: rgba(76, 38, 20, 0.7);
}

body.art-theme-roman #vs-tooltip .vs-tip-close:hover {
  color: #2c180d;
  background: rgba(76, 38, 20, 0.14);
}

body.art-theme-roman .art-hero-tile {
  border-color: rgba(120, 255, 210, 0.3);
}

body.art-theme-renaissance {
  --tip-bg: rgba(255, 224, 192, 0.97);
  --tip-border: rgba(180, 80, 20, 0.88);
  --tip-shadow: 0 22px 42px rgba(150, 60, 0, 0.4), 0 0 0 1px rgba(255, 200, 150, 0.55) inset;
  background: radial-gradient(circle at 24% -12%, rgba(255, 150, 40, 0.28), transparent 55%),
              radial-gradient(circle at 72% -18%, rgba(200, 80, 0, 0.32), transparent 62%),
              #2a1202;
}

body.art-theme-renaissance .app-header {
  background: linear-gradient(135deg, rgba(90, 30, 0, 0.95), rgba(180, 70, 0, 0.88));
  border-bottom: 1px solid rgba(255, 185, 120, 0.38);
}

body.art-theme-renaissance .brand-mark {
  border-color: rgba(255, 185, 120, 0.5);
}

body.art-theme-renaissance .subnav .section-title {
  color: #ffe6c5;
}

body.art-theme-renaissance .subnav-inline-toggle {
  background: rgba(160, 70, 0, 0.3);
  border-color: rgba(255, 190, 120, 0.5);
  color: #ffeeda;
}

body.art-theme-renaissance .subnav-inline-toggle:hover {
  background: rgba(190, 90, 0, 0.42);
  border-color: rgba(255, 205, 140, 0.6);
}

body.art-theme-renaissance .pills a {
  background: rgba(150, 70, 0, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 190, 120, 0.36);
  color: #fff2d8;
}

body.art-theme-renaissance .pills a:hover {
  background: rgba(190, 90, 0, 0.62);
  box-shadow: 0 12px 24px rgba(150, 60, 0, 0.42), inset 0 0 0 1px rgba(255, 210, 150, 0.52);
}

body.art-theme-renaissance .pills a.active {
  background: linear-gradient(135deg, rgba(255, 185, 80, 0.96), rgba(210, 100, 0, 0.95));
  box-shadow: 0 16px 35px rgba(210, 110, 0, 0.5);
}

body.art-theme-renaissance .nav-toggle {
  background: rgba(130, 55, 0, 0.65);
  border-color: rgba(255, 195, 130, 0.45);
}

body.art-theme-renaissance nav.sidebar {
  background: linear-gradient(180deg, rgba(200, 90, 18, 0.9), rgba(80, 24, 0, 0.97));
  border-color: rgba(255, 185, 120, 0.4);
  box-shadow: 0 28px 60px rgba(130, 50, 10, 0.34);
}

body.art-theme-renaissance .art-card-artist {
  background: rgba(170, 80, 0, 0.28);
  border-color: rgba(255, 190, 130, 0.46);
  color: #ffe7c4;
}

body.art-theme-renaissance .art-card .artwork {
  background: rgba(85, 35, 0, 0.78);
  border-color: rgba(255, 190, 130, 0.42);
}

body.art-theme-renaissance .art-card .artwork figcaption {
  border-top: 1px solid rgba(255, 200, 140, 0.3);
  color: rgba(255, 230, 200, 0.9);
}

body.art-theme-renaissance nav.sidebar details,
body.art-theme-renaissance nav.sidebar .sidebar-section,
body.art-theme-renaissance nav.sidebar .snapshot,
body.art-theme-renaissance nav.sidebar .keywords,
body.art-theme-renaissance nav.sidebar .grade-switcher {
  background: rgba(90, 40, 0, 0.52);
  border-color: rgba(255, 190, 120, 0.28);
}

body.art-theme-renaissance nav.sidebar a:hover,
body.art-theme-renaissance nav.sidebar summary:hover {
  background: rgba(200, 90, 0, 0.32);
}

body.art-theme-renaissance .art-hero {
  background: linear-gradient(135deg, rgba(120, 45, 0, 0.9), rgba(220, 120, 20, 0.86));
  border-color: rgba(255, 195, 130, 0.4);
  box-shadow: 0 32px 70px rgba(200, 100, 10, 0.38);
}

body.art-theme-renaissance .art-card {
  background: rgba(95, 40, 0, 0.82);
  border-color: rgba(255, 190, 120, 0.3);
  box-shadow: 0 26px 56px rgba(150, 60, 0, 0.38);
}

body.art-theme-renaissance #vs-tooltip {
  color: #2f1808;
}

body.art-theme-renaissance #vs-tooltip .vs-tip-caption {
  color: #4a2812;
}

body.art-theme-renaissance #vs-tooltip .vs-tip-close {
  color: rgba(74, 40, 16, 0.7);
}

body.art-theme-renaissance #vs-tooltip .vs-tip-close:hover {
  color: #2f1808;
  background: rgba(74, 40, 16, 0.14);
}

body.art-theme-renaissance .art-hero-tile {
  border-color: rgba(255, 195, 130, 0.34);
}

body.art-theme-baroque {
  --tip-bg: rgba(250, 228, 190, 0.97);
  --tip-border: rgba(70, 60, 140, 0.88);
  --tip-shadow: 0 22px 42px rgba(40, 50, 120, 0.4), 0 0 0 1px rgba(210, 170, 110, 0.5) inset;
  background: radial-gradient(circle at 18% -14%, rgba(255, 190, 0, 0.22), transparent 55%),
              radial-gradient(circle at 80% -16%, rgba(90, 50, 170, 0.3), transparent 60%),
              #050a19;
}

body.art-theme-baroque .app-header {
  background: linear-gradient(135deg, rgba(20, 30, 90, 0.95), rgba(120, 60, 0, 0.88));
  border-bottom: 1px solid rgba(255, 215, 130, 0.38);
}

body.art-theme-baroque .brand-mark {
  border-color: rgba(255, 215, 140, 0.5);
}

body.art-theme-baroque .subnav .section-title {
  color: #ffeec4;
}

body.art-theme-baroque .subnav-inline-toggle {
  background: rgba(200, 140, 40, 0.28);
  border-color: rgba(255, 215, 140, 0.5);
  color: #fff0ca;
}

body.art-theme-baroque .subnav-inline-toggle:hover {
  background: rgba(210, 150, 60, 0.42);
  border-color: rgba(255, 225, 160, 0.6);
}

body.art-theme-baroque .pills a {
  background: rgba(40, 50, 120, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 150, 0.38);
  color: #fff2d6;
}

body.art-theme-baroque .pills a:hover {
  background: rgba(70, 60, 150, 0.64);
  box-shadow: 0 12px 24px rgba(40, 50, 120, 0.42), inset 0 0 0 1px rgba(255, 225, 170, 0.5);
}

body.art-theme-baroque .pills a.active {
  background: linear-gradient(135deg, rgba(255, 210, 130, 0.96), rgba(160, 90, 20, 0.95));
  box-shadow: 0 16px 35px rgba(140, 90, 30, 0.52);
}

body.art-theme-baroque .nav-toggle {
  background: rgba(30, 35, 100, 0.66);
  border-color: rgba(255, 215, 150, 0.46);
}

body.art-theme-baroque nav.sidebar {
  background: linear-gradient(180deg, rgba(40, 60, 150, 0.94), rgba(90, 50, 10, 0.96));
  border-color: rgba(255, 215, 150, 0.36);
  box-shadow: 0 28px 60px rgba(40, 50, 120, 0.34);
}

body.art-theme-baroque .art-card-artist {
  background: rgba(140, 90, 20, 0.3);
  border-color: rgba(255, 215, 150, 0.45);
  color: #ffecc0;
}

body.art-theme-baroque .art-card .artwork {
  background: rgba(25, 28, 80, 0.78);
  border-color: rgba(255, 215, 150, 0.4);
}

body.art-theme-baroque .art-card .artwork figcaption {
  border-top: 1px solid rgba(255, 215, 150, 0.32);
  color: rgba(255, 235, 205, 0.9);
}

body.art-theme-baroque nav.sidebar details,
body.art-theme-baroque nav.sidebar .sidebar-section,
body.art-theme-baroque nav.sidebar .snapshot,
body.art-theme-baroque nav.sidebar .keywords,
body.art-theme-baroque nav.sidebar .grade-switcher {
  background: rgba(26, 24, 70, 0.5);
  border-color: rgba(255, 215, 150, 0.3);
}

body.art-theme-baroque nav.sidebar a:hover,
body.art-theme-baroque nav.sidebar summary:hover {
  background: rgba(110, 80, 30, 0.35);
}

body.art-theme-baroque .art-hero {
  background: linear-gradient(135deg, rgba(28, 32, 90, 0.9), rgba(150, 90, 20, 0.82));
  border-color: rgba(255, 215, 150, 0.36);
  box-shadow: 0 32px 70px rgba(70, 50, 150, 0.42);
}

body.art-theme-baroque .art-card {
  background: rgba(28, 26, 70, 0.84);
  border-color: rgba(255, 215, 150, 0.3);
  box-shadow: 0 26px 56px rgba(45, 38, 110, 0.4);
}

body.art-theme-baroque #vs-tooltip {
  color: #201a43;
}

body.art-theme-baroque #vs-tooltip .vs-tip-caption {
  color: #362b6b;
}

body.art-theme-baroque #vs-tooltip .vs-tip-close {
  color: rgba(54, 43, 107, 0.68);
}

body.art-theme-baroque #vs-tooltip .vs-tip-close:hover {
  color: #201a43;
  background: rgba(54, 43, 107, 0.14);
}

body.art-theme-baroque .art-hero-tile {
  border-color: rgba(255, 215, 150, 0.32);
}

body.art-theme-rococo {
  --tip-bg: rgba(255, 233, 250, 0.97);
  --tip-border: rgba(200, 140, 230, 0.85);
  --tip-shadow: 0 22px 42px rgba(170, 120, 240, 0.42), 0 0 0 1px rgba(255, 210, 245, 0.58) inset;
  background: radial-gradient(circle at 18% -12%, rgba(250, 180, 215, 0.35), transparent 58%),
              radial-gradient(circle at 78% -10%, rgba(180, 210, 255, 0.32), transparent 60%),
              #12061f;
}

body.art-theme-rococo .app-header {
  background: linear-gradient(135deg, rgba(255, 145, 205, 0.9), rgba(150, 170, 255, 0.88));
  border-bottom: 1px solid rgba(255, 200, 245, 0.42);
}

body.art-theme-rococo .brand-mark {
  border-color: rgba(255, 200, 245, 0.55);
}

body.art-theme-rococo .subnav .section-title {
  color: #ffe9fb;
}

body.art-theme-rococo .subnav-inline-toggle {
  background: rgba(240, 150, 210, 0.3);
  border-color: rgba(255, 205, 245, 0.5);
  color: #fff2fb;
}

body.art-theme-rococo .subnav-inline-toggle:hover {
  background: rgba(230, 150, 220, 0.45);
  border-color: rgba(255, 215, 250, 0.6);
}

body.art-theme-rococo .pills a {
  background: rgba(170, 150, 255, 0.36);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 245, 0.4);
  color: #fff2ff;
}

body.art-theme-rococo .pills a:hover {
  background: rgba(200, 160, 255, 0.54);
  box-shadow: 0 12px 24px rgba(120, 100, 220, 0.36), inset 0 0 0 1px rgba(255, 225, 250, 0.5);
}

body.art-theme-rococo .pills a.active {
  background: linear-gradient(135deg, rgba(255, 200, 245, 0.98), rgba(190, 160, 255, 0.95));
  box-shadow: 0 16px 35px rgba(180, 140, 255, 0.48);
}

body.art-theme-rococo .nav-toggle {
  background: rgba(170, 140, 255, 0.62);
  border-color: rgba(255, 205, 245, 0.48);
}

body.art-theme-rococo nav.sidebar {
  background: linear-gradient(180deg, rgba(255, 175, 220, 0.92), rgba(150, 160, 255, 0.9));
  border-color: rgba(255, 200, 245, 0.45);
  box-shadow: 0 28px 60px rgba(180, 150, 220, 0.35);
}

body.art-theme-rococo .art-card-artist {
  background: rgba(210, 150, 240, 0.3);
  border-color: rgba(255, 210, 245, 0.45);
  color: #ffe7fa;
}

body.art-theme-rococo .art-card .artwork {
  background: rgba(70, 40, 110, 0.78);
  border-color: rgba(255, 210, 245, 0.38);
}

body.art-theme-rococo .art-card .artwork figcaption {
  border-top: 1px solid rgba(255, 215, 245, 0.34);
  color: rgba(255, 230, 250, 0.9);
}

body.art-theme-rococo nav.sidebar details,
body.art-theme-rococo nav.sidebar .sidebar-section,
body.art-theme-rococo nav.sidebar .snapshot,
body.art-theme-rococo nav.sidebar .keywords,
body.art-theme-rococo nav.sidebar .grade-switcher {
  background: rgba(60, 30, 90, 0.48);
  border-color: rgba(255, 205, 245, 0.32);
}

body.art-theme-rococo nav.sidebar a:hover,
body.art-theme-rococo nav.sidebar summary:hover {
  background: rgba(210, 150, 240, 0.32);
}

body.art-theme-rococo .art-hero {
  background: linear-gradient(135deg, rgba(210, 140, 240, 0.92), rgba(150, 170, 255, 0.84));
  border-color: rgba(255, 210, 245, 0.4);
  box-shadow: 0 32px 70px rgba(140, 110, 240, 0.42);
}

body.art-theme-rococo .art-card {
  background: rgba(70, 40, 110, 0.8);
  border-color: rgba(255, 210, 245, 0.32);
  box-shadow: 0 26px 56px rgba(90, 60, 180, 0.4);
}

body.art-theme-rococo #vs-tooltip {
  color: #3c1f52;
}

body.art-theme-rococo #vs-tooltip .vs-tip-caption {
  color: #5a2f75;
}

body.art-theme-rococo #vs-tooltip .vs-tip-close {
  color: rgba(90, 47, 117, 0.68);
}

body.art-theme-rococo #vs-tooltip .vs-tip-close:hover {
  color: #3c1f52;
  background: rgba(90, 47, 117, 0.14);
}

body.art-theme-rococo .art-hero-tile {
  border-color: rgba(255, 210, 245, 0.34);
}

a {
  color: inherit;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  backdrop-filter: blur(16px);
  background: linear-gradient(135deg, rgba(40, 0, 0, 0.92), rgba(128, 0, 0, 0.85));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem clamp(1.4rem, 3.5vw, 2.4rem) 0.7rem;
  border-bottom: 1px solid rgba(255, 88, 88, 0.28);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  width: min(100%, 1040px);
  margin: 0 auto;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 88, 88, 0.45);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffe0e0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-title {
  font-size: clamp(1.1rem, 1.9vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff5f5;
}

.subnav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  padding: 0.35rem clamp(0.7rem, 2.8vw, 1.2rem) 0.4rem;
  margin: 0.45rem auto 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-height: 520px;
  overflow-x: visible;
  overflow-y: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease, margin 0.25s ease;
  align-self: stretch;
}

.subnav.compact {
  padding-bottom: 0.15rem;
  gap: 0.15rem;
}

.subnav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffe0e0;
  gap: 0.6rem;
  line-height: 1;
}

.subnav .section-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #fff0f0;
}

.subnav-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 88, 88, 0.45);
  background: rgba(196, 0, 0, 0.18);
  color: #fff5f5;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.subnav-inline-toggle:hover {
  border-color: rgba(255, 120, 120, 0.65);
  background: rgba(196, 0, 0, 0.32);
}

.subnav-inline-toggle .icon {
  font-size: 1rem;
  line-height: 1;
}

.pills {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.3rem;
  width: 100%;
  max-width: 100%;
  justify-content: center;
  margin: 0.2rem auto 0;
  overflow-x: visible;
  overflow-y: hidden;
  padding: 0 1rem;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.2s ease;
}

.pills.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
}

.pills a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  border: 0;
  background: rgba(80, 0, 0, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 96, 96, 0.28);
  color: #ffecec;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.pills a:hover {
  transform: translateY(-1px);
  background: rgba(120, 0, 0, 0.62);
  box-shadow: 0 12px 24px rgba(150, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 120, 120, 0.4);
}

.pills a.active {
  background: linear-gradient(135deg, rgba(255, 96, 96, 0.95), rgba(196, 0, 0, 0.95));
  border-color: transparent;
  color: #fff5f5;
  box-shadow: 0 16px 35px rgba(196, 0, 0, 0.45);
}

.nav-toggle {
  position: fixed;
  top: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(40, 0, 0, 0.65);
  border: 1px solid rgba(255, 96, 96, 0.4);
  color: #ffe8e8;
  border-radius: 12px;
  cursor: pointer;
  z-index: 1100;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(80, 0, 0, 0.75);
  border-color: rgba(255, 128, 128, 0.6);
}

#toggle-left {
  left: 1rem;
}

#toggle-right {
  right: 1rem;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  position: relative;
}

.nav-toggle span::before {
  position: absolute;
  top: -5px;
}

.nav-toggle span::after {
  position: absolute;
  top: 5px;
}

#sidebar-left {
  width: var(--sidebar-left-width);
}

#sidebar-right {
  width: var(--sidebar-right-width);
  overflow: visible;
}

nav.sidebar {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  width: var(--sidebar-right-width);
  padding: 1.05rem 0.6rem 1.6rem;
  overflow-y: auto;
  background: rgba(8, 8, 8, 0.92);
  border: 1px solid rgba(255, 64, 64, 0.28);
  border-radius: 0 0 var(--shell-radius) var(--shell-radius);
  backdrop-filter: blur(20px);
  transition: transform 0.3s ease;
  z-index: 900;
}

nav.sidebar .sidebar-scroll {
  height: 100%;
  overflow-y: auto;
  padding-right: 0.25rem;
  overscroll-behavior: contain;
}

nav.sidebar.primary {
  left: 0;
  border-left: none;
  border-top-left-radius: 0;
}

nav.sidebar.secondary {
  right: 0;
  border-right: none;
  border-top-right-radius: 0;
}

#sidebar-left.collapsed {
  transform: translateX(-100%);
}

#sidebar-right.collapsed {
  transform: translateX(100%);
}

nav.sidebar details,
nav.sidebar .sidebar-section,
nav.sidebar .snapshot,
nav.sidebar .keywords,
nav.sidebar .grade-switcher {
  background: rgba(36, 0, 0, 0.42);
  border-radius: 14px;
  border: 1px solid rgba(255, 80, 80, 0.22);
  padding: 0.55rem 0.45rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 120, 120, 0.12);
}

.sidebar-clock {
  background: rgba(36, 0, 0, 0.42);
  border-radius: 14px;
  border: 1px solid rgba(255, 80, 80, 0.22);
  padding: 0.75rem 0.6rem;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 120, 120, 0.12);
}

.sidebar-clock .clock-time {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.sidebar-clock .clock-date {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-heading {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

nav.sidebar a,
nav.sidebar summary {
  display: block;
  color: var(--text-main);
  text-decoration: none;
  padding: 0.38rem 0.4rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.18s ease, transform 0.18s ease;
}

nav.sidebar summary {
  cursor: pointer;
  font-weight: 700;
  padding-right: 1.8rem;
  position: relative;
}

nav.sidebar summary::after {
  content: "▾";
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: rgba(255, 160, 160, 0.75);
}

details[open] > summary::after {
  transform: translateY(-50%) rotate(180deg);
}

nav.sidebar a:hover,
nav.sidebar summary:hover {
  background: rgba(196, 0, 0, 0.38);
  transform: translateX(2px);
}

nav.sidebar .help-overlay-item {
  position: relative;
}

nav.sidebar .help-overlay-item .periodic-table-link {
  display: block;
}

.periodic-table-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 7vw, 4rem);
  background: rgba(8, 8, 8, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.45s;
  z-index: 1600;
}

.periodic-table-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

.periodic-table-overlay__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform: translate3d(32vw, 0, 0);
  opacity: 0;
  will-change: transform, opacity;
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.35s ease-out;
}

.periodic-table-overlay.visible .periodic-table-overlay__panel {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.periodic-table-overlay__panel img {
  width: min(100vw - 3rem, 1500px);
  max-height: calc(100vh - 3rem);
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(255, 120, 120, 0.32);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.periodic-table-overlay__close {
  position: absolute;
  top: clamp(0.5rem, 1.5vw, 1.1rem);
  right: clamp(0.5rem, 1.5vw, 1.1rem);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 120, 120, 0.4);
  background: rgba(12, 12, 12, 0.8);
  color: #ffeaea;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.periodic-table-overlay__close:hover,
.periodic-table-overlay__close:focus-visible {
  transform: scale(1.08);
  background: rgba(32, 0, 0, 0.9);
  border-color: rgba(255, 160, 160, 0.65);
  outline: none;
}

.artwork-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 7vw, 4rem);
  background: rgba(8, 8, 8, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.45s;
  z-index: 1600;
}

.artwork-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

.artwork-overlay__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform: translate3d(32vw, 0, 0);
  opacity: 0;
  will-change: transform, opacity;
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.35s ease-out;
}

.artwork-overlay.visible .artwork-overlay__panel {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.artwork-overlay__panel img {
  width: min(100vw - 3rem, 1500px);
  max-height: calc(100vh - 3rem);
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(255, 120, 120, 0.32);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
}

.artwork-overlay__close {
  position: absolute;
  top: clamp(0.5rem, 1.5vw, 1.1rem);
  right: clamp(0.5rem, 1.5vw, 1.1rem);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 120, 120, 0.4);
  background: rgba(12, 12, 12, 0.8);
  color: #ffeaea;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.artwork-overlay__close:hover,
.artwork-overlay__close:focus-visible {
  transform: scale(1.08);
  background: rgba(32, 0, 0, 0.9);
  border-color: rgba(255, 160, 160, 0.65);
  outline: none;
}


.prefix {
  color: rgba(255, 160, 160, 0.85);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  margin-right: 0.45rem;
  text-transform: uppercase;
}

.grade-switcher h2 {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  color: #ffd7d7;
}

.grade-switcher a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: rgba(196, 0, 0, 0.24);
  color: #ffeaea;
  margin-bottom: 0.35rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.grade-switcher a:hover {
  background: rgba(196, 0, 0, 0.38);
}

.grade-switcher--inline {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.grade-switcher--inline .grade-switcher__title {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}

.grade-switcher--inline .grade-switcher__levels {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.grade-switcher--inline .grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 140, 0.35);
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.grade-switcher--inline a.grade-pill {
  background: rgba(196, 0, 0, 0.18);
  color: #ffeaea;
  margin-bottom: 0;
  text-decoration: none;
}

.grade-switcher--inline a.grade-pill:hover,
.grade-switcher--inline a.grade-pill:focus-visible {
  background: rgba(196, 0, 0, 0.32);
  border-color: rgba(255, 160, 160, 0.6);
  box-shadow: 0 6px 16px rgba(196, 0, 0, 0.28);
  outline: none;
}

.grade-switcher--inline .grade-pill--active {
  border-color: rgba(255, 210, 160, 0.85);
  background: rgba(255, 190, 120, 0.22);
  color: #fff4e5;
  box-shadow: 0 0 0 2px rgba(255, 210, 160, 0.3), 0 12px 22px rgba(0, 0, 0, 0.18);
}

.snapshot h3 {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.snapshot ul {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.snapshot li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.snapshot .label {
  color: var(--text-dim);
}

.snapshot .value {
  font-weight: 600;
  color: #ff9a9a;
}

.snapshot.keywords ul {
  gap: 0.6rem;
}

.snapshot.keywords li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.2rem;
}

.snapshot.keywords .label,
.snapshot.keywords .value {
  width: 100%;
  text-align: left;
}

.snapshot.keywords .vs-tip {
  border-bottom: none;
}

main {
  margin-top: calc(var(--header-h) + 1.6rem);
  margin-left: calc(var(--sidebar-left-width) + var(--sidebar-gap));
  margin-right: calc(var(--sidebar-right-width) + var(--sidebar-gap));
  padding: 2.3rem clamp(0.75rem, 2.4vw, 1.8rem) 3rem;
  display: grid;
  gap: 1.5rem;
  transition: margin 0.3s ease, transform 0.3s ease;
}

body:not(.mobile-nav-overlay) #sidebar-left.collapsed ~ main {
  margin-left: clamp(1.2rem, 6vw, 3.2rem);
}

body:not(.mobile-nav-overlay) #sidebar-right.collapsed ~ main {
  margin-right: clamp(1.2rem, 6vw, 3.2rem);
}

.card {
  background: var(--surface);
  border-radius: var(--shell-radius);
  border: 1px solid rgba(255, 80, 80, 0.24);
  box-shadow: var(--glow);
  padding: clamp(1.25rem, 3vw, 1.8rem);
  display: grid;
  gap: 1rem;
}

.hero {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: center;
  background: linear-gradient(135deg, rgba(90, 0, 0, 0.78), rgba(196, 0, 0, 0.55));
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255, 80, 80, 0.35), transparent 55%);
  filter: blur(60px);
  opacity: 0.6;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
}

.hero .meta {
  color: var(--text-dim);
}

.art-hero {
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 320px);
  gap: clamp(1.35rem, 4.5vw, 3rem);
  min-height: 0;
}

.art-hero-copy {
  display: grid;
  gap: 0.8rem;
}

.art-hero-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.75rem;
}

.art-hero-tile {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 96, 96, 0.32);
  background-size: cover;
  background-position: center;
  min-height: clamp(120px, 18vw, 160px);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.45);
}

.art-hero-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0) 0%, rgba(10, 10, 10, 0.78) 100%);
  mix-blend-mode: screen;
}

.art-hero .tile-1 {
  background-image: url("Art/The_Parthenon_in_Athens.jpg");
}

.art-hero .tile-2 {
  background-image: url("Art/hero_images/renaissance_mona_lisa.jpg");
}

.art-hero .tile-3 {
  background-image: url("Art/The_Night_Watch_by_Remnrandt.jpg");
}

.art-hero .tile-4 {
  background-image: url("Art/Laoco%C3%B6n_and_his_sons_group.jpg");
}

.art-hero--african .tile-1 {
  background-image: url("Art/Benin_bronze_Louvre_A97-14-1.jpg");
}

.art-hero--african .tile-2 {
  background-image: url("Art/Gelede_mask_1.jpg");
}

.art-hero--african .tile-3 {
  background-image: url("Art/Nok_sculpture_Louvre_70-1998-11-1.jpg");
}

.art-hero--african .tile-4 {
  background-image: url("Art/Nkisi_nkondi_Ethnological_Museum_Berlin.jpg");
}

.art-hero--prehistoric .tile-1 {
  background-image: url("Art/Venus_Of_Willendorf.jpg");
}

.art-hero--prehistoric .tile-2 {
  background-image: url("Art/Venus_Of_Willendorf_(Multiple).png");
}

.art-hero--prehistoric .tile-3 {
  background-image: url("Art/Easter_Island_Stone_Heads.jpg");
}

.art-hero--prehistoric .tile-4 {
  background-image: url("Art/Easter_Island_Stone_Heads_(Multiple).jpg");
}

.art-hero--mesopotamian .tile-1 {
  background-image: url("Art/Tell Asmar Hoard.jpg");
}

.art-hero--mesopotamian .tile-3 {
  background-image: url("Art/The Standard of Ur - War side.jpg");
}

.art-hero--mesopotamian .tile-4 {
  background-image: url("Art/Reliefs from The palace of Ashurnasirpal II War scenes.jpg");
}

.art-hero--egyptian .tile-1 {
  background-image: url("Art/hero_images/egyptian_rosetta_stone.jpg");
}

.art-hero--egyptian .tile-2 {
  background-image: url("Art/hero_images/egyptian_great_sphinx.jpg");
}

.art-hero--egyptian .tile-3 {
  background-image: url("Art/King Menkaure (Mycerinus) and queen.jpg");
}

.art-hero--egyptian .tile-4 {
  background-image: url("Art/King Menkaure (Mycerinus) and queen front.jpg");
}

.art-hero--rococo .tile-1 {
  background-image: url("Art/The_Swing_by_Fragonard.jpg");
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn.primary {
  background: linear-gradient(135deg, rgba(255, 96, 96, 0.95), rgba(196, 0, 0, 0.98));
  box-shadow: 0 18px 30px rgba(196, 0, 0, 0.4);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 26px 44px rgba(196, 0, 0, 0.52);
}

.btn.ghost {
  border-color: rgba(255, 96, 96, 0.35);
  background: rgba(28, 0, 0, 0.55);
  color: #ffecec;
}

.btn.ghost:hover {
  border-color: rgba(255, 140, 140, 0.55);
  background: rgba(60, 0, 0, 0.68);
}

.hero-viz svg {
  width: 100%;
  height: auto;
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.4rem;
  background: rgba(32, 0, 0, 0.52);
}

.info-grid article {
  display: grid;
  gap: 0.45rem;
}

.info-grid h2 {
  font-size: 1.1rem;
  color: #ffdede;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.info-grid p {
  color: #f8b7b7;
  line-height: 1.55;
}

.card-header {
  display: grid;
  gap: 0.35rem;
}

.card-header h2 {
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: #ffe2e2;
}

.meta {
  font-size: 0.92rem;
  color: var(--text-dim);
}

.meta.secondary {
  margin-top: -0.2rem;
  font-size: 0.88rem;
}

.art-card {
  gap: clamp(0.85rem, 2.6vw, 1.6rem);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.art-card + .art-card {
  margin-top: clamp(1.35rem, 3vw, 2rem);
}

.art-card .card-header h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
}

.art-card-artist {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.24rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 96, 96, 0.32);
  background: rgba(196, 0, 0, 0.18);
}

.art-card-body {
  display: flow-root;
  font-size: 1rem;
  line-height: 1.62;
  color: var(--text-main);
}

.art-card-body p {
  position: relative;
  padding: 0.35rem 0.65rem;
  border-radius: 14px;
}

.art-card-body p + p {
  margin-top: 0.85rem;
}

.art-section-text {
  display: inline;
  color: var(--text-main);
  transition: color 0.3s ease;
}

.art-card-body p:focus-within .art-section-text {
  color: #fff6d6;
}

.art-section-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.14rem 0.6rem;
  margin: -0.08rem 0.55rem 0.12rem 0;
  border-radius: 999px;
  background: rgba(255, 96, 96, 0.12);
  color: #dca1a1;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(255, 210, 210, 0.65);
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.05;
  transform-origin: center left;
  transition: transform 0.2s ease, color 0.3s ease, background 0.3s ease;
}

.art-section-heading:focus-visible,
.art-card-body p:focus-within .art-section-heading {
  transform: scale(1.05);
  background: rgba(255, 120, 120, 0.18);
  color: #eed0d0;
}

.art-section-heading__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.05rem;
  line-height: 1;
  color: inherit;
}

.art-section-heading__icon::before {
  content: "";
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.art-section-heading--snapshot .art-section-heading__icon::before {
  content: "\01F4F7";
}

.art-section-heading--subject .art-section-heading__icon::before {
  content: "\01F9CD";
}

.art-section-heading--formal .art-section-heading__icon::before {
  content: "\01F3A8";
}

.art-section-heading--materials .art-section-heading__icon::before {
  content: "\01F528";
}

.art-section-heading--function .art-section-heading__icon::before {
  content: "\01F3AF";
}

.art-section-heading--style .art-section-heading__icon::before {
  content: "\01F3DB";
}

.art-section-heading--interpretation .art-section-heading__icon::before {
  content: "\01F4A1";
}

.art-section-heading--comparison .art-section-heading__icon::before {
  content: "\02696";
}

.art-section-heading--condition .art-section-heading__icon::before {
  content: "\01F527";
}

.art-section-heading__label {
  display: inline-block;
}

.art-card .artwork {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 96, 96, 0.32);
  background: rgba(18, 0, 0, 0.7);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.48);
  cursor: zoom-in;
  --artwork-scale: 1;
  --artwork-base-width: clamp(300px, 42vw, 520px);
  width: min(100%, calc(var(--artwork-base-width) * var(--artwork-scale)));
  max-width: 100%;
  transition: width 0.3s ease;
  will-change: width;
}

.art-card .artwork img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.art-card .artwork img:focus-visible {
  outline: 3px solid rgba(255, 120, 120, 0.55);
  outline-offset: 3px;
}

.art-card .artwork:hover,
.art-card .artwork:focus-within {
  --artwork-scale: 1.25;
}

.art-card .artwork figcaption {
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  color: rgba(255, 200, 200, 0.85);
  line-height: 1.45;
  background: rgba(12, 12, 12, 0.82);
  border-top: 1px solid rgba(255, 96, 96, 0.25);
}

.art-card .artwork.float-left {
  float: left;
  margin: 0.35rem clamp(1rem, 3vw, 1.8rem) 0.9rem 0;
  shape-outside: inset(0 round 18px);
  shape-margin: 0.6rem;
}

.art-card .artwork.float-left figcaption {
  text-align: left;
}

.art-card .artwork.float-right {
  float: right;
  margin: 0.35rem 0 0.9rem clamp(1rem, 3vw, 1.8rem);
  shape-outside: inset(0 round 18px);
  shape-margin: 0.6rem;
}

.art-card .artwork.float-right figcaption {
  text-align: right;
}

.art-card .artwork.float-center {
  float: none;
  margin: clamp(0.9rem, 3vw, 1.8rem) auto;
  text-align: center;
  --artwork-base-width: clamp(300px, 60vw, 520px);
}

.art-card .artwork.float-center figcaption {
  text-align: center;
}

.art-card .artwork.float-center + p {
  margin-top: 1rem;
}

@media (max-width: 880px) {
  .art-card .artwork.float-left,
  .art-card .artwork.float-right {
    float: none;
    margin: clamp(0.9rem, 4vw, 1.8rem) auto;
    text-align: center;
  }

  .art-card .artwork.float-left figcaption,
  .art-card .artwork.float-right figcaption {
    text-align: center;
  }
}

.artwork-collage {
  display: grid;
  gap: clamp(0.6rem, 3vw, 1.1rem);
  margin: clamp(0.8rem, 3vw, 1.6rem) 0;
}

.artwork-collage .artwork {
  float: none;
  margin: 0;
  max-width: 100%;
  --artwork-base-width: clamp(260px, 100%, 480px);
}

.artwork-collage .artwork figcaption {
  text-align: left;
}

.art-card .card-header {
  --art-card-header-scale: 1;
}

.art-card .card-header h2 {
  font-size: calc(1.35rem * var(--art-card-header-scale));
  transition: font-size 0.3s ease;
}

.art-card .card-header .art-card-artist {
  font-size: calc(0.85rem * var(--art-card-header-scale));
  transition: font-size 0.3s ease;
}

.art-card .card-header .meta {
  font-size: calc(0.92rem * var(--art-card-header-scale));
  transition: font-size 0.3s ease;
}

.art-card .card-header:focus-within {
  --art-card-header-scale: 1.5;
}

@media (max-width: 1200px) {
  .art-hero {
    grid-template-columns: 1fr;
  }
  .art-hero-gallery {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 1024px) {
  .art-card .artwork {
    float: none !important;
    margin: 0 auto clamp(1rem, 5vw, 1.6rem);
    --artwork-base-width: clamp(240px, 86vw, 520px);
  }
  .art-card .card-header h2 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .art-card-artist {
    align-self: flex-start;
  }
}

@media (max-width: 560px) {
  .art-hero-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .art-hero-tile {
    min-height: 110px;
  }
}

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

.chart {
  background: rgba(120, 0, 0, 0.18);
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid rgba(255, 96, 96, 0.18);
  display: grid;
  gap: 0.6rem;
}

.chart-title {
  font-size: 0.95rem;
  color: #ffbbbb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart svg {
  width: 100%;
  height: auto;
}

.formula-block {
  background: rgba(36, 0, 0, 0.6);
  border: 1px solid rgba(255, 80, 80, 0.24);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.formula-block .label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffb5b5;
}

.note {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.responsive-frame {
  position: relative;
  padding-top: min(62%, 480px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 88, 88, 0.22);
  background: rgba(36, 0, 0, 0.52);
}

.responsive-frame--video {
  padding-top: 56.25%;
  background: rgba(20, 0, 0, 0.65);
}

.responsive-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

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

.media-item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 88, 88, 0.18);
  background: rgba(32, 0, 0, 0.42);
  transform: translateZ(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 26px rgba(196, 0, 0, 0.28);
}

.media-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.media-item .caption {
  padding: 0.6rem;
  font-size: 0.88rem;
  color: #ffc7c7;
  background: rgba(60, 0, 0, 0.68);
}

.dev-checklist {
  list-style: disc;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.dev-checklist li {
  line-height: 1.65;
}

@media (hover: none) {
  .subnav-inline-toggle:hover,
  .nav-toggle:hover,
  .pills a:hover,
  nav.sidebar a:hover,
  nav.sidebar summary:hover,
  .grade-switcher a:hover,
  .grade-switcher--inline a.grade-pill:hover,
  .btn.primary:hover,
  .btn.ghost:hover {
    background-color: transparent;
    color: inherit;
    transform: none;
    box-shadow: none;
  }
  .grade-switcher a:hover,
  .grade-switcher--inline a.grade-pill:hover {
    border-color: rgba(255, 140, 140, 0.35);
  }
  .art-card-body p:focus-within .art-section-text {
    color: inherit;
  }
  .art-card-body p:focus-within .art-section-heading {
    transform: none;
    background: rgba(255, 96, 96, 0.12);
    color: #dca1a1;
  }
  .art-card .card-header:focus-within {
    --art-card-header-scale: 1;
  }
  .art-card .artwork,
  .art-card .artwork:hover,
  .art-card .artwork:focus-within {
    --artwork-scale: 1 !important;
    cursor: default;
    transition: width 0.3s ease;
  }
  .art-card .artwork img {
    cursor: default;
  }
  .media-item:hover {
    transform: none;
    box-shadow: none;
  }
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

h2[id] {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.katex {
  color: #ffecec;
  font-family: "Franklin Gothic Medium", "Franklin Gothic Demi", "Arial Black", Arial, sans-serif !important;
  font-style: normal !important;
  font-weight: 500 !important;
}

.katex * {
  font-family: inherit !important;
  font-weight: inherit !important;
}

.katex .mathit,
.katex .mathnormal,
.katex .textit {
  font-style: normal !important;
}

.vs-tip {
  color: inherit;
  cursor: help;
  border-bottom: 1px dotted currentColor;
  text-decoration: none;
  position: relative;
}

.vs-tip:focus-visible {
  outline: 2px solid #ff6b6b;
  outline-offset: 2px;
  border-radius: 2px;
}

#vs-tooltip {
  position: fixed;
  z-index: 4000;
  max-width: var(--tip-maxw);
  background: var(--tip-bg);
  border-radius: var(--tip-radius);
  border: 1px solid var(--tip-border);
  box-shadow: var(--tip-shadow);
  padding: var(--tip-padding-y) var(--tip-padding-x);
  font-size: 0.95rem;
  line-height: 1.45;
  color: #ffeaea;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.14s ease, transform 0.18s ease;
  pointer-events: none;
  visibility: hidden;
}

#vs-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

#vs-tooltip .vs-tip-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 0;
  color: rgba(226, 232, 240, 0.65);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px;
}

#vs-tooltip .vs-tip-close:hover {
  color: #fff;
  background: rgba(255, 80, 80, 0.24);
}

#vs-tooltip img,
#vs-tooltip svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.4rem 0;
  border-radius: 10px;
  background: rgba(36, 0, 0, 0.6);
}

#vs-tooltip .vs-tip-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

#vs-tooltip .vs-tip-caption {
  font-size: 0.85rem;
  color: #ffc7c7;
}

#vs-tooltip::before,
#vs-tooltip::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translateX(calc(var(--arrow-x, 14px) - 7px)) rotate(45deg);
}

#vs-tooltip::before {
  background: var(--tip-border);
}

#vs-tooltip::after {
  background: var(--tip-bg);
}

#vs-tooltip.pos-top::before,
#vs-tooltip.pos-top::after {
  bottom: -8px;
}

#vs-tooltip.pos-bottom::before,
#vs-tooltip.pos-bottom::after {
  top: -8px;
}

#vs-tooltip[data-fixedwidth] {
  width: attr(data-fixedwidth px);
  max-width: none;
}

@media (max-width: 1200px) {
  :root {
    --sidebar-left-width: 264px;
    --sidebar-right-width: 210px;
  }
  nav.sidebar.primary {
    left: 0.5rem;
  }
  nav.sidebar.secondary {
    right: 0.5rem;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-left-width: 236px;
    --sidebar-right-width: 196px;
  }
  main {
    gap: 1.4rem;
  }
}

@media (max-width: 1100px) {
  .pills {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.45rem;
    padding: 0 0.6rem;
    margin-top: 0.25rem;
    overflow-x: visible;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-left-width: clamp(220px, 32vw, 236px);
    --sidebar-right-width: clamp(204px, 30vw, 224px);
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-left-width: var(--compact-sidebar-width);
    --sidebar-right-width: var(--compact-sidebar-width);
  }

  header.app-header {
    padding: 0.75rem 1rem 0.6rem;
    gap: 0.5rem;
  }

  .brand {
    align-items: center;
  }

  .nav-toggle {
    top: 12px;
  }

  nav.sidebar {
    width: var(--compact-sidebar-width);
    border-radius: 0 0 var(--shell-radius) var(--shell-radius);
    border-width: 1px;
    padding: 1rem 1.1rem 1.4rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.42);
  }

  nav.sidebar.primary {
    left: 0;
  }

  nav.sidebar.secondary {
    right: 0;
  }

 main {
   margin-left: clamp(1rem, 4vw, 1.6rem);
   margin-right: clamp(1rem, 4vw, 1.6rem);
   padding-bottom: clamp(2.4rem, 7vw, 3.2rem);
   gap: clamp(1.25rem, 6vw, 1.8rem);
 }

  #sidebar-left:not(.collapsed) {
    transform: translateX(0);
  }

  #sidebar-right:not(.collapsed) {
    transform: translateX(0);
  }

  #sidebar-left:not(.collapsed) ~ main,
  #sidebar-right:not(.collapsed) ~ main {
    margin-left: clamp(1rem, 4vw, 1.6rem);
    margin-right: clamp(1rem, 4vw, 1.6rem);
  }

  .pills {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: flex-start;
    gap: 0.3rem;
  }

  .pills a {
    padding: 0.4rem 0.7rem;
  }

  .art-card .artwork {
    float: none !important;
    margin: 0 auto clamp(1rem, 5vw, 1.6rem);
    --artwork-base-width: clamp(240px, 82vw, 420px);
  }

  .art-card .card-header h2 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .art-card-artist {
    align-self: flex-start;
  }

  .art-card-body {
    font-size: clamp(0.95rem, 3.6vw, 1.05rem);
    line-height: 1.68;
  }
}
