:root {
  color-scheme: light;
  --bg: #f3efe6;
  --ink: #1c1915;
  --muted: #655e54;
  --card: #fffdf8;
  --line: #e3dac8;
  --accent: #0c6b4d;
  --accent-ink: #f3fff8;
  --danger: #8d2f2f;
  --shadow: 0 16px 40px rgba(48, 36, 18, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(12, 107, 77, 0.08), transparent 32rem),
    var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

.top, main, footer {
  width: min(720px, calc(100% - 32px));
  margin-inline: auto;
}

.top { padding: 40px 0 8px; }

.brand {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--accent);
}

h1, h2 { font-family: Georgia, "Iowan Old Style", serif; font-weight: 600; }

h1 { margin: 0 0 8px; font-size: 2rem; line-height: 1.15; letter-spacing: -0.02em; }

h2 { margin: 0 0 8px; font-size: 1.4rem; }

.lede, .hint, footer { color: var(--muted); }

.lede { margin: 0; max-width: 62ch; }

.card {
  margin-top: 20px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.drop {
  position: relative;
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 148px;
  padding: 24px;
  border: 1.5px dashed #c9bea8;
  border-radius: 14px;
  background: #faf7f1;
  text-align: center;
  cursor: pointer;
}

.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop:focus-within, .drop.hot {
  border-color: var(--accent);
  background: #f3faf6;
}

.drop-title { font-weight: 650; }

.field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.95rem;
}

.field span, .hint { font-size: 0.85rem; }

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: inherit;
  font: inherit;
}

input[type="text"]:focus {
  outline: 2px solid rgba(12, 107, 77, 0.35);
  border-color: var(--accent);
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.hint { margin: 8px 0 0; }

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: progress; }

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

.status { min-height: 1.4em; margin: 12px 0 0; }

.status.error { color: var(--danger); }

.result {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  margin-top: 8px;
  align-items: center;
}

.preview-wrap {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e7e0d4 25%, transparent 25%),
    linear-gradient(-45deg, #e7e0d4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7e0d4 75%),
    linear-gradient(-45deg, transparent 75%, #e7e0d4 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  display: grid;
  place-items: center;
}

.preview-wrap img { width: 100%; height: 100%; object-fit: contain; }

.meta { margin: 0; font-weight: 650; }

.split { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.pack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.pack-list li {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.pack-list img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: #f6f1e8;
  object-fit: contain;
}

.pack-list button {
  margin-top: 0;
  padding: 2px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

code { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 0.9em; }

footer { padding: 24px 0 40px; font-size: 0.85rem; }

@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
  .result, .split { grid-template-columns: 1fr; }
  .preview-wrap { width: min(100%, 280px); height: auto; aspect-ratio: 1; }
  button, .button { width: 100%; }
  .row { display: grid; }
}
