:root {
  --bg: #09111f;
  --bg-deep: #050b16;
  --panel: rgba(13, 24, 43, 0.94);
  --panel-strong: rgba(17, 31, 55, 0.98);
  --panel-soft: rgba(11, 21, 39, 0.72);
  --line: rgba(137, 166, 213, 0.18);
  --line-strong: rgba(137, 166, 213, 0.34);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.84);
  --text-faint: rgba(255, 255, 255, 0.64);
  --accent: #f4b75e;
  --accent-strong: #ffd78a;
  --secondary: #66d0ff;
  --secondary-soft: rgba(102, 208, 255, 0.14);
  --danger: #ff7b74;
  --success: #79dfa2;
  --warning: #ffcf70;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.42);
  --mono: "Microsoft YaHei", "微软雅黑", sans-serif;
  --body: "Microsoft YaHei", "微软雅黑", sans-serif;
  --display: "Microsoft YaHei", "微软雅黑", sans-serif;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(102, 208, 255, 0.12), transparent 28%),
    radial-gradient(circle at 100% 25%, rgba(244, 183, 94, 0.12), transparent 26%),
    linear-gradient(180deg, #08111f 0%, #06101d 55%, #050c15 100%);
  color: var(--text);
  font-family: var(--body);
}

body {
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  padding: 18px;
}

.control-rail {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding-right: 4px;
}

.control-rail::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar {
  width: 8px;
}

.control-rail::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(137, 166, 213, 0.22);
  border-radius: 999px;
}

.rail-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 4px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(244, 183, 94, 0.22), rgba(102, 208, 255, 0.16)),
    rgba(13, 23, 42, 0.9);
  border: 1px solid rgba(244, 183, 94, 0.35);
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.08em;
}

.rail-head h1,
.hero-banner h2,
.panel-headline h3,
.section-head h2,
.drawer-header h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.04em;
}

.rail-head h1 {
  font-size: 36px;
  font-weight: 700;
}

.eyebrow,
.card-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: var(--mono);
}

.eyebrow,
.card-kicker,
.hero-copy,
.hero-badges {
  display: none !important;
}

.rail-card,
.panel-block,
.detail-drawer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 28, 50, 0.96), rgba(9, 18, 33, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.rail-card::before,
.panel-block::before,
.detail-drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 10%, transparent 90%, rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 35%);
}

.rail-card {
  padding: 18px;
  margin-bottom: 16px;
}

.rail-card.is-collapsed .card-body {
  display: none;
}

.rail-card-glow {
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(244, 183, 94, 0.08);
}

.section-head,
.panel-headline,
.split-headline,
.compact-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.export-mini-button {
  white-space: nowrap;
}

.insight-panel {
  margin-bottom: 16px;
}

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

.insight-summary-head strong {
  font-size: 18px;
  color: #ffffff;
}

.insight-summary-head span {
  font-size: 12px;
  color: var(--text-muted);
}

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

.insight-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 14, 26, 0.96), rgba(10, 18, 31, 0.92));
  border: 1px solid rgba(137, 166, 213, 0.14);
}

.insight-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #ffffff;
}

.insight-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}

.section-head h2,
.panel-headline h3 {
  font-size: 22px;
}

