:root {
  color-scheme: light;
  --ink: #17191d;
  --muted: #616873;
  --faint: #89919d;
  --line: #d9dee6;
  --panel: #ffffff;
  --soft: #f4f6f8;
  --soft-blue: #edf4ff;
  --soft-green: #eaf7ef;
  --soft-amber: #fff6db;
  --soft-red: #fff0ee;
  --navy: #111820;
  --navy-2: #1e2933;
  --blue: #1f5fbf;
  --blue-dark: #174f9d;
  --green: #197642;
  --amber: #9b6a00;
  --red: #b3261e;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: #0f141a;
}

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

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 11px;
  font-weight: 700;
  cursor: pointer;
}

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

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

input,
select {
  min-height: 36px;
  padding: 0 10px;
}

textarea {
  min-height: 230px;
  padding: 12px;
  resize: vertical;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #e7edf4;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  background: #0f141a;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(260px, 1fr) max-content;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid #2b3743;
}

.brand-block,
.pathbar,
.top-actions,
.object-strip,
.object-badges,
.browser-head,
.wp-adminbar,
.wp-menu,
.panel-head,
.card-title,
.inline-actions,
.editor-head,
.toolbar,
.drawer-actions,
.search-row,
.row-actions {
  display: flex;
  align-items: center;
}

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

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

.brand-block strong {
  font-size: 15px;
}

.brand-block span:last-child {
  max-width: 210px;
  color: #b6c0ca;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.pathbar label {
  min-width: 0;
  flex: 1;
}

.pathbar input {
  border-color: #3a4652;
  background: #25313d;
  color: #f8fbff;
}

.top-actions {
  gap: 8px;
  white-space: nowrap;
}

.topbar button {
  border-color: #3b4854;
  background: #202c37;
  color: #fff;
}

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

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

.secondary {
  background: #fff;
  color: var(--ink);
}

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

.danger-ghost {
  border-color: #e7b0ad;
  background: var(--soft-red);
  color: var(--red);
}

.mini {
  min-height: 29px;
  padding: 0 9px;
  font-size: 12px;
}

.icon-btn {
  padding-inline: 10px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1.12fr) minmax(440px, 0.88fr);
  gap: 12px;
  padding: 12px;
}

.preview-pane,
.console-pane {
  min-width: 0;
  min-height: 0;
}

.preview-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.object-strip {
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #283541;
  border-radius: var(--radius);
  background: #f8fafc;
  box-shadow: var(--shadow);
}

.object-strip h1,
.panel-head h2,
.card h3,
.drawer h3,
.blueprint-detail h3 {
  margin: 0;
  line-height: 1.2;
}

.object-strip h1 {
  font-size: 20px;
}

.object-strip p,
.panel-head p,
.card p,
.drawer p,
.blueprint-detail p {
  margin: 5px 0 0;
  color: var(--muted);
}

.object-badges {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.neutral {
  border-color: #ccd5df;
  background: #eef2f6;
  color: #334155;
}

.badge.warn {
  border-color: #f0d48a;
  background: var(--soft-amber);
  color: #6f4b00;
}

.badge.ok {
  border-color: #a9dfbd;
  background: var(--soft-green);
  color: #146c39;
}

.badge.danger {
  border-color: #efb5b0;
  background: var(--soft-red);
  color: var(--red);
}

.browser-shell {
  min-height: 0;
  overflow: hidden;
  border: 1px solid #283541;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.browser-head {
  gap: 10px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  background: #17212b;
  color: #f6f8fb;
}

.browser-head strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.browser-head span:last-child {
  color: #b9c3cf;
  font-size: 12px;
  white-space: nowrap;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #6ee7a0;
  box-shadow: 17px 0 #ffd166, 34px 0 #ef476f;
}

.wp-adminbar {
  gap: 10px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  background: #1f252a;
  color: #f1f3f5;
  font-size: 13px;
}

.wp-adminbar button {
  min-height: 24px;
  border: 0;
  background: transparent;
  color: #f1f3f5;
  padding: 0 4px;
}

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

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

.wp-menu {
  justify-content: space-between;
  gap: 16px;
  padding: 22px 36px;
  border-bottom: 1px solid #eff2f5;
}

.wp-menu nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  color: #3d4147;
}

