/* ------------------------------------------------------------------------ *
 *  Asset Performance & Optimization for Energy — data² theme
 *
 *  Follows "Design Guidelines – reView UI" (Confluence): the Marketing brand
 *  palette, colour only for status / selection / data category, and every
 *  surface and text colour defined as a light/dark pair. Two themes, driven
 *  by CSS custom properties on <html data-theme="...">:
 *    light (default) — off-white #F5F5F8 canvas, near-black #16141F ink,
 *                      deep violet #534B7F for actions and selection.
 *    dark            — #16141F canvas, #F5F5F8 ink. No brand accent reaches
 *                      4.5:1 on #16141F, so accent text uses a light tint of
 *                      the violet (tints await Marketing sign-off, guide §5).
 *
 *  Brand palette (guide §3):  primary  #F5F5F8 #16141F #534B7F #726B9D
 *                             secondary #4B6E7F #00334C #4B647F #002F63
 *  Status colours (ok / amber / err, trust tiers) are the functional
 *  exception the guide proposes; use them for status only.
 * ------------------------------------------------------------------------ */

:root,
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #F5F5F8;              /* app canvas */
  --panel-bg: #ffffff;        /* panels and cards (white pending Marketing) */
  --panel-bg2: #F5F5F8;       /* insets, table stripes */
  --border: #dcdbe2;          /* #16141F at ~12% on the canvas */
  --border-dim: #e9e8ee;
  --border-bright: #726B9D;   /* selected-item border */

  --text: #16141F;
  --muted: #5d5b6b;           /* 5.9:1 on #F5F5F8 */
  --accent: #534B7F;          /* primary action, active, links (7.2:1) */
  --accent-dim: #726B9D;      /* hover, secondary emphasis, icons */
  --accent-contrast: #ffffff; /* text on top of the accent (7.8:1) */
  --accent2: #4B6E7F;         /* secondary accent: blue-teal (5.0:1) */
  --accent2-dim: #4B647F;
  --accent2-ink: #ffffff;     /* text sitting on top of --accent2 */
  --amber: #b45309;           /* status: warning / attention */
  --ok: #15803d;              /* status: success */
  --err: #dc2626;             /* status: error / destructive */

  --wash: rgba(83, 75, 127, 0.08);       /* selected-item tint of #534B7F */
  --glow: none;
  --glow-soft: none;
  --glow2: none;
  --glow2-soft: none;
  --scanline-opacity: 0;
  --shadow: 0 10px 30px rgba(22, 20, 31, 0.14);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius-sm: 6px;           /* buttons, inputs, dropdowns */
  --radius: 8px;              /* cards, nav items — the default */

  /* categorical series colours (= themes.PALETTE) */
  --series-1: #4C72B0;
  --series-2: #DD8452;
  --series-3: #55A868;
  --series-4: #C44E52;
  --series-5: #8172B3;
  --series-6: #4BA3B6;
  --series-7: #CCB974;
  --series-8: #DA8BC3;
  --series-9: #937860;
  --series-10: #8C8C8C;
  --series-11: #2F9E8F;
  --series-12: #B07AA1;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #16141F;
  --panel-bg: #1e1c2a;        /* tints of #16141F (pending Marketing) */
  --panel-bg2: #1a1825;
  --border: #33304a;
  --border-dim: #27253a;
  --border-bright: #726B9D;

  --text: #F5F5F8;
  --muted: #a9a6bc;           /* 7.0:1 on #1e1c2a */
  --accent: #b3aed6;          /* light tint of #726B9D — text-safe on dark */
  --accent-dim: #726B9D;      /* icons, borders, large text only */
  --accent-contrast: #16141F;
  --accent2: #8fb3c3;         /* light tint of #4B6E7F */
  --accent2-dim: #4B6E7F;
  --accent2-ink: #16141F;
  --amber: #fbbf24;
  --ok: #34d399;
  --err: #fca5a5;

  --wash: rgba(114, 107, 157, 0.16);
  --glow: none;
  --glow-soft: none;
  --glow2: none;
  --glow2-soft: none;
  --scanline-opacity: 0;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);

  /* categorical series colours (= themes.PALETTE_DARK) */
  --series-1: #5E8CDB;
  --series-2: #EE9455;
  --series-3: #6ACC64;
  --series-4: #E06A6A;
  --series-5: #A082D0;
  --series-6: #6CC4D8;
  --series-7: #DCC777;
  --series-8: #E792CD;
  --series-9: #B89377;
  --series-10: #A8A8A8;
  --series-11: #45C1AE;
  --series-12: #C99BBE;
}

* { box-sizing: border-box; }

/* Base font scales with the viewport so the UI stays readable on a small
   laptop and large on a 4K / 44" monitor. Everything below is sized in rem/em
   so it all scales together. */
html { font-size: clamp(15px, 0.42vw + 10px, 26px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: background .3s ease, color .3s ease;
}

/* Monospace is for IDs, Cypher and technical values (guide §6). */
code, pre, kbd, samp, .mono { font-family: var(--font-mono); }

.app { display: flex; flex-direction: column; height: 100vh; width: 100vw; }

/* ---------------------------------------------------------------- header */
.header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 1.1rem;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; min-width: 0; }

.brand-logo {
  width: 1.9rem;
  height: 1.9rem;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}

/* White-label client logo, sitting immediately right of the wordmark. Two
   pre-tinted artworks per brand — light-coloured for the dark theme, dark
   for light — swapped by theme; the Configuration screen picks the brand.
   The rule divides the client mark from the product wordmark. */
.client-logo-wrap {
  display: flex;
  align-items: center;
  padding-left: 0.85rem;
  border-left: 1px solid var(--border);
  min-width: 0;
}
.client-logo {
  /* Sized to lead the header: the client mark reads as the owner of the
     deployment, so it runs half again the height of the data² mark. */
  height: 2.6rem;
  width: auto;
  /* Client artwork ranges from square to very wide (Rawabet is ~6:1), so
     cap the run of header it can take rather than trusting its aspect. */
  max-width: 16.5rem;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
}
.client-logo-light { display: none; }
:root[data-theme="light"] .client-logo-dark { display: none; }
:root[data-theme="light"] .client-logo-light { display: block; }

/* What the deployment is called for this client, with its positioning line
   underneath — set from the brand registry, right of the client logo. */
