:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --soft: #f5f7fb;
  --panel: #ffffff;
  --line: #d8dee8;
  --line-strong: #b9c3d2;
  --blue: #1f5eff;
  --blue-dark: #123da8;
  --green: #0d8f61;
  --amber: #b7791f;
  --red: #c93636;
  --purple: #6f42c1;
  --teal: #087a7a;
  --shadow: 0 16px 40px rgba(25, 35, 54, 0.12);
  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;
  color: var(--ink);
  background: #e8edf5;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

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

button:hover {
  border-color: #748198;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 220px minmax(320px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: #18212b;
  color: #f7fafc;
  border-bottom: 1px solid #0f151c;
}

.brand-lockup,
.identity,
.browser-strip,
.shell-actions,
.identity-actions,
.card-head,
.module-head,
.button-row,
.preview-toolbar,
.saved-row,
.gallery-summary,
.catalog-tools {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 10px;
}

.brand-lockup strong,
.identity h1 {
  display: block;
}

.brand-lockup span:not(.mark) {
  display: block;
  color: #b7c0cd;
  font-size: 12px;
}

.mark,
.site-badge,
.mini-wp,
.route-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-weight: 800;
}

.mark {
  width: 34px;
  height: 34px;
  background: #fff;
  color: #111821;
}

.browser-strip {
  gap: 8px;
  min-width: 0;
}

.path-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 160px;
}

.path-field span {
  position: absolute;
  left: 10px;
  top: -7px;
  padding: 0 4px;
  background: #18212b;
  color: #aeb9c7;
}

.path-field input {
  height: 36px;
  border-color: #465363;
  background: #27313d;
  color: #eef3f8;
}

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

.takeover {
  display: grid;
  grid-template-columns: minmax(640px, 1fr) 320px 250px;
  gap: 12px;
  padding: 12px;
  min-height: calc(100vh - 57px);
}

