:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: rgba(18, 21, 29, 0.88);
  --panel-solid: #12151d;
  --panel-raised: #171b25;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f5f8;
  --muted: #a2aaba;
  --muted-light: #c8ceda;
  --accent: #b8ff47;
  --accent-strong: #94e827;
  --cyan: #55dddf;
  --violet: #aa86ff;
  --amber: #ffbd63;
  --green: #67d996;
  --danger: #ff7b78;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 48% -18%, rgba(184, 255, 71, 0.06), transparent 37%),
    linear-gradient(180deg, #0c0e14 0, #080a0f 45%, #07090d 100%);
}

button,
input,
select {
  font: inherit;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
}

.ambient-one {
  top: 24%;
  left: -210px;
  width: 430px;
  height: 430px;
  background: rgba(89, 223, 225, 0.035);
}

.ambient-two {
  right: -260px;
  bottom: 0;
  width: 540px;
  height: 540px;
  background: rgba(170, 134, 255, 0.03);
}

.app-shell {
  width: min(1680px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 32px 42px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 5px);
  align-items: end;
  gap: 3px;
  width: 31px;
  height: 31px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid rgba(184, 255, 71, 0.35);
  border-radius: 9px;
  background: rgba(184, 255, 71, 0.08);
  box-shadow: inset 0 0 16px rgba(184, 255, 71, 0.05);
}

.brand-mark span {
  width: 5px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(184, 255, 71, 0.45);
}

.brand-mark span:nth-child(1) {
  height: 9px;
}

.brand-mark span:nth-child(2) {
  height: 18px;
}

.brand-mark span:nth-child(3) {
  height: 13px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  letter-spacing: 0.19em;
  font-size: 15px;
  font-weight: 720;
}

.brand-copy small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.25em;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(103, 217, 150, 0.08), 0 0 12px rgba(103, 217, 150, 0.3);
}

