/* FLUID ERP browser client — Stage 77. Every colour is a CSS variable set by MainLayout from erpcfg.tbltheme — the same
   document the MAUI ThemeService paints from — so the browser and the app wear the same palette. */
:root {
  --primary:#0B3A56; --primary-dark:#08283B; --accent:#22B0EA; --success:#1A9E6B; --danger:#C0392B; --info:#0A6EA6; --neutral:#41667C;
  --bg:#EEF6FA; --surface:#FFFFFF; --surface-alt:#EAF3F9; --border:#D5E6EF; --text:#12324A; --muted:#5B7A8D; --header-text:#FFFFFF;
  --tab-inactive:#DCEBF3; --tab-active:#0B3A56; --accent-light:#A7E6FB; --accent-pale:#D8FBFF; --primary-deep:#071C2D;
  --warn-bg:#FFF4D6; --warn-border:#E8C66A; --warn-text:#7A5A00; --radius:10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { min-height: 100vh; }
h1 { font-size: 20px; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .error { color: var(--danger); } .hint { font-size: 12px; color: var(--muted); font-style: italic; }
.hint.strong { font-style: normal; font-weight: 600; } .hint.info { font-style: italic; }
code { background: var(--surface-alt); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
a { color: var(--info); }

/* ── bars ── */
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--header-text);
  background: linear-gradient(90deg, var(--primary), #0D4A6E); position: sticky; top: 0; z-index: 5; }
.bar .spacer { flex: 1; } .bar .who { font-size: 12.5px; } .bar .company { font-size: 13px; opacity: .9; }
.bar .title { font-size: 17px; font-weight: 700; color: var(--header-text); }
.wordmark { font-weight: 700; letter-spacing: 2px; font-size: 19px; } .wordmark.small { font-size: 15px; }
.wordmark .lead { color: var(--accent-light); } .wordmark .tail { color: var(--header-text); }
.signin .wordmark .tail { color: var(--primary); }
.link { background: none; border: 0; color: inherit; cursor: pointer; text-decoration: underline; font: inherit; }

/* ── buttons ── */
.btn { padding: 7px 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 7px; cursor: pointer; font: inherit; font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--header-text); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--header-text); }
.btn.success { background: var(--success); border-color: var(--success); color: var(--header-text); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--header-text); }
.btn.info { background: var(--info); border-color: var(--info); color: var(--header-text); }
.btn.neutral { background: var(--neutral); border-color: var(--neutral); color: var(--header-text); }
.btn.outline { background: var(--surface); } .btn.danger-text { color: var(--danger); }
.btn.outline.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }   /* 89.2: the Definition Tree Editor's 🗑 Delete was white-on-white (outline won the background, danger kept the header text colour) */
.btn.back { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--header-text); font-size: 13px; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.icon-btn { width: 38px; height: 34px; border: 0; border-radius: 4px; background: var(--neutral); color: var(--header-text); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon-btn.alt { background: var(--surface-alt); color: var(--text); width: 34px; } .icon-btn.sm { width: 34px; height: 32px; }
.icon-btn:disabled, .icon-btn.disabled { opacity: .45; cursor: default; }
.act-btn { padding: 0 10px; height: 34px; border: 0; border-radius: 4px; background: var(--primary); color: var(--header-text); cursor: pointer; font-size: 12px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.act-btn.open { height: 30px; align-self: flex-start; }

/* ── launcher ── */
.launcher { padding: 14px 18px; max-width: 1400px; margin: 0 auto; }
.command { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 0 8px; margin-bottom: 4px; }
.chip { padding: 6px 13px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-alt); color: var(--text); font-size: 12.5px; cursor: pointer; margin: 0 0 6px; font-family: inherit; }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--header-text); font-weight: 700; }
.count { margin: 2px 0 10px; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tile { position: relative; text-align: left; border: 1.4px solid var(--border); background: var(--surface); border-radius: 13px; padding: 15px 17px; cursor: pointer; display: flex; flex-direction: column; font: inherit; color: var(--text); }
.tile:hover { border-color: var(--accent); }
.tile-icon { font-size: 24px; } .tile-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-top: 6px; }
.tile-sub { font-size: 11.5px; font-family: Consolas, monospace; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { position: absolute; top: 12px; right: 14px; background: var(--danger); color: var(--header-text); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* ── sign-in ── */
.signin-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.signin { width: 380px; padding: 28px; }
.signin label { display: block; margin: 14px 0 4px; font-size: 12.5px; color: var(--muted); }
.signin input, .signin textarea, .signin select { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
.signin input[type=checkbox] { width: auto; }
.primary:not(.btn) { margin-top: 18px; width: 100%; padding: 10px; border: 0; border-radius: 6px; background: var(--primary); color: var(--header-text); font: inherit; cursor: pointer; }
.toggle { display: flex; gap: 6px; margin-top: 12px; }
.toggle button { padding: 6px 12px; border: 1px solid var(--border); background: var(--surface-alt); border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.toggle button.on { background: var(--primary); color: var(--header-text); border-color: var(--primary); }

/* ── form page ── */
.formpage { display: flex; flex-direction: column; min-height: 100vh; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.toolbar .param { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); } .toolbar .param .entry { min-width: 160px; }
.lock-banner { margin: 8px 14px 0; padding: 8px 13px; background: var(--warn-bg); border: 1.3px solid var(--warn-border); border-radius: 9px; color: var(--warn-text); font-weight: 700; font-size: 12.5px; }
.tabstrip { display: flex; gap: 4px; padding: 10px 14px 0; overflow-x: auto; border-bottom: 2px solid var(--primary); margin: 0 14px; }
.tab { padding: 6px 12px; border: 0; border-radius: 6px 6px 0 0; background: var(--tab-inactive); color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.tab.on { background: var(--tab-active); color: var(--header-text); }
.content { padding: 10px 14px 24px; }
.formcard { padding: 14px 16px; }
.subtabs, .tier { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); align-items: center; }
.subtabs .chip, .tier .chip { border-radius: 6px; margin: 0; padding: 5px 12px; font-size: 12px; }
.fields.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 4px; }
@media (max-width: 760px) { .fields.two-col { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.control-row { display: flex; gap: 4px; align-items: center; }
.entry { width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.entry.num { text-align: right; } textarea.entry { min-height: 90px; resize: vertical; }
.entry[readonly], .entry.ro, .entry:disabled, select.entry:disabled { background: var(--surface-alt); color: var(--text); }
.field.locked .entry { background: var(--surface-alt); }
.switch { width: 20px; height: 20px; accent-color: var(--primary); margin: 8px 0; }
.preview { max-height: 140px; max-width: 100%; align-self: flex-start; border-radius: 6px; margin-top: 4px; }
.lookup-img { height: 44px; align-self: flex-start; }

/* ── browse / grids ── */
.browse { padding: 10px 14px; }
.searchbar { display: flex; gap: 10px; margin: 4px 0 10px; align-items: center; } .searchbar .entry { max-width: 300px; }
.grid-scroll { overflow: auto; max-width: 100%; }
.grid-table { border-collapse: separate; border-spacing: 0 2px; width: 100%; font-size: 13.5px; }
.grid-table th { text-align: left; padding: 7px 8px; background: var(--surface-alt); color: var(--neutral); font-size: 12px; letter-spacing: .4px; white-space: nowrap; }
.grid-table td { padding: 7px 8px; background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.grid-table tbody tr:nth-child(even) td { background: var(--surface-alt); }
.grid-table tbody tr[data-browse-row], .grid-table.pick tbody tr { cursor: pointer; } .grid-table tbody tr:hover td { background: var(--accent-pale); }
.report-grid tr.subtotal td { font-weight: 600; background: var(--surface-alt); } .report-grid tr.grandtotal td { font-weight: 700; border-top: 2px solid var(--primary); }
.line-grid { border-collapse: separate; border-spacing: 4px 2px; table-layout: fixed; }
.line-grid th { background: var(--neutral); color: var(--header-text); font-size: 11px; font-weight: 700; text-align: left; padding: 3px 4px; white-space: nowrap; overflow: hidden; }
.line-grid.ro th { background: var(--primary); }
.line-grid td { padding: 0; vertical-align: top; } .line-grid tr.alt td { background: var(--surface-alt); }
.line-grid.ro td { padding: 3px 4px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-grid .menu-col { width: 44px; text-align: center; }
.cell { width: 100%; height: 32px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 3px; font: inherit; font-size: 12px; background: var(--surface); }
.cell.ro { background: transparent; border-color: transparent; } .cell.num { text-align: right; } textarea.cell { height: 72px; resize: none; }
.cell-lookup { display: flex; gap: 2px; } .cell-check { margin: 8px; }
.tab-panel { padding: 4px; } .tab-toolbar { display: flex; gap: 8px; align-items: center; padding: 4px 0; background: var(--surface-alt); margin-bottom: 6px; }
.tab-error { color: var(--danger); font-size: 13px; margin: 8px; } .empty { font-style: italic; margin: 8px; }
.kv { border-collapse: collapse; } .kv th { text-align: left; font-size: 13px; padding: 4px 12px 4px 0; width: 160px; vertical-align: middle; } .kv td { padding: 4px 0; font-size: 13px; }
.kv.edit .cell { width: 100%; min-width: 260px; }
.template { line-height: 1.5; } .template-row { padding: 3px 6px; border-bottom: 1px solid var(--border); }
.feed-note, .page-error { padding: 20px; }
.chart { margin: 8px 0 14px; } .chart svg { max-width: 100%; height: auto; }

/* ── dialogs & toast ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7,28,45,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; padding: 18px 20px; width: min(440px, 100%); box-shadow: 0 12px 40px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(900px, 100%); }
.modal h3 { margin: 0 0 8px; font-size: 16px; } .modal-msg { white-space: pre-wrap; margin: 0 0 14px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; margin-bottom: 12px; }
.sheet { display: flex; flex-direction: column; gap: 6px; } .sheet-opt { justify-content: center; padding: 10px; font-size: 14px; }
.toast { position: fixed; left: 50%; top: 58px; transform: translateX(-50%); background: var(--primary); color: var(--header-text); padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13.5px; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* 77.1: the document viewer and the report shapes (the printed HTML, shown on screen) */
.docframe { width: 100%; height: calc(100vh - 70px); border: 0; background: #fff; }
.docsource { white-space: pre-wrap; font: 12.5px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 12px; }
.report-body { overflow-x: auto; }
.report-chrome { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
.report-chrome .caption { font-weight: 700; margin: 0 6px; }
.param .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.param .chips .chip { padding: 2px 9px; margin: 0; font-size: 11.5px; }
.param .georow { display: flex; gap: 4px; } .param .georow .entry { flex: 1; }
/* 77.2: the matching page */
.section { font-size: 13.5px; font-weight: 700; color: var(--neutral); margin: 12px 2px 6px; } .section.ok { color: var(--success); }
.match-group { display: flex; gap: 8px; border: 1.2px solid var(--border); border-radius: 9px; background: var(--surface); padding: 8px 10px; margin: 6px 0; }
.match-group.manual { border-color: var(--accent); } .match-group .rows { flex: 1; min-width: 0; } .match-group .foot { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.match-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; min-width: 0; }
.match-row.unmatched { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-alt); padding: 6px 10px; margin: 5px 0; }
.match-row .side { font-size: 11px; font-weight: 700; color: var(--info); white-space: nowrap; } .match-row .text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.match-row .amt { font-weight: 700; font-size: 12.5px; white-space: nowrap; } .match-row .amt.neg { color: var(--danger); }
.tick input { width: 18px; height: 18px; } .link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 11px; font-family: inherit; } .link.danger { color: var(--danger); }
/* 77.3: credential screens and the public form */
.cardtitle { margin: 0 0 6px; font-size: 19px; } .center { text-align: center; }
.public-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.public-actions .outline { background: transparent; border: 1.4px solid var(--accent); color: inherit; border-radius: 9px; padding: 10px; font-weight: 700; cursor: pointer; font-family: inherit; }
.signin .link { display: block; margin: 8px auto 0; color: inherit; opacity: .8; font-size: 12.5px; }
.pubfield .search-hits { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line, #d8dee6); border-radius: 8px; max-height: 220px; overflow: auto; } .pubfield .search-hits li + li { border-top: 1px solid var(--line, #eef2f6); } .pubfield .search-hits button.link { display: block; width: 100%; text-align: left; padding: 7px 10px; }
.pubfield { margin: 8px 0; } .pubfield label { display: block; } .pubfield select, .pubfield textarea, .pubfield input[type=text], .pubfield input[type=date], .pubfield input[type=password] { width: 100%; }
.success { text-align: center; } .success .big { font-size: 40px; } .success .ref { font-size: 20px; font-weight: 700; letter-spacing: .05em; }

/* ── Stage 80: the left menu (NavSidebar.razor · NavigationPlan.cs) ── every colour from tbltheme */
.shell.with-side { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.shell.with-side > main { min-width: 0; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--primary-deep); color: var(--header-text);
  border-right: 1px solid rgba(0,0,0,.15); z-index: 20; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; text-decoration: none; color: var(--header-text);
  background: linear-gradient(180deg, var(--primary), var(--primary-deep)); }
.side-brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface); flex: none; }
.side-word { display: flex; flex-direction: column; font-weight: 800; letter-spacing: 1.5px; font-size: 16px; line-height: 1.15; min-width: 0; }
.side-word .lead { color: var(--accent-light); } .side-word .tail { color: var(--header-text); }
.side-word { display: block; } .side-word small { display: block; font-size: 11px; letter-spacing: 0; font-weight: 500; opacity: .75; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-find { margin: 4px 12px 8px; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: var(--header-text); font: inherit; font-size: 13px; }
.side-find::placeholder { color: rgba(255,255,255,.55); }
.side nav { flex: 1; overflow-y: auto; padding: 0 8px 10px; scrollbar-width: thin; }
.side-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 8px 4px; border: 0; background: none; color: var(--header-text);
  opacity: .62; font: inherit; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; text-align: left; }
.side-head:hover { opacity: .9; } .side-head .lb { flex: 1; } .side-head .ic { font-size: 12px; } .side-head .chev { font-size: 10px; }
.side-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; margin: 1px 0; border-radius: 8px; color: var(--header-text);
  text-decoration: none; font-size: 13.5px; opacity: .88; border-left: 3px solid transparent; }
.side-item .ic { width: 20px; text-align: center; flex: none; } .side-item .lb { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item:hover { background: rgba(255,255,255,.08); opacity: 1; }
.side-item.on { background: var(--accent-pale); color: var(--primary); font-weight: 700; opacity: 1; border-left-color: var(--accent); }
.side-item.home { margin-top: 2px; }
.side-pill { background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 9px; flex: none; }
.side-foot { padding: 10px 14px 12px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; }
.side-who { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .side-who small { display: block; font-weight: 400; opacity: .65; }
.side-acts { display: flex; gap: 12px; margin-top: 6px; } .side-acts a, .side-acts .link { color: var(--accent-light); font-size: 12px; text-decoration: none; }
.side-power { margin-top: 8px; font-size: 10.5px; opacity: .5; letter-spacing: .04em; }
.side-scrim { display: none; }
/* 89.4: the menu is MINIMISED after login. ☰ opens it, ✕ minimises it again — on a wide screen as well as a phone. */
.side-toggle { display: inline-flex; position: fixed; left: 10px; bottom: 14px; z-index: 25; width: 46px; height: 46px; border-radius: 23px; border: 0;
  background: var(--primary); color: var(--header-text); font-size: 20px; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: pointer; }
.shell.with-side:not(.side-min) .side-toggle { left: 222px; top: 10px; bottom: auto; width: 34px; height: 34px; border-radius: 17px; font-size: 15px; background: rgba(255,255,255,.16); box-shadow: none; }
.shell.with-side.side-min { display: block; }
.shell.with-side.side-min .side { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 4px 0 24px rgba(0,0,0,.25); visibility: hidden; }
.shell.with-side.side-min .bar [data-action="signout"] { display: inline; }
/* the module chips and the in-page sign-out stay for phones; on a wide screen the left menu carries them */
.shell.with-side .bar [data-action="signout"] { display: none; }
@media (max-width: 900px) {
  .shell.with-side { display: block; }
  .side { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  .side.open { transform: none; visibility: visible; }
  .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; }
  .shell.with-side:not(.side-min) .side-toggle { left: 234px; }
  .shell.with-side .bar [data-action="signout"] { display: inline; }
}
.signin-logo { display: block; max-width: 220px; max-height: 120px; margin: 0 auto 12px; border-radius: 12px; }
.signin .wordmark { text-align: center; } .signin-tag { text-align: center; margin: 4px 0 0; }
/* ── Stage 80: the advertising tab ── */
.adstrip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding: 6px 0; }
.adcard { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.adcard img { width: 100%; height: 140px; object-fit: cover; background: var(--surface-alt); }
.adbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.adsponsor { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.adhead { font-weight: 800; color: var(--primary); font-size: 15px; } .adtext { font-size: 13px; color: var(--text); }
.adbody .btn { align-self: flex-start; margin-top: 6px; }

/* Stage 82: the tree form (Components/Shared/TreeEditor.razor) */
.tree-editor { padding: 8px 14px 24px; }
.tree-editor .toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.tree-capture { margin: 10px 0; padding: 12px 14px; border: 1.3px solid var(--primary); border-radius: 10px; background: var(--surface-alt); }
.tree-capture-title { font-weight: 700; margin-bottom: 8px; }
.tree-capture-fields { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.tree-field { display: flex; flex-direction: column; gap: 3px; min-width: 180px; }
.tree-capture-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.tree-empty { padding: 24px; text-align: center; }
.tree-gen-label { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); margin: 6px 0 4px; }
.tree-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.tree-connector { width: 2px; height: 18px; background: var(--border); margin: 2px auto; }
.tree-node { margin: 2px 0; }
/* Stage 96 — who is who */
.tree-couple { display: flex; flex-wrap: wrap; align-items: center; }
.tree-marry { color: var(--muted); margin: 0 2px; font-size: 16px; }
.tree-card.spouse { border-style: dashed; background: color-mix(in srgb, var(--surface) 92%, var(--border)); }
.tree-rel { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tree-group-label { font-size: 11px; font-weight: 700; color: var(--muted); margin: 6px 0 2px; }
.tree-children { margin-left: 18px; padding-left: 12px; border-left: 2px solid var(--border); }
.tree-card { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 8px; padding: 6px 10px; margin: 4px; background: var(--surface); min-width: 200px; }
.tree-card.root { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent); }
.tree-avatar { width: 42px; height: 42px; border-radius: 21px; object-fit: cover; flex: none; }
.tree-avatar.initials { color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.tree-name { font-weight: 700; }
.tree-actions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
/* Stage 97.2 — the person panel: click a card to see the parents, brothers and sisters, spouse and children */
.tree-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.tree-name.click, .tree-avatar.click { cursor: pointer; }
.tree-name.click:hover { color: var(--primary); text-decoration: underline; }
.tree-panel { position: fixed; top: 64px; right: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); overflow-y: auto; z-index: 30; padding: 14px; border: 1.3px solid var(--primary); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.tree-panel-head { display: flex; gap: 10px; align-items: flex-start; }
.tree-panel-who { flex: 1; min-width: 0; }
.tree-avatar.big { width: 64px; height: 64px; border-radius: 32px; font-size: 20px; }
.tree-panel-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 6px; }
.tree-panel-actions .btn { padding: 4px 10px; font-size: 13px; }
.tree-panel-add { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
.tree-panel-add .mini, .tree-relative .mini { font: inherit; font-size: 11px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); cursor: pointer; }
.tree-panel-add .mini:hover, .tree-relative .mini:hover { border-color: var(--primary); color: var(--primary); }
.tree-panel-section { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.tree-panel-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 4px; }
.tree-relative { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; padding: 2px 0; }
.tree-role { font-size: 11px; font-weight: 700; color: var(--muted); min-width: 62px; }
.tree-relative-name { font: inherit; font-weight: 600; border: 0; background: none; padding: 0; color: var(--text); cursor: pointer; text-align: left; }
.tree-relative-name:hover { color: var(--primary); text-decoration: underline; }
.tree-actions .mini { font: inherit; font-size: 11px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); cursor: pointer; }
.tree-actions .mini:hover { border-color: var(--primary); color: var(--primary); }

/* ── 83.1 the feed in the browser ─────────────────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.feed-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feed-toolbar .spacer { flex: 1; }
.feed-filter select { margin-left: 6px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.feed-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.feed-card.unread { border: 2px solid var(--primary); }
.feed-card.gated { border-style: dashed; }
.feed-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 8px; background: var(--surface-alt); }
/* Stage 86: a YouTube / Vimeo link embedded on a feed card or under a media field — 16:9, the iframe fills it */
.feed-embed, .preview-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #10222e; }
.preview-embed { max-width: 480px; margin-top: 4px; }
.feed-embed iframe, .preview-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.feed-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-title { margin: 0; font-size: 1.05rem; }
.feed-body { margin: 0; white-space: pre-wrap; line-height: 1.45; }
.feed-meta { font-size: .85rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.feed-gate { margin: 0; font-size: .85rem; color: var(--warning, #b45309); background: var(--surface-alt); padding: 6px 8px; border-radius: 6px; }
.feed-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.feed-actions .react { border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); border-radius: 14px; padding: 2px 10px; font-size: .9rem; cursor: pointer; }
.feed-actions .react.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 15%, var(--surface)); }
.feed-comments { border-top: 1px solid var(--border); padding-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.feed-comment { margin: 0; font-size: .92rem; }
.feed-compose { display: flex; gap: 6px; }
.feed-compose input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.feed .more { align-self: center; }
.chip.mine { background: var(--surface-alt); }
.chip.danger { background: var(--danger); color: #fff; }
.feed-card .chip { padding: 2px 9px; font-size: 11.5px; margin: 0; cursor: default; }

/* Stage 87: the definition tree editor */
.deftree { padding: 8px 14px 24px; }
.deftree .toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.deftree-capture, .deftree-panel, .deftree-json { margin: 10px 0; padding: 12px 14px; border: 1.3px solid var(--primary); border-radius: 10px; background: var(--surface-alt); }
.deftree-panel { border-style: dashed; }
.deftree-capture-title { font-weight: 700; margin-bottom: 8px; }
.deftree-capture-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.deftree-capture-fields .tree-field { min-width: 180px; max-width: 360px; flex: 1; }
.deftree-capture-fields .tree-field.unknown .entry { border-style: dashed; }
.deftree-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.deftree-json textarea.mono { width: 100%; font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 12px; }
.deftree-problems { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: var(--surface-alt); color: var(--warning, #b45309); font-size: .9rem; }
.deftree-tree { margin-top: 10px; }
.deftree-node { margin: 4px 0; }
.deftree-children { margin-left: 22px; border-left: 2px solid var(--border); padding-left: 8px; }
.deftree-card { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.deftree-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.deftree-node.leaf .deftree-card { background: var(--surface-alt); padding: 3px 8px; }
.deftree-node.list > .deftree-card { background: transparent; border-style: dashed; }
.deftree-title { font-weight: 700; }
.deftree-sub { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deftree-actions { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.deftree-card .mini { font-size: .8rem; padding: 2px 7px; }
.deftree-card .mini.fold { min-width: 26px; }
.deftree-card .mini.danger { color: var(--danger, #b91c1c); }
.deftree-card .entry.inline { padding: 2px 6px; font-size: .85rem; max-width: 220px; }

/* Stage 89.3 — the Home guide */
.guide { margin: 10px 12px 14px; padding: 10px 14px; border: 1px solid var(--line, #d8dde6); border-radius: 12px; background: var(--card, #fff); }
.guide-head { display: flex; align-items: center; gap: 12px; }
.guide-head h2 { margin: 0; font-size: 1.05rem; flex: 1; }
.guide-count { color: var(--muted, #667); font-size: .85rem; }
.guide-flow { list-style: none; margin: 10px 0 2px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.gstep { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line, #d8dde6); background: var(--bg, #f7f8fb); position: relative; }
.gstep:not(:last-child)::after { content: "→"; position: absolute; right: -14px; color: var(--muted, #889); }
.gstep { margin-right: 14px; }
.gstep .gmark { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; background: #e5e8ef; color: #445; flex: none; }
.gstep.done { opacity: .75; }
.gstep.done .gmark { background: #2e9e5b; color: #fff; }
.gstep.next { border-color: var(--primary, #2b6cb0); box-shadow: 0 0 0 2px rgba(43,108,176,.18); background: #fff; }
.gstep.next .gmark { background: var(--primary, #2b6cb0); color: #fff; }
.gstep .gbody { display: flex; flex-direction: column; line-height: 1.15; }
.gstep .gbody small { color: var(--muted, #667); margin-top: 2px; max-width: 28ch; }
@media (max-width: 700px) { .guide-flow { flex-direction: column; } .gstep { margin-right: 0; border-radius: 12px; } .gstep:not(:last-child)::after { content: "↓"; right: 12px; top: auto; bottom: -14px; } }

/* ── 89.4: photo feed with pick-for-print, and the printed book ── */
.pick-card.picked { outline: 2px solid var(--accent); }
.pick-btn.on { background: var(--accent-pale); color: var(--primary); font-weight: 700; }
.pick-no { background: var(--accent); color: #fff; font-weight: 800; }
.bookprint { margin: 8px 0 16px; }
.book-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 10px; }
.book-sheet { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.book-page { position: relative; background: #fff; color: #12324A; border: 1px solid var(--border); border-radius: 6px; padding: 14px; aspect-ratio: 210 / 297; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.book-page img { max-width: 100%; max-height: 76%; object-fit: contain; }
.book-cap { margin: 10px 0 0; font-weight: 700; } .book-det { margin: 2px 0 0; font-size: 12px; opacity: .7; }
.book-no { position: absolute; bottom: 10px; left: 0; right: 0; font-size: 12px; opacity: .7; }
.book-cover h1 { font-size: 26px; margin: 0 0 8px; } .book-sub, .book-count { margin: 4px 0; opacity: .75; }
/* the watermark: across every page of a free copy, drawn over the picture */
.book-page.wm::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .28;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='170'><text x='130' y='90' text-anchor='middle' font-family='sans-serif' font-size='22' font-weight='700' fill='%23b00020' transform='rotate(-30 130 85)'>TSINDE HERITAGE</text><text x='130' y='116' text-anchor='middle' font-family='sans-serif' font-size='13' fill='%23b00020' transform='rotate(-30 130 85)'>free copy · subscribe to remove</text></svg>") repeat; }
@media print {
  body.printing-book * { visibility: hidden; }
  body.printing-book .book-live, body.printing-book .book-live * { visibility: visible; }
  body.printing-book .book-live { position: absolute; left: 0; top: 0; width: 100%; display: block; }
  body.printing-book .book-page { page-break-after: always; break-after: page; border: 0; border-radius: 0; height: 100vh; aspect-ratio: auto; margin: 0; }
  body.printing-book .book-page.wm::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Stage 94 — drawing mark-up (MarkupTab.razor / markup.js) */
.markup-wrap { border: 1px solid var(--line, #ccc); border-radius: 8px; overflow: auto; background: #f6f6f6; max-height: 72vh; }
.markup-canvas { display: block; touch-action: none; cursor: crosshair; background: #fff; }
.markup-tools { flex-wrap: wrap; gap: 6px; align-items: center; }
.markup-color { width: 36px; height: 30px; border: 1px solid var(--line, #ccc); border-radius: 6px; padding: 0; background: none; }
.markup-width { height: 30px; border-radius: 6px; }
.markup-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.markup-row { font-size: 0.9rem; padding: 6px 8px; border: 1px solid var(--line, #e3e3e3); border-radius: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Stage 95: a form opens on its RECORDS AS CARDS · my profile as a page · the Home cards (my family, my request to join) ── */
.rcards-page { display: flex; flex-direction: column; gap: 12px; }
.rcards-search { flex: 1 1 220px; max-width: 420px; }
.rcards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.rcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 10px); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: border-color .12s, box-shadow .12s; }
.rcard:hover, .rcard:focus-visible { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); outline: none; }
.rcard-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-alt); display: block; }
.rcard-icon { height: 64px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.rcard-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rcard-head { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.rcard-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--primary); overflow-wrap: anywhere; }
.rcard-badge { margin: 0; cursor: default; flex: none; font-size: 11.5px; padding: 3px 9px; }
.rcard-key { font-family: Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.rcard-line { font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.rcard-label { color: var(--muted); }
.rcards-empty { padding: 26px 6px; }
.profile-page { max-width: 820px; }
.profile-card { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.profile-photo { width: 148px; height: 148px; border-radius: 50%; object-fit: cover; background: var(--surface-alt); border: 3px solid var(--accent-light, var(--border)); flex: none; }
.profile-photo.none { display: flex; align-items: center; justify-content: center; font-size: 60px; }
.profile-main { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.profile-name { margin: 0; font-size: 24px; color: var(--primary); }
.profile-facts { margin: 4px 0 6px; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.profile-fact dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.profile-fact dd { margin: 1px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.home-cards { display: flex; flex-direction: column; gap: 12px; margin: 12px 12px 4px; }
.home-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 13px; padding: 16px 18px; }
.home-card.empty { border-left-color: var(--neutral); }
.home-card-img { width: 104px; height: 104px; border-radius: 12px; object-fit: cover; background: var(--surface-alt); flex: none; }
.home-card-icon { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; background: var(--accent-pale, var(--surface-alt)); flex: none; }
.home-card-main { flex: 1 1 320px; min-width: 0; }
.home-card-main h2 { margin: 0 0 4px; font-size: 20px; color: var(--primary); }
.home-card-main p { margin: 2px 0; line-height: 1.45; }
.home-card-stats { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 2px; font-size: 13px; color: var(--muted); }
.home-stat b { color: var(--text); font-size: 16px; }
.home-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
/* the circuit to the server was lost, or a screen failed: SAY SO (it used to look like a frozen page) */
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: #7a271a; color: #fff; padding: 12px 18px; font-weight: 600; box-shadow: 0 -4px 16px rgba(0,0,0,.25); }
#blazor-error-ui a, #blazor-error-ui button { color: #fff; text-decoration: underline; background: none; border: 0; font: inherit; cursor: pointer; margin-left: 10px; }

/* Stage 97.3 — drill-down: ↗ beside a look-up, underlined report cells, and the view-only card they open */
.drill-btn { font-size: 13px; }
a.drill { color: var(--primary); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; cursor: pointer; }
a.drill:hover { text-decoration-style: solid; }
.peek-backdrop { z-index: 60; }
.peek { outline: none; max-height: 86vh; overflow-y: auto; }
.peek-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 9px; background: var(--accent-pale); color: var(--primary); margin-right: auto; margin-left: 8px; }
.peek-img { max-width: 160px; max-height: 160px; border-radius: 10px; float: right; margin: 0 0 8px 12px; object-fit: cover; }
.peek-list { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 4px 14px; margin: 8px 0; }
.peek-list dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.peek-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.peek-long { white-space: pre-line; }
.tile-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: left; }
/* 97.5 — the definition tree: find, expand / collapse all, where used */
.deftree-findbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.deftree-findbar .entry { flex: 1 1 320px; max-width: 560px; }
.deftree-card.hit { outline: 2px solid var(--accent, #0B7A5E); background: color-mix(in srgb, var(--accent, #0B7A5E) 9%, transparent); }
.deftree-usedby { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 10px; margin: 6px 0; border: 1px dashed var(--line, #C9D6D2); border-radius: 8px; }
.deftree-usedby .deftree-capture-title { flex-basis: 100%; }
.tree-row > .tree-couple { margin: 0 6px 6px; justify-content: center; }

/* Stage 97.9 — the node menu (⋮) and the family view */
.tree-card { position: relative; }
.tree-node-menu { position: absolute; z-index: 30; top: 100%; right: 0; min-width: 230px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.tree-node-menu button { text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.tree-node-menu button:hover, .tree-node-menu button:focus-visible { background: rgba(10,110,166,.10); }
.tree-node-menu-sep { font-size: 12px; opacity: .7; padding: 6px 10px 2px; border-top: 1px solid var(--border); margin-top: 4px; }
.family-view .family-row { flex-wrap: wrap; justify-content: center; }
.family-view .family-pivot.sibling .tree-card { opacity: .92; }

/* Stage 98.1 — a question on the tree's quick capture, with the box that answers it; the endless feed; a sponsored card in the feed */
.tree-asked { margin: 10px 0; padding: 12px 14px; border: 1px solid #E0A800; border-left-width: 5px; border-radius: 10px; background: rgba(224,168,0,.09); }
.tree-asked-title { font-weight: 700; margin-bottom: 6px; }
.tree-asked p { margin: 4px 0 8px; }
.feed-sentinel { height: 1px; }
.feed-sponsored { border: 1px dashed var(--border); border-radius: 12px; padding: 8px 12px; margin: 10px 0; }
.feed-sponsored-label { font-size: 12px; opacity: .7; margin-bottom: 4px; }
.feed-sponsored:not(:has(.adcard)) { display: none; }   /* nobody to show (a child, an ad-free family, no campaign on this page): no empty box */
.feed-credit { font-size: 12px; opacity: .75; margin: 2px 0 0; }

/* ── Stage 98.2: THE ENGINE ROOM (MonitorPanel) — background processes: running? done, waiting, and what to run on the server ── */
.monitor { padding: 12px 14px 30px; max-width: 1180px; }
.monitor-verdict { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 15px; border-radius: var(--radius); border: 1.4px solid var(--border, #d5dde3); background: var(--surface); margin-bottom: 14px; }
.monitor-verdict.good { border-color: var(--success); background: color-mix(in srgb, var(--success) 9%, var(--surface)); }
.monitor-verdict.warn { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.monitor-verdict.bad { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.monitor-verdict-text { display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; } .monitor-verdict-side { display: flex; gap: 10px; align-items: center; }
.monitor-h { font-size: 15px; margin: 20px 0 9px; color: var(--primary); }
.monitor-workers { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; margin-bottom: 14px; }
.monitor-worker { border: 1.3px solid var(--border, #d5dde3); border-left-width: 5px; border-radius: var(--radius); background: var(--surface); padding: 11px 13px; min-width: 0; }
.monitor-worker.good { border-left-color: var(--success); } .monitor-worker.bad { border-left-color: var(--danger); } .monitor-worker.off { border-left-color: var(--neutral); opacity: .85; }
.monitor-worker-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .monitor-worker-head strong { font-size: 14.5px; }
.monitor-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--neutral); flex: none; }
.monitor-dot.good { background: var(--success); } .monitor-dot.warn { background: #E0A100; } .monitor-dot.bad { background: var(--danger); }
.monitor-chip { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 10px; border: 1px solid currentColor; white-space: nowrap; color: var(--neutral); }
.monitor-chip.good { color: var(--success); } .monitor-chip.warn { color: var(--warn-text); background: var(--warn-bg); } .monitor-chip.bad { color: #fff; background: var(--danger); border-color: var(--danger); }
.monitor-worker-head .monitor-chip { margin-left: auto; }
.monitor-what { margin: 6px 0 2px; font-size: 12.5px; color: var(--muted); } .monitor-explain { margin: 4px 0 8px; font-size: 13px; }
.monitor-worker.bad .monitor-explain { font-weight: 600; }
.monitor-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin: 0; font-size: 12.5px; } .monitor-facts .wide { grid-column: 1 / -1; }
.monitor-facts dt { color: var(--muted); font-size: 11.5px; } .monitor-facts dd { margin: 0; overflow-wrap: anywhere; }
.monitor-cmds { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border, #d5dde3); } .monitor-cmds-h { font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }
.monitor-cmd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; margin-bottom: 8px; } .monitor-cmd-label { grid-column: 1 / -1; font-size: 12.5px; }
.monitor-cmd code, .monitor-facts code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: #0f1b24; color: #e6f1f7; padding: 6px 9px; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; display: block; min-width: 0; }
.monitor-facts code { display: inline-block; padding: 1px 6px; white-space: nowrap; }
.monitor-queues { width: 100%; border-collapse: collapse; background: var(--surface); border: 1.3px solid var(--border, #d5dde3); border-radius: var(--radius); font-size: 13px; }
.monitor-queues th { text-align: left; font-size: 11.5px; color: var(--muted); padding: 7px 10px; border-bottom: 1.3px solid var(--border, #d5dde3); }
.monitor-queues td { padding: 7px 10px; border-bottom: 1px solid var(--border, #e6ecf0); vertical-align: top; } .monitor-queues .num { text-align: right; font-variant-numeric: tabular-nums; }
.monitor-queues tr.can-open { cursor: pointer; } .monitor-queues tr.can-open:hover td { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.monitor-queues tr.q-stuck td:first-child, .monitor-queues tr.q-late td:first-child { font-weight: 600; }
.monitor-rows > td { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); padding: 8px 14px 12px 28px; }
.monitor-rowtable { border-collapse: collapse; width: 100%; font-size: 12.5px; } .monitor-rowtable th { text-align: left; color: var(--muted); font-size: 11px; padding: 3px 8px; } .monitor-rowtable td { padding: 4px 8px; border-top: 1px solid var(--border, #e6ecf0); }
@media (max-width: 720px) { .monitor-queues th:nth-child(2), .monitor-queues td:nth-child(2) { display: none; } .monitor-facts { grid-template-columns: 1fr; } }
.monitor-h3 { font-size: 13px; margin: 14px 0 6px; color: var(--neutral); font-weight: 700; }

/* ── Stage 98.3: THE CONFIGURATION EXPLORER (Components/Shared/DefinitionTreeEditor.razor) — folders left, contents right, a menu per node ── */
.cfx { padding: 8px 14px 24px; }
.cfx-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cfx-param { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); min-width: 170px; position: relative; }
.cfx-param .entry { min-height: 34px; }
.cfx-find { flex: 1 1 300px; max-width: 520px; }
.cfx-combo { display: flex; gap: 4px; }
.cfx-combo .mini { min-width: 34px; }
.cfx-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.cfx-backdrop { position: fixed; inset: 0; z-index: 40; background: transparent; }
.cfx-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 41; max-height: 380px; overflow: auto; margin-top: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.cfx-list-row { display: grid; grid-template-columns: minmax(110px, 32%) 1fr auto; gap: 10px; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cfx-list-row:hover, .cfx-list-row.on { background: var(--surface-alt); }
.cfx-list-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfx-list-row i { color: var(--muted); font-size: 12px; }
.cfx-list-empty { padding: 8px 10px; }
.cfx-status { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 6px 2px; min-height: 20px; }
.cfx-dirty { color: var(--danger); font-size: 12.5px; font-weight: 700; }
.cfx-panes { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 12px; align-items: start; margin-top: 8px; }
.cfx-left, .cfx-right { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cfx-left { padding: 6px 4px; max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: 56px; }
.cfx-right { padding: 10px 14px 16px; min-width: 0; }
.cfx-kids { margin-left: 15px; border-left: 1px dotted var(--border); }
.cfx-row { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; cursor: pointer; user-select: none; font-size: 13.5px; }
.cfx-row:hover { background: var(--surface-alt); }
.cfx-row.selected { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 700; }
.cfx-row.hit { outline: 2px solid var(--success); }
.cfx-fold { width: 18px; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; font-size: 12px; }
.cfx-fold.none { display: inline-block; }
.cfx-icon { width: 20px; text-align: center; flex: none; }
.cfx-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfx-count { font-size: 11px; color: var(--muted); background: var(--surface-alt); border-radius: 9px; padding: 0 6px; }
.cfx-dots { border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 5px; padding: 0 6px; font-size: 16px; line-height: 18px; visibility: hidden; }
.cfx-row:hover .cfx-dots, .cfx-row.selected .cfx-dots, .cfx-file .cfx-dots, .cfx-grid .cfx-dots, .cfx-value .cfx-dots { visibility: visible; }   /* a touch screen has no hover: the ⋯ of a grid row or a folder tile is always there */
@media (hover: none) { .cfx-row .cfx-dots { visibility: visible; } }
.cfx-dots:hover { background: var(--border); color: var(--text); }
.cfx-crumbs { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; font-size: 12.5px; margin-bottom: 6px; }
.cfx-crumb { border: 0; background: transparent; color: var(--info); cursor: pointer; padding: 2px 4px; border-radius: 5px; font: inherit; font-size: 12.5px; }
.cfx-crumb:hover { background: var(--surface-alt); } .cfx-crumb.on { color: var(--text); font-weight: 700; }
.cfx-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.cfx-head-icon { font-size: 20px; } .cfx-head-title { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.cfx-kind { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 9px; padding: 0 7px; white-space: nowrap; }
.cfx-section { margin: 10px 0 14px; }
.cfx-section-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cfx-props { width: 100%; border-collapse: collapse; }
.cfx-props th { text-align: left; font-weight: 600; font-size: 12.5px; width: 190px; padding: 3px 8px 3px 0; vertical-align: middle; color: var(--text); white-space: nowrap; }
.cfx-props td { padding: 3px 4px; vertical-align: middle; }
.cfx-props tr.unset th { color: var(--muted); font-weight: 400; }
.cfx-props tr.unknown th { font-style: italic; }
.cfx-props .entry { min-height: 30px; padding: 3px 7px; font-size: 13.5px; }
.cfx-props textarea.cfx-long { min-height: 34px; font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 12.5px; }
.cfx-prop-help { font-size: 11.5px; color: var(--muted); width: 30%; }
.cfx-prop-x { width: 30px; }
.cfx-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.cfx-file { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; min-width: 0; }
.cfx-file:hover { background: var(--surface-alt); border-color: var(--accent); }
.cfx-file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 64px; }
.cfx-file .cfx-kind { flex: 0 3 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cfx-file-sum { flex: 1 4 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfx-adds { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 8px; }
.cfx-grid { width: 100%; border-collapse: collapse; }
.cfx-grid th { text-align: left; font-size: 12px; color: var(--muted); padding: 2px 4px; border-bottom: 1px solid var(--border); }
.cfx-grid td { padding: 2px 3px; border-bottom: 1px solid var(--border); }
.cfx-grid tr.hit td { background: color-mix(in srgb, var(--success) 12%, transparent); }
.cfx-grid .entry { min-height: 28px; padding: 2px 6px; font-size: 13px; }
.cfx-grid-n { width: 30px; color: var(--muted); font-size: 12px; text-align: right; }
.cfx-grid-open { width: 52px; } .cfx-grid-act { width: 104px; white-space: nowrap; text-align: right; }
.cfx-values { display: flex; flex-direction: column; gap: 4px; max-width: 620px; }
.cfx-value { display: flex; gap: 4px; align-items: center; }
.cfx-value .entry { min-height: 30px; padding: 3px 7px; }
.cfx-menu-wrap { position: fixed; z-index: 60; display: flex; align-items: flex-start; gap: 2px; }
.cfx-menu { min-width: 236px; max-width: 320px; max-height: min(590px, calc(100vh - 24px)); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 12px 32px rgba(0,0,0,.24); padding: 4px; }
.cfx-menu-title { font-size: 12px; font-weight: 700; padding: 5px 9px 6px; border-bottom: 1px solid var(--border); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfx-menu-group { font-size: 11.5px; color: var(--muted); padding: 6px 9px 2px; font-weight: 700; }
.cfx-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 5px 9px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; border-radius: 6px; cursor: pointer; }
.cfx-menu-item.indent { padding-left: 20px; }
.cfx-menu-item:hover:not(:disabled), .cfx-menu-item.on { background: var(--surface-alt); }
.cfx-menu-item:disabled { color: var(--muted); opacity: .55; cursor: default; }
.cfx-menu-item.danger { color: var(--danger); }
.cfx-menu-icon { width: 20px; text-align: center; flex: none; }
.cfx-menu-arrow { margin-left: auto; color: var(--muted); }
.cfx-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
@media (max-width: 860px) { .cfx-panes { grid-template-columns: 1fr; } .cfx-left { position: static; max-height: 320px; } .cfx-prop-help { display: none; } .cfx-menu-wrap { flex-direction: column; } }
