/* ═══════════════════════════════════════════════════════════
   FORJA DE IDEI v1.3 — stylesheet conform rules.txt
   Lato (UI) + Merriweather (titluri) · scară: xs .65 / sm .7 /
   base .75 / lg .8 / xl .9 rem · padding minim, densitate maximă,
   butoane aliniate jos, raze unificate, focus vizibil ≥1px,
   contrast ≥ 4.5:1, responsive, animații scurte (GSAP + CSS)
   v1.3: selector de limbă în header (cu stare .locked), grilă
   pas 1 adaptată la 2 carduri de select
   ═══════════════════════════════════════════════════════════ */

:root, [data-theme="dark"] {
  --bg: #0b0e16;
  --bg2: #0f1420;
  --panel: #141a2a;
  --panel2: #1a2236;
  --border: #25304b;
  --border2: #31406a;
  --text: #e9edf8;
  --muted: #9aa8c7;
  --accent: #8b6cff;
  --accent2: #38d6f0;
  --good: #3ddba2;
  --warn: #fcc63a;
  --bad: #f98b8b;
  --shadow: 0 6px 18px rgba(0,0,0,.45);
  --grad: linear-gradient(135deg, #7c5cff, #24d3ee);
  --tag-bg: #1c2540;
  --card-hover: #1b2440;
  --r: 8px;
  --fs-xs: 0.65rem;
  --fs-sm: 0.7rem;
  --fs-base: 0.75rem;
  --fs-lg: 0.8rem;
  --fs-xl: 0.9rem;
}
[data-theme="light"] {
  --bg: #f2f4fa;
  --bg2: #e9edf6;
  --panel: #ffffff;
  --panel2: #f4f6fc;
  --border: #d8deee;
  --border2: #b9c4e2;
  --text: #1c2438;
  --muted: #566389;
  --accent: #6a48f0;
  --accent2: #087ea8;
  --good: #047857;
  --warn: #9a5304;
  --bad: #b91c1c;
  --shadow: 0 4px 14px rgba(28,36,56,.12);
  --grad: linear-gradient(135deg, #6a48f0, #0891b2);
  --tag-bg: #e8ecf9;
  --card-hover: #f2f5ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Lato", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.45;
  min-height: 100vh;
}
h1, h2, h3, h4 {
  font-family: "Merriweather", Georgia, serif;
  margin: 0 0 .3em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
h1, h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); font-family: "Lato", sans-serif; }
small { color: var(--muted); font-size: var(--fs-xs); }
#app { display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent2); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; }

/* ─────────── focus vizibil (≥1px, contrast) ─────────── */
:focus-visible { outline: 1px solid var(--accent2); outline-offset: 1px; }
input:focus, textarea:focus, select:focus {
  outline: 1px solid var(--accent2);
  outline-offset: 0;
  border-color: var(--accent);
}
.btn:focus-visible, .chip:focus-visible { outline: 1px solid var(--accent2); outline-offset: 1px; }

/* ─────────── butoane ─────────── */
.btn {
  border: 1px solid var(--border2);
  background: var(--panel2);
  color: var(--text);
  padding: 4px 10px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-family: inherit;
  line-height: 1.35;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 3px 10px rgba(124,92,255,.22); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--grad); border: none; color: #fff; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big {
  padding: 8px 14px; font-size: var(--fs-base);
  display: inline-flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 2px; text-align: center;
}
.btn.big small { color: #fff; opacity: .85; font-weight: 400; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 2px 8px; font-size: var(--fs-xs); border-radius: calc(var(--r) - 2px); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); box-shadow: none; }

/* ─────────── header ─────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo {
  width: 28px; height: 28px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--grad); border-radius: var(--r); font-size: var(--fs-base);
  color: #fff; box-shadow: 0 2px 8px rgba(124,92,255,.4);
}
.brand-text { min-width: 0; }
.brand-text strong { letter-spacing: 1.2px; font-size: var(--fs-base); display: block; white-space: nowrap; }
.brand-text small { display: block; font-size: var(--fs-xs); letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.topbar-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.badge-count {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: var(--fs-xs); padding: 0 6px; font-weight: 700;
}

/* selectorul de limbă */
.lang-sel { display: inline-flex; align-items: center; gap: 4px; }
.lang-sel i { color: var(--accent2); }
.lang-sel select {
  padding: 3px 6px; border-radius: var(--r);
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border2);
  font-family: inherit; font-size: var(--fs-xs);
  cursor: pointer; max-width: 110px;
}
.lang-sel select:disabled { opacity: .5; cursor: not-allowed; }
.lang-sel.locked select { border-style: dashed; }
.lang-sel.locked i { opacity: .5; }

