:root {
  --ink: #221a15;
  --muted: #71675e;
  --soft: #f7f3ec;
  --paper: #fffaf2;
  --panel: #ffffff;
  --line: #dfd5c8;
  --line-strong: #c9b9a7;
  --blue: #3455eb;
  --blue-dark: #1c36b8;
  --teal: #0d7f74;
  --amber: #d88621;
  --rose: #b55250;
  --dark: #171b1d;
  --shadow: 0 18px 60px rgba(65, 45, 25, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #2a211d 0, #2a211d 56px, var(--soft) 56px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  color: var(--ink);
  border-radius: 7px;
  min-height: 34px;
  padding: 7px 11px;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: var(--blue);
  outline: none;
}

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

.topbar {
  height: 56px;
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(320px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 0 18px;
  color: #f9f4ec;
  background: var(--dark);
}

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

.brand-mark,
.wp-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-weight: 800;
  font-family: Georgia, serif;
}

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

.address-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-width: 0;
  border: 1px solid #3b4247;
  border-radius: 8px;
  background: #252b2f;
  overflow: hidden;
}

.address-field button {
  border: 0;
  border-right: 1px solid #3b4247;
  border-radius: 0;
  color: #d9e1e7;
  background: transparent;
}

.address-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 8px 12px;
  color: #eef2f4;
  background: transparent;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.top-actions strong {
  color: #ffd75c;
  font-size: 13px;
}

.top-actions button {
  border-color: #4a5155;
  background: #252b2f;
  color: #f7f1e8;
}

.top-actions [data-jump="save-panel"] {
  border-color: #ffd75c;
  background: #ffd75c;
  color: #1c1b18;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8cffb1;
}

.status-dot.unsaved {
  background: #ffd75c;
}

.takeover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 25vw);
  gap: 14px;
  height: calc(100vh - 56px);
  min-height: 720px;
  padding: 14px;
}

.manager-surface,
.preview-rail {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.manager-surface {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(216, 134, 33, 0.16), rgba(255, 255, 255, 0) 42%),
    #fffdf8;
}

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

.wp-logo {
  flex: 0 0 auto;
  color: var(--ink);
  background: white;
  border: 2px solid var(--ink);
}

.overline {
  margin: 0 0 5px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.site-header h1 {
  margin: 0 0 4px;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.08;
}

.site-header span {
  color: var(--muted);
  font-size: 14px;
}

.site-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-controls .selected,
.filter-row .selected {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: #eef1ff;
}

.manager-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #fbf7ef;
  overflow-x: auto;
}

.tab {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  min-height: 46px;
  padding: 10px 18px;
  color: var(--muted);
  font-weight: 700;
}

.tab.is-active {
  color: var(--ink);
  background: white;
  box-shadow: inset 0 -3px 0 var(--blue);
}

.manager-layout {
  display: grid;
  grid-template-columns: minmax(260px, 32%) minmax(0, 1fr);
  min-height: 0;
}

.workflow-column {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fbf6ed;
  padding: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.panel + .panel {
  margin-top: 12px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.panel-heading span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  font-weight: 800;
  font-size: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 15px;
}

.source-list {
  display: grid;
  gap: 7px;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
}

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

.source-row.is-primary {
  border-color: var(--blue);
  background: #eef1ff;
}

.inline-flow {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f5ecdf;
  border: 1px solid #ead8c0;
}

.inline-flow h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.inline-flow p:not(.overline) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.compact-field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-field input,
.settings-grid select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
}

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

.choice-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 13px;
}

.progress-card {
  padding: 11px;
  border-radius: 8px;
  background: #1f2528;
  color: white;
}

.progress-card div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.progress-bar {
  height: 7px;
  border-radius: 99px;
  background: #414a50;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 78%;
  height: 100%;
  background: #ffd75c;
}

