:root {
  color-scheme: light;
  --ink: #111;
  --muted: #5f6368;
  --subtle: #878c91;
  --line: #d8dde3;
  --soft: #f5f6f8;
  --panel: #fff;
  --black: #090909;
  --black-2: #151515;
  --black-3: #242424;
  --blue: #185abc;
  --blue-2: #0b57d0;
  --green: #147a37;
  --green-soft: #e8f5ec;
  --amber: #9a6700;
  --amber-soft: #fff6d7;
  --red: #b3261e;
  --red-soft: #fff0ee;
  --radius: 8px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

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

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: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  background: var(--black);
}

.shellbar {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(260px, 1fr) max-content;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #080808;
  color: #fff;
  border-bottom: 1px solid #323232;
}

.brand,
.object-header,
.deck-head,
.panel-title,
.block-title,
.browser-top,
.wp-adminbar,
.wp-nav,
.button-row,
.shell-actions,
.path-strip,
.editor-head,
.toolbar-row,
.contract-locks {
  display: flex;
  align-items: center;
}

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

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

.brand span:last-child {
  display: block;
  color: #b9b9b9;
  font-size: 12px;
}

.brand-mark,
.wp-mini,
.row-logo {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid currentColor;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

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

.path-field {
  flex: 1;
  min-width: 0;
}

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

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

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

.path-field input {
  height: 36px;
  background: #242424;
  color: #f7f7f7;
  border-color: #424242;
}

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

button,
.primary,
.secondary,
.danger,
.danger-ghost,
.mini,
.icon-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  font-weight: 700;
}

.shellbar button {
  border-color: #3d3d3d;
  background: #1d1d1d;
  color: #fff;
}

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

.secondary {
  background: #fff;
}

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

.danger-ghost {
  border-color: #8f302b;
  color: #fff;
  background: #351210;
}

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

.mini.danger {
  color: #fff;
}

.button-row {
  gap: 8px;
  flex-wrap: wrap;
}

.button-row.tight {
  justify-content: flex-end;
}

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

.pill.browser {
  background: #e9f1ff;
  color: #174ea6;
  border-color: #b9d1ff;
}

.pill.success {
  background: var(--green-soft);
  color: var(--green);
  border-color: #b8dfc5;
}

.pill.warning {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #f3d988;
}

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

.pill.neutral {
  background: #f1f3f4;
  color: #4b4f52;
  border-color: #dde1e5;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 38vw) minmax(440px, 1fr) minmax(270px, 310px);
  gap: 10px;
  padding: 10px;
}

.live-column,
.deck,
.support-rail {
  min-width: 0;
}

.live-column {
  display: grid;
  grid-template-rows: auto minmax(380px, 1fr) auto;
  gap: 10px;
}

