:root {
  --wp-blue: #0073aa;
  --wp-blue-dark: #005f8d;
  --ink: #1d2327;
  --muted: #646970;
  --line: #dcdcde;
  --soft-line: #eef0f2;
  --panel: #ffffff;
  --canvas: #f6f7f7;
  --bar: #1d2327;
  --warning: #b32d2e;
  --good: #008a20;
  --focus: 0 0 0 2px rgba(0, 115, 170, .18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.studio-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  grid-template-rows: 50px minmax(0, 1fr);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bar);
  color: #f0f0f1;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.wp-badge {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

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

.path-box {
  flex: 1;
}

.path-box span,
.search-box span {
  color: var(--muted);
  font-size: 12px;
}

.path-box input,
.search-box input,
.modal-card input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
  padding: 6px 9px;
}

.topbar .path-box input {
  border-color: #3c434a;
  background: #2c3338;
  color: #f0f0f1;
}

.save-state {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.save-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  background: #dba617;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
  min-height: 34px;
  padding: 7px 11px;
}

.icon-button,
.top-action {
  width: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.topbar .icon-button {
  border-color: transparent;
  background: transparent;
  color: #c3c4c7;
}

.topbar .top-action {
  width: auto;
  min-width: 34px;
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
  color: #c3c4c7;
  font-weight: 700;
}

.button:hover,
.icon-button:hover,
.top-action:hover,
.route-card:hover,
.data-row:hover,
.rail-link:hover,
.blueprint-card:hover,
.manager-tabs button:hover {
  border-color: var(--wp-blue);
  box-shadow: var(--focus);
}

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

.button-primary:hover {
  background: var(--wp-blue-dark);
}

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

.button-ghost {
  background: #f6f7f7;
}

.button-danger {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}

.rail {
  grid-row: 2;
  padding: 18px 16px;
  border-right: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 50px;
  height: calc(100vh - 50px);
}

.rail-title {
  display: grid;
  gap: 3px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft-line);
}

.rail-title span,
.rail-note span,
small,
.label,
.eyebrow {
  color: var(--muted);
}

.rail nav {
  display: grid;
  gap: 4px;
  margin: 18px 0;
}

.rail-link {
  min-height: 38px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 2px;
}

.rail-link.is-active {
  border-left: 4px solid var(--wp-blue);
  background: #f0f6fc;
  font-weight: 700;
}

.rail-note {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #f6f7f7;
  border: 1px solid var(--line);
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.page-heading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

.quick-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 1.1fr 1.4fr;
  border: 1px solid var(--line);
  background: #fff;
}

.quick-strip > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--soft-line);
}

.quick-strip > div:last-child {
  border-right: 0;
}

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

.panel,
.section-panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.config-panel {
  min-width: 0;
}

.panel-header,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.config-table,
.data-table {
  display: grid;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) minmax(110px, .8fr) minmax(180px, 1fr) minmax(130px, .8fr);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--soft-line);
}

.config-row > span:first-child,
.data-row > span:first-child {
  display: grid;
  gap: 2px;
}

.config-head,
.data-head {
  background: #f6f7f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #dcdcde;
  position: relative;
  flex: none;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 1px;
  top: 1px;
  border-radius: 50%;
  background: #fff;
}

.switch input:checked + span {
  background: var(--wp-blue);
  border-color: var(--wp-blue);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 22px;
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink);
  background: #fff;
}

.status-badge.danger {
  border-color: #f0c8c8;
  color: var(--warning);
  background: #fff5f5;
}

.status-badge.warn {
  border-color: #e0c27a;
  color: #7a5400;
  background: #fff8e5;
}

.status-badge.good {
  border-color: #9bd39b;
  color: var(--good);
  background: #f2fbf2;
}

.reset-panel {
  position: sticky;
  top: 72px;
}

.reset-stack {
  display: grid;
}

.reset-item {
  display: grid;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--soft-line);
}

.reset-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.reset-item.is-critical {
  border-left: 4px solid var(--warning);
  background: #fff8f8;
}

.progress-line {
  width: 100%;
  height: 6px;
  background: #dcdcde;
  overflow: hidden;
}

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

.preview-band,
.section-panel {
  margin-top: 18px;
}

.browser-mock {
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.mock-adminbar {
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  background: #1d2327;
  color: #f0f0f1;
  font-size: 13px;
}

.mock-adminbar strong {
  margin-left: auto;
}

.mock-page {
  min-height: 330px;
}

.mock-page nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px;
  border-bottom: 1px solid transparent;
}

.mock-content {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(260px, 1fr);
  gap: 26px;
  align-items: center;
  padding: 56px 56px 64px;
}

.mock-content h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.14;
}

.mock-content h2 span {
  color: #3858e9;
}

.mock-content p {
  font-size: 19px;
}

.mock-content mark {
  background: #fff2a8;
}

.mock-content button {
  display: block;
  margin-top: 22px;
  min-height: 44px;
  border: 0;
  background: #3858e9;
  color: #fff;
  padding: 10px 18px;
}

