:root {
  color-scheme: dark;
  --bg: #12171b;
  --surface: #1b2329;
  --surface-2: #222c34;
  --ink: #101418;
  --text: #f3f6f8;
  --muted: #87919c;
  --line: #34414b;
  --card: #fbfcfd;
  --card-muted: #eef3f8;
  --blue: #3858e9;
  --cyan: #0085ba;
  --green: #0f8a63;
  --amber: #d79a14;
  --red: #b42318;
  --purple: #7a4cc2;
  --radius: 8px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: #171d22;
  border-bottom: 1px solid #2f3a43;
}

.brand-lockup,
.shell-actions,
.site-actions,
.button-row,
.transfer-actions,
.tool-row,
.blueprint-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup span:not(.brand-mark),
.state,
.eyebrow,
.site-identity p,
.run-step p,
.source-option span,
.storage-card span,
.site-row span,
.editor-title span,
.meta-list dt,
.selected-blueprint p,
.transfer-card p {
  color: var(--muted);
}

.brand-lockup > div {
  display: grid;
  gap: 2px;
}

.brand-mark,
.wp-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid #87a6ff;
  border-radius: 50%;
  color: #eaf0ff;
  font-weight: 800;
}

.path-control {
  height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid #3a4650;
  border-radius: var(--radius);
  background: #27313a;
}

.path-control > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.path-control button,
.preview-toolbar button {
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: #36424d;
  color: #dbe5ed;
}

.path-control input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #edf2f6;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 750;
}

.state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.state-warning::before {
  background: #ffd34d;
}

.button,
.mini-button,
.icon-button,
.tab,
.pill,
.catalog-row {
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 750;
}

.button {
  min-height: 36px;
  padding: 0 14px;
}

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

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

.button.dark {
  background: #2c3741;
  color: #eef4f8;
  border-color: #43505b;
}

.button.danger,
.mini-button.danger {
  background: #fff1ee;
  color: var(--red);
  border-color: #f0b5ab;
}

.icon-button {
  height: 36px;
  padding: 0 10px;
  background: #28323b;
  color: #e4ebf1;
  border-color: #3e4b55;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.manager-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 12px;
  padding: 12px;
}

.manager-surface {
  min-width: 0;
  overflow: auto;
  border: 1px solid #2f3b45;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.surface-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.site-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-identity h1,
.card h2,
.gallery-section h2,
.transfer-card h2 {
  margin: 0;
}

.site-identity p,
.run-step p,
.card p,
.transfer-card p {
  margin: 4px 0 0;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.72rem;
  font-weight: 800;
}

.run-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 20px;
  background: #151b20;
  border-bottom: 1px solid var(--line);
}

.run-step {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #36434e;
  border-radius: var(--radius);
  background: #202932;
}

.run-step span {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #313d48;
  color: #cbd6df;
  font-weight: 850;
}

.run-step.active {
  border-color: #7895ff;
  background: #26324a;
}

.run-step.active span {
  background: var(--blue);
  color: #fff;
}

.run-step strong,
.run-step p {
  display: block;
  min-width: 0;
}

.manager-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  overflow-x: auto;
}

.tab {
  min-height: 40px;
  padding: 0 16px;
  background: #26313a;
  color: #c7d1db;
  border-color: #34414c;
  white-space: nowrap;
}

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

.tab-panels {
  padding: 0 20px 20px;
}

.tab-panel {
  display: none;
  color: var(--ink);
  background: var(--card);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 18px;
}

.tab-panel.is-active {
  display: block;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.card,
.gallery-section,
.transfer-section,
.split-card,
.database-card,
.log-card {
  border: 1px solid #d8e0e7;
  border-radius: var(--radius);
  background: #fff;
}

.card {
  padding: 16px;
}

.launch-card,
.settings-card {
  grid-column: 1 / -1;
}

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

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

.source-option,
.storage-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid #d5dee6;
  border-radius: var(--radius);
  background: #f7fafc;
}

.source-option.selected,
.storage-card.selected {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.source-option.danger-tint {
  background: #fff7f4;
  border-color: #efc2b8;
}

.inline-input,
.field input,
.settings-grid select,
.search-field input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid #c9d4dd;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 750;
}

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

.progress-block {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: #eef5ff;
}

.progress-block span {
  display: block;
  color: #50606e;
  margin-top: 3px;
}

.progress {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #d5dee8;
}

.progress span {
  display: block;
  width: 81%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

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

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

.site-row.selected {
  border-color: #8fa2ef;
  background: #eef2ff;
}

.wp-logo.small {
  width: 30px;
  height: 30px;
  color: var(--ink);
  border-color: var(--ink);
}

.wp-logo.blue {
  border-color: var(--blue);
  color: var(--blue);
}

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

.settings-grid label {
  display: grid;
  gap: 6px;
  font-weight: 750;
}

.settings-grid .check {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius);
  background: #f4f7fa;
}

.warning-note {
  padding: 10px 12px;
  border-left: 4px solid var(--amber);
  background: #fff8df;
  color: #513d00;
}

.split-card {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  overflow: hidden;
}

