:root {
  color-scheme: light;
  --ink: #111;
  --muted: #666;
  --soft: #f3f3f3;
  --panel: #fff;
  --line: #d7d7d7;
  --line-strong: #a8a8a8;
  --focus: #111;
  --green-bg: #e7f7ec;
  --green-text: #166534;
  --amber-bg: #fff5cc;
  --amber-text: #7a5600;
  --blue-bg: #e9f1ff;
  --blue-text: #164eaf;
  --red-bg: #fff0ed;
  --red-text: #a12b18;
  --neutral-bg: #ededed;
  --neutral-text: #3d3d3d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #e9e9e9;
}

button,
input,
select {
  font: inherit;
}

button,
a.button {
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  padding: 10px 18px;
  border-bottom: 1px solid #0f0f0f;
  background: #191919;
  color: #fff;
}

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

.brand div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand strong,
.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  color: #bcbcbc;
  font-size: 12px;
}

.logo-mark,
.site-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

.topbar-path {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.path-field {
  width: 100%;
}

.path-field input,
.command-input input,
.task-card input,
.save-layout input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.path-field input {
  height: 36px;
  padding: 0 12px;
  border-color: #383838;
  background: #2b2b2b;
  color: #e7e7e7;
}

.path-field input:focus,
.command-input:focus-within,
input:focus,
select:focus,
button:focus-visible,
a.button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.topbar-actions,
.workspace-actions,
.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
}

.icon-button:hover {
  border-color: currentColor;
}

.button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
}

.button.dark {
  background: var(--ink);
  color: #fff;
}

.button.secondary {
  background: transparent;
  color: inherit;
}

.page {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero-workspace,
.command-surface,
.blueprint-gallery,
.manager-stack {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}

.hero-workspace {
  order: 2;
  margin-top: 22px;
  overflow: hidden;
}

.command-surface {
  order: 1;
  margin-top: 0;
}

.blueprint-gallery {
  order: 3;
}

.manager-stack {
  order: 4;
}

.workspace-title,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  font-weight: 760;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.14;
}

h3 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

.active-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.1fr;
  gap: 0;
}

.site-identity {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-identity div {
  display: grid;
  gap: 4px;
}

.site-identity span:last-child {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-grid > span {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  background: #fafafa;
  color: var(--muted);
  font-size: 14px;
}

.summary-grid strong {
  color: var(--ink);
}

.mini-site {
  grid-column: 1 / -1;
  min-height: 246px;
  background: #fff;
}

.mini-site-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #1e1e1e;
  color: #f8f8f8;
}

.mini-site-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cfcfcf;
}

.mini-site-bar em {
  margin-left: 10px;
  font-size: 12px;
  font-style: normal;
  color: #d5d5d5;
}

.mini-site-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 24px;
  align-items: center;
  min-height: 212px;
  padding: 24px 34px;
  overflow: hidden;
}

.mini-title {
  margin-bottom: 12px;
  font-family: Georgia, serif;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.12;
}

.mini-title span {
  color: #2b55e8;
}

.mini-site-body mark {
  background: #fff0a8;
}

.mini-rings {
  position: relative;
  height: 160px;
}

.mini-rings span {
  position: absolute;
  inset: 12px 0 auto auto;
  display: block;
  width: min(420px, 100%);
  height: 120px;
  border: 24px solid #28d96f;
  border-radius: 50%;
}

.mini-rings span:nth-child(2) {
  top: 58px;
  right: 24px;
  width: min(340px, 86%);
  border-color: #31e879;
}

.mini-rings span:nth-child(3) {
  top: 4px;
  right: 84px;
  width: 132px;
  height: 132px;
  border: 14px solid #1f1f1f;
}

.blueprint-gallery,
.manager-stack {
  margin-top: 22px;
  padding: 24px;
}

.command-surface {
  padding: 24px;
}

.command-header {
  max-width: 720px;
}

.command-header p:last-child {
  color: var(--muted);
  font-size: 16px;
}

.command-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  margin-top: 18px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.command-prefix {
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
  text-transform: uppercase;
}

.command-input input {
  height: 58px;
  border: 0;
  font-size: clamp(18px, 2vw, 23px);
}

