:root {
  color-scheme: dark;
  --bg-0: #06070a;
  --bg-1: #10131a;
  --bg-2: #161c27;
  --panel: rgba(15, 20, 29, 0.84);
  --panel-strong: rgba(21, 27, 38, 0.94);
  --line: rgba(120, 255, 212, 0.18);
  --line-strong: rgba(120, 255, 212, 0.34);
  --text: #f4f8ff;
  --muted: #9cb2ca;
  --accent: #7cffd4;
  --accent-warm: #ffbe63;
  --accent-soft: #82a8ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --radius: 20px;
}

body[data-theme="graphite"] {
  --bg-0: #0a0d12;
  --bg-1: #151922;
  --bg-2: #202635;
  --panel: rgba(18, 22, 31, 0.88);
  --panel-strong: rgba(28, 34, 46, 0.95);
  --line: rgba(170, 206, 255, 0.18);
  --line-strong: rgba(170, 206, 255, 0.34);
  --muted: #adc0d9;
  --accent: #8fd0ff;
  --accent-warm: #f4c982;
  --accent-soft: #aab7ff;
}

body[data-theme="forest"] {
  --bg-0: #050907;
  --bg-1: #0d1712;
  --bg-2: #15241c;
  --panel: rgba(12, 22, 17, 0.86);
  --panel-strong: rgba(16, 29, 22, 0.94);
  --line: rgba(138, 255, 188, 0.18);
  --line-strong: rgba(138, 255, 188, 0.34);
  --muted: #b1cbb9;
  --accent: #8ff0b7;
  --accent-warm: #ffd17a;
  --accent-soft: #8cc8ff;
}

body[data-theme="harbor"] {
  --bg-0: #061018;
  --bg-1: #10202e;
  --bg-2: #163147;
  --panel: rgba(14, 27, 38, 0.84);
  --panel-strong: rgba(18, 34, 49, 0.94);
  --line: rgba(134, 228, 255, 0.2);
  --line-strong: rgba(134, 228, 255, 0.34);
  --muted: #abc2d4;
  --accent: #83e4ff;
  --accent-warm: #ffd28b;
  --accent-soft: #8bb8ff;
}

body[data-theme="ember"] {
  --bg-0: #0b0706;
  --bg-1: #1a1110;
  --bg-2: #261817;
  --panel: rgba(24, 16, 15, 0.86);
  --panel-strong: rgba(34, 23, 22, 0.94);
  --line: rgba(255, 190, 136, 0.18);
  --line-strong: rgba(255, 190, 136, 0.34);
  --muted: #d1b9af;
  --accent: #ffbe88;
  --accent-warm: #ffe08d;
  --accent-soft: #f0a1a1;
}

body[data-theme="contrast"] {
  --bg-0: #020305;
  --bg-1: #0b1017;
  --bg-2: #121925;
  --panel: rgba(12, 16, 24, 0.94);
  --panel-strong: rgba(15, 20, 30, 0.98);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.32);
  --text: #ffffff;
  --muted: #d0dbeb;
  --accent: #9fffe3;
  --accent-warm: #ffd58f;
  --accent-soft: #a6c7ff;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Trebuchet MS", "Segoe UI Variable", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(130, 168, 255, 0.16), transparent 32%),
    radial-gradient(circle at top left, rgba(124, 255, 212, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 190, 99, 0.08), transparent 24%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 28px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 28px
    ),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.02) 48%, transparent 52%, transparent 100%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 2px,
      transparent 2px,
      transparent 6px
    );
  opacity: 0.6;
}

button,
input,
label {
  font: inherit;
}

.app-shell {
  width: min(1780px, calc(100% - 28px));
  height: calc(100vh - 20px);
  margin: 10px auto;
  position: relative;
  z-index: 1;
  display: grid;
}

.panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 28%),
    linear-gradient(135deg, rgba(124, 255, 212, 0.02), rgba(130, 168, 255, 0.04)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(124, 255, 212, 0.05), transparent 20%),
    linear-gradient(315deg, rgba(255, 190, 99, 0.04), transparent 28%);
}

.hero {
  padding: 14px 18px;
  display: grid;
  gap: 10px 16px;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 0.9fr);
  align-items: end;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 5px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(124, 255, 212, 0.16), rgba(130, 168, 255, 0.08));
  border: 1px solid var(--line-strong);
}

.brand-mark span {
  display: block;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent), #2bc5b4);
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.28);
}

