:root {
  color-scheme: dark;
  --ink: #070605;
  --panel: #161310;
  --wash: #0e0c0a;
  --well: #0a0908;
  --line: rgba(243, 235, 225, 0.07);
  --line-strong: rgba(243, 235, 225, 0.13);
  --text: #f6efe6;
  --muted: #9a8c7c;
  --copper: #d9a15a;
  --copper-dim: #8a6230;
  --ok: #8fbf8a;
  --bad: #d97a6a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Figtree", "Segoe UI", "Helvetica Neue", sans-serif;
  --serif: "Newsreader", Georgia, "Iowan Old Style", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow-deep: 0 28px 80px rgba(0, 0, 0, 0.55);
  --inset-well: inset 0 1px 0 rgba(255, 236, 210, 0.06), inset 0 -40px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  background:
    radial-gradient(920px 560px at 108% -18%, rgba(217, 161, 90, 0.2), transparent 48%),
    radial-gradient(760px 520px at -12% 118%, rgba(92, 52, 18, 0.38), transparent 52%),
    radial-gradient(500px 280px at 40% 0%, rgba(217, 161, 90, 0.05), transparent 60%),
    linear-gradient(180deg, #14110d 0%, #090807 46%, #060504 100%);
  color: var(--text);
  letter-spacing: -0.011em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.45);
}

.is-hidden, [hidden] { display: none !important; }

.band {
  position: relative;
  z-index: 9;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  min-height: 64px;
  padding: 0 1rem 0 1.1rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 232, 196, 0.04), transparent 40%),
    linear-gradient(180deg, rgba(22, 18, 14, 0.88), rgba(10, 9, 8, 0.78));
  backdrop-filter: blur(22px);
  box-shadow: 0 1px 0 rgba(255, 230, 190, 0.04);
}
.band-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 9.5rem;
}
.band-word {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}
.band-side {
  margin: 0.18rem 0 0;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
  text-shadow: 0 0 18px rgba(217, 161, 90, 0.35);
}
.hud {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.7fr;
  gap: 0.45rem;
  min-width: 0;
}
.hud-cell {
  min-width: 0;
  padding: 0.38rem 0.7rem 0.42rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(8, 7, 6, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.05);
}
.hud-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hud-cell strong {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-cmd {
  padding: 0.48rem 0.7rem;
  border-radius: 10px;
  background: #14110e;
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.06);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
}
.band-mark {
  display: grid;
  filter: drop-shadow(0 8px 16px rgba(217, 161, 90, 0.22));
}

.gate {
  position: relative;
  z-index: 9;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 25rem);
  gap: 4.5rem;
  align-items: center;
  padding: 4rem 8vw;
}
.gate-copy { max-width: 38rem; }
.gate-kicker, .eyebrow {
  margin: 0 0 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--copper);
  text-shadow: 0 0 20px rgba(217, 161, 90, 0.25);
}
.gate-copy h1 {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.038em;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.chat-head h2 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.035em;
  transition: font-size 0.32s var(--ease), opacity 0.32s var(--ease);
}
.gate-copy p, .gate-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.08rem;
  max-width: 34rem;
}
.gate-copy p + p { margin-top: 0.9rem; }
.gate-copy a { color: var(--copper); }
.gate-points {
  display: grid;
  gap: 0.55rem;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
}
.gate-points li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #cfc3b4;
  font-size: 0.92rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(8, 7, 6, 0.35);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.04);
}
.gate-points span {
  font-family: var(--serif);
  font-size: 0.78rem;
  color: var(--copper);
  letter-spacing: 0.08em;
}
.auth-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 232, 196, 0.07), transparent 28%),
    rgba(16, 13, 11, 0.82);
  border: 1px solid rgba(217, 161, 90, 0.16);
  border-radius: 22px;
  padding: 1.3rem 1.25rem 1.4rem;
  box-shadow:
    var(--shadow-deep),
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 0 48px rgba(217, 161, 90, 0.08),
    inset 0 1px 0 rgba(255, 236, 210, 0.1);
  backdrop-filter: blur(18px);
}
.auth-card-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  margin-bottom: 1.15rem;
  padding: 0.24rem;
  background: #080706;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}
