:root {
  --bg: #070b18;
  --bg-soft: rgba(13, 20, 41, 0.78);
  --panel: rgba(10, 16, 32, 0.86);
  --panel-strong: rgba(8, 12, 24, 0.96);
  --line: rgba(129, 151, 255, 0.22);
  --text: #edf2ff;
  --muted: #a5b0d4;
  --cyan: #7be7ff;
  --orange: #ff9f43;
  --green: #8ee3b5;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-scale: 1;
  --sidebar-width: clamp(320px, calc(282px + 3vw + (var(--font-scale) - 1) * 92px), 410px);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: calc(16px * var(--font-scale));
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(39, 58, 132, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(44, 164, 255, 0.16), transparent 24%),
    linear-gradient(135deg, #030611 0%, #07111f 38%, #090d18 100%);
  overflow: auto;
}

body.sidebar-open {
  overflow: hidden;
}

.page-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.page-glow-a {
  top: -140px;
  right: -120px;
  background: radial-gradient(circle, rgba(118, 82, 255, 0.75), transparent 65%);
}

.page-glow-b {
  bottom: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(19, 174, 255, 0.65), transparent 65%);
}

.floating-tools {
  position: fixed;
  top: auto;
  left: auto;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: auto;
  isolation: isolate;
  transform: translateZ(0);
}

.floating-tools__button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(123, 231, 255, 0.24);
  background: rgba(8, 14, 28, 0.9);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
  align-items: start;
  overflow: visible;
}

.card {
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(108, 188, 255, 0.10), transparent 28%),
    linear-gradient(180deg, rgba(20, 29, 56, 0.94), rgba(9, 15, 30, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(127, 214, 255, 0.42), transparent 30%, transparent 60%, rgba(255, 166, 77, 0.34));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero,
.dataset-summary,
.viewer {
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(121, 223, 255, 0.06),
    0 0 34px rgba(121, 223, 255, 0.12);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #90a2e8;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  padding: 18px 18px 22px;
  background: linear-gradient(180deg, rgba(7, 11, 24, 0.98), rgba(6, 10, 20, 0.94));
  border: 1px solid rgba(115, 142, 255, 0.18);
  border-radius: 30px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar__brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 4;
  padding-bottom: 8px;
  background: linear-gradient(180deg, rgba(7, 11, 24, 0.98), rgba(7, 11, 24, 0.92));
}

.sidebar__brand > :not(.brand-mark) {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(160deg, rgba(87, 118, 255, 0.9), rgba(36, 195, 255, 0.7));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 14px 30px rgba(35, 122, 255, 0.25);
}

.sidebar__brand h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.2rem;
  line-height: 1.1;
  text-wrap: balance;
}

.language-switcher {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.language-switcher__label {
  display: block;
  margin: 0;
}

.language-switcher__field {
  position: relative;
  min-width: 0;
}

.language-switcher__field::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(219, 227, 255, 0.78);
  border-bottom: 2px solid rgba(219, 227, 255, 0.78);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.language-switcher select {
  width: 100%;
  min-height: calc(44px + (var(--font-scale) - 1) * 8px);
  padding: 0 44px 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(123, 231, 255, 0.24);
  background: #050914;
  color: #f5f7ff;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  appearance: none;
  cursor: pointer;
  color-scheme: dark;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.22);
}

.language-switcher select option {
  background: #050914;
  color: #f5f7ff;
}

