/* BackOfHouseOS individual room design system.
   One restrained operating environment shared by every room.
   Per-room atmosphere comes from accent + rhythm, never gimmick. */

:root {
  color-scheme: dark;

  --bg: #07090a;
  --bg-2: #0d1110;
  --paper: #f0eadc;
  --ink: #e6dfd0;
  --muted: rgba(230, 223, 208, 0.6);
  --dim: rgba(230, 223, 208, 0.36);
  --line: rgba(230, 223, 208, 0.1);
  --line-strong: rgba(230, 223, 208, 0.2);
  --field: rgba(255, 252, 244, 0.025);

  --accent: #9fb9a3;
  --gold: #b89a64;
  --warn: #c89172;

  --font-display: "Druk Wide", "Druk", "Helvetica Neue Condensed", HelveticaNeue-CondensedBold, "Arial Narrow", Impact, sans-serif;
  --font-ui: Inter, "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --font: var(--font-ui);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3eddf;
  --bg-2: #ece6d6;
  --paper: #1a1c17;
  --ink: #1c1e18;
  --muted: rgba(28, 30, 24, 0.6);
  --dim: rgba(28, 30, 24, 0.38);
  --line: rgba(28, 30, 24, 0.1);
  --line-strong: rgba(28, 30, 24, 0.2);
  --field: rgba(28, 30, 24, 0.025);
}

