:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #17202a;
  --muted: #667385;
  --line: #d7e0ea;
  --blue: #2563eb;
  --blue-soft: #e7efff;
  --green: #0f8a56;
  --green-soft: #e7f6ee;
  --amber: #b56a00;
  --amber-soft: #fff2d2;
  --danger: #b42318;
  --danger-soft: #fde9e7;
  --shadow: 0 18px 45px rgba(34, 48, 73, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: default;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

button.secondary {
  border-color: #9eb7ff;
  background: var(--blue-soft);
  color: #1747bd;
}

button.danger,
.danger button,
button.danger:hover {
  border-color: #f4b5ae;
  background: var(--danger-soft);
  color: var(--danger);
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  color: var(--ink);
  background: white;
}

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

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef2f7;
  color: #0f172a;
}

.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px;
  border-right: 1px solid #1d3348;
  background: #15202c;
  color: #eaf1f9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid #dce8f5;
  border-radius: 50%;
  color: #15202c;
  background: #ffffff;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 700;
}

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

.brand span {
  color: #9fb0c4;
  font-size: 13px;
}

.rail-nav {
  display: grid;
  gap: 6px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 7px;
  color: #c8d4e2;
  text-decoration: none;
}

.rail-nav a span {
  color: #7d91a8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rail-nav a.active,
.rail-nav a:hover {
  background: #26384d;
  color: #ffffff;
}

.rail-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.rail-card strong {
  font-size: 15px;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.rail-status {
  display: grid;
  gap: 10px;
  margin-top: auto;
  color: #bdccdc;
  font-size: 13px;
}

.rail-status span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

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

.dot.blue {
  background: var(--blue);
}

.dot.amber {
  background: #ffbf47;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(12px);
}

.path-field {
  width: min(460px, 42vw);
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}

.path-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-spacer {
  flex: 1;
}

.icon-button {
  padding: 0 11px;
}

.screen {
  padding: 32px clamp(18px, 3vw, 42px) 56px;
  border-bottom: 1px solid var(--line);
}

.monitor-screen {
  min-height: calc(100vh - 62px);
}

.screen-title {
  max-width: 820px;
  margin-bottom: 22px;
}

.screen-title.compact {
  margin-bottom: 18px;
}

.screen-title h1,
.screen-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.screen-title h1 {
  font-size: clamp(32px, 4.3vw, 60px);
  line-height: 1.03;
  max-width: 760px;
}

.screen-title h2 {
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.1;
}

.screen-title p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-grid {
  display: grid;
  grid-template-columns: minmax(390px, 1.15fr) minmax(300px, 0.85fr);
  grid-template-areas:
    "summary health"
    "summary database"
    "logs preview";
  gap: 16px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.panel-head h2,
.panel-head h3,
.panel h3 {
  margin: 0;
}

.run-summary {
  grid-area: summary;
  display: grid;
  gap: 16px;
  padding-bottom: 18px;
}

.health-panel {
  grid-area: health;
}

.database-card {
  grid-area: database;
}

.logs-panel {
  grid-area: logs;
}

.preview-panel {
  grid-area: preview;
}

.state {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.state.green {
  border-color: #a8dfc4;
  background: var(--green-soft);
  color: var(--green);
}

.state.blue {
  border-color: #bad0ff;
  background: var(--blue-soft);
  color: #164dbf;
}

.state.amber {
  border-color: #f7d58c;
  background: var(--amber-soft);
  color: #8a5100;
}

.state.danger {
  border-color: #f4b5ae;
  background: var(--danger-soft);
  color: var(--danger);
}

.run-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px;
}

.step {
  position: relative;
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #d7e1ec;
  font-weight: 800;
}

.step strong,
.step p {
  display: block;
}

.step p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.step.done {
  border-color: #b7dfcc;
  background: var(--green-soft);
}

.step.active {
  border-color: #b6cbff;
  background: var(--blue-soft);
}

.step.warning {
  border-color: #f3d289;
  background: var(--amber-soft);
}

.progress-block {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 0 18px;
  padding: 14px;
  border: 1px solid #c6d7e9;
  border-radius: 8px;
  background: #f7fbff;
}

.progress-block span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e2ec;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #18a058);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.fact-grid div,
.stacked-facts div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.notice {
  margin: 0 18px 18px;
  padding: 12px;
  border-radius: 7px;
  font-size: 14px;
}

.notice.amber {
  border: 1px solid #f3d289;
  background: var(--amber-soft);
  color: #684000;
}

.notice.danger {
  border: 1px solid #f4b5ae;
  background: var(--danger-soft);
  color: var(--danger);
}

.stacked-facts {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 18px;
}

.log-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px;
  list-style: none;
}

.log-list li {
  display: grid;
  grid-template-columns: 70px auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.log-list p {
  margin: 2px 0 0;
}

time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.site-preview {
  margin: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.site-preview nav {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 50px;
  padding: 0 18px;
  border-bottom: 1px solid #edf1f5;
  font-size: 13px;
}

.site-preview nav strong {
  margin-right: auto;
}

.site-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 16px;
  min-height: 250px;
  padding: 30px;
  align-items: center;
}

.site-content h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
}

.site-content h3 span {
  color: #3155ef;
}

.site-content p {
  font-size: 17px;
}

.orbit {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border: 18px solid #2ee879;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 82px;
  font-weight: 800;
}

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

.source-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 250px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.source-card h3,
.source-card p {
  margin: 0;
}

.source-card p {
  color: var(--muted);
}

.source-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #e9f0fb;
  color: var(--blue);
  font-weight: 900;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button,
.filter-row button,
.manager-tabs button {
  min-height: 32px;
  padding: 0 10px;
}

.selected,
button.selected {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.warning-card {
  border-color: #f0c978;
  background: #fffaf0;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 72px;
  border: 1px dashed #c28f2b;
  border-radius: 7px;
  background: #fff7e7;
  color: #815000;
  font-weight: 700;
}

.save-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(420px, 1.4fr);
  gap: 14px;
}

.save-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
}

.save-card h3,
.save-card p {
  margin: 0;
}

.save-card p {
  color: var(--muted);
}

.result {
  padding: 10px;
  border-radius: 7px;
  background: #f4f8fc;
}

.saved-list {
  overflow: hidden;
}

table {
  width: calc(100% - 36px);
  margin: 18px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

td:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.manager-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
}

.manager-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
}

