:root {
  color-scheme: dark;
  --ink: #ffffff;
  --muted: #b8b8b8;
  --line: rgba(255, 255, 255, 0.08);
  --paper: #000000;
  --surface: #1c1c1c;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --accent: #ffa726;
  --accent-hover: #ffb950;
  --accent-2: #be4a1d;
  --focus: #ffbf48;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 167, 38, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 46%),
    var(--paper);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  flex: 1 0 auto;
  min-height: calc(100vh - 82px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: rgba(28, 28, 28, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #111111;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
}

.type-nav {
  display: grid;
  gap: 6px;
}

.type-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
}

.type-button:hover,
.type-button.is-active {
  background: var(--accent);
  color: #111111;
}

.workspace {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  max-width: 780px;
}

.privacy-note {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  min-width: 58px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #111111;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(360px, 560px) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.editor-panel {
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.tab-button {
  height: 48px;
  border: 0;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-weight: 750;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button.is-active {
  background: var(--surface-strong);
  color: #ffffff;
}

.tab-panel {
  display: none;
  padding: 20px;
}

.tab-panel.is-active {
  display: block;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.theme-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 0.9rem;
  font-weight: 760;
}

.theme-choice.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.swatches {
  display: flex;
  flex: 0 0 auto;
}

.swatches i {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid #111111;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.swatches i + i {
  margin-left: -5px;
}

.field-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

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

.field span,
.check-field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

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

input[type="color"] {
  padding: 5px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--focus);
  outline: 3px solid rgba(255, 167, 38, 0.28);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.check-field input {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--accent);
}

.frame-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.frame-choice {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 750;
}

.frame-choice.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111111;
}

.preview-zone {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 760;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
  transition: transform 160ms ease;
}

.switch-field input:checked + .switch-track {
  background: #ffffff;
  border-color: rgba(255, 167, 38, 0.5);
}

.switch-field input:checked + .switch-track::after {
  transform: translateX(18px);
  background: #111111;
}

.device {
  display: grid;
  min-height: 650px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    #111111;
  background-size: 28px 28px;
  overflow: hidden;
}

.device.is-light-preview {
  border-color: rgba(17, 17, 17, 0.12);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.07) 1px, transparent 1px),
    #f7f7f7;
  background-size: 28px 28px;
}

.preview-card {
  --frame-color: var(--accent);
  --frame-text-color: var(--ink);
  --frame-width: 10px;
  display: grid;
  gap: 18px;
  justify-items: center;
  max-width: min(92%, 560px);
  padding: 28px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-radius 180ms ease;
}

.preview-card.is-transparent-bg {
  background: transparent;
  box-shadow: none;
}

.preview-card.is-transparent-bg.frame-classic,
.preview-card.is-transparent-bg.frame-ticket,
.preview-card.is-transparent-bg.frame-badge,
.preview-card.is-transparent-bg.has-frame-text.frame-poster {
  background: rgba(255, 255, 255, 0.08);
}

.frame-title {
  display: none;
  color: var(--frame-text-color);
  font-size: 1.15rem;
  font-weight: 850;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.qr-preview {
  display: grid;
  place-items: center;
  max-width: 100%;
}

.qr-preview canvas,
.qr-preview svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.frame-classic {
  border: var(--frame-width) solid var(--frame-color);
}

.frame-ticket {
  border: min(5px, var(--frame-width)) dashed var(--frame-color);
  padding: 34px 28px;
}

.frame-badge {
  border-radius: 34px;
  padding: 42px;
  border: var(--frame-width) solid var(--frame-color);
}

.frame-poster {
  overflow: hidden;
}

.has-frame-text.frame-poster {
  padding-bottom: 0;
}

.has-frame-text.frame-classic .frame-title,
.has-frame-text.frame-ticket .frame-title,
.has-frame-text.frame-badge .frame-title,
.has-frame-text.frame-poster .frame-title {
  display: block;
}

.frame-poster .frame-title {
  order: 2;
  width: calc(100% + 56px);
  margin: 0 -28px;
  padding: 16px 20px;
  background: var(--frame-color);
  color: var(--frame-text-color);
}

.no-frame-text.frame-poster {
  gap: 0;
}

.quality-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  flex: 0 0 auto;
  background: var(--surface);
  color: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 30px;
}

.footer-copy,
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-copy span + span::before,
.footer-copy a::before {
  content: "|";
  margin-right: 10px;
  color: rgba(255, 255, 255, 0.28);
}

.footer-copy a,
.footer-brand {
  color: #fff;
  text-decoration: none;
}

.footer-copy a:hover,
.footer-brand:hover {
  color: var(--accent-hover);
}

.footer-brand {
  font-weight: 760;
}

.footer-brand img {
  display: block;
  width: 25px;
  height: 23px;
}

.footer-brand-dot {
  color: #ffa726;
  margin-left: -10px;
}

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

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .type-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .type-button {
    text-align: center;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .preview-zone {
    position: static;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .type-nav,
  .field-grid.two-cols,
  .theme-picker,
  .frame-picker {
    grid-template-columns: 1fr;
  }

  .device {
    min-height: 460px;
  }

  .preview-card {
    padding: 18px;
  }

  .frame-poster .frame-title {
    width: calc(100% + 36px);
    margin: 0 -18px;
  }

  .quality-row {
    flex-direction: column;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .footer-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .footer-copy span + span::before,
  .footer-copy a::before {
    content: "";
    margin-right: 0;
  }
}
