:root {
  color-scheme: dark;
  --bg: #101315;
  --panel: #171d21;
  --panel-2: #20282e;
  --panel-3: #29323a;
  --line: #39454f;
  --line-soft: #2b353d;
  --text: #f4f7f8;
  --muted: #a6b0b8;
  --soft: #d6dde3;
  --paper: #fbfbf9;
  --ink: #111517;
  --blue: #3858f5;
  --blue-2: #0c7eb8;
  --green: #27c686;
  --yellow: #ffd34f;
  --red: #ff766f;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(56, 88, 245, 0.14), transparent 32rem),
    linear-gradient(180deg, #151a1e 0, var(--bg) 42rem);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #212a31;
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: #607282;
  background: #27323a;
}

button.primary,
.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11171b;
  color: var(--text);
  padding: 0 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.16;
}

h2 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

.app-shell {
  display: grid;
  gap: 14px;
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px;
}

.phone-stage {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: calc(100vh - 20px);
  padding: 10px 10px 84px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 23, 27, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar,
.brand-lockup,
.status-strip,
.path-row,
.quick-actions,
.stack-heading,
.launch-grid,
.panel-heading,
.warning-row,
.segmented,
.progress-row,
.saved-list article,
.export-strip,
.site-manager-bar,
.manager-tabs,
.file-actions,
.filter-row,
.preview-toolbar,
.wp-admin-preview {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 2px;
}

.brand-lockup {
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark,
.site-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid #edf2f5;
  border-radius: 50%;
  color: #edf2f5;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #8fd2ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-weight: 700;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.status-strip {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #11181d;
}

.status-strip div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  min-width: 0;
}

.status-strip span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  align-self: center;
  border-radius: 999px;
  background: var(--yellow);
}

.status-dot.saved {
  background: var(--green);
}

.path-card,
.lesson-card,
.next-stack,
.panel,
.settings-card,
.save-card,
.database-card,
.logs-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.path-card {
  padding: 10px;
}

.path-row {
  align-items: end;
  gap: 8px;
}

.path-input {
  flex: 1;
}

.quick-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.quick-actions button,
.export-strip button,
.file-actions button {
  padding: 0 10px;
  font-size: 13px;
}

.hero-deck {
  display: grid;
  gap: 10px;
}

.lesson-card,
.next-stack {
  padding: 13px;
}

.lesson-card h2 {
  max-width: 22rem;
}

.browser-mini {
  margin-top: 14px;
  border: 1px solid #d9dee3;
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

.admin-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  background: #1d2327;
  color: #edf2f5;
  font-size: 11px;
}

.site-mini {
  display: grid;
  gap: 9px;
  padding: 16px;
}

.site-mini span {
  width: fit-content;
  background: #fee88a;
}

.site-mini button {
  border-color: #3858f5;
  background: #3858f5;
  color: #fff;
}

