:root {
  --app-shell-max: 1760px;
  --cutclean-layout-max: 1700px;
  --cutclean-layout-gap: clamp(24px, 2.2vw, 36px);
  --cutclean-input-column-min: 460px;
  --cutclean-input-column-max: 640px;
  --cutclean-sidebar-width: clamp(460px, 38vw, 640px);
  --cutclean-sticky-top: clamp(16px, 2vw, 24px);
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d9e0eb;
  --line-strong: #c4cedd;
  --text: #1e2530;
  --muted: #697587;
  --brand: #2563eb;
  --brand-soft: #dbeafe;
  --success: #0f766e;
  --danger: #b91c1c;
  --warning: #b45309;
  --checker-a: #edf1f7;
  --checker-b: #dbe3ee;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, Apple SD Gothic Neo, Inter, system-ui, sans-serif;
}

body {
  padding: 0 0 clamp(24px, 4vw, 32px);
}

.layout-shell--app {
  --layout-shell-max: var(--cutclean-layout-max);
  --content-rail-boundary: clamp(0.9rem, 1.6vw, 1.35rem);
  --content-rail-boundary-desktop: clamp(1.25rem, 2.4vw, 2.75rem);
}

button,
input,
select,
summary {
  font: inherit;
}

.hero {
  max-width: var(--cutclean-layout-max);
  margin: 0 auto 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.hero h1 {
  margin: 14px 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.16;
}

.hero p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}


.app-shell-status {
  margin-top: 16px;
  width: 100%;
  justify-self: stretch;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.shell-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shell-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shell-pill.is-online,
.shell-pill.is-ready {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: var(--success);
}

.shell-pill.is-offline,
.shell-pill.is-updating {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.shell-pill.is-pending,
.shell-pill.is-neutral {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.shell-pill.is-warning {
  border-color: #fdba74;
  background: #fff7ed;
  color: #92400e;
}

.shell-pill.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: var(--danger);
}

.shell-status-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.shell-status-detail button {
  flex: 0 0 auto;
  padding: 10px 12px;
}

.workspace {
  max-width: var(--cutclean-layout-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns:
    minmax(var(--cutclean-input-column-min), var(--cutclean-sidebar-width))
    minmax(0, 1fr);
  gap: var(--cutclean-layout-gap);
  align-items: start;
}

.core-flow-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  cursor: pointer;
  list-style: none;
}

.core-flow-summary::-webkit-details-marker {
  display: none;
}

.core-flow-summary h2 {
  margin: 0;
  font-size: 15px;
}

.core-flow-chevron {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.core-flow-inline {
  padding-top: 0;
}

.core-flow-inline[open] .core-flow-chevron {
  transform: rotate(225deg);
}

.core-flow-inline > p {
  margin: 0;
  padding-top: 10px;
  color: var(--muted);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.core-flow-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.workspace-sidebar {
  display: grid;
  gap: 18px;
  align-self: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.input-panel,
.run-panel,
.preview-panel {
  min-width: 0;
}

.run-panel {
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.14), rgba(219, 234, 254, 0.04)),
    var(--panel);
}

.preview-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 18px;
  min-height: 0;
  position: sticky;
  top: var(--cutclean-sticky-top);
  max-height: calc(100vh - (var(--cutclean-sticky-top) * 2));
  overflow: hidden;
}

.preview-head {
  margin-bottom: 0;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.subhead {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.dropzone {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 180px;
  padding: 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.2), rgba(219, 234, 254, 0.04)),
    var(--panel);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--brand);
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.36), rgba(219, 234, 254, 0.12)),
    var(--panel);
  transform: translateY(-1px);
}

.dropzone input {
  display: none;
}

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

.dropzone-copy strong {
  font-size: 17px;
}

.dropzone-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.controls {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.control-card {
  display: grid;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.96)),
    #fff;
}

.core-settings-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 600;
}


.checkbox-field {
  gap: 8px;
}

.checkbox-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.checkbox-wrap input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.checkbox-wrap small {
  color: var(--muted);
  line-height: 1.45;
}

.field select,
.field input[type='text'],
.field input[type='number'] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.range-field {
  gap: 6px;
}

.range-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
}

.range-wrap input[type='range'] {
  width: 100%;
}

.range-wrap output {
  min-width: 44px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.advanced {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.details-stack {
  display: grid;
  gap: 12px;
}

.advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.advanced[open] summary {
  margin-bottom: 12px;
}

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

.compact-field {
  gap: 6px;
}

.compact-field span {
  font-size: 13px;
}

.picker-tool {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.78), rgba(255, 255, 255, 0.96)),
    #fbfdff;
}

.picker-head {
  display: grid;
  gap: 14px;
}

