:root {
  --black: #050505;
  --ink: #101114;
  --muted: #5f6368;
  --line: #d7dade;
  --panel: #ffffff;
  --soft: #f5f6f7;
  --blue: #3157f4;
  --blue-dark: #1735aa;
  --green: #0a7f45;
  --amber: #a16207;
  --red: #b42318;
  --cyan: #007cba;
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 1px solid #bfc5cc;
  background: #fff;
  color: #111;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  border-color: #6f7782;
}

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

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

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7ccd1;
  background: #fff;
  color: #111;
  min-height: 34px;
  padding: 7px 9px;
}

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

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 58px;
  background: var(--black);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #34383f;
}

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

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

.brand strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand #shellSubtitle {
  color: #aeb4bd;
  font-size: 12px;
  margin-top: 2px;
}

.mark,
.wpIcon {
  width: 32px;
  height: 32px;
  border: 2px solid currentColor;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 850;
  flex: 0 0 auto;
}

.pathbar {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) auto;
  gap: 6px;
  min-width: 0;
}

.pathbar input {
  background: #262a31;
  border-color: #3a4049;
  color: #fff;
}

.pathbar button,
.shellActions button,
.iconButton {
  background: #1d2127;
  color: #fff;
  border-color: #3a4049;
}

.shellActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(420px, 1fr) 390px;
  gap: 10px;
  padding: 10px;
  min-height: calc(100vh - 58px);
}

.panel,
.previewPanel {
  background: var(--panel);
  border: 1px solid #22252a;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

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

.panelHeader.compact {
  align-items: center;
}

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

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

h1,
h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.objectSummary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.objectSummary > div {
  padding: 11px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.metric {
  font-size: 23px;
  color: #111;
  font-weight: 850;
}

.objectList {
  display: grid;
  gap: 8px;
  padding: 10px;
  max-height: 34vh;
  overflow: auto;
  border-bottom: 1px solid var(--line);
}

.objectRow {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  min-height: auto;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.objectRow.active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
  background: #f7f9ff;
}

.objectRow strong,
.objectRow small {
  display: block;
}

.objectRow small {
  color: var(--muted);
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.35;
}

.rowActions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rowActions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.miniSection {
  padding: 12px 10px;
  overflow: auto;
}

.sectionTitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sectionTitle h2 {
  font-size: 14px;
}

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

.routeGrid {
  display: grid;
  gap: 7px;
}

.route {
  text-align: left;
  min-height: 58px;
  display: block;
  padding: 9px 10px;
  background: var(--soft);
}

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

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

.route span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.previewPanel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: #fff;
}

.browserChrome,
.wpAdminBar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 10px;
  flex: 0 0 auto;
}

.browserChrome {
  background: #1d2127;
  color: #d7dde5;
  border-bottom: 1px solid #373d45;
}

.browserChrome #previewUrl {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #767e89;
  margin-right: 4px;
}

.wpAdminBar {
  background: #252a31;
  color: #f1f3f4;
  font-size: 13px;
}

.wpAdminBar .push {
  margin-left: auto;
}

.wpIcon {
  width: 22px;
  height: 22px;
  font-size: 12px;
}

.sitePreview {
  flex: 1;
  min-height: 520px;
  overflow: auto;
  background: #fff;
}

.sitePreview nav {
  height: 76px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  gap: 28px;
  border-bottom: 1px solid #f0f0f0;
}

.sitePreview nav strong {
  margin-right: auto;
  font-size: 19px;
}

.hero {
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(260px, 1.1fr);
  align-items: center;
  gap: 32px;
  padding: 38px clamp(28px, 5vw, 70px);
}

.heroCopy {
  max-width: 540px;
}

.previewKicker {
  display: inline-block;
  background: #fff0b3;
  padding: 3px 7px;
  font-size: 13px;
  font-weight: 750;
}

.hero h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: #2f55f5;
  font-weight: 500;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.15;
  margin: 12px 0 18px;
}

.hero p {
  font-size: 20px;
  line-height: 1.45;
}

.notice {
  background: #fff5c2;
  border-left: 4px solid #d1a000;
  padding: 9px 10px;
  font-weight: 650;
  margin: 16px 0;
}

.previewGlyph {
  width: min(42vw, 430px);
  aspect-ratio: 1;
  border: 28px solid #28e779;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: center;
  position: relative;
}

.previewGlyph::after {
  content: "";
  position: absolute;
  width: 92%;
  height: 28%;
  border: 24px solid #28e779;
  border-left: 0;
  border-right: 0;
  border-radius: 50%;
  bottom: 12%;
}

.previewGlyph span {
  width: 55%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 16px solid #1c1c1c;
  border-radius: 50%;
  color: #1c1c1c;
  font-family: Georgia, serif;
  font-size: clamp(76px, 8vw, 150px);
  font-weight: 900;
  background: #fff;
  z-index: 1;
}