/* ─────────── stepper ─────────── */
.stepper {
  display: flex; justify-content: center; align-items: center; gap: 0;
  padding: 8px 8px 4px;
  flex-wrap: wrap;
}
.step-node {
  display: flex; align-items: center; gap: 6px; cursor: default;
  padding: 2px 6px; border-radius: var(--r);
}
.step-node.clickable { cursor: pointer; }
.step-node.clickable:hover { background: var(--panel); }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm);
  background: var(--panel2); color: var(--muted);
  border: 2px solid var(--border2); transition: all .2s;
}
.step-node.active .step-dot {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}
.step-node.done .step-dot { background: var(--good); color: #06281c; border-color: transparent; }
.step-label { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); white-space: nowrap; }
.step-node.active .step-label { color: var(--text); }
.step-node.done .step-label { color: var(--text); }
.step-link { width: 34px; height: 2px; background: var(--border2); margin: 0 3px; flex-shrink: 0; }
.step-node.done + .step-link { background: var(--good); }

/* ─────────── layout pași ─────────── */
#main { flex: 1; padding: 4px 14px 24px; max-width: 1500px; width: 100%; margin: 0 auto; }
.step-panel { display: none; animation: fadein .22s ease; }
.step-panel.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.step-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  margin: 8px 0 8px; flex-wrap: wrap;
}
.step-head > div { min-width: 0; }
.step-head h2 { font-size: var(--fs-xl); margin: 0; }
.step-sub { color: var(--muted); margin: 2px 0 0; max-width: 760px; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.step-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.step-num {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: calc(var(--r) - 2px); margin-right: 4px;
  background: var(--grad); color: #fff; font-size: var(--fs-sm); vertical-align: -4px;
  font-family: "Lato", sans-serif; font-weight: 700; flex-shrink: 0;
}
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 10px;
  min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: var(--fs-lg); }
.panel-head h3 i, .opt-card h3 i, .drawer-head h3 i, .compose-panel h3 i { color: var(--accent2); margin-right: 2px; }

.query-strip {
  background: var(--panel2); border: 1px dashed var(--border2);
  padding: 5px 8px; border-radius: var(--r); margin-bottom: 8px;
  font-family: Consolas, "Courier New", monospace; font-size: var(--fs-sm); color: var(--accent2);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.query-strip:empty { display: none; }
.query-strip i { flex-shrink: 0; }
.query-strip .en-note {
  font-family: "Lato", sans-serif; font-size: var(--fs-xs); color: var(--warn);
  border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent);
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}

/* minmax(0,1fr) pe coloana lată = conținutul lung nu mai umflă grila */
.layout-2col { display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); gap: 10px; align-items: start; min-width: 0; }
@media (max-width: 1100px) { .layout-2col { grid-template-columns: minmax(0, 1fr); } }

/* ─────────── pasul 1 ─────────── */
.hero { text-align: center; padding: 18px 6px 12px; }
.hero-badge {
  display: inline-block; font-size: var(--fs-xs); letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent2); border: 1px solid var(--border2);
  padding: 2px 10px; border-radius: 999px; margin-bottom: 8px;
}
.hero h1 { font-size: clamp(.9rem, 2.2vw, 1.08rem); font-weight: 900; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p { color: var(--muted); max-width: 720px; margin: 6px auto 0; font-size: var(--fs-sm); }

.problem-box { max-width: 900px; margin: 0 auto 10px; }
.problem-box label { font-weight: 700; display: flex; align-items: center; margin-bottom: 6px; font-size: var(--fs-base); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
#problemInput {
  flex: 1; resize: vertical; min-height: 48px; min-width: 0;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border2); border-radius: var(--r);
  padding: 8px 10px; font-size: var(--fs-base); font-family: inherit;
  transition: border-color .15s;
}

