:root {
  --bg: #101010;
  --panel: #1b1b1b;
  --panel-2: #252525;
  --yellow: #fff200;
  --text: #f6f6f6;
  --muted: #bebebe;
  --border: #363636;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 210, 0, .1), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(255, 210, 0, .08), transparent 28%),
    var(--bg);
}

.app {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 18px;
}

.panel {
  background: rgba(27, 27, 27, .98);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.form-panel {
  align-self: start;
  position: sticky;
  top: 16px;
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.brand span {
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand strong {
  font-size: 28px;
  line-height: 1;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.layout-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 46px;
  border: 1px solid #424242;
  border-radius: 6px;
  background: var(--panel-2);
  overflow: hidden;
}

.switch-ui::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc(50% - 6px);
  border-radius: 4px;
  background: var(--yellow);
  transition: transform .18s ease;
}

.layout-switch input:checked + .switch-ui::before {
  transform: translateX(calc(100% + 4px));
}

.switch-ui em {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.layout-switch input:not(:checked) + .switch-ui em:first-child,
.layout-switch input:checked + .switch-ui em:last-child {
  color: #080808;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #424242;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px;
  font: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--yellow);
}

textarea {
  min-height: 230px;
  resize: vertical;
  line-height: 1.4;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--yellow);
  color: #090909;
  padding: 12px;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

button.secondary {
  background: #3a3a3a;
  color: var(--text);
}

button.danger {
  grid-column: 1 / -1;
  background: #2b2b2b;
  color: var(--yellow);
  border: 1px solid #545454;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.preview-wrap {
  display: grid;
  justify-items: center;
  align-items: start;
  min-width: 0;
}

canvas {
  width: min(100%, 640px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .5);
  background: #050505;
}

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

  .form-panel {
    position: static;
  }

  .preview-wrap {
    order: -1;
  }
}

@media (max-width: 460px) {
  .two,
  .actions {
    grid-template-columns: 1fr;
  }

  .brand strong {
    font-size: 24px;
  }

  textarea {
    min-height: 180px;
  }
}
