:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #1d2327;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #d9dee5;
  --line-strong: #c3cbd6;
  --blue: #265bd7;
  --blue-2: #eaf0ff;
  --green: #0f8a4b;
  --amber: #a15c00;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(16, 24, 40, .12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

button:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
}

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

.danger {
  color: var(--red);
  border-color: #f1b4ad;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 240px minmax(280px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 14px;
  background: #161b20;
  color: #f8fafc;
  border-bottom: 1px solid #2b333d;
}

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

.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #738094;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
  background: #fff;
  color: #101418;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span:not(.mark) {
  display: block;
  color: #aeb7c2;
  font-size: 12px;
}

.omnibar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #3a4552;
  background: #242b33;
  border-radius: 7px;
}

.slash {
  color: #89a8ff;
  font-weight: 700;
}

.omnibar input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
}

kbd {
  border: 1px solid #596575;
  color: #b8c2cf;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
}

.topnav {
  display: flex;
  gap: 4px;
}

.nav-button {
  background: transparent;
  color: #cbd5e1;
  border-color: transparent;
}

.nav-button.active,
.nav-button:hover {
  background: #28313a;
  color: #fff;
  border-color: #3e4a58;
}

.state-chip {
  white-space: nowrap;
  border: 1px solid #5d491d;
  background: #312716;
  color: #ffd966;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
  min-height: calc(100vh - 58px);
}

.command-stage {
  min-width: 0;
  padding: 14px;
}

.pathbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  padding: 7px 9px;
}

.path-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
}

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

.path-input input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.command-panel,
.run-board,
.inspector,
.preview-shell,
.card,
.gallery-detail,
.file-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.command-panel {
  overflow: hidden;
}

.panel-head,
.board-head,
.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h1,
.board-head h2,
.inspector-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.filter {
  white-space: nowrap;
  padding: 6px 9px;
  font-size: 12px;
}

.filter.active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-2);
}

.command-list {
  max-height: calc(100vh - 216px);
  overflow: auto;
}

.command-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.command-row.selected {
  background: #f5f8ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.command-key {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f8fa;
  color: #3b4654;
  font-size: 11px;
  font-weight: 800;
}

.command-row strong,
.command-row small {
  display: block;
}

.command-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.command-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.run-board {
  min-width: 0;
  overflow: hidden;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.flow-strip li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
}

.flow-strip li:last-child {
  border-right: 0;
}

.flow-strip span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.flow-strip small {
  min-width: 0;
  color: var(--muted);
}

.flow-strip .done span {
  background: #e8f7ef;
  border-color: #a6e1bd;
  color: var(--green);
}

.flow-strip .active {
  background: #eef4ff;
}

