/* TIRAZIS 3.4 - TRIZ tools: shared tool windows, sub-systems, Nine Windows, Su-Field,
 * physical contradictions, cause-effect chains, resources, flow. Uses the app's tokens. */

/* ------------------------------------------------------------------ toolbar menu */
#trizToolsMenu{width:min(340px, calc(100vw - 16px));padding:6px}
.tzx-menu-item{align-items:flex-start !important;gap:10px !important;padding:8px 10px !important}
.tzx-menu-item b{display:block;font-weight:700;font-size:12.5px}
.tzx-menu-item small{display:block;color:var(--muted);font-weight:500;font-size:11px;line-height:1.35;white-space:normal}
.tzx-menu-item > span:nth-child(2){flex:1;min-width:0}
.tzx-menu-ic{width:26px;height:26px;flex:0 0 26px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;background:var(--soft);color:var(--blue)}
.tzx-menu-ic svg{width:15px;height:15px}
.tzx-menu-sep{height:1px;background:var(--line);margin:5px 4px}
.tzx-menu-switch{width:30px;height:17px;border-radius:999px;background:var(--line);position:relative;flex:0 0 30px;align-self:center;transition:background .15s}
.tzx-menu-switch i{position:absolute;left:2px;top:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:left .15s}
.tzx-menu-item[aria-pressed="true"] .tzx-menu-switch{background:var(--blue)}
.tzx-menu-item[aria-pressed="true"] .tzx-menu-switch i{left:15px}

