/* ============================================================
   CoreRoom — AI & ML Workspace styling
   Warm, technical-but-calm. Matches app tokens.
   ============================================================ */

.mllab { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; }
.mllab[hidden], #ml-root[hidden] { display: none !important; }
#ml-root { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ---------- top ---------- */
.ml-top { flex: none; padding: 24px 34px 0; background: var(--surface); }
.ml-title { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.ml-sub { font-size: 13.5px; color: var(--muted); margin-top: 5px; max-width: 680px; text-wrap: pretty; }

.ml-tabs { flex: none; display: flex; gap: 4px; padding: 16px 34px 0; background: var(--surface); border-bottom: 1px solid var(--hairline); }
.ml-tab {
  position: relative; border: none; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: var(--muted);
  padding: 9px 14px 14px; display: inline-flex; align-items: center; gap: 7px;
}
.ml-tab:hover { color: var(--ink); }
.ml-tab.on { color: var(--accent-ink); }
.ml-tab.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.ml-tab-ct { font-family: var(--mono); font-size: 10px; background: var(--surface-warm); border: 1px solid var(--hairline); border-radius: 100px; padding: 1px 7px; color: var(--faint); }

.ml-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.ml-body { padding: 22px 34px 56px; max-width: 1080px; margin: 0 auto; }
.ml-body.wide { max-width: 980px; }

/* ---------- caution ---------- */
.ml-caution {
  display: flex; gap: 13px; align-items: flex-start; max-width: 1080px; margin: 22px auto 0;
  padding: 14px 18px; border: 1px solid rgba(181,138,27,0.3); background: #FBF4E2;
  border-radius: var(--r); color: #6B5314;
}
.ml-caution svg { width: 19px; height: 19px; color: #B58A1B; flex: none; margin-top: 1px; }
.ml-caution div { font-size: 12.5px; line-height: 1.55; text-wrap: pretty; }
.ml-caution b { color: #4F3D0E; }
.ml-body + .ml-caution { margin-top: 0; }

/* ---------- model library ---------- */
.ml-sec { margin-top: 30px; }
.ml-sec:first-child { margin-top: 6px; }
.ml-sec-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.ml-sec-n { font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 2px; }
.ml-sec-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ml-sec-head p { font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }

.ml-card {
  display: flex; gap: 14px; text-align: left; cursor: pointer; font-family: var(--sans);
  border: 1px solid var(--hairline); border-radius: var(--r); background: var(--surface);
  padding: 16px 17px; transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.ml-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(24,22,15,0.07); transform: translateY(-2px); }
.ml-card-ico { width: 40px; height: 40px; border-radius: 11px; flex: none; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.ml-ico { width: 21px; height: 21px; color: var(--accent-ink); }
.ml-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ml-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ml-card-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; min-width: 0; }
.ml-card-n { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-right: 7px; }
.ml-level { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--lc); border: 1px solid var(--lc); border-radius: 100px; padding: 2px 8px; flex: none; opacity: 0.92; white-space: nowrap; }
.ml-card-one { font-size: 12px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.ml-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 1px; }
.ml-type { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.ml-tagchip { font-family: var(--mono); font-size: 9.5px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 100px; padding: 3px 9px; }
.ml-3dchip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: #1F8A5B; background: rgba(31,138,91,0.12); border-radius: 100px; padding: 3px 8px; margin-left: auto; }
.ml-3dchip svg { width: 12px; height: 12px; }
.ml-done { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--ok); }
.ml-done svg { width: 13px; height: 13px; }

/* ---------- full-screen detail ---------- */
.ml-full { position: fixed; inset: 0; z-index: 6400; background: var(--bg); display: flex; flex-direction: column; opacity: 0; transition: opacity 0.2s; }
.ml-full.show { opacity: 1; }
.ml-full-bar { flex: none; display: flex; align-items: center; gap: 18px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--hairline); }
.ml-back { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hairline); background: var(--surface-warm); border-radius: var(--r-sm); padding: 8px 13px 8px 9px; font-family: var(--sans); font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; flex: none; }
.ml-back svg { width: 15px; height: 15px; }
.ml-back:hover { border-color: var(--accent); color: var(--accent-ink); }
.ml-full-id { display: flex; align-items: center; gap: 13px; flex: 1; min-width: 0; }
.ml-full-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.ml-full-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; }
.ml-full-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.ml-full-inner { max-width: 940px; margin: 0 auto; padding: 28px 34px 64px; }