.topbar-actions {
  display: flex;
  justify-self: end;
  gap: 9px;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button svg {
  width: 17px;
  height: 17px;
}

.button.compact {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
}

.button.ghost {
  color: var(--muted-light);
  background: transparent;
}

.button.ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.button.primary {
  overflow: hidden;
  color: #11150b;
  border-color: rgba(215, 255, 151, 0.7);
  background: linear-gradient(180deg, #c7ff6e 0%, var(--accent) 100%);
  box-shadow:
    0 10px 30px rgba(157, 232, 39, 0.16),
    inset 0 1px rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

.button.primary:hover:not(:disabled) {
  box-shadow:
    0 13px 36px rgba(157, 232, 39, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.65);
}

.button:focus-visible,
select:focus-visible,
input:focus-visible,
.upload-card:focus-within {
  outline: 2px solid rgba(184, 255, 71, 0.7);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
  padding-top: 22px;
}

.workspace-column {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.control-column {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.preview-panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 22px 18px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.eyebrow::before {
  width: 14px;
  height: 1px;
  content: "";
  background: currentColor;
}

.panel-heading h1,
.section-title h2,
.diagnostics-title h2,
.guide-header h2 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.panel-heading h1 {
  font-size: clamp(18px, 1.5vw, 23px);
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.view-switcher {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.18);
}

.view-switcher button {
  min-width: 46px;
  height: 30px;
  padding: 0 9px;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  transition: 150ms ease;
}

.view-switcher button:hover {
  color: var(--text);
}

.view-switcher button.active {
  color: #f7f8fa;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.canvas-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  background:
    linear-gradient(45deg, #12151c 25%, transparent 25%),
    linear-gradient(-45deg, #12151c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #12151c 75%),
    linear-gradient(-45deg, transparent 75%, #12151c 75%),
    #0d1016;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  user-select: none;
}

#previewCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #090b0f;
}

.scene-viewport {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: #101318;
}

.scene-viewport[hidden] {
  display: none;
}

#sceneCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#sceneCanvas.dragging {
  cursor: grabbing;
}

.scene-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.scene-toolbar label {
  display: grid;
  gap: 4px;
}

.scene-toolbar label > span {
  color: rgba(225, 229, 236, 0.62);
  font-size: 7px;
}

.scene-toolbar select {
  width: 118px;
  height: 29px;
  padding: 0 24px 0 8px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.055);
  font-size: 9px;
}

.scene-toolbar select option {
  color: var(--text);
  background: #171a22;
}

.scene-toolbar .scene-exposure {
  width: 132px;
  padding: 0 3px 4px;
}

.scene-exposure > span {
  display: flex;
  justify-content: space-between;
}

.scene-exposure b {
  color: var(--accent);
  font-size: 7px;
  font-weight: 550;
}

.scene-exposure input {
  height: 3px;
}

.scene-reset {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  color: var(--muted-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

.scene-reset:hover {
  color: var(--accent);
  border-color: rgba(184, 255, 71, 0.3);
}

.scene-reset svg {
  width: 14px;
  height: 14px;
}

.scene-status {
  position: absolute;
  bottom: 13px;
  left: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(10px);
}

.scene-status b {
  font-size: 8px;
  font-weight: 600;
}

.scene-status small {
  color: var(--muted);
  font-size: 7px;
}

.scene-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.scene-live-dot.ready {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(184, 255, 71, 0.55);
}

.scene-loading,
.scene-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--muted-light);
  background: #11151b;
  font-size: 11px;
}

.scene-loading[hidden],
.scene-fallback[hidden] {
  display: none;
}

.scene-loading .processing-orbit {
  width: 42px;
  height: 42px;
}

.scene-loading .processing-orbit span {
  left: 18px;
  transform-origin: 3px 17px;
}

.scene-fallback {
  z-index: 5;
  padding: 30px;
  text-align: center;
}

.canvas-label {
  position: absolute;
  top: 14px;
  z-index: 3;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(5, 7, 10, 0.66);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.canvas-label.left {
  left: 14px;
}

.canvas-label.right {
  right: 14px;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 4;
  width: 1px;
  cursor: ew-resize;
  touch-action: none;
}

.compare-line {
  position: absolute;
  inset: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.compare-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #16191f;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.compare-knob svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(10px);
}

.processing-overlay[hidden] {
  display: none;
}

.processing-overlay strong {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 650;
}

.processing-overlay small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.processing-orbit {
  position: relative;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(184, 255, 71, 0.2);
  border-radius: 50%;
}

.processing-orbit::before,
.processing-orbit::after {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(184, 255, 71, 0.12);
  border-radius: 50%;
  content: "";
}

.processing-orbit::after {
  inset: 18px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(184, 255, 71, 0.65);
}

.processing-orbit span {
  position: absolute;
  top: 4px;
  left: 23px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(184, 255, 71, 0.7);
  transform-origin: 3px 22px;
  animation: orbit 1s linear infinite;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 20px;
  padding: 12px 20px;
}

.image-meta {
  display: flex;
  gap: 17px;
  color: var(--muted);
  font-size: 10px;
}

.image-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.image-meta svg {
  width: 14px;
  height: 14px;
}

.image-meta b {
  color: var(--muted-light);
  font-weight: 550;
}

.strength-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(36%, 250px);
  color: var(--muted-light);
  font-size: 10px;
}

.strength-control span {
  white-space: nowrap;
}

.strength-control b {
  display: inline-block;
  min-width: 30px;
  color: var(--text);
  text-align: right;
}

input[type="range"] {
  --range-value: 50%;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--accent) 0,
    var(--accent) var(--range-value),
    rgba(255, 255, 255, 0.09) var(--range-value),
    rgba(255, 255, 255, 0.09) 100%
  );
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--panel-solid);
  border-radius: 50%;
  appearance: none;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(184, 255, 71, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 3px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(184, 255, 71, 0.4);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 94px;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(18, 21, 29, 0.7);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.14);
}

.metric-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid currentColor;
  border-radius: 11px;
}

.metric-icon svg {
  width: 19px;
  height: 19px;
}

.metric-icon.cyan {
  color: var(--cyan);
  background: rgba(85, 221, 223, 0.07);
  border-color: rgba(85, 221, 223, 0.18);
}

.metric-icon.violet {
  color: var(--violet);
  background: rgba(170, 134, 255, 0.07);
  border-color: rgba(170, 134, 255, 0.18);
}

.metric-icon.amber {
  color: var(--amber);
  background: rgba(255, 189, 99, 0.07);
  border-color: rgba(255, 189, 99, 0.18);
}

.metric-icon.green {
  color: var(--green);
  background: rgba(103, 217, 150, 0.07);
  border-color: rgba(103, 217, 150, 0.18);
}

.metric-card > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.metric-card span,
.metric-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card span {
  font-size: 10px;
}

.metric-card strong {
  margin: 3px 0;
  font-size: clamp(17px, 1.5vw, 23px);
  font-weight: 620;
  letter-spacing: -0.035em;
}

.metric-card small {
  font-size: 9px;
}

.diagnostics-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 17px 19px;
}