.wp-page {
  min-height: clamp(460px, calc(100vh - 260px), 760px);
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(230px, 0.38fr);
  align-items: center;
  gap: 28px;
  padding: 42px 44px;
  background:
    linear-gradient(140deg, rgba(31, 95, 191, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(25, 118, 66, 0.14), transparent 48%),
    #fff;
}

.wp-page h2 {
  max-width: 560px;
  margin: 0 0 16px;
  color: #203bd1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.12;
  font-weight: 500;
}

.wp-page p {
  max-width: 610px;
  margin: 0 0 15px;
  font-size: 18px;
  line-height: 1.5;
}

.wp-page button {
  min-height: 44px;
  margin-top: 6px;
  border-color: #384fdb;
  background: #3856e9;
  color: #fff;
}

.highlight {
  display: inline;
  background: #fff2a8;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.preview-diagnostics {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding: 20px;
  border: 1px solid #d6e2ed;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.preview-diagnostics dl,
.facts {
  margin: 0;
}

.preview-diagnostics div,
.facts div {
  display: grid;
  grid-template-columns: minmax(86px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f4;
}

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

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

.console-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #283541;
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: var(--shadow);
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #e9edf2;
}

.tabbar button {
  min-width: 0;
  min-height: 46px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: #38414c;
  white-space: nowrap;
}

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

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

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

.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 20px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.status-grid,
.save-layout,
.transfer-grid,
.log-grid {
  display: grid;
  gap: 12px;
}

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

.save-layout {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.6fr);
}

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

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

.card,
.drawer,
.blueprint-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.card-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.inline-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.signal-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.signal-list li {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
}

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

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

.event-list li {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e4e9ef;
  border-radius: 6px;
  background: #fbfcfe;
  color: #3e4650;
  overflow-wrap: anywhere;
}

.event {
  display: inline-flex;
  min-width: 52px;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.event.ok {
  color: var(--green);
}

.event.warn {
  color: var(--amber);
}

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

.event.info {
  color: var(--blue);
}

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

.route-card {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  text-align: left;
}

.route-card.is-active,
.destination.is-active,
.saved-row.is-active,
.blueprint-card.is-active {
  border-color: var(--blue);
  background: var(--soft-blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.route-card span,
.route-card em,
.destination span,
.saved-row span,
.blueprint-card span,
.gallery-note {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.route-card strong {
  font-size: 15px;
}

.drawer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 14px;
  margin-top: 12px;
}

.drawer-actions {
  align-self: end;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.chips li {
  padding: 5px 8px;
  border: 1px solid #d9e0e8;
  border-radius: 999px;
  background: #f7f9fb;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.destination-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.destination {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 12px;
  text-align: left;
}

.progress-wrap {
  margin-top: 14px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #dfe5eb;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.25s ease;
}

.progress-wrap p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

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

.manager-panel {
  display: none;
}

.manager-panel.is-active {
  display: block;
}

.warning-box,
.confirm-box {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #f0d48a;
  border-radius: var(--radius);
  background: var(--soft-amber);
  color: #3d2d00;
}

.warning-box.info {
  border-color: #b7d0f2;
  background: var(--soft-blue);
  color: #183c69;
}

.confirm-box.danger-panel {
  border-color: #efb5b0;
  background: var(--soft-red);
  color: #4f1714;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--ink);
  font-weight: 700;
}

.check input {
  width: auto;
  min-height: auto;
}

.split-tool {
  display: grid;
  grid-template-columns: minmax(190px, 0.36fr) minmax(0, 1fr);
  min-height: 470px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

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

.toolbar {
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.file-row {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid #edf1f4;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.file-row.folder {
  font-weight: 800;
}

.file-row.is-active {
  background: var(--soft-blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.editor-card {
  min-width: 0;
  padding: 0;
}

.editor-head {
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.editor-head strong {
  min-width: 0;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-card textarea {
  min-height: 416px;
  border: 0;
  border-radius: 0;
}

.blueprint-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 0.55fr);
  gap: 12px;
}

.catalog {
  min-width: 0;
}

.search-row {
  gap: 8px;
}

.search-row input {
  flex: 1;
}

.search-row select {
  width: 150px;
}

.gallery-note {
  margin: 9px 0;
}

.blueprint-cards {
  display: grid;
  gap: 9px;
}

.blueprint-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 94px;
  padding: 9px;
  text-align: left;
}

.thumb {
  align-self: stretch;
  border: 1px solid #cdd6df;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(31, 95, 191, 0.34), transparent 44%),
    linear-gradient(315deg, rgba(25, 118, 66, 0.34), transparent 48%),
    #eef3f7;
}

.thumb.coffee {
  background: linear-gradient(135deg, #4b246d, #f2a65a);
}

.thumb.feed {
  background: linear-gradient(135deg, #f8fafc, #dbeafe 48%, #fff 49%);
}

.thumb.news {
  background: linear-gradient(135deg, #050505, #f9fafb 48%, #c2410c 49%);
}

.thumb.nonprofit {
  background: linear-gradient(135deg, #4b2116, #f59e0b);
}

.thumb.blog {
  background: linear-gradient(135deg, #6b123d, #f8e7ef);
}

.blueprint-card strong {
  display: block;
  margin-bottom: 3px;
}

.blueprint-detail textarea {
  min-height: 240px;
}

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

.saved-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.row-icon {
  color: #20304a;
  background: #f6f8fb;
}

.transfer-history {
  margin-top: 12px;
}

.mobile-nav {
  display: none;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #0f1720;
  color: #fff;
  box-shadow: var(--shadow);
}

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

  .wp-page {
    min-height: 460px;
  }
}

@media (max-width: 840px) {
  .app {
    grid-template-rows: auto minmax(0, 1fr);
    padding-bottom: 66px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-block span:last-child {
    max-width: none;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    white-space: normal;
  }

  .top-actions button,
  .top-actions .badge {
    justify-content: center;
  }

  .workspace {
    padding: 8px;
  }

  .object-strip {
    display: grid;
  }

  .object-badges {
    justify-content: start;
  }

  .wp-menu {
    display: grid;
    padding: 16px;
  }

  .wp-page {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 24px 18px;
  }

  .wp-page h2 {
    font-size: 34px;
  }

  .wp-page p {
    font-size: 16px;
  }

  .tabbar {
    display: none;
  }

  .panel {
    padding: 14px;
  }

  .panel-head {
    display: grid;
  }

  .result {
    max-width: none;
    text-align: left;
  }

  .route-grid,
  .settings-grid,
  .transfer-grid,
  .save-layout,
  .blueprint-layout,
  .split-tool {
    grid-template-columns: 1fr;
  }

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

  .drawer-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .saved-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .saved-row > .badge,
  .saved-row > .row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid #2b3743;
    background: #111820;
  }

  .mobile-nav button {
    min-width: 0;
    min-height: 56px;
    border: 0;
    border-right: 1px solid #2b3743;
    border-radius: 0;
    background: transparent;
    color: #dce3eb;
    padding: 0 4px;
    font-size: 12px;
  }

  .mobile-nav button.is-active {
    color: #fff;
    box-shadow: inset 0 3px 0 #6ea8ff;
  }
}

@media (max-width: 520px) {
  .pathbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

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

  .wp-adminbar {
    gap: 7px;
    overflow-x: auto;
  }

  .wp-menu nav {
    gap: 12px;
  }

  .preview-diagnostics div,
  .facts div,
  .signal-list li {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .route-grid {
    gap: 8px;
  }

  .route-card {
    min-height: 94px;
  }

  .search-row {
    display: grid;
  }

  .search-row select {
    width: 100%;
  }

  .blueprint-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .editor-head {
    display: grid;
  }

  .editor-head strong {
    white-space: normal;
  }
}