.ml-d-ico { width: 42px; height: 42px; border-radius: 12px; flex: none; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.ml-d-ico .ml-ico { width: 22px; height: 22px; }
.ml-d-type { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.ml-d-one { font-size: 16px; line-height: 1.55; color: var(--ink); font-weight: 500; margin: 0 0 24px; text-wrap: pretty; }
.ml-d-sec { margin-bottom: 22px; }
.ml-d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.ml-d-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 9px; }
.ml-d-label.warn { color: #B58A1B; }
.ml-mono { font-family: var(--mono); text-transform: none; letter-spacing: 0; color: var(--accent-ink); }
.ml-d-text { font-size: 14px; line-height: 1.6; color: var(--ink); margin: 0; text-wrap: pretty; }
.ml-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.ml-list.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 26px; }
.ml-list li { position: relative; padding-left: 17px; font-size: 13px; line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.ml-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ml-list.warn li::before { background: #B58A1B; border-radius: 1px; }
.ml-d-use { margin-bottom: 24px; padding: 14px 16px; border: 1px solid var(--hairline); border-left: 3px solid var(--accent); border-radius: var(--r-sm); background: var(--surface-warm); }
.ml-d-use .ml-d-label { margin-bottom: 6px; }
.ml-btn { border-radius: var(--r-sm); padding: 10px 18px; font-family: var(--sans); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 7px; }
.ml-btn svg { width: 16px; height: 16px; flex: none; }
.ml-btn.ghost:hover { background: var(--surface-warm); }
.ml-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.ml-btn.primary:hover { background: var(--accent-ink); }
.ml-btn.ghost3d { display: inline-flex; align-items: center; gap: 7px; color: #1F8A5B; border-color: rgba(31,138,91,0.4); background: rgba(31,138,91,0.07); }
.ml-btn.ghost3d svg { width: 16px; height: 16px; }
.ml-btn.ghost3d:hover { background: rgba(31,138,91,0.13); }

/* sample data table */
.ml-tablewrap { border: 1px solid var(--hairline); border-radius: var(--r); overflow: auto; background: var(--surface); }
.ml-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; }
.ml-table th { text-align: left; padding: 9px 12px; background: var(--surface-warm); border-bottom: 1px solid var(--hairline); color: var(--faint); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.ml-table td { padding: 7px 12px; border-bottom: 1px solid var(--hairline-soft); color: var(--ink); white-space: nowrap; }
.ml-table td.k { color: var(--muted); }
.ml-table tr:last-child td { border-bottom: none; }

/* ---------- executed notebook (nbx) ---------- */
#ml-run-area { margin-top: 8px; }
.nbx-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.nbx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; animation: nbxpulse 1s infinite; }
.nbx-dot.done { background: var(--ok); animation: none; }
@keyframes nbxpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.nbx { border: 1px solid #E0E0E0; border-radius: var(--r); overflow: hidden; background: #fff; padding: 4px 10px 8px; }
.nbx-cell { display: flex; gap: 0; border-bottom: 1px solid var(--hairline-soft); }
.nbx-cell:last-child { border-bottom: none; }
.nbx-gut { flex: none; width: 44px; padding: 12px 0; text-align: center; font-family: var(--mono); font-size: 9.5px; color: var(--faint); background: var(--surface-warm); border-right: 1px solid var(--hairline-soft); }
.nbx-cell.out .nbx-gut { color: var(--accent); }
.nbx-code { margin: 0; padding: 12px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: #2A2620; white-space: pre-wrap; flex: 1; min-width: 0; }
.nbx-out { padding: 12px 16px; flex: 1; min-width: 0; }
.nbx-res { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.nbx-text { margin: 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: #2A2620; white-space: pre-wrap; }
.nbx-warn { color: #B58A1B; }
.nbx-fig { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nbx-svg { max-width: 360px; width: 100%; height: auto; }
.nbx-svg.gs { max-width: 380px; }
.nbx-fig .nbx-svg.gs { border: 1px solid #ECECEC; border-radius: 4px; background: #fff; }
.ml-chartcard .nbx-svg { margin: 0 auto; display: block; }
.nbx-cap { font-size: 11.5px; color: var(--muted); text-align: center; text-wrap: pretty; }

/* feature importance bars */
.nbx-imp { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 7px; }
.nbx-imp-row { display: flex; align-items: center; gap: 10px; }
.nbx-imp-l { width: 34px; font-family: var(--mono); font-size: 11px; color: var(--muted); flex: none; text-align: right; }
.nbx-imp-bar { flex: 1; height: 14px; background: var(--surface-warm); border-radius: 3px; overflow: hidden; }
.nbx-imp-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #D98A3D); border-radius: 3px; }
.nbx-imp-v { width: 34px; font-family: var(--mono); font-size: 11px; color: var(--faint); flex: none; }

/* confusion matrix */
.nbx-cm { border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.nbx-cm td { border: 1px solid var(--hairline); padding: 9px 14px; text-align: center; }
.nbx-cm-h { background: var(--surface-warm); color: var(--faint); font-size: 10.5px; }
.nbx-cm .good { background: rgba(31,138,91,0.12); color: #1F6E4A; font-weight: 600; }
.nbx-cm .bad { background: rgba(180,83,9,0.08); color: var(--accent-ink); }

@media (max-width: 760px) { .ml-d-grid, .ml-list.cols2 { grid-template-columns: 1fr; } }

/* ---------- Jupyter notebooks ---------- */
.jp-nb { border: 1px solid #E0E0E0; border-radius: var(--r); overflow: hidden; margin-bottom: 18px; background: #fff; box-shadow: 0 1px 2px rgba(24,22,15,0.04); }
.jp-nb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 15px; border-bottom: 1px solid #EDEDED; background: #F7F7F7; }
.jp-nb-name { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: #2A2620; }
.ml-nb-ico { width: 15px; height: 15px; color: var(--accent); }
.jp-kernel { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans); font-size: 11px; color: #6A6A6A; }
.jp-kdot { width: 8px; height: 8px; border-radius: 50%; background: #3F9142; box-shadow: 0 0 0 2px rgba(63,145,66,0.18); }
.jp-cells { padding: 6px 10px 10px; }
.jpc { display: flex; align-items: flex-start; padding: 5px 0; }
.jpc-prompt { width: 62px; flex: none; text-align: right; padding: 9px 9px 0 0; font-family: var(--mono); font-size: 11px; line-height: 1.6; white-space: nowrap; }
.jpc-prompt.jin { color: #303F9F; }
.jpc-prompt.jres { color: #B71C1C; }
.jpc-code { flex: 1; min-width: 0; margin: 0; padding: 9px 13px; background: #F6F6F6; border: 1px solid #E6E6E6; border-radius: 3px; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: #1A1A1A; white-space: pre-wrap; overflow-x: auto; }
.jpc.jout { padding: 2px 0 6px; }
.jpc-output { flex: 1; min-width: 0; padding: 4px 13px; }

/* ---------- charts ---------- */
.ml-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ml-chartcard { border: 1px solid var(--hairline); border-radius: var(--r); background: var(--surface); padding: 16px 18px; }
.ml-chart-h { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.ml-chart-svg { width: 100%; height: auto; display: block; }
.ml-chart-cap { font-size: 11.5px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------- agent environment (wireframe) ---------- */
.ae-note { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; text-wrap: pretty; }
.ae-ws-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ae-ws-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ae-ws-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--hairline); border-radius: 9px; background: var(--surface); cursor: pointer; font-family: var(--sans); font-size: 12.5px; font-weight: 500; color: var(--muted); transition: border-color 0.15s, color 0.15s; }
.ae-ws-tab:hover { color: var(--ink); }
.ae-ws-tab.on { background: var(--surface-warm); color: var(--accent-ink); border-color: var(--accent); }
.ae-ws-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--faint); }
.ae-ws-dot.running { background: var(--ok); box-shadow: 0 0 0 3px rgba(31,138,91,0.16); }
.ae-ws-dot.idle { background: var(--faint); }
.ae-new { padding: 8px 13px; border: 1px dashed var(--hairline); border-radius: 9px; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 12.5px; font-weight: 500; color: var(--faint); white-space: nowrap; transition: color 0.15s, border-color 0.15s; }
.ae-new:hover { color: var(--accent-ink); border-color: var(--accent); }

.ae-meta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface-warm); border: 1px solid var(--hairline-soft); border-radius: var(--r-sm); margin-bottom: 14px; }
.ae-meta-model { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ae-mi { width: 16px; height: 16px; color: var(--accent); }
.ae-meta-status { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; }
.ae-meta-status.running { color: var(--ok); }
.ae-meta-status.idle { color: var(--faint); }
.ae-meta-desc { font-size: 12.5px; color: var(--muted); }

.ae-ide { display: grid; grid-template-columns: 215px minmax(0, 1fr) 220px; gap: 12px; min-height: 420px; }
.ae-pane { border: 1px solid var(--hairline); border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.ae-pane-h { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 11px 13px; border-bottom: 1px solid var(--hairline-soft); display: flex; align-items: center; justify-content: space-between; flex: none; }

/* file tree */
.ae-tree { padding: 9px 8px; overflow-y: auto; }
.ae-folder { margin-bottom: 7px; }
.ae-folder-h { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink); padding: 3px 5px; }
.ae-fi { width: 14px; height: 14px; color: var(--accent); flex: none; }
.ae-fi.sm { width: 13px; height: 13px; color: var(--faint); }
.ae-file { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 3px 5px 3px 16px; border-radius: 5px; cursor: default; }
.ae-file:hover { background: var(--surface-warm); }
.ae-file.dir { color: var(--accent-ink); }
.ae-file.empty { color: var(--faint); font-style: italic; padding-left: 16px; }

/* notebook editor */
.ae-run { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--ok); cursor: pointer; }
.ae-run-ic { display: flex; }
.ae-run-ic svg { width: 11px; height: 11px; }
.ae-nb { padding: 11px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.ae-cell { display: flex; gap: 9px; border: 1px solid var(--hairline-soft); border-radius: 8px; overflow: hidden; }
.ae-cell-tag { flex: none; width: 34px; padding: 9px 0; text-align: center; font-family: var(--mono); font-size: 9.5px; color: var(--faint); background: var(--surface-warm); border-right: 1px solid var(--hairline-soft); }
.ae-cell-body { padding: 9px 11px; font-size: 12px; line-height: 1.5; color: var(--ink); min-width: 0; }
.ae-cell.code .ae-cell-body { font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-word; color: #2C2A22; }
.ae-cell.code .ae-cell-tag { color: var(--accent); }
.ae-cell.md { background: var(--surface-warm); }
.ae-cell.out { background: rgba(31,138,91,0.05); }
.ae-cell.out .ae-cell-body { font-family: var(--mono); font-size: 11px; color: #1F6F4C; }
.ae-cell.out .ae-cell-tag { color: var(--ok); }

/* tools + activity */
.ae-side { padding: 0; }
.ae-tools { display: flex; flex-wrap: wrap; gap: 5px; padding: 11px 12px; }
.ae-tool { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--muted); background: var(--surface-warm); border: 1px solid var(--hairline-soft); border-radius: 6px; padding: 4px 7px; }
.ae-ti { width: 11px; height: 11px; color: var(--accent); }
.ae-side .ae-pane-h { border-top: 1px solid var(--hairline-soft); }
.ae-logs { padding: 9px 12px 12px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.ae-log-row { display: flex; gap: 9px; font-size: 11px; color: var(--muted); line-height: 1.4; }
.ae-log-t { flex: none; font-family: var(--mono); font-size: 10px; color: var(--faint); }
@media (max-width: 900px) { .ae-ide { grid-template-columns: 1fr; } }

/* ---------- 3D models ---------- */
.ml-3d-note { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.ml-3d-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ml-3d-card { display: flex; flex-direction: column; border: 1px solid var(--hairline); border-radius: var(--r); background: var(--surface); padding: 16px 17px 15px; }
.ml-3d-head { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.ml-3d-ico { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--surface-warm); border: 1px solid var(--hairline-soft); }
.ml-3d-ico svg { width: 19px; height: 19px; color: var(--accent); }
.ml-3d-ht { flex: 1; min-width: 0; }
.ml-3d-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ml-3d-method { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; color: var(--faint); margin-top: 1px; }
.ml-3d-badge { flex: none; font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; }
.ml-3d-badge.ready { background: rgba(31,138,91,0.13); color: #1F8A5B; }
.ml-3d-badge.compute { background: rgba(181,138,27,0.15); color: #8A6A14; }
.ml-3d-desc { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; text-wrap: pretty; }
.ml-3d-meta { display: flex; gap: 8px; font-size: 11.5px; margin-bottom: 10px; }
.ml-3d-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); flex: none; padding-top: 1px; }
.ml-3d-v { color: var(--ink); }
.ml-3d-unc { display: flex; gap: 8px; align-items: flex-start; background: rgba(181,138,27,0.07); border: 1px solid rgba(181,138,27,0.18); border-radius: 8px; padding: 9px 11px; margin-bottom: 13px; }
.ml-3d-unc svg { width: 15px; height: 15px; color: #8A6A14; flex: none; margin-top: 1px; }
.ml-3d-unc span { font-size: 11.5px; line-height: 1.45; color: #5C4A1E; text-wrap: pretty; }
.ml-3d-open { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--hairline); border-radius: 9px; background: var(--surface-warm); cursor: pointer; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent-ink); transition: border-color 0.15s, background 0.15s; }
.ml-3d-open svg { width: 16px; height: 16px; }
.ml-3d-open:hover { border-color: var(--accent); background: #fff; }
@media (max-width: 760px) { .ml-3d-grid { grid-template-columns: 1fr; } }

/* ---------- datasets ---------- */
.ml-ds-note { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.ml-link { border: none; background: none; padding: 0; font: inherit; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ml-link:hover { color: var(--accent); }
.ml-ds-list { display: flex; flex-direction: column; gap: 10px; }
.ml-ds { display: flex; align-items: center; gap: 14px; border: 1px solid var(--hairline); border-radius: var(--r); background: var(--surface); padding: 14px 16px; }
.ml-ds-ico { width: 38px; height: 38px; border-radius: 10px; flex: none; background: var(--surface-warm); border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center; }
.ml-ds-ico svg { width: 19px; height: 19px; color: var(--muted); }
.ml-ds-text { flex: 1; min-width: 0; }
.ml-ds-name { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.ml-ds-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ml-ds-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); text-align: right; flex: none; }

/* ---------- empty state ---------- */
.ml-empty { max-width: 420px; margin: 60px auto; text-align: center; }
.ml-empty-ico { width: 40px; height: 40px; color: var(--faint); margin: 0 auto 14px; display: block; }
.ml-empty-t { font-size: 16px; font-weight: 600; }
.ml-empty-b { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.55; text-wrap: pretty; }

@media (max-width: 720px) { .ml-d-grid { grid-template-columns: 1fr; } }

/* ---------- data readiness panel (live, from the backend) ---------- */
.ml-rd-loading, .ml-rd-err { font-size: 13px; color: var(--muted); padding: 14px 0; }
.ml-rd-err { color: #B0413A; }
.ml-rd { border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; background: var(--surface); }
.ml-rd-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface-warm); border-bottom: 1px solid var(--hairline); }
.ml-rd-summary { font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.ml-rd-badge { flex: none; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 4px 10px; border-radius: 100px; color: #fff; }
.ml-rd-badge.ok { background: var(--ok); }
.ml-rd-badge.warn { background: #B58A1B; }
.ml-rd-badge.bad { background: #B0413A; }
.ml-rd-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 16px 4px; }
.ml-rd-chip { font-size: 11.5px; color: var(--muted); background: var(--surface-warm); border: 1px solid var(--hairline); border-radius: 100px; padding: 3px 10px; }
.ml-rd-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ml-rd-checks { padding: 8px 16px 4px; }
.ml-rd-check { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hairline); }
.ml-rd-check:first-child { border-top: none; }
.ml-rd-vd { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.ml-rd-check.pass .ml-rd-vd { background: var(--ok); }
.ml-rd-check.warn .ml-rd-vd { background: #B58A1B; }
.ml-rd-check.fail .ml-rd-vd { background: #B0413A; }
.ml-rd-cname { font-size: 13px; font-weight: 600; color: var(--ink); }
.ml-rd-found { font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--accent-ink); margin-left: 4px; }
.ml-rd-req { font-size: 12px; color: var(--faint); margin-top: 1px; }
.ml-rd-cnote { font-size: 12px; color: #8A5A12; margin-top: 3px; line-height: 1.45; }
.ml-rd-block { padding: 12px 16px; border-top: 1px solid var(--hairline); }
.ml-rd-bh { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.ml-rd-block .ml-list { margin: 0; }

/* ---------- Phase-B honesty note ---------- */
.ml-phaseb { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding: 13px 15px; border: 1px dashed var(--hairline); border-radius: 10px; background: var(--surface-warm); }
.ml-phaseb svg { flex: none; width: 18px; height: 18px; color: var(--faint); margin-top: 1px; }
.ml-phaseb span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ml-d-note { font-size: 12.5px; color: var(--muted); }

/* ---------- runnability grouping (green / amber / red) ---------- */
.ml-grouping-note { font-size: 12.5px; color: var(--muted); padding: 2px 2px 8px; }
.ml-sec-ct { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--faint); background: var(--surface-warm); border: 1px solid var(--hairline); border-radius: 100px; padding: 1px 8px; margin-left: 9px; vertical-align: middle; }
.ml-sec-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.ml-sec-dot.ok, .ml-card-dot.ok { background: var(--ok); }
.ml-sec-dot.warn, .ml-card-dot.warn { background: #B58A1B; }
.ml-sec-dot.bad, .ml-card-dot.bad { background: #B0413A; }
.ml-card-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.ml-card.s-ok:hover { border-color: var(--ok); }
.ml-card.s-warn:hover { border-color: #B58A1B; }
.ml-card.s-bad:hover { border-color: #B0413A; }

/* ---------- notebooks list (real, from backend) ---------- */
.ml-nblist { display: flex; flex-direction: column; gap: 8px; }
.ml-nbrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); padding: 12px 14px; }
.ml-nbrow:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(24,22,15,0.06); }
.ml-nbrow-ico { width: 34px; height: 34px; border-radius: 9px; flex: none; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.ml-nbrow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ml-nbrow-name { font-size: 14px; font-weight: 600; }
.ml-nbrow-meta { font-size: 12px; color: var(--faint); }
.ml-nbrow-open { font-size: 12.5px; color: var(--accent-ink); font-weight: 600; flex: none; }

/* ---------- charts (real figure images) ---------- */
.ml-chart-img { width: 100%; border-radius: 8px; border: 1px solid var(--hairline); background: #fff; min-height: 120px; display: block; }

/* ---------- notebook reader ---------- */
.ml-nbcells { display: flex; flex-direction: column; gap: 12px; }
.nbc { border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.nbc.md { border: none; }
.nbc.md p { font-size: 14px; line-height: 1.6; margin: 6px 0; }
.nbc-tag { display: inline-block; font-family: var(--mono); font-size: 10px; color: var(--faint); padding: 4px 8px; background: var(--surface-warm); border-bottom: 1px solid var(--hairline); width: 100%; box-sizing: border-box; }
.nbc pre { font-family: var(--mono); font-size: 12px; line-height: 1.55; padding: 11px 13px; margin: 0; white-space: pre-wrap; overflow-x: auto; }
.nbc.code pre { background: #1f1d18; color: #f3efe6; }
.nbc.out pre { background: var(--surface-warm); color: var(--ink); }

/* ---------- one-click Run ---------- */
.ml-runout:empty { display: none; }
.ml-runout { margin-top: 16px; }
.ml-run-prog, .ml-run-done, .ml-run-refused { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; background: var(--surface); }
.ml-run-prog { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ml-run-done { display: flex; align-items: flex-start; gap: 12px; border-color: color-mix(in srgb, var(--ok) 40%, var(--hairline)); }
.ml-run-done svg { width: 22px; height: 22px; flex: none; color: #fff; background: var(--ok); border-radius: 50%; padding: 3px; box-sizing: border-box; }
.ml-run-refused { border-color: #d9b25e; color: var(--ink); }
.ml-run-acts { display: flex; gap: 8px; margin-top: 10px; }
.ml-brief-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 10px 0 2px; }
.ml-brief-done { font-size: 12.5px; color: var(--ok); margin: 10px 0 2px; }
.ml-brief-done b { color: var(--ink); }
.ml-btn.sm { padding: 6px 12px; font-size: 12px; }
.ml-btn.run.busy { opacity: 0.7; cursor: progress; }
.ml-spin { width: 15px; height: 15px; flex: none; border: 2px solid var(--hairline); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: mlspin 0.7s linear infinite; }
@keyframes mlspin { to { transform: rotate(360deg); } }

/* ---------- methodology (ordered) ---------- */
.ml-ol { margin: 8px 0 0; padding-left: 20px; }
.ml-ol li { font-size: 13px; line-height: 1.6; margin: 5px 0; color: var(--muted); }
.ml-ol li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- pre-run agent fit assessment ---------- */
.ml-fit-sec { margin: 18px 0 6px; }
.ml-fit-loading { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); padding: 14px 16px; border: 1px dashed var(--hairline); border-radius: 12px; background: var(--surface-warm); }
.ml-fit { border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--hairline)); border-left: 3px solid var(--accent); border-radius: 12px; background: linear-gradient(180deg, var(--accent-soft, var(--surface-warm)), var(--surface)); padding: 14px 18px; }
.ml-fit p { font-size: 14px; line-height: 1.6; margin: 7px 0; color: var(--ink); }
.ml-fit p:first-child { margin-top: 0; }
.ml-fit strong { color: var(--accent-ink); }

/* ---------- in-app Jupyter notebook viewer ---------- */
.nbv { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.nbv-cell { display: flex; flex-direction: column; gap: 8px; }
.nbv-md { font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.nbv-md h1 { font-size: 22px; font-weight: 700; margin: 6px 0; letter-spacing: -0.01em; }
.nbv-md h2 { font-size: 17px; font-weight: 700; margin: 12px 0 4px; }
.nbv-md p { margin: 6px 0; }
.nbv-md strong { font-weight: 700; }
.nbv-md code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-warm); padding: 1px 5px; border-radius: 4px; }
.nbv-md ul { margin: 6px 0; padding-left: 22px; }
.nbv-md li { margin: 3px 0; line-height: 1.55; }
.nbv-md blockquote { margin: 8px 0; padding: 8px 14px; border-left: 3px solid #d9b25e; background: #fbf3e2; border-radius: 0 8px 8px 0; color: #6b531c; font-size: 13.5px; }
.nbv-incell, .nbv-outwrap { display: flex; gap: 10px; align-items: flex-start; }
.nbv-prompt { flex: none; width: 34px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); padding-top: 12px; text-align: right; }
.nbv-prompt.out { color: var(--accent); }
.nbv-code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; background: #1f1d18; color: #f3efe6; border-radius: 9px; padding: 12px 14px; margin: 0; white-space: pre-wrap; overflow-x: auto; border: 1px solid #2c2920; }
.nbv-outs { flex: 1; min-width: 0; }
.nbv-img { max-width: 100%; border: 1px solid var(--hairline); border-radius: 8px; background: #fff; display: block; margin: 2px 0; }
.nbv-stream, .nbv-text { font-family: var(--mono); font-size: 12px; line-height: 1.5; background: var(--surface-warm); border: 1px solid var(--hairline); border-radius: 8px; padding: 9px 12px; margin: 0 0 8px; white-space: pre-wrap; overflow-x: auto; color: var(--ink); }
.nbv-error { font-family: var(--mono); font-size: 12px; background: #fdecea; color: #8a1c10; border: 1px solid #f0b4ab; border-radius: 8px; padding: 9px 12px; margin: 0; white-space: pre-wrap; }
#nbv-dl { text-decoration: none; }

/* Phase 5 — notebook export status (in the notebook viewer toolbar) */
.nbv-exp { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.nbv-exp .ml-link { font-size: 12px; }

/* ══ H9d — 3D models tab: the project's real models + method identity ══ */
.ml-3d-mine { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.ml-3d-mine-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.ml-3d-mine-h svg { width: 15px; height: 15px; color: var(--accent); }
.ml-3d-mine-ct { margin-left: auto; font-size: 11px; font-weight: 550; text-transform: none; letter-spacing: 0; color: var(--accent); background: rgba(180, 83, 9, 0.08); border-radius: 999px; padding: 3px 9px; }
.ml-3d-mine-list { display: flex; flex-direction: column; gap: 6px; }
.ml-3d-chip { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 11px; border: 1px solid var(--hairline-soft); border-radius: 10px; background: var(--bg, #fff); cursor: pointer; transition: 0.14s; font-family: inherit; }
.ml-3d-chip:hover { border-color: var(--accent); background: rgba(180, 83, 9, 0.045); }
.ml-3d-chip-name { font-size: 12.8px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-3d-chip-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ml-3d-chip-go { font-size: 11px; font-weight: 600; color: var(--accent); flex: none; opacity: 0; transition: 0.14s; }
.ml-3d-chip:hover .ml-3d-chip-go, .ml-3d-last:hover .ml-3d-chip-go { opacity: 1; }
.ml-3d-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.ml-3d-dot.idw { background: #B45309; }
.ml-3d-dot.kriging { background: #1E3A5F; }
.ml-3d-dot.prospectivity { background: #3F6212; }
.ml-3d-dot.anomaly { background: #7C2D12; }
.ml-3d-last { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; margin: 10px 0 2px; padding: 7px 10px; border: 1px dashed var(--hairline); border-radius: 9px; background: transparent; cursor: pointer; font-size: 11.5px; color: var(--muted); font-family: inherit; transition: 0.14s; }
.ml-3d-last:hover { border-color: var(--accent); color: var(--ink); }
.ml-3d-last b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.ml-3d-last-t { flex: 1; font-size: 10.5px; color: var(--faint); }
.ml-3d-card { transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease; }
.ml-3d-card:hover { box-shadow: 0 8px 24px rgba(24, 20, 12, 0.08); transform: translateY(-1px); }
.ml-3d-card.algo-idw .ml-3d-ico { color: #B45309; background: rgba(180, 83, 9, 0.09); }
.ml-3d-card.algo-gpr .ml-3d-ico { color: #1E3A5F; background: rgba(30, 58, 95, 0.09); }
.ml-3d-card.algo-prospect3d .ml-3d-ico { color: #3F6212; background: rgba(63, 98, 18, 0.09); }
.ml-3d-card.algo-iforest .ml-3d-ico { color: #7C2D12; background: rgba(124, 45, 18, 0.09); }

/* model-library cards get the same life */
.ml-card { transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease; }
.ml-card:hover { box-shadow: 0 8px 24px rgba(24, 20, 12, 0.08); transform: translateY(-1px); border-color: var(--hairline); }

/* ══ R7 — fit verdicts, run history, model-panel affordances ══ */
.ml-fitchip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 650; letter-spacing: 0.02em; margin-right: 8px; flex: none; }
.ml-fitchip.good_fit { background: rgba(63, 98, 18, 0.12); color: #3F6212; }
.ml-fitchip.usable_with_warnings { background: rgba(180, 83, 9, 0.12); color: #B45309; }
.ml-fitchip.poor_fit { background: rgba(158, 27, 27, 0.1); color: #9E1B1B; }
.ml-fitchip.cannot_run { background: rgba(90, 84, 72, 0.12); color: #5b5247; }
.ml-fit-verdict { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface); margin-bottom: 10px; font-size: 12.5px; color: var(--ink); line-height: 1.45; }
.ml-run-fitnote { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.ml-run-refused .ml-fitchip { margin-bottom: 6px; }
#ml-force-run { margin-top: 10px; border-color: #9E1B1B; color: #9E1B1B; }
#ml-force-run:hover { background: rgba(158, 27, 27, 0.06); }

.ml-3d-head { cursor: pointer; position: relative; }
.ml-3d-about { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--accent); opacity: 0; transition: 0.14s; flex: none; }
.ml-3d-head:hover .ml-3d-about { opacity: 1; }

.ml-runs { display: flex; flex-direction: column; gap: 8px; }
.ml-runrow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); transition: 0.14s; }
.ml-runrow:hover { border-color: var(--accent); }
.ml-runstat { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 9px; border-radius: 7px; }
.ml-runstat.ok { background: rgba(63, 98, 18, 0.12); color: #3F6212; }
.ml-runstat.bad { background: rgba(158, 27, 27, 0.1); color: #9E1B1B; }
.ml-runstat.run { background: rgba(30, 58, 95, 0.1); color: #1E3A5F; }
.ml-runmain { flex: 1; min-width: 0; }
.ml-runlabel { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.ml-runmeta { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-runerr { color: #9E1B1B; }

/* ══ R10 — traditional/predictive split, grouped project models, reference rows ══ */
.ml-3d-sec-h { display: flex; align-items: baseline; gap: 10px; margin: 22px 2px 12px; }
.ml-3d-sec-h b { font-size: 14.5px; color: var(--ink); letter-spacing: -0.01em; }
.ml-3d-sec-sub { font-size: 12px; color: var(--muted); }
.ml-3d-sec-k { width: 10px; height: 10px; border-radius: 3px; flex: none; align-self: center; }
.ml-3d-sec-k.trad { background: #1E3A5F; }
.ml-3d-sec-k.pred { background: #3F6212; }
.ml-3d-sec-k.ref { background: #9a917f; }

.ml-3d-mine-groups { display: flex; flex-direction: column; gap: 10px; }
.ml-3d-group { display: flex; flex-direction: column; gap: 6px; }
.ml-3d-ghead { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 2px 2px 0; }
.ml-3d-gct { color: var(--faint); font-weight: 600; }
.ml-3d-more summary { cursor: pointer; font-size: 11.5px; color: var(--accent); padding: 4px 2px; list-style: none; }
.ml-3d-more summary::-webkit-details-marker { display: none; }
.ml-3d-more[open] summary { margin-bottom: 6px; }
.ml-3d-more > .ml-3d-chip { margin-bottom: 6px; }

.ml-3d-refs { display: flex; flex-direction: column; gap: 6px; }
.ml-3d-ref { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; border: 1px dashed var(--hairline); border-radius: 11px; background: transparent; cursor: pointer; font-family: inherit; transition: 0.14s; }
.ml-3d-ref:hover { border-color: var(--accent); background: rgba(180, 83, 9, 0.03); }
.ml-3d-ref:hover .ml-3d-chip-go { opacity: 1; }
.ml-3d-ref-name { font-size: 13px; font-weight: 600; color: var(--ink); flex: none; }
.ml-3d-ref-tag { font-size: 11.5px; color: var(--accent); flex: none; }
.ml-3d-ref-why { font-size: 11.5px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-3d-open.agent { border-color: #1E3A5F; color: #1E3A5F; }
.ml-3d-open.agent:hover { background: rgba(30, 58, 95, 0.06); }
.ml-3d-dot.difference { background: #5b5247; }
