:root {
  --bg: #090a10;
  --bg-soft: #11131d;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --stroke: rgba(255, 255, 255, 0.16);
  --stroke-bright: rgba(255, 255, 255, 0.28);
  --text: #f7f3ea;
  --muted: #aaa4b6;
  --gold: #d8b76d;
  --rose: #db6f92;
  --cyan: #58d3d8;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --radius: 24px;
  --radius-sm: 14px;
  --bar-height: 96px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0 0 var(--bar-height);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(216, 183, 109, 0.2), transparent 26rem),
    radial-gradient(circle at 82% 4%, rgba(88, 211, 216, 0.14), transparent 28rem),
    linear-gradient(145deg, #08080d 0%, #11131c 48%, #090a10 100%);
}

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

button {
  cursor: pointer;
}

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

.hero {
  padding: 42px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.35rem, 7vw, 5.7rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.hero-copy {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.panel,
.accordion,
.upload-card {
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.panel {
  border-radius: var(--radius);
  padding: 18px;
}

.controls-panel {
  display: grid;
  gap: 14px;
}

.upload-card {
  display: grid;
  gap: 14px;
  border-radius: var(--radius);
  padding: 14px;
}

.upload-zone {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 132px;
  padding: 18px;
  border: 1px dashed var(--stroke-bright);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(216, 183, 109, 0.1);
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: #0e0d10;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--cyan));
}

.preview-card {
  display: grid;
  place-items: center;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.25);
}

.preview-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
}

.preview-placeholder {
  color: var(--muted);
}

.accordion {
  overflow: hidden;
  border-radius: 20px;
}

.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 18px;
  font-weight: 800;
  list-style: none;
}

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

.accordion summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
  transition: transform 180ms ease;
}

.accordion[open] summary::after {
  transform: rotate(45deg);
}

.grid,
.stack {
  display: grid;
  gap: 14px;
  padding: 0 14px 16px;
}

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

.field span,
.group-label {
  color: #ded7e8;
  font-size: 0.84rem;
  font-weight: 700;
}

select,
input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  outline: none;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

select,
input[type="text"] {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  min-height: 96px;
  padding: 14px;
  line-height: 1.55;
}

select:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: rgba(216, 183, 109, 0.72);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 0 0 4px rgba(216, 183, 109, 0.1);
}

small {
  color: var(--muted);
}

.range-field input {
  accent-color: var(--gold);
}

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

.chip,
.check-card {
  min-height: 44px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chip:hover,
.check-card:hover {
  transform: translateY(-1px);
  border-color: var(--stroke-bright);
  background: rgba(255, 255, 255, 0.09);
}

.chip.is-active {
  border-color: var(--gold);
  background: rgba(216, 183, 109, 0.18);
}

.check-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.check-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.output-panel {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.output-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.button-row {
  display: grid;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 16px;
  color: var(--text);
  font-weight: 800;
  transition: transform 180ms ease, filter 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-btn {
  width: min(620px, calc(100% - 32px));
  background: linear-gradient(135deg, var(--gold), var(--rose), var(--cyan));
  color: #08080d;
  box-shadow: 0 18px 42px rgba(216, 183, 109, 0.24);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--stroke);
}

.ghost-btn {
  min-height: 42px;
  background: rgba(216, 183, 109, 0.1);
  border-color: rgba(216, 183, 109, 0.25);
  color: var(--gold);
}

.danger-btn {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.24);
  color: #ffc4c4;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.bottom-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  min-height: var(--bar-height);
  border-top: 1px solid var(--stroke);
  background: rgba(9, 10, 16, 0.78);
  backdrop-filter: blur(18px);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bar-height) + 16px);
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(20, 22, 32, 0.92);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide,
  .range-field {
    grid-column: 1 / -1;
  }

  .upload-card {
    grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.65fr);
  }

  .button-row {
    grid-template-columns: 1fr 1fr;
  }

  .danger-btn {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.72fr);
    align-items: start;
  }

  .panel {
    padding: 22px;
  }

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

@media (max-width: 420px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .panel {
    padding: 12px;
    border-radius: 18px;
  }

  .chip-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .upload-zone {
    grid-template-columns: 1fr;
  }
}
