:root {
  color-scheme: dark;
  --bg: #06080f;
  --bg-2: #0b1220;
  --surface: #0d1929;
  --panel: rgba(10, 18, 30, 0.64);
  --panel-solid: #0d1929;
  --panel-soft: rgba(13, 25, 41, 0.86);
  --ink: #06070a;
  --text: #e8f0fc;
  --muted: #8ea6c6;
  --dim: #5a7a9a;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --accent: #ff7338;
  --accent-strong: #ff6421;
  --accent-soft: rgba(255, 115, 56, 0.14);
  --teal: #38d9d9;
  --teal-soft: rgba(56, 217, 217, 0.1);
  --pink: #ff2d78;
  --gold: #ffca28;
  --warn: #ffca28;
  --error: #ff5a66;
  --ok: #39d98a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Syne, Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 14% -8%, rgba(255, 115, 56, 0.2) 0%, rgba(255, 115, 56, 0.08) 28%, transparent 62%),
    radial-gradient(ellipse 80% 62% at 86% -10%, rgba(255, 45, 120, 0.16) 0%, rgba(255, 45, 120, 0.06) 30%, transparent 66%),
    radial-gradient(ellipse 68% 54% at 52% 18%, rgba(56, 217, 217, 0.08) 0%, transparent 64%),
    linear-gradient(180deg, #06080f 0%, #08101e 46%, #06080f 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

body::after {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 58%);
}

.title-card {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #000;
  animation: titleCardOut 700ms cubic-bezier(0.4, 0, 0.2, 1) 1500ms forwards;
}

.title-card-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 800;
  opacity: 0;
  animation: titleReveal 650ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards;
}

.title-card-logo i {
  width: 4px;
  height: 42px;
  border-radius: 999px;
  background: var(--accent);
}

.title-card-logo span:last-child {
  color: var(--accent);
}

.title-card-rule {
  width: 0;
  height: 1px;
  margin-top: 16px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  animation: ruleExpand 520ms cubic-bezier(0.16, 1, 0.3, 1) 560ms forwards;
}

.title-card p {
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  opacity: 0;
  text-transform: uppercase;
  animation: titleReveal 520ms cubic-bezier(0.16, 1, 0.3, 1) 860ms forwards;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ruleExpand {
  from {
    width: 0;
  }
  to {
    width: 76px;
  }
}

@keyframes titleCardOut {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 0 22px 22px;
}

.orb {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(86px);
}

.orb-1 {
  top: -150px;
  left: -120px;
  width: 700px;
  height: 440px;
  background: radial-gradient(ellipse, rgba(255, 115, 56, 0.2) 0%, transparent 65%);
}

.orb-2 {
  top: -90px;
  right: -100px;
  width: 560px;
  height: 560px;
  background: radial-gradient(ellipse, rgba(255, 45, 120, 0.15) 0%, transparent 65%);
}

.orb-3 {
  bottom: 12%;
  left: 30%;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(56, 217, 217, 0.1) 0%, transparent 65%);
}

