:root {
  --ink: #172126;
  --muted: #637078;
  --line: #d8e0e3;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --green: #0f766e;
  --green-dark: #0a4f49;
  --blue: #2c6bed;
  --coral: #f06d5f;
  --shadow: 0 18px 55px rgba(30, 45, 52, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(44, 107, 237, 0.10), transparent 35%),
    linear-gradient(240deg, rgba(240, 109, 95, 0.12), transparent 32%),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  border: 1px solid rgba(23, 33, 38, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 16px;
  box-shadow: 0 8px 28px rgba(30, 45, 52, 0.06);
}

.brand-mark {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.topbar-points {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar-points span {
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.07);
  padding: 7px 10px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 26px;
  min-height: auto;
  padding: 48px 0 18px;
}

.hero-copy {
  max-width: 850px;
  padding: 0;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  border: 1px solid rgba(44, 107, 237, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(44, 107, 237, 0.08);
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 880px;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.65;
}

.tool {
  width: min(780px, 100%);
  border: 1px solid rgba(23, 33, 38, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 18px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 330px;
  border: 2px dashed #abc5c2;
  border-radius: 8px;
  background: #f9fcfb;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: var(--green);
  background: #eef8f6;
  outline: none;
  transform: translateY(-1px);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 2rem;
  line-height: 1;
}

.upload-title {
  margin: 16px 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
}

.upload-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status {
  margin: 14px 0 0;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.workspace {
  margin-top: 18px;
}

.is-hidden {
  display: none;
}

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

.preview-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.panel-header small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-stage {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  min-height: 220px;
  background: #f1f4f1;
}

.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #dce4e4 25%, transparent 25%),
    linear-gradient(-45deg, #dce4e4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dce4e4 75%),
    linear-gradient(-45deg, transparent 75%, #dce4e4 75%);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.image-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}

.control-group {
  min-width: 0;
}

.control-label,
.color-control span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f1;
}

.segment {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.segment.is-active {
  color: #fff;
  background: var(--green);
}

.color-control {
  min-width: 106px;
}

.color-control input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 900;
}

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

.primary-button:hover {
  background: var(--green-dark);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.trust-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.trust-band div {
  border-left: 4px solid var(--coral);
  background: rgba(255, 255, 255, 0.68);
  padding: 14px;
}

.trust-band strong,
.trust-band span {
  display: block;
}

.trust-band span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hero {
    padding-top: 34px;
  }

  .trust-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding: 12px 0 22px;
  }

  h1 {
    font-size: clamp(2.2rem, 13vw, 4rem);
  }

  .tool {
    padding: 12px;
  }

  .dropzone {
    min-height: 196px;
  }

  .preview-grid,
  .controls {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