.hero-banner h2,
.panel-headline h3,
.section-head h2,
.compact-head h3 {
  background: linear-gradient(135deg, #79a8ff 0%, #9278ff 52%, #c57cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head-large h2 {
  font-size: 30px;
  line-height: 1.1;
}

.section-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.compact-head h3,
.split-headline h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.section-head {
  margin-bottom: 14px;
}

.compact-head {
  margin-top: 18px;
  margin-bottom: 12px;
}

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

.mode-tab,
.ghost-button,
.action-button,
.drawer-close,
.ranking-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 13px/1 var(--body);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.mode-tab,
.ranking-tab,
.ghost-button,
.drawer-close {
  background: rgba(137, 166, 213, 0.08);
  border-color: rgba(137, 166, 213, 0.18);
  color: var(--text-muted);
}

.mode-tab:hover,
.ghost-button:hover,
.action-button:hover,
.drawer-close:hover,
.ranking-tab:hover {
  transform: translateY(-1px);
}

.mode-tab.is-active,
.ranking-tab.is-active {
  background: linear-gradient(135deg, rgba(244, 183, 94, 0.18), rgba(102, 208, 255, 0.14));
  border-color: rgba(244, 183, 94, 0.35);
  color: var(--text);
}

.mode-tab,
.ranking-tab {
  padding: 12px 10px;
}

.ghost-button,
.action-button,
.drawer-close {
  padding: 12px 14px;
}

.action-button {
  background: linear-gradient(135deg, var(--accent) 0%, #ffcf70 100%);
  color: #ffffff;
}

.collapse-button {
  appearance: none;
  min-width: 72px;
  border-radius: 999px;
  border: 1px solid rgba(137, 166, 213, 0.18);
  background: rgba(137, 166, 213, 0.08);
  color: var(--text);
  padding: 12px 14px;
  font: 600 13px/1 var(--body);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.collapse-button:hover {
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

.source-pane {
  display: none;
}

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

.rail-card-minimal .inline-grid,
.rail-card-minimal #reparseButton,
.rail-card-minimal #dataStatus,
.rail-card-minimal #datasetMeta,
.rail-card-minimal #datasetNotes {
  display: none !important;
}

.upload-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(244, 183, 94, 0.35);
  background:
    linear-gradient(180deg, rgba(244, 183, 94, 0.06), rgba(102, 208, 255, 0.04)),
    rgba(7, 14, 26, 0.75);
  cursor: pointer;
  margin-bottom: 12px;
}

.upload-panel input {
  display: none;
}

.upload-badge,
.caption-pill,
.sub-caption,
.metric-note,
.chip,
.metric-card span,
.micro-note,
.status-line,
.field-label,
.selection-caption,
.drawer-label {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-panel strong,
.metric-card strong,
.big-number,
.meta-tile strong {
  font-weight: 700;
}

.upload-panel strong {
  font-size: 16px;
  color: var(--text);
}

.compact-meta {
  margin-top: 14px;
}

.compact-notes {
  margin-top: 10px;
}

.inline-grid,
.export-grid {
  display: grid;
  gap: 10px;
}

.inline-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.export-grid {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: #ffffff;
}

.field-input,
.field-select,
.data-textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(137, 166, 213, 0.18);
  background: rgba(5, 12, 23, 0.8);
  color: var(--text);
  padding: 12px 13px;
  font: 500 13px/1.4 var(--body);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-text-fill-color: #ffffff;
}

.field-input::placeholder,
.data-textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.field-select option {
  background: #09111f;
  color: #ffffff;
}

.field-input:focus,
.field-select:focus,
.data-textarea:focus,
.action-button:focus-visible,
.ghost-button:focus-visible,
.mode-tab:focus-visible,
.ranking-tab:focus-visible,
.gallery-category-tab:focus-visible,
.drawer-close:focus-visible {
  border-color: rgba(244, 183, 94, 0.52);
  box-shadow: 0 0 0 4px rgba(244, 183, 94, 0.1);
  outline: none;
}

.data-textarea {
  min-height: 138px;
  resize: vertical;
}

.filter-textarea {
  min-height: 96px;
}

.status-line {
  min-height: 18px;
  margin: 12px 0 0;
  line-height: 1.5;
}

.import-progress-panel {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
}

.import-progress-panel.is-hidden {
  display: none;
}

.import-progress-head,
.filter-card-head,
.filter-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.import-progress-label,
.import-progress-percent {
  font-size: 12px;
  color: #d7defa;
}

.import-progress-percent {
  font-family: var(--mono);
}

.import-progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(137, 166, 213, 0.14);
  border: 1px solid rgba(137, 166, 213, 0.12);
}

.import-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #78a5ff 0%, #8d79ff 48%, #c47cff 100%);
  box-shadow: 0 0 14px rgba(141, 121, 255, 0.35);
  transition: width 0.25s ease;
}

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