.language-switcher select:focus {
  outline: none;
  border-color: rgba(123, 231, 255, 0.42);
  box-shadow:
    0 0 0 3px rgba(123, 231, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (min-width: 1380px) {
  .language-switcher {
    grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
  }
}

.sidebar__objective-button {
  position: sticky;
  top: 86px;
  z-index: 3;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 16px 18px;
  border: 1px solid rgba(123, 231, 255, 0.18);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font: inherit;
}

.sidebar__objective-button:hover {
  border-color: rgba(123, 231, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(0, 0, 0, 0.22);
}

.sidebar__tools {
  padding: 12px 12px 6px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(15, 22, 41, 0.88), rgba(8, 12, 24, 0.26));
  box-shadow: none;
}

.sidebar__tools::after {
  display: none;
}

.sidebar__tools-copy {
  display: none;
}

.sidebar__tools-copy h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
}

.sidebar__tools-copy p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.sidebar__tools-actions {
  margin-top: 0;
}

.sidebar__intro-label {
  margin: 0 0 10px;
  color: var(--cyan);
  font-weight: 700;
}

.sidebar__objective-button .sidebar__intro-label {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 1.04rem;
}

.dataset-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 0 2px;
}

.nav-group {
  border: 1px solid var(--menu-accent-soft, rgba(129, 151, 255, 0.14));
  border-radius: 20px;
  background:
    linear-gradient(180deg, var(--menu-fill-top, rgba(18, 27, 49, 0.94)), var(--menu-fill-bottom, rgba(8, 12, 24, 0.9))),
    var(--menu-accent-glow, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 12px 26px rgba(0, 0, 0, 0.22),
    0 0 24px color-mix(in srgb, var(--menu-accent, #7be7ff) 18%, transparent);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, filter 0.22s ease;
  filter: saturate(1.08) brightness(1.05);
}

.nav-group:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 34px rgba(0, 0, 0, 0.28),
    0 0 34px color-mix(in srgb, var(--menu-accent, #7be7ff) 24%, transparent);
  filter: saturate(1.14) brightness(1.1);
}

.nav-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015));
}

.nav-group__toggle:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
}

.nav-group__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.nav-group__title {
  display: block;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #f5f8ff;
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.08);
}

.nav-group__meta {
  color: rgba(226, 234, 255, 0.78);
  font-size: 0.86rem;
  white-space: normal;
  min-width: 0;
}

.nav-group__toggle > span:last-child {
  flex: 0 0 auto;
}

.nav-group.is-open .nav-group__toggle .chevron {
  transform: rotate(225deg);
}