/* Per-room accents. Domain mood comes from this single hue. */
body[data-room="revenuedeskos"] { --accent: #84a78d; }
body[data-room="archiveos"]     { --accent: #94a39a; }
body[data-room="churchos"]      { --accent: #c4b387; }
body[data-room="inventoryos"]   { --accent: #a8b1a8; }
body[data-room="runneros"]      { --accent: #92a9a4; }
body[data-room="cookbookos"]    { --accent: #b89c75; }

html[data-theme="light"] body[data-room="revenuedeskos"] { --accent: #3a6a4d; }
html[data-theme="light"] body[data-room="archiveos"]     { --accent: #4c5a52; }
html[data-theme="light"] body[data-room="churchos"]      { --accent: #7c6536; }
html[data-theme="light"] body[data-room="inventoryos"]   { --accent: #565f57; }
html[data-theme="light"] body[data-room="runneros"]      { --accent: #426664; }
html[data-theme="light"] body[data-room="cookbookos"]    { --accent: #785930; }

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.boh-room {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-synthesis: none;
  font-feature-settings: "kern" 1, "ss01" 1, "cv11" 1;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.boh-room a {
  color: inherit;
  text-decoration: none;
}

body.boh-room img {
  max-width: 100%;
}

body.boh-room button,
body.boh-room input,
body.boh-room select,
body.boh-room textarea {
  font: inherit;
  color: inherit;
}

/* Container */
body.boh-room .room-shell,
body.boh-room main,
body.boh-room .shell,
body.boh-room .main,
body.boh-room .workspace,
body.boh-room footer {
  width: min(1080px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

body.boh-room .shell {
  display: block !important;
  min-height: auto !important;
  grid-template-columns: none !important;
}

body.boh-room .app-shell {
  display: block !important;
  min-height: auto !important;
}

/* Top bar — hairline, no boxed pieces */
body.boh-room .room-top,
body.boh-room .topbar,
body.boh-room .shell-header,
body.boh-room .workspace-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  margin: 0 auto;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 10, 0.86);
  backdrop-filter: blur(20px);
  color: var(--ink);
  box-shadow: none !important;
  border-radius: 0 !important;
}

html[data-theme="light"] body.boh-room .room-top,
html[data-theme="light"] body.boh-room .topbar,
html[data-theme="light"] body.boh-room .shell-header,
html[data-theme="light"] body.boh-room .workspace-top {
  background: rgba(243, 237, 223, 0.88);
}

body.boh-room .room-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  text-decoration: none;
}

body.boh-room .room-back:hover,
body.boh-room .room-back:focus-visible {
  color: var(--paper);
  outline: none;
}

body.boh-room .room-back-arrow {
  font-size: 0.92rem;
}

/* On legacy / non-canonical deploys, make the canonical pointer visible
   but restrained — accent-colored label so the visitor sees demos.philbap.com. */
body.boh-room .room-back.is-canonical-pointer {
  color: var(--accent);
}

body.boh-room .room-back.is-canonical-pointer:hover,
body.boh-room .room-back.is-canonical-pointer:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

body.boh-room .room-identity,
body.boh-room .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink);
}

body.boh-room .brand-mark,
body.boh-room .app-logo,
body.boh-room .logo-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 500;
  box-shadow: none !important;
}

body.boh-room .brand-mark img,
body.boh-room .app-logo img,
body.boh-room .logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
}

body.boh-room .room-identity-text,
body.boh-room .brand > span,
body.boh-room .brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

body.boh-room .brand strong,
body.boh-room .brand small,
body.boh-room .room-identity-text strong,
body.boh-room .room-identity-text small {
  display: block;
}

body.boh-room .brand strong,
body.boh-room .room-identity-text strong {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.005em;
}

body.boh-room .brand small,
body.boh-room .room-identity-text small {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* Status — text-only, no pill */
body.boh-room .room-status {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: none;
}

body.boh-room[data-status="SNAPSHOT"] .room-status,
body.boh-room[data-status="CONCEPT"]  .room-status {
  color: var(--gold);
}

body.boh-room[data-status="HELD"]     .room-status {
  color: var(--dim);
}

/* Room nav — quiet underline, no pill */
body.boh-room .room-nav,
body.boh-room .nav,
body.boh-room .side-nav,
body.boh-room .sidebar .nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  overflow: visible;
}

body.boh-room .room-nav a,
body.boh-room .nav a,
body.boh-room .side-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  background: transparent !important;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: none !important;
}

body.boh-room .room-nav a:hover,
body.boh-room .room-nav a:focus-visible,
body.boh-room .nav a:hover,
body.boh-room .nav a:focus-visible,
body.boh-room .nav a[aria-current="page"],
body.boh-room .side-nav a:hover,
body.boh-room .side-nav a:focus-visible {
  color: var(--paper);
  outline: none;
}

body.boh-room .nav a[aria-current="page"] {
  color: var(--accent);
}

body.boh-room .sidebar {
  position: static !important;
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 12px 0 !important;
  margin: 0 auto;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
}

body.boh-room .sidebar .brand {
  display: grid !important;
  gap: 2px;
  min-width: 0;
}

body.boh-room .sidebar .nav {
  justify-content: flex-start;
}

body.boh-room main,
body.boh-room .main,
body.boh-room .workspace {
  padding: 56px 0 36px !important;
}

/* Typography parity with studio.css: Druk display, Inter UI, JetBrains mono */
body.boh-room h1,
body.boh-room h2,
body.boh-room h3,
body.boh-room p {
  margin-top: 0;
  letter-spacing: 0;
}

body.boh-room h1 {
  max-width: 22ch;
  margin-bottom: 18px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.2vw, 2.8rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

body.boh-room h2 {
  max-width: 32ch;
  margin-bottom: 10px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.014em;
}

body.boh-room h3 {
  margin-bottom: 6px;
  font-family: var(--font-ui);
  color: var(--paper);
  font-size: 0.95rem;
  font-weight: 600;
}

body.boh-room p,
body.boh-room li {
  color: var(--muted);
}

body.boh-room .lede,
body.boh-room .muted,
body.boh-room .subtle {
  color: var(--muted);
}

body.boh-room .lede {
  max-width: 64ch;
  font-size: clamp(0.96rem, 1.4vw, 1.04rem);
  line-height: 1.6;
}

/* Eyebrows — quiet, sentence-cased */
body.boh-room .eyebrow,
body.boh-room .kicker,
body.boh-room .section-kicker,
body.boh-room .meta,
body.boh-room .meta-label,
body.boh-room .detail-label,
body.boh-room .history-meta,
body.boh-room .chapter-label,
body.boh-room .nav-label,
body.boh-room .sidebar .brand > span:first-child,
body.boh-room .sidebar .brand > span:last-child {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

body.boh-room .sidebar .brand strong {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 500;
}

/* Room state badge — status + data + concrete what-to-inspect */
body.boh-room .room-state {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 0 0 18px;
  max-width: 64ch;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

body.boh-room .room-state .state-tag {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.05em;
}

body.boh-room .room-state.is-snapshot .state-tag,
body.boh-room .room-state.is-concept  .state-tag { color: var(--gold); }
body.boh-room .room-state.is-held     .state-tag { color: var(--dim); }

body.boh-room .room-state .state-sep {
  color: var(--line-strong);
  margin: 0 2px;
}

body.boh-room .room-state .state-detail {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  letter-spacing: 0;
  flex-basis: 100%;
  max-width: 64ch;
}

body.boh-room .implementation-state {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 18px;
  max-width: 920px;
  margin: 0 0 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

body.boh-room .implementation-state > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  border: 0;
}

body.boh-room .implementation-state dt {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

body.boh-room .implementation-state dd {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Hero — no boxed aside, just text */
body.boh-room .hero,
body.boh-room .revenue-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  align-items: end;
  gap: clamp(24px, 4vw, 48px);
  min-height: 0 !important;
  padding: clamp(40px, 5vw, 64px) 0 clamp(32px, 4vw, 48px) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.boh-room .hero-copy,
body.boh-room .stack {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 64ch;
}

body.boh-room .hero h1 { margin-bottom: 2px; }
body.boh-room .hero .lede { margin-top: 2px; max-width: 58ch; }

/* Hide the legacy theme toggle if anything still injects it */
body.boh-room .theme-toggle-group,
body.boh-room .product-theme-toggle {
  display: none !important;
}

body.boh-room .action-row,
body.boh-room .hero-actions,
body.boh-room .button-row,
body.boh-room .pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 14px;
  row-gap: 8px;
}

body.boh-room .sample-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 10px;
}

/* Hero asides — type, no box */
body.boh-room .intake-card,
body.boh-room .today-card,
body.boh-room .loop-card,
body.boh-room .hero-panel {
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.boh-room .intake-card span,
body.boh-room .today-card span,
body.boh-room .loop-card span,
body.boh-room .intake-card strong,
body.boh-room .today-card strong {
  display: block;
}

body.boh-room .intake-card > span:first-child,
body.boh-room .today-card > span:first-child,
body.boh-room .loop-card > div:first-child {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

body.boh-room .intake-card strong,
body.boh-room .today-card strong {
  margin: 0 0 6px;
  color: var(--paper);
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.005em;
}

body.boh-room .intake-card p,
body.boh-room .today-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Loop-card list (Archive vertical loop) */
body.boh-room .loop-card {
  gap: 6px;
}

body.boh-room .loop-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
}

body.boh-room .loop-step::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--line-strong);
  flex: 0 0 auto;
}

body.boh-room .loop-step.active {
  color: var(--paper);
}

body.boh-room .loop-step.active::before {
  background: var(--accent);
}

/* Metric strips — typographic rows, not bordered cells */
body.boh-room .metrics,
body.boh-room .stats,
body.boh-room .metric-strip,
body.boh-room .status-strip,
body.boh-room .report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 28px;
  margin: 40px 0 24px;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent !important;
  border-radius: 0 !important;
}

body.boh-room .metrics article,
body.boh-room .stats article,
body.boh-room .metric-strip article,
body.boh-room .status-strip > div,
body.boh-room .report-grid article {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.boh-room .metrics article span,
body.boh-room .stats article span,
body.boh-room .metric-strip article span,
body.boh-room .status-strip > div .meta,
body.boh-room .report-grid article span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

body.boh-room .metrics strong,
body.boh-room .stats strong,
body.boh-room .metric-strip strong,
body.boh-room .status-strip > div h2,
body.boh-room .report-grid article strong {
  display: block;
  color: var(--paper);
  font-size: clamp(1.3rem, 2.3vw, 1.7rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.005em;
}

body.boh-room .status-strip > div .muted,
body.boh-room .status-strip > div p {
  margin: 4px 0 0;
  font-size: 0.84rem;
}

/* Section headings */
body.boh-room .section-heading,
body.boh-room .section-header,
body.boh-room .section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 56px 0 14px;
}

body.boh-room .section-heading > div,
body.boh-room .section-header > div,
body.boh-room .section-title > div {
  min-width: 0;
}

body.boh-room .section-title.inline {
  align-items: center;
}

/* Panels — hairlines only, no fills, no shadows */
body.boh-room .panel,
body.boh-room .detail,
body.boh-room .approved-detail,
body.boh-room .export-report,
body.boh-room .command-card,
body.boh-room .step-card,
body.boh-room .workspace-section,
body.boh-room .deal-record,
body.boh-room .columns article,
body.boh-room .flow .step {
  padding: 28px 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.boh-room .columns,
body.boh-room .home-grid,
body.boh-room .split,
body.boh-room .split-section,
body.boh-room .two-column,
body.boh-room .intake-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  margin: 14px 0 14px;
}

body.boh-room .deal-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 36px;
  margin: 14px 0;
}

body.boh-room .detail,
body.boh-room .approved-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 36px;
  margin: 14px 0;
}

body.boh-room .detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Buttons — text-actions by default, no pill blobs */
body.boh-room .button,
body.boh-room .primary-action,
body.boh-room .tool-grid button,
body.boh-room .sample-buttons button,
body.boh-room button.button,
body.boh-room .text-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 0;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--paper) !important;
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none !important;
  cursor: pointer;
}

body.boh-room .button::after,
body.boh-room .primary-action::after,
body.boh-room button.button::after,
body.boh-room .text-action::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
  transform: scaleX(0.18);
  transform-origin: left center;
  transition: transform 220ms ease, opacity 220ms ease;
}

body.boh-room .button:hover::after,
body.boh-room .primary-action:hover::after,
body.boh-room .button:focus-visible::after,
body.boh-room .primary-action:focus-visible::after,
body.boh-room button.button:hover::after,
body.boh-room .text-action:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

body.boh-room .button.primary,
body.boh-room .primary-action,
body.boh-room .primary,
body.boh-room button.primary {
  color: var(--accent) !important;
}

body.boh-room .button.primary::after,
body.boh-room .primary-action::after,
body.boh-room .primary::after {
  opacity: 0.6;
  transform: scaleX(1);
}

body.boh-room .button.secondary {
  color: var(--paper) !important;
}

/* Sample-buttons (Revenue) — small chips, pressed-state shown by accent color */
body.boh-room .sample-buttons button {
  min-height: 28px;
  margin-right: 16px;
  padding: 2px 0;
  font-size: 0.86rem;
}

body.boh-room .sample-buttons button[aria-pressed="true"] {
  color: var(--accent) !important;
}

body.boh-room .sample-buttons button[aria-pressed="true"]::after {
  background: var(--accent);
  opacity: 1;
  transform: scaleX(1);
}

/* Inputs */
body.boh-room input,
body.boh-room select,
body.boh-room textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line-strong) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  font: inherit;
  transition: border-color 200ms ease;
}

body.boh-room textarea {
  min-height: 110px;
  padding: 8px 0 !important;
  resize: vertical;
}

body.boh-room input:focus-visible,
body.boh-room select:focus-visible,
body.boh-room textarea:focus-visible {
  border-bottom-color: var(--accent) !important;
  outline: none;
}

body.boh-room .filter,
body.boh-room .textarea-label,
body.boh-room .search-box {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

body.boh-room .filter {
  min-width: 180px;
}

/* Pills/badges — text only */
body.boh-room .pill,
body.boh-room .badge,
body.boh-room .tag,
body.boh-room .chip,
body.boh-room .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none !important;
}

body.boh-room .pill.green,
body.boh-room .badge.green { color: var(--accent); }
body.boh-room .pill.gold   { color: var(--gold); }
body.boh-room .pill.coral  { color: var(--warn); }

/* dl */
body.boh-room dl {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

body.boh-room dl > div {
  display: grid;
  grid-template-columns: 0.4fr minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

body.boh-room dl > div:last-child {
  border-bottom: 0;
}

body.boh-room dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

body.boh-room dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
}

body.boh-room ul,
body.boh-room ol {
  padding-left: 0;
  margin: 8px 0;
  list-style: none;
}

body.boh-room ul li,
body.boh-room ol li {
  position: relative;
  padding: 4px 0 4px 16px;
}

body.boh-room ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 8px;
  height: 1px;
  background: var(--line-strong);
}

body.boh-room ol {
  counter-reset: ord;
}

body.boh-room ol li {
  counter-increment: ord;
  padding-left: 28px;
}

body.boh-room ol li::before {
  content: counter(ord, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 4px;
  width: auto;
  height: auto;
  color: var(--dim);
  font-size: 0.78rem;
  font-weight: 500;
  background: transparent;
}

body.boh-room .subpanel,
body.boh-room .draft-output,
body.boh-room .record-card,
body.boh-room .detail-card,
body.boh-room .governance-list,
body.boh-room .review-queue,
body.boh-room .review-list,
body.boh-room .import-list,
body.boh-room .history-list,
body.boh-room .jobs-list,
body.boh-room .queue,
body.boh-room .library-table {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.boh-room .subpanel {
  margin-top: 18px;
  padding-top: 14px !important;
  border-top: 1px solid var(--line) !important;
}

body.boh-room .subpanel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

body.boh-room .draft-output {
  min-height: 92px;
  padding: 16px 0 !important;
  border-top: 1px solid var(--line) !important;
  color: var(--muted);
  font-size: 0.94rem;
}

/* Artifact previews — public-safe proof texture, not decoration */
body.boh-room .artifact-strip,
body.boh-room .proof-artifacts,
body.boh-room .artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 28px 0 24px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}

body.boh-room .artifact-card,
body.boh-room .artifact-note {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.boh-room .artifact-card img,
body.boh-room .artifact-note img,
body.boh-room .record-preview img,
body.boh-room .asset-art img,
body.boh-room .photo-frame img,
body.boh-room .route-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--bg-2);
  object-fit: cover;
}

body.boh-room .artifact-card h3,
body.boh-room .artifact-note h3 {
  margin: 0;
  color: var(--paper);
  font-size: 0.98rem;
  font-weight: 500;
}

body.boh-room .artifact-card p,
body.boh-room .artifact-note p,
body.boh-room .artifact-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

body.boh-room .artifact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

body.boh-room .photo-frame,
body.boh-room .route-preview,
body.boh-room .record-preview {
  display: grid;
  gap: 8px;
}

/* Theme toggle — minimal */
body.boh-room .theme-toggle-group,
body.boh-room .product-theme-toggle {
  display: inline-flex;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.boh-room .theme-toggle-group button,
body.boh-room .product-theme-toggle button {
  min-height: 28px;
  padding: 4px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none !important;
  cursor: pointer;
}

body.boh-room .theme-toggle-group button[aria-pressed="true"],
body.boh-room .product-theme-toggle button[aria-pressed="true"] {
  background: transparent !important;
  color: var(--paper) !important;
}

/* Modal — quiet sheet */
body.boh-room .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 9, 10, 0.84);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}

body.boh-room .modal-backdrop[hidden] { display: none; }

body.boh-room .modal {
  position: relative;
  width: min(540px, 100%);
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 32px 32px 28px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 0 !important;
  background: var(--bg) !important;
  color: var(--ink);
  box-shadow: none !important;
}

html[data-theme="light"] body.boh-room .modal {
  background: var(--bg) !important;
}

body.boh-room .modal h2 { margin-top: 6px; }

body.boh-room .modal .icon-button,
body.boh-room .modal #close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

body.boh-room .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 22px;
}