.meta-tile,
.metric-card,
.selection-row,
.mapping-card,
.filter-card,
.potential-card,
.gallery-card,
.drawer-metric,
.report-card {
  background: linear-gradient(180deg, rgba(8, 14, 26, 0.96), rgba(10, 18, 31, 0.92));
  border: 1px solid rgba(137, 166, 213, 0.14);
}

.meta-tile {
  padding: 14px;
  border-radius: 18px;
}

.meta-tile span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-tile strong {
  font-size: 22px;
  font-family: var(--display);
}

.note-stack {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.micro-note {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(102, 208, 255, 0.08);
  border: 1px solid rgba(102, 208, 255, 0.12);
  line-height: 1.55;
}

.mapping-grid,
.filter-grid {
  display: grid;
  gap: 10px;
}

.filter-section-title {
  margin: 8px 0 0;
  font-size: 14px;
  color: #ffffff;
  font-weight: 700;
}

.mapping-card,
.filter-card {
  padding: 12px;
  border-radius: 18px;
}

.mapping-card strong,
.filter-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #ffffff;
}

.filter-card-head strong {
  margin-bottom: 0;
}

.mapping-card .helper,
.filter-card .helper {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-faint);
}

.mapping-card .helper,
.filter-card .helper,
.metric-note {
  display: none;
}

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

.filter-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-inline-actions {
  justify-content: flex-end;
}

.filter-mini-button {
  padding: 6px 10px;
  min-height: auto;
  font-size: 11px;
}

.filter-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(137, 166, 213, 0.18);
  background: rgba(5, 12, 23, 0.8);
  color: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.filter-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 183, 94, 0.34);
}

.filter-choice.is-selected {
  border-color: rgba(244, 183, 94, 0.45);
  background: linear-gradient(135deg, rgba(244, 183, 94, 0.18), rgba(102, 208, 255, 0.14));
}

.filter-choice input {
  margin: 0;
  accent-color: #f4b75e;
}

.filter-choice span {
  line-height: 1;
}

.selection-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.selection-group {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(137, 166, 213, 0.12);
  background: rgba(8, 15, 28, 0.56);
}

.selection-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.selection-group-meta {
  display: grid;
  gap: 4px;
}

.selection-group-head strong {
  font-size: 14px;
  color: #ffffff;
}

.selection-group-head span {
  font-size: 11px;
  color: var(--text-muted);
}

.selection-group-list {
  display: grid;
  gap: 8px;
}

.selection-group-list[hidden] {
  display: none;
}

.selection-group-toggle {
  flex: 0 0 auto;
  min-width: 112px;
}

.selection-group-note {
  margin: 2px 0 0;
}

.selection-row {
  display: grid;
  grid-template-columns: auto 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
}

.selection-row img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.selection-row label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.selection-row input {
  accent-color: var(--accent);
}

.selection-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.selection-caption {
  display: block;
  margin-top: 3px;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.content-stage {
  display: grid;
  gap: 22px;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 28px 26px;
  border-radius: 32px;
  border: 1px solid rgba(102, 208, 255, 0.18);
  background:
    linear-gradient(130deg, rgba(12, 23, 40, 0.98), rgba(7, 14, 26, 0.95)),
    rgba(9, 17, 31, 0.96);
  box-shadow: var(--shadow);
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 24px;
  border: 1px dashed rgba(244, 183, 94, 0.2);
  pointer-events: none;
}

.hero-banner h2 {
  max-width: 940px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  color: #ffffff;
}

.hero-copy {
  margin: 12px 0 0;
  max-width: 840px;
  color: var(--text-muted);
  line-height: 1.75;
}

.hero-badges {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 170px;
}

.hero-badges span,
.caption-pill,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(244, 183, 94, 0.24);
  background: rgba(244, 183, 94, 0.08);
  color: var(--accent-strong);
}

.panel-block {
  padding: 22px;
}

