/* CogniChat — asistent peste reglementarile interne.

   Fisierul incepe cu SISTEMUL DE DESIGN: jetoanele (culoare, tipografie, spatiere,
   raze, umbre, focus) si componentele comune (butoane, campuri, comutatoare,
   insigne, stari goale / de incarcare / de eroare). Fisierele pe ecrane — sertar.css,
   date.css, analiza.css, cont.css — folosesc DOAR aceste jetoane: un buton, un tabel
   sau o insigna arata la fel oriunde apare.

   Identitatea: navy `--navy` pentru titluri si accente grave; albastrul CogniChat
   `--blue` (#0091ff) pentru marca, focus si indicatorul elementului activ. Butoanele
   pline folosesc `--primary`, acelasi albastru adus la contrast AA cu text alb
   (#0091ff pe alb are 3:1, sub pragul de lizibilitate pentru text mic).

   Suprafete, de la exterior spre interior: aplicatia (`--app`: navigatia si lista de
   conversatii), panoul de lucru alb, inset, cu colturile rotunjite; in panou,
   canvasul (`--canvas`) si cardurile albe. O singura paleta, cea din identitate; toate
   culorile trec prin jetoane, niciuna nu e scrisa direct in regulile componentelor.

   Regula de asezare: RASPUNSUL e singurul lucru care are voie sa domine ecranul.
   Navigatia, traseul deciziei, sursele si intrebarile de demo stau pliate pana cand
   cineva le cere.

   Tipografie de sistem: interfata trebuie sa porneasca air-gapped, deci nu se poate
   incarca niciun font extern. */

:root {
  color-scheme: light;

  /* identitate */
  --navy:          #1f1b4d;
  --navy-2:        #2e2a63;
  --blue:          #0091ff;   /* marca: logo, focus, indicatorul activ */
  --blue-600:      #0b6fdb;   /* text si pictograme de actiune pe alb (AA) */
  --blue-700:      #0a5cb8;
  --blue-50:       #eef6ff;
  --blue-100:      #d9ebff;
  --blue-200:      #b6d8ff;
  --primary:       #0b72e0;   /* butoane pline: text alb, contrast 4,7:1 */
  --primary-hover: #0962c4;
  --primary-press: #0853a8;

  /* suprafete si text */
  --app:         #eef1f5;     /* fundalul aplicatiei: navigatia si conversatiile */
  --canvas:      #f7f8fa;     /* sub cardurile unui ecran */
  --bg:          #f7f8fa;     /* nume vechi pentru canvas */
  --surface:     #ffffff;
  --surface-2:   #f7f8fa;     /* umpluturi discrete: antete de tabel, pliuri */
  --surface-3:   #edf0f4;     /* sine de comutatoare, schelete */
  --hover:       rgba(16, 24, 40, .05);
  --ink:         #171c28;
  --ink-2:       #444c5c;
  --muted:       #636d80;     /* contrast AA si pe `--app` */
  --faint:       #98a1b0;     /* text de ajutor in campuri, elemente dezactivate */
  --line:        #e1e5eb;
  --line-2:      #edf0f4;
  --line-strong: #cdd4de;     /* conturul campurilor si al butoanelor secundare */
  --line-hover:  #b9c2ce;
  --scroll:      #c9d0da;

  /* stari: DOAR pentru starea de verificare si pentru erori, niciodata decor */
  --ok:          #0c7a43;
  --ok-bg:       #e9f6ef;
  --ok-line:     #bfe3cd;
  --warn:        #8a5a12;
  --warn-bg:     #fdf4e2;
  --warn-line:   #f0d9ab;
  --bad:         #b42318;
  --bad-bg:      #fdeceb;
  --bad-line:    #f6c7c2;
  --bad-hover:   #97190f;
  --violet:      #5935c2;
  --violet-bg:   #f2eefe;
  --violet-line: #ddd3fb;
  --mark:        #ffe27a;
  --mark-dim:    #fdf3cd;
  --ink-inv:     #1b2030;     /* fundalul notificarilor si al etichetelor plutitoare */

  /* focus */
  --focus:       var(--blue);
  --ring:        0 0 0 3px rgba(0, 145, 255, .22);
  --ring-bad:    0 0 0 3px rgba(180, 35, 24, .15);

  /* tipografie */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-2xs: 11px;
  --fs-xs:  12px;
  --fs-sm:  13px;
  --fs-md:  14px;
  --fs-lg:  15px;
  --fs-xl:  17px;
  --fs-2xl: 20px;
  --fs-3xl: 28px;
  --lh:       1.5;
  --lh-read:  1.68;
  --lh-tight: 1.25;

  /* spatiere (grila de 4 px) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px;

  /* raze */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r: 10px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;

  /* umbre: cardurile abia se ridica; meniurile si dialogurile plutesc */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .05);
  --sh-lg: 0 16px 40px -8px rgba(16, 24, 40, .18), 0 4px 10px -4px rgba(16, 24, 40, .06);
  --sh-xl: 0 28px 64px -12px rgba(16, 24, 40, .32);
  --umbra: var(--sh-xs);

  /* controale si miscare */
  --h-xs: 24px; --h-sm: 30px; --h-md: 36px; --h-lg: 40px;
  --dur:  .14s;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* asezare */
  --rail-w:  232px;
  --conv-w:  264px;
  --bar-h:   52px;
  --col-w:   780px;     /* coloana de citire (`.col`) si casuta de intrebare */
  --gap-app: 8px;

  /* pictograme folosite de mai multe componente (SVG inline: air-gapped) */
  --ico-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636d80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --ico-cauta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
  height: 100%; margin: 0;
  background: var(--app); color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-md); line-height: var(--lh);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.num, .stats, table, .val { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--blue-100); color: var(--ink); }

/* bare de derulare discrete, aceleasi pe tot produsul */
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px;
  border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* ================================================================ componente */

/* ---- butoane. Trei feluri, aceleasi pe toate ecranele: plin (actiunea principala a
   ecranului), secundar (contur) si de pericol (ireversibil). `ui-btn` vine din
   auth.js / admin.js / analiza.js, `dm-btn` din date.js: aceleasi masuri si culori. */
.ui-btn, .dm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--h-md); padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid transparent; background: none;
  font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ui-btn:disabled, .dm-btn:disabled { opacity: .5; cursor: not-allowed; }