.flow-strip .active span {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.preview-shell {
  margin: 14px;
  overflow: hidden;
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.red { background: #ff605c; }
.yellow { background: #ffbd44; }
.green { background: #00ca4e; }

.browser-chrome strong {
  margin-left: 8px;
}

.browser-chrome em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.wp-preview {
  min-height: 382px;
  background: #fff;
}

.wp-preview header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid #eef1f4;
}

.wp-preview nav {
  color: #30343b;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 318px;
  padding: 28px;
  overflow: hidden;
}

.hero h3 {
  margin: 0 0 16px;
  font-family: Georgia, serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.2;
}

.hero h3 span {
  color: #3458ed;
}

.hero p {
  max-width: 430px;
  font-size: 18px;
}

mark {
  background: #fff1a8;
}

.hero button {
  display: block;
  margin-top: 18px;
  background: #3858e9;
  color: #fff;
  border-color: #3858e9;
}

.wp-art {
  justify-self: center;
  display: grid;
  place-items: center;
  width: min(340px, 40vw);
  aspect-ratio: 1;
  border: 18px solid #1d1d1f;
  border-radius: 50%;
  color: #1d1d1f;
  font-family: Georgia, serif;
  font-size: clamp(120px, 18vw, 230px);
  font-weight: 800;
  outline: 34px solid #31e879;
  outline-offset: 22px;
}

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

.manager-summary article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--panel-2);
}

.manager-summary strong,
.manager-summary span {
  display: block;
}

.manager-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.inspector {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow: auto;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}

.inspector-body {
  padding: 14px;
}

.drawer-section {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.check-row strong,
.mini-label {
  color: #3b4654;
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 94px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.notice,
.warning,
.result {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 6px;
  padding: 10px;
  background: var(--panel-2);
  color: #3b4654;
}

.warning {
  border-left-color: var(--amber);
  background: #fff8ed;
}

.notice {
  border-left-color: var(--blue);
}

.result {
  border-left-color: var(--green);
  background: #ecfdf3;
}

.button-row,
.segmented,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.segmented button.active {
  background: var(--blue-2);
  border-color: var(--blue);
  color: var(--blue);
}

.progress {
  display: grid;
  gap: 7px;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ec;
}

.bar span {
  display: block;
  height: 100%;
  width: 78%;
  background: var(--blue);
}

.table {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row small {
  display: block;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: var(--panel-2);
}

.check-row input {
  margin-top: 2px;
}

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

.file-tree {
  background: var(--panel-2);
  border-right: 1px solid var(--line);
  padding: 8px;
}

.file-tree div {
  padding: 6px;
  border-radius: 4px;
  font-size: 12px;
}

.file-tree .active {
  background: var(--blue-2);
  color: var(--blue);
  font-weight: 700;
}

.code {
  overflow: auto;
  margin: 0;
  padding: 10px;
  color: #8a3200;
  font-size: 12px;
  line-height: 1.55;
}

.code,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.gallery-tools {
  display: grid;
  gap: 10px;
}

.search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.chip {
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}

.chip.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

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

.blueprint-card {
  display: grid;
  gap: 7px;
  min-height: 116px;
  padding: 9px;
  text-align: left;
  background: #fff;
}

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

.thumb {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(38,91,215,.2), transparent 45%),
    linear-gradient(160deg, #1d2327 0 34%, #f4f6f8 34% 60%, #31e879 60%);
}

.coffee .thumb { background: linear-gradient(140deg, #592f7f 0 48%, #ffb357 48%); }
.feed .thumb { background: linear-gradient(90deg, #f7f9ff 0 70%, #d8e5ff 70%); }
.gaming .thumb { background: linear-gradient(140deg, #080808 0 40%, #b42318 40% 68%, #f5f5f5 68%); }
.nonprofit .thumb { background: linear-gradient(140deg, #5b3008 0 40%, #ead5b0 40% 65%, #2c6e49 65%); }
.blog .thumb { background: linear-gradient(140deg, #6e123f 0 60%, #f6d6e6 60%); }

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

.blueprint-card small {
  color: var(--muted);
}

.gallery-detail {
  padding: 10px;
}

.tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tagline span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.artifact-grid .card {
  padding: 10px;
}

.card strong,
.card span {
  display: block;
}

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

[data-drawer-open="false"] .workspace {
  grid-template-columns: minmax(0, 1fr);
}

[data-drawer-open="false"] .inspector {
  display: none;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto minmax(220px, 1fr) auto;
  }

  .topnav {
    grid-column: 1 / -1;
    overflow-x: auto;
  }

  .state-chip {
    display: none;
  }

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

  .inspector {
    position: fixed;
    top: 78px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    width: min(420px, calc(100vw - 24px));
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand span:not(.mark) {
    display: none;
  }

  .omnibar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .topnav {
    grid-row: 3;
  }

  .drawer-toggle {
    grid-column: 2;
    grid-row: 1;
  }

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

  .pathbar button:nth-last-child(2),
  .pathbar button:nth-last-child(3) {
    display: none;
  }

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

  .command-list {
    max-height: none;
  }

  .flow-strip,
  .manager-summary,
  .settings-grid,
  .artifact-grid {
    grid-template-columns: 1fr;
  }

  .flow-strip li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .wp-art {
    width: 170px;
    outline-width: 18px;
    outline-offset: 12px;
    font-size: 110px;
  }
}

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

  .command-stage {
    padding: 10px;
  }

  .panel-head,
  .board-head,
  .inspector-head {
    padding: 12px;
  }

  .command-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .command-row em {
    grid-column: 2;
  }

  .wp-preview header {
    display: grid;
    padding: 18px;
  }

  .hero {
    padding: 18px;
  }

  .hero h3 {
    font-size: 34px;
  }

  .hero p {
    font-size: 16px;
  }

  .file-layout,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

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