/* Pasul 1: cardul „Unghi de abordare" pe tot rândul (radiouri pe
   orizontală), cele 2 selecturi într-un rând dedesubt. */
.options-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 8px; max-width: 1100px; margin: 0 auto 10px;
}
.opt-card { display: flex; flex-direction: column; min-width: 0; }
.opt-card.mode-card { grid-column: 1 / -1; }
.mode-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.opt-card h3 { font-size: var(--fs-base); }
.opt-card select, .compose-panel select {
  width: 100%; max-width: 100%; padding: 6px 8px; border-radius: var(--r);
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2);
  font-family: inherit; font-size: var(--fs-sm);
  margin-top: 2px;
}
.opt-card .hint { margin-top: 4px; }
.radio-row { display: flex; gap: 8px; padding: 4px; border-radius: var(--r); cursor: pointer; height: 100%; }
.radio-row:hover { background: var(--panel2); }
.radio-row input { accent-color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.radio-row b { display: block; font-size: var(--fs-sm); }
.radio-row small { display: block; font-size: var(--fs-xs); }
.hint { color: var(--muted); font-size: var(--fs-xs); margin: 4px 0 0; overflow-wrap: anywhere; }
.set-hint { display: block; color: var(--muted); font-size: var(--fs-xs); margin: 2px 0 8px; padding: 8px 10px; border: 1px dashed var(--border, #444); border-radius: 8px; overflow-wrap: anywhere; }

.howto { max-width: 1100px; margin: 0 auto; }
.howto-steps { margin: 4px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; color: var(--muted); font-size: var(--fs-xs); }
.howto-steps li { margin-bottom: 4px; break-inside: avoid; }
.howto-steps b { color: var(--text); }
@media (max-width: 800px) { .howto-steps { columns: 1; } }

/* ─────────── taguri ─────────── */
.tag-tools { display: flex; gap: 5px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 2px; min-height: 40px; }
.chip {
  border: 1px solid var(--border2); background: var(--tag-bg); color: var(--text);
  border-radius: 999px; padding: 3px 10px; font-size: var(--fs-xs); cursor: pointer;
  font-family: inherit; transition: all .13s; display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; overflow-wrap: anywhere; text-align: left;
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip .tag-score { font-size: var(--fs-xs); color: var(--muted); flex-shrink: 0; }
.chip.selected {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(124,92,255,.4);
}
.chip.selected .tag-score { color: rgba(255,255,255,.8); }
.chip.base { cursor: default; font-weight: 700; background: var(--panel2); }
.chip.filter.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .x { font-weight: 700; margin-left: 2px; }
.chips-inline { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }

.continue-row {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.continue-row.big { margin: 10px 0 0; padding: 8px 10px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); }
.sel-info { color: var(--muted); font-size: var(--fs-xs); }

/* ─────────── compunere interogare (pasul 3) ─────────── */
.compose-rows { display: flex; flex-direction: column; gap: 6px; }
.compose-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compose-row .lbl { min-width: 110px; color: var(--muted); font-size: var(--fs-xs); }
.compose-row select { width: auto; min-width: 220px; max-width: 100%; margin-top: 0; flex: 1; }
.pre-report .compose-row select { margin-top: 0; }
.pre-report .compose-row { align-items: stretch; }
.pre-report .compose-row .btn.big { flex-shrink: 0; }
.add-inline { display: flex; gap: 5px; flex: 1; min-width: 200px; }
.add-inline input {
  flex: 1; min-width: 80px;
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 4px 8px; font-family: inherit; font-size: var(--fs-xs);
}
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span {
  display: inline-block; padding: 4px 12px; border: 1px solid var(--border2);
  background: var(--bg2); font-size: var(--fs-xs); cursor: pointer; border-radius: var(--r);
  white-space: nowrap;
}
.seg input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.seg:first-of-type span { border-radius: var(--r) 0 0 var(--r); }
.seg:last-of-type span { border-radius: 0 var(--r) var(--r) 0; }

/* ─────────── bara de filtre ─────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 8px; margin-bottom: 8px;
}
.filter-bar .mini, .mini {
  padding: 4px 7px; border-radius: var(--r); font-size: var(--fs-xs);
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2);
  font-family: inherit; max-width: 100%;
}
.filter-bar label { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.filter-bar label i { color: var(--accent2); }
.mini.num { width: 60px; }
.range-lbl input[type="range"] { accent-color: var(--accent); width: 90px; }
.check-lbl { cursor: pointer; white-space: nowrap; }
input[type="search"].mini.grow { flex: 1; min-width: 120px; }

/* ─────────── panou academic ─────────── */
.acad-panel {
  padding: 7px 10px; margin-bottom: 8px; font-size: var(--fs-xs);
  border-left: 3px solid var(--accent2);
  overflow-wrap: anywhere;
}
.acad-panel i { color: var(--accent2); }
.acad-panel .acad-terms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.acad-term {
  font-size: var(--fs-xs); background: color-mix(in srgb, var(--accent2) 12%, transparent);
  color: var(--accent2); padding: 1px 8px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent2) 30%, transparent);
  max-width: 100%; overflow-wrap: anywhere;
}
[data-theme="light"] .acad-term { color: #155e75; border-color: rgba(8,126,168,.35); }

/* ─────────── carduri rezultate ─────────── */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(255px, 100%), 1fr));
  gap: 8px; align-items: stretch;
}
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r); padding: 7px 9px;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color .15s, transform .15s, background .15s;
  position: relative; height: 100%; min-width: 0;
}
.card:hover { border-color: var(--border2); background: var(--card-hover); transform: translateY(-1px); }
.card.academic { border-left: 3px solid var(--accent2); }
.card.web { border-left: 3px solid var(--warn); }
.card.cand { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.35); }
.card.cand::after {
  content: "★"; position: absolute; top: -8px; right: 8px;
  background: var(--grad); color: #fff; font-size: var(--fs-xs); font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
}
.card-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.badge {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .3px;
  padding: 1px 7px; border-radius: 999px; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge.academic { background: color-mix(in srgb, var(--accent2) 15%, transparent); color: var(--accent2); }
.badge.web { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.rs {
  background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good);
  cursor: help; text-transform: none;
}
.badge.rs.low { background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted); }
.badge.indexed { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
[data-theme="light"] .badge.indexed { color: #5b3df0; }
.badge.demo { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.badge.warnq {
  background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn);
  cursor: help; text-transform: none;
}
.card-right { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.card-year { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.info-ico { color: var(--muted); cursor: help; }
.card h4 { margin: 0; font-size: var(--fs-base); line-height: 1.3; }
.card h4 a { color: var(--text); word-break: break-word; }
.card h4 a:hover { color: var(--accent2); }
.snippet { font-size: var(--fs-xs); color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; overflow-wrap: anywhere; }
.card-meta .meta-cit { display: inline-flex; align-items: center; gap: 3px; cursor: default; }
.card-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; padding-top: 3px; }
.kw-row { display: flex; flex-wrap: wrap; gap: 3px; }
.kw {
  font-size: var(--fs-xs); background: var(--panel2); border: 1px solid var(--border);
  color: var(--muted); padding: 0 6px; border-radius: 999px;
  max-width: 100%; overflow-wrap: anywhere;
}
.cards-grid.selectable .card { cursor: pointer; }

/* schelete încărcare */
.skel { border-radius: var(--r); background: var(--panel); border: 1px solid var(--border); padding: 10px; }
.skel .l { height: 8px; border-radius: 4px; margin: 6px 0; background: linear-gradient(90deg, var(--panel2) 25%, var(--border) 50%, var(--panel2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel .l:nth-child(1) { width: 38%; }
.skel .l:nth-child(2) { width: 92%; }
.skel .l:nth-child(3) { width: 75%; }
.skel .l:nth-child(4) { width: 55%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* stări goale */
.empty {
  text-align: center; color: var(--muted); padding: 24px 12px;
  border: 2px dashed var(--border2); border-radius: var(--r); grid-column: 1/-1;
  font-size: var(--fs-sm); overflow-wrap: anywhere;
}
.empty .big-ico { font-size: 1.5rem; display: block; margin-bottom: 4px; color: var(--muted); }

/* ─────────── raport final ─────────── */
.report { display: flex; flex-direction: column; gap: 10px; }
.report-section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.report-section > h3 { font-size: var(--fs-lg); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.report-section > h3 i { color: var(--accent2); margin-right: 2px; }
/* varianta profesorului: narațiunea */
.report-narr { border-left: 3px solid var(--accent); }
.report-narr p { line-height: 1.55; margin: 7px 0; font-size: var(--fs-base); overflow-wrap: anywhere; }
/* „de ce e aici” la descoperiri și dovezi */
.finding .why { color: var(--accent2); font-size: var(--fs-xs); margin-top: 3px; }
.path-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: var(--fs-xs); }
.path-breadcrumb .step-chip { background: var(--panel2); border: 1px solid var(--border2); padding: 2px 10px; border-radius: 999px; max-width: 100%; overflow-wrap: anywhere; }
.path-breadcrumb .arrow { color: var(--accent); display: inline-flex; flex-shrink: 0; }
.path-breadcrumb .step-chip.final { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }
.report-summary { font-size: var(--fs-base); padding-left: 18px; overflow-wrap: anywhere; }
.report-summary li { margin-bottom: 5px; }
.report-summary li::marker { color: var(--accent); }
.findings-list, .evidence-list { display: flex; flex-direction: column; gap: 6px; }
.finding {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--panel2); border: 1px solid var(--border);
  padding: 6px 9px; border-radius: var(--r); min-width: 0;
}
.finding .n {
  min-width: 20px; height: 20px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--grad); color: #fff; border-radius: calc(var(--r) - 2px); font-weight: 700; font-size: var(--fs-xs);
}
.finding > div:last-child { min-width: 0; }
.finding .t { font-weight: 700; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.finding .m { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.wordcloud { display: flex; flex-wrap: wrap; gap: 3px 12px; align-items: baseline; justify-content: center; padding: 6px 0; }
.wordcloud span { color: var(--accent2); opacity: .9; line-height: 1.6; overflow-wrap: anywhere; }
.wordcloud span:nth-child(3n) { color: var(--accent); }
.wordcloud span:nth-child(4n) { color: var(--good); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 6px; }
.stat { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 6px; text-align: center; min-width: 0; }
.stat b { font-size: 1.05rem; display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat small { font-size: var(--fs-xs); overflow-wrap: anywhere; }
.report-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* ─────────── drawer bibliotecă ─────────── */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(5,8,16,.6);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 95vw);
  background: var(--bg2); border-left: 1px solid var(--border);
  transform: translateX(102%); transition: transform .25s ease;
  z-index: 100; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; overflow-wrap: anywhere; }
.drawer-filters { padding: 6px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.chip-row { display: flex; gap: 5px; flex-wrap: wrap; }
.drawer-tools { display: flex; gap: 6px; }
.lib-list { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.lib-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 6px 8px; display: flex; flex-direction: column; min-width: 0; }
.lib-item .t { font-weight: 700; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.lib-item .m { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 2px 0; overflow-wrap: anywhere; }
.lib-item .m i { color: var(--accent2); }
.lib-item .note {
  width: 100%; margin-top: 4px; font-family: inherit; font-size: var(--fs-xs);
  background: var(--bg2); color: var(--text); border: 1px solid var(--border2);
  border-radius: calc(var(--r) - 2px); padding: 4px 6px; resize: vertical;
}
.lib-item .acts { display: flex; gap: 5px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.drawer-foot { border-top: 1px solid var(--border); padding: 6px 10px; display: flex; flex-direction: column; gap: 6px; }
.drawer-foot-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.drawer-foot-actions .btn { flex: 1; }
.lib-stats { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }

/* ─────────── modal ─────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,8,16,.65);
  display: grid; place-items: center; z-index: 120; padding: 14px;
}
.modal {
  background: var(--panel); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 10px 12px; max-width: 620px; width: 100%;
  max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal h3 { margin-top: 0; font-size: var(--fs-lg); }
.modal h3 i { color: var(--accent2); }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.modal .modal-actions .btn { min-width: 88px; }
.modal p { overflow-wrap: anywhere; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.set-row > label:first-child { min-width: 0; flex: 1; }
.set-row label b { display: block; font-size: var(--fs-sm); }
.set-row label small { color: var(--muted); font-size: var(--fs-xs); display: block; overflow-wrap: anywhere; }
.set-row select.mini { max-width: 55%; flex-shrink: 1; }
.set-group-title { margin: 10px 0 2px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 1px; color: var(--accent2); font-weight: 700; }
.set-presets { display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0 2px; }
.switch { position: relative; width: 34px; height: 18px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: var(--border2); border-radius: 999px;
  transition: background .15s; cursor: pointer;
}
.switch span::before {
  content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: left .15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { left: 19px; }
.switch input:disabled + span { opacity: .6; cursor: not-allowed; }

/* ─────────── toasts ─────────── */
.toasts { position: fixed; bottom: 38px; right: 12px; z-index: 200; display: flex; flex-direction: column; gap: 6px; max-width: min(340px, 90vw); }
.toast {
  background: var(--panel2); border: 1px solid var(--border2); border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: 6px 12px; font-size: var(--fs-sm);
  box-shadow: var(--shadow); animation: toastin .22s ease; overflow-wrap: anywhere;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toastin { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ─────────── status bar ─────────── */
.statusbar {
  position: sticky; bottom: 0; z-index: 60;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 4px 12px; font-size: var(--fs-xs); color: var(--muted);
  min-width: 0;
}
#statusMsg {
  min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prov-dots {
  display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; align-items: center;
  overflow-x: auto; scrollbar-width: thin; max-width: 65%; flex-shrink: 0; padding: 1px 0;
}
.prov-dot { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.prov-dot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.prov-dot.ok .dot { background: var(--good); }
.prov-dot.err .dot { background: var(--bad); }
.prov-dot.run .dot { background: var(--warn); animation: pulse 1s infinite; }
.prov-dot .lbl { white-space: nowrap; }
@keyframes pulse { 50% { opacity: .4; } }
@media (max-width: 980px) { .prov-dot .lbl { display: none; } }
@media (max-width: 720px) { .prov-dots { max-width: 45%; } }

/* ─────────── scrollbar ─────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─────────── responsive ─────────── */
@media (max-width: 800px) {
  .options-grid { grid-template-columns: minmax(0, 1fr); }
  .mode-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  #main { padding: 2px 8px 16px; }
  .topbar { padding: 5px 8px; flex-wrap: nowrap; }
  .topbar-actions { gap: 4px; flex-wrap: nowrap; }
  .hero { padding: 10px 2px 8px; }
  .cards-grid { grid-template-columns: minmax(0, 1fr); }
  .input-row { flex-direction: column; }
  .input-row .btn.big { flex-direction: row; justify-content: center; }
  .step-head { flex-direction: column; align-items: flex-start; }
  .step-head h2 { font-size: var(--fs-lg); }
  .compose-row .lbl { min-width: 100%; }
  .filter-bar { gap: 5px; }
  .report-actions .btn { flex: 1 1 46%; }
  .set-row select.mini { max-width: 100%; }
}
@media (max-width: 560px) {
  .topbar-actions .btn .lbl { display: none; }
  .brand-text small { display: none; }
  .step-label { display: none; }
  .step-node { gap: 0; padding: 2px 2px; }
  .step-link { width: 18px; }
}

/* ─────────── mișcare redusă ─────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ─────────── print (doar raportul) ─────────── */
@media print {
  body { background: #fff; color: #000; font-size: 10pt; }
  .topbar, .stepper, .statusbar, .drawer, .drawer-backdrop, .toasts,
  .step-head, .pre-report, .filter-bar, #modalRoot { display: none !important; }
  .step-panel { display: none !important; }
  #step5 { display: block !important; }
  .report-section { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
  .card, .finding { border: 1px solid #ccc; }
}

/* ── input text tematic (salvarea selecțiilor) ── */
.text-inp {
  background: var(--bg2); border: 1px solid var(--border); border-radius: calc(var(--r) - 2px);
  color: var(--text); padding: 6px 9px; font: inherit; font-size: var(--fs-sm); min-width: 150px;
}
.text-inp:focus { outline: none; border-color: var(--accent); }
.text-inp::placeholder { color: var(--muted); }

/* ── butoane rapide cu selecțiile salvate (pasul 1) ── */
#favQuick { margin: 6px 0 8px; }
#favQuick .lbl { align-self: center; }

/* butonul rapid de selecție activ (pasul 1) */
.btn.tiny.on { background: var(--accent); border-color: var(--accent); color: #fff; }