.brand-mark span:nth-child(2) {
  background: linear-gradient(180deg, var(--accent-warm), #d68732);
}

.brand-mark span:nth-child(3) {
  background: linear-gradient(180deg, var(--accent-soft), #5671dd);
}

.hero-copy h1,
.panel__header h2,
.dropzone h2 {
  margin: 0;
  font-family: "Consolas", "Lucida Console", monospace;
  letter-spacing: 0.02em;
}

.hero-copy h1 {
  font-size: clamp(1rem, 1vw + 0.9rem, 1.9rem);
  line-height: 1.02;
  max-width: 26ch;
  text-wrap: balance;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.lede {
  margin: 4px 0 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.hero-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.chip {
  position: relative;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chip__label,
.metric-card__label,
.palette-panel__label,
.status {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}

.chip strong {
  display: block;
  margin-top: 1px;
  font-size: 0.78rem;
  line-height: 1.25;
}

.workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr) minmax(300px, 360px);
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.tool-column {
  display: grid;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.controls-panel,
.preview-panel,
.details-panel {
  padding: 18px;
}

.controls-panel {
  display: grid;
  gap: 14px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.preview-panel {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.details-panel {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.dropzone {
  position: relative;
  min-height: clamp(220px, 34vh, 360px);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 24px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background:
    radial-gradient(circle at top center, rgba(124, 255, 212, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 36%),
    rgba(8, 11, 16, 0.48);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone:focus-visible,
.dropzone.is-active {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(124, 255, 212, 0.54);
  background-color: rgba(16, 24, 31, 0.68);
}

.dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.dropzone__icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  border: 1px solid rgba(124, 255, 212, 0.26);
  background:
    linear-gradient(180deg, rgba(124, 255, 212, 0.14), rgba(130, 168, 255, 0.08)),
    linear-gradient(90deg, transparent 35%, rgba(255, 255, 255, 0.14) 35%, rgba(255, 255, 255, 0.14) 65%, transparent 65%),
    linear-gradient(180deg, transparent 35%, rgba(255, 255, 255, 0.14) 35%, rgba(255, 255, 255, 0.14) 65%, transparent 65%);
}

.dropzone h2 {
  font-size: 1.08rem;
  line-height: 1.22;
}

.dropzone__icon,
.dropzone h2,
.dropzone p,
.dropzone .button {
  position: relative;
  z-index: 1;
}

.dropzone p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 28ch;
  text-align: center;
  font-size: 0.9rem;
}

.dropzone .button {
  white-space: nowrap;
}

.status {
  margin: 10px 4px 0;
  min-height: 1.3em;
  font-size: 0.74rem;
}

.panel__header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.panel__header h2 {
  font-size: 1rem;
}

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

.preview-select {
  min-width: 150px;
  max-width: 180px;
}

.panel__header--stacked {
  align-items: flex-start;
  margin-bottom: 0;
}

.panel__header--stacked .eyebrow {
  margin-bottom: 6px;
}

.preview-panel > .panel__header {
  margin-bottom: 0;
}

.tab-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  padding: 7px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    rgba(8, 11, 16, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-button {
  position: relative;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-family: "Consolas", "Lucida Console", monospace;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.tab-button::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 8px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(124, 255, 212, 0.9), rgba(130, 168, 255, 0.75));
  opacity: 0;
  transform: scaleY(0.35);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tab-button:hover,
.tab-button:focus-visible {
  outline: none;
  color: var(--text);
  border-color: rgba(124, 255, 212, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.tab-button:hover::before,
.tab-button:focus-visible::before,
.tab-button.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.tab-button.is-active {
  color: var(--text);
  border-color: rgba(124, 255, 212, 0.24);
  background:
    linear-gradient(135deg, rgba(124, 255, 212, 0.08), rgba(130, 168, 255, 0.08)),
    rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tab-panels {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.tab-panel {
  animation: panel-reveal 180ms ease;
  min-height: 0;
}

.tab-panel[hidden] {
  display: none;
}

.tab-list--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 6px;
}

.tab-button--compact {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.tab-list--compact {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.controls-panel .tab-panels {
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.controls-panel .tab-panel {
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.preview-panels .tab-panel {
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.details-scroll {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  align-content: start;
}

.control {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.control > span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.control__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.control__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 255, 212, 0.2), rgba(130, 168, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), #1db7a7);
  border: 2px solid rgba(9, 14, 20, 0.8);
  box-shadow: 0 0 0 4px rgba(124, 255, 212, 0.14);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), #1db7a7);
  box-shadow: 0 0 0 4px rgba(124, 255, 212, 0.14);
}

output {
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 12px;
  text-align: center;
  font-family: "Consolas", "Lucida Console", monospace;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

input[type="number"] {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 18, 0.7);
  color: var(--text);
}

input[type="number"]:focus-visible,
select:focus-visible,
input[type="range"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(124, 255, 212, 0.14);
}

.select-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 18, 0.7);
  color: var(--text);
}

.color-input {
  width: 56px;
  height: 40px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 12, 18, 0.7);
  cursor: pointer;
}

.color-input:disabled,
.select-input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.dimension-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggles {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.tool-section {
  position: relative;
  z-index: 1;
  margin: 4px 0 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tool-section--flush {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  border-top: 0;
}

.tool-section__title {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  outline: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.button--ghost:hover:not(:disabled),
.button--ghost:focus-visible:not(:disabled) {
  border-color: rgba(124, 255, 212, 0.4);
}

.button--primary {
  width: 100%;
  position: relative;
  z-index: 1;
  font-weight: 700;
  color: #081118;
  background: linear-gradient(135deg, var(--accent), #2fc2b2 55%, var(--accent-warm));
  box-shadow: 0 14px 30px rgba(124, 255, 212, 0.18);
}

.controls-footer {
  position: relative;
  z-index: 1;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-stage {
  position: relative;
  z-index: 1;
  min-height: clamp(220px, 34vh, 380px);
  height: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    rgba(10, 14, 20, 0.72);
  background-size: 24px 24px, 24px 24px, auto, auto;
  background-position: 0 0, 12px 12px, 0 0, 0 0;
  display: grid;
  place-items: center;
}

#previewCanvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.preview-deck {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.preview-progress {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.preview-progress__track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.preview-progress__bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2fc2b2 52%, var(--accent-soft));
  box-shadow: 0 0 18px rgba(124, 255, 212, 0.18);
  transition: width 120ms linear;
}

.preview-progress__label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.preview-panels {
  min-height: 0;
  height: 100%;
}

.preview-panel__section {
  height: 100%;
}

#panel-import:not([hidden]) {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  align-content: start;
}

#panel-canvas:not([hidden]) {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.metrics {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  margin-top: 0;
}

.metric,
.metric-card strong {
  font-family: "Consolas", "Lucida Console", monospace;
}

.metric {
  color: var(--accent);
  font-size: 0.9rem;
}

.metric-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metrics--sidebar {
  grid-template-columns: 1fr;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.palette-panel {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.analysis-panel {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.analysis-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.diagnostic-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.diagnostic-card--prominent {
  background:
    linear-gradient(135deg, rgba(124, 255, 212, 0.06), rgba(130, 168, 255, 0.05)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(124, 255, 212, 0.16);
}

.diagnostic-card strong {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
}

.integrity-report {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.assist-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.analysis-visual {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 10px;
}

.analysis-copy {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.pie-chart {
  --pie-fill: conic-gradient(
    from -90deg,
    rgba(124, 255, 212, 0.3) 0 35%,
    rgba(130, 168, 255, 0.24) 35% 70%,
    rgba(255, 190, 99, 0.22) 70% 100%
  );
  position: relative;
  width: 116px;
  height: 116px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pie-fill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 12px 24px rgba(255, 255, 255, 0.04),
    inset 0 -16px 24px rgba(0, 0, 0, 0.28);
}

.pie-chart::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.05), transparent 48%),
    rgba(9, 12, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pie-chart--small {
  width: 96px;
  height: 96px;
}

.pie-chart__label {
  position: relative;
  z-index: 1;
  max-width: 58px;
  text-align: center;
  font-family: "Consolas", "Lucida Console", monospace;
  font-size: 0.66rem;
  line-height: 1.2;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-legend {
  display: grid;
  gap: 8px;
}

.chart-legend__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.chart-legend__name {
  min-width: 0;
}

.chart-legend__value {
  font-family: "Consolas", "Lucida Console", monospace;
  color: var(--text);
}

.chart-legend__empty {
  color: var(--muted);
  font-size: 0.76rem;
}

.palette-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.swatch {
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 -8px 12px rgba(0, 0, 0, 0.2);
}

.swatch.is-empty {
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

@keyframes panel-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1500px) {
  .app-shell {
    width: min(1880px, calc(100% - 28px));
  }
}

@media (max-width: 1460px) {
  .workspace {
    grid-template-columns: minmax(300px, 350px) minmax(0, 1fr) minmax(260px, 310px);
  }

  .analysis-visual {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .analysis-copy {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  body {
    min-height: 100%;
  }

  .app-shell {
    height: auto;
    width: min(100%, calc(100% - 20px));
    margin: 10px auto 20px;
    display: block;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .tool-column,
  .controls-panel,
  .preview-panel,
  .details-panel {
    min-height: 0;
  }

  .controls-panel {
    height: auto;
    overflow: visible;
  }

  .preview-panel,
  .details-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .tab-shell,
  .preview-deck,
  .tab-panels,
  .preview-panels,
  .tab-panel,
  .details-scroll {
    min-height: initial;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .controls-panel,
  .preview-panel,
  .details-panel {
    padding: 16px;
  }

  .dimension-grid,
  .metrics,
  .analysis-grid,
  .palette-swatches {
    grid-template-columns: 1fr;
  }

  .analysis-visual {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .tab-list {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 8px;
  }

  .tab-list--compact {
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  }

  .tab-button {
    min-height: 46px;
  }

  .preview-stage {
    min-height: 260px;
    height: 260px;
  }
}