.panel-headline {
  margin-bottom: 18px;
}

.summary-block .summary-grid + .split-headline {
  margin-top: 18px;
}

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

.metric-card {
  padding: 18px;
  border-radius: 18px;
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.metric-card strong {
  display: block;
  font-size: clamp(22px, 3vw, 34px);
  font-family: var(--display);
  letter-spacing: -0.05em;
}

.metric-note {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}

.funnel-board {
  display: grid;
  gap: 12px;
}

.funnel-stage {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) 120px 100px;
  gap: 12px;
  align-items: center;
}

.funnel-label strong,
.drawer-metric strong {
  display: block;
  font-size: 14px;
}

.funnel-label span,
.funnel-rate,
.funnel-conversion {
  font-size: 12px;
  color: var(--text-muted);
}

.funnel-rail {
  position: relative;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(137, 166, 213, 0.08);
}

.funnel-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(102, 208, 255, 0.65), rgba(244, 183, 94, 0.8));
}

.funnel-value {
  font-family: var(--display);
  font-size: 20px;
}

.board-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
}

.board-grid > .panel-block:only-child {
  grid-column: 1 / -1;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ranking-list,
.potential-grid,
.gallery-grid {
  display: grid;
  gap: 12px;
}

.ranking-list {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: stretch;
}

.ranking-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(137, 166, 213, 0.14);
  background: linear-gradient(180deg, rgba(8, 15, 28, 0.95), rgba(10, 17, 31, 0.9));
  cursor: pointer;
  text-align: left;
}

.ranking-rank {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(244, 183, 94, 0.12);
  color: var(--accent-strong);
  font-family: var(--display);
  font-size: 17px;
}

.ranking-row img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.ranking-copy {
  min-width: 0;
}

.ranking-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.45;
}

.ranking-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #ffffff;
  line-height: 1.5;
}

.ranking-detail {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

.ranking-bar {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(102, 208, 255, 0.08);
  overflow: hidden;
}

.ranking-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(102, 208, 255, 0.85), rgba(244, 183, 94, 0.85));
}

.ranking-value {
  min-width: 0;
  text-align: left;
  font-family: var(--display);
  font-size: 20px;
  color: #ffffff;
}

.collection-toggle {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 220px;
  margin-top: 6px;
}

.potential-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.potential-card {
  padding: 16px;
  border-radius: 20px;
}

.potential-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.potential-card p {
  margin: 0 0 12px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 13px;
}

.potential-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.potential-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(102, 208, 255, 0.06);
  cursor: pointer;
  border: 1px solid rgba(137, 166, 213, 0.1);
  text-align: left;
}

.potential-thumb {
  width: 96px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(5, 12, 23, 0.9);
}

.potential-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.potential-body {
  min-width: 0;
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(180px, 0.85fr);
  gap: 18px;
  align-items: center;
}

.potential-title {
  font-size: 14px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.45;
  align-self: center;
  justify-self: start;
}

.potential-reason {
  font-size: 12px;
  color: #ffffff;
  line-height: 1.5;
  text-align: left;
  margin: 0;
  align-self: center;
}

.gallery-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.gallery-category-tab {
  appearance: none;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 104px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(137, 166, 213, 0.18);
  background: linear-gradient(180deg, rgba(9, 17, 31, 0.96), rgba(10, 18, 31, 0.92));
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-category-tab:hover {
  transform: translateY(-1px);
}

.gallery-category-tab strong {
  font-size: 14px;
  line-height: 1.45;
  color: #ffffff;
}

.gallery-category-tab span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.gallery-category-tab.is-active {
  border-color: rgba(244, 183, 94, 0.36);
  background:
    linear-gradient(145deg, rgba(244, 183, 94, 0.14), rgba(102, 208, 255, 0.1)),
    linear-gradient(180deg, rgba(9, 17, 31, 0.98), rgba(10, 18, 31, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(244, 183, 94, 0.08);
}

.gallery-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  cursor: pointer;
  align-self: start;
}

.gallery-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(5, 11, 23, 0.82);
}

.gallery-frame::before,
.gallery-frame::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  width: 10px;
  background:
    radial-gradient(circle, rgba(9, 17, 31, 1) 36%, transparent 38%) center / 10px 24px repeat-y;
  opacity: 0.9;
  z-index: 2;
}

