﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --bg-page: #0f1412;
  --bg-canvas: #f8faf9;
  --surface-0: #ffffff;
  --surface-1: #f3f6f4;
  --surface-2: #e9efe9;
  --surface-border: #e2e8e3;
  --surface-border-strong: #cdd8d0;

  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-bg: #ecfdf5;
  --primary-text: #065f46;

  --text-main: #111817;
  --text-secondary: #4b5550;
  --text-muted: #6b7a72;
  --text-dim: #94a39b;

  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 28px -4px rgba(18, 38, 28, 0.08), 0 4px 12px -2px rgba(18, 38, 28, 0.03);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-canvas: #0b0f0d;
  --surface-0: #131916;
  --surface-1: #19221e;
  --surface-2: #212c26;
  --surface-border: #27342d;
  --surface-border-strong: #384b41;

  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-glow: rgba(16, 185, 129, 0.3);
  --primary-bg: #132b21;
  --primary-text: #6ee7b7;

  --text-main: #f0fdf4;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-canvas);
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.04) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; transition: var(--transition); }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: inherit; text-decoration: none; }

header {
  height: 72px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, 5vw);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

[data-theme="dark"] header {
  background: rgba(19, 25, 22, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: grid;
  place-items: center;
  height: 38px;
  width: 38px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  font-size: 20px;
}

.studio {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-1);
  color: var(--primary);
  border: 1px solid var(--surface-border);
  margin-left: 2px;
}

nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

nav a, nav button {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

nav a:hover, nav button:hover {
  color: var(--text-main);
  background: var(--surface-1);
}

nav .active {
  color: var(--primary-text);
  background: var(--primary-bg);
}

[data-theme="dark"] nav .active {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
}

nav span { font-size: 12px; opacity: 0.7; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface-0);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-1);
  color: var(--text-main);
  transform: scale(1.05);
}

.edition {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--surface-border);
  background: var(--surface-0);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.edition i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px var(--primary);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  flex: 1;
}

