/* Workbench chrome. Self-contained on purpose.
   The sidebar, inspector and notices deliberately do NOT read the active
   variable set: a theme that renders the review surface unreadably must still
   leave the workbench navigable, and a screenshot of the host pane should
   contain the product's pixels and nothing of the harness's. */

:root {
  --wb-bg: #14161a;
  --wb-panel: #1b1e24;
  --wb-line: #2a2f38;
  --wb-text: #d7dae0;
  --wb-muted: #8b93a1;
  --wb-accent: #8a9a63;
  --wb-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wb-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--wb-bg);
  color: var(--wb-text);
  font-family: var(--wb-ui);
  font-size: 14px;
}

/* ol-mioe: there used to be a `:where(*)` reset here, neutralising the bare
   element rules a vendored theme aims at the whole document. It is gone because
   the thing it defended against is gone: the theme stylesheet is now loaded
   into the host pane's own document (src/host-frame.ts), which this document is
   not. A reset could always be beaten by a more specific theme rule — Things'
   `body:not(.default-font-color) strong` is (0,2,1) — and the document boundary
   cannot be. */

.wb {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- sidebar ---- */

.wb-sidebar {
  border-right: 1px solid var(--wb-line);
  background: var(--wb-panel);
  padding: 20px 16px 32px;
  overflow-y: auto;
}

.wb-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.wb-brand-name {
  font-weight: 600;
}

.wb-badge {
  border: 1px solid var(--wb-accent);
  border-radius: 999px;
  color: var(--wb-accent);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  text-transform: uppercase;
}

.wb-blurb {
  color: var(--wb-muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.wb-blurb code {
  font-family: var(--wb-mono);
  font-size: 11px;
}

.wb-nav-heading {
  color: var(--wb-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 18px 0 8px;
  text-transform: uppercase;
}

.wb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-nav-item {
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  color: var(--wb-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  text-align: left;
}

.wb-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.wb-nav-item.is-active {
  background: rgba(138, 154, 99, 0.14);
  border-left-color: var(--wb-accent);
  color: #fff;
}

.wb-nav-item:focus-visible {
  outline: 2px solid var(--wb-accent);
  outline-offset: -2px;
}

.wb-counts {
  color: var(--wb-muted);
  font-family: var(--wb-mono);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 24px;
}

/* ---- stage ---- */

.wb-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wb-stage {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 24px;
}

/* The host pane: an <iframe> holding the product's own document (ol-mioe).
   Everything about how the PRODUCT looks is declared inside that document — the
   variable set, packages/plugin/styles.css and the Obsidian-shell layout rules
   all live there (src/host-frame.ts). What is left here is the frame's box, and
   only that, which is the whole point: nothing the harness declares can reach
   the pixels a WB-2 screenshot captures. */
.wb-host {
  background: #1e1e1e;
  border: 1px solid var(--wb-line);
  border-radius: 8px;
  display: block;
  flex: 1;
  min-height: 520px;
  min-width: 0;
}

/* ---- inspector ---- */

.wb-inspector {
  border-top: 1px solid var(--wb-line);
  background: var(--wb-panel);
  max-height: 34vh;
  overflow-y: auto;
  padding: 14px 24px 20px;
}

.wb-inspector-note {
  line-height: 1.55;
  margin-bottom: 6px;
  max-width: 90ch;
}

.wb-inspector-note--dim {
  color: var(--wb-muted);
  font-size: 12px;
}

.wb-inspector-row {
  align-items: baseline;
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.wb-inspector-label {
  color: var(--wb-muted);
  flex: 0 0 140px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wb-inspector-value {
  font-family: var(--wb-mono);
  font-size: 12px;
}

.wb-inspector-log {
  min-width: 0;
}

.wb-inspector-log-path {
  color: var(--wb-accent);
  font-family: var(--wb-mono);
  font-size: 11px;
  margin-top: 8px;
}

.wb-inspector-log-json {
  background: #101216;
  border: 1px solid var(--wb-line);
  border-radius: 4px;
  font-family: var(--wb-mono);
  font-size: 11px;
  margin: 4px 0 0;
  overflow-x: auto;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- notices ---- */

.wb-notices {
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: fixed;
  right: 16px;
  width: min(420px, calc(100vw - 32px));
  z-index: 50;
}

.wb-notice {
  background: #232830;
  border: 1px solid var(--wb-line);
  border-left: 3px solid var(--wb-accent);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
}

.wb-fatal {
  background: #3a1a1a;
  color: #ffd9d4;
  font-family: var(--wb-mono);
  font-size: 12px;
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
}

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

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