.chevron {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(219, 227, 255, 0.78);
  border-bottom: 2px solid rgba(219, 227, 255, 0.78);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.nav-group__items {
  display: none;
  padding: 0 10px 10px;
}

.nav-group__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.group-action {
  min-height: 38px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1px solid var(--menu-accent-soft, rgba(129, 151, 255, 0.18));
  background: linear-gradient(180deg, rgba(12, 19, 36, 0.92), rgba(7, 12, 24, 0.9));
  color: #f2f6ff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.group-action--danger {
  color: #ffb8b8;
}

.nav-group.is-open .nav-group__items {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 17, 32, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  border-color: color-mix(in srgb, var(--menu-accent, #7be7ff) 70%, white 10%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(12, 20, 38, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px color-mix(in srgb, var(--menu-accent, #7be7ff) 22%, transparent);
  transform: translateY(-1px);
  outline: none;
}

.nav-item.is-active {
  border-color: var(--menu-accent, rgba(123, 231, 255, 0.45));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--menu-accent, #7be7ff) 18%, rgba(28, 44, 84, 0.96)), rgba(11, 18, 34, 0.94)),
    var(--menu-accent-glow, transparent);
  box-shadow:
    inset 0 0 0 1px var(--menu-accent-soft, rgba(123, 231, 255, 0.14)),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 24px color-mix(in srgb, var(--menu-accent, #7be7ff) 18%, transparent);
}

.nav-item__title {
  display: block;
  margin-bottom: 4px;
  font-weight: 800;
  min-width: 0;
  color: #f6f8ff;
}

.nav-item--title-only .nav-item__title {
  margin-bottom: 0;
}

.nav-item--full-width {
  grid-template-columns: 1fr;
  gap: 0;
}

.nav-item--title-only .nav-item__open {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.nav-item__open {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.nav-item__meta {
  display: block;
  color: rgba(226, 234, 255, 0.76);
  font-size: 0.9rem;
  min-width: 0;
}

.marquee {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee > span {
  display: inline-block;
  min-width: 100%;
}

.nav-group__toggle:hover .marquee > span,
.nav-item:hover .marquee > span {
  animation: marqueeShift 6s linear infinite alternate;
}

.nav-item__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(129, 151, 255, 0.16);
  border-radius: 10px;
  background: rgba(10, 14, 25, 0.86);
  color: var(--muted);
  cursor: pointer;
}

.nav-item__controls {
  display: inline-flex;
  gap: 8px;
}

.nav-item__rename {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(129, 151, 255, 0.16);
  border-radius: 10px;
  background: rgba(10, 14, 25, 0.86);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
}

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  overflow-x: hidden;
  max-height: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 18px;
  padding: 28px 30px;
}

.hero h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.08;
}

.hero__subtitle {
  max-width: 72ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.68;
  font-size: 1.08rem;
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 18px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(119, 216, 255, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(23, 35, 67, 0.94), rgba(12, 19, 38, 0.92));
  border: 1px solid rgba(146, 172, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 30px rgba(7, 12, 24, 0.22);
}

.metric-card__label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-card__value {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.metric-card--brand {
  display: flex;
  flex-direction: column;
}

.metric-card__brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
}

.metric-card__brand img {
  display: block;
  width: min(100%, 180px);
  max-height: 56px;
  object-fit: contain;
}

.metric-card__accent {
  color: var(--green);
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  flex: 1;
}

.dataset-summary {
  padding: 24px;
  --section-accent: rgba(123, 231, 255, 0.7);
  --section-accent-soft: rgba(123, 231, 255, 0.14);
}

.dataset-summary.is-hidden {
  display: none;
}

.dataset-summary.is-home .meta-chips {
  display: none;
}

.insight-card.is-hidden {
  display: none;
}

.dataset-summary.is-home .insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-objective-panel {
  margin-top: 4px;
  padding: 20px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(123, 231, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(19, 29, 53, 0.84), rgba(10, 16, 31, 0.90));
  border: 1px solid var(--section-accent-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-objective-panel__body {
  width: 100%;
  min-height: 0;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 13, 26, 0.5);
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.9;
  white-space: pre-wrap;
}

.dataset-summary.is-home .insight-grid {
  margin-top: 22px;
}

.dataset-summary.is-originals-context .insight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.dataset-summary.is-originals-context .dataset-summary__content {
  margin-top: 10px;
}

.dataset-summary.is-originals-context .insight-card__actions {
  display: none;
}

.dataset-summary.is-home .rich-content {
  min-height: 0;
}

.dataset-summary.is-home .insight-card h3 {
  display: none;
}

.dataset-summary.is-home .rich-text-editor {
  min-height: 560px;
  font-size: 1.18rem;
  line-height: 1.9;
}

.dataset-summary.is-home .rich-text-static--home-fixed {
  min-height: 124px;
  font-size: 1.18rem;
  line-height: 2;
  padding: 18px 20px;
}

.dataset-summary.is-powerbi-context .rich-content {
  gap: 18px;
}

.dataset-summary.is-powerbi-context .rich-text-editor,
.dataset-summary.is-powerbi-context .rich-text-static {
  min-height: 180px;
  padding: 18px 20px;
  font-size: 1.18rem;
  line-height: 1.9;
}

.dataset-summary::before,
.viewer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--section-accent), transparent);
  opacity: 0.9;
  pointer-events: none;
}

.dataset-summary.is-collapsed .dataset-description,
.dataset-summary.is-collapsed .dataset-summary__content {
  display: none;
}

.dataset-summary__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.dataset-summary__header h2 {
  margin: 0 0 10px;
  font-size: 2rem;
  font-family: "Sora", sans-serif;
}

.dataset-summary__header p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dataset-summary__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.dataset-summary__content {
  margin-top: 18px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(123, 231, 255, 0.4);
  background: linear-gradient(135deg, rgba(41, 112, 255, 0.92), rgba(24, 188, 255, 0.82));
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.action-button--full {
  width: 100%;
}

.action-button--ghost {
  background: rgba(10, 16, 30, 0.45);
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  padding: 10px 12px;
  border-radius: 12px;
  border-left: 3px solid currentColor;
  background: rgba(13, 21, 41, 0.74);
  color: #dbe3ff;
  font-size: 0.92rem;
  font-weight: 700;
}

.meta-chip[data-tone="cyan"] {
  color: #88efff;
  background: rgba(23, 45, 62, 0.72);
}

.meta-chip[data-tone="orange"] {
  color: #ffba76;
  background: rgba(54, 35, 18, 0.72);
}

.meta-chip[data-tone="green"] {
  color: #9af0c2;
  background: rgba(24, 50, 36, 0.72);
}

.meta-chip[data-tone="violet"] {
  color: #c5b2ff;
  background: rgba(36, 27, 58, 0.72);
}

.meta-chip[data-tone="blue"] {
  color: #9db9ff;
  background: rgba(25, 34, 62, 0.72);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.insight-card {
  padding: 20px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(123, 231, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(19, 29, 53, 0.84), rgba(10, 16, 31, 0.90));
  border: 1px solid var(--section-accent-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.insight-card__toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.insight-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.card-action {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--section-accent-soft);
  background: rgba(8, 14, 26, 0.92);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.insight-card__label {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.insight-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.insight-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.rich-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rich-text-editor {
  width: 100%;
  min-height: 124px;
  resize: none;
  overflow-y: hidden;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 13, 26, 0.5);
  color: var(--muted);
  font: inherit;
  line-height: 1.75;
  box-sizing: border-box;
}

.rich-text-editor:focus {
  outline: none;
  border-color: var(--section-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.02);
}

.rich-text-static {
  width: 100%;
  min-height: 124px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 13, 26, 0.5);
  color: var(--muted);
  font: inherit;
  line-height: 1.75;
  white-space: pre-wrap;
}

.dictionary-table-wrap {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 13, 26, 0.5);
  overflow: hidden;
}

.dictionary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dictionary-table th,
.dictionary-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  vertical-align: top;
}

.dictionary-table th {
  color: #edf3ff;
  font-family: "Sora", sans-serif;
  font-size: 0.92rem;
  background: rgba(12, 19, 34, 0.92);
}

.dictionary-table td {
  color: #c5d3f0;
  line-height: 1.85;
  white-space: normal;
  word-break: break-word;
}

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

.dictionary-table td:first-child,
.dictionary-table th:first-child {
  width: 24%;
  color: #edf3ff;
  font-weight: 700;
}

.dictionary-table td:nth-child(2),
.dictionary-table th:nth-child(2) {
  width: 76%;
}

.dictionary-table-empty {
  padding: 18px 20px;
  color: var(--muted);
  line-height: 1.8;
}

.rich-image {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: block;
  cursor: zoom-in;
}

.code-block-card {
  border-radius: 18px;
  border: 1px solid rgba(88, 166, 255, 0.24);
  overflow: hidden;
  background: #0b1220;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.code-block-card--viewer {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.gallery-block {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 13, 24, 0.55);
  overflow: hidden;
}

.gallery-block__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gallery-block__title {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9bb0d9;
}

.gallery-block__actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-action {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 19, 32, 0.88);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.gallery-block__body {
  padding: 14px;
}

.gallery-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #050914;
}

.gallery-stage img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: contain;
  background: #050914;
}

.gallery-stage__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 24, 0.72);
  color: #e6eeff;
  font-size: 1.2rem;
  cursor: pointer;
}

.gallery-stage__arrow--prev {
  left: 14px;
}

.gallery-stage__arrow--next {
  right: 14px;
}

.gallery-collections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-collection {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 19, 32, 0.88);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.gallery-collection.is-active {
  border-color: var(--section-accent);
  color: var(--section-accent);
}

.gallery-caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.code-library-block__body {
  padding-top: 12px;
}

.code-library-list {
  display: grid;
  gap: 10px;
}

.code-library-item {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(95, 173, 255, 0.14);
  background: linear-gradient(180deg, rgba(14, 20, 35, 0.96), rgba(9, 14, 24, 0.96));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.code-library-item:hover {
  transform: translateY(-1px);
  border-color: rgba(123, 231, 255, 0.28);
  box-shadow: 0 12px 24px rgba(5, 11, 24, 0.28);
}

.code-library-item__name {
  color: #edf3ff;
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-library-item__meta {
  color: #9bb0d9;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.code-editor-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(14px);
  z-index: 30;
}

.code-editor-modal.is-open {
  display: flex;
}

.code-editor-modal__panel {
  width: min(920px, 100%);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(88, 166, 255, 0.24);
  background: #0b1220;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.code-editor-modal__topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #141d2e, #0d1421);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-editor-modal__body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.code-editor-modal__fields {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

.code-editor-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 14, 24, 0.98);
  color: var(--text);
  font: inherit;
}

.code-editor-area {
  width: 100%;
  min-height: 340px;
  resize: vertical;
  padding: 18px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(9, 14, 22, 0.98), rgba(6, 10, 18, 0.98));
  color: #d6e2ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.94rem;
  line-height: 1.7;
}

.code-editor-area:focus,
.code-editor-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.18);
}