.diagnostics-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.diagnostics-title h2 {
  font-size: 13px;
}

.diagnostics-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.diagnostic-status {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(103, 217, 150, 0.22);
  border-radius: 50%;
  color: var(--green);
  background: rgba(103, 217, 150, 0.08);
}

.diagnostic-status.warning {
  color: var(--amber);
  border-color: rgba(255, 189, 99, 0.22);
  background: rgba(255, 189, 99, 0.08);
}

.diagnostic-status.danger {
  color: var(--danger);
  border-color: rgba(255, 123, 120, 0.22);
  background: rgba(255, 123, 120, 0.08);
}

.diagnostic-status svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.capability-tags {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.capability-tags span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-light);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
}

.capability-tags .supported::before,
.capability-tags .unsupported::before {
  margin-right: 4px;
  content: "✓";
}

.capability-tags .supported::before {
  color: var(--green);
}

.capability-tags .unsupported::before {
  color: var(--danger);
  content: "×";
}

.workflow-panel {
  max-height: calc(100vh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  scrollbar-width: thin;
}

.workflow-panel::-webkit-scrollbar {
  width: 5px;
}

.workflow-panel::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
}

.workflow-section {
  padding: 21px 21px 22px;
}

.fit-mode-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 19px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.18);
}

.fit-mode-switcher button {
  display: flex;
  min-width: 0;
  min-height: 43px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: 150ms ease;
}

.fit-mode-switcher button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.fit-mode-switcher button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

.fit-mode-switcher button.active b {
  color: var(--accent);
}

.fit-mode-switcher b {
  overflow: hidden;
  max-width: 100%;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fit-mode-switcher small {
  overflow: hidden;
  max-width: 100%;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.step-index {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.step-index.active,
.step-index.complete {
  color: #14190d;
  border-color: rgba(184, 255, 71, 0.65);
  background: var(--accent);
}

.section-title h2 {
  font-size: 14px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.section-divider {
  height: 1px;
  margin: 0 21px;
  background: var(--line);
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.upload-grid.single-reference {
  grid-template-columns: 1fr;
}

.upload-grid.single-reference .upload-card {
  height: 164px;
}

.upload-card[hidden] {
  display: none;
}

.upload-card {
  position: relative;
  display: block;
  min-width: 0;
  height: 118px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
  background: #0c0f14;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.upload-card:hover,
.upload-card.dragging {
  border-color: rgba(184, 255, 71, 0.5);
  transform: translateY(-1px);
}

.upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-card canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 20%, rgba(0, 0, 0, 0.76) 100%);
}

.upload-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(7, 9, 12, 0.58);
  backdrop-filter: blur(6px);
  font-size: 8px;
  font-weight: 650;
}

.upload-badge.ai {
  color: var(--accent);
  border-color: rgba(184, 255, 71, 0.24);
}

.replace-action {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(7, 9, 12, 0.52);
  opacity: 0;
  font-size: 8px;
  transition: opacity 160ms ease;
}

.replace-action svg {
  width: 10px;
  height: 10px;
}

.upload-card:hover .replace-action {
  opacity: 1;
}

.file-name {
  position: absolute;
  right: 9px;
  bottom: 9px;
  left: 9px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.84);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-collection {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.reference-collection[hidden] {
  display: none;
}

.reference-collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reference-collection-heading span {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 550;
}

.reference-collection-heading small {
  color: var(--muted);
  font-size: 8px;
}

.reference-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.reference-thumb,
.add-reference-card {
  position: relative;
  min-width: 0;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.reference-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-thumb::after {
  position: absolute;
  inset: auto 0 0;
  height: 30px;
  content: "";
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  pointer-events: none;
}

.reference-thumb > span {
  position: absolute;
  right: 6px;
  bottom: 5px;
  left: 6px;
  z-index: 1;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.85);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(5, 7, 10, 0.7);
  cursor: pointer;
}

.reference-thumb button:hover {
  color: var(--danger);
}

.reference-thumb button svg {
  width: 10px;
  height: 10px;
}

.add-reference-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  border-style: dashed;
  cursor: pointer;
  font-size: 8px;
  transition: 150ms ease;
}

.add-reference-card:hover {
  color: var(--accent);
  border-color: rgba(184, 255, 71, 0.4);
  background: rgba(184, 255, 71, 0.035);
}

.add-reference-card svg {
  width: 16px;
  height: 16px;
}

.reference-collection > p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
}

.pair-alert {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.pair-alert.warning {
  color: var(--amber);
}

.pair-alert svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.reference-options {
  display: grid;
  gap: 8px;
  margin-top: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.reference-options[hidden] {
  display: none;
}

.reference-options > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-light);
  font-size: 8px;
}

.reference-options select {
  width: 178px;
  height: 28px;
  padding: 0 7px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #151922;
  font-size: 8px;
}

.local-analysis-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 7px;
}

.local-analysis-note span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(103, 217, 150, 0.4);
}