.manager,
.detail-drawer,
.preview-rail {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.manager {
  border-radius: 8px;
  overflow: hidden;
}

.manager-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.identity {
  gap: 12px;
  min-width: 0;
}

.identity h1 {
  margin: 2px 0 4px;
  font-size: 22px;
  line-height: 1.15;
}

.site-badge {
  width: 46px;
  height: 46px;
  border: 2px solid #0e1520;
  color: #0e1520;
  background: #fff;
  font-size: 22px;
}

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

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.meta-line span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.identity-actions {
  gap: 8px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #f3f6fb;
}

.tab {
  height: 44px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-weight: 700;
}

.tab.active {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: inset 0 -3px 0 var(--blue);
}

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

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

.flow-ledger {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.flow-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px 8px;
  align-items: center;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcff;
}

.flow-step span {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f5;
  color: #3a475a;
  font-weight: 800;
}

.flow-step strong,
.flow-step small {
  min-width: 0;
}

.flow-step small {
  color: var(--muted);
}

.flow-step.done span {
  background: #dff5eb;
  color: var(--green);
}

.flow-step.active {
  border-color: var(--blue);
  background: #f2f6ff;
}

.flow-step.active span {
  background: var(--blue);
  color: #fff;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

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

.work-card,
.module,
.save-card,
.log-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 154px;
  padding: 12px;
}

.work-card.selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.work-card p,
.save-card p,
.module p,
.gallery-summary span {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card-head {
  gap: 9px;
}

.route-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #eef2f8;
  color: #29364a;
  font-size: 12px;
}

.danger-card {
  border-color: #f0caca;
  background: #fffafa;
}

.danger-card .route-icon {
  background: #fae8e8;
  color: var(--red);
}

.text-button {
  margin-top: auto;
  width: fit-content;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 800;
}

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

.split-row,
.settings-layout,
.database-grid,
.logs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.module {
  padding: 14px;
}

.module-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.blueprint-bundle {
  border-left: 4px solid var(--purple);
}

.bundle-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.json-editor {
  max-height: 190px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcff;
  color: #8145a8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.save-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fbfcff;
}

.progress-row {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

meter {
  width: 100%;
  height: 8px;
}

.directory-pick {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 8px;
  color: var(--muted);
  background: #fff;
}

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

.saved-row {
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcff;
}

.saved-row div {
  flex: 1;
  min-width: 0;
}

.saved-row b,
.saved-row small {
  display: block;
  overflow-wrap: anywhere;
}

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

.saved-row.warning {
  border-color: #ead39e;
  background: #fffaf0;
}

.active-site {
  border-color: #b7c8ff;
  background: #f4f7ff;
}

.mini-wp {
  width: 28px;
  height: 28px;
  background: #17202a;
  color: #fff;
  font-size: 14px;
}

.catalog-module {
  margin-top: 12px;
}

.catalog-tools {
  gap: 8px;
  flex: 0 1 450px;
}

.gallery-summary {
  justify-content: space-between;
  gap: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9fd;
}

.blueprint-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.blueprint-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.thumb {
  height: 82px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.1)),
    var(--thumb, #dee7f7);
}

.blueprint-card-body {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.blueprint-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chips span {
  padding: 3px 6px;
  border-radius: 999px;
  background: #eef2f8;
  color: #526070;
  font-size: 11px;
}

.settings-layout {
  align-items: start;
}

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

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

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

.checkline span {
  margin: 0;
  color: var(--ink);
}

.consequence {
  border-left: 4px solid var(--red);
  background: #fffafa;
}

.file-workbench {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.file-tree {
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.file-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.file-tree ul {
  margin: 0;
  padding: 8px;
  list-style: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 2.05;
}

.file-tree li {
  padding: 0 8px;
  border-radius: 4px;
}

.active-file {
  background: #eaf1ff;
  color: var(--blue-dark);
  font-weight: 800;
}

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

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

pre {
  margin: 0;
  overflow: auto;
}

.editor-pane pre,
.log-card pre {
  padding: 14px;
  color: #8a3414;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.notice-module {
  border-left: 4px solid var(--teal);
  background: #f0fbfb;
}

.data-table dl {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.data-table div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
}

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

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

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

.export-panel {
  grid-column: 1 / -1;
}

.log-card {
  padding: 12px;
}

.log-card div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.log-card pre {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
  color: #445064;
}

.detail-drawer {
  position: sticky;
  top: 69px;
  align-self: start;
  max-height: calc(100vh - 81px);
  overflow: auto;
  border-radius: 8px;
  padding: 16px;
}

.drawer-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-drawer h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.detail-drawer p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.drawer-block {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcff;
  margin-bottom: 10px;
}

.drawer-block span {
  color: var(--muted);
  line-height: 1.4;
}

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

.preview-rail {
  position: sticky;
  top: 69px;
  align-self: start;
  max-height: calc(100vh - 81px);
  overflow: hidden;
  border-radius: 8px;
  background: #f7f9fc;
}

.preview-toolbar {
  gap: 7px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.preview-toolbar span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.site-preview {
  height: calc(100vh - 126px);
  min-height: 620px;
  overflow: hidden;
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
}

.wp-admin-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 25px;
  padding: 0 8px;
  background: #1d2327;
  color: #f0f0f1;
  font: 11px/1.2 Arial, sans-serif;
}

.site-nav {
  display: grid;
  gap: 8px;
  padding: 18px 18px 42px;
  font-family: Arial, sans-serif;
}

.site-nav b {
  font-size: 16px;
}

.site-nav span {
  color: #3f3f46;
  font-size: 12px;
}

.hero-preview {
  position: relative;
  min-height: 430px;
  padding: 160px 16px 24px;
  overflow: hidden;
}

.hero-preview h2 {
  max-width: 220px;
  color: #3155f6;
  font-size: 28px;
  font-weight: 400;
}

.hero-preview p {
  max-width: 210px;
  font: 15px/1.45 Arial, sans-serif;
}

.hero-preview button {
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: #3858e9;
  color: #fff;
}

.wp-watermark {
  position: absolute;
  right: -82px;
  top: 105px;
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  border: 14px solid #1e1e1e;
  border-radius: 50%;
  color: #1e1e1e;
  font-size: 118px;
  font-weight: 800;
  opacity: .16;
}

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

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

.outline {
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
}

.ghost {
  background: transparent;
  color: inherit;
}

.topbar .ghost,
.topbar .icon-button {
  border-color: #465363;
  color: #f7fafc;
}

.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-button {
  width: 36px;
  padding: 0;
}

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

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

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-unsaved {
  border-color: #e8c36a;
  background: #fff4cf;
  color: #6a4800;
}

.status-warn {
  border-color: #f1c48f;
  background: #fff4e5;
  color: #8a4f0b;
}

.status-ok {
  border-color: #a9dfbf;
  background: #e9f8ee;
  color: #11633a;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 28px));
  padding: 11px 13px;
  border: 1px solid #253244;
  border-radius: 7px;
  background: #17202a;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1240px) {
  .takeover {
    grid-template-columns: minmax(560px, 1fr) 300px;
  }

  .preview-rail {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }

  .site-preview {
    height: 360px;
    min-height: 360px;
  }

  .hero-preview {
    min-height: 290px;
    padding-top: 82px;
  }
}

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

  .takeover {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .detail-drawer,
  .preview-rail {
    position: static;
    max-height: none;
  }

  .flow-ledger,
  .card-grid,
  .split-row,
  .settings-layout,
  .database-grid,
  .logs-grid {
    grid-template-columns: 1fr;
  }

  .blueprint-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-header,
  .section-title,
  .module-head,
  .gallery-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .save-options,
  .bundle-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .browser-strip,
  .shell-actions,
  .identity-actions,
  .catalog-tools,
  .button-row {
    flex-wrap: wrap;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 112px;
  }

  .tab-panel {
    padding: 10px;
  }

  .manager-header {
    padding: 12px;
  }

  .identity {
    align-items: flex-start;
  }

  .identity h1 {
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .flow-ledger {
    gap: 6px;
  }

  .flow-step {
    min-height: 58px;
  }

  .blueprint-gallery {
    grid-template-columns: 1fr;
  }

  .file-workbench {
    grid-template-columns: 1fr;
  }

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

  .data-table div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .site-preview {
    min-height: 310px;
    height: 310px;
  }

  .hero-preview {
    padding-top: 44px;
  }

  .wp-watermark {
    right: -100px;
  }
}