.code-editor-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.code-viewer-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 14, 0.82);
  backdrop-filter: blur(12px);
  z-index: 120;
}

.code-viewer-modal.is-open {
  display: flex;
}

.code-viewer-modal__panel {
  width: min(1500px, calc(100vw - 32px));
  height: min(90vh, 980px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid rgba(123, 231, 255, 0.2);
  background:
    radial-gradient(circle at top right, rgba(91, 182, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(12, 18, 33, 0.98), rgba(5, 9, 18, 0.98));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.code-viewer-modal__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.code-viewer-modal__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.code-viewer-modal__title {
  color: #edf3ff;
  font-family: "Sora", sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-viewer-modal__counter {
  color: #c3d1ec;
  font-size: 1rem;
  font-weight: 700;
}

.code-viewer-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.code-viewer-modal__stage {
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
}

.code-viewer-modal__viewport {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 26px;
  border: 1px solid rgba(129, 151, 255, 0.16);
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.98), rgba(4, 7, 14, 0.98));
  overflow: hidden;
  padding: 0;
}

.code-viewer-modal__nav {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 24, 0.72);
  color: #e6eeff;
  font-size: 1.65rem;
  cursor: pointer;
}

.code-viewer-modal__pre {
  margin: 0;
  height: calc(100% - 48px);
  min-height: 0;
  padding: 22px 24px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(9, 14, 22, 0.98), rgba(6, 10, 18, 0.98));
}