.commandPanel {
  min-width: 0;
}

.modeTabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.modeTabs button {
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent;
  min-height: 42px;
  font-size: 12px;
  background: #fff;
}

.modeTabs button.active {
  border-bottom-color: #111;
  background: #f2f3f5;
}

.view {
  display: none;
  min-height: 0;
  overflow: auto;
}

.view.active {
  display: block;
}

.commandStack,
#managerBody,
.detailBox {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
  padding: 0 14px 12px;
  font-weight: 750;
  font-size: 12px;
}

.field.inline {
  padding: 0;
}

.field span,
.choice small,
.muted {
  color: var(--muted);
  font-weight: 500;
}

.buttonRow,
.transferActions,
.inlineActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #bfc5cc;
  padding: 2px 8px;
  background: #f3f4f5;
  color: #111;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.ok {
  background: #eaf7ee;
  border-color: #a7d8b7;
  color: var(--green);
}

.status.warning {
  background: #fff7df;
  border-color: #f2cf79;
  color: var(--amber);
}

.status.danger {
  background: #fff1f0;
  border-color: #f3b5ae;
  color: var(--red);
}

.routeCard,
.resultBox,
.detailBox,
.managerPane,
.destructiveBox,
.folderGrant,
.progressBlock {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.routeCard {
  display: grid;
  gap: 11px;
}

.resultBox {
  margin: 0 14px 14px;
  background: var(--soft);
  color: #30343a;
  line-height: 1.45;
}

.saveChoice {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.choice {
  border: 1px solid var(--line);
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  cursor: pointer;
}

.choice.active {
  border-color: var(--blue);
  background: #f7f9ff;
}

.choice strong,
.choice small {
  display: block;
}

.folderGrant {
  margin: 0 14px 12px;
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.progressBlock {
  margin: 0 14px 12px;
}

.progressLine {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 7px;
}

.progress {
  height: 8px;
  background: #e4e7eb;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width .2s ease;
}

#view-save .buttonRow {
  padding: 0 14px 14px;
}

.managerTabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}

.managerTabs button {
  border: 0;
  border-right: 1px solid var(--line);
  min-height: 38px;
  font-size: 12px;
  background: #fff;
}

.managerTabs button.active {
  background: #111;
  color: #fff;
}

.settingsGrid {
  display: grid;
  gap: 10px;
}

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

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

.fileLayout {
  display: grid;
  grid-template-columns: 128px 1fr;
  min-height: 260px;
  border: 1px solid var(--line);
}

.fileTree {
  background: #f6f7f8;
  border-right: 1px solid var(--line);
  padding: 8px;
  display: grid;
  gap: 5px;
  align-content: start;
  font-size: 12px;
}

.fileTree button {
  text-align: left;
  min-height: 28px;
  padding: 0 7px;
  background: #fff;
}

.editorPane {
  min-width: 0;
}

.editorHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.editorPane textarea {
  border: 0;
  min-height: 225px;
}

.filterLine {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 8px;
  padding: 14px 14px 0;
}

.blueprintList {
  padding: 14px;
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
}

.blueprintCard {
  text-align: left;
  display: grid;
  gap: 4px;
  min-height: auto;
  padding: 10px;
}

.blueprintCard.active {
  border-color: var(--blue);
  background: #f7f9ff;
}

.tagLine {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  background: #edf0f2;
  color: #4a515a;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
}

.transferActions {
  padding: 14px;
}

.destructiveBox {
  margin: 0 14px 14px;
  display: none;
  gap: 8px;
  border-color: #f1b8b1;
  background: #fff6f5;
}

.destructiveBox.show {
  display: grid;
}

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

.eventLog li {
  border: 1px solid var(--line);
  padding: 9px 10px;
  background: #fff;
  display: grid;
  gap: 3px;
}

.eventLog strong {
  font-size: 13px;
}

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

.deleteConfirm {
  border: 1px solid #f0b2aa;
  background: #fff6f5;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.runtimeStrip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.runtimeStrip div {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 9px;
}

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

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

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 310px minmax(380px, 1fr);
  }

  .commandPanel {
    grid-column: 1 / -1;
    min-height: 420px;
  }

  .view.active {
    max-height: none;
  }
}

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

  .shellActions {
    justify-content: flex-start;
  }

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

  .objectsPanel,
  .commandPanel {
    min-height: auto;
  }

  .objectList {
    max-height: none;
  }

  .sitePreview {
    min-height: auto;
  }

  .sitePreview nav {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 26px 18px 34px;
  }

  .previewGlyph {
    width: min(70vw, 320px);
  }

  .modeTabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .fileLayout,
  .filterLine,
  .runtimeStrip {
    grid-template-columns: 1fr;
  }
}