.manager-tabs button {
  justify-content: flex-start;
  text-align: left;
}

.tool-panel {
  display: none;
  min-height: 430px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

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

.tool-copy p {
  color: var(--muted);
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #f8fafc;
}

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

.file-workbench,
.blueprint-workbench {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.file-tree {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

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

.file-tree li {
  padding: 7px 8px;
  border-radius: 6px;
}

.file-tree li:nth-child(5) {
  background: var(--blue-soft);
  color: #1747bd;
}

.indent {
  margin-left: 18px;
}

.folder::before {
  content: "[dir] ";
  color: var(--muted);
}

.file::before {
  content: "[file] ";
  color: var(--muted);
}

.code {
  margin: 0;
  min-height: 300px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 13px;
}

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

.empty-log {
  min-height: 180px;
  padding: 14px;
  border: 1px dashed #b9c7d7;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
}

.gallery-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.gallery-controls {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.gallery-controls input {
  max-width: 420px;
}

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

.gallery-controls p {
  margin: 0;
  color: var(--muted);
}

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

.bp-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.bp-card.selected {
  border-color: var(--blue);
  background: white;
  color: var(--ink);
}

.bp-card h3,
.bp-card p {
  margin: 10px 12px 0;
}

.bp-card p {
  color: var(--muted);
  font-size: 14px;
}

.bp-card span {
  display: inline-flex;
  margin: 10px 0 12px 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #536172;
  font-size: 12px;
}

.thumb {
  height: 118px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 20%, transparent 20% 28%, rgba(255, 255, 255, 0.2) 28% 42%, transparent 42%),
    linear-gradient(135deg, #355c7d, #6c5b7b);
}

.thumb.art {
  background:
    linear-gradient(90deg, #b7d9df 0 34%, #d9b15f 34% 66%, #6c2a4f 66%),
    linear-gradient(#ffffff, #ffffff);
}

.thumb.coffee {
  background:
    radial-gradient(circle at 72% 45%, #f9b85f 0 16%, transparent 17%),
    linear-gradient(180deg, #52277d 0 48%, #ef9d43 48%);
}

.thumb.feed {
  background:
    repeating-linear-gradient(0deg, #ffffff 0 12px, #e7efff 12px 14px),
    linear-gradient(90deg, #f8fafc 0 22%, #ffffff 22%);
}

.thumb.gaming {
  background:
    linear-gradient(180deg, #05070c 0 42%, #ffffff 42%),
    radial-gradient(circle at 25% 70%, #dc2626, #f97316 30%, transparent 31%);
}

.thumb.nonprofit {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent),
    linear-gradient(135deg, #4a2519, #da7b47);
}

.thumb.blog {
  background:
    radial-gradient(circle at 20% 68%, #ede9fe 0 15%, transparent 16%),
    linear-gradient(135deg, #66133e, #9f1239);
}

.thumb.docs {
  background:
    linear-gradient(90deg, #1d4ed8 0 22%, #ffffff 22%),
    repeating-linear-gradient(0deg, #f8fafc 0 14px, #dbeafe 14px 16px);
}

.thumb.shop {
  background:
    linear-gradient(180deg, #0f766e 0 45%, #f8fafc 45%),
    radial-gradient(circle at 70% 66%, #facc15 0 15%, transparent 16%);
}

.thumb.blocks {
  background:
    linear-gradient(90deg, #1e293b 0 33%, #e0f2fe 33% 66%, #dcfce7 66%),
    linear-gradient(#fff, #fff);
}

.thumb.theme {
  background:
    linear-gradient(135deg, #f8fafc 0 35%, #2563eb 35% 36%, #e0e7ff 36% 70%, #0f8a56 70%);
}

.thumb.data {
  background:
    repeating-linear-gradient(90deg, #eff6ff 0 36px, #dbeafe 36px 38px),
    repeating-linear-gradient(0deg, transparent 0 22px, #93c5fd 22px 24px);
}

.thumb.events {
  background:
    linear-gradient(180deg, #f97316 0 36%, #fff7ed 36%),
    radial-gradient(circle at 28% 70%, #2563eb 0 12%, transparent 13%);
}

.selected-blueprint {
  position: sticky;
  top: 86px;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.selected-blueprint p {
  color: var(--muted);
}

.export-grid .panel {
  padding: 18px;
}

.export-grid p {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .run-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "summary"
      "health"
      "database"
      "logs"
      "preview";
  }

  .run-stepper,
  .source-grid,
  .blueprint-grid,
  .export-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .selected-blueprint {
    position: static;
  }
}

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

  .rail {
    position: relative;
    height: auto;
    gap: 14px;
  }

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

  .rail-nav a {
    justify-content: center;
  }

  .rail-nav a span {
    display: none;
  }

  .rail-card,
  .rail-status {
    display: none;
  }

  .topbar {
    position: relative;
    flex-wrap: wrap;
  }

  .path-field {
    order: 10;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .topbar-spacer {
    display: none;
  }

  .progress-block,
  .manager-layout,
  .file-workbench,
  .blueprint-workbench {
    grid-template-columns: 1fr;
  }

  .settings-grid,
  .log-columns {
    grid-template-columns: 1fr;
  }

  .manager-tabs {
    display: flex;
    flex-wrap: wrap;
  }

  .site-content {
    grid-template-columns: 1fr;
  }

  .orbit {
    width: 104px;
    height: 104px;
    border-width: 13px;
    font-size: 58px;
  }
}

@media (max-width: 620px) {
  .screen {
    padding-inline: 14px;
  }

  .run-stepper,
  .source-grid,
  .blueprint-grid,
  .export-grid,
  .fact-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar button,
  .button-row button,
  td button {
    flex: 1 1 auto;
  }

  .log-list li {
    grid-template-columns: 1fr;
  }

  .site-preview nav {
    flex-wrap: wrap;
    padding-block: 10px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  th {
    display: none;
  }

  td {
    border-bottom: 0;
  }

  tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
}