.code-viewer-modal__pre code {
  display: block;
  min-height: 100%;
}

.code-viewer-modal .gallery-action {
  min-height: 48px;
  padding: 0 18px;
  font-size: 0.92rem;
  border-radius: 14px;
}

.image-viewer-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(2, 6, 14, 0.76);
  backdrop-filter: blur(14px);
  z-index: 1200;
}

.image-viewer-modal.is-open {
  display: flex;
}

.image-viewer-modal__panel {
  width: min(1540px, calc(100vw - 28px));
  height: min(92vh, 1040px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(123, 231, 255, 0.2);
  background:
    radial-gradient(circle at top right, rgba(91, 182, 255, 0.10), transparent 26%),
    linear-gradient(180deg, rgba(12, 18, 33, 0.98), rgba(5, 9, 18, 0.98));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.image-viewer-modal__topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.image-viewer-modal__meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.image-viewer-modal__title {
  display: none;
}

.image-viewer-modal__counter {
  color: #d5ddf7;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.image-viewer-modal__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.image-viewer-modal__stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.image-viewer-modal__viewport {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 26px;
  border: 1px solid rgba(129, 151, 255, 0.16);
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.98), rgba(4, 7, 14, 0.98));
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 34px 36px;
}

.image-viewer-modal__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.18s ease;
  user-select: none;
}