.auth-tabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.6rem 0.4rem;
  font-weight: 600;
  border-radius: 10px;
}
.auth-tabs button.is-on {
  background: linear-gradient(180deg, #e3b26a, var(--copper));
  color: #1b1208;
  box-shadow: 0 8px 18px rgba(217, 161, 90, 0.22);
}
.auth-form { display: grid; gap: 0.8rem; }
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}
input, textarea, button {
  font: inherit;
  color: var(--text);
}
input, textarea {
  background: #0b0a08;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, textarea:focus {
  outline: none;
  border-color: rgba(217, 161, 90, 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(217, 161, 90, 0.12);
}
button {
  background: linear-gradient(180deg, #e3b26a, #c88c3f);
  color: #1b1208;
  border: 0;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(217, 161, 90, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease);
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: wait; transform: none; }
.error { color: var(--bad); margin: 0; font-size: 0.85rem; }

.studio {
  position: relative;
  z-index: 9;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) minmax(340px, 42%);
}
.studio.is-drawer {
  grid-template-columns: 62px 248px minmax(0, 1fr) minmax(300px, 38%);
}
.studio::before,
.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.studio > *,
.gate > * {
  position: relative;
  z-index: 1;
}
.who {
  margin-top: auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; padding: 1.7rem; gap: 1.8rem; }
}

.rail {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 0.45rem;
  background:
    linear-gradient(180deg, rgba(255, 232, 196, 0.03), transparent 20%),
    var(--well);
  box-shadow: inset -12px 0 24px rgba(0, 0, 0, 0.18);
}
.rail-nav {
  display: grid;
  gap: 0.4rem;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #e3b26a, var(--copper));
  color: #1b1208;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(217, 161, 90, 0.24);
}
.rail button {
  width: 36px;
  height: 36px;
  padding: 0;
  background: #14110e;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.06), 0 8px 16px rgba(0, 0, 0, 0.2);
}
.rail button:hover {
  border-color: rgba(217, 161, 90, 0.34);
  background: #1c1713;
}
.rail button.is-on {
  background: linear-gradient(180deg, #e3b26a, var(--copper));
  color: #1b1208;
  border-color: transparent;
}

.chat-pane {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  background:
    radial-gradient(680px 280px at 50% -10%, rgba(217, 161, 90, 0.07), transparent 50%),
    linear-gradient(180deg, #12100d 0%, #0b0a09 100%);
  box-shadow: var(--inset-well);
}
.chat-head {
  padding: 1.05rem 1.4rem 0.2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.studio.is-chatting .chat-head h2 { font-size: 1.08rem; }
.thread {
  overflow: auto;
  padding: 1rem 1.7rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-behavior: smooth;
}
.thread::-webkit-scrollbar { width: 8px; }
.thread::-webkit-scrollbar-thumb {
  background: rgba(243, 235, 225, 0.1);
  border-radius: 99px;
}
.thread-empty {
  margin: auto 0;
  max-width: 26rem;
  padding: 1.35rem 1.45rem 1.5rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 236, 210, 0.04), rgba(8, 7, 6, 0.18));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.06), 0 18px 40px rgba(0, 0, 0, 0.18);
}
.thread-empty-kicker {
  margin: 0 0 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--copper);
}
.thread-empty-title {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: 2rem;
  letter-spacing: -0.035em;
  color: var(--text);
}
.thread-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.bubble {
  max-width: 40rem;
  padding: 0.88rem 1.05rem;
  border-radius: 18px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.rise { animation: rise 0.42s var(--ease); }
.bubble.user {
  margin-left: auto;
  background:
    linear-gradient(180deg, rgba(217, 161, 90, 0.16), rgba(36, 28, 20, 0.92));
  border: 1px solid rgba(217, 161, 90, 0.2);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 232, 196, 0.1);
}
.bubble.assistant {
  background:
    linear-gradient(180deg, rgba(255, 236, 210, 0.04), rgba(16, 13, 11, 0.86));
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 236, 210, 0.05);
}
.bubble.meta {
  color: var(--muted);
  font-size: 0.9rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0.2rem 0.15rem;
}
.bubble.think {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  color: var(--muted);
  background: rgba(12, 10, 8, 0.7);
  border: 1px solid var(--line);
  padding: 0.48rem 0.8rem;
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.05);
}
.think-orb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 10px rgba(217, 161, 90, 0.55);
  animation: think-pulse 1.4s ease-out infinite;
}
.think-label { font-size: 0.88rem; }
.think-dots { display: flex; gap: 0.16rem; }
.think-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--copper);
  opacity: 0.3;
  animation: think-dot 1.1s infinite;
}
.think-dots i:nth-child(2) { animation-delay: 0.15s; }
.think-dots i:nth-child(3) { animation-delay: 0.3s; }
.bubble.think.is-done {
  opacity: 0.62;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding: 0.15rem 0.1rem;
}
.bubble.think.is-done .think-dots,
.bubble.think.is-done .think-orb { display: none; }
.stream-text.md { display: block; white-space: normal; }
.stream-text.md p { margin: 0 0 0.7rem; }
.stream-text.md p:last-child { margin-bottom: 0; }
.stream-text.md h1, .stream-text.md h2, .stream-text.md h3 {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-weight: 500;
}
.stream-text.md ul, .stream-text.md ol { margin: 0 0 0.7rem 1.1rem; }
.stream-text.md code {
  font-size: 0.86em;
  background: #100e0c;
  padding: 0.08rem 0.28rem;
  border-radius: 5px;
}
.stream-text.md pre {
  margin: 0.4rem 0 0.8rem;
  padding: 0.75rem 0.85rem;
  overflow: auto;
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: pre-wrap;
}
.stream-text.md pre code { padding: 0; background: none; }
.stream-text.md a { color: var(--copper); }
.caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--copper);
  animation: blink 0.9s steps(1) infinite;
}
.bubble.is-stream .caret { display: inline-block; }
.bubble.assistant:not(.is-stream) .caret { display: none; }