.tree-card {
  padding: 12px;
  background: #f5f8fb;
  border-right: 1px solid #d9e2e8;
}

.tool-row,
.blueprint-actions {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.file-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.file-tree li {
  padding: 8px 10px;
  border-radius: 6px;
  color: #33404a;
}

.file-tree .open {
  background: #e8f0ff;
  color: var(--blue);
  font-weight: 800;
}

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

.editor-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #d9e2e8;
}

pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  min-height: 360px;
  background: #fbfdff;
  color: #9b2f10;
  font: 0.86rem/1.6 "SFMono-Regular", Consolas, monospace;
}

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

.database-card {
  padding: 18px;
}

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

.meta-list div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
}

.meta-list dd,
.meta-list dt {
  margin: 0;
}

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

.log-card {
  min-height: 140px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.log-card code,
.empty-log {
  display: block;
  padding: 10px;
  border-radius: 6px;
  background: #f2f6f8;
  color: #41515e;
}

.gallery-section,
.transfer-section {
  margin: 0 20px 20px;
  padding: 18px;
  color: var(--ink);
}

.gallery-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  align-items: start;
}

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

.pill {
  min-height: 32px;
  padding: 0 12px;
  color: #34414b;
  background: #edf2f6;
  border-color: #d7e0e7;
}

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

.search-field {
  display: block;
}

.search-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gallery-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.selected-blueprint {
  overflow: hidden;
  border: 1px solid #d8e0e7;
  border-radius: var(--radius);
  background: #f8fafc;
}

.selected-blueprint img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: top left;
  display: block;
  border-bottom: 1px solid #d8e0e7;
}

.selected-blueprint div {
  padding: 12px;
}

.catalog-list {
  max-height: 410px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.catalog-row {
  min-width: 0;
  min-height: 54px;
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 9px 10px;
  text-align: left;
  background: #f6f9fb;
  color: var(--ink);
  border-color: #dbe3ea;
}

.catalog-row span {
  color: #66727d;
  font-size: 0.82rem;
}

.catalog-row.selected,
.catalog-row:hover {
  border-color: var(--blue);
  background: #eef2ff;
}

.catalog-row.is-hidden {
  display: none;
}

.transfer-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

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

.preview-pane {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid #303b44;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.preview-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  height: 42px;
  padding: 6px 8px;
  background: #1c2329;
  color: #dce4eb;
}

.preview-toolbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 6px;
  background: #3a4651;
}

.wp-admin-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  background: #20272d;
  color: #e8edf2;
  font-size: 0.78rem;
  white-space: nowrap;
}

.wp-admin-bar span:first-child {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd4dc;
  border-radius: 50%;
}

.site-preview {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.site-preview nav {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.site-preview section {
  position: relative;
  z-index: 1;
  width: 78%;
  padding: 70px 24px;
}

.site-preview h2 {
  margin: 0 0 18px;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  font-weight: 400;
}

.site-preview h2 span {
  color: var(--blue);
}

.site-preview p {
  max-width: 360px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.site-preview mark {
  display: inline;
  background: #fff2a8;
}

.site-preview button {
  display: block;
  width: min(330px, 100%);
  min-height: 46px;
  margin-top: 26px;
  border: 0;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font-weight: 750;
}

.preview-logo {
  position: absolute;
  right: -80px;
  top: 180px;
  width: 260px;
  height: 260px;
  display: grid;
  place-items: center;
  border: 26px solid #2fe875;
  border-radius: 50%;
  color: #1b1b1b;
  font-family: Georgia, serif;
  font-size: 8rem;
  font-weight: 900;
  opacity: 0.95;
}

@media (max-width: 1180px) {
  .manager-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .run-strip,
  .source-grid,
  .settings-grid,
  .logs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .shell-actions,
  .site-actions {
    flex-wrap: wrap;
  }

  .manager-layout {
    grid-template-columns: 1fr;
  }

  .preview-pane {
    min-height: 480px;
  }

  .surface-header,
  .transfer-card,
  .card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .run-strip,
  .source-grid,
  .storage-grid,
  .settings-grid,
  .split-card,
  .gallery-tools,
  .catalog-list,
  .logs-grid {
    grid-template-columns: 1fr;
  }

  .tab-panels,
  .manager-tabs,
  .run-strip,
  .surface-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .gallery-section,
  .transfer-section {
    margin-left: 12px;
    margin-right: 12px;
  }

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

  .site-row .mini-button {
    grid-column: 2;
    justify-self: start;
  }

  .tree-card {
    border-right: 0;
    border-bottom: 1px solid #d9e2e8;
  }

  .site-preview nav {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 14px;
  }

  .site-preview section {
    width: 100%;
    padding: 40px 18px;
  }

  .preview-logo {
    right: -110px;
    top: 230px;
  }
}

@media (max-width: 520px) {
  .manager-layout {
    padding: 8px;
  }

  .tab-panel,
  .gallery-section,
  .transfer-section {
    padding: 12px;
  }

  .button,
  .mini-button {
    width: 100%;
  }

  .meta-list div {
    grid-template-columns: 1fr;
  }
}
