:root {
  --bg: #f5f7f9;
  --panel: #ffffff;
  --panel-soft: #eef3f7;
  --line: #d9e0e7;
  --line-strong: #bdc8d4;
  --text: #15202b;
  --muted: #64717f;
  --muted-2: #8995a3;
  --blue: #3157e8;
  --blue-soft: #e8edff;
  --green: #147a48;
  --green-soft: #e4f5ec;
  --amber: #9a6400;
  --amber-soft: #fff1cf;
  --red: #b42318;
  --red-soft: #ffe5e2;
  --violet: #6c4bd2;
  --shadow: 0 20px 60px rgba(34, 47, 62, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.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: flex;
  flex-direction: column;
}

.topbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: #1f252b;
  color: #f8fafc;
  border-bottom: 1px solid #11161b;
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid #4f70ff;
  border-radius: 50%;
  color: #9db0ff;
  font-weight: 800;
}

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

.brand span {
  color: #aeb7c2;
  font-size: 12px;
}

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

.path-field {
  flex: 1;
}

.path-field input,
label input,
label select,
.filter-row input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.path-field input {
  height: 34px;
  padding: 0 12px;
  background: #303943;
  color: #f9fbfd;
  border-color: #46515e;
}

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

.btn,
.icon-btn,
.menu-btn {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 34px;
  padding: 7px 12px;
  line-height: 1.1;
}

.icon-btn {
  width: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #2c343d;
  color: #e8edf3;
  border-color: #46515e;
  font-weight: 700;
}

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

.btn.secondary {
  color: #123fb5;
  border-color: #9eb0f5;
  background: #f8faff;
}

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

.btn.quiet,
.menu-btn {
  background: transparent;
  color: inherit;
}

.topbar .btn.quiet {
  border-color: #46515e;
}

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

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(380px, 440px) minmax(210px, 280px) minmax(520px, 1fr);
  gap: 12px;
  padding: 12px;
}

