:root {
  --bg: #09090b;
  --panel: #09090b;
  --panel-muted: #a1a1aa;
  --panel-text: #fafafa;
  --accent: #f4f4f5;
  --input-bg: #18181b;
  --input-border: #27272a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 18% 8%, #13131a 0%, #0a0a0f 44%, var(--bg) 100%);
  color: #e4e4e7;
}

.layout {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  min-height: 100vh;
}

.panel {
  background: linear-gradient(180deg, #0c0c11 0%, var(--panel) 100%);
  color: var(--panel-text);
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid #27272a;
}

.panel h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 8px 0 18px;
  color: var(--panel-muted);
  font-size: 0.9rem;
}

.subtitle a {
  color: #d4d4d8;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

section {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.8);
  border: 1px solid #27272a;
}

section h2 {
  margin: 0 0 10px;
  font-size: 0.93rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d4d4d8;
}

label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 9px;
  color: #d4d4d8;
}

.label-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.tip-icon {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid #3f3f46;
  background: #111827;
  color: #f4f4f5;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  flex-shrink: 0;
}

.tip-icon:hover {
  border-color: #71717a;
  color: #ffffff;
}

label .label-head + input,
label .label-head + textarea,
label .label-head + select {
  margin-top: 0;
}

input,
textarea,
select,
button {
  width: 100%;
  margin-top: 5px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: #f6fbff;
  padding: 7px 9px;
  font-size: 0.86rem;
}

textarea {
  resize: vertical;
  min-height: 88px;
  font-family: "SF Mono", "Menlo", monospace;
}

input[type="color"] {
  height: 37px;
  padding: 4px;
}

button {
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  filter: brightness(1.07);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: linear-gradient(180deg, #ffffff 0%, var(--accent) 100%);
  border-color: #d4d4d8;
  color: #09090b;
  font-weight: 600;
}

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

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
  padding: 18px;
  background: #09090b;
}

.canvas-wrap {
  min-width: 0;
}

.canvas-side {
  padding-top: 0;
}

#view {
  width: 100%;
  height: calc(100vh - 36px);
  border-radius: 14px;
  background: #020617;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  border: 1px solid #1f2937;
}

.status {
  min-height: 64px;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #e4e4e7;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .stage {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }

  .canvas-side {
    padding: 14px;
  }

  #view {
    height: 58vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}
