@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=DM+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --page-bg: #edf7f2;
  --page-bg-deep: #e2efe8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --line: rgba(104, 136, 121, 0.18);
  --line-strong: rgba(75, 119, 93, 0.28);
  --ink: #162033;
  --muted: #6f7b96;
  --accent: #2f9b67;
  --accent-strong: #257a51;
  --accent-soft: rgba(47, 155, 103, 0.1);
  --danger: #c44d77;
  --danger-bg: #fdebf1;
  --focus: #25c3d8;
  --shadow: 0 28px 60px rgba(25, 35, 66, 0.12);
  --shadow-soft: 0 14px 34px rgba(25, 35, 66, 0.08);
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-sans: "DM Sans", "Aptos", "Segoe UI", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(47, 155, 103, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(73, 181, 138, 0.1), transparent 22%),
    linear-gradient(180deg, #f7f9ff 0%, var(--page-bg) 52%, var(--page-bg-deep) 100%);
  font-family: var(--font-sans);
}

button,
input,
label {
  font: inherit;
}

button,
.drop-zone,
.segmented span,
.icon-button,
.primary-button {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

button {
  cursor: pointer;
}

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

button:focus-visible,
input:focus-visible,
.drop-zone:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px;
}

.shell {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.surface {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  background: linear-gradient(135deg, #43b37c 0%, #2f9b67 52%, #7ed3a8 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 30px rgba(47, 155, 103, 0.24);
}

.brand-copy h1 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.05;
}

.brand-copy p {
  color: var(--muted);
  font-size: 14px;
}

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

.topbar-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(47, 155, 103, 0.12));
  border: 1px solid rgba(47, 155, 103, 0.18);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.primary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 16px;
}

.primary-button {
  gap: 8px;
  padding: 0 16px;
  border: 0;
  background: linear-gradient(135deg, #43b37c 0%, #2f9b67 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 20px 30px rgba(47, 155, 103, 0.24);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 24px 34px rgba(47, 155, 103, 0.28);
}

.icon-button {
  width: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.hero {
  padding: 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 292px;
  padding: 34px 24px;
  text-align: center;
  border: 1.5px dashed rgba(47, 155, 103, 0.28);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(47, 155, 103, 0.06));
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: rgba(47, 155, 103, 0.54);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(47, 155, 103, 0.1));
  transform: translateY(-1px);
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: 1px solid rgba(47, 155, 103, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 14px 28px rgba(25, 35, 66, 0.08);
}

.drop-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.drop-title {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.drop-sub {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.drop-link {
  margin-top: 8px;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-copy {
  padding: 8px 8px 8px 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kicker,
.workspace-kicker,
.card-label {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker {
  margin-bottom: 10px;
}

.hero-copy h2 {
  margin-bottom: 12px;
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-copy p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 56ch;
}

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

.mini-card {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
}

.mini-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.app-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.card-label {
  margin-bottom: 14px;
}

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

.control-group {
  display: grid;
  gap: 10px;
}

.control-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
}

output,
.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

output {
  font-family: var(--font-mono);
}

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

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

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

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

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

.segmented span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(47, 155, 103, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

.segmented input:checked + span {
  border-color: transparent;
  background: linear-gradient(135deg, #43b37c 0%, #2f9b67 100%);
  color: #fff;
  box-shadow: 0 16px 26px rgba(47, 155, 103, 0.18);
}

.check-card {
  display: block;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.check-row input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.workspace {
  min-width: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.workspace-title-wrap strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.status-line {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100%;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin-top: 16px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.05;
}

.empty-state p {
  max-width: 460px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(47, 155, 103, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.empty-mark svg {
  width: 34px;
  height: 34px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.image-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.preview-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

figure {
  display: grid;
  grid-template-rows: auto 34px;
  min-width: 0;
  background:
    linear-gradient(45deg, rgba(194, 202, 222, 0.34) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(194, 202, 222, 0.34) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(194, 202, 222, 0.34) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(194, 202, 222, 0.34) 75%);
  background-color: rgba(255, 255, 255, 0.78);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

figure + figure {
  border-left: 1px solid var(--line);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  padding: 10px;
}

figcaption {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.card-body h3 {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
}

.image-card.has-error {
  border-color: rgba(196, 77, 119, 0.22);
  background: var(--danger-bg);
}

.image-card.has-error .meta {
  color: var(--danger);
}

@media (max-width: 980px) {
  .hero-grid,
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 14px;
  }

  .shell {
    min-height: calc(100vh - 28px);
  }

  .topbar {
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-note {
    width: 100%;
    text-align: center;
  }

  .primary-button {
    flex: 1;
  }

  .brand-copy h1 {
    font-size: 22px;
  }

  .hero-copy h2 {
    font-size: 30px;
  }

  .mini-features {
    grid-template-columns: 1fr;
  }

  .workspace,
  .hero,
  .card {
    padding: 16px;
  }

  .drop-zone {
    min-height: 220px;
  }

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