/* Proof loop — numbered list, no boxed grid */
body.boh-room .proof-loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 28px;
  margin: 32px 0 14px;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent !important;
  border-radius: 0 !important;
  list-style: none;
}

body.boh-room .proof-loop article {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.boh-room .proof-loop span {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--dim);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
}

body.boh-room .proof-loop strong {
  color: var(--paper);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

body.boh-room .proof-loop p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 2px 0 0;
}

/* Flow steps (Church) */
body.boh-room .flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 28px;
  margin: 24px 0 14px;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent !important;
}

body.boh-room .flow .step {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 0 !important;
  border: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
}

/* Footer — one quiet line */
body.boh-room .footer,
body.boh-room footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 22px;
  margin: 56px auto 24px !important;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--dim) !important;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-align: left;
}

body.boh-room .footer span,
body.boh-room footer span {
  padding: 0;
  color: var(--dim);
}

body.boh-room .notebook-bottom-nav,
body.boh-room .notebook-status-strip,
body.boh-room .boh-detail-band,
body.boh-room .boh-freshness-band,
body.boh-room .theme-dock,
body.boh-room .tco-logo-lockup,
body.boh-room .notebook-logo-lockup {
  display: none !important;
}

/* Library / table */
body.boh-room .library-table {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

body.boh-room .library-table > * {
  padding: 14px 0 !important;
  border-top: 1px solid var(--line) !important;
  background: transparent !important;
  border-radius: 0 !important;
}

body.boh-room .library-table > *:first-child {
  border-top: 0 !important;
}

/* Grid lists */
body.boh-room .item-wall,
body.boh-room .run-grid,
body.boh-room .opportunity-grid,
body.boh-room .board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
  margin: 16px 0 24px;
}

