/* Org design builder, restyled in Blueprint Equity Design System v4.
   Every rule is scoped under #od-root. Tokens only (tokens.css). */

#od-root {
  height: min(88vh, 960px); min-height: 720px;
  display: flex; flex-direction: column;
  background: var(--bg-page); color: var(--fg-1);
  border: 1px solid var(--rule); border-radius: var(--radius-sheet); overflow: hidden;
  font-family: var(--font-sans); font-variant-numeric: tabular-nums lining-nums;
}
#od-root *, #od-root *::before, #od-root *::after { box-sizing: border-box; }
#od-root button { font-family: var(--font-sans); }
#od-root .od-loading { padding: var(--space-7); color: var(--fg-2); font-size: 14px; }
#od-root .od-app { display: flex; flex-direction: column; height: 100%; min-height: 0; }
#od-root .od-spacer { flex: 1; }
#od-root .od-kicker { font-size: 12.5px; line-height: 1.3; font-weight: 600; letter-spacing: .005em; color: var(--fg-2); }

/* Row 1: scenarios as tabs on a hairline; the active one carries the blue rule. */
#od-root .od-topbar { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-5) 0; flex-shrink: 0; border-bottom: 1px solid var(--rule); }
#od-root .od-pills { display: flex; align-items: center; gap: var(--space-1); overflow-x: auto; overflow-y: hidden; flex: 1; min-width: 0; }
#od-root .od-pill {
  appearance: none; flex-shrink: 0; display: flex; align-items: center; gap: var(--space-2);
  padding: 10px var(--space-3) 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: var(--fg-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
#od-root .od-pill:hover { color: var(--fg-1); }
#od-root .od-pill.is-active { color: var(--fg-1); font-weight: 600; border-bottom-color: var(--bp-primary); }
#od-root .od-pill-count { font-size: 12.5px; font-weight: 400; color: var(--fg-2); }
#od-root .od-pill-new, #od-root .od-pill-ghost {
  height: 32px; padding: 0 var(--space-3); margin: 0 0 6px var(--space-2); border: 1px solid var(--rule-strong); border-radius: var(--radius-press);
  color: var(--fg-1); font-size: 13px;
}
#od-root .od-pill-new:hover { background: var(--fg-1); color: var(--bg-page); }
#od-root .od-pill-ghost { border-color: transparent; color: var(--fg-2); margin-left: 0; }
#od-root .od-pill-ghost:hover { color: var(--fg-1); background: var(--bg-raised); }
#od-root .od-summary { flex-shrink: 0; padding-bottom: 8px; font-size: 13px; color: var(--fg-2); white-space: nowrap; }

/* Row 2: view switch and actions */
#od-root .od-toolbar { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); flex-shrink: 0; flex-wrap: wrap; }
#od-root .od-tabs { display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: var(--radius-press); overflow: hidden; }
#od-root .od-tab {
  appearance: none; height: 34px; padding: 0 var(--space-4); border: 0; border-radius: 0;
  font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; color: var(--fg-1);
}
#od-root .od-tab + .od-tab { border-left: 1px solid var(--rule-strong); }
#od-root .od-tab:hover { background: var(--bg-raised); }
#od-root .od-tab.is-active { background: var(--fg-1); color: var(--bg-page); }
#od-root .od-btn {
  appearance: none; height: 34px; padding: 0 var(--space-4); flex-shrink: 0; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--radius-press);
  font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .12s ease, color .12s ease;
}
#od-root .od-btn-primary { background: var(--action-primary); color: var(--fg-on-action); }
#od-root .od-btn-primary:hover { background: var(--action-primary-hover); color: var(--fg-on-action-hover); }
#od-root .od-btn-secondary { background: transparent; color: var(--fg-1); border-color: var(--rule-strong); }
#od-root .od-btn-secondary:hover { background: var(--fg-1); color: var(--bg-page); }
#od-root .od-btn-tertiary { background: transparent; color: var(--fg-1); }
#od-root .od-btn-tertiary:hover { background: var(--bg-raised); }
#od-root .od-btn-tertiary:focus-within { outline: var(--rule-bold) solid var(--focus); outline-offset: 2px; }
#od-root .od-btn-icon { width: 34px; padding: 0; justify-content: center; background: transparent; color: var(--fg-1); border-color: var(--rule); }
#od-root .od-btn-icon:hover { border-color: var(--rule-strong); background: var(--bg-raised); }
#od-root .od-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#od-root .od-zoom { display: flex; align-items: center; gap: var(--space-1); }
#od-root .od-zoom-label { font-size: 13px; font-weight: 500; color: var(--fg-2); width: 48px; text-align: center; }

/* Main area: the canvas scrolls inside its own pane. */
#od-root .od-main { flex: 1; display: flex; min-height: 0; border-top: 1px solid var(--rule); }
#od-root .od-pane { flex: 1; min-width: 0; background: var(--bg-raised); overflow: auto; position: relative; }