.form-stack {
  display: grid;
  gap: 10px;
}

.field-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 9px;
}

.field-hint {
  color: var(--muted);
}

.select-wrap,
.text-field-wrap {
  position: relative;
}

.select-wrap select,
.text-field-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(0, 0, 0, 0.18);
  font-size: 11px;
  transition: border-color 150ms ease;
}

.select-wrap select {
  appearance: none;
  cursor: pointer;
}

.select-wrap select:hover,
.text-field-wrap input:hover {
  border-color: var(--line-strong);
}

.select-wrap option {
  color: var(--text);
  background: #171a22;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.slider-field {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.slider-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 10px;
}

.slider-field b {
  font-weight: 500;
}

.slider-field output {
  min-width: 28px;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-align: center;
  font-size: 9px;
}

.slider-field small {
  color: var(--muted);
  font-size: 8px;
}

.style-controls {
  display: grid;
  gap: 12px;
  margin-top: 2px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.style-controls[hidden] {
  display: none;
}

.advanced-style-controls {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.12);
}

.advanced-style-controls summary {
  padding: 10px;
  color: var(--muted-light);
  cursor: pointer;
  font-size: 9px;
  list-style-position: inside;
}

.advanced-style-controls[open] summary {
  border-bottom: 1px solid var(--line);
}

.advanced-style-controls > div {
  display: grid;
  gap: 12px;
  padding: 11px;
}

.compact-slider {
  margin-top: 0;
}

.semantic-protections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.semantic-protections label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-light);
  font-size: 8px;
}

.semantic-protections input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
}

.fit-button {
  width: 100%;
  height: 48px;
  margin-top: 17px;
  font-size: 12px;
}

.fit-button .button-glow {
  position: absolute;
  top: -30px;
  left: 20%;
  width: 90px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
  filter: blur(22px);
}

.fit-button > *:not(.button-glow) {
  position: relative;
}

.fit-button kbd {
  position: absolute;
  right: 12px;
  padding: 3px 5px;
  border: 1px solid rgba(20, 25, 13, 0.16);
  border-radius: 4px;
  color: rgba(20, 25, 13, 0.52);
  background: rgba(255, 255, 255, 0.23);
  font-family: inherit;
  font-size: 8px;
  font-weight: 650;
}

.fit-button.busy {
  cursor: wait;
}

.candidate-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(184, 255, 71, 0.13);
  border-radius: 10px;
  background: rgba(184, 255, 71, 0.025);
}

.candidate-panel[hidden] {
  display: none;
}

.candidate-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.candidate-heading > span {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 550;
}

