:root {
  color-scheme: dark;
  --bg: #10161a;
  --panel: #182027;
  --panel-2: #202a32;
  --card: #f7f8f6;
  --card-2: #ecefed;
  --ink: #11181d;
  --muted: #63707a;
  --line: #d5dbdc;
  --line-dark: #34414b;
  --blue: #315bef;
  --cyan: #0b8eb8;
  --green: #1fa971;
  --yellow: #ffd54d;
  --red: #c4362f;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 80% 0%, rgba(49, 91, 239, 0.18), transparent 32rem), var(--bg);
  color: #f2f5f5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
  padding: 12px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.3fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(24, 32, 39, 0.94);
}

.brand,
.saved-title,
.pathbar,
.status-actions,
.button-row,
.icon-row,
.inline-actions,
.log-tabs,
.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.brand span,
.runtime,
.brand div span,
.saved-title span,
small {
  color: #9ca7af;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #e8ecef;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 800;
}

.brand-mark.inverse {
  border-color: var(--ink);
  color: var(--ink);
}

.pathbar {
  min-width: 0;
}

.path-input {
  min-width: 120px;
  flex: 1;
}

.path-input input,
.route-detail input,
.route-detail select,
.settings-card select,
.search-box input,
.inline-actions input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
}

.status-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.runtime {
  white-space: nowrap;
  font-weight: 700;
}

.runtime.unsaved::before {
  content: "!";
  display: inline-grid;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #1c2024;
  font-size: 11px;
}

.primary-button,
.secondary-button,
.quiet-button,
.icon-button,
.danger-button,
.text-link {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 7px 12px;
  font-weight: 700;
}

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

.secondary-button,
.quiet-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.quiet-button,
.icon-button {
  background: var(--panel-2);
  color: #f2f5f5;
  border-color: var(--line-dark);
}

.icon-button {
  width: 36px;
  padding: 0;
}

.danger-button {
  background: #fff2f0;
  color: var(--red);
  border-color: #efc5c0;
}

.text-link {
  min-height: auto;
  padding: 0;
  color: var(--cyan);
  background: transparent;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 2px;
}

.tab {
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #1b242b;
  color: #cbd3d8;
  padding: 8px 14px;
  font-weight: 800;
}

.tab.is-active {
  background: var(--card);
  color: var(--ink);
  border-color: var(--card);
}

.view {
  display: none;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.1fr) minmax(280px, 0.9fr);
  gap: 12px;
}

.light-card,
.trace-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.trace-card {
  background: #fbf7ed;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.18;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8efff;
  color: #2345b7;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  background: #e9f7f0;
  color: #0f7c53;
}

.muted {
  color: var(--muted);
}

.route-list {
  display: grid;
  gap: 8px;
}

.route {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-left: 5px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.route.is-active {
  border-left-color: var(--blue);
  background: #eef3ff;
}

.route-kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

label {
  display: grid;
  gap: 6px;
  color: #55616a;
  font-size: 13px;
  font-weight: 800;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 14px 0;
}

.check-row label,
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
}

.warning-row,
.notice {
  border-left: 4px solid var(--yellow);
  background: #fff7ce;
  color: #2b2610;
  padding: 10px 12px;
  margin: 14px 0;
  border-radius: 4px;
}

.full {
  width: 100%;
  margin-top: 10px;
}

.flow-steps {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.flow-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
}

.step-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.step-index.danger {
  background: var(--red);
}

.destination-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}

.mini-choice {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.mini-choice.is-selected {
  border-color: var(--blue);
  color: var(--blue);
}

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

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

.inline-actions {
  flex-wrap: wrap;
}

.inline-actions input {
  flex: 1 1 170px;
}

.preview-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  margin-top: 12px;
}

.preview-window {
  padding: 0;
  overflow: hidden;
}

.browser-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 14px;
  background: #1c242b;
  color: #eff3f3;
}

.browser-mini strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-mini em {
  color: #9de9c1;
  font-style: normal;
}

.site-preview {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(200px, 0.7fr);
  align-items: center;
  gap: 18px;
  min-height: 270px;
  padding: 28px;
}

.site-preview h2 {
  font-family: Georgia, serif;
  font-size: clamp(28px, 4vw, 48px);
  color: #244fe6;
}

