:root {
  --bg: #060606;
  --panel: rgba(21, 21, 21, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text: #f7f0e7;
  --muted: rgba(247, 240, 231, 0.62);
  --accent: #f1672f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(241, 103, 47, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 207, 101, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
}

.sidebar {
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 26%),
    #0d0d0d;
  overflow-y: auto;
}

.brandbar,
.panel,
.workspace__topbar,
.canvas-frame {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brandbar {
  padding: 16px;
  margin-bottom: 16px;
}

.brandbar__eyebrow,
.panel__title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brandbar__title {
  margin-top: 8px;
  font-size: 29px;
  font-weight: 800;
  line-height: 1.02;
}

.brandbar__meta {
  margin-top: 8px;
  color: #f7bb92;
  font-size: 13px;
}

.panel {
  padding: 14px;
  margin-bottom: 16px;
}

.panel__title {
  margin-bottom: 12px;
}

.preset-grid,
.stack-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preset-btn,
.action-btn {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: #141414;
  color: var(--text);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.preset-btn:hover,
.action-btn:hover,
.upload-box:hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.42);
}

.preset-btn.active,
.action-btn--primary {
  background: linear-gradient(135deg, var(--accent), #be2b1f);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff7ef;
}

.hidden-file-input {
  display: none;
}

.upload-box {
  margin-top: 10px;
  min-height: 108px;
  border: 1px dashed var(--line-strong);
  background:
    linear-gradient(135deg, rgba(241, 103, 47, 0.08), transparent 60%),
    #101010;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
}

.upload-box strong,
.upload-box span {
  display: block;
}

.upload-box span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.field span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.field input[type="range"] {
  width: 100%;
}

.status-card {
  min-height: 44px;
  margin-top: 10px;
  padding: 11px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  height: 100vh;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.workspace__topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.canvas-frame {
  min-height: 0;
  padding: 18px;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    #101010;
  background-size: 28px 28px;
  overflow: auto;
  display: grid;
  place-items: center;
}

canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(calc(100vh - 180px), 720px);
  max-height: 100%;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111;
  object-fit: contain;
}

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar,
  .workspace {
    height: auto;
  }

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

  .canvas-frame {
    min-height: 0;
  }

  canvas {
    width: min(100%, 680px);
    height: auto;
  }
}