.stack-heading {
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stack-heading span {
  color: var(--muted);
  font-size: 12px;
}

.launch-grid {
  flex-wrap: wrap;
  gap: 8px;
}

.launch-grid button {
  flex: 1 1 30%;
  min-width: 92px;
  padding: 0 10px;
  font-size: 13px;
}

.task-detail {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid #3d4b55;
  border-radius: var(--radius);
  background: #11181d;
}

.task-detail p:last-of-type {
  margin-bottom: 12px;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 620px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 19, 21, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.nav-item {
  min-height: 42px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.nav-item.active {
  background: #25315e;
  color: #fff;
}

.panel-stack {
  display: grid;
  gap: 10px;
}

.panel {
  display: none;
  padding: 13px;
}

.panel.active {
  display: block;
}

.dense-list {
  display: grid;
  gap: 9px;
}

.dense-list article {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #11181d;
}

.dense-list span,
.saved-list span,
.logs-grid span,
.count-line {
  color: var(--muted);
  font-size: 13px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.settings-card,
.save-card,
.database-card {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 13px;
}

.setting-grid {
  display: grid;
  gap: 10px;
}

.check {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--soft);
}

.check input {
  width: auto;
  min-height: auto;
}

.warning-row {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  gap: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11181d;
}

.segmented button {
  flex: 1;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
}

.segmented button.active {
  background: #2a3640;
}

.progress-row {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #2a333b;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.saved-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.saved-list article {
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #11181d;
}

.saved-list article div {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 9rem;
}

.saved-list .selected {
  border-color: var(--blue);
  background: #172144;
}

.site-icon {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.export-strip {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.site-manager-bar {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manager-tabs,
.filter-row {
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.manager-tabs button,
.filter-row button {
  flex: 0 0 auto;
  padding: 0 12px;
}

.manager-tabs button.active,
.filter-row button.active {
  border-color: var(--blue);
  background: var(--blue);
}

.tool-panel {
  display: none;
  margin-top: 10px;
}

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

.file-actions {
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.code-split {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tree-view {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: #10161a;
  border-bottom: 1px solid var(--line);
}

.tree-view span {
  padding: 7px 8px;
  border-radius: 5px;
  color: var(--soft);
  font-size: 13px;
}

.tree-view span.active {
  background: #25315e;
}

pre {
  min-height: 220px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  background: #0a0f12;
  color: #dbe8ee;
  font: 13px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.notice {
  margin-bottom: 12px;
  padding: 10px;
  border-left: 3px solid var(--blue-2);
  background: #111b22;
  color: var(--soft);
  font-size: 13px;
}

.database-card dl {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) 1.2fr;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

.database-card dt {
  color: var(--muted);
  font-weight: 700;
}

.database-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.logs-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.logs-grid article {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.search-field {
  margin: 10px 0;
}

.blueprint-grid {
  display: grid;
  gap: 10px;
}

.blueprint-grid article {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #11181d;
}

.thumb {
  display: grid;
  place-items: end start;
  min-height: 96px;
  padding: 10px;
  border-radius: 6px;
  color: #fff;
  font-weight: 800;
}

.thumb.art {
  background: linear-gradient(135deg, #21635d, #c7944b);
}

.thumb.coffee {
  background: linear-gradient(135deg, #4a2269, #d28b42);
}

.thumb.feed {
  background: linear-gradient(135deg, #e9edf5, #5573dc);
  color: #263141;
}

.thumb.game {
  background: linear-gradient(135deg, #111, #d94c35);
}

.thumb.nonprofit {
  background: linear-gradient(135deg, #4b2b13, #df7b5b);
}

.thumb.blog {
  background: linear-gradient(135deg, #63163a, #9b6d8c);
}

.thumb.blocks {
  background: linear-gradient(135deg, #17324d, #0c7eb8);
}

.desktop-preview {
  display: none;
  min-height: calc(100vh - 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

.preview-toolbar {
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: #1d2327;
  color: #edf2f5;
}

.preview-toolbar button {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.preview-toolbar span {
  flex: 1;
  padding: 7px 12px;
  border-radius: 7px;
  background: #39434d;
  color: #cbd4dc;
}

.preview-toolbar strong {
  color: #8ef0bf;
  font-size: 13px;
}

.wp-admin-preview {
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #252b2f;
  color: #eef2f3;
  font-size: 12px;
}

.wp-site-preview {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
  align-items: center;
  gap: 20px;
  min-height: calc(100% - 88px);
  padding: 48px 28px;
}

.wp-site-preview h2 {
  color: #151515;
  font-family: Georgia, serif;
  font-size: clamp(36px, 5vw, 68px);
  font-weight: 400;
}

.wp-site-preview h2 span {
  color: #3858f5;
}

.wp-site-preview p {
  color: #111;
  font-size: 18px;
}

.wp-site-preview mark {
  display: inline;
  background: #fee88a;
}

.wp-site-preview button {
  display: block;
  width: min(380px, 100%);
  margin-top: 24px;
  border-color: #3858f5;
  background: #3858f5;
  color: #fff;
}

.wp-orbit {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: clamp(18px, 3vw, 42px) solid #2fe577;
  border-radius: 50%;
  color: #1d1d1d;
  font-family: Georgia, serif;
  font-size: clamp(120px, 16vw, 260px);
  font-weight: 800;
}

@media (min-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .phone-stage {
    max-width: 640px;
    margin: 0 auto;
  }

  .hero-deck,
  .setting-grid,
  .blueprint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-split {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .tree-view {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .logs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .app-shell {
    grid-template-columns: minmax(390px, 620px) minmax(0, 1fr);
    align-items: start;
  }

  .phone-stage {
    position: sticky;
    top: 14px;
    max-width: none;
    height: calc(100vh - 28px);
    overflow-y: auto;
    padding-bottom: 94px;
  }

  .desktop-preview {
    display: block;
  }

  .bottom-nav {
    position: sticky;
    right: auto;
    bottom: 0;
    left: auto;
    order: 2;
    width: 100%;
    max-width: none;
    margin-top: 4px;
  }

  .panel-stack {
    order: 3;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding: 0;
  }

  .phone-stage {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .inline-form,
  .warning-row,
  .database-card dl {
    grid-template-columns: 1fr;
  }

  .saved-list article {
    grid-template-columns: auto 1fr;
  }

  .saved-list article button {
    grid-column: span 2;
  }

  .launch-grid button {
    flex-basis: 44%;
  }
}
