:root {
  --panel:   #141b22;
  --panel-2: #10161c;
  --accent:  #e0b45c;
  --accent-2: #7bd8d6;
  --text:    #f2f5f7;
  --muted:   #9aa7b2;
  --border:  rgba(224, 180, 92, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background-color: #0a1118;
  background-image:
    radial-gradient(circle, rgba(224, 180, 92, 0.18) 1.5px, transparent 1.5px),
    radial-gradient(900px 500px at 10% 10%, rgba(123, 216, 214, 0.12), transparent 60%),
    radial-gradient(700px 400px at 90% 20%, rgba(224, 180, 92, 0.14), transparent 55%),
    linear-gradient(180deg, #0b0f14 0%, #0a1118 100%);
  background-size: 24px 24px, auto, auto, auto;
  color: var(--text);
  min-height: 100vh;
  padding: 32px 20px 48px;
}

/* ── Page shell ──────────────────────────────────────────── */
.shell {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  font-family: "Silkscreen", sans-serif;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.02em;
}

.lede {
  font-family: "Space Grotesk", sans-serif;
  color: var(--muted);
  margin-top: 6px;
}

/* ── GitHub corner ───────────────────────────────────────── */
.github-corner {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  z-index: 1000;
  opacity: 0.66;
  transition: opacity 0.15s ease;
}

.github-corner:hover { opacity: 1; }

.github-corner img {
  width: 40px;
  height: 40px;
  filter: invert(1);
}

/* ── Connect button ──────────────────────────────────────── */
.connect-status-btn {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #1d1405;
  border: none;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(224, 180, 92, 0.25);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.connect-status-btn:hover {
  box-shadow: 0 12px 24px rgba(224, 180, 92, 0.4);
}

.connect-status-btn.is-connected {
  background: rgba(62, 207, 106, 0.12);
  color: #3ecf6a;
  border: 1px solid rgba(62, 207, 106, 0.3);
  box-shadow: none;
}

.connect-status-btn.is-connected:hover {
  background: rgba(62, 207, 106, 0.22);
  border-color: rgba(62, 207, 106, 0.55);
  transform: none;
  box-shadow: none;
}

/* ── Panel ───────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.apply-btn {
  background: #3ecf6a;
  color: #041a0d;
  box-shadow: 0 10px 20px rgba(62, 207, 106, 0.25);
}

.apply-btn:hover:not(:disabled) {
  background: #4eda78;
  box-shadow: 0 12px 24px rgba(62, 207, 106, 0.4);
}

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.layout.locked {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pin-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pin-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.pin-label input[type="number"] {
  width: 52px;
  padding: 4px 6px;
  background: rgba(16, 22, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-align: center;
  -moz-appearance: textfield;
}

.pin-label input[type="number"]::-webkit-inner-spin-button,
.pin-label input[type="number"]::-webkit-outer-spin-button {
  display: none;
}

/* ── Mode tabs ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  background: rgba(16, 22, 28, 0.7);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab {
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab.active {
  background: rgba(224, 180, 92, 0.18);
  color: var(--accent);
  border: 1px solid rgba(224, 180, 92, 0.4);
}

.tab.tab-add {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(154, 167, 178, 0.35);
  box-shadow: none;
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px 13px;
}

.tab.tab-add:hover {
  background: rgba(154, 167, 178, 0.08);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.tab.tab-add:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.tab .tab-name {
  display: inline-block;
}

.tab-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit;
  font-size: 0.85rem;
  margin-left: 6px;
  padding: 0 !important;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.tab-icon:hover { background: transparent !important; }
.tab-icon:focus { background: transparent !important; outline: none; box-shadow: none; }
.tab-delete { color: #ff8b8b; }
.tab-edit { color: var(--accent); }

.mode-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
}

/* ── LED controls ────────────────────────────────────────── */
.mode-color-label,
.brightness-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  user-select: none;
}

.mode-color-label { cursor: pointer; }

#ledBrightnessSlider {
  width: 72px;
  cursor: pointer;
}

#ledBrightnessValue {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: var(--text);
  min-width: 30px;
}

/* ── Hue picker dropdown ─────────────────────────────────── */
.hue-picker-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.hue-swatch {
  width: 44px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #ff0040;
  cursor: pointer;
  padding: 3px;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.hue-swatch:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: none;
  box-shadow: none;
}

.hue-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  align-items: center;
}

.hue-dropdown.open { display: flex; }