.brand-tagline-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  padding-left: 0.85rem;
  border-left: 1px solid var(--border);
}
.brand-tagline {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: .07em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-byline {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: .04em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}
/* The application name beside the wordmark: identity, not emphasis. */
.brand-product {
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The product wordmark (HEADER_MARK in app.py) — set as a wordmark rather
   than running text: wide tracking, no ellipsis games, one colour. */
.brand-company {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .16em;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes crt-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* -------------------------------------------- Reasoner prompt + console */
/* The prompt lives in the Reasoner console module — the blinking CRT cursor
   sits on its input. (There was a second copy of this prompt under the
   header; it was removed, along with the perspective + standing-instruction
   controls it carried, which now live on the Configuration screen.) */
.con-prompt {
  color: var(--accent);
  text-shadow: var(--glow-soft);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.prompt-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}
.console-input {
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  caret-color: var(--accent);
}
/* the blinking block cursor — visible until you focus or type */
.prompt-cursor {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.55em;
  height: 1.1em;
  background: var(--accent);
  box-shadow: var(--glow-soft);
  animation: crt-blink 1.15s steps(1) infinite;
  pointer-events: none;
}
.console-input:focus + .prompt-cursor,
.console-input:not(:placeholder-shown) + .prompt-cursor { display: none; }
/* the Reasoner console module */
.module-console { display: flex; }
.console {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg2);
}

/* Ask Anything: the reView thread-history rail (left of the console) */
.thread-rail {
  width: clamp(190px, 17vw, 280px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
}
.thread-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.9rem 0.45rem;
}
.thread-rail-title {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: .22em;
}
.thread-refresh {
  background: none;
  border: 1px solid var(--accent2-dim);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  padding: 0 0.4rem;
}
.thread-refresh:hover { color: var(--accent); border-color: var(--accent2); }
.thread-rail-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.55rem 1rem 0.6rem;
}
.thread-link {
  background: none;
  border: none;
  border-left: 2px solid var(--border);
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  text-align: left;
  padding: 0.22rem 0.55rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.thread-link:hover { color: var(--text); border-left-color: var(--accent2); }
.thread-link-active {
  color: var(--accent);
  border-left-color: var(--accent2);
  text-shadow: var(--glow-soft);
}
.thread-live { color: var(--accent); }
.thread-rail-msg {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 0.4rem 0.6rem;
}
.console-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.3rem 1.4rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.console-banner {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: pre-wrap;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-dim);
}
.con-line { margin-top: 1rem; word-break: break-word; }
.con-q { color: var(--text); font-weight: 600; }
.con-tool {
  color: var(--amber);
  font-size: 0.76rem;
  margin: 0.4rem 0 0 1.4rem;
  word-break: break-all;
}
.con-answer {
  margin: 0.5rem 0 0 1.4rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--accent-dim);
  white-space: pre-wrap;
  color: var(--text);
}
/* Live Reasoner answers arrive as markdown — restyle it to fit the console. */
.con-md { white-space: normal; }
.con-md p, .con-md ul, .con-md ol, .con-md table { margin: 0.45rem 0; }
.con-md h1, .con-md h2, .con-md h3, .con-md h4 {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0.9rem 0 0.3rem;
}
.con-md hr { border: none; border-top: 1px dashed var(--border-dim); }
.con-md code {
  color: var(--amber);
  background: transparent;
  font-family: inherit;
}
.con-md pre {
  border: 1px solid var(--border-dim);
  padding: 0.5rem 0.7rem;
  overflow-x: auto;
}
.con-md table { border-collapse: collapse; display: block; overflow-x: auto; }
.con-md th, .con-md td {
  border: 1px solid var(--border-dim);
  padding: 0.2rem 0.55rem;
  text-align: left;
}
.con-md th { color: var(--accent); }
.con-md a { color: var(--accent); }
.con-cursor {
  display: inline-block;
  margin: 0.5rem 0 0 1.4rem;
  color: var(--accent);
  text-shadow: var(--glow-soft);
  animation: crt-blink 1.15s steps(1) infinite;
}
.console-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.3rem;
  border-top: 1px solid var(--border);
  background: var(--panel-bg);
  flex-shrink: 0;
}

.summary { color: var(--muted); font-size: 0.82rem; letter-spacing: .02em; }

/* Data-source badge: local CSVs vs live reView graph (server · project) */
.src-badge {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
}
.src-badge:empty { display: none; }
.src-badge.src-live { color: var(--ok); border-color: var(--ok); }
.src-badge.src-csv { color: var(--amber); border-color: var(--amber); }
.src-badge.src-none { color: var(--err); border-color: var(--err); }

/* theme toggle + help buttons */
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.theme-btn {
  height: 1.9rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg2);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
}
a.training-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  text-shadow: var(--glow-soft);
}

/* ------------------------------------------------------------ module bar */
.module-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 1.1rem 0;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.module-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5rem 0.9rem 0.45rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--accent2-dim);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  white-space: nowrap;
}
.module-tab:hover { color: var(--text); border-color: var(--accent2); }
.module-tab.module-active {
  color: var(--accent);
  border-color: var(--accent2);
  box-shadow: var(--glow2-soft);
  text-shadow: var(--glow-soft);
  background: var(--panel-bg2);
}
/* One glyph per tab (MODULE_ICONS in app.py), set at text weight in the
   secondary accent so it reads as a marker, not decoration. */
.tab-icon {
  color: var(--accent2-dim);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1;
}
.module-tab:hover .tab-icon { color: var(--accent2); }
.module-tab.module-active .tab-icon {
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
}
/* drag-to-reorder feedback (assets/taborder.js) */
.module-tab.tab-dragging { opacity: 0.35; }
.module-tab.tab-drop-left { box-shadow: -3px 0 0 0 var(--accent2); }
.module-tab.tab-drop-right { box-shadow: 3px 0 0 0 var(--accent2); }

/* module pages: all mounted, only the active one visible */
.module-page { flex: 1; min-height: 0; }
.module-review { flex-direction: column; }
.module-scroll {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}
/* the Voxelize explainer lives in its own document (an iframe over
   assets/voxelization.html) — the frame just fills the module page */
.voxel-frame { flex: 1; min-height: 0; width: 100%; border: 0;
  background: var(--bg); }
.module-card {
  width: min(46rem, 92vw);
  margin: 2.2rem auto;
  padding: 1.4rem 1.6rem 1.8rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.module-title {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
}
.module-h4 {
  margin: 1.4rem 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
}
.module-h4::before { content: "// "; color: var(--accent2); }
.module-h4:empty { display: none; }

/* Scrolling pages (00 Data Overview, 06 Help): a sticky bookmark rail on
   the left jumps between sections. */
.page-with-nav { flex-direction: row; }
.page-nav {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex-shrink: 0;
  width: clamp(150px, 14vw, 210px);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.7rem 0.4rem 1rem 1rem;
}
.page-nav-head {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: .22em;
  margin-bottom: 0.45rem;
}
.page-nav-link {
  background: none;
  border: none;
  border-left: 2px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  padding: 0.28rem 0 0.28rem 0.65rem;
  text-align: left;
}
.page-nav-link:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  text-shadow: var(--glow-soft);
}
/* Sections land clear of the page top when jumped to. */
.hello .module-h4, .hello-hero { scroll-margin-top: 0.9rem; }

