:root {
  --bg: #171d22;
  --bg-2: #202830;
  --bg-3: #2a333d;
  --card: #f7f8f5;
  --card-2: #ffffff;
  --ink: #182027;
  --muted: #6e7681;
  --muted-dark: #aeb8c2;
  --line: #d7ddd7;
  --line-dark: #3b4652;
  --blue: #3858e9;
  --cyan: #0f8ea8;
  --green: #16865f;
  --amber: #bf7b22;
  --red: #b42318;
  --yellow: #f7d154;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: #eef3f7;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 220px),
    var(--bg);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.diagnostic-top {
  min-height: 64px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: #12171c;
  border-bottom: 1px solid var(--line-dark);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand-orbit,
.wp-icon,
.wp-large {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-weight: 800;
  font-family: Georgia, serif;
}

.brand-orbit {
  width: 36px;
  height: 36px;
  color: #86a0ff;
  box-shadow: inset 0 0 0 5px rgba(56, 88, 233, .14);
}

.brand small,
.eyebrow,
small {
  color: var(--muted-dark);
}

.brand strong,
.brand small {
  display: block;
}

.workspace-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.workspace-tab,
.manager-tab,
.filter-pills button {
  border: 1px solid var(--line-dark);
  color: #dce5ec;
  background: var(--bg-2);
  border-radius: 6px;
  min-height: 34px;
  padding: 7px 12px;
  white-space: nowrap;
}

.workspace-tab.active,
.manager-tab.active,
.filter-pills button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.top-actions,
.stage-actions,
.button-cluster,
.browser-status,
.card-title-row,
.pane-toolbar,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  justify-content: end;
}

.saved-state {
  color: #8df0ba;
  font-weight: 700;
  white-space: nowrap;
}

.saved-state.unsaved {
  color: var(--yellow);
}

.button,
.icon-button,
.source-grid button,
.task-list button,
.blueprint-mini-grid button {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  border-radius: 6px;
  min-height: 36px;
  padding: 8px 12px;
}

.button:hover,
.icon-button:hover,
.source-grid button:hover,
.blueprint-mini-grid button:hover {
  border-color: #9fa8b2;
}

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

.button.subtle {
  color: #dbe3ea;
  border-color: var(--line-dark);
  background: var(--bg-2);
}

.button.danger,
.danger {
  border-color: #efb7b2;
  color: var(--red);
}

.icon-button {
  min-width: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.diagnostic-top .icon-button {
  color: #e9edf2;
  border-color: var(--line-dark);
  background: var(--bg-2);
}

.browser-strip {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #192127;
  border-bottom: 1px solid var(--line-dark);
}

.address-field,
.search-field,
label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.address-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted-dark);
}

input,
select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  min-width: 0;
}

.address-field input {
  color: #eef3f7;
  border-color: var(--line-dark);
  background: #313b45;
}

.browser-status {
  justify-content: end;
  color: var(--muted-dark);
  flex-wrap: wrap;
}

.browser-status span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}

main {
  flex: 1;
}

.workspace-panel {
  display: none;
}

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