.picker-head h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.picker-head .compact-field {
  width: min(100%, 260px);
  min-width: 0;
}

.picker-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.picker-stage-wrap {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.picker-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.18), rgba(219, 234, 254, 0.02)),
    #fff;
  overflow: hidden;
}

.picker-stage.has-image {
  border-style: solid;
}

.picker-stage img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: crosshair;
  user-select: none;
}

.picker-stage [hidden] {
  display: none !important;
}

.picker-empty {
  display: grid;
  gap: 12px;
  place-items: center;
  min-height: 240px;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 26px 24px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(219, 234, 254, 0.36), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.picker-empty strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.picker-empty p {
  margin: 0;
  max-width: 30ch;
}

.picker-empty-tip {
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--muted) 90%, #fff 10%);
}

.picker-empty-art {
  position: relative;
  width: 148px;
  height: 112px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(219, 234, 254, 0.55));
  box-shadow:
    0 12px 24px rgba(148, 163, 184, 0.16),
    inset 0 0 0 1px rgba(147, 197, 253, 0.3);
}

.picker-empty-frame,
.picker-empty-sun,
.picker-empty-hill,
.picker-empty-target {
  position: absolute;
  display: block;
}

.picker-empty-frame {
  inset: 14px 16px 18px;
  border: 1.5px solid rgba(96, 165, 250, 0.5);
  border-radius: 14px;
}

.picker-empty-sun {
  top: 26px;
  right: 28px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.9);
  box-shadow: 0 0 0 6px rgba(254, 240, 138, 0.32);
}

.picker-empty-hill {
  left: 28px;
  right: 28px;
  bottom: 28px;
  height: 34px;
  border-radius: 20px 20px 14px 14px;
  background:
    linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(59, 130, 246, 0.06)),
    linear-gradient(180deg, rgba(148, 163, 184, 0.26), rgba(148, 163, 184, 0.06));
}

.picker-empty-target {
  left: 34px;
  bottom: 38px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(37, 99, 235, 0.72);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.92),
    0 0 0 4px rgba(191, 219, 254, 0.72);
}

.picker-empty-target::before,
.picker-empty-target::after {
  content: '';
  position: absolute;
  background: rgba(37, 99, 235, 0.72);
}

.picker-empty-target::before {
  top: 50%;
  left: 4px;
  right: 4px;
  height: 1.5px;
  transform: translateY(-50%);
}

.picker-empty-target::after {
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 1.5px;
  transform: translateX(-50%);
}

.picker-marker {
  position: absolute;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 1.5px rgba(37, 99, 235, 0.95),
    0 6px 12px rgba(15, 23, 42, 0.18);
  background: transparent;
  pointer-events: none;
}

.picker-marker::before,
.picker-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(37, 99, 235, 0.92);
  transform: translate(-50%, -50%);
}

.picker-marker::before {
  width: 2px;
  height: 26px;
}

.picker-marker::after {
  width: 26px;
  height: 2px;
}

.picker-stage-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.picker-stage-actions .field {
  min-width: 0;
}

.picker-stage-actions button {
  width: 100%;
}

.picker-status-card {
  display: grid;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  align-content: start;
}

.picker-swatch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.picker-swatch {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(148, 163, 184, 0.2)),
    #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.picker-swatch-copy {
  display: grid;
  gap: 4px;
}

.picker-swatch-copy strong {
  font-size: 16px;
}

.picker-swatch-copy span {
  color: var(--muted);
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.picker-mode-status {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.picker-mode-status.is-active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.picker-mode-status.is-warning {
  border-color: #fdba74;
  background: #fff7ed;
  color: #92400e;
}

.picker-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.picker-hint strong {
  color: var(--text);
}

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

.actions .primary {
  grid-column: 1 / -1;
}

.actions button {
  width: 100%;
}

button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #9fb0c8;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

button.primary:hover:not(:disabled),
button.primary:focus-visible:not(:disabled),
button.primary:active:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.queue-status {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.queue-copy {
  display: grid;
  gap: 4px;
}

.queue-copy strong {
  font-size: 14px;
}

.queue-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

progress {
  width: 100%;
  height: 12px;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: #eaf0f7;
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 999px;
}

.notice-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.notice span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.notice.is-warning {
  border-color: #fdba74;
  background: #fff7ed;
}

.notice.is-info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.notice .dismiss-btn {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.bg-toggle {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.bg-btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 999px;
}

.bg-btn.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: #bfdbfe;
}

.hint-box {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.96)),
    #f8fafc;
  border: 1px solid var(--line);
  padding: 14px 16px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.issue-overview {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fcfdff;
}

.issue-overview.is-hidden {
  display: none;
}

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

.overview-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.overview-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-card strong {
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1;
}

.overview-card small {
  color: var(--muted);
  line-height: 1.5;
}

.overview-card.is-warning {
  border-color: #fdba74;
  background: #fff7ed;
}

.overview-card.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-reasons {
  display: grid;
  gap: 8px;
}

.overview-reasons strong {
  font-size: 14px;
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reason-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
}

.reason-chip strong {
  color: var(--text);
  font-size: 12px;
}

.results-grid {
  display: grid;
  gap: 14px;
}

.preview-scroll-region {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  overflow-y: auto;
  padding-right: 6px;
  margin-right: -6px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.results-grid.empty-state {
  min-height: 560px;
  place-items: stretch;
}

.empty-card {
  display: grid;
  gap: 6px;
  min-height: 320px;
  place-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.72), rgba(255, 255, 255, 0.96)),
    #fff;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.result-card.is-processing {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.result-card.is-warning {
  border-color: #fdba74;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.result-card.is-low-confidence {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.result-card.is-error {
  border-color: #fca5a5;
}

.result-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 14px 14px 0;
}