.hero {
  position: relative;
  padding: 56px 0 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.hero-content { max-width: 620px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--primary-text);
  background: var(--primary-bg);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.hero h1 {
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -1.8px;
  line-height: 1.15;
  margin: 0 0 18px;
  color: var(--text-main);
}

.hero h1 span {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 26px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.hero-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.hero-badge-item span.icon {
  color: var(--primary);
  font-weight: 700;
}

.cube-scene {
  position: relative;
  width: 260px;
  height: 240px;
  flex-shrink: 0;
}

.cube-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cube {
  position: absolute;
  top: 50px;
  left: 70px;
  width: 100px;
  height: 100px;
  transform: rotate(-10deg);
  animation: float-cube 6s ease-in-out infinite alternate;
}

@keyframes float-cube {
  0% { transform: rotate(-10deg) translateY(0px); }
  100% { transform: rotate(-8deg) translateY(-14px); }
}

.cube-front {
  position: absolute;
  width: 90px;
  height: 90px;
  top: 24px;
  left: 0;
  background: repeating-conic-gradient(#b0805c 0% 25%, #c59772 0% 50%) 0 0 / 22px 22px;
  border: 4px solid #8e6241;
  transform: skewY(24deg);
  box-shadow: inset 0 0 0 4px #cfab87, 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #faebd7;
}

.cube-front span:nth-child(2) {
  background: #73594b;
  border: 4px solid #e2cdb3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #34d399;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.cube-top {
  position: absolute;
  left: 0;
  top: -10px;
  width: 90px;
  height: 40px;
  transform: skewY(24deg) skewX(-48deg);
  transform-origin: bottom left;
  background: repeating-conic-gradient(#dec4a6 0% 25%, #e7d3b9 0% 50%) 0 0 / 22px 20px;
  border: 4px solid #c9a685;
}

.cube-side {
  position: absolute;
  left: 90px;
  top: 24px;
  height: 90px;
  width: 44px;
  transform: skewY(-43deg);
  transform-origin: top left;
  background: repeating-conic-gradient(#976e4e 0% 25%, #a67b57 0% 50%) 0 0 / 20px 22px;
  border: 4px solid #825838;
  color: #ddc1a0;
  display: grid;
  place-items: center;
  font-size: 34px;
}

.cube-shadow {
  position: absolute;
  top: 195px;
  left: 70px;
  width: 120px;
  height: 16px;
  background: rgba(0, 0, 0, 0.15);
  filter: blur(10px);
  border-radius: 50%;
}

[data-theme="dark"] .cube-shadow {
  background: rgba(0, 0, 0, 0.5);
  filter: blur(14px);
}

.spark {
  position: absolute;
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
  opacity: 0.7;
  animation: pulse-spark 3s ease-in-out infinite alternate;
}

.s1 { top: 20px; left: 50px; }
.s2 { right: 10px; bottom: 40px; font-size: 18px; animation-delay: 1.5s; }

@keyframes pulse-spark {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.3; }
  100% { transform: scale(1.2) rotate(45deg); opacity: 0.9; }
}

.workspace {
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 40px;
  scroll-margin-top: 90px;
}

.workspace-title {
  height: 64px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--surface-0);
}

.workspace-title > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.green-square {
  color: var(--primary);
  font-size: 22px;
  display: flex;
  align-items: center;
}

.badge {
  background: var(--primary-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-text);
  letter-spacing: 0.8px;
}

[data-theme="dark"] .badge { color: #34d399; }

.local-note {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.local-note i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.work-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
}

.settings {
  padding: 28px;
  border-right: 1px solid var(--surface-border);
  background: var(--surface-1);
  display: flex;
  flex-direction: column;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.step {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.settings-group { margin-top: 22px; }

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.help {
  color: var(--text-dim);
  cursor: help;
  font-size: 13px;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  padding: 0 12px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.select-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-wrap > span {
  color: var(--primary);
  font-size: 18px;
  margin-right: 8px;
  display: flex;
  align-items: center;
}

select {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 10px 4px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.field-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 7px 0 0;
}

.compat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
}

.compat-icon {
  background: var(--primary-bg);
  color: var(--primary);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.compat strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.compat p {
  font-size: 11px;
  margin: 3px 0 0;
  color: var(--text-muted);
  line-height: 1.4;
}

.divider {
  border-top: 1px solid var(--surface-border);
  margin: 22px 0;
}

.optional {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"], input:not([type]) {
  width: 100%;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  background: var(--surface-0);
  color: var(--text-main);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  outline: none;
}

input[type="text"]:focus, input:not([type]):focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder { color: var(--text-dim); }

.settings h4 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-row:hover { border-color: var(--surface-border-strong); }

.toggle-row > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.toggle-row small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

input[role="switch"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  background: var(--surface-2);
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  margin: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

input[role="switch"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[role="switch"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

input[role="switch"]:checked::before {
  transform: translateX(16px);
}

.sidebar-tip {
  display: flex;
  gap: 12px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(254, 243, 199, 0.4);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: auto;
}

[data-theme="dark"] .sidebar-tip {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.sidebar-tip-icon {
  color: #d97706;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-tip p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.sidebar-tip strong {
  display: block;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

[data-theme="dark"] .sidebar-tip strong { color: #fbbf24; }

.editor-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.editor-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--surface-border);
  background: var(--surface-0);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface-1);
  color: var(--text-main);
  border-color: var(--surface-border-strong);
}

.editor-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.editor {
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--surface-0);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.editor:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.editor-toolbar {
  height: 38px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.file-icon {
  color: var(--primary);
  margin-right: 6px;
}

.editor-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
}

.editor-body {
  height: 270px;
  display: flex;
  background: var(--surface-0);
  padding: 12px 0;
  overflow: hidden;
}

#line-numbers {
  width: 48px;
  flex-shrink: 0;
  color: var(--text-dim);
  text-align: right;
  padding-right: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 24px;
  white-space: pre;
  overflow: hidden;
  user-select: none;
  border-right: 1px solid var(--surface-border);
}

textarea#commands {
  border: 0;
  resize: none;
  background: transparent;
  width: 100%;
  height: 100%;
  padding: 0 16px;
  outline: none;
  white-space: pre;
  tab-size: 2;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 24px;
}

textarea#commands::placeholder { color: var(--text-dim); }

.editor-footer {
  height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  background: var(--surface-1);
  border-top: 1px solid var(--surface-border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.editor-footer i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 6px;
}

.footer-separator {
  margin: 0 8px;
  opacity: 0.4;
}

.editor-under {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.editor-under code {
  font-family: var(--font-mono);
  background: var(--surface-1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--surface-border);
  color: var(--primary-text);
}

.text-danger {
  color: var(--danger);
  font-weight: 600;
}

.text-danger:hover { text-decoration: underline; }

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  width: 100%;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.primary-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-btn > span {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.primary-btn:hover:not(:disabled) > span {
  transform: translateX(3px);
}

.keyboard-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

kbd {
  border: 1px solid var(--surface-border-strong);
  background: var(--surface-1);
  border-radius: 4px;
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.output-panel {
  border-top: 1px solid var(--surface-border);
  padding: 28px;
  background: var(--surface-1);
}

.output-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.output-status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ready {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-border);
  transition: var(--transition);
}

.ready.status-success {
  background: var(--success-bg);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.3);
}

.ready.status-warning {
  background: var(--warning-bg);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
}

.output-actions {
  display: flex;
  gap: 10px;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--surface-border);
  background: var(--surface-0);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-action:hover:not(:disabled) {
  border-color: var(--surface-border-strong);
  background: var(--surface-2);
}

.btn-action-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-action-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

pre#output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-0);
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-md);
  margin: 16px 0 12px;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-main);
  max-height: 170px;
  overflow-y: auto;
  min-height: 80px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

pre#output:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.output-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  gap: 16px;
  flex-wrap: wrap;
}

.output-bottom strong {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-left: 6px;
}

#message {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-text);
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: none;
  animation: fade-in 0.2s ease;
}

#message:not(:empty) {
  display: block;
}

#message.error {
  color: #991b1b;
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.25);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.how {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin: 48px 0 28px;
  scroll-margin-top: 80px;
}

.how-header {
  grid-column: 1 / -1;
  text-align: center;
  margin-bottom: 8px;
}

.how-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 0 0 8px;
}

.how-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.how article {
  display: flex;
  flex-direction: column;
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.how article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--surface-border-strong);
}

.how-icon-box {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 20px;
  margin-bottom: 18px;
}

.how h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-num {
  font-size: 11px;
  color: var(--primary);
  font-family: var(--font-mono);
  background: var(--primary-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.how article p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.inline-copy {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 12px;
  margin-top: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.inline-copy:hover {
  background: var(--surface-2);
  border-color: var(--primary);
}

.inline-copy span {
  color: var(--primary);
  font-weight: 700;
}

.world-note {
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  margin: 28px auto 44px;
  color: var(--text-muted);
  max-width: 900px;
  background: var(--surface-0);
  border: 1px solid var(--surface-border);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

footer {
  border-top: 1px solid var(--surface-border);
  background: var(--surface-0);
  padding: 28px max(24px, 5vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  gap: 16px;
}

footer .brand {
  font-size: 15px;
  color: var(--text-secondary);
}

.small {
  height: 26px;
  width: 26px;
  font-size: 14px;
  border-radius: 6px;
}

dialog#version-dialog {
  max-width: 600px;
  width: calc(100% - 32px);
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: var(--text-main);
  background: var(--surface-0);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background: rgba(15, 23, 19, 0.6);
  backdrop-filter: blur(6px);
}

dialog h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 12px 0 16px;
}

dialog p, dialog dd {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}

dialog dl {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

dialog dt {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-text);
}

dialog dd {
  margin: 4px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--surface-border);
}

dialog a {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 12px;
}

dialog a:hover {
  text-decoration: underline;
}

.dialog-close {
  float: right;
  border: 0;
  background: var(--surface-1);
  border-radius: 50%;
  height: 32px;
  width: 32px;
  color: var(--text-secondary);
  font-size: 20px;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.dialog-close:hover {
  background: var(--surface-2);
  color: var(--text-main);
}

@media (max-width: 960px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
  .settings {
    border-right: 0;
    border-bottom: 1px solid var(--surface-border);
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .cube-scene {
    align-self: center;
  }
  .how {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  header {
    height: 64px;
    padding: 0 16px;
  }
  .brand { font-size: 17px; }
  .studio { display: none; }
  .edition { display: none; }
  nav { display: none; }
  main { padding: 0 16px; }
  .hero { padding: 36px 0 24px; }
  .hero h1 { font-size: 34px; }
  .workspace-title { padding: 0 16px; }
  .settings, .editor-panel, .output-panel { padding: 20px 16px; }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 24px 16px;
  }
}
