:root {
  color-scheme: light;
  --ink: #1d2327;
  --muted: #646970;
  --line: #dcdcde;
  --soft-line: #eff0f1;
  --panel: #fff;
  --canvas: #f6f7f7;
  --dark: #1d2327;
  --blue: #007cba;
  --blue-dark: #005a87;
  --green: #008a20;
  --amber: #dba617;
  --red: #cc1818;
  --red-dark: #8a2424;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #111517;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}

button:disabled {
  cursor: progress;
  opacity: 0.68;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b8c0c7;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  min-height: 34px;
  padding: 6px 9px;
}

textarea {
  min-height: 220px;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.app-shell {
  min-height: 100vh;
  background: var(--canvas);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(250px, 1.1fr) minmax(420px, 2fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px 12px;
  border-bottom: 1px solid #2c3338;
  color: #f0f0f1;
  background: var(--dark);
}

.brand,
.path-shell,
.shell-actions,
.browser-status,
.status-ledger,
.manager-head,
.section-head,
.tool-row,
.tabbar,
.chip-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  line-height: 1.15;
}

.brand span:not(.brand-mark) {
  margin-top: 2px;
  color: #b8c0c7;
  font-size: 12px;
}

.brand-mark,
.wp-dot {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

.path-shell {
  gap: 8px;
  min-width: 0;
}

.path-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 220px;
  padding-left: 10px;
  border: 1px solid #3c434a;
  border-radius: 6px;
  background: #2c3338;
}

.path-field span {
  color: #b8c0c7;
  font-size: 12px;
  text-transform: uppercase;
}

.path-field input {
  min-height: 34px;
  border: 0;
  color: #f0f0f1;
  background: transparent;
}

.shell-actions {
  justify-content: flex-end;
  gap: 8px;
}

.topbar button {
  border-color: #50575e;
  color: #f0f0f1;
  background: #2c3338;
}

.topbar .primary {
  border-color: #f0c33c;
  color: #1d2327;
  background: #f0c33c;
}

.topbar .danger-outline {
  border-color: #8a2424;
  color: #ffb3b3;
}

.icon-button {
  flex: 0 0 auto;
}

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

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

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

.danger-outline {
  color: var(--red-dark);
  background: #fff;
}

.state-pill,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.state-pill.amber {
  border-color: rgba(219, 166, 23, 0.38);
  color: #6f5400;
  background: #fff8e5;
}

.state-pill.green,
.ok {
  border-color: rgba(0, 138, 32, 0.3);
  color: var(--green);
  background: #edfaef;
}

.state-pill.red {
  border-color: rgba(204, 24, 24, 0.3);
  color: var(--red-dark);
  background: #fcf0f1;
}

.route-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.route-strip button {
  display: block;
  min-height: 58px;
  padding: 8px 10px;
  text-align: left;
}

.route-strip strong,
.route-strip span {
  display: block;
  overflow-wrap: anywhere;
}

.route-strip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 12px;
  height: calc(100vh - 139px);
  min-height: 760px;
  padding: 12px;
}

.browser,
.inspector,
.manager,
.command-lens,
.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.browser {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
}

.browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.mini-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.browser-status {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.wp-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 32px;
  padding: 0 10px;
  color: #c3c4c7;
  background: #1d2327;
  font-size: 13px;
}

.wp-dot {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.wp-admin-greeting {
  margin-left: auto;
}

.preview-frame {
  position: relative;
  min-width: 0;
  overflow: auto;
  background: #fff;
}

.front-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
  min-height: 100%;
  padding: clamp(32px, 6vw, 78px);
  overflow: hidden;
}

.front-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.front-copy h1 {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.25;
}

.front-copy h1 span {
  color: #3858e9;
}

.front-copy p {
  margin: 0 0 20px;
  font-size: clamp(17px, 1.6vw, 23px);
  line-height: 1.45;
}

mark {
  background: #fff0a6;
}

.front-copy button {
  min-width: 320px;
  min-height: 48px;
  border-color: #3858e9;
  color: #fff;
  background: #3858e9;
  font-weight: 700;
}

.playground-art {
  position: relative;
  min-height: 520px;
}

.green-ring {
  position: absolute;
  right: -10%;
  border: 46px solid #32e875;
  border-radius: 50%;
  transform: rotate(-7deg);
}

.ring-a {
  top: 90px;
  width: 620px;
  height: 260px;
}

.ring-b {
  top: 310px;
  width: 620px;
  height: 260px;
}

.wp-orb {
  position: absolute;
  top: 0;
  right: 17%;
  display: grid;
  place-items: center;
  width: 310px;
  height: 310px;
  border: 18px solid #1d1d1f;
  border-radius: 50%;
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 210px;
  font-weight: 700;
}

.admin-page {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100%;
}

.admin-sidebar {
  padding: 18px 0;
  color: #f0f0f1;
  background: #1d2327;
}

.admin-sidebar strong,
.admin-sidebar span {
  display: block;
  padding: 9px 18px;
}

.admin-sidebar span.active {
  background: var(--blue);
}

.admin-main {
  padding: clamp(24px, 4vw, 52px);
  background: #f0f0f1;
}

.admin-main h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 42px);
}

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

.dashboard-card,
.result-card,
.notice,
.destination,
.gallery-card,
.editor-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.dashboard-card {
  min-height: 150px;
  padding: 18px;
}

.dashboard-card strong {
  display: block;
  margin-bottom: 10px;
}