.gallery-frame::before {
  left: 10px;
}

.gallery-frame::after {
  right: 10px;
}

.gallery-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, rgba(5, 11, 23, 0), rgba(5, 11, 23, 0.92) 60%);
}

.gallery-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.gallery-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #ffffff;
}

.gallery-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
}

.gallery-stat span {
  display: block;
  font-size: 11px;
  color: #ffffff;
  line-height: 1.45;
}

.gallery-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #ffffff;
}

.detail-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(620px, calc(100vw - 32px));
  padding: 18px;
  transform: translateX(calc(100% + 20px));
  transition: transform 0.28s ease;
  z-index: 20;
}

.selection-list,
.ranking-list,
.potential-list,
.control-rail {
  scrollbar-color: rgba(137, 166, 213, 0.3) transparent;
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.drawer-close {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.drawer-body {
  height: calc(100% - 76px);
  overflow: auto;
  display: grid;
  gap: 16px;
  padding-right: 4px;
}

.drawer-media-grid {
  display: grid;
  grid-template-columns: 1.65fr 1.2fr;
  gap: 12px;
  align-items: start;
}

.drawer-main-image,
.drawer-aux-image,
.drawer-video,
.empty-thumb {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(137, 166, 213, 0.14);
  background: rgba(5, 11, 23, 0.82);
}

.drawer-side-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.drawer-main-image,
.drawer-aux-image {
  display: block;
  height: auto;
  max-height: min(64vh, 620px);
  object-fit: contain;
}

.empty-thumb {
  aspect-ratio: 1 / 1;
}

.drawer-video {
  aspect-ratio: 1 / 0.78;
}

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

.drawer-metric {
  padding: 12px;
  border-radius: 16px;
}

.drawer-metric span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.drawer-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 30px;
  padding: 6px 10px;
}

.empty-state {
  padding: 26px;
  border-radius: 20px;
  border: 1px dashed rgba(137, 166, 213, 0.2);
  background: rgba(6, 12, 23, 0.65);
  color: var(--text-muted);
  line-height: 1.75;
}

.report-workbench {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

.report-stage {
  width: 1440px;
  display: grid;
  gap: 20px;
}

.report-page {
  width: 1440px;
  height: 810px;
  padding: 46px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  border-radius: 26px;
  overflow: hidden;
}

.report-page.report-formal {
  background: linear-gradient(180deg, #f9fbff, #eaf0fb);
  color: #1b2942;
}

.report-page.report-visual {
  background: linear-gradient(180deg, #0d1629, #111f39);
  color: #f1f5ff;
}

.report-page.report-balanced {
  background: linear-gradient(180deg, #f4f7fd, #dfe8f7);
  color: #13203a;
}

.report-page.report-leadership {
  background: linear-gradient(180deg, #11203b, #101a30);
  color: #f1f5ff;
}

.report-page.report-operations {
  background: linear-gradient(180deg, #0c1526, #13233f);
  color: #f4f7ff;
}

.report-page.report-showcase {
  background: linear-gradient(180deg, #15121e, #281b3f);
  color: #fff5e4;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.report-header h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 44px;
  line-height: 1.05;
}

.report-subtitle {
  margin-top: 10px;
  font-size: 18px;
  opacity: 0.76;
}

.report-tag {
  padding: 10px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid currentColor;
  opacity: 0.74;
}

.report-body {
  display: grid;
  gap: 16px;
}

.report-card {
  border-radius: 24px;
  padding: 18px;
}

.report-grid-4,
.report-grid-3,
.report-gallery-grid,
.report-potential-grid,
.report-ranking-layout,
.report-insight-grid,
.report-inline-list {
  display: grid;
  gap: 14px;
}

.report-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.report-potential-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-ranking-layout {
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
}

.report-insight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-inline-list {
  gap: 10px;
}

.report-inline-list--tight {
  gap: 8px;
}

.report-insight-item {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(12, 19, 33, 0.44);
  border: 1px solid rgba(127, 140, 166, 0.16);
}

.report-insight-item h4 {
  margin: 0;
  font-size: 15px;
}

.report-insight-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.report-inline-material {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(12, 19, 33, 0.42);
  border: 1px solid rgba(127, 140, 166, 0.14);
}

.report-inline-material img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(8, 16, 29, 0.72);
}

.report-inline-copy {
  display: grid;
  gap: 8px;
}

.report-inline-copy h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
}

.report-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--mono);
  color: #0c1526;
  background: linear-gradient(135deg, #f4b75e, #ffde92);
}

.report-empty-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.report-card h3,
.report-card h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.report-big {
  font-family: var(--display);
  font-size: 28px;
}

.report-list,
.report-mini-list {
  display: grid;
  gap: 8px;
}

.report-item,
.report-mini-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(127, 140, 166, 0.15);
}

.report-mini-item:last-child,
.report-item:last-child {
  border-bottom: none;
}

.report-cover {
  grid-template-rows: 1fr auto;
}

.report-cover .report-body {
  align-content: end;
}

.report-cover h2 {
  font-size: 62px;
  max-width: 760px;
}

.report-cover .report-subtitle {
  max-width: 640px;
  line-height: 1.7;
}

.report-footer-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0.72;
}

.report-image-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  align-items: center;
}

.report-image-card img {
  width: 170px;
  height: 170px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(8, 16, 29, 0.72);
}

.report-image-card h4 {
  margin: 0 0 8px;
}

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

.report-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--mono);
  border: 1px solid rgba(127, 140, 166, 0.2);
}

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