.topbar,
.workspace,
.hero-actions,
.panel-head,
.actions,
.control,
.toggle-control,
.service-state,
.meta-pills,
.view-toggle,
.site-brand,
.tool-identity {
  display: flex;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  margin: 0 -22px 22px;
  padding: 0 40px;
  border: 1px solid var(--line);
  border-width: 0 0 1px;
  border-radius: 0;
  background: rgba(6, 8, 15, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.site-brand {
  align-items: center;
  gap: 12px;
  flex: 1 1 260px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-brand em {
  color: var(--accent);
  font-style: normal;
}

.dvp-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 58px;
  height: 30px;
  color: var(--text);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.dvp-mini i {
  width: 2px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
}

.dvp-mini strong:last-child {
  color: var(--accent);
}

.tool-identity {
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 1 260px;
  min-width: 190px;
}

.tool-icon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid rgba(56, 217, 217, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(56, 217, 217, 0.14), rgba(91, 141, 238, 0.08));
}

.tool-icon span {
  border-radius: 999px;
}

.tool-icon span:nth-child(1) {
  background: var(--teal);
}

.tool-icon span:nth-child(2) {
  background: var(--accent);
}

.tool-icon span:nth-child(3) {
  background: var(--pink);
}

.nav-title {
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-title span {
  color: var(--teal);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(54px, 8vw, 104px);
  line-height: 0.9;
  font-weight: 800;
  color: var(--text);
}

h1 span {
  color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
}

h2 {
  font-size: 18px;
  font-weight: 800;
}

h3 {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.service-state {
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 220px;
  width: fit-content;
  max-width: 230px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 115, 56, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 115, 56, 0.12), rgba(255, 45, 120, 0.07));
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 18px rgba(255, 202, 40, 0.38);
}

.service-state.is-ok .state-dot {
  background: var(--ok);
  box-shadow: 0 0 18px rgba(57, 217, 138, 0.38);
}

.service-state.is-error .state-dot {
  background: var(--error);
  box-shadow: 0 0 18px rgba(255, 90, 102, 0.34);
}

.workspace {
  align-items: stretch;
  gap: 18px;
}

.tool-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 22px;
  padding: 34px 0 28px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.tool-hero p:last-child {
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  text-shadow: 0 0 20px rgba(255, 115, 56, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 34px;
  margin-top: 18px;
  padding: 0 13px;
  border: 1px solid rgba(255, 115, 56, 0.32);
  border-radius: var(--radius);
  background: rgba(255, 115, 56, 0.08);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hero-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions .tool-back {
  margin-top: 0;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid rgba(255, 115, 56, 0.72);
  border-radius: var(--radius);
  background: var(--accent);
  color: #070a10;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 160ms ease, transform 160ms ease;
}

.hero-secondary {
  min-height: 34px;
  padding: 0 15px;
  border: 1px solid rgba(56, 217, 217, 0.34);
  border-radius: var(--radius);
  background: rgba(56, 217, 217, 0.08);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-cta:hover,
.hero-secondary:hover {
  background: var(--accent-strong);
  color: #070a10;
  transform: translateY(-1px);
}

.tool-back::before {
  content: "<";
  color: var(--text);
}

.tool-back:hover {
  border-color: rgba(255, 115, 56, 0.72);
  background: rgba(255, 115, 56, 0.14);
  color: #fff;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.trust-strip div {
  min-height: 90px;
  padding: 18px;
  background: rgba(6, 13, 24, 0.58);
}

.trust-strip strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
}

.trust-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tool-section,
.story-grid,
.feature-section {
  margin-top: 22px;
}

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

.section-head h2 {
  max-width: 720px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.step-grid,
.feature-grid {
  display: grid;
  gap: 14px;
}

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

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

.step-card,
.feature-card {
  position: relative;
  min-height: 170px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 18, 30, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.step-card::before,
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 22% 18%, rgba(255, 115, 56, 0.12), transparent 48%);
  pointer-events: none;
}

.step-card span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 115, 56, 0.26);
  border-radius: 3px;
  background: rgba(255, 115, 56, 0.08);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.step-card h3,
.feature-card h3,
.step-card p,
.feature-card p {
  position: relative;
}

.step-card h3,
.feature-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.step-card p,
.feature-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  width: min(1500px, 100%);
  margin: 28px auto 0;
  padding: 24px 22px 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.input-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow);
  backdrop-filter: blur(18px);
}

.input-panel {
  width: 440px;
  flex: 0 0 440px;
  padding: 18px;
}

.result-panel {
  flex: 1;
  min-width: 0;
  padding: 18px;
}

.panel-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head > div {
  min-width: 0;
}

.panel-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 115, 56, 0.24);
  border-radius: 3px;
  background: rgba(255, 115, 56, 0.08);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.drop-grid {
  display: grid;
  gap: 12px;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 188px;
  padding: 14px;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(3, 5, 8, 0.58);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-hovering {
  border-color: rgba(255, 115, 56, 0.82);
  background: rgba(255, 115, 56, 0.08);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone.is-ready {
  border-style: solid;
  border-color: rgba(255, 115, 56, 0.68);
}

.drop-label,
.drop-name {
  position: relative;
  z-index: 1;
}

.drop-label {
  align-self: start;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 6px;
  background: #000;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.drop-name {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.thumb {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drop-zone.is-ready .thumb {
  display: block;
}

.drop-zone.is-ready::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.54), rgba(0, 0, 0, 0.08) 42%, rgba(0, 0, 0, 0.7));
}