/* context-menu additions */
.tzx-cm-head{font-size:10px !important;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.tzx-cm-ic{display:inline-block;width:16px;text-align:center;color:var(--blue)}

/* ------------------------------------------------------------------ tool windows */
.tzx-win .tz-win-head{flex-wrap:nowrap}
.tzx-win .tz-win-title{min-width:0;flex:0 1 auto}
.tzx-win-titles{display:flex;flex-direction:column;min-width:0}
.tzx-win-titles strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tzx-win-sub{color:var(--muted);font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tzx-head-extra{flex:1;min-width:0;display:flex;justify-content:flex-end;align-items:center;gap:6px}
.tzx-win-btns{display:flex;gap:2px;flex:0 0 auto}
.tzx-win-btns .tz-icon-btn{display:inline-flex;align-items:center;justify-content:center}
.tzx-win.tzx-maxed{resize:none;border-radius:12px}
.tzx-body{padding:12px 14px}
.tzx-muted{color:var(--muted)}
.tzx-foot-note{font-size:11px}
.tzx-link{border:0;background:transparent;color:var(--blue);font:700 11.5px var(--font-stack);cursor:pointer;padding:2px 0}
.tzx-link:hover{text-decoration:underline}
.tzx-confirm{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;padding:8px 10px;border-radius:10px;background:var(--tz-red-soft);border:1px solid rgba(239,68,68,.3);font-size:12px}
.tzx-confirm span{flex:1;min-width:140px}
.tzx-section-t{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:2px 0 6px}
.tzx-field{display:flex;flex-direction:column;gap:4px;font-weight:700;font-size:11.5px}
.tzx-field .tz-input{font-weight:500}
.tzx-grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tzx-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:26px 16px;color:var(--muted)}
.tzx-empty b{color:var(--ink);font-size:13px}
.tzx-empty svg{width:42px;height:42px;opacity:.5}
@media (max-width:700px){ .tzx-grid2{grid-template-columns:1fr} }

/* ------------------------------------------------------------------ sub-systems */
.tzx-crumbs{position:absolute;left:14px;top:12px;z-index:4;display:flex;align-items:center;gap:4px;flex-wrap:wrap;max-width:calc(100% - 28px);
  padding:5px 6px 5px 8px;border-radius:12px;background:color-mix(in srgb, var(--card) 94%, transparent);backdrop-filter:blur(6px);
  border:1px solid rgba(124,58,237,.45);box-shadow:var(--shadow);font:600 12px var(--font-stack);color:var(--ink);animation:tzBarIn .22s cubic-bezier(.2,.8,.2,1)}
.tzx-crumbs[hidden]{display:none}
.tzx-crumb{display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--blue);font:700 12px var(--font-stack);padding:3px 6px;border-radius:7px;cursor:pointer}
button.tzx-crumb:hover{background:var(--soft)}
.tzx-crumb-here{color:#6D28D9;cursor:default}
body.dark-mode .tzx-crumb-here{color:#C4B5FD}
.tzx-crumb-ic{width:14px;height:14px}
.tzx-crumb-sep{color:var(--muted)}
.tzx-up{margin-left:4px}
body.tz-nested #canvasWrap{box-shadow:inset 0 0 0 3px rgba(124,58,237,.35)}
body.tz-nested #canvasWrap svg#canvas{background-image:radial-gradient(rgba(124,58,237,.10) 1px, transparent 1.2px);background-size:22px 22px}
body.tz-nested .tz-lens-bar{top:56px}
.tzx-sub-hint{position:absolute;left:14px;top:60px;z-index:3;max-width:min(420px, calc(100% - 28px));display:flex;gap:8px;align-items:flex-start;
  padding:10px 10px 10px 12px;border-radius:12px;background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow);font:500 12px/1.45 var(--font-stack);color:var(--ink)}
.tzx-sub-hint[hidden]{display:none}
.tzx-sub-hint b{display:block;margin-bottom:2px}
.tzx-sub-hint span{flex:1}
.tzx-sub-layer{pointer-events:auto}
.tzx-sub-badge{cursor:pointer}
.tzx-sub-badge rect:first-of-type{fill:#F5F3FF;stroke:#7C3AED;stroke-width:1.3px}
.tzx-sub-badge .tzx-sb-o{fill:none;stroke:#7C3AED;stroke-width:1.4px}
.tzx-sub-badge .tzx-sb-i{fill:#7C3AED}
.tzx-sub-badge text{font:800 10.5px var(--font-stack);fill:#5B21B6}
.tzx-sub-badge:hover rect:first-of-type{fill:#EDE9FE}
body.dark-mode .tzx-sub-badge rect:first-of-type{fill:#2E1065}
body.dark-mode .tzx-sub-badge text{fill:#DDD6FE}
body.dark-mode .tzx-sub-badge .tzx-sb-o{stroke:#C4B5FD} body.dark-mode .tzx-sub-badge .tzx-sb-i{fill:#C4B5FD}
.tz-chip-disabled{opacity:.5;cursor:not-allowed}
.tz-chip-disabled:hover{transform:none}

/* ------------------------------------------------------------------ Nine Windows */
.tzx-nine-win .tzx-body{padding:10px}
.tzx-nw{display:grid;grid-template-columns:34px repeat(3, minmax(0,1fr));grid-template-rows:auto repeat(3, minmax(120px, 1fr));gap:6px;min-height:100%}
.tzx-nw-colh{text-align:center;font:800 11px var(--font-stack);text-transform:uppercase;letter-spacing:.08em;color:var(--muted);padding:2px 0}
.tzx-nw-colh.tzx-now{color:var(--blue)}
.tzx-nw-rowh{display:flex;align-items:center;justify-content:center}
.tzx-nw-rowh span{writing-mode:vertical-rl;transform:rotate(180deg);font:800 11px var(--font-stack);text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.tzx-nw-cell{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:6px;min-width:0;overflow:auto}
.tzx-nw-cell.tzx-now{border-color:rgba(37,99,235,.45);background:linear-gradient(180deg, var(--soft), var(--card) 70%)}
.tzx-nw-cell.tzx-now.tzx-l-system{box-shadow:0 0 0 2px rgba(37,99,235,.25)}
.tzx-nw-note{flex:1;min-height:70px;width:100%;resize:none;border:1px dashed var(--line);border-radius:9px;background:transparent;color:var(--ink);font:500 12px/1.45 var(--font-stack);padding:7px 8px;outline:none}
.tzx-nw-note:focus{border-style:solid;border-color:var(--blue);background:var(--card)}
.tzx-nw-sys{display:flex;flex-direction:column;gap:3px;font-size:12px}
.tzx-nw-sys b{font-size:14px}
.tzx-here{align-self:flex-start;font-style:normal;font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:#fff;background:var(--blue);border-radius:999px;padding:1px 8px;margin-top:3px}
.tzx-chips{display:flex;flex-wrap:wrap;gap:4px}
.tzx-chip{display:inline-flex;align-items:center;border:1px solid var(--line);background:var(--card);border-radius:999px;font:600 11.5px var(--font-stack);color:var(--ink);overflow:hidden}
button.tzx-chip{padding:3px 9px;cursor:pointer}
.tzx-chip > button{border:0;background:transparent;color:inherit;font:inherit;padding:3px 4px 3px 9px;cursor:pointer}
.tzx-chip > button:hover,button.tzx-chip:hover{background:var(--soft)}
.tzx-chip-super{border-color:#FDBA74;background:#FFF7ED}
.tzx-chip-target{border-color:#FACC15;background:#FEFCE8}
body.dark-mode .tzx-chip-super{background:rgba(249,115,22,.12)} body.dark-mode .tzx-chip-target{background:rgba(250,204,21,.12)}
.tzx-chip-std{border-color:#93C5FD}
.tzx-in{display:inline-flex !important;align-items:center;padding:3px 7px 3px 4px !important;color:var(--muted) !important}
.tzx-in svg{width:13px;height:13px}
.tzx-in.tzx-has{color:#7C3AED !important}
.tzx-nw-var{display:flex;flex-wrap:wrap;align-items:center;gap:4px}
.tzx-vchip{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:999px;background:var(--card);overflow:hidden}
.tzx-vchip.tzx-on{border-color:var(--blue)}
.tzx-vchip button{border:0;background:transparent;color:var(--ink);font:700 11.5px var(--font-stack);padding:3px 6px 3px 8px;cursor:pointer;display:inline-flex;align-items:center;gap:5px}
.tzx-vchip button i{width:8px;height:8px;border-radius:50%}
.tzx-vchip .tzx-x{padding:3px 7px 3px 2px;color:var(--muted)}
.tzx-tag-sel{width:auto;max-width:100%;padding:3px 6px;font-size:11.5px}
@media (max-width:700px){
  .tzx-nw{grid-template-columns:28px repeat(3, minmax(150px,1fr));overflow-x:auto}
}

/* ------------------------------------------------------------------ split layout: list + editor */
.tzx-split{display:flex;gap:10px;height:100%;min-height:0}
.tzx-side{flex:0 0 230px;display:flex;flex-direction:column;gap:6px;min-height:0}
.tzx-side-list{flex:1;overflow:auto;display:flex;flex-direction:column;gap:4px;min-height:60px}
.tzx-main{flex:1;min-width:0;overflow:auto;display:flex;flex-direction:column;gap:10px;padding-right:2px}
.tzx-item{display:flex;flex-direction:column;gap:2px;text-align:left;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink);padding:7px 9px;cursor:pointer;font:500 12px var(--font-stack)}
.tzx-item:hover{border-color:#C9D4E8}
.tzx-item.tzx-on{border-color:var(--blue);background:var(--soft)}
.tzx-item b{font-weight:700;font-size:12px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.tzx-item small{color:var(--muted);font-size:10.5px}
.tzx-status{display:inline-block;font-style:normal;font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;padding:0 5px;border-radius:5px;border:1px solid var(--line);color:var(--muted)}
.tzx-status-harmful{color:#DC2626;border-color:rgba(220,38,38,.4)}
.tzx-status-insufficient{color:#2563EB;border-color:rgba(37,99,235,.4);border-style:dashed}
.tzx-status-excessive{color:#1D4ED8;border-color:#1D4ED8;border-width:2px}
.tzx-status-normal{color:#059669;border-color:rgba(5,150,105,.4)}
@media (max-width:760px){
  .tzx-split{flex-direction:column}
  .tzx-side{flex:0 0 auto;max-height:160px}
}

/* ------------------------------------------------------------------ tabs, cards */
.tzx-tabs{display:inline-flex;gap:2px;padding:3px;border-radius:10px;background:var(--bg);border:1px solid var(--line)}
.tzx-tabs button{border:0;background:transparent;color:var(--muted);font:700 11.5px var(--font-stack);padding:5px 10px;border-radius:7px;cursor:pointer;white-space:nowrap}
.tzx-tabs button[aria-selected="true"]{background:var(--card);color:var(--ink);box-shadow:0 1px 3px rgba(15,23,42,.12)}
.tzx-card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px 12px;min-width:0}
.tzx-shake{animation:tzxShake .4s}
@keyframes tzxShake{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}

/* ------------------------------------------------------------------ Su-Field */
.tzx-sf-win .tzx-body{display:flex;flex-direction:column;gap:10px;background:var(--bg)}
.tzx-sf-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:10px}
@media (max-width:760px){ .tzx-sf-grid{grid-template-columns:1fr} }
.tzx-sf-tri{width:100%;max-height:220px;display:block}
.tzx-sf-node{fill:var(--card);stroke:var(--line);stroke-width:1.5px}
.tzx-sf-name{font:700 12px var(--font-stack);fill:var(--ink)}
.tzx-sf-role{font:700 9px var(--font-stack);fill:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.tzx-sf-leg{stroke-width:2.4px;stroke-dasharray:5 4}
.tzx-sf-f{font:800 15px var(--font-stack);fill:#fff}
.tzx-sf-act{font:700 11.5px var(--font-stack);fill:var(--muted)}
.tzx-fields{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:4px}
.tzx-fchip{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:999px;padding:3px 9px 3px 4px;font:600 11px var(--font-stack);cursor:pointer}
.tzx-fchip b{display:inline-flex;align-items:center;justify-content:center;width:22px;height:18px;border-radius:999px;background:var(--fc);color:#fff;font-size:9.5px}
.tzx-fchip:hover{border-color:var(--fc)}
.tzx-fchip.tzx-on{border-color:var(--fc);box-shadow:0 0 0 2px color-mix(in srgb, var(--fc) 25%, transparent);font-weight:800}
.tzx-fchip.tzx-sugg{border-style:dashed;border-color:var(--fc)}
.tzx-sug{text-transform:none;letter-spacing:0;font-weight:600;color:var(--blue)}
.tzx-ptypes{display:flex;flex-wrap:wrap;gap:4px}
.tzx-ptype{border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:8px;padding:5px 8px;font:600 11.5px var(--font-stack);cursor:pointer}
.tzx-ptype:hover{border-color:#C9D4E8}
.tzx-ptype.tzx-on{background:var(--blue);border-color:var(--blue);color:#fff}
.tzx-ptype-desc{margin:8px 0;font-size:12px}
.tzx-ideas{margin:0 0 8px;padding-left:18px;font-size:12px}
.tzx-ideas li{margin:2px 0}
.tzx-sf-btns,.tzx-std-actions{display:flex;flex-wrap:wrap;gap:6px}
.tzx-std-actions{justify-content:flex-end;margin-top:6px}
.tzx-stds{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.tzx-std{border:1px solid var(--line);border-radius:10px;background:var(--card);overflow:hidden}
.tzx-std.tzx-open{border-color:#C9D4E8}
.tzx-std-head{width:100%;display:flex;align-items:center;gap:9px;border:0;background:transparent;color:var(--ink);padding:7px 10px;text-align:left;cursor:pointer;font:600 12.5px var(--font-stack)}
.tzx-std-head:hover{background:var(--soft)}
.tzx-std-n{flex:0 0 auto;font:800 11px var(--font-stack);color:var(--blue);background:var(--soft);border-radius:6px;padding:2px 6px;font-variant-numeric:tabular-nums}
.tzx-std-t{flex:1}
.tzx-std-chev{width:7px;height:7px;border-right:1.6px solid var(--muted);border-bottom:1.6px solid var(--muted);transform:rotate(45deg);transition:transform .15s}
.tzx-open .tzx-std-chev{transform:rotate(-135deg)}
.tzx-std-body{padding:0 10px 10px 10px;font-size:12px}
.tzx-std-body p{margin:0 0 8px}
.tzx-std-class{font:800 12px var(--font-stack);margin:14px 0 6px;color:var(--ink)}
.tzx-std-group{font:700 10.5px var(--font-stack);color:var(--muted);text-transform:uppercase;letter-spacing:.05em;padding:6px 2px 2px}
.tzx-also summary{cursor:pointer;color:var(--blue);font:700 12px var(--font-stack);margin:2px 0 6px}
.tzx-search{margin-bottom:4px}
.tzx-src{font-size:10.5px;color:var(--muted);margin:14px 2px 2px}

/* lens badges for fields */
.tz-b-sf rect{stroke-width:0} .tz-b-sf text{fill:#fff}
.tz-b-faded{opacity:.5}
.tz-b-sf-mechanical rect{fill:#2563EB} .tz-b-sf-acoustic rect{fill:#0891B2} .tz-b-sf-thermal rect{fill:#DC2626}
.tz-b-sf-chemical rect{fill:#16A34A} .tz-b-sf-electric rect{fill:#CA8A04} .tz-b-sf-magnetic rect{fill:#9333EA}
.tz-b-sf-electromagnetic rect{fill:#DB2777} .tz-b-sf-gravitational rect{fill:#475569} .tz-b-sf-biological rect{fill:#65A30D}
.tz-lg-sf-mechanical{background:#2563EB}.tz-lg-sf-acoustic{background:#0891B2}.tz-lg-sf-thermal{background:#DC2626}.tz-lg-sf-chemical{background:#16A34A}
.tz-lg-sf-electric{background:#CA8A04}.tz-lg-sf-magnetic{background:#9333EA}.tz-lg-sf-electromagnetic{background:#DB2777}
.tz-lens-ic-sufield{background:rgba(37,99,235,.1);color:#2563EB}
.tz-lens-group{font:800 10px var(--font-stack);text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:8px 9px 2px}

/* ------------------------------------------------------------------ physical contradiction */
.tzx-pc-win .tzx-body{background:var(--bg)}
.tzx-pc-form{display:flex;flex-direction:column;gap:10px}
.tzx-pc-ab{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:stretch}
.tzx-pc-req{position:relative;display:flex;flex-direction:column;gap:6px;border-radius:12px;padding:10px 10px 10px 12px;border:1px solid var(--line)}
.tzx-pc-a{background:rgba(37,99,235,.06);border-color:rgba(37,99,235,.3)}
.tzx-pc-b{background:rgba(219,39,119,.06);border-color:rgba(219,39,119,.3)}
.tzx-pc-tag{position:absolute;right:10px;top:8px;font:900 13px var(--font-stack);opacity:.5}
.tzx-pc-a .tzx-pc-tag{color:#2563EB} .tzx-pc-b .tzx-pc-tag{color:#DB2777}
.tzx-pc-vs{align-self:center;font:800 18px var(--font-stack);color:var(--muted)}
@media (max-width:760px){ .tzx-pc-ab{grid-template-columns:1fr} .tzx-pc-vs{justify-self:center;transform:rotate(90deg)} }
.tzx-pc-statement{margin:0;padding:10px 14px;border-left:4px solid var(--blue);background:var(--card);border-radius:0 12px 12px 0;font:600 13px/1.5 var(--font-stack);color:var(--ink)}
.tzx-pc-statement small{display:block;margin-top:4px;font-weight:500;font-size:11.5px;color:var(--muted)}
.tzx-seps{display:grid;grid-template-columns:1fr 1fr;gap:8px}
@media (max-width:900px){ .tzx-seps{grid-template-columns:1fr} }
.tzx-sep{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:6px;transition:border-color .2s, box-shadow .2s}
.tzx-sep header{display:flex;align-items:center;gap:8px}
.tzx-sep header b{flex:1;font-size:12.5px}
.tzx-sep p{margin:0;font-size:12px}
.tzx-sep.tzx-promising{border-color:rgba(16,185,129,.6);box-shadow:0 0 0 3px rgba(16,185,129,.12)}
.tzx-sep.tzx-closed{opacity:.72}
.tzx-pill-good,.tzx-pill-muted{font-style:normal;font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:1px 7px}
.tzx-pill-good{background:var(--tz-green-soft);color:#047857}
.tzx-pill-muted{background:var(--bg);color:var(--muted)}
body.dark-mode .tzx-pill-good{color:#6EE7B7}
.tzx-seg{display:flex;flex-wrap:wrap;gap:4px}
.tzx-seg button{border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:8px;padding:4px 8px;font:600 11.5px var(--font-stack);cursor:pointer}
.tzx-seg button[aria-checked="true"]{background:var(--ink);color:var(--card);border-color:var(--ink)}
.tzx-seg button[data-v="no"][aria-checked="true"]{background:#059669;border-color:#059669;color:#fff}
.tzx-sep-notes{margin-top:2px}
.tzx-sep-hint{color:var(--muted);font-size:11.5px !important}
.tzx-princ{display:flex;flex-wrap:wrap;gap:4px}
.tzx-pchip{border:1px solid rgba(124,58,237,.35);background:rgba(124,58,237,.06);color:#6D28D9;border-radius:999px;padding:3px 9px;font:700 11px var(--font-stack);cursor:pointer}
.tzx-pchip:hover{background:rgba(124,58,237,.14)}
body.dark-mode .tzx-pchip{color:#C4B5FD}
.tzx-pc-idea{display:flex;flex-direction:column;gap:6px}
.tzx-pc-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:2px 2px 8px}
.tzx-danger{color:#DC2626 !important}
/* the application styles every <header>; tool sections reset that */
.tzx-sep > header{display:flex;grid-template-columns:none;grid-template-areas:none;padding:0;background:none;border:0;z-index:auto}
.tzx-main{container-type:inline-size}
@container (max-width: 620px){ .tzx-seps{grid-template-columns:1fr} .tzx-grid2{grid-template-columns:1fr} .tzx-pc-ab{grid-template-columns:1fr} }

/* ------------------------------------------------------------------ cause-effect chains */
.tzx-ceca-win .tzx-body{background:var(--bg)}
.tzx-tree,.tzx-kids{list-style:none;margin:0;padding:0}
.tzx-kids{position:relative;margin-left:22px;padding-left:16px;border-left:2px solid var(--line)}
.tzx-kids > .tzx-cause-li{position:relative;padding-top:8px}
.tzx-kids > .tzx-cause-li::before{content:'';position:absolute;left:-16px;top:30px;width:14px;border-top:2px solid var(--line)}
.tzx-kids > .tzx-cause-li:last-child::after{content:'';position:absolute;left:-18px;top:31px;bottom:0;width:4px;background:var(--bg)}
.tzx-kids-wrap{position:relative}
.tzx-op{position:absolute;left:10px;top:6px;z-index:1;border:0;border-radius:6px;padding:1px 5px;font:900 9.5px var(--font-stack);letter-spacing:.04em;cursor:pointer}
.tzx-op-or{background:#E0E7FF;color:#3730A3}
.tzx-op-and{background:#FCE7F3;color:#9D174D}
body.dark-mode .tzx-op-or{background:#312E81;color:#C7D2FE} body.dark-mode .tzx-op-and{background:#831843;color:#FBCFE8}
.tzx-cause{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:7px 8px 6px 10px;display:flex;flex-direction:column;gap:4px;max-width:560px;transition:border-color .15s, box-shadow .15s}
.tzx-cause:focus-within{border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.tzx-cause.tzx-root{border-color:rgba(37,99,235,.45);background:linear-gradient(180deg, var(--soft), var(--card))}
.tzx-cause.tzx-key{border-color:rgba(239,68,68,.6);box-shadow:0 0 0 3px rgba(239,68,68,.12)}
.tzx-cause-kicker{font:800 9.5px var(--font-stack);text-transform:uppercase;letter-spacing:.06em;color:var(--blue)}
.tzx-cause-text{border:0;background:transparent;color:var(--ink);font:600 12.5px/1.4 var(--font-stack);resize:none;outline:none;padding:0;width:100%;min-height:20px;overflow:hidden}
.tzx-cause-bar{display:flex;align-items:center;gap:3px;flex-wrap:wrap}
.tzx-cbtn{border:1px solid transparent;background:transparent;color:var(--muted);border-radius:7px;padding:2px 6px;font:700 11.5px var(--font-stack);cursor:pointer;line-height:1.3}
.tzx-cbtn:hover{background:var(--soft);color:var(--ink)}
.tzx-cbtn.tzx-why{color:var(--blue)}
.tzx-cbtn.tzx-on{color:#DC2626;background:var(--tz-red-soft)}
.tzx-pin{border:0;background:var(--soft);color:var(--ink);border-radius:999px;padding:2px 8px;font:600 10.5px var(--font-stack);cursor:pointer;max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tzx-pin-pick{margin-top:2px}
.tzx-keys{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.tzx-keys li{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px}
.tzx-key-star{color:#DC2626;font-weight:900}
.tzx-key-t{flex:1;min-width:160px;font-weight:600}
.tzx-key-empty{font-size:12px;margin:0}

/* ------------------------------------------------------------------ resource radar */
.tzx-res-win .tzx-body{background:var(--bg)}
.tzx-res{display:flex;gap:12px;min-height:100%}
.tzx-res-left{flex:0 0 300px;display:flex;flex-direction:column;align-items:center;gap:6px;position:sticky;top:0;align-self:flex-start}
.tzx-res-right{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
.tzx-radar{width:100%;max-width:300px;height:auto}
.tzx-ring{fill:none;stroke:var(--line);stroke-width:1.2px}
.tzx-ring-0{fill:rgba(16,185,129,.10);stroke:rgba(16,185,129,.5)}
.tzx-ring-1{fill:rgba(37,99,235,.04)}
.tzx-spoke{stroke:var(--line);stroke-width:1px}
.tzx-radar-k{font:800 9.5px var(--font-stack)}
.tzx-radar-c{font:800 9px var(--font-stack);fill:#059669;text-transform:uppercase;letter-spacing:.06em}
.tzx-radar-r{font:700 8.5px var(--font-stack);fill:var(--muted)}
.tzx-rdot{cursor:pointer;outline:none}
.tzx-rdot circle{stroke:var(--card);stroke-width:2px;transition:r .15s}
.tzx-rdot:hover circle,.tzx-rdot:focus circle{r:8}
.tzx-res-sum{margin:0;font-size:12px}
.tzx-good{color:#059669}
.tzx-res-filter{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}
.tzx-res-group{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px 10px}
.tzx-res-h{display:flex;align-items:center;gap:7px;font-size:12.5px;margin-bottom:4px}
.tzx-res-h i{width:10px;height:10px;border-radius:50%}
.tzx-res-h b{flex:1}
.tzx-res-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.tzx-res-list li{display:flex;align-items:center;gap:8px;padding:4px 2px;border-bottom:1px dashed var(--line)}
.tzx-res-list li:last-child{border-bottom:0}
.tzx-res-t{flex:1;min-width:0;font-size:12px}
.tzx-res-t small{display:block;color:var(--muted);font-size:10.5px}
.tzx-av{flex:0 0 auto;font:800 9px var(--font-stack);text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:2px 7px}
.tzx-av-free{background:var(--tz-green-soft);color:#047857}
.tzx-av-system{background:var(--soft);color:var(--blue)}
.tzx-av-add{background:var(--tz-amber-soft);color:#B45309}
.tzx-res-hint{margin:6px 0 0;font-size:11px;color:var(--muted)}
.tzx-res-add{display:flex;flex-direction:column;gap:6px}
.tzx-res-add-row{display:flex;gap:6px;flex-wrap:wrap}
.tzx-res-add-row input{flex:1 1 200px}
.tzx-res-add-row select{flex:0 1 140px;width:auto}
.tz-lens-ic-resources{background:var(--tz-green-soft);color:#059669}
.tz-lens-ic-causes{background:var(--tz-red-soft);color:#DC2626}
@container (max-width: 640px){ .tzx-res{flex-direction:column} .tzx-res-left{position:static;flex:0 0 auto;align-self:center} }
.tzx-res-win .tzx-body{container-type:inline-size}

/* ------------------------------------------------------------------ flow animation */
.tz-lens-dock{display:flex;flex-direction:column;gap:6px}
.tz-flow-btn.tz-on{background:#0891B2;border-color:#0891B2;color:#fff}
.tz-flow-btn.tz-on:hover{color:#fff}
.tzf-p{stroke:#fff;stroke-width:1.2px;filter:drop-shadow(0 0 2px rgba(59,130,246,.55))}
body.dark-mode .tzf-p{stroke:#0F172A}
.tzf-normal{fill:#3B82F6}
.tzf-excessive{fill:#1D4ED8}
.tzf-insufficient{fill:#93C5FD;opacity:.85}
.tzf-harmful{fill:#EF4444;stroke:none;filter:blur(.6px)}
.tzx-menu-h{font:800 9.5px var(--font-stack);text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:6px 10px 2px}
#trizToolsMenu{max-height:calc(100vh - 120px);overflow:auto}