.candidate-heading small {
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.candidate-switcher button {
  height: 29px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-size: 8px;
}

.candidate-switcher button:hover {
  color: var(--text);
}

.candidate-switcher button.active {
  color: #11150b;
  border-color: rgba(184, 255, 71, 0.55);
  background: var(--accent);
  font-weight: 650;
}

.style-palette {
  display: flex;
  min-height: 8px;
  gap: 4px;
}

.style-palette button {
  flex: 1;
  height: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
  transition:
    height 120ms ease,
    border-color 120ms ease;
}

.style-palette button:hover,
.style-palette button.active {
  height: 12px;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(184, 255, 71, 0.25);
}

.export-section {
  padding-bottom: 20px;
}

.text-field-wrap input {
  padding-right: 82px;
}

.text-field-wrap span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
  transform: translateY(-50%);
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.export-button {
  min-height: 54px;
  justify-content: flex-start;
  padding: 0 10px;
}

.export-button svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.export-button span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.export-button b {
  font-size: 9px;
}

.export-button small {
  overflow: hidden;
  max-width: 86px;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 2px solid rgba(184, 255, 71, 0.55);
  border-radius: 0 7px 7px 0;
  color: var(--muted);
  background: rgba(184, 255, 71, 0.035);
  font-size: 8px;
  line-height: 1.55;
}

.lut-validation {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.validation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.validation-heading > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.validation-heading b {
  font-size: 10px;
  font-weight: 600;
}

.validation-heading > span:last-child {
  color: var(--muted);
  font-size: 8px;
}

.validation-heading > span:last-child.ready {
  color: var(--green);
}

.validation-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(143, 150, 167, 0.08);
}

.validation-light.ready {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(103, 217, 150, 0.08), 0 0 9px rgba(103, 217, 150, 0.3);
}

#lutStripPreview {
  display: block;
  width: 100%;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(45deg, #171b23 25%, transparent 25%),
    linear-gradient(-45deg, #171b23 25%, transparent 25%),
    #10131a;
  image-rendering: auto;
}

.validation-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 9px 0;
}

.validation-stats > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.validation-stats small {
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.validation-stats b {
  overflow: hidden;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.validation-view-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.validation-view-button {
  width: 100%;
  min-height: 35px;
  padding-inline: 7px;
  color: var(--accent);
  border-color: rgba(184, 255, 71, 0.16);
  background: rgba(184, 255, 71, 0.045);
  font-size: 9px;
}

.validation-view-button:hover:not(:disabled) {
  border-color: rgba(184, 255, 71, 0.35);
  background: rgba(184, 255, 71, 0.075);
}

.validation-view-button svg {
  width: 14px;
  height: 14px;
}

.validation-view-button.scene {
  color: var(--cyan);
  border-color: rgba(85, 221, 223, 0.16);
  background: rgba(85, 221, 223, 0.045);
}

.validation-view-button.scene:hover:not(:disabled) {
  border-color: rgba(85, 221, 223, 0.35);
  background: rgba(85, 221, 223, 0.075);
}

.chart-export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.chart-export-actions .button {
  min-height: 31px;
  padding-inline: 7px;
  border: 1px solid var(--line);
  font-size: 8px;
}

.lut-validation > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.55;
}

.local-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  color: rgba(143, 150, 167, 0.68);
  font-size: 9px;
}

.local-note svg {
  width: 13px;
  height: 13px;
}

.guide-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #131720;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.66);
}

.guide-dialog::backdrop {
  background: rgba(3, 4, 7, 0.72);
  backdrop-filter: blur(8px);
}

.guide-dialog form {
  padding: 24px;
}

.guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.guide-header h2 {
  font-size: 20px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.guide-steps {
  display: grid;
  gap: 17px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.guide-steps li > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(184, 255, 71, 0.25);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(184, 255, 71, 0.06);
  font-size: 10px;
  font-weight: 700;
}

.guide-steps b {
  font-size: 12px;
  font-weight: 600;
}

.guide-steps p,
.guide-limit p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.guide-limit {
  padding: 13px 14px;
  border: 1px solid rgba(255, 189, 99, 0.13);
  border-radius: 11px;
  background: rgba(255, 189, 99, 0.045);
}

.guide-limit strong {
  color: var(--amber);
  font-size: 11px;
}

.guide-close {
  width: 100%;
  margin-top: 18px;
}

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  width: min(340px, calc(100vw - 32px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--muted-light);
  background: rgba(22, 26, 35, 0.95);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  font-size: 10px;
  animation: toast-in 220ms ease both;
}

.toast.success::before,
.toast.warning::before {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: #11150b;
  background: var(--green);
  content: "✓";
  font-size: 10px;
  font-weight: 800;
}

.toast.warning::before {
  color: #1a1308;
  background: var(--amber);
  content: "!";
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Readability refresh: image-first spacing inspired by Lightroom,
   restrained hierarchy inspired by Linear/Vercel, progressive controls like Figma. */
.app-shell {
  width: min(1760px, 100%);
  padding-inline: 38px;
  padding-bottom: 56px;
}

.topbar {
  min-height: 88px;
}

.topbar-center,
.button.compact {
  font-size: 14px;
}

.app-main {
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 30px;
  padding-top: 26px;
}

.panel-heading {
  padding: 24px 26px 21px;
}

.eyebrow {
  margin-bottom: 9px;
  font-size: 11px;
}

.panel-heading h1 {
  font-size: clamp(24px, 1.8vw, 29px);
}

.panel-heading p {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.5;
}

.view-switcher button {
  min-width: 50px;
  height: 34px;
  padding-inline: 11px;
  font-size: 13px;
}

.canvas-label {
  padding: 7px 10px;
  font-size: 12px;
}

.preview-footer {
  min-height: 68px;
  padding: 14px 22px;
}

.image-meta {
  font-size: 12px;
}

.strength-control {
  font-size: 12px;
}

.metric-card {
  min-height: 104px;
  gap: 14px;
  padding: 18px;
}

.metric-icon {
  width: 42px;
  height: 42px;
}

.metric-card span {
  font-size: 12px;
}

.metric-card strong {
  margin-block: 4px;
  font-size: clamp(21px, 1.7vw, 26px);
}

.metric-card small {
  font-size: 11px;
}

.diagnostics-panel {
  min-height: 94px;
  padding: 19px 22px;
}

.diagnostics-title h2 {
  font-size: 15px;
}

.diagnostics-title p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.capability-tags span {
  padding: 6px 9px;
  font-size: 11px;
}

.workflow-section {
  padding: 24px 24px 26px;
}

.fit-mode-switcher {
  gap: 5px;
  margin-bottom: 23px;
  padding: 5px;
}

.fit-mode-switcher button {
  min-height: 50px;
}

.fit-mode-switcher b {
  font-size: 12px;
}

.fit-mode-switcher small {
  font-size: 10px;
}

.section-title {
  gap: 13px;
  margin-bottom: 20px;
}

.step-index {
  width: 35px;
  height: 35px;
  font-size: 10px;
}

.section-title h2 {
  font-size: 17px;
}

.section-title p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
}

.section-divider {
  margin-inline: 24px;
}

.upload-grid {
  gap: 11px;
}

.upload-card {
  height: 132px;
}

.upload-grid.single-reference .upload-card {
  height: 184px;
}

.upload-badge,
.replace-action {
  font-size: 10px;
}

.file-name {
  font-size: 11px;
}

.pair-alert {
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
}

.reference-options {
  margin-top: 13px;
  padding: 12px;
}

.reference-options > label,
.reference-options select {
  font-size: 11px;
}

.reference-options select {
  height: 32px;
}

.local-analysis-note {
  font-size: 10px;
}

.reference-collection {
  padding: 13px;
}

.reference-collection-heading span {
  font-size: 12px;
}

.reference-collection-heading small,
.reference-collection > p {
  font-size: 10px;
}

.reference-thumb,
.add-reference-card {
  height: 82px;
}

.add-reference-card {
  font-size: 10px;
}

.reference-thumb > span {
  font-size: 9px;
}

.form-stack {
  gap: 14px;
}

.field-label {
  font-size: 12px;
}

.select-wrap select,
.text-field-wrap input {
  height: 46px;
  font-size: 13px;
}

.slider-field {
  gap: 9px;
  margin-top: 6px;
}

.slider-field > span {
  font-size: 12px;
}

.slider-field output {
  min-width: 34px;
  font-size: 11px;
}

.slider-field small {
  font-size: 10px;
  line-height: 1.45;
}

.advanced-style-controls summary {
  padding: 12px;
  font-size: 11px;
}

.semantic-protections label {
  font-size: 11px;
}

.fit-button {
  height: 56px;
  margin-top: 20px;
  font-size: 14px;
}

.candidate-panel {
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
}

.candidate-heading > span {
  font-size: 12px;
}

.candidate-heading small,
.candidate-switcher button {
  font-size: 10px;
}

.candidate-switcher button {
  height: 33px;
}

.export-button b,
.engine-note,
.validation-heading b {
  font-size: 11px;
}

.export-button small,
.validation-heading > span:last-child,
.validation-stats b {
  font-size: 10px;
}

.validation-stats small,
.lut-validation > p,
.chart-export-actions .button {
  font-size: 9px;
}

.local-note {
  font-size: 11px;
}

.scene-toolbar label > span,
.scene-exposure b {
  font-size: 9px;
}

.scene-toolbar select {
  font-size: 11px;
}

.scene-status b {
  font-size: 10px;
}

.scene-status small {
  font-size: 9px;
}

.validation-view-button {
  font-size: 10px;
}

.guide-steps b {
  font-size: 13px;
}

.guide-steps p,
.guide-limit p {
  font-size: 11px;
}

.toast {
  font-size: 11px;
}

@media (max-width: 1220px) {
  .app-shell {
    padding-inline: 20px;
  }

  .app-main {
    grid-template-columns: minmax(0, 1fr) 390px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capability-tags {
    display: none;
  }
}

@media (max-width: 1160px) {
  .app-shell {
    padding-inline: 14px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-center {
    display: none;
  }

  .app-main {
    grid-template-columns: 1fr;
  }

  .control-column {
    position: static;
    grid-row: auto;
  }

  .workflow-panel {
    max-height: none;
  }

  .workflow-panel {
    display: block;
  }

  .workflow-section {
    padding: 20px;
  }

  .section-divider {
    width: auto;
    height: 1px;
    margin: 0 20px;
  }

  .export-section {
    padding-bottom: 20px;
  }

  .local-note {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar-actions .ghost {
    display: none;
  }

  .workflow-panel {
    display: block;
  }

  .section-divider {
    width: auto;
    height: 1px;
    margin: 0 20px;
  }

  .preview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-switcher {
    width: 100%;
    overflow-x: auto;
  }

  .view-switcher button {
    flex: 1;
  }

  .canvas-shell {
    margin-inline: 8px;
  }

  .scene-toolbar {
    top: 8px;
    right: 8px;
    left: 8px;
    gap: 5px;
    padding: 6px;
  }

  .scene-toolbar select {
    width: 105px;
  }

  .scene-toolbar .scene-exposure {
    width: 92px;
  }

  .scene-status {
    right: 8px;
    bottom: 8px;
    left: 8px;
    justify-content: center;
  }

  .preview-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .strength-control {
    width: 100%;
    min-width: 0;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .diagnostics-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .reference-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .app-shell {
    padding-inline: 8px;
  }

  .topbar {
    min-height: 70px;
  }

  .brand-copy small {
    display: none;
  }

  .topbar-actions .button {
    padding-inline: 10px;
  }

  .topbar-actions .button svg {
    display: none;
  }

  .panel {
    border-radius: 16px;
  }

  .panel-heading {
    padding: 18px 16px 14px;
  }

  .view-switcher button {
    min-width: 49px;
    padding-inline: 6px;
  }

  .scene-toolbar label:nth-child(2) {
    display: none;
  }

  .scene-status small {
    display: none;
  }

  .canvas-label {
    top: 8px;
  }

  .canvas-label.left {
    left: 8px;
  }

  .canvas-label.right {
    right: 8px;
  }

  .image-meta span:last-child {
    display: none;
  }

  .metrics-grid {
    gap: 7px;
  }

  .metric-card {
    min-height: 92px;
    padding: 12px;
  }

  .metric-icon {
    width: 32px;
    height: 32px;
  }

  .metric-icon svg {
    width: 16px;
    height: 16px;
  }

  .upload-card {
    height: 104px;
  }

  .workflow-section {
    padding-inline: 16px;
  }

  .section-divider {
    margin-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