#modeColorPicker {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
}

#modeColorPicker::-webkit-slider-runnable-track,
#modeColorPicker::-moz-range-track {
  height: 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(to right,
    hsl(0,100%,50%), hsl(30,100%,50%), hsl(60,100%,50%),
    hsl(90,100%,50%), hsl(120,100%,50%), hsl(150,100%,50%),
    hsl(180,100%,50%), hsl(210,100%,50%), hsl(240,100%,50%),
    hsl(270,100%,50%), hsl(300,100%,50%), hsl(330,100%,50%),
    hsl(360,100%,50%));
}

#modeColorPicker::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--thumb-color, #ff0040);
  border: 2px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  margin-top: -2px;
}

#modeColorPicker::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--thumb-color, #ff0040);
  border: 2px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ── Remote panel ────────────────────────────────────────── */
.remote-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0;
}

.remote-tabbar {
  display: flex;
  align-items: flex-end;
}

.remote-tabs {
  display: flex;
  gap: 2px;
}

.layout-tab {
  padding: 7px 16px;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-color: rgba(255, 255, 255, 0.05);
  background: rgba(10, 15, 20, 0.45);
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  margin-bottom: -1px;
  z-index: 1;
}

.layout-tab.active {
  background: var(--panel-2);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.07);
  border-bottom-color: var(--panel-2);
}