.report-resource-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(12, 19, 33, 0.44);
  border: 1px solid rgba(127, 140, 166, 0.16);
  min-height: 126px;
}

.report-resource-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  border-radius: 18px;
  background: rgba(8, 16, 29, 0.72);
  border: 1px solid rgba(127, 140, 166, 0.18);
  overflow: hidden;
}

.report-resource-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.report-resource-copy {
  display: grid;
  gap: 6px;
}

.report-resource-copy h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}

.report-resource-id {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.report-resource-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.report-resource-metric {
  display: grid;
  gap: 2px;
}

.report-resource-metric span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
}

.report-resource-metric strong {
  font-size: 12px;
  color: #ffffff;
}

.report-resource-note {
  font-size: 11px;
  color: #caa9ff;
}

.report-funnel-row {
  display: grid;
  grid-template-columns: 220px 1fr 160px;
  gap: 14px;
  align-items: center;
}

.report-funnel-bar {
  position: relative;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(127, 140, 166, 0.14);
}

.report-funnel-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(102, 208, 255, 0.9), rgba(244, 183, 94, 0.9));
}

@media (max-width: 1400px) {
  .ranking-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .gallery-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .board-grid,
  .potential-grid {
    grid-template-columns: 1fr;
  }

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

  .ranking-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gallery-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-drawer {
    left: 12px;
    width: auto;
  }

  .detail-drawer:not(.is-open) {
    transform: translateY(calc(100% + 20px));
  }

  .detail-drawer.is-open {
    transform: translateY(0);
  }
}

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

  .hero-banner,
  .panel-block,
  .rail-card {
    border-radius: 24px;
  }

  .hero-banner {
    padding: 22px;
    flex-direction: column;
  }

  .hero-badges {
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .summary-grid,
  .inline-grid,
  .export-grid,
  .range-grid,
  .meta-grid,
  .insight-grid,
  .gallery-category-grid,
  .drawer-meta-grid,
  .drawer-media-grid,
  .funnel-stage {
    grid-template-columns: 1fr;
  }

  .panel-tools,
  .insight-summary-head,
  .potential-body {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .ranking-list,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .funnel-stage {
    gap: 8px;
  }

  .button-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