.composer {
  display: grid;
  gap: 0.45rem;
  margin: 0 1.25rem 1.2rem;
  padding: 0.8rem 0.85rem 0.7rem;
  border: 1px solid rgba(217, 161, 90, 0.2);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 236, 210, 0.07), rgba(16, 13, 11, 0.96));
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(217, 161, 90, 0.06),
    inset 0 1px 0 rgba(255, 236, 210, 0.12);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.composer textarea {
  resize: none;
  min-height: 56px;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.4rem 0.1rem;
  box-shadow: none;
}
.composer textarea:focus { box-shadow: none; }
.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.composer-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}
.composer #send {
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
}
.composer.is-live {
  border-color: rgba(217, 161, 90, 0.4);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.38),
    0 0 0 4px rgba(217, 161, 90, 0.1),
    inset 0 1px 0 rgba(255, 236, 210, 0.14);
}
.composer.is-live #send { animation: send-glow 1.2s ease-in-out infinite; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes think-pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 161, 90, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(217, 161, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 161, 90, 0); }
}
@keyframes think-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
@keyframes blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes send-glow {
  50% { filter: brightness(1.08); }
}
@keyframes flash {
  0% { opacity: 0.35; }
  100% { opacity: 1; }
}
.preview-frame.flash { animation: flash 0.55s ease; }
.gate-copy, .auth-card { animation: rise 0.55s var(--ease); }
.band { animation: rise 0.34s var(--ease); }
.auth-tabs button, .preview-tabs button, .rail button, .composer #send {
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), filter 0.18s var(--ease);
}