.layout-tab:hover:not(.active) {
  background: rgba(10, 15, 20, 0.7);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.layout-tab-add {
  border-style: dashed;
  border-color: rgba(154, 167, 178, 0.35);
  color: var(--muted);
  padding: 7px 13px;
}

.layout-tab-add:hover {
  background: rgba(154, 167, 178, 0.08);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

/* ── Edit header ─────────────────────────────────────────── */
.remote-edit-header {
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
  border-radius: 0 20px 0 0;
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.layout-edit-btn,
.combo-capture-btn {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.combo-capture-btn {
  flex-shrink: 0;
}

.combo-capture-btn.capturing {
  color: var(--accent);
  border-color: rgba(224, 180, 92, 0.5);
}

/* ── New layout form ─────────────────────────────────────── */
.new-layout-form {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: rgba(10, 15, 20, 0.5);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  margin-top: 4px;
  margin-bottom: 4px;
}

.new-layout-form.visible { display: flex; }

.new-layout-form input {
  background: rgba(10, 15, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

.new-layout-form input[type="text"] { min-width: 180px; }

/* ── Content grid ────────────────────────────────────────── */
.content {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 18px;
}

/* ── Remote grid ─────────────────────────────────────────── */
.remote {
  background: var(--panel-2);
  border-radius: 0 0 20px 20px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  display: grid;
  grid-template-columns: repeat(var(--layout-cols, 5), minmax(0, 1fr));
  grid-auto-rows: minmax(64px, auto);
  gap: 10px;
  position: relative;
  z-index: 0;
}

.slot {
  background: rgba(10, 15, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  min-height: 64px;
  padding: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(224, 180, 92, 0.28);
  transition: transform 0.15s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.slot small {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.slot.active {
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.slot.dragging { opacity: 0.35; }

.slot.drag-over {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(123, 216, 214, 0.3);
}

/* ── Slot edit mode ──────────────────────────────────────── */
.slot-editing {
  position: relative;
  cursor: grab;
  padding-top: 22px;
}

.slot-editing:active { cursor: grabbing; }

.slot-drag-handle {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
  user-select: none;
}

.slot-label {
  font-size: inherit;
  font-weight: 600;
}

.slot-remove {
  position: absolute;
  top: 3px;
  right: 5px;
  background: rgba(255, 70, 70, 0.2);
  border: 1px solid rgba(255, 70, 70, 0.35);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 13px;
  line-height: 1;
  color: #ff7070;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  user-select: none;
}

.slot-remove:hover { background: rgba(255, 70, 70, 0.45); }

/* ── Drop cell ───────────────────────────────────────────── */
.drop-cell {
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-cell.drag-over {
  border-color: var(--accent-2);
  background: rgba(123, 216, 214, 0.08);
}

/* ── Layout edit bar ─────────────────────────────────────── */
.layout-edit-bar {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.layout-edit-hint {
  flex: 1;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Detail column ───────────────────────────────────────── */
.detail-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.led-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.detail {
  background: rgba(16, 22, 28, 0.8);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-header h2 { font-size: 1.1rem; }

.detail-header .btn-danger {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.detail label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail input,
.detail select {
  background: rgba(10, 15, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
}

/* ── Inline input + action button ────────────────────────── */
.input-action-group {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(10, 15, 20, 0.85);
}

.input-action-group input {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  min-width: 0;
}

.input-action-btn {
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: none;
}

.input-action-btn:hover:not(:disabled) {
  background: rgba(224, 180, 92, 0.12);
  color: var(--accent);
  transform: none;
  box-shadow: none;
}

.input-action-btn.listening {
  color: var(--accent);
  border-left-color: rgba(224, 180, 92, 0.4);
  animation: learn-pulse 1.1s ease-in-out infinite;
}

@keyframes learn-pulse {
  0%, 100% { background: rgba(224, 180, 92, 0.08); }
  50%       { background: rgba(224, 180, 92, 0.24); }
}

/* ── Inline rename input ─────────────────────────────────── */
.tab-rename-input {
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  font-size: inherit;
  font-weight: 600;
  width: 80px;
  padding: 0;
  outline: none;
}

/* ── Combo key editor ────────────────────────────────────── */
.combo-editor {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.combo-mod-bar {
  display: flex;
  gap: 4px;
}

.combo-mod-toggle {
  padding: 3px 9px;
  font-size: 0.75rem;
  border-radius: 6px;
  box-shadow: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.combo-mod-toggle:hover {
  transform: none;
  box-shadow: none;
}

.combo-mod-toggle.active {
  background: rgba(224, 180, 92, 0.18);
  color: var(--accent);
  border-color: rgba(224, 180, 92, 0.5);
}

.combo-step-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 28px;
}

.combo-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 15, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.combo-step-text { border-color: rgba(123, 216, 214, 0.3); }

.combo-mod {
  background: rgba(224, 180, 92, 0.15);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.73rem;
  font-weight: 600;
}

.combo-key-label { color: var(--text); }

.combo-text-value {
  color: var(--accent-2);
  font-style: italic;
}

.combo-arrow {
  color: var(--muted);
  font-size: 0.8rem;
  user-select: none;
}

.combo-step-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0 2px;
  font-size: 0.95rem;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  min-width: unset;
}

.combo-step-remove:hover {
  color: #ff7070;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.combo-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.combo-text-input {
  display: none;
  background: rgba(10, 15, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  min-width: 120px;
  flex: 1;
  outline: none;
}

.combo-text-input.active {
  display: block;
  border-color: rgba(123, 216, 214, 0.4);
}

/* ── Buttons (base) ──────────────────────────────────────── */
button {
  font-family: "Space Grotesk", sans-serif;
  background: var(--accent);
  color: #1d1405;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(224, 180, 92, 0.2);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(224, 180, 92, 0.32);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(242, 245, 247, 0.2);
  box-shadow: none;
}

button.btn-danger {
  background: transparent;
  color: #ff6060;
  border: 1px solid rgba(255, 80, 80, 0.4);
  box-shadow: none;
}

button.btn-danger:hover:not(:disabled) {
  background: rgba(255, 80, 80, 0.08);
  border-color: rgba(255, 80, 80, 0.65);
  box-shadow: none;
  transform: none;
}

/* ── JSON editor ─────────────────────────────────────────── */
#jsonPanel { display: none; }

#jsonPanel.visible {
  display: grid;
  margin-top: 18px;
}

.editor-wrap {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 16px;
}

textarea {
  width: 100%;
  min-height: 420px;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 16px;
  padding: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.notes {
  background: rgba(16, 22, 28, 0.8);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes h2 { font-size: 1.1rem; }
.notes p  { color: var(--muted); }

.notes ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes li {
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.notes span {
  display: inline-block;
  background: rgba(224, 180, 92, 0.14);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 600;
}

.panel-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.hint {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(154, 167, 178, 0.3);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Console log ─────────────────────────────────────────── */
.log-section {
  background: rgba(10, 15, 20, 0.8);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.log-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: none;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.log-toggle:hover {
  transform: none;
  box-shadow: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.log-toggle .chevron {
  font-size: 0.7rem;
  color: var(--muted);
}

.log {
  max-height: 200px;
  overflow-y: auto;
  padding: 0 16px 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
  display: none;
  flex-direction: column;
  gap: 3px;
}

.log.visible { display: flex; }

@media (max-width: 900px) {
  .editor-wrap,
  .content {
    grid-template-columns: 1fr;
  }
}