.object-header,
.browser-frame,
.deck,
.rail-card,
.panel,
.white-panel,
.contract-panel,
.destination,
.confirm-box,
.transfer-card,
.log-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.object-header {
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.object-header h1,
.deck h2,
.panel h3,
.panel h4,
.rail-card h3 {
  margin: 0;
  letter-spacing: 0;
}

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

.object-header p,
.panel p,
.white-panel p,
.transfer-card p,
.contract-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

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

.browser-frame {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.browser-top {
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: #fff;
  background: var(--black-2);
}

.browser-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.browser-top span:last-child {
  margin-left: auto;
  color: #c8c8c8;
  font-size: 12px;
}

.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34a853;
}

.wp-adminbar {
  gap: 12px;
  min-height: 32px;
  padding: 0 10px;
  color: #e9e9e9;
  background: #202427;
  font-size: 12px;
}

.wp-adminbar button {
  min-height: 24px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: inherit;
}

.wp-mini {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.push {
  margin-left: auto;
}

.wp-nav {
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: #fff;
}

.wp-nav nav {
  display: flex;
  gap: 18px;
  color: #333;
  font-size: 14px;
}

.preview-surface {
  flex: 1;
  min-height: 300px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  padding: 52px 28px;
  background: #fff;
  overflow: hidden;
}

.preview-surface:after {
  content: "W";
  position: absolute;
  right: -60px;
  bottom: -72px;
  width: 260px;
  height: 260px;
  display: grid;
  place-items: center;
  border: 28px solid #1ed760;
  border-radius: 50%;
  color: #111;
  font-family: Georgia, serif;
  font-size: 160px;
  font-weight: 800;
  opacity: 0.18;
}

.preview-surface > * {
  position: relative;
  z-index: 1;
}

.preview-surface h2 {
  max-width: 580px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.1;
  letter-spacing: 0;
}

.preview-surface p {
  max-width: 560px;
  color: #111;
  font-size: 16px;
  line-height: 1.55;
}

.highlight {
  display: inline;
  background: #fff1a8;
}

.preview-surface button {
  margin-top: 12px;
  min-height: 42px;
  border-color: #3858e9;
  background: #3858e9;
  color: #fff;
}

.review-summary {
  align-self: start;
  border: 1px solid #d9dde3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

.review-summary strong {
  display: block;
  font-size: 16px;
}

.contract-locks {
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

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

.signal-grid article {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fdfdfd;
  border: 1px solid var(--line);
}

.signal-grid strong {
  display: block;
}

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

.deck {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #f8f9fb;
  overflow: hidden;
}

.deck-head {
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.command-search {
  width: min(300px, 42%);
}

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

.command-tabs button,
.manager-tabs button,
.filters button,
.route-card,
.blueprint-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.command-tabs button {
  min-height: 56px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  font-size: 12px;
}

kbd {
  display: block;
  width: max-content;
  margin-top: 4px;
  padding: 2px 5px;
  border: 1px solid #cfd3d8;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #f3f4f5;
  color: #4b4f52;
  font: 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.command-tabs button.is-active,
.manager-tabs button.is-active,
.filters button.is-active {
  background: #111;
  color: #fff;
}

.command-tabs button.is-active kbd {
  color: #fff;
  background: #2b2b2b;
  border-color: #555;
}

.panel-stack {
  min-height: 0;
  overflow: auto;
}

.panel {
  display: none;
  margin: 10px;
  padding: 14px;
}

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

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

.result-text {
  color: var(--muted);
  font-size: 13px;
}

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

.white-panel,
.contract-panel,
.confirm-box,
.transfer-card,
.log-card {
  padding: 14px;
}

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

.fact-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.fact-list.compact div {
  grid-template-columns: 76px minmax(0, 1fr);
}

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

.fact-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.signal-list,
.log-pills {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  line-height: 1.4;
}

.event-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.35;
}

.event-list.compact {
  max-height: 170px;
  overflow: auto;
}

.event-type {
  display: inline-block;
  margin-right: 5px;
  font-weight: 900;
}

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

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

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

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

.route-layout,
.library-grid,
.file-layout,
.blueprint-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.1fr);
  gap: 12px;
}

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

.route-card {
  display: block;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.route-card.is-active,
.destination.is-selected,
.blueprint-card.is-active {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  background: #f3f7ff;
}

.route-card span,
.route-card em,
.blueprint-card span,
.destination small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.route-card strong {
  display: block;
  margin: 3px 0 5px;
  font-size: 15px;
}

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

.constraint-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.constraint-grid span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.timeline li.done {
  color: var(--green);
  font-weight: 800;
}

.timeline li.current {
  color: var(--blue);
  font-weight: 800;
}

.progress-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.progress-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.progress-card strong {
  color: var(--ink);
}

.meter {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #dfe3e8;
}

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

.meter.danger span {
  background: var(--red);
}

.destination {
  min-height: 150px;
  padding: 14px;
  background: #fff;
}

.save-form,
.permission-card,
.callout {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.permission-card {
  background: #f8fafc;
}

.callout.warning {
  color: #4f3400;
  background: var(--amber-soft);
  border-color: #f1d27b;
}

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

.saved-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.saved-row.is-active {
  border-color: var(--blue);
  background: #f3f7ff;
}

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

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

.row-logo {
  width: 30px;
  height: 30px;
  color: #111;
  border-color: #111;
}

.row-logo.local {
  color: var(--green);
  border-color: var(--green);
}

.row-logo.temporary {
  color: var(--amber);
  border-color: var(--amber);
}

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

.confirm-box {
  align-self: start;
  background: #fffafa;
  border-color: #efb4b0;
}

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

.manager-tabs button,
.filters button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.manager-panel {
  display: none;
}

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

.settings-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.settings-grid .check input {
  width: auto;
  height: auto;
}

.file-tree,
.catalog {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

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

.file-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-tree li {
  padding: 8px;
  border-radius: 6px;
  color: var(--muted);
}

.file-tree li.selected {
  color: var(--ink);
  background: #edf3ff;
  font-weight: 800;
}

.editor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.editor-head {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.blueprint-grid {
  grid-template-columns: minmax(230px, 0.8fr) minmax(320px, 1.2fr);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.blueprint-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.blueprint-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  font-weight: 800;
}

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

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  color: #f3f3f3;
  background: #111;
  border-radius: 6px;
  padding: 10px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

.support-rail {
  display: grid;
  align-content: start;
  gap: 10px;
}

.rail-card {
  padding: 12px;
}

.mono {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.db-meter {
  height: 8px;
  margin: 10px 0 6px;
  border-radius: 999px;
  background: #e4e7eb;
  overflow: hidden;
}

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

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}

.dot.success {
  background: var(--green);
}

.dot.warning {
  background: var(--amber);
}

.history-card {
  max-height: calc(100vh - 420px);
  overflow: auto;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #111;
  box-shadow: var(--shadow);
  z-index: 5;
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: minmax(340px, 0.9fr) minmax(430px, 1.1fr);
  }

  .support-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-card {
    max-height: none;
  }
}

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

  .shell-actions {
    flex-wrap: wrap;
  }

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

  .live-column {
    grid-template-rows: auto auto auto;
  }

  .support-rail {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 720px) {
  .workspace {
    padding: 6px;
  }

  .object-header,
  .deck-head,
  .panel-title,
  .wp-nav,
  .browser-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .wp-nav nav,
  .button-row.tight {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .preview-surface {
    grid-template-columns: 1fr;
    padding: 34px 18px;
  }

  .review-summary {
    max-width: none;
  }

  .signal-grid,
  .diagnostic-board,
  .save-grid,
  .transfer-grid,
  .settings-grid,
  .log-grid,
  .support-rail,
  .route-layout,
  .library-grid,
  .file-layout,
  .blueprint-grid {
    grid-template-columns: 1fr;
  }

  .command-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .command-search {
    width: 100%;
  }

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

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .fact-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 460px) {
  .command-tabs {
    grid-template-columns: 1fr;
  }

  .path-strip,
  .shell-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .path-strip > *,
  .shell-actions > * {
    width: 100%;
  }
}