.deck,
.event-stream,
.preview {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.deck {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.object-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

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

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

h1 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.25;
}

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

.object-header p {
  margin-bottom: 0;
  font-size: 13px;
}

.object-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.object-grid div {
  padding: 12px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.object-grid div:nth-child(2n) {
  border-right: 0;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
}

.view-tabs,
.manager-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tab,
.manager-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.tab.is-active,
.manager-tab.is-active {
  color: #123fb5;
  border-color: #b9c6f8;
  background: var(--blue-soft);
}

.view {
  display: none;
  overflow: auto;
  padding: 16px;
}

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

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head p {
  margin-bottom: 0;
  font-size: 13px;
}

.ledger-table {
  display: grid;
  gap: 8px;
}

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

.ledger-row.is-active {
  border-color: #7c92f1;
  background: #f7f9ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.ledger-row h3 {
  margin-bottom: 4px;
}

.ledger-row p {
  margin: 0;
  font-size: 12px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6f8fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.blue {
  background: var(--blue-soft);
  border-color: #b9c6f8;
  color: #173fb0;
}

.chip.green {
  background: var(--green-soft);
  border-color: #a5d9bc;
  color: var(--green);
}

.chip.amber {
  background: var(--amber-soft);
  border-color: #f3d184;
  color: var(--amber);
}

.chip.red {
  background: var(--red-soft);
  border-color: #ffbbb5;
  color: var(--red);
}

.flow-panel,
.mini-ledger,
.destination,
.route-card,
.transfer-card,
.selected-blueprint,
.manager-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-panel {
  margin-top: 12px;
  padding: 12px;
}

.flow-title,
.event-head,
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.danger-strip {
  padding: 12px;
  border-left: 4px solid var(--red);
  background: var(--red-soft);
  border-radius: 6px;
}

.danger-strip p {
  margin: 4px 0 0;
  color: #64312c;
  font-size: 13px;
}

.progress-track {
  height: 6px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

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

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

.action-row.wrap,
.chip-row {
  flex-wrap: wrap;
}

.mini-ledger {
  margin-top: 12px;
  padding: 12px;
}

.mini-ledger ul,
.event-stream ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mini-ledger li,
.event-stream li {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mini-ledger li:first-child,
.event-stream li:first-child {
  border-top: 0;
}

.mini-ledger span,
.event-stream span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.route-card,
.destination,
.transfer-card {
  min-width: 0;
  padding: 12px;
  text-align: left;
}

button.route-card:hover,
.route-card.is-featured {
  border-color: #9eb0f5;
  background: #f8faff;
}

.route-card span,
.destination p,
.transfer-card p {
  display: block;
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.form-route {
  display: grid;
  gap: 8px;
}

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

label input,
label select,
.filter-row input {
  min-height: 34px;
  padding: 0 10px;
}

textarea {
  min-height: 120px;
  padding: 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

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

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

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  font-size: 13px;
}

.check input {
  width: auto;
}

.manager-panel {
  display: none;
  padding: 12px;
}

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

.file-layout {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tree-row {
  width: 100%;
  margin-bottom: 5px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tree-row.is-selected {
  border-color: #9eb0f5;
  background: #f3f6ff;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.editor-head span {
  overflow-wrap: anywhere;
}

.editor-head b {
  color: var(--green);
}

.facts {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.facts div {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.facts strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

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

.log-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.filter-row {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

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

.chip-row .chip {
  background: #fff;
}

.chip-row .chip.blue {
  background: var(--blue-soft);
}

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

.blueprint-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.blueprint-card.is-selected {
  border-color: #7c92f1;
  background: #f8faff;
}

.blueprint-card strong,
.blueprint-card span:last-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blueprint-card span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.thumb {
  min-height: 50px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #385898, #f5d365);
}

.thumb.art { background: linear-gradient(135deg, #23596f 0 42%, #d6b56f 42% 67%, #6d2b52 67%); }
.thumb.coffee { background: linear-gradient(135deg, #4e2472 0 52%, #f3aa54 52%); }
.thumb.feed { background: linear-gradient(135deg, #f5f7ff 0 62%, #3d65d8 62%); }
.thumb.gaming { background: linear-gradient(135deg, #030303 0 34%, #ffffff 34% 50%, #b72418 50%); }
.thumb.nonprofit { background: linear-gradient(135deg, #4a210c, #d57b43 45%, #1b332f); }
.thumb.blog { background: linear-gradient(135deg, #68143b 0 70%, #d9c5ce 70%); }
.thumb.shop { background: linear-gradient(135deg, #1e5b46 0 45%, #dfe35d 45% 67%, #f7f8fa 67%); }
.thumb.docs { background: linear-gradient(135deg, #3157e8 0 35%, #fff 35% 55%, #1d4d36 55%); }

.selected-blueprint {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
}

.event-stream {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.event-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.event-head h2 {
  margin-bottom: 0;
}

.event-stream ol {
  overflow: auto;
  padding: 10px 14px 14px;
}

.event-stream li {
  position: relative;
  padding-left: 14px;
}

.event-stream li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.event-stream time {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

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

.preview-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-toolbar h2 {
  margin: 0;
}

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

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

.wp-adminbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding: 0 12px;
  color: #e9edf1;
  background: #1f252b;
  font-size: 13px;
  overflow: hidden;
}

.wp-adminbar span,
.wp-adminbar strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

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

.wp-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #9aa4af;
  border-radius: 50%;
  font-weight: 800;
}

.wp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid #f0f1f2;
}

.wp-nav strong {
  font-size: 20px;
}

.wp-nav nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wp-nav button {
  border: 0;
  background: transparent;
  color: #2d343a;
  padding: 4px 0;
}

.wp-content {
  position: relative;
  flex: 1;
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  align-items: center;
  gap: 30px;
  padding: 42px 48px;
  overflow: hidden;
}

.copy {
  max-width: 490px;
  position: relative;
  z-index: 2;
}

.copy h3 {
  margin-bottom: 16px;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.12;
}

.copy h3 span {
  color: #3157e8;
}

.copy p {
  color: #151515;
  font-size: 20px;
}

.copy .highlight {
  display: inline;
  background: #f9e68b;
  line-height: 1.5;
}

.wp-button {
  margin-top: 18px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 2px;
  color: #fff;
  background: #3157e8;
  font-weight: 700;
}

.wp-mark {
  position: relative;
  min-height: 520px;
}

.ring {
  position: absolute;
  left: 0;
  right: -160px;
  border: 58px solid #30e875;
  border-radius: 50%;
}

.r1 {
  top: 120px;
  height: 240px;
}

.r2 {
  top: 330px;
  height: 210px;
}

.w-logo {
  position: absolute;
  top: 12px;
  left: 130px;
  width: 330px;
  height: 330px;
  display: grid;
  place-items: center;
  border: 16px solid #1b1b1b;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: #1b1b1b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 220px;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 1220px) {
  .workspace {
    grid-template-columns: minmax(360px, 430px) minmax(460px, 1fr);
  }

  .event-stream {
    grid-column: 1 / -1;
    max-height: 240px;
    order: 3;
  }
}

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

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

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .preview {
    min-height: 620px;
  }

  .wp-content {
    grid-template-columns: 1fr;
    min-height: 480px;
    padding: 30px 24px;
  }

  .wp-mark {
    display: none;
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 8px;
  }

  .object-grid,
  .route-grid,
  .save-grid,
  .transfer-grid,
  .settings-grid,
  .file-layout,
  .blueprint-grid,
  .selected-blueprint {
    grid-template-columns: 1fr;
  }

  .ledger-row {
    grid-template-columns: 1fr;
  }

  .row-actions,
  .action-row,
  .section-head,
  .flow-title,
  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .btn,
  .menu-btn,
  .route-card button {
    width: 100%;
  }

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

  .wp-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .copy h3 {
    font-size: 36px;
  }

  .copy p {
    font-size: 17px;
  }
}
