:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-soft: #0d1a30;
  --panel: rgba(10, 20, 37, 0.84);
  --panel-strong: rgba(10, 20, 37, 0.96);
  --panel-soft: rgba(18, 32, 55, 0.9);
  --border: rgba(132, 182, 255, 0.16);
  --border-strong: rgba(132, 182, 255, 0.28);
  --text: #f8fbff;
  --muted: #96a8c3;
  --accent: #67d4ff;
  --accent-strong: #2fbef5;
  --accent-soft: rgba(103, 212, 255, 0.12);
  --surface: rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(61, 192, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(23, 105, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #050b14 0%, var(--bg) 45%, #06101d 100%);
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 20% 20%, rgba(103, 212, 255, 0.05), transparent 20%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
}

.app {
  width: min(1280px, calc(100% - 40px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(380px, 1fr);
  gap: 28px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(135deg, rgba(103, 212, 255, 0.32), rgba(47, 190, 245, 0.06));
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}

.brand-icon::before,
.brand-icon::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 12px;
  border: 2px solid rgba(103, 212, 255, 0.65);
}

.brand-icon::after {
  inset: 17px;
  border-color: rgba(255, 255, 255, 0.88);
}

.brand-text {
  display: grid;
  gap: 4px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 700;
}

.brand-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.version-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(103, 212, 255, 0.18);
  font-size: 0.85rem;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.hero-note {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(132, 182, 255, 0.14);
}

.hero-card strong {
  font-size: 0.95rem;
}

.hero-card span {
  color: var(--muted);
  line-height: 1.5;
}

.section-title {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.field-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(132, 182, 255, 0.11);
}

.field-group {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 10px;
  font-size: 0.95rem;
}

label > span:first-child {
  font-weight: 600;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.label-row span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid rgba(132, 182, 255, 0.14);
  border-radius: 16px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(103, 212, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(103, 212, 255, 0.1);
  background: rgba(18, 32, 55, 1);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

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

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

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

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #04131f;
}

button.secondary {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}

button.ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border: 1px solid rgba(132, 182, 255, 0.14);
}

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

.preview-shell {
  display: grid;
  gap: 18px;
}

.canvas-wrap {
  background:
    linear-gradient(45deg, #d7e0ee 25%, transparent 25%),
    linear-gradient(-45deg, #d7e0ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7e0ee 75%),
    linear-gradient(-45deg, transparent 75%, #d7e0ee 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border-radius: 28px;
  padding: 22px;
  border: 1px solid rgba(132, 182, 255, 0.14);
}

canvas {
  display: block;
  width: min(100%, 680px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: white;
  border-radius: 24px;
  touch-action: none;
}

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

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

.preview-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.preview-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(132, 182, 255, 0.14);
  color: var(--text);
  white-space: nowrap;
  font-size: 0.85rem;
}

.hint,
.status {
  color: var(--muted);
  line-height: 1.5;
}

.status {
  min-height: 24px;
}

.mini-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(132, 182, 255, 0.12);
  border-radius: 20px;
  padding: 16px;
}

.mini-card strong {
  display: block;
  margin-bottom: 8px;
}

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

.hidden {
  display: none;
}

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

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

@media (max-width: 640px) {
  .app {
    width: min(100% - 24px, 1280px);
    margin: 12px auto 20px;
    gap: 16px;
  }

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

  .brand-row,
  .preview-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