.result-title {
  display: grid;
  gap: 4px;
}

.result-title strong {
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: anywhere;
}

.result-title span {
  color: var(--muted);
  font-size: 13px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.status-chip.is-done {
  background: #ecfdf5;
  color: var(--success);
}

.status-chip.is-warning {
  background: #fff7ed;
  color: var(--warning);
}

.status-chip.is-error {
  background: #fef2f2;
  color: var(--danger);
}

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

.preview-box {
  display: grid;
  gap: 8px;
}

.preview-box > span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.thumb {
  position: relative;
  min-height: 180px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.thumb.original {
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.thumb.output {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

body[data-preview-bg='white'] .thumb.output {
  background: #ffffff;
}

body[data-preview-bg='black'] .thumb.output {
  background: #0f172a;
}

body[data-preview-bg='checker'] .thumb.output {
  background-color: #fff;
}

.thumb img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.preview-placeholder {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.issue-box {
  display: grid;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fcfdff;
}

.issue-box.is-warning {
  border-color: #fdba74;
  background: #fff7ed;
}

.issue-box.is-low {
  border-color: #f59e0b;
  background: #fffbeb;
}

.issue-box.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.issue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.issue-head strong {
  font-size: 14px;
}

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

.issue-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.issue-list li {
  color: var(--muted);
  line-height: 1.5;
}

.issue-list strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.issue-list em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  color: #92400e;
}

.issue-box.is-error .issue-list em {
  color: #b91c1c;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 14px 14px;
}

.result-actions .download-btn {
  color: var(--brand);
}

.footer {
  max-width: min(1520px, var(--cutclean-layout-max));
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 640px) {
  .shell-status-detail {
    flex-direction: column;
    align-items: flex-start;
  }

  .shell-status-detail button {
    width: 100%;
  }
}

@media (max-width: 1380px) {
  :root {
    --cutclean-layout-max: 1540px;
    --cutclean-input-column-min: 420px;
    --cutclean-input-column-max: 560px;
    --cutclean-sidebar-width: clamp(420px, 40vw, 560px);
  }
}

@media (max-width: 1240px) {
  :root {
    --cutclean-layout-max: 1400px;
    --cutclean-input-column-min: 400px;
    --cutclean-input-column-max: 500px;
    --cutclean-sidebar-width: clamp(400px, 42vw, 500px);
  }
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    gap: 16px;
  }

  .preview-panel {
    order: -1;
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .preview-scroll-region {
    overflow: visible;
    padding-right: 0;
    margin-right: 0;
  }
}

@media (max-width: 960px) {
  .panel {
    padding: 18px;
  }

  .core-settings-card,
  .actions,
  .picker-stage-actions {
    grid-template-columns: 1fr;
  }

  .input-panel {
    order: 1;
  }

  .preview-panel {
    order: 2;
  }
}

@media (max-width: 640px) {
  .preview-pair,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .result-top,
  .issue-head,
  .notice {
    grid-template-columns: 1fr;
  }

  .result-top {
    display: grid;
  }
}

.preset-tools {
  margin-top: 0;
}

.preset-manager {
  display: grid;
  gap: 12px;
}

.storage-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.storage-copy strong {
  color: var(--text);
}

.preset-save-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.preset-save-row input[type='text'] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.preset-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-actions-row button,
.preset-save-row button {
  padding: 10px 12px;
}

.storage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.storage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.storage-pill strong {
  color: var(--text);
  font-size: 12px;
}

.storage-pill.is-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.storage-pill.is-warning {
  border-color: #fdba74;
  background: #fff7ed;
  color: #92400e;
}

.storage-pill.is-neutral {
  color: var(--muted);
}

@media (max-width: 640px) {
  .preset-save-row {
    grid-template-columns: 1fr;
  }
}

.sample-tools-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sample-tools-actions {
  display: grid;
  gap: 8px;
}

.sample-tools-actions > * {
  width: 100%;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button-link:hover {
  transform: translateY(-1px);
  border-color: #9fb0c8;
}

.qa-body {
  padding-bottom: 32px;
}

.qa-hero {
  max-width: var(--cutclean-layout-max);
}

.qa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.qa-run-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fcfdff;
  color: var(--muted);
  line-height: 1.6;
}

.qa-shell {
  max-width: var(--cutclean-layout-max);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

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

.qa-card-pass {
  border-color: #99f6e4;
  background: #ecfdf5;
}

.qa-card-metric {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.qa-cases-grid {
  display: grid;
  gap: 14px;
}

.qa-case {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.qa-case.is-pass {
  border-color: #99f6e4;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.qa-case.is-warning {
  border-color: #fdba74;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.qa-case.is-fail {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.qa-case-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.qa-case-head strong {
  display: block;
  margin-bottom: 4px;
}

.qa-case-head span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.qa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.qa-badge.is-pass {
  background: #ecfdf5;
  color: var(--success);
}

.qa-badge.is-warning {
  background: #fff7ed;
  color: var(--warning);
}

.qa-badge.is-fail {
  background: #fef2f2;
  color: var(--danger);
}

.qa-badge.is-pending {
  background: #f8fafc;
  color: var(--muted);
}

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

.qa-preview-box .thumb {
  min-height: 220px;
}

.qa-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.qa-checks {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fcfdff;
}

.qa-checks summary {
  cursor: pointer;
  font-weight: 700;
}

.qa-checks[open] summary {
  margin-bottom: 12px;
}

.qa-check-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.qa-check-item {
  color: var(--muted);
  line-height: 1.5;
}

.qa-check-item strong {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}

.qa-check-item.is-ok strong {
  color: var(--success);
}

.qa-check-item.is-soft strong {
  color: var(--warning);
}

.qa-check-item.is-bad strong {
  color: var(--danger);
}

.qa-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 960px) {
  .qa-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .picker-stage-actions,
  .sample-tools-actions,
  .qa-toolbar,
  .qa-preview-row,
  .qa-summary-grid,
  .qa-case-head {
    grid-template-columns: 1fr;
  }

  .picker-stage-actions,
  .qa-toolbar,
  .sample-tools-actions {
    display: grid;
  }

  .qa-preview-row {
    display: grid;
  }

  .picker-stage-actions button,
  .picker-stage-actions .field,
  .qa-badge,
  .button-link,
  .sample-tools-actions button,
  .qa-toolbar button {
    width: 100%;
  }
}

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

.qa-hero .locale-switcher {
  margin-bottom: 12px;
}

.qa-head-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.qa-tier-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.qa-tier-pill.is-baseline {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.qa-tier-pill.is-challenge {
  background: #fefce8;
  color: #a16207;
  border-color: #fde68a;
}

.qa-tier-pill.is-limit {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.qa-preview-row.is-advanced {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qa-thumb-mask {
  background: #0f172a;
}

.qa-thumb-diff {
  background: linear-gradient(180deg, #111827, #1f2937);
}

.qa-thumb-mask img,
.qa-thumb-diff img {
  max-height: 260px;
}

@media (max-width: 1180px) {
  .qa-summary-grid-advanced {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .qa-preview-row.is-advanced {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .qa-summary-grid-advanced {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .qa-head-badges {
    justify-content: flex-start;
  }

  .qa-summary-grid-advanced,
  .qa-preview-row.is-advanced {
    grid-template-columns: 1fr;
  }
}

.cutclean-guide {
  max-width: var(--cutclean-layout-max);
  margin: 20px auto 24px;
  display: grid;
  grid-template-columns:
    minmax(var(--cutclean-input-column-min), var(--cutclean-sidebar-width))
    minmax(0, 1fr);
  gap: var(--cutclean-layout-gap);
}

.cutclean-guide-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.cutclean-guide-card--wide {
  grid-column: 1 / -1;
}

.cutclean-guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.cutclean-guide-card p + p {
  margin-top: 10px;
}

.cutclean-guide-card ul,
.cutclean-guide-card ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.cutclean-guide-card li + li {
  margin-top: 8px;
}

.cutclean-guide-card details + details {
  margin-top: 10px;
}

.cutclean-guide-card summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.cutclean-guide-card details p {
  margin-top: 10px;
}

.updated-at {
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 1280px) {
  .cutclean-guide {
    grid-template-columns: 1fr;
  }
}