.status-ledger {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.status-ledger div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: var(--canvas);
}

.status-ledger strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.inspector {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.command-lens {
  padding: 12px;
}

.section-head,
.manager-head {
  justify-content: space-between;
  gap: 10px;
}

.section-head h2,
.section-head h3,
.manager-head h2,
.gallery-card h3,
.log-columns h3,
.event-stream h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.section-head.compact {
  margin-bottom: 10px;
}

.command-results {
  display: grid;
  gap: 6px;
  max-height: 150px;
  margin-top: 8px;
  overflow: auto;
}

.result-group {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.command-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 7px 8px;
  text-align: left;
}

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

.command-form {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6f7f7;
}

.command-form p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.command-form label {
  display: block;
  margin: 8px 0;
  font-size: 13px;
}

.manager {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.manager-head {
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.manager-head button {
  padding-inline: 9px;
  font-size: 12px;
}

.tabbar {
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tabbar button {
  min-width: max-content;
  border: 0;
  border-right: 1px solid var(--soft-line);
  border-radius: 0;
  background: #fff;
  font-size: 13px;
}

.tabbar button.active {
  box-shadow: inset 0 -3px 0 var(--blue);
  color: var(--blue-dark);
  font-weight: 700;
}

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

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

.tool-row {
  gap: 8px;
  flex-wrap: wrap;
}

.tool-row.end {
  justify-content: flex-end;
}

.file-layout {
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.file-tree {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.file-tree strong {
  display: block;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.tree-row {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  border-radius: 0;
  text-align: left;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.tree-row.selected {
  box-shadow: inset 3px 0 0 var(--blue);
  background: #f0f6fc;
}

.editor-card,
.gallery-card {
  padding: 10px;
}

.editor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.editor-meta strong {
  overflow-wrap: anywhere;
}

.progress-wrap {
  margin: 10px 0;
}

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcdcde;
}

.progress-line span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.2s ease;
}

.progress-wrap small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.blueprint-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(0, 1fr);
  gap: 10px;
}

.chip-row {
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chip {
  min-height: 28px;
  background: #f6f7f7;
}

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

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

.blueprint-item {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  text-align: left;
}

.blueprint-item strong,
.blueprint-item span {
  display: block;
}

.blueprint-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.blueprint-item.selected {
  border-color: var(--blue);
  background: #f0f6fc;
}

.validation,
.result-card,
.notice {
  margin: 10px 0;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.validation.ok,
.notice {
  border-left: 4px solid var(--blue);
  background: #f0f6fc;
}

.notice.warning {
  border-left-color: var(--amber);
  background: #fff8e5;
}

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

.data-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
}

.data-list dt {
  color: var(--muted);
  font-weight: 700;
}

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

.log-columns {
  display: grid;
  gap: 10px;
}

.log-columns > div,
.event-stream {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.log-columns ul,
.event-stream ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-grid,
.start-grid {
  display: grid;
  gap: 10px;
}

.settings-grid label,
.start-grid label,
.stacked-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-grid label input,
.settings-grid label select,
.start-grid label input {
  color: var(--ink);
  font-weight: 400;
}

.checkbox {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 400 !important;
}

.checkbox input {
  width: auto;
  min-height: 0;
}

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

.destination {
  display: block;
  padding: 12px;
}

.destination.selected {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
  background: #f0f6fc;
}

.destination input {
  width: auto;
  min-height: 0;
  margin-right: 6px;
}

.destination strong,
.destination span,
.destination p {
  display: block;
}

.destination p,
.destination span {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.saved-list {
  margin-top: 12px;
}

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

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

.saved-row.active {
  border-color: var(--blue);
  background: #f0f6fc;
}

.saved-row strong,
.saved-row span {
  display: block;
}

.saved-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.saved-row-actions {
  display: flex;
  gap: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.56);
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  padding: 16px;
  overflow: auto;
  box-shadow: var(--shadow);
}

.modal.narrow {
  width: min(520px, 100%);
}

.modal p {
  color: var(--muted);
  line-height: 1.45;
}

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

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

  .workspace {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .browser {
    min-height: 680px;
  }

  .inspector {
    min-height: 760px;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    padding: 10px;
  }

  .path-shell,
  .shell-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .path-field {
    grid-template-columns: 1fr;
    gap: 0;
    min-width: 0;
    padding: 6px 8px;
  }

  .route-strip {
    grid-template-columns: 1fr 1fr;
  }

  .workspace {
    padding: 8px;
  }

  .browser {
    min-height: 620px;
  }

  .front-page,
  .admin-page,
  .file-layout,
  .blueprint-grid,
  .save-destinations,
  .destination-grid,
  .dashboard-grid,
  .status-ledger {
    grid-template-columns: 1fr;
  }

  .front-page {
    padding: 28px 18px;
  }

  .front-copy button {
    min-width: 0;
    width: 100%;
  }

  .playground-art {
    min-height: 240px;
  }

  .green-ring {
    right: -210px;
    border-width: 28px;
  }

  .ring-a,
  .ring-b {
    width: 460px;
    height: 180px;
  }

  .ring-a {
    top: 28px;
  }

  .ring-b {
    top: 160px;
  }

  .wp-orb {
    top: 4px;
    right: 20px;
    width: 160px;
    height: 160px;
    border-width: 10px;
    font-size: 104px;
  }

  .wp-toolbar {
    gap: 10px;
    overflow-x: auto;
  }

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