:root {
  color-scheme: light;
  --bg: #f0f2f5;
  --shell: #1d2327;
  --shell-2: #2c3338;
  --panel: #ffffff;
  --panel-2: #f6f7f7;
  --ink: #1d2327;
  --muted: #646970;
  --line: #dcdcde;
  --blue: #2271b1;
  --blue-2: #135e96;
  --green: #008a20;
  --amber: #dba617;
  --red: #b32d2e;
  --purple: #6c4ab6;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #101517;
}

.command-bar {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--shell);
  color: #f6f7f7;
  border-bottom: 1px solid #3c434a;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.brand-mark,
.wp-logo {
  display: inline-grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 800;
}

.icon-button,
.toolbar-button,
.button,
.small-button,
.filters button,
.command-picker button,
.inspector-tabs button,
.manager-tabs button,
.file-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 650;
}

.icon-button {
  border-color: #56616a;
  background: transparent;
  color: #f6f7f7;
}

.toolbar-button {
  border-color: #56616a;
  background: #2c3338;
  color: #f6f7f7;
  white-space: nowrap;
}

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

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

.path-field input {
  inline-size: 100%;
  block-size: 34px;
  border: 1px solid #56616a;
  border-radius: 7px;
  background: #3c434a;
  color: #f6f7f7;
  padding: 0 12px;
}

.top-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  border-radius: 999px;
  background: #eef0f2;
  color: #2c3338;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.badge.success {
  background: #e7f6ed;
  color: var(--green);
}

.badge.warning {
  background: #fcf3cf;
  color: #755400;
}

.badge.danger {
  background: #f8e3e3;
  color: var(--red);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(540px, 1fr) minmax(390px, 440px);
  gap: 0;
}

.browser-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  background: #dfe3e7;
  border-right: 1px solid #3c434a;
}