.first-viewport {
  min-height: calc(100vh - 113px);
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.checklist-rail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.progress-card,
.manager-summary {
  border: 1px solid var(--line-dark);
  background: #1f2830;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.progress-card strong {
  display: block;
  margin: 4px 0 10px;
  font-size: 22px;
}

.progress-card p,
.manager-summary p {
  color: var(--muted-dark);
  margin: 10px 0 0;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.light-card .meter,
.save-panel .meter {
  background: #e3e8ee;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.task-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list button {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  text-align: left;
  color: #eaf0f5;
  border-color: var(--line-dark);
  background: #222c35;
}

.task-list button > span {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid #718091;
}

.task-list strong,
.task-list small {
  display: block;
}

.task-list small {
  margin-top: 2px;
}

.task-list .done button > span {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 4px #222c35;
}

.task-list .active button {
  border-color: var(--blue);
  background: #26324a;
}

.task-list .active button > span {
  border-color: var(--blue);
  background: #fff;
  box-shadow: inset 0 0 0 5px var(--blue);
}

.primary-stage {
  display: grid;
  grid-template-rows: auto auto minmax(250px, 1fr);
  gap: 14px;
  min-width: 0;
}

.stage-header,
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.stage-header h1,
.page-heading h1,
.save-panel h1,
.manager-summary h1 {
  margin: 2px 0 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.stage-header h1 {
  font-size: clamp(28px, 4vw, 48px);
}

.eyebrow {
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr);
  gap: 14px;
  min-width: 0;
}

.light-card {
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  min-width: 0;
}

.light-card h1,
.light-card h2,
.light-card p,
.light-card dl,
.light-card fieldset {
  margin-top: 0;
}

.card-title-row {
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.card-title-row h2,
.launch-stack h2 {
  margin: 2px 0 0;
}

.blueprint-author-card {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr);
}

.code-surface {
  margin: 0;
  padding: 14px;
  overflow: auto;
  min-height: 210px;
  color: #e9f3ff;
  background: #111923;
  border-radius: 7px;
  border: 1px solid #2f3d4d;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.source-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-grid article,
.source-grid button,
.saved-list article,
.logs-grid article,
.blueprint-card {
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 7px;
}

.source-grid button {
  min-height: 58px;
  text-align: left;
  font-weight: 700;
}

.source-grid article {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.source-grid article p,
.github-card p,
.blueprint-card p {
  color: var(--muted);
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.mini-save {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mini-save strong,
.mini-save small {
  display: block;
}

.preview-band {
  overflow: hidden;
  color: var(--ink);
  background: var(--card-2);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.wp-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 7px 10px;
  color: #d7dee6;
  background: #20262d;
}

.wp-chrome span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #111923;
  font-family: Georgia, serif;
}

.wp-chrome small:last-child {
  margin-left: auto;
}

.wp-preview {
  min-height: 286px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: center;
  padding: 26px;
  overflow: hidden;
}

.wp-preview nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 42px;
}

.wp-preview h2 {
  max-width: 520px;
  margin: 0 0 14px;
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.18;
}

.wp-preview h2 em {
  color: var(--blue);
  font-style: normal;
}

.wp-preview p {
  max-width: 520px;
  font-size: 18px;
  margin: 0 0 12px;
}

.wp-preview mark {
  background: #fff1a8;
}

.hero-button {
  display: block;
  width: min(420px, 100%);
  margin-top: 18px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 3px;
  min-height: 46px;
  font-weight: 700;
}

.wp-symbol {
  width: 310px;
  height: 310px;
  display: grid;
  place-items: center;
  color: #1f1f1f;
  border: 18px solid #25d86f;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 168px;
  font-weight: 800;
  transform: translateX(36px);
}

.tab-page {
  padding: 28px;
  display: grid;
  gap: 18px;
}

.page-heading {
  color: #f5f8fb;
}

.page-heading h1 {
  max-width: 760px;
  font-size: clamp(26px, 3.5vw, 42px);
}

.start-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .95fr);
  gap: 18px;
}

.start-layout .github-card {
  grid-column: 2;
}

.featured-row {
  display: grid;
  gap: 14px;
}

.blueprint-mini-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.blueprint-mini-grid button {
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 10px;
}

.blueprint-mini-grid strong,
.blueprint-mini-grid small,
.blueprint-card strong,
.blueprint-card small {
  display: block;
}

.thumb {
  display: block;
  height: 84px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,.12);
  background: linear-gradient(135deg, #7a5a1f, #244f66 55%, #d7a65a);
}

.thumb.coffee { background: linear-gradient(135deg, #56306f, #d88b42 55%, #fed7a2); }
.thumb.feed { background: linear-gradient(135deg, #f9fbff, #d8e4ff 55%, #ffffff); }
.thumb.gaming { background: linear-gradient(135deg, #080808, #ba321f 55%, #f8f8f8); }
.thumb.nonprofit { background: linear-gradient(135deg, #41200b, #c26a32 50%, #f5d3a0); }
.thumb.blog { background: linear-gradient(135deg, #6c123c, #901a52 55%, #e8bed1); }

.two-column {
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
  align-items: start;
}

.save-panel {
  display: grid;
  gap: 12px;
}

fieldset {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}

fieldset label,
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

fieldset input,
.check input {
  min-height: auto;
}

.copy-progress {
  display: grid;
  gap: 8px;
}

.saved-list {
  display: grid;
  gap: 10px;
}

.saved-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

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

.wp-icon {
  width: 38px;
  height: 38px;
  color: #1e293b;
}

.manager-shell {
  min-height: calc(100vh - 113px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.manager-summary {
  align-self: start;
  display: grid;
  gap: 14px;
}

.wp-large {
  width: 58px;
  height: 58px;
  color: #fff;
  font-size: 28px;
}

.button-stack,
.export-card {
  display: grid;
  gap: 8px;
}

.export-card {
  border-top: 1px solid var(--line-dark);
  padding-top: 14px;
}

.manager-content {
  padding: 0;
  overflow: hidden;
}

.manager-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #edf1f4;
}

.manager-tab {
  color: var(--ink);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-height: 46px;
}

.manager-view {
  display: none;
  padding: 18px;
}

.manager-view.active {
  display: block;
}

.notice {
  margin-bottom: 18px;
  padding: 14px;
  border-left: 4px solid var(--cyan);
  background: #eef5ff;
  color: var(--ink);
}

.notice.strong {
  margin: 0;
  font-weight: 700;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.file-workbench {
  min-height: 500px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.tree-pane {
  background: #f1f3f5;
  border-right: 1px solid var(--line);
}

.toolbar {
  flex-wrap: wrap;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.toolbar button {
  border: 0;
  background: transparent;
  min-height: 30px;
}

.tree-row {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  text-align: left;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid #e6e9ed;
  background: transparent;
}

.tree-row.active {
  outline: 2px solid #007cba;
  outline-offset: -2px;
  background: #fff;
}

.editor-pane {
  min-width: 0;
  background: #fff;
}

.pane-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 52px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.pane-toolbar button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
}

.database-grid,
.logs-grid {
  display: grid;
  gap: 16px;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

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

dd {
  margin: 0;
}

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

.logs-grid article {
  padding: 16px;
}

.gallery-tools {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-field {
  min-width: min(320px, 100%);
  color: var(--muted-dark);
}

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

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

.blueprint-card .thumb {
  height: 155px;
}

.blueprint-card.selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

@media (max-width: 1120px) {
  .diagnostic-top {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: start;
  }

  .first-viewport,
  .manager-shell,
  .two-column {
    grid-template-columns: 1fr;
  }

  .stage-grid,
  .start-layout {
    grid-template-columns: 1fr;
  }

  .start-layout .github-card {
    grid-column: auto;
  }

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

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .diagnostic-top,
  .browser-strip,
  .tab-page,
  .first-viewport,
  .manager-shell {
    padding: 12px;
  }

  .browser-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .browser-strip .button,
  .browser-status {
    grid-column: 1 / -1;
  }

  .stage-header,
  .page-heading,
  .card-title-row,
  .gallery-tools {
    display: grid;
    align-items: start;
  }

  .stage-grid,
  .source-grid,
  .source-grid.compact,
  .form-grid,
  .settings-grid,
  .file-workbench,
  .logs-grid,
  .gallery-grid,
  .blueprint-mini-grid,
  .wp-preview {
    grid-template-columns: 1fr;
  }

  .wp-symbol {
    width: 180px;
    height: 180px;
    font-size: 98px;
    transform: none;
    justify-self: center;
  }

  .wp-preview nav {
    display: grid;
    margin-bottom: 22px;
  }

  .saved-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

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