.image-viewer-modal__nav {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 24, 0.72);
  color: #e6eeff;
  font-size: 1.65rem;
  cursor: pointer;
}

.image-viewer-modal .gallery-action {
  min-height: 48px;
  padding: 0 18px;
  font-size: 0.92rem;
  border-radius: 14px;
}

.code-block-card__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #141d2e, #0d1421);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-block-card__dots {
  display: inline-flex;
  gap: 6px;
}

.code-block-card__dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.code-block-card__dots span:nth-child(1) {
  background: #ff5f57;
}

.code-block-card__dots span:nth-child(2) {
  background: #ffbd2f;
}

.code-block-card__dots span:nth-child(3) {
  background: #28c840;
}

.code-block-card__title {
  color: #9fb2d1;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.code-block-card pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(9, 14, 22, 0.98), rgba(6, 10, 18, 0.98));
  color: #d6e2ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
}

.viewer {
  position: sticky;
  top: 18px;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 36px);
  min-height: 0;
  max-height: calc(100vh - 36px);
  padding: 22px;
  --section-accent: rgba(123, 231, 255, 0.7);
  --section-accent-soft: rgba(123, 231, 255, 0.14);
  overflow: hidden;
}

.viewer__toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 6px 4px 24px;
  margin-bottom: 22px;
  background:
    linear-gradient(180deg, rgba(13, 20, 38, 0.98) 0%, rgba(13, 20, 38, 0.94) 78%, rgba(13, 20, 38, 0) 100%);
  backdrop-filter: blur(14px);
}

.viewer__toolbar-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.viewer__toolbar h3 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.08;
  font-family: "Sora", sans-serif;
}

.viewer__note {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.viewer__frame {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--section-accent-soft);
  background:
    radial-gradient(circle at top, rgba(76, 144, 255, 0.07), transparent 30%),
    linear-gradient(180deg, rgba(8, 14, 28, 0.98), rgba(6, 10, 18, 0.98));
}

.viewer__frame iframe,
.viewer__frame .powerbi-host {
  width: 100%;
  height: 100%;
  border: 0;
  background: #090f1f;
}

.viewer__frame.is-powerbi {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #050914;
}

.viewer__frame.is-powerbi iframe {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 124%;
  height: 132%;
  max-width: none;
  margin: 0;
  display: block;
  background: #050914;
  transform: translateX(-50%) scale(0.92);
  transform-origin: top center;
}

#viewer-panel:fullscreen {
  padding: 18px;
  background: #030611;
}

#viewer-panel:fullscreen .viewer__frame {
  min-height: calc(100vh - 120px);
}

#viewer-panel:fullscreen .viewer__frame.is-powerbi iframe {
  top: -8px;
  width: 122%;
  height: 128%;
  transform: translateX(-50%) scale(0.9);
}

.viewer-data {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  padding: 20px;
  overflow: auto;
}

.viewer__toolbar-actions [hidden] {
  display: none !important;
}

.viewer.is-empty .viewer__toolbar {
  display: none;
}

.viewer.is-hidden {
  display: none;
}

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