.browser-status {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(380px, 1.35fr);
  gap: 18px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.label,
.mini-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.browser-status h1,
.inspector-head h2 {
  margin: 3px 0 0;
  font-size: 19px;
  line-height: 1.2;
}

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

.identity-grid div {
  min-width: 0;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.identity-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.identity-grid dd {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.browser-frame {
  min-width: 0;
  margin: 14px;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.browser-frame.loading .site-canvas {
  opacity: 0.45;
}

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

.admin-user {
  margin-left: auto;
}

.site-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid #f0f0f1;
}

.site-header strong {
  font-size: 18px;
}

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

.site-header button {
  border: 0;
  background: transparent;
  color: #2c3338;
  padding: 5px 0;
}

.site-canvas {
  position: relative;
  flex: 1;
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(220px, 0.38fr);
  align-items: center;
  gap: 28px;
  padding: clamp(28px, 6vw, 72px);
  background:
    linear-gradient(90deg, #fff 0 58%, rgba(34, 113, 177, 0.08) 58% 100%),
    #fff;
}

.site-copy {
  max-width: 520px;
}

.site-copy h2 {
  margin: 10px 0 18px;
  font-family: Georgia, serif;
  font-size: clamp(38px, 4.6vw, 68px);
  line-height: 1.06;
  font-weight: 400;
}

.site-copy h2 span {
  color: #3858e9;
}

.site-copy p {
  font-size: 20px;
  line-height: 1.46;
}

.site-copy .note {
  display: inline;
  background: #fff2b4;
  font-size: 18px;
}

.wp-button {
  display: block;
  margin-top: 22px;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: #3858e9;
  color: #fff;
  padding: 0 18px;
  font-weight: 750;
}

.runtime-card {
  justify-self: end;
  inline-size: min(100%, 300px);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px;
  border: 1px solid #b7c7d8;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 138, 32, 0.16), rgba(34, 113, 177, 0.13)),
    #fff;
}

.runtime-card strong {
  font-size: 20px;
}

.runtime-card span {
  color: var(--muted);
}

.mini-meter,
.progress {
  inline-size: 100%;
  block-size: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcdcde;
}

.mini-meter span,
.progress span {
  display: block;
  inline-size: 72%;
  block-size: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: inline-size 220ms ease;
}

.progress.red span {
  background: var(--red);
}

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

.under-browser section {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.under-browser strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.inspector {
  min-width: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 52px);
}

.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.health-dot {
  white-space: nowrap;
  border-radius: 999px;
  background: #fcf3cf;
  color: #6b4c00;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.inspector-tabs,
.command-picker,
.manager-tabs {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.inspector-tabs button,
.command-picker button,
.manager-tabs button {
  flex: 0 0 auto;
  background: var(--panel-2);
  color: #2c3338;
}

.inspector-tabs button.active,
.command-picker button.active,
.manager-tabs button.active,
.filters button.active {
  background: var(--shell);
  border-color: var(--shell);
  color: #fff;
}

.panel {
  display: none;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.panel.active {
  display: block;
}

.command-view,
.manager-view {
  display: none;
}

.command-view.active,
.manager-view.active {
  display: grid;
  gap: 14px;
}

.callout,
.consequence-box,
.pending-change,
.result-card,
.progress-card,
.inline-confirm,
.selected-detail,
.status-stack article,
.destination-card,
.route-card,
.saved-row,
.transfer-action {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.callout {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--blue);
  background: #f6f7f7;
}

.callout.warning,
.consequence-box {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.pending-change {
  border-left: 4px solid var(--purple);
  background: #f4f0ff;
  color: #33235c;
  font-weight: 750;
}

.callout.danger {
  border-left-color: var(--red);
  background: #fcf0f1;
}

.callout span,
.result-card span,
.selected-detail span,
.destination-card p,
.route-card p,
.status-stack p,
.saved-row span,
.transfer-action span,
.muted {
  color: var(--muted);
  line-height: 1.45;
}

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

label {
  display: grid;
  gap: 5px;
  color: #3c434a;
  font-size: 13px;
  font-weight: 700;
}

label input,
label select,
.search input {
  min-width: 0;
  inline-size: 100%;
  min-height: 34px;
  border: 1px solid #c3c4c7;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

label.check input {
  inline-size: auto;
  min-height: auto;
}

.button-row,
.row-actions,
.library-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.progress-card {
  display: grid;
  gap: 8px;
  background: #f6f7f7;
}

.result-card {
  display: grid;
  gap: 5px;
  background: #f6f7f7;
}

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

.destination-card,
.route-card,
.transfer-action {
  display: grid;
  gap: 9px;
  text-align: left;
}

.route-card.active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.route-card h3,
.destination-card h3 {
  margin: 0;
  font-size: 16px;
}

.catalog-head {
  display: grid;
  gap: 9px;
}

.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

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

.blueprint-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 10px;
  align-items: center;
  text-align: left;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.blueprint-row.selected {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.blueprint-row strong,
.blueprint-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.blueprint-thumb {
  grid-row: 1 / span 2;
  inline-size: 56px;
  block-size: 42px;
  border-radius: 5px;
  border: 1px solid #c3c4c7;
}

.blueprint-thumb.art {
  background: linear-gradient(135deg, #856323 0 42%, #74a8a0 42% 58%, #efc16b 58%);
}

.blueprint-thumb.coffee {
  background: linear-gradient(135deg, #552583 0 45%, #f1a35b 45% 75%, #7d3b8c 75%);
}

.blueprint-thumb.feed {
  background: linear-gradient(135deg, #fff 0 60%, #c9d7ff 60%);
}

.blueprint-thumb.gaming {
  background: linear-gradient(135deg, #050505 0 35%, #d45027 35% 60%, #fff 60%);
}

.blueprint-thumb.nonprofit {
  background: linear-gradient(135deg, #3c1f13 0 45%, #be5b37 45% 70%, #121212 70%);
}

.result-line {
  display: block;
  color: var(--blue-2);
  font-weight: 750;
}

.status-stack {
  display: grid;
  gap: 10px;
}

.log-lines {
  display: grid;
  gap: 6px;
}

.log-lines p {
  margin: 0;
  padding: 7px 8px;
  border-radius: 6px;
  background: #f6f7f7;
  font-size: 13px;
  line-height: 1.4;
}

.history-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.history-list span {
  color: var(--muted);
  font-weight: 800;
}

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

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

.saved-row.active {
  border-color: var(--blue);
  background: #f0f6fc;
  box-shadow: inset 4px 0 0 var(--blue);
}

.danger-text {
  color: var(--red);
}

.file-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

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

.file-editor li {
  padding: 7px;
  border-radius: 5px;
  font-size: 13px;
}

.file-editor li.selected {
  background: #fff;
  color: var(--blue-2);
  font-weight: 800;
}

.file-editor pre,
.blueprint-code {
  margin: 0;
  min-height: 190px;
  overflow: auto;
  background: #fbfbfc;
  color: #3c434a;
  padding: 12px;
  line-height: 1.5;
  font-size: 12px;
}

.facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(460px, 1fr) minmax(360px, 410px);
  }

  .identity-grid,
  .under-browser {
    grid-template-columns: 1fr;
  }

  .site-canvas {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .runtime-card {
    justify-self: stretch;
    min-height: 130px;
  }
}

@media (max-width: 900px) {
  .command-bar {
    grid-template-columns: 1fr auto auto;
  }

  .brand,
  .icon-button,
  .path-field,
  .top-badges {
    grid-column: 1 / -1;
  }

  .top-badges {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .workspace {
    display: block;
  }

  .browser-panel {
    min-height: auto;
  }

  .browser-status {
    grid-template-columns: 1fr;
  }

  .browser-frame {
    margin: 10px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .site-canvas {
    min-height: 430px;
    padding: 24px;
  }

  .site-copy h2 {
    font-size: 36px;
  }

  .site-copy p {
    font-size: 16px;
  }

  .inspector {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .command-bar {
    gap: 8px;
  }

  .toolbar-button,
  .icon-button,
  .button,
  .small-button {
    width: 100%;
  }

  .command-bar > .toolbar-button,
  .command-bar > .icon-button {
    width: auto;
  }

  .identity-grid,
  .save-destination-grid,
  .route-grid,
  .transfer-grid,
  .form-grid,
  .saved-row,
  .file-editor {
    grid-template-columns: 1fr;
  }

  .row-actions,
  .button-row,
  .library-tools {
    width: 100%;
  }

  .row-actions > *,
  .button-row > *,
  .library-tools > * {
    flex: 1 1 100%;
  }

  .wp-adminbar {
    flex-wrap: wrap;
    padding: 8px;
  }

  .admin-user {
    margin-left: 0;
  }
}