.mock-button {
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  font-weight: 900;
}

.wp-orbit {
  display: grid;
  width: min(100%, 290px);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border: 18px solid #2fe878;
  border-radius: 50%;
  color: #1d1d1d;
  font-family: Georgia, serif;
  font-size: 130px;
  font-weight: 900;
  box-shadow: inset 0 0 0 14px #fff, 0 0 0 10px rgba(47, 232, 120, 0.2);
}

.compact-panel {
  align-self: stretch;
}

.metric-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.metric-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.metric-list dt {
  color: var(--muted);
  font-weight: 800;
}

.metric-list dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.manager-header,
.library-grid,
.transfer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.manager-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(420px, 1.25fr);
  gap: 12px;
  margin-top: 12px;
}

.settings-card {
  grid-row: span 2;
}

.settings-card label {
  margin-top: 12px;
}

.file-editor {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.tree {
  margin: 0;
  padding: 10px;
  list-style: none;
  background: #f0f2f2;
}

.tree li {
  padding: 7px 8px;
  border-radius: 4px;
  color: #2e3940;
}

.tree .selected {
  background: #dfeaff;
  color: #173fb9;
  font-weight: 900;
}

pre {
  margin: 0;
  overflow: auto;
  background: #11181d;
  color: #e4edf0;
  padding: 14px;
  border-radius: 4px;
  line-height: 1.6;
}

.json-code {
  max-height: 220px;
}

.log-tabs {
  margin-bottom: 10px;
}

.log-tabs button,
.filter-stack button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
}

.log-tabs .is-selected,
.filter-stack .is-selected {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
}

.search-box input {
  margin-top: 6px;
}

.filter-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1fr);
  gap: 12px;
}

.blueprint-list {
  display: grid;
  max-height: 610px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.blueprint-row {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.blueprint-row.is-selected {
  background: #eaf1ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.blueprint-row span {
  color: var(--muted);
}

.blueprint-detail {
  display: grid;
  align-content: start;
}

.blueprint-image {
  display: grid;
  min-height: 190px;
  margin-bottom: 16px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, #f9fbff 0 68%, #ecf2ff 68%),
    #f9fbff;
  border: 1px solid var(--line);
  color: var(--blue);
  padding: 20px;
  font-weight: 900;
}

.feed-lines {
  align-self: end;
  height: 110px;
  background:
    linear-gradient(#d7e0ff 0 12px, transparent 12px 22px) 0 0 / 76% 24px repeat-y,
    linear-gradient(#edf1f3 0 12px, transparent 12px 22px) 100% 0 / 24% 24px repeat-y;
}

.tag-row {
  flex-wrap: wrap;
}

.tag-row span {
  border-radius: 999px;
  background: #edf1f3;
  padding: 5px 9px;
  color: #44515b;
  font-size: 12px;
  font-weight: 800;
}

.library-grid,
.transfer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

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

.save-option {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 14px;
}

.save-option.is-selected {
  border-color: var(--blue);
  background: #eef3ff;
}

.site-list,
.route-table {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.site-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.site-row.warning {
  border-color: #ebd37a;
  background: #fff9dc;
}

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

.route-table div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.route-table span {
  color: var(--muted);
}

@media (max-width: 1120px) {
  .topbar,
  .hero-grid,
  .preview-strip,
  .manager-header,
  .manager-grid,
  .catalog-layout,
  .catalog-grid,
  .library-grid,
  .transfer-grid {
    grid-template-columns: 1fr;
  }

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

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

  .topbar {
    padding: 8px;
  }

  .pathbar,
  .status-actions,
  .button-row,
  .icon-row {
    flex-wrap: wrap;
  }

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

  .tab {
    width: 100%;
  }

  .light-card,
  .trace-card {
    padding: 14px;
  }

  .section-heading,
  .site-preview,
  .form-grid,
  .destination-grid,
  .save-options,
  .file-editor,
  .route-table div,
  .site-row {
    grid-template-columns: 1fr;
  }

  .site-preview {
    padding: 18px;
  }

  .wp-orbit {
    width: min(78vw, 220px);
    font-size: 92px;
  }

  .route-table div,
  .site-row {
    justify-items: start;
  }
}
