/* G4-MAP1-A — the account tree and classification (structure and spacing only; colors follow the site tokens) */
.maptree .mt-body{display:grid;gap:12px}
.maptree .mt-busy{opacity:.6}
.maptree .mt-head{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center}
.maptree .mt-coverage{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}
.maptree .mt-coverage progress{inline-size:min(320px,100%);block-size:12px}
.maptree .mt-pattern{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}
.maptree .mt-pattern-edit{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center}
.maptree .mt-pattern-edit input{inline-size:11ch}
.maptree .mt-filters{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:end}
.maptree .mt-filters label{display:grid;gap:4px}
.maptree .mt-filters .mt-check{grid-auto-flow:column;align-items:center}
.maptree .mt-filters .mt-search{flex:1 1 200px}
.maptree .mt-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(280px,1fr);gap:16px;align-items:start}
.maptree .mt-tree-host{max-block-size:70vh;overflow:auto;border:1px solid var(--line,rgba(0,0,0,.12));border-radius:10px;padding:6px}
.maptree .mt-tree,.maptree .mt-tree ul{list-style:none;margin:0;padding:0}
.maptree .mt-tree ul{padding-inline-start:18px}
.maptree .mt-row{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto auto auto;gap:6px 10px;align-items:center;padding:4px 6px;border-radius:8px;cursor:pointer}
.maptree .mt-row.mt-account{grid-template-columns:auto minmax(0,1fr) auto auto auto;padding-inline-start:28px}
.maptree .mt-row:hover{background:var(--xc-soft,rgba(37,99,235,.06))}
.maptree .mt-row[aria-selected="true"]{background:var(--xc-soft,rgba(37,99,235,.12));outline:1px solid var(--xc-line,rgba(37,99,235,.3))}
.maptree .mt-toggle{border:0;background:none;cursor:pointer;inline-size:22px;block-size:22px;padding:0;font:inherit}
.maptree .mt-code{font-variant-numeric:tabular-nums;font-weight:600}
.maptree .mt-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.maptree .mt-bal{font-variant-numeric:tabular-nums}
.maptree .mt-count,.maptree .mt-metric{font-size:.85em;opacity:.8}
.maptree .mt-badge{display:inline-block;padding:1px 8px;border-radius:999px;font-size:.8em;border:1px solid currentColor;white-space:nowrap}
.maptree .mt-badge[data-status="missing"]{color:var(--bad,#b42318)}
.maptree .mt-badge[data-status="exception"]{color:var(--warn,#b54708)}
.maptree .mt-badge[data-status="inherited"],.maptree .mt-badge[data-status="direct"],.maptree .mt-badge[data-status="ok"]{color:var(--good,#067647)}
.maptree .mt-badge[data-status="master"],.maptree .mt-badge[data-status="deferred"],.maptree .mt-badge[data-status="empty"]{opacity:.75}
.maptree .mt-card h4{margin:0 0 6px}
.maptree .mt-current{margin:0 0 8px}
.maptree .mt-actions{display:flex;flex-wrap:wrap;gap:8px}
.maptree .mt-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-block:10px}
.maptree .mt-bar .mt-status{flex:1 1 100%;margin:0}
.maptree .mt-figures{inline-size:100%;border-collapse:collapse;margin-block:8px}
.maptree .mt-figures th,.maptree .mt-figures td{padding:4px 8px;text-align:start;border-block-end:1px solid var(--line,rgba(0,0,0,.1))}
.maptree .mt-figures caption{text-align:start;font-weight:600;padding:4px 0}
.maptree .mt-diff{font-weight:600}
.maptree .mt-changes,.maptree .mt-exceptions{margin:6px 0;padding-inline-start:18px;max-block-size:30vh;overflow:auto}
.maptree .mt-exc summary{cursor:pointer}
/* G4-MAP1-B — the suggestions, the market, the notices, the side rules, the flips, MX, the approval */
.maptree .mt-market{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}
.maptree .mt-market label{display:inline-flex;gap:6px;align-items:center}
.maptree .mt-notice{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;margin:0;padding:6px 10px;border:1px dashed var(--line,rgba(0,0,0,.2));border-radius:8px}
.maptree .mt-suggest{margin:8px 0;padding:8px 10px;border:1px solid var(--line,rgba(0,0,0,.12));border-radius:8px}
.maptree .mt-suggest h5{margin:0 0 6px}
.maptree .mt-suggest ul{margin:0;padding-inline-start:16px}
.maptree .mt-suggest .mt-sug-item{margin-block:4px}
.maptree .mt-suggest .mt-sug-item p{margin:2px 0 4px}
.maptree .mt-badge[data-status="suggest"]{color:var(--accent,#1d4ed8)}
.maptree .mt-alerts{margin:6px 0;padding-inline-start:18px;max-block-size:30vh;overflow:auto}
.maptree .mt-alerts li[data-state="pending"],.maptree .mt-alerts li[data-state="none"]{font-weight:600}
.maptree .mt-sr summary,.maptree .mt-flips summary{cursor:pointer}
.maptree .mt-sr table td{vertical-align:top}
.maptree .mt-locked{display:grid;gap:6px;margin-block:6px}
.maptree .mt-mx{margin-block:8px}
.maptree .mt-notice,.maptree .mt-market,.maptree .mt-suggest,.maptree .mt-alerts{overflow-wrap:anywhere;max-inline-size:100%}
.maptree .mt-body,.maptree .mt-body>*,.maptree .mt-side,.maptree .mt-grid,.maptree .mt-sr,.maptree .mt-flips{min-inline-size:0;max-inline-size:100%}
.maptree .mt-market>*,.maptree .mt-notice>*{min-inline-size:0;flex:0 1 auto}
@media (max-width:760px){.maptree .mt-sr table{display:block;overflow-x:auto;max-inline-size:100%}.maptree .mt-sr th,.maptree .mt-sr td{white-space:normal;min-inline-size:90px}.maptree .mt-preview{min-inline-size:0;max-inline-size:100%;overflow-x:auto}/* G4-MAP1-D: the figures table scrolls inside the preview, the page keeps its width */}
@media (max-width:760px){.maptree .mt-grid{grid-template-columns:1fr}.maptree .mt-tree-host{max-block-size:50vh}.maptree .mt-row{grid-template-columns:auto auto minmax(0,1fr) auto}.maptree .mt-row .mt-count,.maptree .mt-row .mt-metric{display:none}.maptree .mt-row.mt-account{grid-template-columns:auto minmax(0,1fr) auto auto;padding-inline-start:18px}}
/* G4-MAP2 (the Owner 2026-10-08: the ERP tree — «+» to open, the numbers beside the accounts, the tree the main column): the rows on one line, guide lines,
   the tree taller, the side card sticky, the readings and the totals as chips, an unnamed group in italics. */
.maptree .mt-grid{grid-template-columns:minmax(0,1.8fr) minmax(300px,1fr)}
.maptree .mt-tree-host{max-block-size:calc(100vh - 150px);min-block-size:420px;padding:8px 10px}
.maptree .mt-side{position:sticky;inset-block-start:12px}
.maptree .mt-row{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;grid-template-columns:none}
.maptree .mt-row.mt-account{padding-inline-start:30px}
.maptree .mt-row .mt-name{flex:1 1 auto;min-inline-size:0}
.maptree .mt-row .mt-bal{min-inline-size:12ch;text-align:end}
.maptree .mt-row .mt-count,.maptree .mt-row .mt-metric{white-space:nowrap}
.maptree .mt-tree ul{margin-inline-start:11px;padding-inline-start:14px;border-inline-start:1px dashed var(--line,rgba(0,0,0,.18))}
.maptree .mt-toggle{inline-size:20px;block-size:20px;border:1px solid var(--line,rgba(0,0,0,.25));border-radius:4px;font-weight:700;line-height:1;display:inline-flex;align-items:center;justify-content:center;flex:none}
.maptree .mt-row[data-level="1"] .mt-name{font-weight:700}.maptree .mt-unnamed{font-style:italic;opacity:.7}
.maptree .mt-totals,.maptree .mt-pattern-choices{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.maptree .mt-total-chip{display:inline-flex;gap:4px;align-items:center;padding:2px 8px;border:1px solid var(--line,rgba(0,0,0,.18));border-radius:999px;font-size:.9em;white-space:nowrap}
.maptree .mt-pattern-pick{display:inline-grid;gap:2px;text-align:start;padding:6px 10px;border-radius:10px}
.maptree .mt-pattern-pick[aria-pressed="true"]{outline:2px solid var(--accent,#2563eb);outline-offset:-2px}
.maptree .mt-pattern-pick span{font-size:.85em;opacity:.8}
.mt-chart-dialog{max-inline-size:min(620px,calc(100vw - 32px));border:1px solid var(--line,rgba(0,0,0,.18));border-radius:14px;padding:18px}
.mt-chart-dialog label{display:grid;gap:4px;margin-block:8px}.mt-chart-dialog textarea{inline-size:100%;font-family:ui-monospace,monospace}
/* G4-PASS1 — «حسابين متقابلين» in the account card */
.maptree .mt-pair{display:grid;gap:8px;margin-block-start:12px;padding:10px 12px;border:1px solid var(--line,rgba(0,0,0,.18));border-inline-start:4px solid var(--accent,#0869c9);border-radius:10px}
.maptree .mt-pair summary{cursor:pointer;font-weight:600}.maptree .mt-pair h5{margin:0;font-size:1em}.maptree .mt-pair p{margin:0}
.maptree .mt-pair label{display:grid;gap:4px}.maptree .mt-pair select{inline-size:100%;max-inline-size:100%}.maptree .mt-pair .mini{justify-self:start}
/* G4-MAP3 — the full-width area under the tree: the exceptions, the side rules, the flipped accounts and the MX suggestions; nothing in it pushes the page sideways */
.maptree .mt-wide{display:grid;gap:12px;margin-block-start:16px;min-inline-size:0;max-inline-size:100%}
.maptree .mt-wide>details,.maptree .mt-wide>.mt-mx{border:1px solid var(--line,rgba(0,0,0,.18));border-radius:12px;padding:10px 14px;min-inline-size:0;max-inline-size:100%;overflow-x:auto}
.maptree .mt-wide summary{cursor:pointer;font-weight:600}.maptree .mt-wide table{inline-size:100%;border-collapse:collapse}.maptree .mt-wide td,.maptree .mt-wide th{overflow-wrap:anywhere;vertical-align:top}
.maptree .mt-wide ul{margin:8px 0 0;padding-inline-start:18px;max-block-size:22rem;overflow-y:auto}.maptree .mt-card small{font-weight:400;opacity:.75}
@media (max-width:900px){.maptree .mt-grid{grid-template-columns:1fr}.maptree .mt-side{position:static}.maptree .mt-row .mt-count,.maptree .mt-row .mt-metric{display:none}}
