:root {
  --bg: #081026;
  --bg-elevated: #0f1e44;
  --fg: #e8eeff;
  --muted: #9cb2ef;
  --accent: #4a7bff;
  --accent-2: #7dd3fc;
  --ok: #6ee7b7;
  --danger: #fb7185;
  --border: #27407b;
}

body[data-theme="cobaltWave"] {
  --bg: #0b1634;
  --bg-elevated: #122656;
  --fg: #e6f2ff;
  --muted: #aac8ff;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --border: #315398;
}

body[data-theme="auroraInk"] {
  --bg: #09131f;
  --bg-elevated: #0d2138;
  --fg: #e9f8ff;
  --muted: #9ac7d8;
  --accent: #00b4d8;
  --accent-2: #7dd3fc;
  --border: #24516b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, system-ui, sans-serif;
  background: radial-gradient(circle at top, #1b2f66 0%, var(--bg) 45%, #060b1a 100%);
  color: var(--fg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  background: color-mix(in hsl, var(--bg-elevated) 90%, black 10%);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  text-transform: lowercase;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.topbar nav a {
  color: var(--muted);
  margin: 0 0.6rem;
  text-decoration: none;
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  padding: 2rem 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.hero p {
  max-width: 72ch;
  color: var(--muted);
}

.eyebrow {
  color: var(--accent-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.button {
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  color: #021024;
  border: none;
  font-weight: 700;
}

.cards,
.pricing .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

article,
.panel {
  background: color-mix(in hsl, var(--bg-elevated) 86%, black 14%);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
}

section {
  margin-top: 1.2rem;
}

.price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-2);
}

label {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select {
  padding: 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #0b1937;
  color: var(--fg);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.8rem 0 1rem;
}

.kpis div {
  background: #0a1a3d;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.7rem;
}

.kpis span {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.5rem;
  vertical-align: top;
}

pre {
  white-space: pre-wrap;
  background: #07142d;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.8rem;
}

footer {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined", sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 1.25em;
  line-height: 1;
  vertical-align: -0.2em;
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.qr-studio {
  background: color-mix(in hsl, var(--bg-elevated) 88%, black 12%);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.25rem;
  margin-top: 2rem;
}

.qr-studio__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.qr-studio__lead {
  color: var(--muted);
  margin: 0 0 0.5rem;
  max-width: 72ch;
}

.qr-studio__hint {
  font-size: 0.88rem;
  color: var(--accent-2);
  margin: 0 0 1rem;
  min-height: 1.2em;
}

.studio-subhead {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.studio-toolbar {
  margin-bottom: 1rem;
}

.studio-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.studio-field--grow select {
  width: 100%;
  max-width: min(100%, 52ch);
}

.studio-field--check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.studio-field--check input {
  width: auto;
}

.studio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.studio-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #0a1937;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.studio-chip.is-active {
  border-color: var(--accent);
  color: var(--fg);
  background: color-mix(in hsl, var(--accent) 18%, #0a1937);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: #0a1a3d;
  color: var(--fg);
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.template-card:hover {
  border-color: var(--accent);
}

.template-card.is-selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px color-mix(in hsl, var(--accent-2) 50%, transparent);
}

.template-card__icon {
  font-size: 1.5rem !important;
  color: var(--accent-2);
}

.template-card__name {
  font-weight: 600;
  font-size: 0.88rem;
}

.template-card__desc {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.studio-preview-row {
  display: grid;
  grid-template-columns: 300px minmax(220px, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

@media (max-width: 720px) {
  .studio-preview-row {
    grid-template-columns: 1fr;
  }
}

.qr-preview-mount {
  min-width: min(100%, 300px);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #060d1f;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.studio-preview-placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  max-width: 28ch;
}

.studio-side-controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.studio-range-value {
  font-weight: 700;
  color: var(--accent-2);
}

.studio-dl-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.studio-dl-buttons .button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.studio-advanced-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.studio-advanced {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 0.65rem;
  border: 1px dashed var(--border);
  background: #07142d;
}

.studio-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.dashboard-actions .button.tiny,
.button.tiny {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
}

.redirect-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.redirect-edit input {
  flex: 1;
  min-width: 12rem;
  font-size: 0.85rem;
}

.dest-display {
  font-size: 0.82rem;
  word-break: break-all;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: color-mix(in hsl, var(--bg-elevated) 95%, black);
  border: 1px solid var(--accent);
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  color: var(--fg);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-action {
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--accent);
  background: color-mix(in hsl, var(--accent) 20%, transparent);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.toast-action:hover {
  background: color-mix(in hsl, var(--accent) 35%, transparent);
}
