:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --ink: #1e2025;
  --muted: #676b75;
  --line: #dfddd5;
  --panel: #ffffff;
  --panel-strong: #fff7e4;
  --accent: #f2aa25;
  --accent-strong: #bf6414;
  --green: #2b8c62;
  --red: #b84242;
  --shadow: 0 18px 60px rgba(37, 29, 12, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(242, 170, 37, 0.12), transparent 32rem),
    linear-gradient(315deg, rgba(51, 122, 183, 0.08), transparent 36rem),
    var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header,
main,
.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}

.brand,
.topbar-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--accent);
  box-shadow: inset -7px -7px 0 rgba(255, 255, 255, 0.08);
}

.topbar-actions {
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 36px;
  align-items: end;
  padding: 56px 0 40px;
}

.hero-copy h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.7;
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.hero-panel > div {
  min-height: 105px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-panel strong {
  display: block;
  margin-top: 9px;
  font-size: 1.55rem;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-top: 10px;
}

.controls,
.drop-zone,
.status-strip,
.empty-state,
.queue-card,
.privacy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.controls {
  display: grid;
  gap: 18px;
  padding: 20px;
}

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

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

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label,
legend {
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 800;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

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

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
}

.segmented legend {
  grid-column: 1 / -1;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented label:has(input:checked) {
  border-color: var(--accent);
  background: var(--panel-strong);
  color: #7a4308;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

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

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

.button.primary {
  border-color: #d78818;
  background: var(--accent);
  color: #221404;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 360px;
  place-items: center;
  overflow: hidden;
  padding: 36px;
  text-align: center;
}

.drop-zone.dragging {
  border-color: var(--accent-strong);
  background: #fff8e8;
}

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

.drop-art {
  position: relative;
  width: min(300px, 72vw);
  height: 138px;
  margin-bottom: 10px;
}

.drop-art span {
  position: absolute;
  width: 156px;
  height: 98px;
  border: 1px solid rgba(30, 32, 37, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 228, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(30, 32, 37, 0.04) 18px 19px);
  box-shadow: 0 18px 35px rgba(30, 32, 37, 0.12);
}

.drop-art span:nth-child(1) {
  left: 5px;
  top: 31px;
  transform: rotate(-9deg);
}

.drop-art span:nth-child(2) {
  left: 72px;
  top: 5px;
  transform: rotate(4deg);
}

.drop-art span:nth-child(3) {
  right: 2px;
  top: 40px;
  transform: rotate(12deg);
}

.drop-copy h2 {
  margin: 0;
  font-size: 1.55rem;
}

.drop-copy p {
  max-width: 440px;
  margin: 10px auto 20px;
  color: var(--muted);
  line-height: 1.55;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 20px 0 34px;
  padding: 14px 16px;
}

.status-strip p {
  margin: 0;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading h2,
.privacy h2 {
  margin: 0;
  font-size: 1.45rem;
}

.section-heading p,
.privacy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 28px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.queue-list {
  display: grid;
  gap: 14px;
}

.queue-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
}

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

.preview {
  display: grid;
  gap: 6px;
}

.preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #ece9e1 25%, transparent 25% 75%, #ece9e1 75%),
    linear-gradient(45deg, #ece9e1 25%, #fff 25% 75%, #ece9e1 75%);
  background-position:
    0 0,
    8px 8px;
  background-size: 16px 16px;
}

.preview span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.queue-main {
  min-width: 0;
}

.queue-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.queue-title {
  min-width: 0;
}

.queue-title h3 {
  overflow: hidden;
  margin: 0;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eff1f3;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-badge.done {
  background: #e5f5ec;
  color: var(--green);
}

.status-badge.error {
  background: #fae8e8;
  color: var(--red);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 0.96rem;
}

.error-text {
  margin: 12px 0 0;
  color: var(--red);
}

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

.privacy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin: 34px 0;
  padding: 24px;
}

.privacy h2 {
  margin-bottom: 8px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 32px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

  .hero {
    padding-top: 34px;
  }

  .queue-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-header,
  main,
  .footer {
    width: min(100% - 22px, 1180px);
  }

  .topbar,
  .status-strip,
  .section-heading,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: 2.4rem;
    line-height: 1;
  }

  .hero-panel,
  .control-row,
  .stats {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 310px;
    padding: 24px;
  }

  .actions,
  .segmented,
  .preview-pair {
    grid-template-columns: 1fr;
  }

  .download-all,
  .actions .button,
  .card-actions .button {
    width: 100%;
  }
}