.saved-sites {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.saved-site {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.saved-site span,
.fine-print {
  color: var(--muted);
  font-size: 12px;
}

.saved-site.current {
  border-color: #ffd75c;
  background: #fff8d7;
}

.saved-site div {
  display: flex;
  gap: 5px;
}

.danger {
  border-color: #d9aaa5;
  color: #9d2f2a;
  background: #fff4f2;
}

.filter-row,
.portability-grid,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-row button {
  min-height: 30px;
  padding: 5px 10px;
}

.blueprint-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.blueprint-list button {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
  min-height: 52px;
  padding: 6px;
}

.thumb {
  height: 40px;
  border-radius: 5px;
  background: linear-gradient(135deg, #7b5b2b, #e8cf89);
}

.thumb.coffee {
  background: linear-gradient(135deg, #4e2375, #ed9b4d);
}

.thumb.feed {
  background: linear-gradient(135deg, #f5f7ff, #5980f0);
}

.thumb.game {
  background: linear-gradient(135deg, #111, #d88321);
}

.thumb.nonprofit {
  background: linear-gradient(135deg, #381a12, #f0a766);
}

.portability-grid button {
  flex: 1 1 120px;
}

.tab-workspace {
  min-width: 0;
  overflow: auto;
  padding: 18px;
  background: #fffdf8;
}

.tab-panel {
  display: none;
}

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

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.workspace-head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.06;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  background: #fff4e5;
  color: #5c4530;
  line-height: 1.45;
}

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

.settings-grid label:not(.check-card) {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 700;
}

.reset-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e6c6a8;
  background: #fff7ef;
}

.reset-band span {
  color: var(--muted);
}

.file-grid {
  display: grid;
  grid-template-columns: minmax(180px, 28%) minmax(0, 1fr);
  min-height: 510px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.tree {
  list-style: none;
  margin: 0;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: #f9f6ef;
}

.tree li {
  padding: 8px 9px;
  border-radius: 6px;
  color: #3d3934;
  font-size: 13px;
}

.tree li.open {
  font-weight: 800;
}

.tree li.selected {
  color: var(--blue-dark);
  background: #eef1ff;
}

.code-pane,
.log-console {
  margin: 0;
  overflow: auto;
  padding: 16px;
  background: #fff;
  color: #9c351d;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.blueprint-grid {
  min-height: 430px;
}

.database-card {
  margin-bottom: 14px;
  padding: 18px;
  border-left: 5px solid var(--teal);
  background: #eef8f6;
  line-height: 1.5;
}

.data-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.data-list div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-list dt {
  font-weight: 800;
}

.data-list dd {
  margin: 0;
  color: var(--muted);
}

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

.log-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.log-grid strong,
.log-grid span {
  display: block;
}

.log-grid span {
  margin-top: 8px;
  color: var(--teal);
}

.log-console {
  min-height: 210px;
  color: #d9f6e4;
  background: #141a18;
  border-radius: 8px;
}

.preview-rail {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fffdf8;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.preview-toolbar div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.mini-browser {
  min-width: 0;
  margin: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.admin-strip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  color: #e9eef2;
  background: #20282d;
  font-size: 11px;
}

.site-nav {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}

.site-nav strong {
  font-size: 15px;
}

.site-body {
  position: relative;
  min-height: 520px;
  padding: 28px 18px;
  overflow: hidden;
}

.site-body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.15;
}

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

.site-body p {
  max-width: 25ch;
  font-size: 16px;
  line-height: 1.5;
}

.site-body mark {
  display: inline;
  background: #ffe78f;
}

.site-body button {
  display: block;
  width: 100%;
  margin-top: 18px;
  border-color: var(--blue);
  color: white;
  background: var(--blue);
}

.preview-mark {
  position: absolute;
  right: -110px;
  bottom: 40px;
  width: 260px;
  height: 260px;
  display: grid;
  place-items: center;
  border: 28px solid #2de775;
  border-radius: 50%;
  color: #1e1e1e;
  font-family: Georgia, serif;
  font-size: 150px;
  font-weight: 800;
  opacity: 0.9;
}

.preview-note {
  margin: 0 14px 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f5ecdf;
  font-size: 13px;
}

.preview-note span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .takeover {
    grid-template-columns: 1fr;
    height: auto;
  }

  .preview-rail {
    min-height: 520px;
  }

  .site-body {
    min-height: 360px;
  }
}

@media (max-width: 860px) {
  body {
    background: var(--soft);
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .takeover {
    padding: 8px;
    min-height: 0;
  }

  .site-header,
  .workspace-head,
  .reset-band,
  .preview-toolbar {
    display: grid;
  }

  .site-controls {
    justify-content: flex-start;
  }

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

  .workflow-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }

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

  .file-grid,
  .data-list div {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .site-identity {
    display: grid;
  }

  .site-controls button,
  .toolbar button,
  .portability-grid button,
  .filter-row button {
    flex: 1 1 auto;
  }

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