kbd {
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #f4f4f4;
  color: var(--muted);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-row.wrap {
  flex-wrap: wrap;
  overflow: visible;
  margin-top: 0;
  padding-bottom: 16px;
}

.filter {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.filter.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.results {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.result-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfb;
  color: inherit;
  text-align: left;
}

.result-row:hover,
.result-row.active {
  border-color: var(--ink);
  background: #fff;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #f1f1f1;
  font-weight: 800;
}

.result-row span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.result-row em {
  color: var(--muted);
  font-style: normal;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.chip-green {
  background: var(--green-bg);
  color: var(--green-text);
}

.chip-amber {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.chip-blue {
  background: var(--blue-bg);
  color: var(--blue-text);
}

.chip-red {
  background: var(--red-bg);
  color: var(--red-text);
}

.chip-neutral {
  background: var(--neutral-bg);
  color: var(--neutral-text);
}

.inspector {
  margin-top: 20px;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.inspector-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

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

.start-grid.small {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.task-card,
.blueprint-card {
  display: grid;
  gap: 10px;
  align-content: start;
  width: 100%;
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: inherit;
  text-align: left;
}

.task-card.primary,
.task-card:hover,
.blueprint-card:hover,
.blueprint-card.selected {
  border-color: var(--ink);
  background: #fff;
}

.task-card span,
.blueprint-card em,
.plain-copy {
  color: var(--muted);
  font-style: normal;
}

.task-card input,
.save-layout input,
select {
  height: 38px;
  padding: 0 10px;
}

.save-layout {
  display: grid;
  gap: 14px;
}

.save-layout > label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.destination-list,
.library-list {
  display: grid;
  gap: 8px;
}

.radio-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.radio-row span {
  grid-column: 2;
  color: var(--muted);
}

.progress-block {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.progress-block div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

meter {
  width: 100%;
  height: 14px;
}

.library-row {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(120px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.library-row.active {
  border-color: var(--ink);
  background: #f8f8f8;
}

.library-row span:nth-child(3) {
  color: var(--muted);
}

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

.settings-grid.short {
  margin: 18px 0;
}

.settings-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 650;
}

.settings-grid .check {
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
  min-height: 40px;
  color: var(--ink);
}

.warning-line {
  margin-top: 14px;
  padding: 12px;
  border-left: 4px solid var(--red-text);
  background: var(--red-bg);
  color: var(--red-text);
}

.blueprint-gallery .section-heading,
.manager-stack .section-heading {
  padding: 0 0 18px;
  border-bottom: 0;
}

.gallery-grid {
  margin-top: 6px;
}

.blueprint-card {
  min-height: 240px;
}

.blueprint-card > span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mock {
  position: relative;
  display: block;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(135deg, #dcdcdc, #f8f8f8);
}

.mock::before,
.mock::after {
  content: "";
  position: absolute;
  background: #202020;
}

.mock::before {
  inset: 12px 14px auto;
  height: 12px;
}

.mock::after {
  left: 14px;
  right: 42%;
  bottom: 14px;
  height: 48px;
}

.mock.coffee {
  background: linear-gradient(135deg, #e5e5e5 0 42%, #bdbdbd 42% 58%, #f7f7f7 58%);
}

.mock.feed {
  background: repeating-linear-gradient(0deg, #fff, #fff 13px, #d8d8d8 14px, #d8d8d8 15px);
}

.mock.gaming {
  background: linear-gradient(90deg, #111 0 35%, #fafafa 35%);
}

.mock.nonprofit {
  background: radial-gradient(circle at 70% 50%, #b6b6b6, #f7f7f7 52%, #252525 53%);
}

.mock.personal {
  background: linear-gradient(135deg, #222 0 30%, #f8f8f8 30% 60%, #bdbdbd 60%);
}

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

.manager-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.manager-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  cursor: pointer;
}

.manager-panel summary span:first-child {
  font-weight: 760;
}

.manager-panel summary span:last-child {
  color: var(--muted);
}

.manager-panel > div:not(.settings-grid) {
  padding: 0 16px 16px;
}

.file-browser {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 12px;
}

.tree {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.tree .button {
  margin: 0 4px 8px 0;
}

.tree ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.tree li {
  padding: 8px;
  border-radius: 5px;
}

.tree li.selected {
  background: #eaeaea;
  font-weight: 750;
}

.code-view {
  min-height: 230px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  color: #f1f1f1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.code-view.compact {
  min-height: 120px;
}

.blueprint-tools,
.database-grid,
.log-grid {
  display: grid;
  gap: 12px;
}

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

.database-grid span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

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

.log-grid div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.log-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

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

  .topbar-actions {
    justify-content: flex-start;
  }

  .page {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .workspace-title,
  .section-heading,
  .inspector-head {
    display: grid;
  }

  .active-summary,
  .mini-site-body,
  .summary-grid,
  .start-grid,
  .start-grid.small,
  .gallery-grid,
  .settings-grid,
  .file-browser,
  .database-grid,
  .log-grid {
    grid-template-columns: 1fr;
  }

  .site-identity {
    border-right: 0;
  }

  .mini-rings {
    display: none;
  }

  .result-row {
    grid-template-columns: 40px 1fr;
  }

  .result-row .status-chip {
    grid-column: 2;
    justify-self: start;
  }

  .library-row {
    grid-template-columns: auto 1fr;
  }

  .library-row .button,
  .library-row span:nth-child(3) {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .page {
    width: 100%;
  }

  .hero-workspace,
  .command-surface,
  .blueprint-gallery,
  .manager-stack {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .command-surface,
  .blueprint-gallery,
  .manager-stack,
  .workspace-title,
  .site-identity,
  .mini-site-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .command-input {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 12px;
  }

  .command-input span,
  .command-input kbd {
    display: none;
  }

  .command-input input {
    height: 44px;
  }

  .button-row,
  .workspace-actions,
  .topbar-actions {
    align-items: stretch;
  }

  .button,
  a.button {
    width: 100%;
  }
}