body.boh-room .opportunity-card,
body.boh-room .item-card,
body.boh-room .run-card,
body.boh-room .asset-card,
body.boh-room .review-card,
body.boh-room .program-card {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  grid-column: auto !important;
}

/* Pending note */
body.boh-room .pending-note {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
}

body.boh-room .pending-note strong {
  color: var(--paper);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Version list (Archive modal) */
body.boh-room .version-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

body.boh-room .version-list > * {
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

body.boh-room .version-list > *:first-child {
  border-top: 0;
}

/* Warnings */
body.boh-room .warnings,
body.boh-room #preflight-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

body.boh-room .warnings li,
body.boh-room #preflight-list li {
  padding: 10px 0 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

body.boh-room .warnings li::before,
body.boh-room #preflight-list li::before {
  background: var(--warn);
}

body.boh-room #preflight-list li::before {
  background: var(--accent);
}

/* Motion — settle once, restrained */
body.boh-room main > section {
  animation: room-settle 380ms ease both;
}

body.boh-room main > section:nth-child(2) { animation-delay: 60ms; }
body.boh-room main > section:nth-child(3) { animation-delay: 100ms; }
body.boh-room main > section:nth-child(4) { animation-delay: 140ms; }

@keyframes room-settle {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.boh-room *, body.boh-room *::before, body.boh-room *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 960px) {
  body.boh-room .room-shell,
  body.boh-room main,
  body.boh-room .main,
  body.boh-room .workspace,
  body.boh-room footer {
    width: min(100% - 32px, 1080px);
  }

  body.boh-room .hero,
  body.boh-room .home-grid,
  body.boh-room .split,
  body.boh-room .split-section,
  body.boh-room .columns,
  body.boh-room .two-column,
  body.boh-room .intake-grid,
  body.boh-room .deal-record,
  body.boh-room .detail,
  body.boh-room .approved-detail {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }

  body.boh-room .metrics,
  body.boh-room .stats,
  body.boh-room .metric-strip,
  body.boh-room .status-strip,
  body.boh-room .report-grid,
  body.boh-room .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 28px;
  }

  body.boh-room .proof-loop,
  body.boh-room .flow,
  body.boh-room .artifact-strip,
  body.boh-room .proof-artifacts,
  body.boh-room .artifact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 28px;
  }
}

