:root {
  --bg: #eef1f3;
  --surface: #fbfbfa;
  --surface-2: #f4f6f5;
  --line: #d6dcda;
  --line-strong: #aeb9b5;
  --text: #17201c;
  --muted: #68736f;
  --green: #0b8f5a;
  --green-soft: #e4f5ed;
  --blue: #315be8;
  --amber: #b47b00;
  --red: #b42318;
  --shadow: 0 18px 45px rgba(22, 31, 28, .12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  min-height: 34px;
  padding: 7px 10px;
  cursor: default;
}

button:hover,
button:focus-visible {
  border-color: var(--line-strong);
  outline: 2px solid transparent;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border: 1px solid #c4ccc8;
  border-bottom-color: #97a39e;
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
}

.app {
  min-height: 100vh;
  padding: 12px;
}

.commandbar {
  display: grid;
  grid-template-columns: auto minmax(620px, max-content) minmax(250px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 251, 250, .94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
  position: sticky;
  top: 8px;
  z-index: 5;
}

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

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

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

.wpmark,
.admin-w,
.site-dot {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

.wpmark {
  width: 34px;
  height: 34px;
  border: 2px solid #151a18;
  background: #fff;
  font-size: 21px;
}

.commands {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cmd {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  background: transparent;
}

.cmd.active {
  border-color: #9ac9b1;
  background: var(--green-soft);
  color: #064c33;
}

.global-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.pathbox {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 145px;
  flex: 1;
  max-width: 390px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 9px;
}

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

input,
select {
  min-width: 0;
  width: 100%;
  height: 34px;
  border: 1px solid #cbd3cf;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 6px 9px;
}

.pathbox input {
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
}

.state {
  display: inline-flex;
  align-items: center;
  height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.unsaved {
  background: #fff1c2;
  color: #6b4a00;
}

.saved {
  background: var(--green-soft);
  color: #075a3a;
}

.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.secondary {
  background: var(--surface-2);
}

.small {
  min-height: 32px;
  padding-inline: 12px;
}

.icon-btn {
  width: auto;
  min-width: 34px;
  padding-inline: 7px;
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}

.preview-column,
.drawer {
  min-width: 0;
}

.preview-toolbar,
.run-strip,
.drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 47px;
  padding: 7px;
}

.preview-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.preview-tabs button.selected,
.site-switcher button.selected,
.log-tabs button.selected,
.filter-bar button.active {
  border-color: #1d2b25;
  background: #17201c;
  color: #fff;
}

.preview-status,
.result-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.green-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.browser-frame {
  height: min(66vh, 660px);
  min-height: 465px;
  margin-top: 12px;
  border: 1px solid #cbd3cf;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.wp-adminbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 34px;
  padding: 0 10px;
  background: #1d2327;
  color: #dfe4e7;
  font-size: 12px;
}

.wp-adminbar .right {
  margin-left: auto;
}

.admin-w {
  width: 22px;
  height: 22px;
  border: 1px solid #9aa4aa;
  color: #fff;
}

.wp-page {
  min-height: calc(100% - 34px);
  background: #fff;
}

.wp-site-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 34px;
  font-size: 16px;
}

.wp-site-head nav {
  display: flex;
  gap: 24px;
  color: #303633;
}

.wp-hero {
  display: grid;
  grid-template-columns: minmax(250px, 480px) minmax(280px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 470px;
  padding: 34px 0 34px 7%;
}

.wp-copy h1 {
  margin: 0 0 20px;
  max-width: 470px;
  font: 44px/1.28 Georgia, serif;
  letter-spacing: 0;
}

.wp-copy h1 span {
  color: #3456f1;
}

.wp-copy p {
  max-width: 460px;
  margin: 0 0 18px;
  font-size: 19px;
}

.wp-copy mark {
  display: inline-block;
  background: #fff0a8;
  margin-bottom: 18px;
  font-size: 18px;
}

.wp-copy button {
  display: block;
  width: min(100%, 390px);
  height: 54px;
  border-color: #3456f1;
  background: #3456f1;
  color: #fff;
  font-weight: 700;
}

.wp-art {
  position: relative;
  height: 440px;
  overflow: hidden;
}

.ring {
  position: absolute;
  left: 4%;
  top: 86px;
  width: 88%;
  height: 230px;
  border: 58px solid #30e876;
  border-radius: 50%;
}

.ring.lower {
  top: 250px;
  height: 180px;
  border-top-color: transparent;
}

.w-big {
  position: absolute;
  top: 6px;
  left: 26%;
  width: 300px;
  height: 300px;
  display: grid;
  place-items: center;
  border: 18px solid #1a1a1a;
  border-radius: 50%;
  background: rgba(255,255,255,.84);
  color: #171717;
  font: 190px/1 Georgia, serif;
  font-weight: 700;
}

.run-strip {
  margin-top: 12px;
  padding: 10px;
}

.strip-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
}

.strip-head strong {
  color: var(--text);
}

.steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 3px solid #c7cfcb;
  border-radius: 6px;
  background: var(--surface-2);
  padding: 8px;
}

.steps li.done {
  border-left-color: var(--green);
}

.steps li.active {
  border-color: #9ac9b1;
  border-left-color: var(--green);
  background: var(--green-soft);
}

.steps span,
.steps strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steps span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.steps strong {
  font-size: 12px;
}

.drawer {
  height: calc(100vh - 94px);
  min-height: 760px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.eyebrow {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
}

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

.panel.active {
  display: block;
}

.section-title,
.drawer-actions,
.inline-actions,
.two-buttons,
.export-row,
.log-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  justify-content: space-between;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pill.warning {
  border-color: #ebcd75;
  background: #fff5d3;
  color: #725400;
}

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

.source-row,
.saved-row,
.destination,
.blueprint-detail,
.import-result,
.compact-form,
.save-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

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

.source-row.selected {
  border-color: #9ac9b1;
  background: var(--green-soft);
}

.source-row.danger {
  border-color: #efb5af;
}

.source-row strong,
.source-row span,
.source-row label,
.field,
.compact-form label {
  display: block;
}

.source-row label,
.field,
.compact-form label,
.settings-grid label,
.search {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.mini-blueprints,
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.mini-blueprints button,
.filter-bar button {
  min-height: 30px;
  border-radius: 999px;
  font-size: 12px;
}

.destination-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.destination {
  text-align: left;
  padding: 11px;
  min-height: 92px;
}

.destination.active {
  border-color: #9ac9b1;
  background: var(--green-soft);
}

.destination span,
.saved-row small,
.bp span,
.blueprint-detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.save-box,
.compact-form,
.import-result {
  padding: 11px;
  margin-top: 10px;
}

.hidden {
  display: none;
}

.meter-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.meter {
  height: 7px;
  border-radius: 999px;
  background: #dfe5e2;
  margin: 9px 0;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

.drawer-actions {
  margin-top: 12px;
}

.saved-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px;
}

.saved-row.selected {
  border-color: #9ac9b1;
  background: var(--green-soft);
}

.site-dot {
  width: 30px;
  height: 30px;
  border: 1px solid #c3ccc8;
  background: #fff;
}

.site-dot.temp {
  background: #fff3c7;
}

.danger-btn {
  border-color: #f1aaa3;
  background: #fff3f1;
  color: var(--red);
}

.consequence {
  margin-top: 9px;
  border-left: 3px solid var(--amber);
  background: #fff8e4;
  padding: 8px 10px;
  color: #604400;
  font-size: 12px;
}

.consequence.strong {
  font-weight: 700;
}

.export-row {
  margin-top: 12px;
}

.site-switcher {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.settings-grid {
  display: grid;
  gap: 9px;
}

.settings-grid .check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  color: var(--text);
  font-weight: 500;
}

.check input {
  width: 16px;
  height: 16px;
}

.file-layout {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.tree {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.tree span,
.tree strong {
  display: block;
  min-height: 27px;
  padding: 5px 6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree .selected {
  background: #fff;
  outline: 1px solid var(--green);
}

.code {
  min-width: 0;
  background: #fff;
}

.code-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 12px;
  color: #7b2300;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.filter-bar {
  margin-bottom: 8px;
}

.search {
  display: grid;
  gap: 5px;
}

.blueprint-detail {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin: 12px 0;
}

.thumb {
  width: 82px;
  height: 58px;
  border-radius: 5px;
  background: linear-gradient(135deg, #f6f7ff 0 35%, #315be8 35% 50%, #fff 50% 100%);
  border: 1px solid var(--line);
}

.thumb.feed {
  background:
    linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,255,255,.4)),
    linear-gradient(135deg, #315be8, #dce8ff 42%, #eef1f3 42%);
}

.catalog {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.bp {
  min-height: 58px;
  text-align: left;
  padding: 9px;
  background: #fff;
}

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

.catalog-foot {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.facts dt {
  font-weight: 800;
}

.facts dd {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.logs {
  min-height: 300px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111715;
  color: #d9f7e7;
}

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

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

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

  .drawer {
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .app {
    padding: 8px;
  }

  .brand {
    min-width: 0;
  }

  .commands,
  .global-actions,
  .preview-toolbar,
  .wp-site-head {
    flex-wrap: wrap;
  }

  .global-actions .state {
    order: -1;
  }

  .pathbox {
    flex-basis: 100%;
    max-width: none;
  }

  .browser-frame {
    height: auto;
    min-height: 0;
  }

  .wp-site-head {
    padding: 18px;
  }

  .wp-adminbar {
    gap: 8px;
    overflow: hidden;
    font-size: 10px;
  }

  .wp-adminbar span {
    white-space: nowrap;
  }

  .wp-adminbar span:nth-child(2) {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .wp-site-head nav {
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
  }

  .wp-hero {
    display: block;
    min-height: 0;
    padding: 24px 18px 0;
  }

  .wp-copy h1 {
    font-size: 34px;
  }

  .wp-copy p,
  .wp-copy mark {
    font-size: 16px;
  }

  .wp-art {
    height: 260px;
    margin-top: 10px;
  }

  .ring {
    left: 8%;
    width: 96%;
    height: 150px;
    border-width: 34px;
  }

  .ring.lower {
    top: 175px;
    height: 120px;
  }

  .w-big {
    left: 28%;
    width: 170px;
    height: 170px;
    border-width: 10px;
    font-size: 104px;
  }

  .steps,
  .destination-grid,
  .source-row,
  .file-layout,
  .catalog,
  .blueprint-detail {
    grid-template-columns: 1fr;
  }

  .source-row > button {
    width: 100%;
  }

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