/* List view: span and load */
#od-root .od-list { padding: var(--space-5) var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
#od-root .od-heat-summary { font-size: 14px; color: var(--fg-2); line-height: 1.55; max-width: 80ch; }
#od-root .od-rows { display: flex; flex-direction: column; gap: 4px; }
#od-root .od-row {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: 10px var(--space-4);
  border: 1px solid var(--rule); border-radius: var(--radius-sheet); cursor: grab; outline-offset: -1px; min-width: 0;
}
#od-root .od-row-toggle {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 28px; height: 28px; padding: 0 4px; flex-shrink: 0; border: 0; border-radius: var(--radius-press);
  font-size: 12px; font-weight: 600; cursor: pointer; color: var(--fg-1);
}
#od-root .od-row-main { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 1px; }
#od-root .od-row-name { font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#od-root .od-row-title { font-size: 13px; line-height: 1.35; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#od-root .od-row-bar { width: 140px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; }
#od-root .od-row-track { height: 6px; position: relative; }
#od-root .od-row-fill { position: absolute; left: 0; top: 0; height: 6px; }
#od-root .od-row-band { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
#od-root .od-row-badge { width: 110px; flex-shrink: 0; text-align: right; font-size: 12.5px; color: var(--fg-2); white-space: nowrap; }

/* Chart view: absolutely placed cards on a scaled canvas (sizes match the layout constants in app.js). */
#od-root .od-canvas-outer { padding: var(--space-6); }
#od-root .od-canvas { position: relative; transform-origin: 0 0; }
#od-root .od-edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
#od-root .od-edges path { stroke: var(--rule-input); }
#od-root .od-ring { position: absolute; width: 216px; height: 86px; border-radius: var(--radius-sheet); outline: 2px solid; outline-offset: 0; pointer-events: none; }
#od-root .od-card {
  position: absolute; width: 208px; height: 78px; background: var(--bg-page); border: 1px solid var(--rule); border-radius: var(--radius-sheet);
  padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; gap: 2px; cursor: grab;
}
#od-root .od-card:hover { border-color: var(--rule-strong); }
#od-root .od-card-name { font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#od-root .od-card-title { font-size: 12.5px; line-height: 1.3; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#od-root .od-card-meta { font-size: 12px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#od-root .od-card-open { background: var(--bg-raised); border: 1px dashed var(--rule-input); }
#od-root .od-card-open-label { font-size: 12px; font-weight: 600; color: var(--fg-2); }
#od-root .od-card-open .od-card-title { font-size: 13px; font-weight: 600; color: var(--fg-1); line-height: 1.25; }
#od-root .od-toggler {
  appearance: none; position: absolute; height: 24px; min-width: 24px; padding: 0 6px; gap: 2px;
  border: 1px solid var(--rule); border-radius: var(--radius-press);
  background: var(--bg-page); color: var(--fg-1); font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#od-root .od-toggler:hover { border-color: var(--rule-strong); }
#od-root .od-toggle-icon { display: inline-flex; }

/* Inspector */
#od-root .od-inspector {
  width: 320px; flex-shrink: 0; background: var(--bg-page); border-left: 1px solid var(--rule);
  overflow: auto; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5);
}
#od-root .od-inspector-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
#od-root .od-link-btn {
  appearance: none; background: none; border: 0; padding: 0; font-size: 13px; font-weight: 500; color: var(--fg-link);
  text-decoration: underline; text-underline-offset: .2em; cursor: pointer;
}
#od-root .od-link-btn:hover { text-decoration-thickness: 2px; }
#od-root .od-fields { display: flex; flex-direction: column; gap: var(--space-4); }
#od-root .od-field { display: flex; flex-direction: column; gap: 6px; }
#od-root .od-field .od-kicker { color: var(--fg-1); }
#od-root .od-input, #od-root .od-select {
  width: 100%; min-width: 0; background: var(--bg-sunken); border: 0; border-bottom: 1px solid var(--rule-input); border-radius: var(--radius-sheet);
  padding: 9px 10px 8px; font: 400 15px/1.4 var(--font-sans); color: var(--fg-1); outline: none;
}
#od-root .od-input:hover, #od-root .od-select:hover { border-bottom-color: var(--rule-strong); }
#od-root .od-input:focus, #od-root .od-select:focus { border-bottom: 2px solid var(--focus); padding-bottom: 7px; }
#od-root .od-select { cursor: pointer; }
#od-root .od-inspector-actions { display: flex; flex-direction: column; gap: var(--space-3); border-top: 1px solid var(--rule); padding-top: var(--space-4); }
#od-root .od-inspector-summary { font-size: 13px; color: var(--fg-2); line-height: 1.5; }
#od-root .od-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
#od-root .od-act {
  appearance: none; height: 36px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-press);
  background: transparent; color: var(--fg-1); font-size: 13px; font-weight: 500; cursor: pointer;
}
#od-root .od-act:hover { background: var(--fg-1); color: var(--bg-page); }
#od-root .od-act-primary { background: var(--action-primary); color: var(--fg-on-action); border-color: transparent; }
#od-root .od-act-primary:hover { background: var(--action-primary-hover); color: var(--fg-on-action-hover); }
#od-root .od-act-danger { border-color: var(--rule); color: var(--status-negative); }
#od-root .od-act-danger:hover { background: var(--status-negative); color: var(--fg-inverse); border-color: var(--status-negative); }

@media (max-width: 900px) {
  #od-root { height: auto; min-height: 640px; }
  #od-root .od-main { flex-direction: column; }
  #od-root .od-pane { height: 70vh; min-height: 420px; flex: none; }
  #od-root .od-inspector { width: auto; border-left: 0; border-top: 1px solid var(--rule); }
  #od-root .od-topbar, #od-root .od-toolbar { padding-left: var(--space-4); padding-right: var(--space-4); }
  #od-root .od-summary { display: none; }
  #od-root .od-list { padding: var(--space-4); }
  #od-root .od-row-bar { width: 120px; }
  #od-root .od-row-badge { width: auto; text-align: left; }
}