.preview-pane {
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(180deg, #100e0c, #0a0908);
  min-width: 0;
  padding: 0.8rem 0.8rem 0.85rem;
  gap: 0.7rem;
  box-shadow: inset 18px 0 40px rgba(0, 0, 0, 0.18);
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}
.preview-tabs {
  display: flex;
  gap: 0.2rem;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #080706;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}
.preview-tabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 0.4rem 0.75rem;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
}
.preview-tabs button:hover:not(.is-on) {
  color: var(--text);
  background: #1d1813;
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.06);
}
.preview-tabs button.is-on {
  color: #1b1208;
  background: linear-gradient(180deg, #e3b26a, var(--copper));
  box-shadow: 0 6px 14px rgba(217, 161, 90, 0.22);
}
.preview-bezel {
  min-height: 0;
  height: 100%;
  display: flex;
  padding: 0.5rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 232, 196, 0.16), transparent 22%),
    linear-gradient(180deg, #32281e, #0e0c0a);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 236, 210, 0.2),
    inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.preview-stage {
  flex: 1;
  height: 100%;
  min-height: 0;
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.preview-frame, .files-view {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.files-view {
  display: grid;
  grid-template-rows: auto 32% 1fr;
  background:
    linear-gradient(180deg, #181410, #100e0c);
  color: var(--text);
}
.files-view ul {
  margin: 0;
  padding: 0.8rem 1rem;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  list-style: none;
  background: #0c0b09;
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.18);
}
.files-view li { padding: 0.2rem 0; }
.files-view button.link {
  background: none;
  color: var(--copper);
  padding: 0;
  border: 0;
  box-shadow: none;
  font-weight: 500;
}
.files-view pre,
.files-view textarea {
  margin: 0;
  padding: 1rem;
  overflow: auto;
  font-size: 0.78rem;
  color: #e8dccb;
  font-family: var(--mono);
  border: 0;
  border-radius: 0;
  background: #0c0b09;
  resize: none;
  box-shadow: none;
}
.preview-status {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .studio.is-drawer { grid-template-columns: 52px minmax(0, 1fr) minmax(280px, 42%); }
  .studio.is-drawer .drawer {
    position: absolute;
    left: 62px;
    top: 0;
    bottom: 0;
    width: 248px;
    z-index: 4;
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.35);
  }
  .hud { grid-template-columns: 1fr 1fr; }
  .hud-cell:last-child { display: none; }
}

@media (max-width: 900px) {
  .studio, .studio.is-drawer { grid-template-columns: 52px 1fr; grid-template-rows: 1fr 46vh; }
  .preview-pane { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .hud { display: none; }
  .thread-list { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.drawer {
  min-width: 0;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 232, 196, 0.04), transparent 22%),
    #0c0b09;
  box-shadow: inset -16px 0 28px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
}
.drawer-head { padding: 1.05rem 1rem 0.4rem; }
.drawer-head h3 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
}
.drawer-body {
  overflow: auto;
  padding: 0.4rem 0.85rem 1rem;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}
.sys-card, .snap-card, .act-row {
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(16, 13, 11, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 236, 210, 0.05);
}
.act-row {
  display: grid;
  gap: 0.2rem;
}
.act-kind, .mono {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
}
.act-row p, .sys-card p, .snap-card p {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
}
.act-row time, .snap-card time, .muted {
  color: var(--muted);
  font-size: 0.72rem;
}
.meter {
  height: 6px;
  border-radius: 99px;
  background: #080706;
  overflow: hidden;
  margin-top: 0.35rem;
}
.meter > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8a6230, var(--copper));
}
.field-mini {
  display: grid;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.field-mini input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 0.86rem;
}
.thread-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 18rem;
}
.thread-list button {
  background: #14110e;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  box-shadow: none;
}
.thread-list button.is-on {
  background: linear-gradient(180deg, #e3b26a, var(--copper));
  color: #1b1208;
}
.mode-tabs {
  display: flex;
  gap: 0.2rem;
  width: fit-content;
  padding: 0.18rem;
  border-radius: 11px;
  background: #080706;
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}
.mode-tabs button {
  background: transparent;
  color: var(--muted);
  border: 0;
  box-shadow: none;
  padding: 0.32rem 0.7rem;
  border-radius: 8px;
  font-size: 0.75rem;
}
.mode-tabs button.is-on {
  background: linear-gradient(180deg, #e3b26a, var(--copper));
  color: #1b1208;
}
.files-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: #14110e;
}
.file-path {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--copper);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-chrome button {
  padding: 0.32rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 8px;
}
.console-view {
  height: 100%;
  overflow: auto;
  padding: 0.85rem 1rem;
  background: #0b0a08;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.65;
  color: #d8cbb8;
}
.console-view .c-kind {
  color: var(--copper);
  margin-right: 0.55rem;
}
.palette {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  background: rgba(6, 5, 4, 0.62);
  backdrop-filter: blur(10px);
}
.palette-card {
  width: min(36rem, calc(100vw - 2rem));
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(217, 161, 90, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 236, 210, 0.06), rgba(16, 13, 11, 0.96));
  box-shadow: var(--shadow-deep);
}
.palette-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.palette-card input {
  width: 100%;
  font-family: var(--mono);
}
.palette-card ul {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}
.palette-card li button {
  width: 100%;
  text-align: left;
  background: #100e0c;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 0.65rem 0.75rem;
}
.palette-card li button:hover,
.palette-card li button.is-on {
  border-color: rgba(217, 161, 90, 0.35);
  background: #1a1612;
}
.band.is-live #hud-run {
  color: var(--copper);
}