.ui-btn-prim, .dm-btn-prim {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(11, 114, 224, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.ui-btn-prim:hover:not(:disabled), .dm-btn-prim:hover:not(:disabled) {
  background: var(--primary-hover); border-color: var(--primary-hover); }
.ui-btn-prim:active:not(:disabled), .dm-btn-prim:active:not(:disabled) {
  background: var(--primary-press); border-color: var(--primary-press); }
.ui-btn-sec, .dm-btn-sec {
  background: var(--surface); border-color: var(--line-strong); color: var(--ink);
  box-shadow: var(--sh-xs);
}
.ui-btn-sec:hover:not(:disabled), .dm-btn-sec:hover:not(:disabled) {
  background: var(--surface-2); border-color: var(--line-hover); }
.ui-btn-pericol, .dm-btn-pericol {
  background: var(--bad); border-color: var(--bad); color: #fff;
  box-shadow: 0 1px 2px rgba(180, 35, 24, .25);
}
.ui-btn-pericol:hover:not(:disabled), .dm-btn-pericol:hover:not(:disabled) {
  background: var(--bad-hover); border-color: var(--bad-hover); }
.ui-btn-mic, .dm-btn-mic {
  height: var(--h-sm); padding: 0 11px; gap: 6px; font-size: 12.5px; border-radius: var(--r-sm); }
.ui-btn.se-incarca::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: ds-rot .7s linear infinite;
}
@keyframes ds-rot { to { transform: rotate(360deg); } }

/* ---- butoane de unealta (`mini`): in antete, bare de unelte, graf */
.mini {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 28px; padding: 0 10px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--sh-xs);
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.mini:hover { background: var(--surface-2); border-color: var(--line-hover); color: var(--ink); }
.mini[aria-pressed="true"] { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.mini[aria-pressed="false"] { color: var(--muted); }
.mini.rea { color: var(--bad); border-color: var(--bad-line); }
.mini.rea:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.mini[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- pastile (`chip`): optiuni de ales, intrebari sugerate, filtre rapide */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  padding: 5px 14px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--sh-xs);
  font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--ink); text-align: left;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.chip:hover { border-color: var(--blue); color: var(--blue-700); background: var(--blue-50); }
.chip .n { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.chip-on { border-color: var(--blue); color: var(--blue-700); background: var(--blue-50); }

/* ---- legaturi care sunt butoane */
.dm-link, .an-link {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left;
  color: var(--blue-600); font-weight: 600;
  text-decoration: underline; text-decoration-color: rgba(11, 111, 219, .3); text-underline-offset: 3px;
}
.dm-link:hover, .an-link:hover { color: var(--blue-700); text-decoration-color: currentColor; }

/* ---- campuri de text si liste derulante: acelasi contur, aceeasi inaltime, acelasi
   inel de focus pe toate ecranele */
.ui-input, .ui-select, .inline-form input, .inline-form select, .adm-cauta, .an-input,
.an-select, .dm-filtre select, .dm-filtre input[type="search"], .graf-ctrl input,
.conv-cauta input {
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background-color: var(--surface); color: var(--ink); box-shadow: var(--sh-xs);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ui-input:focus, .ui-select:focus, .inline-form input:focus, .inline-form select:focus,
.adm-cauta:focus, .an-input:focus, .an-select:focus, .dm-filtre select:focus,
.dm-filtre input[type="search"]:focus, .graf-ctrl input:focus, .conv-cauta input:focus {
  outline: none; border-color: var(--blue); box-shadow: var(--ring);
}
/* listele derulante: aceeasi sageata peste tot, nu cea a sistemului de operare */
.ui-select, .inline-form select, .an-select, .dm-filtre select {
  -webkit-appearance: none; appearance: none;
  background-image: var(--ico-chevron); background-repeat: no-repeat;
  background-position: right 9px center; background-size: 16px 16px;
}
/* cautarile au lupa in camp */
.adm-cauta, .dm-filtre input[type="search"] {
  background-image: var(--ico-cauta); background-repeat: no-repeat;
  background-position: 10px center; background-size: 15px 15px;
}

/* ---- comutatoare segmentate: moduri de analiza, sectiuni de administrare, sursa
   documentelor, vederea sursei. O sina gri si segmentul ales, alb, ridicat. */
.an-moduri, .adm-seg, .dm-seg, .sertar-vederi {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--line-2);
}
.an-mod-btn, .adm-seg button, .dm-seg-it, .vedere {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 0; border-radius: 7px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background var(--dur), color var(--dur), box-shadow var(--dur);
}
.an-mod-btn:hover, .adm-seg button:hover, .dm-seg-it:hover, .vedere:hover:not([disabled]) {
  color: var(--ink); }
.an-mod-btn.is-on, .adm-seg button[aria-selected="true"], .dm-seg-it[aria-checked="true"],
.vedere.is-on {
  background: var(--surface); color: var(--navy); box-shadow: var(--sh-sm);
}

/* ---- insigne: stare, tip, versiune. Pastila de 22 px; culoarea spune starea. */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12px; font-weight: 500; line-height: 1; color: var(--ink-2); white-space: nowrap;
}
.badge-ok      { color: var(--ok);    background: var(--ok-bg);     border-color: var(--ok-line); }
.badge-bad     { color: var(--bad);   background: var(--bad-bg);    border-color: var(--bad-line); }
.badge-neutral { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.badge-nou     { color: var(--blue-700); background: var(--blue-50); border-color: var(--blue-100);
  font-weight: 600; }

/* ---- stari: gol, se incarca, eroare */
.empty { color: var(--muted); font-size: 13.5px; }
.loading { color: var(--muted); font-size: 12.5px; }
p.loading::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 9px;
  vertical-align: -2px; border-radius: 50%;
  border: 2px solid var(--blue-100); border-top-color: var(--blue);
  animation: ds-rot .8s linear infinite;
}
.err {
  color: var(--bad); font-size: 13px; line-height: 1.5;
  background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: var(--r-md);
  padding: 10px 12px;
}
/* singurul lucru dintr-un ecran care se incarca sau e gol: centrat, cu aer */
.panel-body > .empty:only-child, .panel-body > p.loading:only-child,
.an-impact-rez > .empty:only-child {
  margin: 0; padding: 56px 16px; text-align: center;
}

/* ================================================================ cadrul aplicatiei */
.app {
  display: flex; height: 100%; overflow: hidden; position: relative;
  background: var(--app); padding: var(--gap-app) var(--gap-app) var(--gap-app) 0;
}

/* ------------------------------------------------------------ bara laterala
   Sta direct pe fundalul aplicatiei, fara chenar: e cadrul, nu continutul. Elementul
   activ e un segment alb, ridicat, cu pictograma in albastrul marcii. */
.rail {
  flex: 0 0 var(--rail-w); min-width: 0; display: flex; flex-direction: column;
  padding: 12px 10px 10px 12px; background: transparent;
}
.rail-cap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 6px 8px 20px; }
.logo { display: block; height: 24px; width: auto; }
.logo-mark { display: none; }               /* apare doar cand bara e stransa */
.rail-nume { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-it {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  height: 36px; padding: 0 10px; border-radius: var(--r-md);
  background: none; border: 1px solid transparent; color: var(--ink-2);
  transition: background var(--dur), color var(--dur);
}
/* pictograma sectiunii: o masca SVG colorata cu `currentColor` (nicio imagine externa) */
.nav-it::before {
  content: ""; flex: none; width: 18px; height: 18px; background: currentColor; opacity: .75;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.nav-it:hover { background: var(--hover); color: var(--ink); }
.nav-it.is-on {
  background: var(--surface); color: var(--navy); border-color: var(--line); box-shadow: var(--sh-xs);
}
.nav-it.is-on::before { background: var(--blue); opacity: 1; }
.nav-t { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.nav-it.is-on .nav-t { font-weight: 600; }
.nav-it[data-panel="chat"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 12a8.5 8.5 0 0 1-12.3 7.6L3.5 20.5l.9-4.4A8.5 8.5 0 1 1 20.5 12z'/%3E%3C/svg%3E"); }
.nav-it[data-panel="impact"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 3.5v17h17'/%3E%3Cpath d='M7.5 15l3.5-4 3 2.5 5-6'/%3E%3C/svg%3E"); }
.nav-it[data-panel="audit"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21.5s7.5-3.6 7.5-9.5V5.5L12 2.5 4.5 5.5V12c0 5.9 7.5 9.5 7.5 9.5z'/%3E%3Cpath d='M8.8 12.2l2.2 2.2 4.3-4.6'/%3E%3C/svg%3E"); }
.nav-it[data-panel="manifest"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5.5' rx='7.5' ry='3'/%3E%3Cpath d='M4.5 5.5v13c0 1.7 3.4 3 7.5 3s7.5-1.3 7.5-3v-13'/%3E%3Cpath d='M4.5 12c0 1.7 3.4 3 7.5 3s7.5-1.3 7.5-3'/%3E%3C/svg%3E"); }
.nav-it[data-panel="graf"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5.5' cy='6.5' r='2.5'/%3E%3Ccircle cx='18.5' cy='5.5' r='2.5'/%3E%3Ccircle cx='12' cy='18.5' r='2.5'/%3E%3Cpath d='M8 6.3l8-.6M6.8 8.7l4 7.6M17.4 7.8l-4.2 8.4'/%3E%3C/svg%3E"); }
.nav-it[data-panel="admin"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20.5a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M15.5 4.6a3.5 3.5 0 0 1 0 6.8M17.5 14.3a6.5 6.5 0 0 1 4 6.2'/%3E%3C/svg%3E"); }

/* jos: starea bazei de documente, motorul, modelul si traseul */
.rail-jos {
  margin-top: auto; padding: 12px 6px 2px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.rail-stats { font-size: 11.5px; color: var(--muted); line-height: 1.55; white-space: pre-line; }
.rail-motor { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.rail-motor b { display: block; font-size: 12px; color: var(--navy); font-weight: 650; }
.rail-butoane { display: flex; gap: 6px; }
/* Comutatorul „Pașii răspunsului": un rand de setare cu intrerupator, nu o eticheta
   „Pași: vizibili". Starea o poarta `aria-pressed` (pusa de app.js). */
.rail-butoane #traseu-btn {
  flex: 1; justify-content: space-between; height: 32px; padding: 0 8px 0 10px;
  background: transparent; border-color: transparent; box-shadow: none;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.rail-butoane #traseu-btn:hover { background: var(--hover); color: var(--ink); }
.rail-butoane #traseu-btn::after {
  content: ""; flex: none; width: 28px; height: 16px; border-radius: var(--r-full);
  background: var(--line-strong) radial-gradient(circle at 8px 50%, #fff 5.5px, transparent 6px);
  transition: background-color var(--dur) var(--ease), background-position var(--dur) var(--ease);
}
.rail-butoane #traseu-btn[aria-pressed="true"]::after {
  background: var(--primary) radial-gradient(circle at 20px 50%, #fff 5.5px, transparent 6px);
}
.rail-env { font-size: 11px; color: var(--muted); }

/* ------------------------------------------------------------ panoul de lucru
   Alb, inset, cu colturile rotunjite, pe fundalul aplicatiei. Latimea lui se citeste
   ca un container: cu sertarul de sursa deschis, panoul se ingusteaza si isi strange
   antetul, fara sa depinda de latimea ferestrei. */
.scena {
  flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-xs); container: scena / inline-size;
}
.panel { flex: 1; min-height: 0; display: none; flex-direction: column; }
.panel.is-on { display: flex; }

.thread {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 28px 28px 12px;
  display: flex; flex-direction: column; gap: 24px;
}

/* ------------------------------------------------------------ ecranul de start
   Casuta de intrebare sta in mijloc pana la prima intrebare, apoi coboara — ca la
   Claude. Firul gol cu casuta lipita de marginea de jos arata a aplicatie care
   asteapta sa fie reparata; centrata, arata a invitatie. */
.panel.is-gol { justify-content: center; }
.panel.is-gol .thread { display: none; }
.panel.is-gol .compose { padding-bottom: 0; }
.hero { display: none; text-align: center; padding: 0 24px 26px; }
.panel.is-gol .hero { display: block; }
/* marca CogniChat deasupra salutului: aceeasi ca in favicon, desenata inline */
.hero::before {
  content: ""; display: block; width: 52px; height: 52px; margin: 0 auto 20px;
  border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--sh-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%22-1%20-1%2028%2030%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M13.9432%2022.2112C9.3747%2022.2112%205.66972%2018.5076%205.66972%2013.9377C5.66972%209.36793%209.37342%205.66423%2013.9432%205.66423C14.6891%205.66423%2015.4119%205.76274%2016.0989%205.94824V0.215509C15.3966%200.105485%2014.6763%200.0491943%2013.9432%200.0491943C6.2723%200.0491943%200.0546875%206.26808%200.0546875%2013.9377C0.0546875%2021.6074%206.27358%2027.8263%2013.9432%2027.8263C14.6763%2027.8263%2015.3966%2027.77%2016.0989%2027.66V22.4313L21.5784%2016.2917C21.989%2016.5476%2022.4739%2016.6947%2022.9933%2016.6947C24.4748%2016.6947%2025.6761%2015.4934%2025.6761%2014.0119C25.6761%2012.5305%2024.4748%2011.3292%2022.9933%2011.3292C21.5118%2011.3292%2020.3105%2012.5305%2020.3105%2014.0119C20.3105%2014.667%2020.5446%2015.2657%2020.9348%2015.7314L15.2443%2022.1076C14.8209%2022.1741%2014.3859%2022.2087%2013.9432%2022.2087V22.2112Z%22%20fill%3D%22%23221D57%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M22.9933%2022.0104C24.4748%2022.0104%2025.6761%2023.2117%2025.6761%2024.6932C25.6761%2026.1746%2024.4748%2027.3759%2022.9933%2027.3759C21.5118%2027.3759%2020.3105%2026.1746%2020.3105%2024.6932C20.3105%2023.2117%2021.5118%2022.0104%2022.9933%2022.0104Z%22%20fill%3D%22%230099FF%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5187%205.64374L15.8294%2012.0187C16.0955%2012.4358%2016.2503%2012.9309%2016.2503%2013.4618C16.2503%2014.9433%2015.049%2016.1446%2013.5675%2016.1446C12.0861%2016.1446%2010.8848%2014.9433%2010.8848%2013.4618C10.8848%2011.9803%2012.0861%2010.779%2013.5675%2010.779C14.2085%2010.779%2014.797%2011.0042%2015.2576%2011.379L20.9711%204.97721C20.7421%204.58189%2020.6116%204.12388%2020.6116%203.63517C20.6116%202.1537%2021.8129%200.952393%2023.2944%200.952393C24.7759%200.952393%2025.9772%202.1537%2025.9772%203.63517C25.9772%205.11665%2024.7759%206.31796%2023.2944%206.31796C22.6138%206.31796%2021.9907%206.06337%2021.5187%205.64502V5.64374Z%22%20fill%3D%22%230099FF%22%2F%3E%3C%2Fsvg%3E") center / 30px 30px no-repeat;
}
.hero-titlu {
  margin: 0 0 8px; font-size: var(--fs-3xl); font-weight: 650; letter-spacing: -.025em;
  line-height: 1.2; color: var(--navy);
}
.hero-sub {
  margin: 0 auto; max-width: 540px; font-size: 14.5px; line-height: 1.6; color: var(--muted);
}
/* Copiii firului NU au voie sa se comprime. Fara asta, `flex-shrink: 1` (implicit)
   strange raspunsurile in inaltimea ramasa in loc sa forteze derularea. */
.thread > * { flex: 0 0 auto; }
/* Coloana de citire. Un raspuns de norma nu se citeste pe 1.400 px latime. */
.col { width: 100%; max-width: 780px; margin: 0 auto; }   /* = --col-w (casuta de intrebare) */

/* ------------------------------------------------------------ mesaje
   Intrebarea: o bula discreta, in tenta albastra a marcii — raspunsul e cel care
   trebuie sa domine, nu intrebarea. Raspunsul: un card cu un antet de stare. */
.msg-user .who { font-size: 11.5px; color: var(--muted); text-align: right; margin-bottom: 6px; }
.msg-user .bula {
  background: var(--blue-50); color: var(--ink); border: 1px solid var(--blue-100);
  border-radius: 14px 14px 4px 14px; padding: 10px 16px;
  margin-left: auto; width: fit-content; max-width: 80%;
  font-size: 14.5px; line-height: 1.55; overflow-wrap: break-word;
}

.raspuns {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 22px 20px; box-shadow: var(--sh-sm);
}
.raspuns-cap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 24px; }
/* tipul raspunsului: pastila cu punct de stare. Textul vine cu litera mica din motor;
   pe ecran incepe cu majuscula, fara sa fie strigat cu majuscule peste tot. */
.kind {
  display: inline-block; height: 24px; line-height: 22px; padding: 0 10px 0 21px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  border-radius: var(--r-full); border: 1px solid transparent;
  background-image: radial-gradient(circle at 11px 50%, currentColor 3px, transparent 3.5px);
  background-repeat: no-repeat;
}
.kind::first-letter { text-transform: uppercase; }
.kind-fact    { background-color: var(--ok-bg);   color: var(--ok);       border-color: var(--ok-line); }
.kind-clarify { background-color: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.kind-abstain { background-color: var(--warn-bg); color: var(--warn);     border-color: var(--warn-line); }
.kind-passage, .kind-impact, .kind-audit {
  background-color: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.kind-live    { background-color: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.raspuns-cap .meta { margin-left: auto; font-size: 12px; color: var(--muted); }

.answer-text { font-size: var(--fs-lg); line-height: var(--lh-read); color: var(--ink);
  overflow-wrap: break-word; }
/* iesirea motorului determinist: indentarea are sens, deci monospatiat, intr-o caseta */
.answer-text.mono {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 12px 14px; color: var(--ink);
}
.raport-scroll .answer-text.mono { background: none; border: 0; padding: 0; }
.answer-text p { margin: 0 0 12px; }
.answer-text p:last-child { margin-bottom: 0; }
.answer-text ul, .answer-text ol { margin: 0 0 12px; padding-left: 22px; }
.answer-text li { margin: 4px 0; }
.answer-text li::marker { color: var(--muted); }
.answer-text strong { font-weight: 650; color: var(--navy); }
.answer-text code {
  font-family: var(--mono); font-size: .86em; background: var(--surface-3);
  padding: 1px 5px; border-radius: var(--r-xs);
}
.answer-text.streaming::after {
  content: "▌"; color: var(--blue); margin-left: 1px;
  animation: caret 1s steps(2, start) infinite;
}
@keyframes caret { to { visibility: hidden; } }

/* trimiterea la sursa, in text: numarul citarii, apasabil */
.cite-ref {
  display: inline-block; min-width: 20px; height: 18px; padding: 0 5px; margin: 0 2px;
  text-align: center; vertical-align: 1px;
  font-size: 11px; font-weight: 650; line-height: 16px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--blue-100); border-radius: var(--r-xs);
  color: var(--blue-600); background: var(--blue-50);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.cite-ref:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.warnband { display: flex; flex-direction: column; gap: 6px; }
.warn-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 12px; font-size: 13px; line-height: 1.5; border-radius: var(--r-md);
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--ink);
}
.warn-item .wtag {
  flex: none; height: 20px; line-height: 18px; padding: 0 7px;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0;
  border-radius: var(--r-xs); border: 1px solid currentColor; color: var(--warn);
  background: var(--surface);
}
.warn-item .wtag::first-letter { text-transform: uppercase; }
.warn-item.t-divergenta, .warn-item.t-verificare { background: var(--bad-bg); border-color: var(--bad-line); }
.warn-item.t-divergenta .wtag, .warn-item.t-verificare .wtag { color: var(--bad); }
.warn-item.t-acoperire, .warn-item.t-structura { background: var(--surface-2); border-color: var(--line); }
.warn-item.t-acoperire .wtag, .warn-item.t-structura .wtag { color: var(--ink-2); }

/* randurile pliate de sub raspuns (traseul, sursele, verificarile): o singura lista cu
   separatoare, nu trei casete gri una sub alta */
.pliuri {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
}
.pliuri:empty { display: none; }
.pliuri > * + * { border-top: 1px solid var(--line-2); }
.pliu { background: var(--surface); }
.pliu > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 40px;
  padding: 8px 14px; list-style: none; font-size: 13px; color: var(--ink-2);
  transition: background var(--dur);
}
.pliu > summary::-webkit-details-marker { display: none; }
.pliu > summary::before {
  content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 0 2px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
.pliu[open] > summary::before { transform: rotate(45deg); }
.pliu > summary:hover { background: var(--surface-2); color: var(--ink); }
.pliu-et { display: inline-block; font-weight: 600; color: var(--ink); }
.pliu-et::first-letter { text-transform: uppercase; }
.pliu-n { min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pliu-corp { padding: 4px 14px 14px; }
/* de ce lista numerotata are mai multe randuri decat spune eticheta randului pliat */
.pliu-nota { margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); }

.recall {
  font-size: 12.5px; line-height: 1.55; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 10px 14px;
}
.recall b { display: block; font-size: 12px; font-weight: 650; color: var(--ink); margin-bottom: 3px; }
.recall b::first-letter { text-transform: uppercase; }

/* ------------------------------------------------------------ traseul deciziei */
/* Ce se vede aici sunt pasii pe care i-a scris motorul si actiunile pe care le-a
   facut agentul, in momentul in care s-au intamplat, trimise pe fir prin
   `GET /api/ask/stream`. Nu e o reconstructie de dupa: daca o poarta nu a rulat sau
   o unealta nu a fost chemata, randul ei nu apare. */
.traseu { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  overflow: hidden; }
/* in cardul final, traseul e primul rand din lista pliata de sub raspuns */
.pliuri > .traseu { border: 0; border-radius: 0; }
.traseu-rand { display: flex; align-items: center; min-height: 40px; }
.traseu-cap {
  flex: 1; align-self: stretch; display: flex; align-items: center; gap: 10px; min-width: 0;
  background: none; border: 0; text-align: left; padding: 8px 6px 8px 14px; color: var(--ink-2);
  transition: background var(--dur);
}
.traseu-cap:hover { background: var(--surface-2); }
.traseu-sageata { flex: none; width: 10px; font-size: 10px; color: var(--muted); text-align: center; }
.traseu-titlu {
  display: inline-block; flex: none; font-size: 13px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: var(--ink);
}
.traseu-titlu::first-letter { text-transform: uppercase; }
.traseu-contor { font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traseu-sari {
  flex: none; margin: 0 10px 0 0; height: 26px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.traseu-sari:hover { background: var(--surface-2); color: var(--ink); }
.traseu-lista { list-style: none; margin: 0; padding: 4px 0 10px;
  border-top: 1px solid var(--line-2); background: var(--surface-2); }
.traseu.plt .traseu-lista { display: none; }
/* Sageata traseului: acelasi chevron desenat ca la celelalte randuri pliate. Textul
   „▸ / ▾" pus de app.js ramane in document (cititor de ecran), dar nu se mai vede. */
.traseu-sageata { display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px; font-size: 0; }
.traseu-sageata::before {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform var(--dur) var(--ease);
}
.traseu.plt .traseu-sageata::before { transform: rotate(-45deg); margin: 0 0 0 -2px; }

/* corpul raspunsului: motivul, textul, tabelul, optiunile — cu aer intre ele (margini,
   nu flex: un buton-legatura din corp nu are voie sa se intinda pe toata latimea) */
.raspuns-corp { min-width: 0; }
.raspuns-corp > * + * { margin-top: 12px; }
/* textul complet al motorului, pliat sub clarificare */
.raspuns-corp > details > summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.raspuns-corp > details > summary::-webkit-details-marker { display: none; }
.raspuns-corp > details > summary::before {
  content: ""; width: 5px; height: 5px; margin: 0 2px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
.raspuns-corp > details[open] > summary::before { transform: rotate(45deg); }
.raspuns-corp > details[open] > summary { margin-bottom: 8px; }
.raspuns-corp > details > summary:hover { color: var(--ink); }

.pas {
  display: flex; align-items: flex-start; gap: 10px; padding: 4px 13px;
  animation: pas-intra .14s ease-out;
}
@keyframes pas-intra { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; } }
.pas-semn { flex: none; width: 14px; text-align: center; font-size: 11px;
  line-height: 1.6; font-weight: 700; }
.pas-mij { min-width: 0; flex: 1; }
.pas-sus { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pas-faza {
  flex: none; font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface); border-radius: 5px; padding: 0 6px;
}
.pas-titlu { font-size: 13px; color: var(--ink); }
.pas-ms { flex: none; font-size: 11px; color: var(--muted); line-height: 1.6; }
.pas-ok      .pas-semn { color: var(--ok); }
.pas-oprit   .pas-semn { color: var(--warn); }
.pas-oprit   .pas-titlu { font-weight: 600; }
.pas-sarit             { opacity: .58; }
.pas-sarit   .pas-semn { color: var(--muted); }
.pas-asteapta .pas-semn { color: var(--blue); }
/* rationamentul modelului: alt registru tipografic, ca sa nu se confunde nici cu
   raspunsul, nici cu actiunile */
.pas-gandire .pas-titlu { font-style: italic; color: var(--ink-2); }
.pas-actiune .pas-faza { color: var(--blue-600); border-color: var(--blue-100);
  background: var(--blue-50); }

.pas-det { margin: 3px 0 3px; }
.pas-det summary { cursor: pointer; font-size: 11.5px; color: var(--muted); list-style: none; }
.pas-det summary::before { content: "▸ "; }
.pas-det[open] summary::before { content: "▾ "; }
.pas-det summary::-webkit-details-marker { display: none; }
.pas-camp {
  margin: 5px 0 0; padding: 8px 10px; border: 1px solid var(--line-2);
  border-radius: 8px; background: var(--surface);
  display: grid; grid-template-columns: minmax(88px, max-content) 1fr; gap: 3px 12px;
  font-size: 11.5px;
}
.pas-camp dt { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.pas-camp dd { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere; }

/* gandirea in curs, deasupra raspunsului cat timp se genereaza */
.gand-viu {
  font-size: 13px; font-style: italic; color: var(--muted);
  border-left: 2px solid var(--blue-100); padding: 2px 0 2px 13px;
  max-height: 96px; overflow: hidden;
}

/* ------------------------------------------------------------ surse
   Fiecare sursa: codul reglementarii, sectiunea, insignele de verificare si citatul
   literal; dedesubt, pliata, previzualizarea blocului in document. */
.cites { display: flex; flex-direction: column; gap: 8px; }
.cite-rand { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface); }
.cite { display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 10px 12px; transition: background var(--dur); }
.cite:hover { background: var(--surface-2); }
.cite .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cite .code { font-family: var(--mono); font-size: 12px; color: var(--blue-600); font-weight: 650; }
.cite .sect { font-size: 12.5px; color: var(--muted); }
.cite .quote {
  margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--ink-2);
  border-left: 2px solid var(--line-strong); padding-left: 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sursa-prev { border-top: 1px solid var(--line-2); background: var(--surface-2); }
.sursa-prev > summary {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 7px 12px; list-style: none;
}
.sursa-prev > summary::-webkit-details-marker { display: none; }
.sursa-prev > summary::before {
  content: ""; flex: none; width: 5px; height: 5px; margin: 0 3px 0 2px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
.sursa-prev[open] > summary::before { transform: rotate(45deg); }
.sursa-prev > summary:hover .sursa-eticheta { color: var(--ink); }
.sursa-eticheta { display: inline-block; flex: none; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sursa-eticheta::first-letter { text-transform: uppercase; }
.sursa-unde { font-size: 12px; color: var(--muted); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sursa-corp { padding: 2px 12px 12px; }
.sursa-cap { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; padding-bottom: 8px; }
.sursa-cap .code { font-family: var(--mono); font-size: 12px; color: var(--blue-600); font-weight: 650; }
.sursa-titlu { font-size: 12.5px; color: var(--ink-2); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sursa-poz { font-size: 12px; color: var(--muted); margin-left: auto; }
.sursa-flux {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  padding: 10px 12px;
}
.sursa-linie { font-size: 13px; line-height: 1.55; color: var(--ink-2); padding: 2px 0; white-space: pre-wrap; }
.sursa-linie.on {
  color: var(--ink); background: var(--blue-50);
  border-left: 3px solid var(--blue); padding: 6px 10px; margin: 5px -6px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.sursa-actiuni { display: flex; align-items: center; gap: 12px; padding-top: 10px; }
.sursa-cale { font-size: 11.5px; color: var(--muted); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; }

/* ------------------------------------------------------------ clarificare
   De ce intreaba asistentul, variantele gasite in norme si optiunile de ales. */
.why {
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--r-md);
  padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: var(--ink);
}
.why b, .why-label { display: block; font-size: 12px; font-weight: 650; letter-spacing: 0;
  text-transform: none; color: var(--blue-700); margin-bottom: 4px; }
.why b::first-letter, .why-label::first-letter { text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* optiunile de clarificare: pastile ceva mai mari decat cele de filtrare */
.chips > .chip { min-height: 34px; padding: 6px 16px; font-size: 13.5px; }
.variants-box { overflow-x: auto; }
table.variants { width: 100%; border-collapse: collapse; font-size: 13px; margin: 2px 0; }
table.variants th, table.variants td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top;
}
table.variants th { font-size: 12px; letter-spacing: 0;
  color: var(--muted); font-weight: 600; white-space: nowrap;
  background: var(--surface-2); border-bottom-color: var(--line); }
table.variants tbody tr:hover td { background: var(--surface-2); }
table.variants td.val { font-weight: 650; white-space: nowrap; color: var(--navy); }
table.variants td.val-lung {
  white-space: normal; font-weight: 650; max-width: 46ch; min-width: 24ch;
  overflow-wrap: anywhere; color: var(--navy);
}
/* Valoarea e rubrica pentru care s-a deschis tabelul; conditia e contextul ei. Fara
   plafonul de mai jos, auto-layout-ul dadea „Condiție" 237 px si „Valoare" 186 px. */
table.variants td:nth-child(4) { max-width: 30ch; overflow-wrap: anywhere; }
.val-mai-mult { margin-left: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.variants-nota { font-size: 12px; color: var(--muted); padding: 6px 12px 0; }

/* abtinerea e un rezultat legitim, nu o eroare: chihlimbar, nu rosu */
.abstain-box { border: 1px solid var(--warn-line); background: var(--warn-bg);
  border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; line-height: 1.55; }
.abstain-box b { display: block; font-size: 12px; font-weight: 650; letter-spacing: 0;
  text-transform: none; color: var(--warn); margin-bottom: 4px; }
.abstain-box b::first-letter { text-transform: uppercase; }
.abstain-box .file, .abstain-box .cale { font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-2); margin-top: 7px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ compunere
   Casuta de intrebare: campul, atasarea unei imagini (context) si trimiterea. Ridicata
   deasupra firului, cu inelul de focus al produsului. */
.compose { padding: 8px 28px 18px; }
.compose > * { max-width: var(--col-w); margin-left: auto; margin-right: auto; }
.compose-box {
  display: flex; gap: 6px; align-items: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 6px 6px 6px 6px; box-shadow: var(--sh-md);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.compose-box:focus-within { border-color: var(--blue); box-shadow: var(--ring), var(--sh-md); }
.compose-box input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font-size: 15px; padding: 9px 4px; color: var(--ink);
}
.compose-box input::placeholder { color: var(--muted); }
.compose-box button[type="submit"] {
  flex: none; height: 38px; padding: 0 18px; border: 0; border-radius: var(--r);
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(11, 114, 224, .3), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background var(--dur);
}
.compose-box button[type="submit"]:hover { background: var(--primary-hover); }
.compose-box button[type="submit"]:disabled {
  background: var(--surface-3); color: var(--faint); box-shadow: none; cursor: not-allowed; }
/* Zona de drop. Nu e un dreptunghi punctat permanent pe ecran — apare doar cat timp
   ceva e tras deasupra, si atunci trebuie sa fie imposibil de ratat: caseta se coloreaza
   toata si spune, in acelasi timp, ce accepta si ce se intampla cu fisierul. */
.compose-box.is-drop { border-color: var(--blue); background: var(--blue-50);
  box-shadow: 0 0 0 3px var(--blue-100); }
.compose-box.is-drop::after {
  content: "Imaginea se atașează ca context (.png, .jpg, .webp, .gif) și nu devine sursă citabilă";
  position: absolute; left: 0; right: 0; bottom: calc(100% + 7px);
  font-size: 11.5px; color: var(--blue-600); text-align: center; font-weight: 600;
}
.compose-box { position: relative; }

.atas-btn {
  flex: none; width: 34px; height: 34px; border-radius: var(--r-md); padding: 0;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 20px; font-weight: 400; line-height: 1;
  transition: background var(--dur), color var(--dur);
}
.atas-btn:hover { background: var(--surface-3); color: var(--ink); }

/* Miniaturile de deasupra casetei. `--warn` si nu `--blue`: culoarea de actiune ar
   spune „e gata, e in sistem", si exact asta NU s-a intamplat. */
.atas { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start;
  padding: 0 4px 10px; }
.atas-card { display: flex; gap: 9px; align-items: center; max-width: 340px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r-md);
  padding: 6px 9px 6px 6px; }
.atas-card img { width: 46px; height: 46px; object-fit: cover; border-radius: var(--r-sm);
  background: var(--surface-3); flex: none; }
.atas-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.atas-nume { font-size: 12px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atas-rol { font-size: 11.5px; letter-spacing: 0;
  color: var(--warn); font-weight: 650; }
.atas-dim { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.atas-scoate { flex: none; width: 24px; height: 24px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--muted); font-size: 15px; line-height: 1; padding: 0; }
.atas-scoate:hover { color: var(--bad); background: var(--bad-bg); }
.atas-eroare { flex-basis: 100%; font-size: 12px; color: var(--bad);
  background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: var(--r-md);
  padding: 7px 10px; }
.atas-eroare b { color: var(--bad); }

/* Aceeasi eticheta, in firul conversatiei: dupa ce intrebarea a plecat, cine reciteste
   firul trebuie sa vada ca raspunsul a avut in fata o imagine adusa de utilizator. */
.msg-user .atas-fir { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.msg-user .atas-fir img { width: 88px; border-radius: var(--r-md); display: block;
  border: 1px solid var(--line); }
.atas-nota { font-size: 12px; color: var(--ink-2); background: var(--warn-bg);
  border-left: 3px solid var(--warn); border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 7px 10px; margin: 8px 0 0; }
.atas-nota b { color: var(--warn); }

.compose-jos { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; }
/* legaturile din text care sunt butoane (intrebarile de demo, „vezi…") */
.linkish {
  background: none; border: 0; padding: 0; font-size: 12.5px; font-weight: 500;
  color: var(--blue-600); text-decoration: underline; text-decoration-color: rgba(11, 111, 219, .3);
  text-underline-offset: 3px;
}
.linkish:hover { color: var(--blue-700); text-decoration-color: currentColor; }
.hints-contor { font-size: 12px; color: var(--muted); }
.hints { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.hints .chip { min-height: 30px; padding: 4px 12px; font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
.slotbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding-bottom: 10px; font-size: 12px; color: var(--muted); }
.slotbar .chip { min-height: 28px; padding: 3px 11px; font-size: 12px; }

/* ------------------------------------------------------------ sertarul de sursa
   Al doilea panou inset, alaturi de cel de lucru. Antetul are aceeasi inaltime ca bara
   de sus, deci liniile de sub cele doua antete se continua una pe alta. */
.gutter { flex: 0 0 var(--gap-app); position: relative; cursor: col-resize; background: transparent; }
.gutter::after {
  content: ""; position: absolute; top: 12px; bottom: 12px; left: 50%; width: 2px; margin-left: -1px;
  border-radius: 2px; background: var(--blue); opacity: 0; transition: opacity var(--dur);
}
.gutter:hover::after, .gutter:focus-visible::after, .gutter:active::after { opacity: 1; }
.gutter:focus-visible { outline: none; }
.sertar {
  flex: 0 0 var(--sertar-w, 620px); min-width: 340px; max-width: 68vw;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}
.sertar-cap {
  flex: none; display: flex; align-items: center; gap: 10px; height: var(--bar-h);
  padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.sertar-titlu { font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.sertar-cap .mini { margin-left: auto; }
.sertar-vederi { padding: 2px; }
.vedere { height: 26px; padding: 0 10px; font-size: 12.5px; }

.doc-head { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.doc-empty h2 { margin: 4px 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.doc-empty p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.doc-body { flex: 1; overflow-y: auto; padding: 14px 16px 40px; }

.doc-title { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.doc-title .code { font-family: var(--mono); font-size: 13px; color: var(--blue-600); font-weight: 650; }
.doc-title h2 { margin: 0; font-size: 15px; font-weight: 650; color: var(--navy); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px;
  color: var(--muted); margin-top: 8px; }
.doc-meta b { color: var(--ink-2); font-weight: 600; }
.doc-meta .path { font-family: var(--mono); font-size: 11px; flex-basis: 100%;
  overflow-wrap: anywhere; color: var(--muted); }
/* starea conversiei documentului: stampila mica, majuscule, ca pe un dosar */
.st { display: inline-block; height: 20px; line-height: 18px; padding: 0 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  border-radius: var(--r-xs); border: 1px solid currentColor; }
.st::first-letter { text-transform: uppercase; }
.st-convertit { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.st-criptat { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.st-format_nesuportat { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.crumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
  font-size: 12.5px; color: var(--ink-2); margin-top: 9px; }
.crumb .sep { color: var(--faint); }
.doc-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.doc-tools button {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); box-shadow: var(--sh-xs);
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.doc-tools button:hover { background: var(--surface-2); border-color: var(--line-hover); color: var(--ink); }

.blk { font-size: 13.5px; line-height: 1.65; padding: 3px 0; white-space: pre-wrap;
  color: var(--ink-2); }
.blk-heading { font-weight: 650; margin-top: 14px; color: var(--navy); }
.blk-row { color: var(--ink-2); }
.blk-missing { color: var(--muted); font-style: italic; }
.blk-focus {
  border: 2px solid var(--blue); border-radius: 11px; padding: 12px 14px;
  margin: 12px 0; background: var(--blue-50); color: var(--ink);
}
.focus-tag { font-size: 12px; font-weight: 650; letter-spacing: 0;
  color: var(--blue-700); display: block; margin-bottom: 7px; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
mark.dim { background: var(--mark-dim); }
.tbl-wrap { overflow-x: auto; margin: 9px 0; }
.tbl-wrap table { border-collapse: collapse; font-size: 12.5px; }
.tbl-wrap th, .tbl-wrap td { border: 1px solid var(--line); padding: 6px 9px;
  text-align: left; vertical-align: top; }
.tbl-wrap th { background: var(--surface-2); font-weight: 650; }
.tree { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 9px; }
.tree-h { font-size: 12px; font-weight: 650; letter-spacing: 0;
  color: var(--ink-2); display: block; margin-bottom: 7px; }
.nod { font-size: 12.5px; padding: 2px 0; color: var(--ink-2); }
.nod .tag, .tree .tag {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
  padding: 0 6px; margin-right: 8px;
}
.tree ul { margin: 0; padding-left: 18px; list-style: none; }
.tree li { font-size: 12.5px; padding: 2px 0; color: var(--ink-2); }
.fapte-bloc { margin-top: 10px; }
.fapte-bloc .lbl { font-size: 12px; font-weight: 650; letter-spacing: 0;
  color: var(--ink-2); display: block; margin-bottom: 6px; }

/* ------------------------------------------------------------ ecranele secundare
   Acelasi antet peste tot: titlul ecranului, o propozitie despre ce face si, dedesubt,
   uneltele (filtre, cautare, actiuni). Continutul sta pe canvas, in carduri. */
.panel-head { flex: none; padding: 22px 28px 18px; border-bottom: 1px solid var(--line);
  background: var(--surface); }
.panel-head h2 { margin: 0 0 6px; font-size: var(--fs-2xl); font-weight: 650; line-height: 1.3;
  letter-spacing: -.018em; color: var(--navy); }
.panel-head .sub { font-size: 13px; font-weight: 400; color: var(--muted); }
.lede { margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); max-width: 80ch; }
.panel-body { flex: 1; overflow-y: auto; padding: 20px 28px 48px; background: var(--canvas); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* conturul si focusul vin din componente; fara `background` prescurtat (sageata listei) */
.inline-form input, .inline-form select {
  height: var(--h-md); padding: 0 12px; font-size: 13.5px; min-width: 150px;
}
.inline-form select { padding-right: 32px; }
.inline-form button {
  height: var(--h-md); padding: 0 16px; border: 1px solid var(--primary); border-radius: var(--r-md);
  background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(11, 114, 224, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background var(--dur), border-color var(--dur);
}
.inline-form button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; box-shadow: var(--sh-xs); }
.card-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.card-head .meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.card-body { padding: 14px 16px; }
.card-body > details { margin-top: 10px; }
.card-body > details summary { cursor: pointer; color: var(--ink-2); font-size: 12.5px; }

.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid th { font-size: 12px; letter-spacing: 0;
  color: var(--muted); font-weight: 600; white-space: nowrap;
  background: var(--surface-2); border-bottom-color: var(--line); }
.grid .code { font-family: var(--mono); font-size: 11.5px; color: var(--blue-600); font-weight: 650; }
.linkable { cursor: pointer; }
.linkable:hover { background: var(--blue-50); }

/* ------------------------------------------------------------ analiza de impact
   Trei straturi cu regim de adevar DIFERIT, deci trei carduri diferite: verde =
   fapte cu citat verificat, chihlimbar = potriviri lexicale de confirmat, gri = ce
   nu se acopera. Pana aici erau trei liste `ul` fara stil, una sub alta, si nimic
   pe ecran nu spunea ca al doilea strat NU e un raspuns. */
.strat {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  margin-bottom: 14px; overflow: hidden; box-shadow: var(--sh-xs);
}
.strat > h3 {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  font-size: 13.5px; font-weight: 650; letter-spacing: 0; color: var(--navy);
}
.strat > h3 .cnt { font-size: 12.5px; font-weight: 600; color: inherit; opacity: .8; letter-spacing: 0; }
.strat > h3 .sub {
  flex: 1 1 100%; font-size: 12.5px; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--ink-2);
}
.strat-sigur > h3      { background: var(--ok-bg);     color: var(--ok);    border-bottom-color: var(--ok-line); }
.strat-probabil > h3   { background: var(--warn-bg);   color: var(--warn);  border-bottom-color: var(--warn-line); }
.strat-neacoperit > h3 { background: var(--surface-2); color: var(--ink-2); }
.strat ul { list-style: none; margin: 0; padding: 4px 0; max-height: 460px; overflow-y: auto; }
.strat li {
  padding: 11px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px;
  display: flex; flex-direction: column; gap: 5px;
}
.strat li:last-child { border-bottom: 0; }
.strat li:hover { background: var(--surface-2); }
.strat li.empty { color: var(--muted); }
.strat li .code { font-family: var(--mono); font-size: 11.5px; color: var(--blue-600);
  font-weight: 650; }
.strat li .dovada { font-size: 12px; color: var(--muted); }
.strat li .quote {
  font-size: 12.5px; line-height: 1.55; color: var(--ink-2);
  border-left: 2px solid var(--line-strong); padding-left: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.strat-cap { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.strat-n { font-size: 12px; color: var(--muted); }
/* raportul lung al motorului, in propria caseta derulabila (caseta e aici, nu pe text) */
.raport-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-2); }
.rand { display: flex; gap: 10px; align-items: baseline; padding: 7px 0;
  border-bottom: 1px solid var(--line-2); font-size: 13px; }
.rand:last-child { border-bottom: 0; }
.rand .code { font-family: var(--mono); font-size: 11.5px; color: var(--blue-600);
  font-weight: 650; flex: none; }
.rand .txt { min-width: 0; }
/* severitatea unei alerte de audit: stampila mica, majuscule, ca pe un dosar */
.sev { display: inline-block; height: 22px; line-height: 20px; padding: 0 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  border-radius: var(--r-full); border: 1px solid currentColor; flex: none; }
.sev::first-letter { text-transform: uppercase; }
/* Valorile vin din `Divergenta.severitate`: `reala`, `de_verificat`, `zgomot`.
   Clasele scrise pe scurt (`sev-real`, `sev-verificat`) nu se potriveau cu niciuna,
   deci toate alertele aparaeu la fel — inclusiv cele 23 reale, care sunt exact cele
   ce trebuie sa iasa din pagina. */
.sev-reala, .sev-real { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.sev-de_verificat, .sev-verificat { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.sev-zgomot, .sev-zgomot_identificat { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.div-head { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.div-body { margin-top: 7px; }
.div-item { padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.div-item:last-child { border-bottom: 0; }
.dovada { font-size: 12px; color: var(--muted); margin-top: 5px; }
.diff, .dif { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; white-space: pre-wrap;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 8px 10px; margin-top: 7px; }
.diff ins, .dif ins { background: var(--ok-bg); color: var(--ok); text-decoration: none; }
.diff del, .dif del { background: var(--bad-bg); color: var(--bad); }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar .lbl { flex: 0 0 190px; color: var(--ink-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.bar .c { flex: 1; height: 8px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.bar .c > i { display: block; height: 100%; background: var(--blue); border-radius: var(--r-full); }
.bar .cnt { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.legend { font-size: 12px; color: var(--muted); margin-top: 10px; }
.sum { font-size: 12.5px; color: var(--ink-2); }
.file { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .pas { animation: none; }
  .answer-text.streaming::after { animation: none; }
  p.loading::before, .ui-btn.se-incarca::before { animation-duration: 2.4s; }
  * { transition-duration: 0s !important; }
}

/* Cat timp agentul lucreaza, traseul creste — 14 pasi pe o intrebare cu doua produse.
   Fara plafon, lista impinge casuta de intrebare afara din ecran si utilizatorul
   deruleaza dupa propriul cursor. Dupa raspuns panoul se plieaza si plafonul dispare. */
.card-live .traseu-lista { max-height: 300px; overflow-y: auto; }
.card-live .answer-text { min-height: 1.6em; }

/* Ecranele inguste (bara laterala stransa, sertarul peste panou) sunt la sfarsitul
   fisierului, dupa toate componentele pe care le ajusteaza. */

.gand-et { font-size: 11.5px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: var(--muted); margin-bottom: 4px; font-style: normal; }
.gand-et::first-letter { text-transform: uppercase; }
.gand-txt { max-height: 78px; overflow: hidden; }

/* ------------------------------------------------------------ vizualizatorul de document
   Textul extras dovedeste ce scrie in norma; documentul randat arata cum arata norma.
   Amandoua peste acelasi bloc citat, comutabile din antetul sertarului (comutatorul
   segmentat din componente). */
.doc-pdf { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pdf-bara {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface-2);
}
.pdf-poz { font-size: 12.5px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pdf-nota { font-size: 12px; color: var(--muted); min-width: 0; flex: 1; }
.pdf-nota.aprox { color: var(--warn); }
.pdf-bara .mini { flex: none; text-decoration: none; }
.pdf-cadru { flex: 1; width: 100%; border: 0; background: var(--surface-3); min-height: 0; }

/* ------------------------------------------------------------ acordeon (audit)
   O problema = un rand inchis. Deschis, arata rezumatul, dovada, diferenta si
   sursele. Inainte, cele 60 de alerte se desfasurau simultan si panoul devenea un
   perete de text din care nu se putea alege nimic. */
.acord {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  margin-bottom: 8px; overflow: hidden; box-shadow: var(--sh-xs);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.acord:hover { border-color: var(--line-hover); }
.acord[open] { box-shadow: var(--sh-sm); border-color: var(--line-hover); }
.acord-cap {
  display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px;
  padding: 9px 14px; list-style: none;
}
.acord-cap::-webkit-details-marker { display: none; }
.acord-cap:hover { background: var(--surface-2); }
.acord[open] .acord-cap { border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
/* sageata: chevron desenat, ca la toate randurile pliate (textul din app.js nu se vede) */
.acord-sageata { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px; font-size: 0; }
.acord-sageata::before {
  content: ""; width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
.acord[open] .acord-sageata::before { transform: rotate(45deg); margin-top: -3px; }
.acord-tip {
  flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-full);
}
.acord-cheie {
  min-width: 0; font-size: 13.5px; color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acord-corp { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.acord-rez { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.acord-dovada {
  font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 10px 12px; line-height: 1.55;
}
.acord-dovada b {
  display: block; font-size: 12px; font-weight: 650; text-transform: none; letter-spacing: 0;
  color: var(--ink); margin-bottom: 3px;
}
.acord-dovada b::first-letter { text-transform: uppercase; }
.acord-et {
  font-size: 12.5px; font-weight: 650; letter-spacing: 0; color: var(--ink-2);
}
.acord-et::first-letter { text-transform: uppercase; }
.acord-surse { display: flex; flex-direction: column; gap: 6px; }
.src-row {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 12.5px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
}
.src-row .code { font-family: var(--mono); font-size: 11.5px; color: var(--blue-600);
  font-weight: 650; flex: none; }
.src-row .sect { color: var(--muted); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-row .spacer { flex: 1; }
.diff .d-a { background: var(--bad-bg); color: var(--bad); }
.diff .d-b { background: var(--ok-bg); color: var(--ok); }

/* ------------------------------------------------------------ graful de citari
   Retea cu asezare prin forte, in registrul browserului Neo4j: culoarea nodului spune
   ce TIP de reglementare e, muchia are sageata si tipul relatiei, iar panoul din
   dreapta arata proprietatile entitatii selectate si relatiile ei.

   Simularea e semintata determinist si se opreste dupa un numar fix de pasi: un graf
   care tremura la nesfarsit consuma bateria si nu adauga nimic, iar doua incarcari ale
   aceleiasi intrebari trebuie sa dea acelasi desen. */
.graf-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.graf-ctrl input { height: var(--h-md); padding: 0 12px; font-size: 13.5px; min-width: 280px; }
.graf-cifre { font-size: 12.5px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

.graf-scena { display: flex; gap: 12px; align-items: stretch; margin-bottom: 14px; }
.graf-panza {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 6px 8px 4px; box-shadow: var(--sh-xs);
}
.graf-svg { width: 100%; height: auto; display: block; touch-action: none; }

.muchie { stroke: var(--line); stroke-width: 1.4; }
.muchie.m-anexa_partajata { stroke-dasharray: 4 3; }
.muchie.on { stroke: var(--blue); stroke-width: 2.2; }
.sageata-varf { fill: var(--line-strong); }
.muchie-et {
  font-size: 8.5px; fill: var(--muted); text-anchor: middle;
  pointer-events: none; opacity: 0;
}
.muchie-et.on { opacity: 1; fill: var(--blue-600); }

.nod-g { cursor: grab; }
.nod-g:active { cursor: grabbing; }
.nod-g circle { stroke: var(--surface); stroke-width: 2; }
.nod-g:hover circle { stroke: var(--navy); }
.nod-g.sel circle { stroke: var(--navy); stroke-width: 3.5; }
.nod-et {
  font-family: var(--mono); font-size: 10px; fill: var(--ink); font-weight: 700;
  pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px;
  stroke-linejoin: round;
}
.nod-g.sel .nod-et { fill: var(--navy); font-size: 11.5px; }
.graf-leg { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 6px 4px; }
.graf-leg-it { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.graf-leg-ajutor { font-size: 12px; color: var(--muted); margin-left: auto; }
.pastila { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* panoul de proprietati: ce ESTE entitatea si CUM e legata */
.graf-info {
  flex: 0 0 300px; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 16px; overflow-y: auto; max-height: 660px; box-shadow: var(--sh-xs);
}
.gi-cap { display: flex; align-items: center; gap: 8px; }
.gi-cod { font-family: var(--mono); font-size: 15px; font-weight: 650; color: var(--navy); }
.gi-tip { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.gi-tip::first-letter { text-transform: uppercase; }
.gi-titlu { font-size: 13px; color: var(--ink); line-height: 1.5; }
.gi-prop {
  margin: 4px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px;
  font-size: 12.5px;
}
.gi-prop dt { color: var(--muted); }
.gi-prop dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.gi-et { font-size: 12.5px; font-weight: 650; letter-spacing: 0;
  color: var(--ink-2); margin-top: 6px; }
.gi-et::first-letter { text-transform: uppercase; }
.gi-rel { display: flex; flex-direction: column; gap: 4px; }
.gi-rel-it {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 7px 10px; font-size: 12px; transition: background var(--dur), border-color var(--dur);
}
.gi-rel-it:hover { border-color: var(--blue-100); background: var(--blue-50); }
.gi-dir { color: var(--blue-600); font-weight: 700; flex: none; }
.gi-motiv { color: var(--muted); font-size: 11.5px; flex: none; }
.gi-rel-it .code { font-family: var(--mono); font-size: 11.5px; color: var(--navy);
  font-weight: 650; margin-left: auto; }
.gi-dovada { font-size: 11.5px; color: var(--muted); padding: 0 10px 4px; line-height: 1.45; }

/* panou de lucru ingust (fereastra mica sau sertarul deschis): proprietatile sub graf */
@container scena (max-width: 1000px) {
  .graf-scena { flex-direction: column; }
  .graf-info { flex: 1 1 auto; max-height: none; }
}

/* capturi de ecran puse de agent IN raspuns */
.fig { margin: 14px 0; display: flex; flex-direction: column; gap: 7px; }
.fig-img {
  display: block; border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-2);
}
.fig-img:hover { border-color: var(--blue); }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; font-size: 12px;
  color: var(--muted);
}
.fig figcaption .code { font-family: var(--mono); color: var(--blue-600); font-weight: 650; }
.fig-sect { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* adaugarea de date, in Data management */
.incarcare { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 12px; }
/* `mini rea` (pericol) si `mini[disabled]` sunt in componentele de la inceputul fisierului.
   Ecranul Data management isi are stilul in date.css. Regulile vechiului ecran
   (.man-adaugat, .man-act, .dm-bara, .btn-primar, .chip-adaugat, .incarcare-stare) nu mai
   aveau niciun element pe care sa se aplice si au fost scoase. */

/* ------------------------------------------------------------ comparatia din audit
   Doua coloane, nu un text in care bucatile celor doua surse se intercaleaza. Ce e
   identic ramane gri; ochiul cade pe ce difera. */
.comp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comp-col {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.comp-cap { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comp-cap .code { font-family: var(--mono); font-size: 12px; color: var(--blue-600);
  font-weight: 650; }
.comp-titlu { font-size: 12px; color: var(--muted); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comp-val {
  font-size: 15px; font-weight: 650; color: var(--navy);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 6px 10px;
}
.comp-txt {
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
  border-left: 2px solid var(--line); padding-left: 10px;
  max-height: 190px; overflow-y: auto; white-space: pre-wrap;
}
.comp-dif { background: var(--mark); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.comp-a .comp-dif { background: #ffd9d6; }
.comp-b .comp-dif { background: #cdf0dc; }
.comp-jos { display: flex; align-items: center; gap: 8px; margin-top: auto; }
@container scena (max-width: 760px) { .comp { grid-template-columns: 1fr; } }

/* zoom si deplasare pe panza grafului */
.graf-zoom { display: flex; align-items: center; gap: 6px; padding: 4px 2px 8px; }
.graf-zoom .mini { min-width: 30px; padding: 0 9px; }
.graf-zoom-et { font-size: 12px; color: var(--muted); min-width: 42px; text-align: center;
  font-variant-numeric: tabular-nums; }
.graf-svg { cursor: grab; }
.graf-svg.se-trage { cursor: grabbing; }
.graf-sub { font-size: 12px; color: var(--muted); padding: 2px 6px 6px; }
.graf-zoom-ajutor { font-size: 12px; color: var(--muted); margin-left: auto; }

/* Efectul ultimei schimbari din Data management, in Audit.

   O alerta noua trebuie sa se vada fara sa fie cautata: un document adaugat care
   contrazice norma isi produce alertele intr-o lista de peste 100 de linii.
   (`chip-on` si `badge-nou` sunt in componente.) */
.audit-noi { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.acord-nou { border-left: 3px solid var(--blue); }

/* ---------------------------------------------------------------- selector de model

   Popover-ul si submeniul traiesc pe `body`, nu in bara laterala: bara are overflow
   propriu si le-ar taia. De aceea pozitionarea e `fixed`, calculata din
   `getBoundingClientRect()` la deschidere. */
.model-slot { margin: 0; }
.model-trig {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 32px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 0 10px; font-size: 12.5px; color: var(--ink-2); text-align: left; box-shadow: var(--sh-xs);
  transition: border-color var(--dur), background var(--dur);
}
.model-trig:hover { border-color: var(--line-hover); background: var(--surface-2); }
.model-nume { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; color: var(--ink); }
.model-sag { color: var(--muted); font-size: 10px; }

.model-pop, .model-sub {
  position: fixed; z-index: 60; min-width: 232px; max-width: 300px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 6px; box-shadow: var(--sh-lg);
}
.model-sub-cap {
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  color: var(--muted); padding: 6px 10px;
}
.model-it {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; border-radius: var(--r-md); padding: 7px 10px; text-align: left;
}
.model-it:hover:not(:disabled) { background: var(--surface-2); }
.model-it-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.model-it-nume { font-size: 13px; color: var(--ink); font-weight: 600; }
.model-it-desc { font-size: 11.5px; color: var(--muted); }
/* Dezactivat, dar CITIBIL: un furnizor sters pana la ilizibil nu mai spune nimic. */
.model-it.este-off { opacity: .45; cursor: default; }
.model-it.este-off .model-it-nume { font-weight: 500; }
.model-bif { color: var(--blue); font-size: 12px; }
.model-sag-dr { color: var(--muted); font-size: 13px; }
.model-off-nota {
  font-size: 11.5px; color: var(--muted); padding: 6px 10px 4px;
  border-top: 1px solid var(--line-2); margin-top: 4px;
}

/* Nota nivelului de fisiere din graf. */
.graf-nivel {
  font-size: 12px; color: var(--muted); margin: 2px 0 10px;
  padding: 8px 12px; background: var(--surface-2); border-radius: var(--r-md);
  border-left: 3px solid var(--line-strong);
}

/* Butonul plin dezactivat (de ex. „Genereaza analiza" fara model): gri si citibil, nu un
   albastru stins care pare inca apasabil. */
.ui-btn-prim:disabled, .dm-btn-prim:disabled {
  opacity: 1; background: var(--surface-3); border-color: var(--line); color: var(--faint);
  box-shadow: none;
}

/* ================================================================ ecrane inguste
   1440 si mai lat: totul alaturi. Pana la 1280 si 1180, bara laterala si lista de
   conversatii se ingusteaza. Cu sertarul de sursa deschis sub 1280, bara laterala se
   strange la pictograme (eticheta apare la trecerea mouse-ului), ca raspunsul si sursa
   sa incapa alaturi. Sub 880 (tableta), bara ramane stransa, iar lista de conversatii
   si sertarul trec peste panou. */
@media (max-width: 1280px) {
  :root { --rail-w: 216px; --conv-w: 248px; }
  .sertar { flex-basis: min(var(--sertar-w, 620px), 52vw); }
}
@media (max-width: 1180px) {
  :root { --rail-w: 196px; --conv-w: 232px; }
  .panel-head { padding-left: 24px; padding-right: 24px; }
  .panel-body { padding-left: 24px; padding-right: 24px; }
  .thread { padding-left: 22px; padding-right: 22px; }
  .compose { padding-left: 22px; padding-right: 22px; }
}
/* bara laterala stransa: cu sertarul deschis pe ecrane medii */
@media (max-width: 1280px) {
  .app:has(> .sertar:not([hidden])) .rail { flex-basis: 64px; padding: 12px 8px 10px; align-items: center; }
  .app:has(> .sertar:not([hidden])) .rail-cap { align-items: center; padding: 4px 0 16px; }
  .app:has(> .sertar:not([hidden])) .logo,
  .app:has(> .sertar:not([hidden])) .rail-nume { display: none; }
  .app:has(> .sertar:not([hidden])) .logo-mark { display: block; width: 28px; height: 28px; }
  .app:has(> .sertar:not([hidden])) .nav { align-items: center; }
  .app:has(> .sertar:not([hidden])) .nav-it { width: 44px; height: 40px; padding: 0; justify-content: center; gap: 0; }
  .app:has(> .sertar:not([hidden])) .nav-it::before { width: 20px; height: 20px; }
  .app:has(> .sertar:not([hidden])) .nav-t {
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); z-index: 80;
    padding: 5px 9px; border-radius: var(--r-sm); background: var(--ink-inv); color: #fff;
    font-size: 12px; font-weight: 500; box-shadow: var(--sh-md);
    opacity: 0; pointer-events: none; transition: opacity var(--dur);
  }
  .app:has(> .sertar:not([hidden])) .nav-it:hover .nav-t,
  .app:has(> .sertar:not([hidden])) .nav-it:focus-visible .nav-t { opacity: 1; }
  .app:has(> .sertar:not([hidden])) .rail-stats,
  .app:has(> .sertar:not([hidden])) .rail-motor,
  .app:has(> .sertar:not([hidden])) .model-slot { display: none; }
  .app:has(> .sertar:not([hidden])) .rail-jos { padding: 10px 0 0; align-items: center; }
  .app:has(> .sertar:not([hidden])) .rail-butoane .mini {
    width: 48px; height: auto; min-height: 28px; padding: 3px 4px;
    font-size: 10.5px; line-height: 1.2; white-space: normal; text-align: center; }
  /* stransa: doar intrerupatorul; eticheta ramane in `title` si pentru cititorul de ecran */
  .app:has(> .sertar:not([hidden])) .rail-butoane #traseu-btn {
    width: 44px; min-height: 32px; padding: 0; justify-content: center; font-size: 0; }
}
/* tableta: bara stransa mereu, lista de conversatii si sertarul plutesc peste panou */
@media (max-width: 880px) {
  .rail { flex-basis: 64px; padding: 12px 8px 10px; align-items: center; }
  .rail-cap { align-items: center; padding: 4px 0 16px; }
  .logo, .rail-nume { display: none; }
  .logo-mark { display: block; width: 28px; height: 28px; }
  .nav { align-items: center; }
  .nav-it { width: 44px; height: 40px; padding: 0; justify-content: center; gap: 0; }
  .nav-it::before { width: 20px; height: 20px; }
  .nav-t {
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); z-index: 80;
    padding: 5px 9px; border-radius: var(--r-sm); background: var(--ink-inv); color: #fff;
    font-size: 12px; font-weight: 500; box-shadow: var(--sh-md);
    opacity: 0; pointer-events: none; transition: opacity var(--dur);
  }
  .nav-it:hover .nav-t, .nav-it:focus-visible .nav-t { opacity: 1; }
  .rail-stats, .rail-motor, .model-slot { display: none; }
  .rail-jos { padding: 10px 0 0; align-items: center; }
  .rail-butoane .mini { width: 48px; height: auto; min-height: 28px; padding: 3px 4px;
    font-size: 10.5px; line-height: 1.2; white-space: normal; text-align: center; }
  .rail-butoane #traseu-btn { width: 44px; min-height: 32px; padding: 0;
    justify-content: center; font-size: 0; }
  .sertar { position: absolute; right: var(--gap-app); top: var(--gap-app); bottom: var(--gap-app);
    z-index: 30; width: min(var(--sertar-w, 620px), calc(100vw - 88px)); min-width: 0; max-width: none;
    box-shadow: var(--sh-xl); }
  .gutter { display: none; }
  .panel-head { padding: 18px 18px 14px; }
  .panel-body { padding: 16px 18px 40px; }
  .thread { padding: 20px 18px 10px; }
  .compose { padding: 6px 18px 16px; }
}
/* panoul de lucru ingust (sertarul deschis): firul si cardul raspunsului strang marginile */
@container scena (max-width: 560px) {
  .thread { padding: 18px 14px 10px; gap: 18px; }
  .compose { padding: 6px 14px 14px; }
  .raspuns { padding: 14px 16px 16px; }
  .msg-user .bula { max-width: 92%; }
}
/* Telefon (sau panou foarte ingust): indemnul lung din camp nu incape si s-ar taia la
   jumatatea unui cuvant. Se ascunde si, cat campul e gol, se arata unul scurt, desenat
   de CSS (fara JS; eticheta accesibila ramane `aria-label` pe camp). */
@container scena (max-width: 480px) {
  .compose-box input::placeholder { color: transparent; }
  .compose-box:has(#q:placeholder-shown)::before {
    content: "Scrie întrebarea…"; position: absolute; left: 46px; right: 104px; top: 50%;
    transform: translateY(-50%); pointer-events: none;
    font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .compose-box button[type="submit"] { padding: 0 14px; }
  .hero-titlu { font-size: 24px; }
}