.stat-box {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(146, 172, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(99, 187, 255, 0.08), transparent 34%),
    rgba(14, 23, 43, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-box p {
  margin: 0;
}

.stat-box__label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-box__value {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(129, 151, 255, 0.14);
  border-radius: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: rgba(8, 13, 26, 0.98);
  color: #dbe3ff;
}

.viewer-section {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(146, 172, 255, 0.20);
  background:
    radial-gradient(circle at top right, rgba(108, 188, 255, 0.07), transparent 34%),
    rgba(14, 22, 41, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.viewer-section h4 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.viewer-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.notebook-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notebook-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.notebook-index {
  position: sticky;
  top: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 210px);
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(129, 151, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(17, 25, 46, 0.94), rgba(9, 14, 27, 0.96));
  font-size: 16px;
}

.notebook-index h4 {
  margin: 0 0 14px;
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
}

.notebook-index__list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  padding-bottom: 32px;
}

.notebook-index__item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #dbe7ff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  overflow: hidden;
  appearance: none;
}

.notebook-index__item:hover {
  border-color: rgba(121, 223, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.notebook-index__item span {
  display: block;
  overflow: hidden;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.notebook-index__item[data-level="2"] {
  padding-left: 22px;
  color: #a8dfff;
}

.notebook-index__item[data-level="3"] {
  padding-left: 32px;
  color: #c7cbff;
}

.notebook-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notebook-markdown h1,
.notebook-markdown h2,
.notebook-markdown h3 {
  scroll-margin-top: 20px;
}

.notebook-cell {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(129, 151, 255, 0.14);
  background: rgba(12, 19, 35, 0.82);
  position: relative;
  overflow: hidden;
}

.notebook-cell__toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.notebook-cell__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cell-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 14, 26, 0.92);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.cell-action--run {
  border-color: rgba(121, 223, 255, 0.32);
  background: linear-gradient(135deg, rgba(31, 78, 136, 0.92), rgba(17, 151, 205, 0.84));
  display: none;
}

.notebook-cell__label {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(123, 231, 255, 0.12);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 700;
}

.notebook-cell--markdown {
  background:
    radial-gradient(circle at top right, rgba(121, 223, 255, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(14, 28, 44, 0.92), rgba(8, 15, 26, 0.94));
}

.notebook-cell--code {
  background:
    radial-gradient(circle at top right, rgba(185, 149, 255, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(16, 20, 40, 0.96), rgba(8, 12, 24, 0.98));
}

.notebook-markdown {
  color: var(--text);
  line-height: 1.7;
}

.notebook-markdown h1,
.notebook-markdown h2,
.notebook-markdown h3 {
  margin: 0 0 12px;
  font-family: "Sora", sans-serif;
}

.notebook-markdown h1 {
  font-size: 1.6rem;
  color: #e7f3ff;
}

.notebook-markdown h2 {
  font-size: 1.28rem;
  color: #9fe5ff;
}

.notebook-markdown h3 {
  font-size: 1.06rem;
  color: #b9c8ff;
}

.notebook-markdown p,
.notebook-markdown ul {
  margin: 0 0 12px;
  color: var(--muted);
}

.notebook-code,
.notebook-output pre {
  margin: 0;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 24, 33, 0.98), rgba(14, 18, 27, 0.99));
  border: 1px solid rgba(129, 151, 255, 0.14);
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.94rem;
  line-height: 1.7;
  color: #d4d4d4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 28px rgba(0, 0, 0, 0.16);
}

.code-token-keyword {
  color: #d4d4d4;
}

.code-token-string {
  color: #ce9178;
}

.code-token-number {
  color: #b5cea8;
}

.code-token-comment {
  color: #6a9955;
}

.code-token-function {
  color: #dcdcaa;
}

.code-token-builtin {
  color: #ffffff;
}

.code-token-constant {
  color: #569cd6;
}

.code-token-operator {
  color: #b5cea8;
}

.code-token-decorator {
  color: #ffd700;
}

.code-token-module {
  color: #23d18b;
}

.code-token-member {
  color: #ffffff;
}

.code-token-variable {
  color: #9cdcfe;
}

.code-token-reserved {
  color: #569cd6;
}

.code-token-command {
  color: #c586c0;
}

.notebook-output {
  margin-top: 12px;
}

.notebook-output pre {
  white-space: pre-wrap;
}

.notebook-output--runtime {
  border-radius: 16px;
  border: 1px solid rgba(142, 227, 181, 0.24);
  background:
    linear-gradient(180deg, rgba(17, 37, 31, 0.94), rgba(8, 20, 17, 0.96));
  padding: 14px;
}

.notebook-output--runtime.is-error {
  border-color: rgba(255, 122, 162, 0.24);
  background:
    linear-gradient(180deg, rgba(47, 20, 31, 0.94), rgba(24, 9, 16, 0.96));
}

.notebook-output__title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9af0c2;
}

.notebook-output--runtime.is-error .notebook-output__title {
  color: #ff9dbf;
}

.notebook-output img {
  max-width: 100%;
  border-radius: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 32px;
  text-align: center;
}

.empty-state__box {
  max-width: 640px;
}

.empty-state h4 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 1.35rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.viewer-data--loading {
  display: grid;
  place-items: center;
}

.viewer-loader {
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 36px 28px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid rgba(129, 151, 255, 0.16);
  background:
    radial-gradient(circle at top, rgba(108, 188, 255, 0.08), transparent 38%),
    rgba(10, 17, 31, 0.82);
}

.viewer-loader__spinner {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 3px solid rgba(123, 231, 255, 0.16);
  border-top-color: rgba(123, 231, 255, 0.92);
  animation: viewer-spin 0.8s linear infinite;
}

.viewer-loader__copy h4 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 1.2rem;
}

.viewer-loader__copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

@keyframes viewer-spin {
  to {
    transform: rotate(360deg);
  }
}

.sidebar-toggle {
  display: none;
  width: fit-content;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(123, 231, 255, 0.3);
  background: rgba(8, 14, 28, 0.84);
  color: var(--text);
  font-weight: 700;
}

body,
.sidebar,
.main-panel,
.viewer-data,
.table-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 231, 255, 0.55) rgba(10, 16, 30, 0.35);
}