.drop-zone.is-ready .drop-name {
  color: #fff;
}

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

.control,
.toggle-control,
.segmented-control,
.preset-control,
.crop-editor,
.analysis-panel,
.split-control {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(3, 5, 8, 0.44);
}

.control,
.toggle-control,
.segmented-control {
  min-height: 58px;
  padding: 10px 12px;
}

.control,
.toggle-control {
  align-items: center;
  gap: 10px;
}

.control {
  flex-wrap: wrap;
  justify-content: space-between;
}

.control span,
.toggle-control span,
.segmented-control legend,
.preset-control legend,
.split-control span,
.metric-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.control output,
.toggle-control strong {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.control input[type="range"],
.split-control input {
  width: 100%;
  accent-color: var(--accent);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.segmented-control legend {
  grid-column: 1 / -1;
  margin-bottom: 6px;
}

.segmented-control label {
  position: relative;
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.segmented-control small {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.segmented-control input:checked + span {
  border-color: rgba(255, 115, 56, 0.78);
  background: var(--accent-soft);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 115, 56, 0.14);
}

.toggle-control {
  justify-content: flex-start;
}

.toggle-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.toggle-control strong {
  margin-left: auto;
  color: var(--accent);
}

.primary-button,
.ghost-button,
.view-toggle button,
.preset-control button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 16px;
  border-color: rgba(255, 115, 56, 0.75);
  background: var(--accent);
  color: #08090c;
  box-shadow: 0 12px 26px rgba(255, 115, 56, 0.18);
}

.sample-button {
  width: 100%;
  margin-top: 10px;
  border-color: rgba(56, 217, 217, 0.28);
  color: var(--teal);
}

.primary-button:not(:disabled):hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

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

.ghost-button:hover,
.preset-control button:hover,
.view-toggle button:hover {
  border-color: rgba(255, 115, 56, 0.7);
  color: #fff;
}

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

.status-line {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.status-line[data-kind="error"] {
  color: var(--error);
}

.view-toggle {
  width: fit-content;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(3, 5, 8, 0.54);
}

.view-toggle button {
  min-height: 32px;
  background: transparent;
  color: var(--muted);
}

.view-toggle button.is-active {
  background: var(--accent);
  color: #08090c;
}

.preview-stage {
  --split: 50%;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  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%),
    #05070b;
  background-position: 0 0, 12px 12px, 0 0;
  background-size: 24px 24px, 24px 24px, auto;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.preview-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 380px;
  padding: 22px;
  text-align: center;
}

.preview-empty span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.preview-empty strong {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-transform: none;
}

.preview-empty .ghost-button {
  margin-top: 5px;
  color: var(--teal);
}

.preview-stage img,
.preview-stage .preview-original,
.preview-stage .preview-matched {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-stage.has-image span {
  display: none;
}

.preview-stage.has-image .preview-empty {
  display: none;
}

.preview-stage.has-image .preview-original,
.preview-stage.has-image .preview-matched {
  display: none;
}

.preview-stage.has-image[data-mode="original"] .preview-original,
.preview-stage.has-image[data-mode="matched"] .preview-matched,
.preview-stage.has-image[data-mode="split"] .preview-original,
.preview-stage.has-image[data-mode="split"] .preview-matched {
  display: block;
}

.preview-stage.has-image[data-mode="split"] .preview-matched {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.split-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  transform: translateX(-1px);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 24px rgba(255, 115, 56, 0.45);
  pointer-events: none;
}

.split-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
}

.split-control input {
  flex: 1;
}

.processing-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(56, 217, 217, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(56, 217, 217, 0.08), rgba(255, 115, 56, 0.06));
}

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

.processing-head span,
.processing-panel li {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.processing-head strong {
  color: var(--text);
  font-size: 13px;
}

.processing-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.processing-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--accent), var(--pink));
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.processing-panel ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.processing-panel li {
  position: relative;
  padding-left: 14px;
  color: var(--dim);
  font-size: 10px;
}

.processing-panel li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.processing-panel li.is-active {
  color: var(--teal);
}

