
:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2ff;
  --text: #172033;
  --muted: #5d687b;
  --border: #d9dfeb;
  --primary: #5b4bdb;
  --primary-2: #7c6df2;
  --success: #0f9f6e;
  --error: #d43c52;
  --shadow: 0 18px 45px rgba(35, 47, 74, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px clamp(20px, 5vw, 70px);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 35%),
    linear-gradient(135deg, #3327a8, #6e52e5 58%, #9872ef);
  color: white;
}

.eyebrow,
.app-number {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: 1.05rem;
  line-height: 1.65;
  opacity: 0.92;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5ef0b6;
  box-shadow: 0 0 0 5px rgba(94, 240, 182, 0.14);
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px;
  gap: 28px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.nav-button span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--primary);
  font-weight: 800;
}

.nav-button:hover,
.nav-button.active {
  background: var(--surface-2);
  color: var(--primary);
}

.workspace {
  min-width: 0;
}

.status-card,
.app-panel,
.notes {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 35%);
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.status-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 180ms ease;
}

.app-panel {
  display: none;
  padding: clamp(20px, 4vw, 38px);
}

.app-panel.active {
  display: block;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.panel-heading p:not(.app-number) {
  margin: 8px 0 0;
  color: var(--muted);
}

.panel-heading code {
  max-width: 44%;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--primary);
  overflow-wrap: anywhere;
}

label {
  display: block;
  margin: 15px 0 7px;
  font-weight: 760;
}

textarea,
input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

textarea:focus,
input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(91, 75, 219, 0.12);
}

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

.run-button {
  margin-top: 18px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(91, 75, 219, 0.24);
}

.run-button:hover {
  transform: translateY(-1px);
}

.run-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.output {
  min-height: 130px;
  margin: 22px 0 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #101725;
  color: #eaf0ff;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.preview {
  display: block;
  max-width: min(560px, 100%);
  max-height: 360px;
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.hidden {
  display: none;
}

.notes {
  margin-top: 20px;
  padding: 24px 30px;
}

.notes h2 {
  margin-top: 0;
}

.notes li {
  margin: 8px 0;
  color: var(--muted);
}

footer {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.status-error #status-title {
  color: var(--error);
}

.status-success #status-title {
  color: var(--success);
}

@media (max-width: 900px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-card,
  .panel-heading {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .panel-heading code {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .sidebar,
  .control-row {
    grid-template-columns: 1fr;
  }

  .status-card {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1018;
    --surface: #121925;
    --surface-2: #1d2540;
    --text: #eef2ff;
    --muted: #aeb7cc;
    --border: #2b3549;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  }

  .output {
    background: #080c13;
  }
}