@media (max-width: 640px) {
  body.boh-room .room-shell,
  body.boh-room main,
  body.boh-room .main,
  body.boh-room .workspace,
  body.boh-room footer {
    width: min(100% - 28px, 1080px);
  }

  body.boh-room .room-top,
  body.boh-room .topbar,
  body.boh-room .shell-header,
  body.boh-room .workspace-top {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
  }

  body.boh-room .room-identity { flex: 0 0 auto; }

  body.boh-room .room-nav,
  body.boh-room .nav,
  body.boh-room .side-nav {
    justify-content: flex-start;
    width: 100%;
    gap: 0 6px;
  }

  body.boh-room .room-nav a,
  body.boh-room .nav a,
  body.boh-room .side-nav a {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  body.boh-room .implementation-state {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }

  body.boh-room main,
  body.boh-room .main,
  body.boh-room .workspace {
    padding: 32px 0 36px !important;
  }

  body.boh-room h1 {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  body.boh-room h2 {
    font-size: 1.2rem;
  }

  body.boh-room .hero {
    padding: 24px 0 22px !important;
  }

  body.boh-room .metrics,
  body.boh-room .stats,
  body.boh-room .metric-strip,
  body.boh-room .status-strip,
  body.boh-room .report-grid,
  body.boh-room .detail-grid,
  body.boh-room .proof-loop,
  body.boh-room .flow,
  body.boh-room .artifact-strip,
  body.boh-room .proof-artifacts,
  body.boh-room .artifact-grid {
    grid-template-columns: 1fr;
    gap: 18px 0;
  }

  body.boh-room .item-wall,
  body.boh-room .run-grid,
  body.boh-room .opportunity-grid,
  body.boh-room .board {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  body.boh-room .action-row,
  body.boh-room .hero-actions,
  body.boh-room .button-row,
  body.boh-room .modal-actions {
    gap: 18px;
  }

  body.boh-room dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  body.boh-room .implementation-state > div {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  body.boh-room .modal-backdrop { padding: 16px; }
  body.boh-room .modal {
    padding: 22px 22px 20px !important;
  }

  body.boh-room .section-heading,
  body.boh-room .section-header,
  body.boh-room .section-title {
    margin: 36px 0 12px;
  }
}

@media (max-width: 380px) {
  body.boh-room .room-back-label { display: none; }

  body.boh-room .implementation-state {
    grid-template-columns: 1fr;
  }
}

/* -------------------- Reading-mode density (rooms) -------------------- */

/* Quick (default) — keep most content, lighten verbosity */
body.boh-room.mode-quick .implementation-state {
  /* keep visible but slightly compressed */
}
body.boh-room.mode-quick .proof-loop p,
body.boh-room.mode-quick .governance-mini {
  /* let through, just rely on mobile compression */
}

/* Show — aggressive prune */
body.boh-room.mode-show .room-state .state-detail,
body.boh-room.mode-show .implementation-state,
body.boh-room.mode-show .governance-mini,
body.boh-room.mode-show .proof-loop,
body.boh-room.mode-show .hero .lede,
body.boh-room.mode-show .archive-note,
body.boh-room.mode-show .boundary-section p,
body.boh-room.mode-show .pattern-section,
body.boh-room.mode-show footer {
  display: none !important;
}

body.boh-room.mode-show .hero {
  padding: clamp(24px, 4vw, 36px) 0 clamp(20px, 3vw, 28px) !important;
}

body.boh-room.mode-show h2 {
  font-size: clamp(1.1rem, 1.9vw, 1.4rem);
}

/* Operator — make sure everything is visible */
body.boh-room.mode-operator .implementation-state,
body.boh-room.mode-operator .room-state .state-detail,
body.boh-room.mode-operator .hero .lede {
  display: revert;
}

/* -------------------- Mobile compression (rooms <=720px) -------------------- */
@media (max-width: 720px) {
  /* Tighter hero rhythm */
  body.boh-room .hero,
  body.boh-room .revenue-hero {
    padding: clamp(24px, 4vw, 36px) 0 clamp(18px, 3vw, 26px) !important;
    gap: 16px;
  }

  body.boh-room .hero h1 { margin-bottom: 8px; }
  body.boh-room .hero .lede { font-size: 0.96rem; line-height: 1.55; }

  /* Room-state badge stacks cleanly */
  body.boh-room .room-state {
    gap: 4px 10px;
    font-size: 0.76rem;
  }
  body.boh-room .room-state .state-detail {
    flex-basis: 100%;
    font-size: 0.88rem;
  }

  /* Implementation-state slimmer */
  body.boh-room .implementation-state {
    margin-top: 14px;
  }

  /* Action row tightens */
  body.boh-room .action-row,
  body.boh-room .hero-actions {
    gap: 10px 22px;
    margin-top: 12px;
  }

  /* Sections compress padding */
  body.boh-room main,
  body.boh-room .main,
  body.boh-room .workspace { padding: 24px 0 28px !important; }

  body.boh-room .section-heading,
  body.boh-room .section-header,
  body.boh-room .section-title { margin: 28px 0 10px; }

  /* Footer slimmer */
  body.boh-room footer { margin-top: 36px; }

  /* In show mode on mobile, hide the hero aside too */
  body.boh-room.mode-show .intake-card,
  body.boh-room.mode-show .today-card,
  body.boh-room.mode-show .loop-card,
  body.boh-room.mode-show .hero-panel {
    display: none;
  }
}

@media (max-width: 420px) {
  body.boh-room h1 { font-size: clamp(1.5rem, 9vw, 2.1rem); }
  body.boh-room .room-state .state-detail { font-size: 0.86rem; }
}