/* 00 Data Overview — the landing page */
.hello {
  width: min(76rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.6rem 3rem;
  min-width: 0;
}
.hello-hero h2 {
  margin: 0 0 0.7rem;
  font-size: 1.55rem;
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
}
.hero-mark { color: var(--accent); text-shadow: var(--glow); }
.hello-hero p {
  margin: 0;
  max-width: 64rem;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.7;
}
.hello-folder {
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 0.6rem;
  word-break: break-all;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.6rem;
  margin: 0.3rem 0 0.7rem;
}
.stat {
  padding: 0.65rem 0.8rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.stat-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: var(--glow-soft);
}
.stat-label {
  margin-top: 0.15rem;
  font-size: 0.66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hello-wells { max-width: 44rem; }
.hello-sig {
  margin: 0.45rem 0;
  padding: 0.5rem 0.9rem;
  border-left: 2px solid var(--amber);
  background: rgba(255, 180, 84, 0.05);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.6;
  max-width: 64rem;
}
.sig-mark { color: var(--amber); }
/* graph schema (HelloWorld) */
.schema-wrap {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.schema-canvas {
  flex: 3;
  min-width: 24rem;
  /* Tall enough for four layers: the trust band sits below the earth
     model, so the schema is roughly half again as deep as it was. */
  height: 40rem;
  position: relative;
  overflow: hidden;
  background: var(--panel-bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.schema-notes {
  flex: 2;
  min-width: 18rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.schema-note {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.6;
}
.schema-note b { color: var(--accent2); font-weight: 700; }
.schema-hint {
  font-size: 0.74rem;
  border-top: 1px dashed var(--border-dim);
  padding-top: 0.6rem;
}

.mcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: 0.8rem;
  margin-top: 0.4rem;
}
.mcard {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mcard-num {
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: .14em;
}
.mcard-title {
  margin: 0.15rem 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}
.mcard p {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}
.mcard ul {
  margin: 0 0 0.7rem;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.81rem;
  line-height: 1.55;
}
.mcard ul li::marker { color: var(--accent2); }
.mcard .chip-grid { margin: 0 0 0.75rem; }
.mcard-open {
  margin-top: auto;
  align-self: flex-start;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.mcard-open:hover { background: var(--wash); box-shadow: var(--glow-soft); }
.hello-tips {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}
.hello-tips li::marker { color: var(--accent2); }

/* Data module: two-column layout (left = controls + contents, right = node
   explorer: well -> node types -> data grid) */
.data-left {
  width: clamp(340px, 36vw, 560px);
  flex-shrink: 0;
  overflow-y: auto;
  padding: 1.1rem 1.3rem 2rem;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
}

/* Data Loader: the three data-source tabs in the left column. */
.data-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.9rem 0 0.2rem;
  border-bottom: 1px solid var(--border);
}
.data-tab {
  background: none;
  border: 1px solid var(--accent2-dim);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
}
.data-tab:hover { color: var(--text); border-color: var(--accent2); }
.data-tab.data-tab-active {
  color: var(--accent);
  border-color: var(--accent2);
  box-shadow: var(--glow2-soft);
  text-shadow: var(--glow-soft);
  background: var(--panel-bg2);
}
.data-right {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.9rem 1.2rem 1rem;
  background: var(--panel-bg2);
}
.data-right .module-h4:first-child { margin-top: 0.2rem; }

/* Data Loader: wellbore preview (mirrors the DataCube Viewer scene)
   beside the graph-design schema — split by the draggable #sim-scene-split —
   then the #sim-split divider and the node explorer below. */
.sim-scene-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
}
.sim-scene-pane,
.sim-schema-pane {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sim-schema-pane { padding-left: 0.15rem; }
.sim-scene-pane { padding-right: 0.15rem; }
.sim-scene-wrap .module-h4 { margin-top: 0.2rem; }
.sim-scene-controls { max-width: 18rem; margin-bottom: 0.5rem; }
.sim-schema-hint { margin: 0.35rem 0 0.5rem; }
.sim-scene-pane.pane-popped,
.sim-schema-pane.pane-popped { padding: 0.8rem 1.1rem 1.1rem; }
.sim-scene-canvas {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  overflow: hidden;
}
.sim-explorer {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 1rem;
}

.ov-row { cursor: pointer; }
.ov-row:hover td { color: var(--accent); }
.ov-row.ov-selected td {
  color: var(--accent);
  text-shadow: var(--glow-soft);
  border-bottom-color: var(--accent-dim);
}

/* node-type chips */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.2rem 0 0.6rem;
}
/* Suggested-ask chips on the Overview tour. (The Data Loader's node-type
   chips became the picker below.) */
.chip {
  display: inline-flex;
  align-items: baseline;
  padding: 0.32rem 0.65rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: left;
  max-width: 16rem;
}
.chip:hover { border-color: var(--accent-dim); color: var(--accent); }

/* Node-type picker: the heading and the dropdown share one row, so the label
   list costs ~34px instead of ~28 description cards. The option rows are
   single-line (name · count · blurb) so the closed control stays one row
   high — the selected type's full description leads the grid below. */
.node-pick-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;          /* narrow panes drop the dropdown below the heading */
  gap: 0.4rem 0.7rem;
  margin: 0.2rem 0 0.5rem;
}
.node-pick-row .module-h4 { margin: 0; white-space: nowrap; }
.node-pick-row .dash-dropdown { flex: 1; min-width: 11rem; }
.opt-row {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  min-width: 0;
  white-space: nowrap;
}
.opt-name { font-weight: 700; }
.opt-count { color: var(--muted); font-size: 0.78em; }
.opt-desc {
  color: var(--muted);
  font-size: 0.78em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opt-unscoped { opacity: 0.6; }

.grid-desc { color: var(--text); font-size: 0.76rem; margin-bottom: 0.25rem; }

.grid-note { color: var(--muted); font-size: 0.74rem; margin-bottom: 0.4rem; }

/* dash DataTable chrome (colors come from _grid_styles in app.py) */
.data-right .dash-table-container .previous-next-container {
  color: var(--muted);
  font-family: inherit;
}
.data-right .dash-table-container .previous-next-container button {
  color: var(--accent) !important;
  font-family: inherit;
}
.data-right .dash-table-container .current-page,
.data-right .dash-table-container .page-number {
  color: var(--muted);
  font-family: inherit;
}
.data-right .dash-filter input {
  color: var(--text) !important;
  font-family: inherit;
}

/* Data Loader: saved simulations */
.sim-save-row {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
  margin-bottom: 0.35rem;
}
.sim-btn {
  padding: 0.35rem 0.75rem;
  background: var(--panel-bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}
.sim-btn:hover { border-color: var(--accent-dim); background: var(--wash); }
.sim-del { color: var(--muted); }
.sim-del:hover { color: var(--err); border-color: var(--err); background: transparent; }
.sim-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--border-dim);
}
.sim-info { flex: 1; min-width: 0; }
.sim-name {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-word;
}
.sim-meta { color: var(--muted); font-size: 0.7rem; }
.sim-meta.sim-generated { color: var(--accent-dim); }

/* Data module: generator parameter grid */
.gen-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.1rem 0.9rem;
  margin-bottom: 0.8rem;
}
.gen-quality-hint { margin: -0.5rem 0 0.7rem 0; }
.gen-input {
  width: 100%;
  padding: 0.42rem 0.55rem;
  background: var(--panel-bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
}
.gen-input:focus { outline: none; border-color: var(--accent-dim); }

/* dataset overview table (Data module) */
.ov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.ov-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 0.3rem 0.6rem 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.ov-table td {
  padding: 0.32rem 0.6rem 0.32rem 0;
  border-bottom: 1px dotted var(--border-dim);
}

/* 06 Asset Performance & Optimization for Energy Overview — the operator's manual */
.ov-lead {
  margin: 0 0 0.7rem;
  max-width: 64rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.ov-group {
  margin: 1rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent2);
}
.ov-table code {
  color: var(--accent2);
  font-size: 0.8rem;
  word-break: break-word;
}
.ov-table td { vertical-align: top; line-height: 1.55; }
.ov-steps {
  max-width: 64rem;
  margin: 0.3rem 0 0.9rem;
  padding-left: 1.4rem;
  font-size: 0.88rem;
  line-height: 1.7;
}
.ov-steps li { margin-bottom: 0.45rem; }
.ov-steps li::marker { color: var(--accent); font-weight: 700; }
.ov-pre {
  margin: 0.5rem 0 0.2rem;
  padding: 0.6rem 0.9rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--accent);
  overflow-x: auto;
  max-width: 40rem;
}

/* Performance Benchmarking module */
.bench-map {
  height: 270px;
  margin: 0.2rem 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  overflow: hidden;
}
.bench-map-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
/* the flex sizing must hit Dash's outer .dash-dropdown wrapper — className
   on dcc.Dropdown lands on the inner react-select div, which is why the
   control collapsed to its 50px content width */
.bench-map-row .dash-dropdown { flex: 1; min-width: 9rem; }
.bench-map-row .net-reset { flex-shrink: 0; }

.bench-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem 0.9rem;
  background: var(--panel-bg2);
}
.bench-note { color: var(--muted); font-size: 0.8rem; flex-shrink: 0; }
.bench-graph {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.bench-graph > div,
.bench-graph .dash-graph,
.bench-graph .js-plotly-plot,
.bench-graph .plot-container,
.bench-graph .svg-container {
  height: 100% !important;
  width: 100% !important;
}

/* ---- Production / Completions module ---------------------------------- */
.prod-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem 0.9rem;
  background: var(--panel-bg2);
}
.prod-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.5rem;
}
.prod-graph {
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.prod-graph > div,
.prod-graph .dash-graph,
.prod-graph .js-plotly-plot,
.prod-graph .plot-container,
.prod-graph .svg-container {
  height: 100% !important;
  width: 100% !important;
}
.prod-targets {
  flex-shrink: 0;
  max-height: 11rem;
  overflow-y: auto;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}
.tf-head {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.tf-row {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.12rem 0;
  border-bottom: 1px dotted var(--border-dim);
}
.tf-row:last-child { border-bottom: none; }
.tf-rank { color: var(--muted); min-width: 1.4rem; }
.tf-well { min-width: 16rem; }
.tf-ratio { color: var(--accent); min-width: 6.5rem; }
.tf-badges { color: var(--muted); }

.body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ---------------------------------------------------------------- sidebar */
.sidebar {
  width: clamp(260px, 19vw, 460px);
  flex-shrink: 0;
  padding: 1rem 1rem 2rem;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.control-label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}
.control-label::before { content: "» "; color: var(--accent2); }

.folder-input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: var(--panel-bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
}
.folder-input:focus { outline: none; border-color: var(--accent-dim); }

.load-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: var(--glow-soft);
}
.load-btn:hover { filter: brightness(1.12); box-shadow: var(--glow); }

/* Data Loader: reView project picker */
.review-picker-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.review-picker-row .load-btn {
  width: auto;
  margin-top: 0;
  flex-shrink: 0;
  font-size: 0.76rem;
  padding: 0.4rem 0.6rem;
}
.review-picker-dd { flex: 1; min-width: 0; }

/* Configuration: read-only server summary */
.cfg-sum-row {
  display: flex;
  gap: 0.6rem;
  margin: 0.25rem 0;
  font-size: 0.8rem;
}
.cfg-sum-key {
  flex-shrink: 0;
  width: 6.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 0.72rem;
  padding-top: 0.08rem;
}
.cfg-sum-val { word-break: break-all; }

.load-status { margin-top: 0.5rem; font-size: 0.78rem; word-break: break-all; }
.load-status .ok { color: var(--ok); }
.load-status .err { color: var(--err); }

/* Data Loader: live graph-load progress */
.load-progress { margin-top: 0.5rem; }
.progress-track {
  height: 8px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  box-shadow: var(--glow-soft);
  transition: width 0.4s ease;
}
.progress-pulse { animation: progress-pulse 1.2s ease-in-out infinite; }
@keyframes progress-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.8; }
}
.progress-note {
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.review-btn {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.review-btn:hover {
  background: var(--wash);
  box-shadow: var(--glow-soft);
  filter: brightness(1.1);
}
.review-btn:active { filter: brightness(0.9); }
.review-status {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  word-break: break-all;
  line-height: 1.5;
}
.review-status .ok   { color: var(--ok); }
.review-status .err  { color: var(--err); }
.review-status .muted { color: var(--muted); }

.control { margin-bottom: 0.5rem; font-size: 0.9rem; }
.check { margin-top: 0.4rem; font-size: 0.9rem; }

hr { border: none; border-top: 1px dashed var(--border); margin: 1rem 0 0.3rem; }

/* dash slider (rc-slider) theming */
.rc-slider-rail { background-color: var(--border-dim); }
.rc-slider-track { background-color: var(--accent-dim); }
.rc-slider-handle {
  background-color: var(--accent);
  border-color: var(--accent-dim);
}
.rc-slider-handle:hover,
.rc-slider-handle:active,
.rc-slider-handle:focus {
  border-color: var(--accent);
  box-shadow: var(--glow-soft);
}
.rc-slider-mark-text { color: var(--muted); font-family: inherit; }
.rc-slider-mark-text-active { color: var(--text); }
.rc-slider-dot { background-color: var(--panel-bg2); border-color: var(--border); }
.rc-slider-dot-active { border-color: var(--accent-dim); }

/* --------- centre: physical + semantic column | chatter + logs column --- */
.center {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

/* "Settings" title at the top of a module sidebar */
.side-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
  margin: 0 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

/* viewport — the left column: the physical network (voxel earth model) 3-D
   scene stacked over the semantic network, ~2/3 of the centre width */
.viewport {
  flex: 2;
  min-height: 0;
  min-width: 0;
  background: var(--panel-bg2);
  display: flex;
  flex-direction: column;
}
.viewport-canvas {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  /* see .net-canvas — never paint an oversized plot over the other panes */
  overflow: hidden;
}
/* dcc.Loading wrapper + Plotly internals need explicit height to fill */
.viewport-canvas > div,
.viewport-canvas .dash-graph,
.viewport-canvas .js-plotly-plot,
.viewport-canvas .plot-container,
.viewport-canvas .svg-container {
  height: 100% !important;
  width: 100% !important;
}

/* draggable divider between stacked panes (row-resize) */
.splitter {
  flex: 0 0 8px;
  min-height: 8px;
  cursor: row-resize;
  background: var(--panel-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
  transition: background .12s;
}
.splitter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 3px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  opacity: .55;
}
.splitter:hover,
.splitter.dragging {
  background: var(--accent-dim);
}
.splitter:hover::after,
.splitter.dragging::after {
  background: var(--accent-contrast);
  opacity: .9;
}

/* vertical divider between the centre column and the right column */
.splitter-h {
  flex: 0 0 8px;
  min-width: 8px;
  min-height: 0;
  cursor: col-resize;
  border-top: none;
  border-bottom: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.splitter-h::after {
  width: 3px;
  height: 44px;
}

/* network — the right column: depth chatter stacked over the log viewer,
   ~1/3 of the centre width */
.network {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  /* two panes stacked: depth chatter / log viewer */
  flex-direction: column;
  background: var(--panel-bg2);
  border-left: 2px solid var(--border);
}
.net-pane {
  flex: 2 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.log-pane {
  flex: 3 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.log-controls {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem 0.35rem;
}
.log-params-dd { flex: 1 1 100%; min-width: 0; }
.log-window-dd { flex: 3 1 0; min-width: 96px; max-width: 130px; }
.log-canvas > div,
.log-canvas .dash-graph,
.log-canvas .js-plotly-plot,
.log-canvas .plot-container,
.log-canvas .svg-container {
  height: 100% !important;
  width: 100% !important;
}
.net-header {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
}
.net-reset {
  margin-left: auto;
  align-self: center;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel-bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.net-reset:hover { border-color: var(--accent-dim); color: var(--accent); }
.net-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
}
.net-subtitle { color: var(--muted); font-size: 0.78rem; }
/* overflow:hidden clips a plot that rendered before its pane had its final
   size (e.g. while the module page was still hidden) so it can never paint
   over the neighbouring panes; the module-switch resize nudge then re-fits. */
.net-canvas { flex: 1; min-height: 0; position: relative; overflow: hidden; }

/* ----------------- right column: inspector on top, reVEAL below --------- */
.right-col {
  width: clamp(300px, 22vw, 540px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--border);
}

/* inspector panel */
.panel {
  flex: 3;
  min-height: 0;
  padding: 1rem 1.1rem 2rem;
  background: var(--panel-bg);
  overflow-y: auto;
}

/* embedded reVEAL app / Reasoner chat, lower-right corner */
.reveal-pane {
  flex: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg2);
}
.reveal-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
  background: #fff; /* the embedded app is not theme-aware */
}
.reveal-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---- AI context: Reasoner strip at the top of the inspector ------------ */
.ai-ctx {
  flex-shrink: 0;
  min-height: 0;
  max-height: 45%;
  overflow-y: auto;
  background: var(--panel-bg2);
}
/* Hide the strip — and the drag bar under it — until there is AI content. */
.ai-ctx:empty { display: none; }
.ai-ctx:empty + #ai-split { display: none; }
.ai-ctx-body, .ai-ctx-hint {
  padding: 0.6rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.ai-ctx-head {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}
.ai-ctx-tag {
  font-size: 0.68rem;
  letter-spacing: .14em;
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
  flex-shrink: 0;
}
.ai-ctx-node {
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
}
.ai-ctx-md { font-size: 0.85rem; }
.ai-ctx .con-tool, .ai-ctx .con-cursor { margin-left: 0; }

/* ---- confirm dialog: review the Reasoner prompt before it is sent ------ */
.ask-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ask-overlay.hidden { display: none; }
.ask-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.ask-panel {
  position: relative;
  width: min(720px, 88vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
}
.ask-head {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.ask-title {
  color: var(--accent2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-shadow: var(--glow2-soft);
  flex-shrink: 0;
}
.ask-node {
  color: var(--accent);
  font-size: 0.85rem;
  word-break: break-all;
}
.ask-hint { margin-bottom: 0.5rem; }
.ask-prompt {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.85rem;
  background: var(--panel-bg2);
  border: 1px solid var(--border-dim);
  font-family: inherit;
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.ask-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.ask-busy {
  margin-right: auto;
  color: var(--amber);
  font-size: 0.75rem;
}
.ask-btn {
  padding: 0.35rem 1.1rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel-bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.ask-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.ask-btn-send {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--accent-contrast);
}
.ask-btn-send:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

/* ------------------------------------------------------------- inspector */
.panel-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--accent);
  text-shadow: var(--glow-soft);
  word-break: break-all;
}
.panel h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2rem;
}
.panel h4::before { content: "// "; color: var(--accent2); }
.panel-hint { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.22rem 0;
  font-size: 0.85rem;
  border-bottom: 1px dotted var(--border-dim);
}
.kv-key { color: var(--muted); flex-shrink: 0; }
.kv-val { text-align: right; word-break: break-word; }

/* "At this depth" offset benchmarking (inspector) */
.dm-scope {
  color: var(--muted);
  font-size: 0.74rem;
  margin-bottom: 0.4rem;
}
.dm-row { margin: 0.45rem 0 0.55rem; }
.dm-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.85rem;
}
.dm-name { color: var(--muted); }
.dm-val { font-weight: 700; }
.dm-track {
  margin-top: 0.22rem;
  height: 0.42rem;
  background: var(--panel-bg2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dm-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .25s ease;
}
.dm-fill.dm-good { background: var(--accent); box-shadow: var(--glow-soft); }
.dm-fill.dm-mid  { background: var(--amber); }
.dm-fill.dm-bad  { background: var(--err); }
.dm-note {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.dm-subhead {
  margin: 0.8rem 0 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.dm-this { color: var(--accent) !important; text-shadow: var(--glow-soft); }

/* drilling remarks */
.cmt {
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--border-dim);
  font-size: 0.85rem;
}
.cmt-meta { color: var(--muted); font-size: 0.76rem; margin-left: 0.4rem; }
.cmt-text { margin-top: 0.2rem; line-height: 1.35; }
.sev {
  display: inline-block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0.05rem 0.4rem;
  border-radius: 2px;
  font-weight: 700;
}
/* status colour carries the meaning; the fill is a tint of it so the
   text clears 4.5:1 in both themes */
.sev-info { color: var(--accent2);
  background: color-mix(in srgb, var(--accent2) 14%, transparent); }
.sev-watch { color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, transparent); }
.sev-critical { color: var(--err);
  background: color-mix(in srgb, var(--err) 14%, transparent); }

/* ------------------------------- gear button (header) ------------------- */
/* Configuration lives here rather than on the module bar: setup, not a step
   in the workflow the tabs describe. It replaced the old ? overlay button. */
.gear-btn {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-bg2);
  color: var(--muted);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.gear-btn:hover {
  color: var(--accent-contrast);
  border-color: var(--accent);
  background: var(--accent);
}
/* Configuration is on screen — the gear carries the active mark the tabs
   would otherwise show. */
.gear-btn.gear-active {
  color: var(--accent);
  border-color: var(--accent2);
  background: var(--wash);
  box-shadow: var(--glow2-soft);
  text-shadow: var(--glow-soft);
}

/* --------------------- dash dropdowns, themed + scaled with rem --------- */
.Select-control, .Select-menu-outer,
.has-value.Select--single > .Select-control .Select-value .Select-value-label {
  background: var(--panel-bg2) !important;
  color: var(--text) !important;
  font-size: 0.9rem;
}
.Select-control { border-color: var(--border) !important; }
.is-focused:not(.is-open) > .Select-control {
  border-color: var(--accent-dim) !important;
  box-shadow: var(--glow-soft) !important;
}
.Select-menu-outer { border-color: var(--border) !important; }
.Select-placeholder, .Select-input > input { font-size: 0.9rem; color: var(--muted) !important; }
.Select-arrow { border-top-color: var(--muted) !important; }
.Select--multi .Select-value {
  background: var(--wash) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.Select--multi .Select-value-icon {
  border-right-color: var(--border) !important;
  color: var(--text) !important;
}
.Select--multi .Select-value-icon:hover { color: var(--err) !important; }
.VirtualizedSelectOption { background: var(--panel-bg2); color: var(--text); font-size: 0.9rem; }
.VirtualizedSelectFocusedOption { background: var(--accent-dim); color: var(--accent-contrast); }

/* close-up controls floating over the 3-D viewport (top-left; plotly's
   modebar owns the top-right) */
.viewport-canvas > .scene-zoom-controls {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 10;
  display: flex;
  gap: 6px;
  /* beat the `.viewport-canvas > div` 100%-fill rule */
  height: auto !important;
  width: auto !important;
  pointer-events: none; /* don't steal rotate/zoom drags from the scene */
}
.scene-zoom-btn { pointer-events: auto; }
.scene-zoom-btn {
  padding: 0.2rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel-bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.85;
}
.scene-zoom-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
  opacity: 1;
}

/* Help page: the embedded presentation decks (collapsible) */
.pres-deck {
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent2-dim);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  margin: 0.55rem 0;
  max-width: 980px;
  scroll-margin-top: 0.9rem;
}
.pres-deck > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.6rem 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pres-deck > summary::-webkit-details-marker { display: none; }
.pres-caret { color: var(--accent2); font-size: 0.8rem; }
.pres-deck[open] .pres-caret { transform: none; }
.pres-title {
  color: var(--accent2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pres-blurb { color: var(--muted); font-size: 0.78rem; }
.pres-deck > summary:hover .pres-title { text-shadow: var(--glow2-soft); }
.pres-deck[open] { border-left-color: var(--accent2); }
.pres-deck[open] > summary { border-bottom: 1px solid var(--border); }
.pres-md {
  padding: 0.4rem 1.2rem 1.1rem;
  font-size: 0.85rem;
  line-height: 1.6;
}
.pres-md h1 { font-size: 1.15rem; }
.pres-md h2 { font-size: 0.98rem; margin-top: 1.1rem; }
.pres-md h3 { font-size: 0.88rem; }
.pres-md hr {
  border: none;
  border-top: 1px dashed var(--accent2-dim);
  margin: 1.1rem 0;
  opacity: 0.55;
}
.pres-md blockquote {
  margin: 0.6rem 0;
  padding: 0.15rem 0.9rem;
  border-left: 2px solid var(--amber);
  color: var(--text);
  background: var(--wash);
}
.pres-md table { width: 100%; }

/* Overview: the documentation library and its reader -------------------- */

/* Section headings on the Overview tour read as chapter titles, matching
   the hero, rather than the small sidebar-style caps .module-h4 gives
   everywhere else in the app. Scoped to this page on purpose. */
#overview-content .module-h4 {
  margin: 2.6rem 0 0.9rem;
  padding-bottom: 0.45rem;
  font-size: 1.55rem;
  letter-spacing: .03em;
  color: var(--accent2);
  text-shadow: var(--glow2-soft);
}
#overview-content .hello-hero + .module-h4 { margin-top: 1.8rem; }

.hello-hero-sub {
  margin-top: 0.6rem !important;
  color: var(--muted) !important;
  font-size: 0.87rem !important;
}

/* A module card's footer: jump into the module, or read its guide. */
.mcard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.7rem;
}
.mcard-actions .mcard-open { margin-top: 0; }
.mcard-doc {
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.mcard-doc:hover {
  border-color: var(--accent2-dim);
  color: var(--accent2);
  box-shadow: var(--glow2-soft);
}

/* An inline "open that document" link inside running prose. */
.doc-inline {
  padding: 0;
  background: none;
  border: none;
  border-bottom: 1px dashed var(--accent2-dim);
  color: var(--accent2);
  font: inherit;
  cursor: pointer;
}
.doc-inline:hover { text-shadow: var(--glow2-soft); }

/* Trust tiers, shown as a strip on the Overview tour. */
.ov-tier-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.ov-tier-chip {
  display: flex;
  align-items: center;
  cursor: help;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  font-size: 0.76rem;
  color: var(--muted);
}

/* The library grid: one card per shipped document. */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.8rem;
  margin: 0.4rem 0 0.5rem;
}
.doc-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem 0.75rem;
  text-align: left;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent2-dim);
  border-radius: var(--radius-sm);
  font-family: inherit;
  cursor: pointer;
}
.doc-card:hover {
  background: var(--wash);
  border-left-color: var(--accent2);
  box-shadow: var(--glow2-soft);
}
.doc-card-title {
  color: var(--accent2);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: .02em;
}
.doc-card-blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.55;
}
.doc-card-go {
  margin-top: auto;
  padding-top: 0.35rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* The reader: one library document, full page. */
.doc-read-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}
.doc-back {
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.doc-back:hover { background: var(--wash); box-shadow: var(--glow-soft); }
.doc-read-title {
  color: var(--accent2);
  font-size: 1.15rem;
  font-weight: 700;
  text-shadow: var(--glow2-soft);
}
.doc-read-body { padding-left: 0; padding-right: 0; max-width: 62rem; }

/* README module: the repository landing page, rendered from README.md ---- */
.readme-page {
  width: min(76rem, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.6rem 3rem;
  min-width: 0;
}
/* The GitHub link sits hard right of the title + strapline. */
.readme-head { align-items: baseline; }
.readme-sub {
  flex: 1;
  min-width: 12rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.readme-gh { text-decoration: none; white-space: nowrap; }

/* 07 Configuration: keys + reView server picker ------------------------- */
.cfg-cols {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 1.1rem;
  flex: 1;
  padding: 1.1rem 1.3rem 2rem;
  overflow-y: auto;
  background: var(--bg);
}
.cfg-card {
  flex: 1 1 320px;
  min-width: 300px;
  max-width: 620px;
  padding: 1rem 1.2rem 1.3rem;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cfg-card .module-h4:first-child { margin-top: 0; }
.cfg-grid { display: flex; flex-direction: column; }
.cfg-input { margin-bottom: 0.55rem; }

/* The editable credentials form: label above a full-width input. This is the
   only way to get credentials into a container, where no .env is baked in. */
.cfg-f-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.5rem 0 0;
}
.cfg-f-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
/* These share .cfg-input's chrome but not its 7rem width (that is sized for
   the numeric evidence-floor boxes). Tag-qualified so it wins on specificity
   rather than on source order — .cfg-input is redefined further down. */
input.cfg-f-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.1rem;
}
.cfg-f-input::placeholder { color: var(--muted); opacity: 0.6; }
.cfg-actions { display: flex; gap: 0.5rem; }
.cfg-actions .cfg-btn { flex: 1; }
.cfg-btn-alt {
  background: var(--panel-bg2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.cfg-btn-alt:hover {
  filter: none;
  box-shadow: none;
  border-color: var(--accent-dim);
  background: var(--wash);
}
.cfg-active {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--panel-bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}
.cfg-active-name {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cfg-active-url { color: var(--muted); word-break: break-all; }
.cfg-active .ok { color: var(--ok); }
.cfg-active .err { color: var(--err); }
.cfg-warn { color: var(--accent2); }

/* Viewer sidebar tabs: Settings / Wellbore viewer -------------------------- */
.side-tabs { margin: 0 0 0.4rem; }
.side-tabs .data-tab { flex: 1; padding: 0.4rem 0.3rem; }
.wb-facts {
  margin: 0.6rem 0 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
  word-break: break-word;
}
.wb-profile { height: 480px; }
.wb-profile .js-plotly-plot,
.wb-profile .plot-container,
.wb-profile .svg-container {
  height: 100% !important;
  width: 100% !important;
}
.log-basis-dd { flex: 2 1 0; min-width: 72px; max-width: 90px; }

/* Left column split: 3-D scene (top) over the semantic network (bottom) -- */
.phys-left {
  flex: 3 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Right column top pane: the depth-chatter feed */
.chatter-pane {
  flex: 2 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg2);
}
.wb-head { display: flex; align-items: baseline; justify-content: space-between; }

/* the band ruler: ±10 m of TVD as a strip, one tick per comment */
.chatter-ruler {
  position: relative;
  height: 1.9rem;
  margin: 0.45rem 0.8rem 0;
  flex-shrink: 0;
}
.ruler-line {
  position: absolute;
  left: 0; right: 0; top: 62%;
  height: 1px;
  background: var(--border-bright);
}
.ruler-centre {
  position: absolute;
  left: 50%; top: 38%; bottom: 8%;
  width: 2px;
  background: var(--accent2);
  box-shadow: var(--glow2-soft);
}
.ruler-tick {
  position: absolute;
  top: 46%;
  width: 3px; height: 32%;
  border-radius: 1px;
  transform: translateX(-50%);
}
.rt-info { background: var(--accent2); }
.rt-watch { background: var(--amber); }
.rt-critical { background: var(--err); }
.ruler-lab {
  position: absolute;
  top: 0;
  font-size: 0.55rem;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ruler-lab-l { left: 0; }
.ruler-lab-r { right: 0; }

.chatter-sev {
  flex-shrink: 0;
  display: flex;
  gap: 0.8rem;
  padding: 0.15rem 0.8rem 0.3rem;
  font-size: 0.68rem;
  color: var(--muted);
}
.chatter-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.1rem 0.8rem 0.9rem;
}
.chatter-hint { line-height: 1.6; }
.chat-card {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
}
.chat-card:hover { border-color: var(--accent-dim); background: var(--wash); }
.chat-card-mine { border-left-color: var(--accent); }
.chat-top { display: flex; gap: 0.45rem; align-items: baseline; }
.chat-cat {
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.chat-dz {
  margin-left: auto;
  font-size: 0.64rem;
  color: var(--accent2);
  white-space: nowrap;
}
.chat-text { font-size: 0.74rem; line-height: 1.45; margin: 0.28rem 0; }
.chat-foot {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.6rem;
  color: var(--muted);
}
.chat-src { margin-left: auto; }
.chat-src-mine { color: var(--accent); }
.chat-when { flex-basis: 100%; opacity: 0.75; }

/* Depth chatter controls row: band selector + severity filter */
.chatter-controls {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  padding: 0.15rem 0.8rem 0.3rem;
}
.band-dd { width: 10.5rem; flex-shrink: 0; }
.chatter-controls .chatter-sev { padding: 0; }

/* Comment-type checklist: every type ticked by default, untick to hide */
.chatter-cat {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.7rem;
  font-size: 0.68rem;
  color: var(--muted);
}

/* Pane tools: collapse chevrons on splitters + pop-out overlay ------------- */
.pane-collapse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  padding: 0.55rem 0.1rem;
  font: inherit;
  font-size: 0.62rem;
  line-height: 1;
  color: var(--muted);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
/* horizontal (row-resize) splitters lay the pill flat */
.splitter:not(.splitter-h) .pane-collapse { padding: 0.1rem 0.55rem; }
/* Edge splitters: hang the pill INSIDE the viewport (toward the pane that
   stays visible) — centred on an 8px bar it pokes past the window edge,
   which spawns a horizontal scrollbar and hides the unhide handle. */
#side-split .pane-collapse,
#bench-split .pane-collapse {
  left: 1px;
  transform: translateY(-50%);
}
#h-split .pane-collapse {
  left: auto;
  right: 1px;
  transform: translateY(-50%);
}
.pane-collapse:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--panel-bg2);
}
.splitter-collapsed { background: var(--panel-bg2); }
/* while a pane is hidden, make its restore handle unmissable */
.splitter-collapsed .pane-collapse {
  color: var(--accent);
  border-color: var(--accent-dim);
  box-shadow: var(--glow-soft);
}

.pane-pop-inline {
  flex-shrink: 0;
  align-self: center;
  margin-left: 0.45rem;
  padding: 0.05rem 0.4rem;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--muted);
  background: var(--panel-bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
/* headers without a Reset button: push the ⛶ to the right edge */
.net-header .pane-pop-inline:first-of-type { margin-left: auto; }
.net-header .net-reset + .pane-pop-inline { margin-left: 0.45rem; }
.pane-pop-inline:hover { color: var(--accent); border-color: var(--accent-dim); }

.pane-poppable { position: relative; }
.pane-poppable > .pane-pop {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  z-index: 30;
  padding: 0.05rem 0.4rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.75;
}
.pane-poppable > .pane-pop:hover {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent-dim);
}

.pane-popped {
  position: fixed !important;
  top: 3.5vh;
  left: 2.5vw;
  right: 2.5vw;
  bottom: 3.5vh;
  z-index: 1500;
  background: var(--panel-bg2);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
}
.pane-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(0, 0, 0, 0.55);
}
.pane-backdrop.show { display: block; }

/* ------------------------------------------------- trust tiers & evidence */
/* Tier ramp — keep in sync with dataGenerator/trust_model.py TIER_COLORS
   (the plotly traces read the Python constant; only this copy is manual). */
/* Hover tooltip layer (assets/tiptip.js): any [data-tip] element explains
   itself in a body-level bubble, so a tier definition is never clipped by a
   scrolling pane and never waits on the browser's title delay. */
.tiptip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2000;
  max-width: 24rem;
  padding: 0.45rem 0.6rem;
  background: var(--panel-bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-line;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s ease-in;
}
.tiptip.on { opacity: 1; }

:root {
  --tier-1: #3E8E5E;
  --tier-2: #6DAE72;
  --tier-3: #A9C97E;
  --tier-4: #E2B85C;
  --tier-5: #DA8452;
  --tier-6: #C44E52;
}
.tier-badge {
  display: inline-block;
  padding: 0 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25rem;
  color: #10130f;
  cursor: help;
}
.tier-badge.tier-1 { background: var(--tier-1); color: #ffffff; }
.tier-badge.tier-2 { background: var(--tier-2); }
.tier-badge.tier-3 { background: var(--tier-3); }
.tier-badge.tier-4 { background: var(--tier-4); outline: 1px dashed #10130f; }
.tier-badge.tier-5 { background: var(--tier-5); }
.tier-badge.tier-6 { background: var(--tier-6); color: #ffffff; }

.tier-mix {
  display: inline-flex;
  width: 7.5rem;
  min-width: 7.5rem;
  height: 0.55rem;
  border-radius: 2px;
  overflow: hidden;
  background: var(--border-dim);
  align-self: center;
}
.tier-mix-seg { display: inline-block; height: 100%; cursor: help; }
.tier-bg-1 { background: var(--tier-1); }
.tier-bg-2 { background: var(--tier-2); }
.tier-bg-3 { background: var(--tier-3); }
.tier-bg-4 { background: var(--tier-4); }
.tier-bg-5 { background: var(--tier-5); }
.tier-bg-6 { background: var(--tier-6); }

/* refusal strip: entities below the evidence floor (never ranked) */
.bench-insufficient {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 0 0.7rem;
}
.bench-insufficient:not(:empty) {
  border: 1px solid var(--tier-5);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  margin-bottom: 0.4rem;
  max-height: 9rem;
  overflow-y: auto;
}
.insuff-head { color: var(--tier-5); }
.insuff-row { opacity: 0.9; }
.insuff-row .tf-well { min-width: 12rem; }
.tf-missing { color: var(--muted); font-style: italic; }
.tf-range { color: var(--accent2); white-space: nowrap; cursor: help; }
.tf-weakest { color: var(--tier-5); white-space: nowrap; cursor: help; }
.tf-sensitivity {
  color: var(--accent2);
  font-size: 0.78rem;
  margin: 0.1rem 0 0.3rem;
}
.cfg-input {
  width: 7rem;
  background: var(--input-bg, transparent);
  color: var(--font, inherit);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.4rem;
  font-family: inherit;
}

/* ------------------------------------------------------ Data Trust module */
.trust-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.8rem;
  overflow-y: auto;
}
.trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  align-content: start;
}
.trust-card {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  max-height: 21rem;
  overflow-y: auto;
  min-width: 0;
}
.trust-card-fig { min-height: 15rem; }
.trust-card-fig .dash-graph,
.trust-card-fig .js-plotly-plot { height: 13rem !important; }
.trust-legend-row { margin-bottom: 0.4rem; cursor: help; }
.legend-name { font-weight: 600; }
.legend-def { margin: 0.05rem 0 0 0.2rem; }
.trust-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.72rem;
  padding: 0 0.45rem;
  cursor: pointer;
  white-space: nowrap;
}
.trust-btn:hover { background: var(--accent-dim); color: var(--accent-contrast); }
.pa-row { flex-wrap: wrap; }
.pa-val { color: var(--accent2); min-width: 6rem; }
.pa-pref { color: var(--accent); white-space: nowrap; }
.contra-head { border-bottom: 1px solid var(--border); margin-top: 0.35rem; }
.contra-key { font-weight: 600; }
.voi-score { min-width: 15rem; }
@media (max-width: 1100px) { .trust-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ */
/* well-review-user additions: project picker, header brand pick, ask
   perspective. Everything above this line is the verbatim port from
   the old UI. */
.picker-page { flex: 1; min-height: 0; }
.picker-body { display: flex; flex: 1; gap: 0.8rem; min-height: 0;
  padding: 0.6rem 0.8rem; }
.picker-left { flex: 0 0 34rem; display: flex; flex-direction: column;
  gap: 0.4rem; overflow-y: auto; min-height: 0; }
.picker-right { flex: 1; overflow-y: auto; min-height: 0; }
.picker-row { display: flex; gap: 0.4rem; align-items: center; }
/* flex sizing must hit Dash's outer .dash-dropdown wrapper — className on
   dcc.Dropdown lands on the inner react-select div, which otherwise
   collapses the control to its ~50px content width */
.picker-row .dash-dropdown { flex: 1; min-width: 16rem; }
.picker-row button { flex-shrink: 0; }
.picker-well-list { max-height: 16rem; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem; font-size: 0.78rem; }
.picker-well-list label { display: block; padding: 0.05rem 0; }
.picker-overview { display: flex; flex-direction: column;
  gap: 0.15rem; font-size: 0.8rem; }
.load-btn { margin-top: 0.4rem; font-weight: 600; }
.load-progress { min-height: 1.6rem; }
.bar-track { height: 0.5rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); }
.bar-fill { height: 100%; background: var(--accent);
  transition: width 0.3s ease; }
@keyframes load-indeterminate {
  0% { opacity: 0.35; } 50% { opacity: 0.9; } 100% { opacity: 0.35; } }
.bar-note { font-size: 0.72rem; color: var(--muted);
  margin-top: 0.15rem; }
.bar-error { font-size: 0.75rem; color: var(--bad, #d73027); }
.brand-pick { min-width: 13rem; font-size: 0.72rem; }
.ask-perspective { font-size: 0.75rem; }
.ask-actions .dash-dropdown { min-width: 14rem; margin-right: auto; }
.review-page { flex: 1; min-height: 0; }