.processing-panel li.is-complete {
  color: var(--ok);
}

.actions {
  gap: 10px;
  margin-top: 14px;
}

.actions .primary-button {
  margin-top: 0;
}

.actions .ghost-button {
  flex: 0 0 145px;
}

.meta-pills {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.pill {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

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

.message {
  position: relative;
  padding: 10px 12px;
  padding-left: 36px;
  border: 1px solid rgba(255, 202, 40, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 202, 40, 0.1);
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
}

.message::before {
  content: "!";
  position: absolute;
  top: 10px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 202, 40, 0.18);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 11px;
}

.message.error {
  border-color: rgba(255, 90, 102, 0.24);
  background: rgba(255, 90, 102, 0.1);
  color: var(--error);
}

.message.error::before {
  background: rgba(255, 90, 102, 0.16);
  color: var(--error);
}

.details-panel {
  margin-top: 14px;
}

.details-panel summary {
  width: fit-content;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-transform: uppercase;
}

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

pre {
  margin: 8px 0 0;
  min-height: 82px;
  max-height: 220px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.42);
  color: #d6dde8;
  font-family: var(--mono);
  font-size: 12px;
}

.analysis-panel {
  margin-top: 14px;
  padding: 12px;
}

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

.analysis-head strong {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.analysis-head strong[data-verdict="color-match"] {
  border-color: rgba(57, 217, 138, 0.24);
  background: rgba(57, 217, 138, 0.1);
  color: var(--ok);
}

.analysis-head strong[data-verdict="minor-shift"] {
  border-color: rgba(255, 202, 40, 0.24);
  background: rgba(255, 202, 40, 0.1);
  color: var(--warn);
}

.analysis-head strong[data-verdict="significant-drift"] {
  border-color: rgba(255, 90, 102, 0.24);
  background: rgba(255, 90, 102, 0.1);
  color: var(--error);
}

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

.metric-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.metric-card span {
  display: block;
  margin-bottom: 6px;
}

.metric-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.crop-editor {
  margin-top: 12px;
  padding: 12px;
}

.crop-head,
.crop-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crop-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.crop-actions .ghost-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.crop-actions .ghost-button.is-active {
  border-color: rgba(255, 115, 56, 0.72);
  background: var(--accent-soft);
  color: #fff;
}

.crop-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #05070b;
  touch-action: none;
}

.crop-stage img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  background: rgba(255, 115, 56, 0.16);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48), 0 0 18px rgba(255, 115, 56, 0.32);
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  cursor: nwse-resize;
}

.crop-readout {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.preset-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  min-height: 58px;
  padding: 10px 12px;
}

.preset-control legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.preset-control button {
  min-height: 36px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .analysis-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .workspace {
    display: grid;
  }

  .tool-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-top: 24px;
  }

  .input-panel {
    width: 100%;
    flex-basis: auto;
  }

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

  .trust-strip,
  .step-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .topbar {
    align-items: center;
    flex-direction: column;
    gap: 10px;
    margin: 0 -22px 18px;
    padding: 14px 22px;
  }

  .site-brand {
    flex: 0 1 auto;
    justify-content: center;
    width: 100%;
  }

  .tool-identity {
    flex: 0 1 auto;
    min-width: 0;
  }

  .service-state {
    flex: 0 1 auto;
    max-width: 100%;
    margin-left: 0;
  }
}

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

  .actions,
  .crop-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    margin: 0 -12px 16px;
    padding: 12px;
  }

  .site-brand {
    font-size: 12px;
  }

  .dvp-mini {
    min-width: 50px;
    font-size: 14px;
  }

  .tool-hero {
    padding: 16px 0 20px;
  }

  .title-card p {
    padding: 0 18px;
    text-align: center;
  }

  .trust-strip div,
  .step-card,
  .feature-card {
    min-height: auto;
    padding: 16px;
  }

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

  .processing-panel ol {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }

  .service-state {
    width: fit-content;
  }

  .segmented-control,
  .stats-grid,
  .preset-control {
    grid-template-columns: 1fr;
  }

  .actions .ghost-button,
  .crop-actions .ghost-button {
    flex-basis: auto;
  }

  .analysis-head {
    align-items: flex-start;
    flex-direction: column;
  }

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