.wp-orbit {
  aspect-ratio: 1.6 / 1;
  display: grid;
  place-items: center;
  border: 24px solid #30e877;
  border-radius: 50%;
  color: #1d2327;
  opacity: .92;
}

.wp-orbit span {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border: 12px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 88px;
  font-weight: 700;
}

.section-panel {
  scroll-margin-top: 68px;
}

.data-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .9fr) minmax(110px, .7fr) minmax(130px, .8fr) minmax(150px, .9fr);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.data-row.is-selected {
  border-left: 4px solid var(--wp-blue);
  background: #f0f6fc;
}

.row-actions {
  color: var(--wp-blue);
  font-weight: 700;
}

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

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

.route-card,
.blueprint-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 14px;
  display: grid;
  gap: 6px;
  min-height: 92px;
}

.route-card span,
.blueprint-card small {
  color: var(--muted);
}

.manager-tabs,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.manager-tabs button,
.chips button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 11px;
  border-radius: 999px;
}

.manager-tabs button.is-active,
.chips button.is-active {
  background: var(--wp-blue);
  border-color: var(--wp-blue);
  color: #fff;
}

.tool-panel {
  display: none;
  padding: 16px;
}

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

.mini-table,
.database-grid,
.logs-grid {
  display: grid;
  grid-template-columns: minmax(140px, .7fr) minmax(0, 1fr);
  border: 1px solid var(--line);
}

.mini-table span,
.mini-table strong,
.database-grid div,
.logs-grid div {
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
}

.mini-table span {
  color: var(--muted);
  background: #f6f7f7;
}

.database-grid,
.logs-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.database-grid div,
.logs-grid div {
  display: grid;
  gap: 5px;
  border-right: 1px solid var(--soft-line);
}

.database-grid div:last-child,
.logs-grid div:last-child {
  border-right: 0;
}

.database-grid span,
.logs-grid span {
  color: var(--muted);
}

.file-browser {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  border: 1px solid var(--line);
}

.file-tree {
  display: grid;
  align-content: start;
  border-right: 1px solid var(--line);
  background: #f6f7f7;
}

.file-tree button {
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  background: transparent;
  text-align: left;
  padding: 8px 12px;
}

.file-tree button.is-active {
  background: #fff;
  border-left: 4px solid var(--wp-blue);
  font-weight: 700;
}

.editor {
  min-width: 0;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

pre {
  margin: 0;
  overflow: auto;
  min-height: 210px;
  padding: 14px;
  background: #fbfbfc;
  color: #1d2327;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.search-box {
  min-width: min(340px, 100%);
}

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

.blueprint-card {
  padding: 0;
  overflow: hidden;
}

.blueprint-card strong,
.blueprint-card small {
  padding-inline: 12px;
}

.blueprint-card small {
  padding-bottom: 12px;
}

.thumb {
  display: block;
  min-height: 132px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #7b6b43, #f6f7f7);
}

.thumb.art {
  background:
    linear-gradient(90deg, rgba(0,0,0,.16) 0 1px, transparent 1px 33%),
    linear-gradient(135deg, #8f6a22, #93c5c1 46%, #ecd4a7);
}

.thumb.coffee {
  background: linear-gradient(180deg, #512475 0 40%, #f0a451 40% 72%, #8b4b2c 72%);
}

.thumb.feed {
  background: linear-gradient(180deg, #ffffff 0 24%, #dce8ff 24% 27%, #ffffff 27%),
    repeating-linear-gradient(0deg, transparent 0 18px, #e5e7eb 18px 20px);
}

.thumb.gaming {
  background: linear-gradient(180deg, #050505 0 42%, #fff 42%),
    radial-gradient(circle at 24% 75%, #b52a1f, transparent 25%);
}

.thumb.nonprofit {
  background: linear-gradient(135deg, #3b1d0e, #cf6d2d 48%, #3b1d0e);
}

.thumb.blog {
  background: linear-gradient(135deg, #6f113c, #25061d);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-card footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.modal-body label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

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

.route-card.is-selected {
  border-color: var(--wp-blue);
  box-shadow: inset 4px 0 0 var(--wp-blue);
}

@media (max-width: 1180px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    grid-row: auto;
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .reset-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
  }

  .path-box {
    order: 6;
    flex-basis: 100%;
  }

  .quick-strip,
  .route-grid,
  .route-grid.compact,
  .blueprint-grid,
  .database-grid,
  .logs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .config-row,
  .data-row {
    grid-template-columns: 1fr;
  }

  .config-head,
  .data-head {
    display: none;
  }

  .mock-content,
  .file-browser {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .workspace {
    padding: 12px;
  }

  .rail {
    padding: 12px;
  }

  .rail nav,
  .quick-strip,
  .route-grid,
  .route-grid.compact,
  .blueprint-grid,
  .destination-grid,
  .database-grid,
  .logs-grid {
    grid-template-columns: 1fr;
  }

  .section-header,
  .panel-header,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .mock-adminbar,
  .mock-page nav {
    flex-wrap: wrap;
  }

  .mock-content {
    padding: 28px 20px 34px;
  }

  .wp-orbit {
    display: none;
  }
}
