:root {
  --bg: #091017;
  --panel: rgba(9, 17, 24, 0.92);
  --panel-soft: rgba(16, 29, 39, 0.88);
  --line: rgba(188, 225, 255, 0.14);
  --text: #eef6fb;
  --muted: #9eb2c2;
  --accent: #8ed1b6;
  --accent-strong: #d1ff87;
  --danger: #ff7b7b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --ui-font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(49, 92, 95, 0.35), transparent 34%),
    linear-gradient(145deg, #061019, #0b1620 55%, #111d25);
  color: var(--text);
  font-family: var(--ui-font);
}

body {
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

.editor-shell {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
}

.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(6, 12, 18, 0.96), rgba(8, 16, 22, 0.86));
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand-card,
.panel,
.topbar,
.viewport {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-card,
.panel {
  background: var(--panel);
}

.brand-card,
.panel {
  padding: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

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

.button-row {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
}

.arrow-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.arrow-pad button:nth-child(1) {
  grid-column: 2;
}

.arrow-pad button:nth-child(2) {
  grid-column: 1;
}

.arrow-pad button:nth-child(3) {
  grid-column: 2;
}

.arrow-pad button:nth-child(4) {
  grid-column: 3;
}

.arrow-pad button:nth-child(5) {
  grid-column: 2;
}

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

.action-button,
.ghost-button,
.danger-button {
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.action-button {
  background: linear-gradient(135deg, rgba(142, 209, 182, 0.26), rgba(209, 255, 135, 0.18));
}

.action-button.active-mode,
.ghost-button.active-mode {
  border-color: rgba(209, 255, 135, 0.34);
  box-shadow: inset 0 0 0 1px rgba(209, 255, 135, 0.14);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.05);
}

.danger-button {
  background: rgba(255, 123, 123, 0.14);
  color: #ffd1d1;
}

.editor-canvas-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  background: var(--panel-soft);
}

.topbar-copy {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
}

.viewport {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(76, 116, 121, 0.16), transparent 32%),
    linear-gradient(180deg, #0a141b, #0f1a23);
}

.viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

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

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

@media (max-width: 720px) {
  .editor-sidebar,
  .editor-canvas-shell {
    padding: 14px;
  }

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

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

  .topbar-copy {
    text-align: left;
  }
}