body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.main-panel::-webkit-scrollbar,
.viewer-data::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.main-panel::-webkit-scrollbar-track,
.viewer-data::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
  background: rgba(10, 16, 30, 0.35);
}

body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.main-panel::-webkit-scrollbar-thumb,
.viewer-data::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(123, 231, 255, 0.45);
  border-radius: 999px;
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .viewer {
    position: relative;
    top: auto;
    align-self: auto;
    height: auto;
    max-height: none;
  }

  .sidebar {
    position: fixed;
    top: 18px;
    left: 18px;
    bottom: 18px;
    width: min(88vw, 360px);
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.25s ease;
    z-index: 5;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 980px) {
  .hero,
  .insight-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dataset-summary__header,
  .viewer__toolbar,
  .insight-card__toolbar {
    flex-direction: column;
  }

  .viewer__note {
    text-align: left;
  }

  .viewer__toolbar-actions {
    justify-content: flex-start;
  }

  .code-editor-modal__fields {
    grid-template-columns: 1fr;
  }

  .gallery-block__header {
    flex-direction: column;
    align-items: stretch;
  }

  .notebook-layout {
    grid-template-columns: 1fr;
  }

  .notebook-index {
    position: relative;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .hero,
  .dataset-summary,
  .viewer {
    padding: 18px;
  }

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

  .nav-group__actions {
    grid-template-columns: 1fr;
  }

  .dataset-summary__header h2 {
    font-size: 1.6rem;
  }

  .viewer__frame {
    height: auto;
    min-height: 48vh;
    max-height: none;
  }

  .sidebar,
  .main-panel {
    max-height: none;
  }
}

@keyframes marqueeShift {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-45%);
  }
}
