/* NormArchAI — application styles. Brand tokens: see docs/brand.md */
:root {
  /* Primary brand palette (strict adherence to brand book) */
  --c-indigo:  #162136;   /* Font principal, fundal dark */
  --c-smarald: #2A6054;   /* Accent pozitiv, butoane, success */
  --c-lavanda: #826D8E;   /* Ton secundar elegant */
  --c-gri:     #929FB2;   /* Fundal calm, neutralizare UI */
  --c-ocru:    #E4B30E;   /* Accent cald, luxury, warning */
  
  /* Auxiliary colors (derived from palette) */
  --c-white:   #FFFFFF;   /* Alb pur pentru carduri, fonduri curate */
  --c-error:   #8a1c1c;   /* Error (dark red tone) */
  --c-success: #2A6054;   /* Success (verde smarald) */
  --c-warning: #E4B30E;   /* Warning (ocru urban) */

  /* Theme variables (light mode) */
  --bg:        #F7F8FA;
  --card:      var(--c-white);
  --text:      var(--c-indigo);
  --muted:     #5b6678;
  --line:      #e6e9ef;
  --bubble:    #eef0f5;   /* assistant message background / UI hatching */
  --input-bg:  var(--c-white);

  --radius: 12px;
  --shadow: 0 1px 3px rgba(22,33,54,.08), 0 8px 24px rgba(22,33,54,.06);
  --font: "Satoshi", "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --logo-gradient: linear-gradient(135deg, var(--c-indigo) 0%, var(--c-smarald) 100%);
}

/* Dark theme — (1) OS preference without explicit toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:       #0f1626;
    --card:     #18233b;
    --text:     #e8ecf3;
    --muted:    #97a3bb;
    --line:     #2a3650;
    --bubble:   #20304e;
    --input-bg: #131d31;
    --shadow:   0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}
/* The lockup follows the theme exactly like the rest of the UI: white on dark background. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img.brand-lockup--light { display: none; }
  :root:not([data-theme="light"]) .brand img.brand-lockup--dark { display: block; }
}
[data-theme="dark"] .brand img.brand-lockup--light { display: none; }
[data-theme="dark"] .brand img.brand-lockup--dark { display: block; }

/* Dark theme — (2) explicit toggle [data-theme="dark"] always wins */
[data-theme="dark"] {
  --bg:       #0f1626;
  --card:     #18233b;
  --text:     #e8ecf3;
  --muted:    #97a3bb;
  --line:     #2a3650;
  --bubble:   #20304e;
  --input-bg: #131d31;
  --shadow:   0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

/* ── Tokens Studio (/app, body.ws-body) — AEC console ───────────────────────
   The public site remains on the brand palette above. In Studio, the dark
   theme switches to the industrial palette (charcoal/graphite) with three semantic accents:
     --acc-cyan    #00E5FF  information / normative reference / CAD selection
     --acc-orange  #FF4D00  attention / non-compliant / destructive action
     --acc-green   #10B981  compliant / OK
   The mono font (JetBrains Mono, loaded only in app.html) is for dimensions,
   layers, legal article codes, and numerical values — not for prose.
   New components (C-3 normative card, C-4 CAD viewport) consume ONLY these
   tokens; existing components remain on --bg/--card/--text/--line. */
:root {
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --acc-cyan:   #00B8CC;   /* on light background: darker cyan, AA contrast */
  --acc-orange: #E04400;
  --acc-green:  #0E9F6E;
  --status-ok:     var(--acc-green);
  --status-warn:   #C77700;
  --status-err:    var(--acc-orange);
  --status-info:   var(--acc-cyan);
  --status-none:   var(--muted);   /* DATE INSUFICIENTE */
  --surface-2:  #EEF1F5;   /* status bar, rails */
  --line-strong: #C9D0DA;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ws-body {
    --bg: #0B0C0E; --card: #141619; --line: #23272E; --line-strong: #2E333B;
    --text: #E6E8EB; --muted: #8B929C; --bubble: #1A1D22; --input-bg: #101215;
    --surface-2: #101215;
    --acc-cyan: #00E5FF; --acc-orange: #FF4D00; --acc-green: #10B981; --status-warn: #F5A524;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
  }
}
[data-theme="dark"] body.ws-body {
  --bg: #0B0C0E; --card: #141619; --line: #23272E; --line-strong: #2E333B;
  --text: #E6E8EB; --muted: #8B929C; --bubble: #1A1D22; --input-bg: #101215;
  --surface-2: #101215;
  --acc-cyan: #00E5FF; --acc-orange: #FF4D00; --acc-green: #10B981; --status-warn: #F5A524;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
}
/* Studio background is taken from the token redefined on body, not from :root */
body.ws-body { background: var(--bg); color: var(--text); }

* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); color: var(--text);
  background: var(--bg); line-height: 1.55;
}
a { color: var(--c-smarald); text-decoration: none; }
a:hover { text-decoration: underline; }
/* A link inside a text block is distinguishable even without color (a11y
   „link-in-text-block", Lighthouse 20.09.2026): thin underline, offset. */
p a, li a, td a, dd a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Layout */
.nav {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line);
}
.nav .spacer { flex: 1; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.container { max-width: 960px; margin: 0 auto; padding: 32px 24px; }
.narrow { max-width: 420px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.brand img { height: 30px; width: auto; }
/* Header lockup (`lockup-header-*.svg`, 720×150): same architecture as
   the master lockup, but with the mono subtitle at 20/150 (not 10/160) — at 72 px height
   the wordmark is ~22 px and the subtitle ~10 px, readable on PC. The master (760×160)
   remains for print/OG, where it is large. Below 480 px only the symbol is displayed. */
.brand img.brand-lockup { height: 72px; width: auto; display: block; }
/* In the Studio rail (268 px) the lockup fills the usable width: 240 px → 50 px height. */
.rail-top .brand { width: 100%; }
.rail-top .brand img.brand-lockup { width: 100%; height: auto; max-width: 240px; }
.brand img.brand-lockup--dark { display: none; }
.tagline { color: var(--muted); font-style: italic; }

/* Nav on mobile: no spacer pushing buttons off-screen;
   let elements flow onto rows instead of cutting off „Creează cont”. */
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; }
  .nav .spacer { display: none; }
  .nav a.btn { padding: 8px 14px; }
  .brand { font-size: 16px; }
  .brand img { height: 26px; }
  .brand img.brand-lockup { height: 48px; }
}

/* Narrow phone: only the -N- reticle (cropped from lockup via object-fit), 40 px. */
@media (max-width: 480px) {
  .brand img.brand-lockup { height: 40px; width: 40px; object-fit: cover; object-position: 0 50%; }
}

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: var(--input-bg); color: var(--text);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--c-smarald); border-color: transparent; }

/* Buttons */
.btn {
  display: inline-block; padding: 11px 18px; border: 0; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer; color: var(--c-white);
  background: var(--c-smarald); transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.accent { background: var(--c-ocru); color: var(--c-indigo); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.block { display: block; width: 100%; text-align: center; }
.nav a.btn,
.nav a.btn:hover {
  color: var(--c-white);
  padding: 8px 14px; font-size: 14px; border-radius: 7px;   /* in header, next to the 72 px lockup */
}
/* The button through which the user manages/cancels their subscription: not "ghost",
   but clearly visible — outline in text color, weight 600. */
.btn.ghost.btn-abonament { border: 1.5px solid var(--text); font-weight: 600; padding: 12px 20px; }
.btn.ghost.btn-abonament:hover { background: var(--bubble); filter: none; }
.nav a.btn.accent,
.nav a.btn.accent:hover {
  color: var(--c-indigo);
}

/* Banners */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.err { background: rgba(138, 28, 28, 0.1); color: var(--c-error); border: 1px solid rgba(138, 28, 28, 0.2); }
.alert.ok  { background: rgba(42, 96, 84, 0.1); color: var(--c-success); border: 1px solid rgba(42, 96, 84, 0.2); }

/* Misc */
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.price { font-size: 30px; font-weight: 700; color: var(--text); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px;
         font-weight: 600; background: var(--bubble); color: var(--muted); }
.badge.curent { background: var(--c-smarald); color: var(--c-white); }
.usage-bar { height: 8px; background: var(--bubble); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.usage-bar > span { display: block; height: 100%; background: var(--c-smarald); }

/* ── Utilities (replacing inline styles from templates) ── */
.mt-s { margin-top: 8px; }
.mt   { margin-top: 12px; }
.mt-m { margin-top: 12px; }
.mt-l { margin-top: 16px; }
.nowrap { white-space: nowrap; }
.mr { margin-right: 12px; }
.right { text-align: right; }
summary { cursor: pointer; }

/* List table (works, history, templates) */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); padding: 8px 6px; font-weight: 600; }
.tbl td { padding: 9px 6px; vertical-align: top; }
.tbl tr { border-top: 1px solid var(--line); }

/* Progress bar (<progress> element, no inline style) */
progress.usage { -webkit-appearance: none; appearance: none; width: 100%; height: 8px;
  border: 0; border-radius: 999px; background: var(--bubble); margin-top: 6px; }
progress.usage::-webkit-progress-bar { background: var(--bubble); border-radius: 999px; }
progress.usage::-webkit-progress-value { background: var(--c-smarald); border-radius: 999px; }
progress.usage::-moz-progress-bar { background: var(--c-smarald); border-radius: 999px; }

/* Badge-uri de status lucrare */
.badge-pending { background: var(--c-gri); color: var(--c-white); }
.badge-running { background: var(--c-ocru); color: var(--c-white); }
.badge-done    { background: var(--c-smarald); color: var(--c-white); }
.badge-error   { background: var(--c-error); color: var(--c-white); }

/* Export guide list + card with checkbox (batch) */
.guide-list { font-size: 13px; }
.check-card { margin: 0; display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check-card input { width: auto; margin-top: 3px; }

/* Utilitare suplimentare */
.mt-xl { margin-top: 18px; }
.ml-s { margin-left: 8px; }
.inline { display: inline; }
.center { text-align: center; }
.small { font-size: 14px; }
.lead { font-size: 18px; }
.smarald { color: var(--c-smarald); }
.min-h { min-height: 42px; }
.mono { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.btn.sm { padding: 4px 10px; }
.hero { text-align: center; padding: 48px 24px; }
.hero img { height: 72px; }
.hero-text { max-width: 560px; margin: 14px auto 22px; }

/* Dashboard super-admin */
.superadmin-page { max-width: 1280px; }
.admin-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--c-ocru) 12%, transparent), transparent 30%),
    var(--card);
}
.admin-heading p { margin: 4px 0 0; }
.admin-kpis { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-kpi {
  position: relative; overflow: hidden; padding: 16px; margin: 0;
  border-radius: 14px; background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--bubble) 38%, var(--card)));
}
.admin-kpi::after {
  content: ''; position: absolute; inset: auto 14px 0 14px; height: 3px; border-radius: 999px 999px 0 0;
  background: var(--c-smarald); opacity: .65;
}
.admin-kpi--warn::after { background: var(--c-ocru); }
.admin-kpi--cost::after { background: var(--c-lavanda); }
.admin-kpis strong { display: block; font-size: 26px; line-height: 1.1; margin-top: 6px; letter-spacing: -.02em; }
.admin-table-wrap { overflow-x: auto; padding: 18px; border-radius: 16px; }
.admin-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.admin-section-head h2 { margin: 0 0 4px; }
.admin-section-head p { margin: 0; }
.admin-table { min-width: 900px; border-collapse: separate; border-spacing: 0; }
.admin-table th {
  padding: 10px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  background: color-mix(in srgb, var(--bubble) 72%, var(--card)); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.admin-table td { vertical-align: middle; padding: 12px 10px; }
.admin-table tbody tr { transition: background .15s; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--c-smarald) 4%, transparent); }
.admin-budget { min-width: 220px; }
.admin-email { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .admin-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .admin-heading { align-items: flex-start; flex-direction: column; }
  .admin-kpis { grid-template-columns: repeat(2, 1fr); }
  .admin-table-wrap { padding: 14px; }
}
@media (max-width: 460px) { .admin-kpis { grid-template-columns: 1fr; } }

/* Studio: chat + vizualizator DXF */
.container.wide { max-width: 1400px; }
.studio { display: grid; grid-template-columns: 380px 1fr; gap: 18px; height: 76vh; }
.studio .card { display: flex; flex-direction: column; margin: 0; min-height: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 8px 12px; border-radius: 10px; max-width: 92%; white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.msg.user { background: var(--c-smarald); color: var(--c-white); align-self: flex-end; }
.msg.assistant { background: var(--bubble); color: var(--text); align-self: flex-start; }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; }
.viewer-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.viewer-bar select { flex: 1; }
.viewer-frame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--c-white); }
@media (max-width: 820px) {
  .studio { grid-template-columns: 1fr; height: auto; }
  .viewer-frame { height: 60vh; }
}

/* Tab-uri Studio */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab-btn { padding: 10px 18px; border: 0; background: transparent; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--c-smarald); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Generate tab: large viewer + generation bar at the bottom */
.gen-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 8px; background: var(--c-white); }
.gen-bar { margin-top: 14px; }
.gen-row { display: flex; gap: 8px; align-items: center; }
.gen-row input[type="text"] { flex: 1; }
.gen-uploads { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.gen-uploads .gen-row { flex: 1; min-width: 260px; }

/* „Assistant” chat on wide width */
.chat-full { height: 64vh; }

/* ── Theme switcher ── */
.theme-toggle { border: 0; background: transparent; color: var(--muted); font-size: 20px;
  cursor: pointer; line-height: 1; padding: 4px 8px; }
.theme-toggle:hover { color: var(--text); }

/* ── App chat ── */
.container.app { max-width: none; padding: 0; }
.chatapp { display: grid; grid-template-columns: 1fr; height: calc(100vh - 61px); }
.chatapp.with-viewer { grid-template-columns: 1fr minmax(420px, 46%); }
.chat-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.conv { flex: 1; overflow-y: auto; padding: 26px 16px; }
.conv-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.turn { display: flex; }
.turn.user { justify-content: flex-end; }
.turn .bubble { padding: 12px 16px; border-radius: 14px; max-width: 86%; white-space: pre-wrap; line-height: 1.55; font-size: 15px; }
.turn.user .bubble { background: var(--c-smarald); color: var(--c-white); border-bottom-right-radius: 4px; }
.turn.assistant .bubble { background: var(--bubble); color: var(--text); border-bottom-left-radius: 4px; }
/* Assistant response footer: model label + 👍/👎 */
/* C-5 — Project Workspace (in the conversation area) */
.rp-name { cursor: pointer; }
.rp-name.active { color: var(--c-smarald); }
.pw { display: flex; flex-direction: column; gap: 14px; max-width: 980px; width: 100%; margin: 0 auto; }
.pw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pw-head h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.pw-desc { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pw-actiuni { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-stare { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-chip { font-family: var(--mono); font-size: 11.5px; padding: 3px 9px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.pw-chip b { color: var(--acc-cyan); font-weight: 600; }
.pw-chip--gol, .pw-chip--data { color: var(--muted); }
.pw-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.pw-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.pw-card h3 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pw-n { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.pw-sub { margin: 12px 0 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pw-hint { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.pw-memorie textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.pw-mem-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.pw-mem-n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pw-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pw-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent;
  border: 0; border-radius: 6px; padding: 7px 8px; color: var(--text); font: inherit; cursor: pointer; }
.pw-item:hover { background: var(--bubble); }
.pw-item-ico { flex: none; display: flex; }
.pw-item-nume { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pw-item-meta { flex: none; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pw-gol { margin: 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 760px) { .pw-grid { grid-template-columns: 1fr; } .pw-item-meta { display: none; } }

/* C-3 — card verdict normativ (token-uri --status-*; culoarea vine din stare) */
.verdict { --vc: var(--status-none); border: 1px solid var(--line); border-left: 4px solid var(--vc);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; background: var(--surface-2); }
.verdict--ok { --vc: var(--status-ok); }
.verdict--err { --vc: var(--status-err); }
.verdict--warn { --vc: var(--status-warn); }
.verdict--none { --vc: var(--status-none); }
.verdict-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdict-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--vc); flex: none; }
.verdict-stare { font-weight: 700; font-size: 13px; letter-spacing: .08em; color: var(--vc); }
.verdict-temei { font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--bubble);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; }
.verdict-motiv { margin-top: 6px; font-size: 14px; color: var(--text); }

.msg-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px;
  padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.msg-model { font-size: 11px; font-weight: 600; color: var(--muted);
  background: color-mix(in srgb, var(--c-smarald) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-smarald) 30%, transparent);
  border-radius: 999px; padding: 2px 9px; margin-right: auto; letter-spacing: .2px; }
.fb-btn { border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--text);
  border-radius: 8px; padding: 2px 8px; font-size: 14px; line-height: 1.2; opacity: .65;
  transition: opacity .12s, border-color .12s, background .12s; }
.fb-btn:hover { opacity: 1; }
.fb-btn.on { opacity: 1; border-color: var(--c-smarald); color: var(--c-smarald);
  background: color-mix(in srgb, var(--c-smarald) 16%, transparent); }
.fb-btn:disabled { opacity: .45; cursor: not-allowed; }
.fb-composer { margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); display: flex;
  flex-direction: column; gap: 8px; }
.fb-composer-hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.fb-composer-input { width: 100%; min-height: 72px; resize: vertical; padding: 8px 10px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit; line-height: 1.45; box-sizing: border-box; }
.fb-composer-input:focus { outline: 2px solid color-mix(in srgb, var(--c-smarald) 45%, transparent);
  outline-offset: 1px; border-color: var(--c-smarald); }
.fb-composer-meta { display: flex; justify-content: flex-end; }
.fb-composer-count { font-size: 11px; color: var(--muted); }
.fb-composer-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.fb-composer-skip, .fb-composer-send { border-radius: 8px; padding: 6px 12px; font-size: 13px;
  cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.fb-composer-send { border-color: var(--c-smarald);
  background: color-mix(in srgb, var(--c-smarald) 14%, transparent); font-weight: 600; }
.fb-composer-skip:hover, .fb-composer-send:hover { opacity: .92; }
.fb-composer-skip:disabled, .fb-composer-send:disabled { opacity: .5; cursor: not-allowed; }
.fb-composer-err, .fb-vote-err { margin: 0; font-size: 12px; color: #c0392b; }
@media (max-width: 640px) {
  .fb-composer-actions { flex-direction: column-reverse; align-items: stretch; }
  .fb-composer-skip, .fb-composer-send { width: 100%; text-align: center; }
}
/* Conversation delete button (discreet SVG, red on hover) — Alex's request */
.rail-del { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--muted); opacity: 0; transition: opacity .12s, color .12s, background .12s; }
.rail-conv:hover .rail-del, .rail-del:focus-visible { opacity: .8; }
.rail-del:hover { opacity: 1; color: #c0392b;
  background: color-mix(in srgb, #c0392b 12%, transparent); }
.rail-del svg { display: block; pointer-events: none; }

/* Detalii recomandate din plan (butoane „generează pe rând") */
.det-sugestii { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.det-chip { border: 1px solid color-mix(in srgb, var(--c-smarald) 40%, var(--line));
  background: color-mix(in srgb, var(--c-smarald) 8%, var(--card)); color: var(--text);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background .12s, border-color .12s; }
.det-chip:hover { background: color-mix(in srgb, var(--c-smarald) 18%, var(--card));
  border-color: var(--c-smarald); }
.det-chip:disabled { opacity: .5; cursor: default; }
.turn.assistant .bubble.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--c-smarald) 10%, var(--bubble)), var(--bubble));
  white-space: normal;
}
.thinking-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.thinking-mark i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-smarald);
  opacity: .45;
  animation: normPulse 1.15s ease-in-out infinite;
}
.thinking-mark i:nth-child(2) { animation-delay: .16s; }
.thinking-mark i:nth-child(3) { animation-delay: .32s; }
@keyframes normPulse {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-3px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .thinking-mark i { animation: none; opacity: .7; }
  .btn, .ws-composer .send, .attach-btn { transition: none; }
}
.ws-composer .send { border: 0; border-radius: 50%; width: 36px; height: 36px; background: var(--c-smarald);
  color: var(--c-white); font-size: 16px; font-weight: 700; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: filter .15s, transform .1s, box-shadow .15s; }
.ws-composer .send:hover { filter: brightness(1.1); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.ws-composer .send:active { transform: scale(0.92); filter: brightness(0.95); }
.ws-composer .send:focus-visible { outline: 2px solid var(--c-smarald); outline-offset: 2px; }
.ws-composer .send:disabled { background: var(--muted); box-shadow: none; cursor: not-allowed; }
.result-card { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.result-card .ttl { font-weight: 600; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 13px; }

/* Panou vizualizator (slide-in dreapta) */
.viewer-panel { display: none; flex-direction: column; border-left: 1px solid var(--line); background: var(--card); min-width: 0; }
.chatapp.with-viewer .viewer-panel { display: flex; }
.vp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--line); font-weight: 600; }
.vp-head button { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.vp-frame { flex: 1; border: 0; width: 100%; background: var(--c-white); }
@media (max-width: 900px) {
  .chatapp.with-viewer { grid-template-columns: 1fr; }
  .viewer-panel { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   Studio SPA — 3-column shell (rail / chat / artifact)
   Reuses .turn .bubble .composer-inner .send from the block above.
   ════════════════════════════════════════════════════════════════════════ */
.ws-body { margin: 0; overflow: hidden; height: 100vh; display: flex; flex-direction: column; }
.ws { flex: 1; min-height: 0; display: grid; grid-template-columns: 268px 1fr; position: relative; }
.ws.with-artifact { grid-template-columns: 268px 1fr minmax(420px, 44%); }

/* legal footer — thin strip across the full width, below the interface (not over the composer) */
.ws-footer { flex: none; display: flex; flex-wrap: wrap; gap: 4px 18px;
  justify-content: space-between; align-items: center; padding: 6px 16px;
  font-size: 11px; color: var(--muted); background: var(--card); border-top: 1px solid var(--line);
  opacity: 0.85; transition: opacity 0.2s; }
.ws-footer:hover { opacity: 1; }
.ws-footer a { color: var(--c-smarald); text-decoration: none; }
.ws-footer a:hover { text-decoration: underline; }
.wf-warn { color: var(--c-smarald); font-weight: 500; }
@media (max-width: 700px) { .ws-footer { justify-content: center; text-align: center; } }

/* LEFT */
.ws-rail { background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; }
.rail-top { padding: 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.rail-top .brand { margin-bottom: 4px; }
.rail-list { flex: 1; overflow-y: auto; padding: 8px; }
.rail-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 12px 8px 4px; }
.rail-proj { margin-bottom: 4px; }
.rp-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; }
.rp-head:hover { background: var(--bubble); }
.rp-name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-new { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.rp-new:hover { color: var(--text); }
.rp-convs { margin-left: 4px; }
.rail-conv { padding: 7px 10px 7px 22px; border-radius: 8px; font-size: 14px; color: var(--muted);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-conv:hover { background: var(--bubble); color: var(--text); }
.rail-conv.active { background: var(--bubble); color: var(--text); font-weight: 600; }
.rail-bottom { border-top: 1px solid var(--line); padding: 12px 14px; }
.storage { margin-bottom: 10px; }
.st-bar { height: 6px; border-radius: 99px; background: var(--bubble); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--c-smarald); }
.st-txt { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rail-menu { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.rail-menu a { color: var(--muted); } .rail-menu a:hover { color: var(--text); text-decoration: none; }
.rail-menu .theme-toggle { margin-left: auto; font-size: 18px; padding: 0; }

/* CENTRU */
.ws-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ws-topbar { display: flex; align-items: baseline; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: var(--card); }
/* Conversation title: on one line, with „…” — otherwise a long title would break word
   by word and cover the conversation. Full text is in title= (hover). */
.ws-title { font-weight: 600; flex: 0 1 auto; min-width: 0; max-width: 38%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-proj { color: var(--muted); font-size: 13px; }
.ws-conv { flex: 1; overflow-y: auto; padding: 26px 16px; }
.ws-conv-inner { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.ws-empty { display: none; }
.ws-suggest { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.ws-suggest button { border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 11px 14px; cursor: pointer; text-align: left; font-size: 14px; }
.ws-suggest button:hover { border-color: var(--c-smarald); }
.ws-composer {
  border-top: 1px solid var(--line); background:
    linear-gradient(180deg, color-mix(in srgb, var(--card) 86%, transparent), var(--card));
  padding: 14px 16px;
}
.agent-starters { width: 100%; margin: 0 0 10px; display: flex; gap: 8px; overflow-x: auto;
  padding: 1px 1px 4px; scrollbar-width: thin; }
.agent-starters.hidden { display: none; }
.agent-starter { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--text); padding: 7px 11px; font: 500 12px/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.agent-starter:hover, .agent-starter:focus-visible { border-color: var(--agent-color, var(--c-smarald));
  background: var(--bubble); outline: none; }
.ws-composer .composer-inner { width: 100%; margin: 0; display: flex; gap: 8px; align-items: flex-end;
  border: 1px solid var(--line); border-radius: 20px; padding: 9px; background: var(--input-bg);
  box-shadow: 0 10px 34px rgba(22,33,54,.07); transition: border-color .18s, box-shadow .18s; }
.ws-composer .composer-inner:focus-within {
  border-color: color-mix(in srgb, var(--c-smarald) 62%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-smarald) 12%, transparent), 0 16px 42px rgba(22,33,54,.10);
}
.ws-composer textarea { flex: 1; border: 0; background: transparent; resize: none; max-height: 200px;
  padding: 7px 4px; color: var(--text); font-family: var(--font); font-size: 15px; }
.ws-composer textarea:focus { outline: none; }
/* sr-only — accessible hidden file input */
.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; }

/* Menu wrapper ＋ attachment */
.attach-wrap { position: relative; flex: none; }
.attach-btn { width: 36px; height: 36px; border-radius: 12px; border: 1px solid transparent; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: background .15s, color .15s, border-color .15s; }
.attach-btn:hover { background: var(--bubble); color: var(--text); border-color: var(--line); }

/* Popup meniu */
.attach-menu { position: absolute; bottom: calc(100% + 10px); left: 0; min-width: 230px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 46px rgba(22,33,54,.18); padding: 7px; z-index: 200; }
.attach-menu.hidden { display: none; }
.attach-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 0; background: transparent; cursor: pointer; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text); text-align: left; }
.attach-item:hover { background: color-mix(in srgb, var(--c-smarald) 8%, var(--bubble)); }
.attach-item svg { color: var(--muted); flex-shrink: 0; }
.attach-sep { height: 1px; background: var(--line); margin: 4px 0; }
/* toggle item — web search */
.attach-item--toggle { justify-content: space-between; }
.toggle-pill { width: 28px; height: 16px; border-radius: 8px; background: var(--line); position: relative;
  transition: background .2s; flex-shrink: 0; }
.toggle-pill::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: white; transition: transform .2s; }
.toggle-pill.on { background: var(--c-smarald); }
.toggle-pill.on::after { transform: translateX(12px); }

/* Active web search textarea — subtle border */
.ws-composer textarea.ws-active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-smarald) 30%, transparent); }

/* Buton STOP */
.btn-stop { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text); flex: none; }
.btn-stop:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.btn-stop.hidden { display: none; }
.send.hidden { display: none; }

/* artifact cards in chat */
.art-card { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; max-width: 100%; }
.art-card:hover { border-color: var(--c-smarald); }
.ac-icon { font-size: 20px; flex: none; display: inline-flex; align-items: center; }
/* SVG file icons: monochrome, inherit theme color; DXF receives the accent */
.ico { display: inline-flex; width: 22px; height: 22px; color: var(--muted); }
/* Icons from the _icons.html sprite: size = 1em (follows text), color = currentColor.
   .ic-lg / .ic-xl variants for site cards. */
.ic { display: inline-block; width: 1em; height: 1em; vertical-align: -0.16em; fill: none; stroke: currentColor;
      stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-lg { width: 1.35em; height: 1.35em; vertical-align: -0.3em; }
.ic-xl { width: 32px; height: 32px; }
.td-ok { color: var(--c-success); text-align: center; position: relative; /* anchor .sr-only in the cell, not the document */ }
.td-ok .ic { width: 1.2em; height: 1.2em; stroke-width: 2; }
.btn .ic, .icon-btn .ic { margin-right: .35em; }
.btn .ic:only-child, .icon-btn .ic:only-child { margin-right: 0; }
.dxf-type-icon, .feat-icon, .card-icon, .man-icon, .cover-logo { color: var(--c-smarald); }
.dxf-type-icon .ic, .feat-icon .ic { width: 32px; height: 32px; }
.card-icon .ic { width: 24px; height: 24px; }
.cover-logo .ic { width: 44px; height: 44px; }
.man-icon .ic { width: 22px; height: 22px; }
.feat-chip .ic, .norms-col-title .ic, .hero-badge .ic, .dxf-badge .ic { margin-right: .3em; }
.fb-btn .ic { width: 18px; height: 18px; vertical-align: middle; }
.bubble-warn > .ic-warn { color: var(--c-warning); margin-right: .35em; }
.ico svg { width: 100%; height: 100%; }
.ico-dxf { color: var(--c-smarald); }
.ico-pdf { color: var(--c-error); }
.ico-img { color: var(--c-indigo); }
.ico-xlsx { color: var(--c-success); }
.art-card:hover .ico { color: var(--text); }
.ad-icon .ico { width: 56px; height: 56px; }
.fp-icon .ico { width: 18px; height: 18px; }
.ac-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-err { margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(228, 179, 14, 0.12); color: var(--text); font-size: 13px; border: 1px solid rgba(228, 179, 14, 0.25); }

/* DREAPTA: panou artefact */
.ws-artifact { display: none; flex-direction: column; border-left: 1px solid var(--line); background: var(--card); min-width: 0; }
.ws.with-artifact .ws-artifact { display: flex; }
.art-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.art-head #art-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.icon-btn:hover { color: var(--text); }
.art-body { flex: 1; min-height: 0; }
.art-frame { width: 100%; height: 100%; border: 0; background: transparent; }
.art-doc { text-align: center; padding: 44px 24px; color: var(--muted); }
.ad-icon { font-size: 48px; }
.ad-name { font-weight: 600; color: var(--text); margin: 10px 0 16px; word-break: break-all; }
.ad-hint { font-size: 12px; margin-top: 12px; }

@media (max-width: 980px) {
  .ws, .ws.with-artifact { grid-template-columns: 1fr; }
  .ws.with-artifact .ws-artifact { position: fixed; inset: 0; z-index: 50; }
}

@media (max-width: 640px) {
  /* The actual height comes from visualViewport (see app.js: syncViewport) — on
     iOS/Android the soft-keyboard shrinks the visualViewport, but NOT `dvh`/`vh`,
     so without this the composer remains hidden under the keyboard. `--app-vh` is
     set in px by JS; `100dvh` is just a fallback until the script runs. */
  .ws-body { height: var(--app-vh, 100dvh); }
  .ws { grid-template-columns: 1fr; }
  .ws-topbar {
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
  }
  .ws-title {
    min-width: 0;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }
  .ws-proj { display: none; }
  .effort { gap: 4px; }
  .effort span { display: none; }
  .effort select { max-width: 92px; padding: 5px 7px; }
  #btn-gen-dxf { display: none; }
  .ws-conv { padding: 18px 10px; }
  .ws-conv-inner { gap: 14px; }
  .turn .bubble {
    max-width: 94%;
    padding: 11px 13px;
    font-size: 14px;
  }
  .ws-composer {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }
  .ws-composer .composer-inner {
    border-radius: 18px;
    padding: 7px;
    gap: 6px;
  }
  .ws-composer textarea { font-size: 16px; max-height: 128px; }
  .attach-btn, .btn-stop, .ws-composer .send {
    width: 38px;
    height: 38px;
  }
  .attach-menu {
    min-width: min(260px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }
  .agents-sidebar.mobile-open, .ws-rail.mobile-open {
    inset: 0 12% 0 0;
  }
  .art-toolbar { overflow-x: auto; }
  .ws-footer {
    justify-content: flex-start;
    text-align: left;
    padding: 5px 96px 5px 10px;
    font-size: 10px;
    line-height: 1.35;
  }
  .ws-footer span:nth-child(2) { display: none; }
  .token-bar { right: 6px; bottom: env(safe-area-inset-bottom); }
  .token-bar-toggle { padding: 4px 8px; font-size: 10px; }
}

/* Footer with disclaimer and copyright */
.footer { border-top: 1px solid var(--line); padding: 24px 28px; margin-top: 40px;
  background: var(--card); font-size: 13px; color: var(--muted); }
.footer-content { max-width: 960px; margin: 0 auto; }
.disclaimer { padding: 12px 16px; border-radius: 8px; background: rgba(42, 96, 84, 0.06);
  border: 1px solid rgba(42, 96, 84, 0.15); margin-bottom: 16px; line-height: 1.6; }
.disclaimer strong { color: var(--c-smarald); font-weight: 600; }
.copyright { text-align: center; color: var(--muted); font-size: 12px; }
.copyright a { color: var(--c-smarald); text-decoration: underline; text-underline-offset: 2px; }  /* link distinguished not just by color (a11y, audit 19.09) */
.copyright a:hover { text-decoration: underline; }

/* hamburger button — opens the assistant sidebar on mobile (hidden on desktop) */
.ws-mobile-agents-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); cursor: pointer;
}
.agents-backdrop { display: none; }

/* effort selector in topbar */
.ws-spacer { flex: 1; }
.effort { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.effort select { width: auto; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--input-bg); color: var(--text); font-size: 12px; }

/* parameter panel for room plans (instant editing) */
.art-body { display: flex; flex-direction: column; }
.art-frame { flex: 1; min-height: 0; }
.art-params { flex: none; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.art-params.busy { opacity: .55; pointer-events: none; }
.ap-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.ap-f { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); margin: 0; }
.ap-f > span { white-space: nowrap; }
.ap-f input[type="number"], .ap-f select { width: auto; min-width: 72px; padding: 4px 6px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); color: var(--text); }
.ap-bool { flex-direction: row; align-items: center; gap: 5px; }
.ap-bool input { width: auto; }

/* ── MAN execution chart editor (plan 049) ───────────────────────
   APPLICATION panel, not iframe: the HTML artifact is served with CSP `sandbox`
   (opaque origin, no session), so it couldn't call the API. See the long comment
   in app.js::openPlanificareEditor. Bar colors come from the server-generated
   SVG (`planificare_cpm._CULORI_CATEGORII`) — here we only style the surrounding
   chrome and editing affordances.                                */
.pl-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pl-top { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.pl-rezumat { flex: 1; min-width: 180px; font-size: 12px; color: var(--muted); }
.pl-rezumat b { color: var(--text); }
.pl-actiuni { display: flex; align-items: center; gap: 8px; flex: none; }
.pl-stare { font-size: 11px; color: var(--muted); max-width: 260px; }
.pl-stare.eroare { color: #c0392b; font-weight: 600; }
.pl-canvas { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; background: var(--bg); }
.pl-canvas.busy { opacity: .6; pointer-events: none; }
.pl-canvas svg { display: block; }
.pl-canvas .grila { stroke: var(--line); stroke-width: 1; }
.pl-canvas .axa, .pl-canvas .axa-titlu { font-size: 10px; fill: var(--muted); }
.pl-canvas .axa { text-anchor: middle; }
.pl-canvas .eticheta { font-size: 12px; fill: var(--text); text-anchor: end; }
.pl-canvas .critic-txt { font-weight: 600; fill: #C00000; }
.pl-canvas .dep { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .75; }
.pl-canvas .dep-varf { fill: var(--muted); opacity: .75; }
.pl-canvas .bara { cursor: pointer; }
.pl-canvas .bara:hover { stroke: var(--text); stroke-width: 1.5; }
.pl-canvas .bara.sel { stroke: var(--text); stroke-width: 2; }
/* duration handle: invisible until hover, but always grabbable */
.pl-canvas .maner { fill: transparent; cursor: ew-resize; }
.pl-canvas .maner:hover { fill: var(--text); fill-opacity: .35; }
.pl-canvas svg.trage { cursor: ew-resize; }
.pl-legenda { flex: none; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 12px;
  font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.pl-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 4px; vertical-align: -1px; }
.pl-form { flex: none; max-height: 46%; overflow-y: auto; padding: 8px 12px;
  border-top: 1px solid var(--line); background: var(--card); }
.pl-form-cap { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pl-form-cap strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.pl-f { display: flex; flex-direction: column; gap: 3px; font-size: 11px;
  color: var(--muted); margin: 6px 0 0; }
.pl-f > span { white-space: nowrap; }
.pl-f input, .pl-f select { width: auto; min-width: 120px; padding: 4px 6px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); color: var(--text); }
.pl-f input[type="number"] { min-width: 76px; }
.pl-preds { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pl-pred { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12px;
  color: var(--text); }
.pl-pred input { width: auto; }
/* ES/EF/LS/LF: calculated by the engine → DISPLAYED, not editable (no fields) */
.pl-calc { margin-top: 8px; font-size: 11px; color: var(--muted); }
.pl-hint { font-size: 12px; color: var(--muted); }
.pl-fara-spec { flex: none; padding: 10px 12px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line); background: var(--card); }

/* ── editor livrabile de management (editor MAN) ─────────────────────────── */
.lv-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.lv-top { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.lv-titlu { flex: 1; font-weight: 600; color: var(--text); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-actiuni { display: flex; align-items: center; gap: 8px; flex: none; }
.lv-stare { font-size: 11px; color: var(--muted); max-width: 240px; }
.lv-stare.eroare { color: #c0392b; font-weight: 600; }
/* Two columns: the form (editable) and the preview (iframe sandbox). On
   narrow screens they stack vertically. */
.lv-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lv-form { min-height: 0; overflow-y: auto; padding: 10px 12px; background: var(--bg);
  border-right: 1px solid var(--line); }
.lv-frame { min-height: 0; width: 100%; height: 100%; border: 0; background: var(--c-white); }
@media (max-width: 1100px) {
  .lv-cols { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .lv-form { border-right: 0; border-bottom: 1px solid var(--line); }
}
.lv-camp { display: block; margin: 0 0 8px; }
.lv-camp .lv-k { display: block; font-size: 11px; color: var(--muted); margin: 0 0 3px; }
.lv-in { width: 100%; padding: 5px 7px; font-size: 13px; font-family: inherit;
  color: var(--text); background: var(--input-bg); border: 1px solid var(--line);
  border-radius: 7px; box-sizing: border-box; }
.lv-in:focus { outline: none; border-color: var(--c-smarald);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-smarald) 22%, transparent); }
textarea.lv-in { resize: vertical; min-height: 34px; line-height: 1.4; }
.lv-grup { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px 10px;
  margin: 0 0 10px; background: var(--card); min-width: 0; }
.lv-grup > legend { font-size: 11px; font-weight: 600; color: var(--text);
  padding: 0 5px; text-transform: uppercase; letter-spacing: .3px; }
.lv-tab-wrap { overflow-x: auto; }
.lv-tab { width: 100%; border-collapse: collapse; font-size: 12px; }
.lv-tab th { text-align: left; color: var(--muted); font-weight: 600; padding: 3px 5px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.lv-tab td { padding: 3px 4px; vertical-align: top; }
.lv-tab td .lv-in { min-width: 90px; }
.lv-td-obj { min-width: 140px; }
.lv-td-obj .lv-grup { margin: 0; padding: 4px 6px 6px; }
.lv-td-obj .lv-camp { margin-bottom: 4px; }
.lv-lista { display: flex; flex-direction: column; gap: 5px; }
.lv-rand { display: flex; align-items: center; gap: 6px; }
.lv-del { flex: none; border: 1px solid var(--line); background: var(--bg);
  color: var(--muted); border-radius: 6px; width: 24px; height: 24px; cursor: pointer;
  font-size: 12px; line-height: 1; padding: 0; }
.lv-del:hover { color: #c0392b; border-color: #c0392b; }
.lv-add { margin-top: 6px; border: 1px dashed var(--line); background: transparent;
  color: var(--c-smarald); border-radius: 7px; padding: 4px 10px; cursor: pointer;
  font-size: 12px; font-weight: 600; font-family: inherit; }
.lv-add:hover { border-color: var(--c-smarald);
  background: color-mix(in srgb, var(--c-smarald) 8%, transparent); }

/* Buton NormArchAI Editor 2D DXF (Premium Feature) */
.btn-dxf-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-left: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-smarald) 0%, #1d4a42 100%);
  color: var(--c-white);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(42, 96, 84, 0.2);
  transition: all 0.25s ease;
  position: relative;
}

.btn-dxf-editor:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 96, 84, 0.35);
  text-decoration: none;
}

.btn-dxf-editor svg {
  flex-shrink: 0;
}

.premium-badge {
  display: inline-block;
  padding: 2px 6px;
  margin-left: 4px;
  border-radius: 4px;
  background: var(--c-ocru);
  color: var(--c-indigo);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dark mode adjustments */
[data-theme="dark"] .btn-dxf-editor {
  background: linear-gradient(135deg, #2d7a6d 0%, var(--c-smarald) 100%);
  box-shadow: 0 2px 8px rgba(42, 96, 84, 0.4);
}

[data-theme="dark"] .btn-dxf-editor:hover {
  box-shadow: 0 4px 12px rgba(42, 96, 84, 0.6);
}

/* preview DXF full-fidelity (imagine) + comutare la interactiv */
/* `min-height` in pixels, not 0: on a panel with verification open,
   `flex:1` with `min-height:0` left the drawing a sliver from which nothing
   could be understood. 320px is the minimum at which a technical section can be
   read; below that, it's better to scroll the panel. */
.art-dxf { flex: 1; min-height: 320px; overflow: auto; display: flex;
  align-items: center; justify-content: center; background: var(--bg); }
.art-png { max-width: 100%; max-height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.art-dxf iframe { width: 100%; height: 100%; border: 0; background: transparent; }
.art-src-note { flex: none; padding: 8px 12px; font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--c-smarald) 8%, transparent); }
.job-avert { margin-top: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px;
  background: color-mix(in srgb, var(--c-warning) 16%, transparent); color: var(--text); }
.job-calitate { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.job-calitate .jc-text b { color: var(--text); }
.verif-scoruri { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.vs-item { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--muted); }
.vs-item b { color: var(--text); }
.vs-item.ok { background: color-mix(in srgb, var(--c-success) 14%, transparent); border-color: transparent; }
.vs-item.warn { background: color-mix(in srgb, var(--c-warning) 16%, transparent); border-color: transparent; }
.vs-item.err { background: color-mix(in srgb, var(--c-error) 14%, transparent); border-color: transparent; }
.art-toolbar { flex: none; padding: 6px 12px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; background: var(--card); }

/* ── Transparency: verification certificate + assumption ledger ──────────────
   The certificate states how much of the drawing was MEASURED; the ledger states
   what was ASSUMED. Both sit under the drawing, collapsed by default: the
   information is one click away, not in the way. */
.art-verif { flex: none; border-top: 1px solid var(--line); background: var(--card);
  font-size: 13px; }
.art-verif > summary { padding: 8px 12px; cursor: pointer; display: flex;
  align-items: center; gap: 8px; list-style: none; user-select: none; }
.art-verif > summary::-webkit-details-marker { display: none; }
.art-verif > summary::after { content: "▾"; margin-left: auto; color: var(--muted);
  transition: transform .15s ease; }
.art-verif[open] > summary::after { transform: rotate(180deg); }
.art-verif > summary:hover { background: var(--bubble); }

.verif-scor { font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.verif-scor.ok   { background: rgba(42, 96, 84, .12);  color: var(--c-success); }
.verif-scor.warn { background: rgba(228, 179, 14, .16); color: #8a6d05; }
.verif-scor.err  { background: rgba(138, 28, 28, .10);  color: var(--c-error); }
.verif-eticheta { color: var(--muted); }

.verif-body { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.verif-grup { display: flex; flex-direction: column; gap: 4px; }
.verif-grup h4 { margin: 0; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.verif-grup.actiune h4 { color: #8a6d05; }
/* Fidelity gate: the drawing does not seem to correspond to the request. */
.verif-alerta { background: color-mix(in srgb, var(--c-error) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-error) 45%, transparent);
  color: var(--c-error); border-radius: 8px; padding: 8px 10px; font-size: 12.5px;
  font-weight: 600; line-height: 1.35; margin-bottom: 4px; }
.verif-grup.verif-review h4 { color: var(--c-error); }

.verif-lista { list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 3px; }
.verif-lista li { display: flex; gap: 8px; align-items: baseline;
  padding: 4px 8px; border-radius: 6px; background: var(--bubble); }
.verif-marime { flex: 1; min-width: 0; }
.verif-valoare { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.verif-nota { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.verif-stare { font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.verif-stare.PASS { background: rgba(42, 96, 84, .12);  color: var(--c-success); }
.verif-stare.WARN { background: rgba(228, 179, 14, .16); color: #8a6d05; }
.verif-stare.FAIL { background: rgba(138, 28, 28, .10);  color: var(--c-error); }
.verif-stare.SKIP { background: var(--bubble); color: var(--muted); }

.verif-gol { color: var(--muted); padding: 4px 0; }

.zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-modal.hidden { display: none; }

.zoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 22, 0.75);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.zoom-shell {
  position: relative;
  z-index: 1;
  width: min(94vw, 1480px);
  height: min(92vh, 980px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.zoom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.zoom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.zoom-badge {
  min-width: 62px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bubble);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.zoom-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto;
  cursor: grab;
  touch-action: none;
}

.zoom-stage.dragging { cursor: grabbing; }

.zoom-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 92%;
  max-height: 92%;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.24);
}

/* ── GENERARE DXF AI —————————————————————————————————————————————————— */

.btn-gen-dxf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-lavanda) 0%, #9c85a8 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(130, 109, 142, 0.3);
}

.btn-gen-dxf:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(130, 109, 142, 0.5);
}

.btn-gen-dxf svg {
  flex-shrink: 0;
}

[data-theme="dark"] .btn-gen-dxf {
  background: linear-gradient(135deg, #9c85a8 0%, var(--c-lavanda) 100%);
}

/* Upload Image button */
.btn-upload-img {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-smarald) 0%, #3a8074 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(42, 96, 84, 0.3);
}

.btn-upload-img:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(42, 96, 84, 0.5);
}

.btn-upload-img svg {
  flex-shrink: 0;
}

[data-theme="dark"] .btn-upload-img {
  background: linear-gradient(135deg, #3a8074 0%, var(--c-smarald) 100%);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(22, 33, 54, 0.28);
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-smarald) 7%, transparent), transparent);
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.modal-body { padding: 22px; }

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}

.form-group label .muted {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--c-smarald);
  box-shadow: 0 0 0 3px rgba(42, 96, 84, 0.1);
}

.form-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.form-actions button[type="submit"] {
  background: linear-gradient(135deg, var(--c-smarald) 0%, #347060 100%);
  padding: 12px 24px;
}

.form-actions button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(42, 96, 84, 0.4);
}

/* Dark mode modal */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* ── Utility classes (replacing inline styles) ───────────────────── */
.hidden { display: none; }
.modal--sm .modal-content { max-width: 520px; }
.btn--danger { color: var(--c-error); }
.alert--mt { margin-top: 1rem; }
.upload-form-group { margin-bottom: 1rem; }
.upload-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.upload-file-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
}
.upload-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text);
  margin: 0.35rem 0;
}
.upload-checkbox-label input[type="checkbox"], .upload-checkbox-label input[type="radio"] { width: auto; margin: 0; }
.upload-checkbox-label span { font-weight: 500; }
.upload-hint {
  margin: 0.7rem 0 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--c-smarald) 5%, var(--bubble));
  font-size: 0.875rem;
  color: var(--muted);
}
.upload-hint--no-indent { margin-left: 0; }
.upload-hint-json { margin: 0; }
.upload-opts { border-top: 1px solid var(--line, #e5e7eb); padding-top: 0.75rem; margin-top: 0.5rem; }
.upload-opts-title { margin-bottom: 0.375rem; }
.upload-intrebare { margin-top: 0.5rem; width: 100%; box-sizing: border-box; }
.upload-cleanup-lbl { margin-top: 0.5rem; }
.upload-select-model { margin-top: 0.25rem; width: 100%; }

.modal-content--phase1 { max-width: 680px; }
.phase1-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.phase1-wide { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .phase1-grid { grid-template-columns: 1fr; }
  .phase1-wide { grid-column: auto; }
}
.analiza-raspuns { white-space: pre-wrap; line-height: 1.6; font-size: 0.95rem; }
.job-meta { margin-top: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.job-nota-fallback {
  margin: 0.5rem 0; padding: 0.6rem 0.8rem; border-radius: 8px;
  background: color-mix(in srgb, #F9C74F 18%, transparent);
  border: 1px solid color-mix(in srgb, #F9C74F 45%, transparent);
  font-size: 0.85rem; line-height: 1.5;
}
.job-assumptions {
  margin: 0.5rem 0; padding: 0.6rem 0.8rem; border-radius: 8px;
  background: color-mix(in srgb, #6c8ebf 14%, transparent);
  border: 1px solid color-mix(in srgb, #6c8ebf 40%, transparent);
  font-size: 0.82rem; line-height: 1.5;
}
.job-assumptions-titlu { font-weight: 600; margin-bottom: 0.25rem; }
.job-assumptions ul { margin: 0; padding-left: 1.1rem; }
.hr-light { border: 0; border-top: 1px solid var(--line, #e5e7eb); }

/* ── Specialized agents sidebar ─────────────────────────────────────── */
/* ── Assistant sidebar ───────────────────────────────────────────────── */
.agents-sidebar {
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 0 14px;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 0;
  scrollbar-width: none;
  width: 196px;
  min-width: 196px;
  transition: width .25s ease, min-width .25s ease, opacity .2s ease;
  position: relative;
}
.agents-sidebar::-webkit-scrollbar { display: none; }

.agents-sidebar.collapsed {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

/* Mobile: the sidebar is hidden by default; the hamburger button opens it as an
   overlay over the entire screen, with a background to close on tap. It must be
   declared HERE (after the base .agents-sidebar/.collapsed rules above), not in
   an @media placed earlier in the file — otherwise the base rule (same specificity,
   declared later) wins the cascade and the sidebar remains visible on mobile. */
@media (max-width: 980px) {
  .ws-rail, .agents-sidebar { display: none; }
  .sidebar-tab { display: none !important; }
  .ws-mobile-agents-btn { display: inline-flex; }
  .agents-sidebar.mobile-open, .ws-rail.mobile-open {
    display: flex;
    position: fixed; inset: 0 20% 0 0;
    z-index: 60;
    width: auto; min-width: 0; opacity: 1; pointer-events: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .agents-backdrop.mobile-open {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 55;
  }
}

/* Header cu buton toggle */
.agents-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 4px 12px;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.agents-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--text); background: var(--bubble); }

/* Tab visible when sidebar is closed — placed in .ws (position:relative) */
.sidebar-tab {
  position: absolute;
  left: 268px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 52px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  z-index: 10;
  transition: color .15s, background .15s;
}
.sidebar-tab:hover { color: var(--text); background: var(--bubble); }

/* Grup label */
.agents-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px 3px;
}

/* Agent buttons — horizontal: icon + text */
.agent-btn {
  width: 100%;
  padding: 7px 10px 7px 12px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  transition: background .12s, border-color .12s;
  color: var(--text);
  text-align: left;
}
.agent-btn:hover {
  background: var(--bubble);
  border-left-color: var(--line);
}
.agent-btn.active {
  background: color-mix(in srgb, var(--agent-color, var(--c-smarald)) 10%, transparent);
  border-left-color: var(--agent-color, var(--c-smarald));
}

/* Icon SVG */
.agent-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color .12s;
}
.agent-icon svg { width: 16px; height: 16px; }
.agent-btn:hover .agent-icon { color: var(--text); }
.agent-btn.active .agent-icon { color: var(--agent-color, var(--c-smarald)); }

/* Denumire asistent */
.agent-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  transition: color .12s;
}
.agent-btn:hover .agent-name { color: var(--text); }
.agent-btn.active .agent-name { color: var(--text); font-weight: 600; }

/* ── Attachment preview in composer ─────────────────────────────────── */
.attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bubble);
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
}
.attach-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.attach-name {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.attach-remove:hover { color: var(--text); background: var(--line); }

/* ── Token bar ─────────────────────────────────────────────────────── */
.token-bar {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.token-bar-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.token-bar-toggle:hover { color: var(--text); background: var(--bubble); }
.token-bar-toggle svg { opacity: .7; }

/* Expanded panel */
.token-bar-panel {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px 0 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.10);
  overflow: hidden;
}
.token-bar-panel.hidden { display: none; }

.tbp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.tbp-title { font-size: 13px; font-weight: 700; color: var(--text); }
.tbp-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 2px 6px; border-radius: 4px;
}
.tbp-close:hover { color: var(--text); background: var(--bubble); }

.tbp-body { padding: 14px 16px 16px; overflow-y: auto; max-height: 360px; }
.tbp-loading { color: var(--muted); font-size: 12px; text-align: center; padding: 20px; }
.tbp-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 24px; }

/* Carduri sumar */
.tbp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.tbp-card {
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.tbp-card-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 4px; }
.tbp-big { font-size: 22px; font-weight: 700; color: var(--text); }
.tbp-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.tbp-cost { font-size: 11px; color: var(--c-smarald); margin-top: 4px; font-weight: 600; }

/* Weekly chart */
.tbp-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 12px 0 8px; }
.tbp-weeks { display: flex; gap: 8px; align-items: flex-end; height: 70px; }
.tbp-week { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; height: 100%; justify-content: flex-end; }
.tbp-week-bar { width: 100%; flex: 1; background: var(--bubble); border-radius: 3px 3px 0 0; position: relative; overflow: hidden; }
.tbp-week-fill { position: absolute; bottom: 0; left: 0; right: 0; background: var(--c-smarald); border-radius: 3px 3px 0 0; transition: height .4s ease; opacity: .7; }
.tbp-week-val { font-size: 9px; color: var(--text); font-weight: 600; }
.tbp-week-label { font-size: 9px; color: var(--muted); }

/* Tabel modele */
.tbp-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px; }
.tbp-table th { text-align: left; padding: 4px 6px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.tbp-table td { padding: 5px 6px; border-bottom: 1px solid var(--bubble); color: var(--text); }
.tbp-table tr:last-child td { border-bottom: none; }
.tbp-model-name { font-weight: 600; color: var(--c-smarald); }

/* ── Landing page ───────────────────────────────────────────────────────── */
.landing-page { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.hero-section { text-align: center; padding: 4rem 0 3rem; }
.hero-badge {
  display: inline-block; background: color-mix(in srgb, var(--c-smarald) 15%, transparent);
  color: var(--c-smarald); border: 1px solid color-mix(in srgb, var(--c-smarald) 30%, transparent);
  border-radius: 2rem; padding: .35rem 1rem; font-size: .8rem; font-weight: 600;
  letter-spacing: .03em; margin-bottom: 1.5rem;
}
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; margin: 0 0 1.2rem; }
.accent-gradient {
  background: linear-gradient(135deg, #2a6054, #4da898);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { font-size: 1.15rem; max-width: 640px; margin: 0 auto 2rem; color: var(--muted); line-height: 1.6; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.hero-note { font-size: .85rem; margin-top: 1rem; }

.stats-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 1rem;
  overflow: hidden; margin: 2rem 0 3rem;
}
.stat-item { background: var(--card); padding: 1.5rem 1rem; text-align: center; }
.stat-num { display: block; font-size: 1.55rem; font-weight: 800; color: var(--c-smarald); }
.stat-lbl { font-size: .8rem; color: var(--muted); }

.section-title { text-align: center; font-size: 1.8rem; font-weight: 700; margin: 0 0 .5rem; }
.section-sub { text-align: center; margin-bottom: 2.5rem; }

.features-section, .examples-section, .how-section, .pricing-section, .norms-section { margin: 3rem 0; }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem;
}
.features-grid--core { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: .75rem;
  padding: 1.5rem; transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); transform: translateY(-1px); }
.feature-icon {
  width: 2rem; height: 2rem; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: .75rem; color: var(--c-smarald); border: 1px solid color-mix(in srgb, var(--c-smarald) 30%, transparent);
  background: color-mix(in srgb, var(--c-smarald) 8%, transparent); font-weight: 800;
}
.feature-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }

.examples-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.example-card {
  background: var(--card); border: 1px solid var(--line); border-radius: .85rem; padding: 1rem 1.1rem;
  color: var(--text); box-shadow: 0 1px 0 rgba(22,33,54,.02);
}

.steps { display: flex; align-items: flex-start; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.step { max-width: 240px; text-align: center; }
.step-num {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--c-smarald); color: #fff;
  font-size: 1.1rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: .75rem;
}
.step h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; }
.step-arrow { font-size: 1.5rem; color: var(--muted); align-self: center; margin-top: -1rem; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; justify-content: center; }
.pricing-card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 2rem 1.5rem; position: relative; text-align: center; }
.pricing-featured { border-color: var(--c-smarald); border-width: 2px; box-shadow: 0 4px 24px rgba(42,96,84,.15); }
.pricing-badge {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%); background: var(--c-smarald); color: #fff;
  font-size: .75rem; font-weight: 700; padding: .25rem .9rem; border-radius: 0 0 .5rem .5rem; white-space: nowrap;
}
.pricing-name { font-weight: 700; font-size: 1.1rem; margin-bottom: .5rem; }
.price-amount { font-size: 2rem; font-weight: 800; color: var(--c-smarald); }
.pricing-desc { font-size: .9rem; margin: .75rem 0 .5rem; }
.pricing-limit { font-size: .8rem; }

.norms-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
.norms-col-title { font-size: .95rem; font-weight: 700; margin-bottom: .75rem; color: var(--text, #111); }
.norms-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.norm-chip { background: var(--card); border: 1px solid var(--line); border-radius: 2rem; padding: .35rem .9rem; font-size: .82rem; font-weight: 500; white-space: nowrap; }
.norm-chip--highlight { background: var(--c-smarald); color: #fff; border-color: transparent; font-weight: 600; }
.norms-note { text-align: center; margin-top: 1.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.pricing-note-free { margin: .5rem 0; font-size: .78rem; line-height: 1.5; }

.cta-section {
  text-align: center; background: linear-gradient(135deg, #162136, #2a6054); color: #fff;
  border-radius: 1.2rem; padding: 3.5rem 2rem; margin: 3rem 0 2rem;
}
.cta-section h2 { font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: .75rem; }
.cta-section p { color: rgba(255,255,255,.75); margin-bottom: 1.5rem; }
.cta-section .btn-lg { background: #fff; color: #162136; font-weight: 700; }
.cta-section .btn-lg:hover { background: #e8f4f2; }

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page { max-width: 980px; }
.auth-shell { display: grid; grid-template-columns: minmax(320px, 430px) 1fr; gap: 1.5rem; align-items: stretch; }
.auth-card { margin: 0; }
.auth-kicker {
  margin: 0 0 .4rem; color: var(--c-smarald); font-size: .78rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.form-hint { margin: .45rem 0 0; color: var(--muted); font-size: .82rem; }
.auth-aside {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--c-smarald) 22%, transparent), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--c-indigo) 98%, #fff), color-mix(in srgb, var(--c-smarald) 72%, var(--c-indigo)));
  color: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center;
}
.auth-aside h2 { color: #fff; font-size: 1.55rem; line-height: 1.25; margin: .9rem 0 1rem; }
.auth-badge {
  align-self: flex-start; border: 1px solid rgba(255,255,255,.24); border-radius: 999px;
  padding: .28rem .75rem; color: rgba(255,255,255,.86); font-size: .78rem; font-weight: 700;
}
.auth-points { margin: 0; padding-left: 1.15rem; color: rgba(255,255,255,.86); }
.auth-points li { margin: .45rem 0; }
.auth-note { margin: 1.2rem 0 0; color: rgba(255,255,255,.72); font-size: .9rem; }

@media (max-width: 760px) {
  .auth-page { max-width: 460px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .hero-section { padding-top: 2.5rem; }
  .step-arrow { display: none; }
}

/* ── Billing page ─────────────────────────────────────────────────────────── */
.billing-page { max-width: 1080px; }
.billing-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  margin: 1.5rem 0 1.75rem; padding: 2rem;
  border: 1px solid var(--line); border-radius: 1.2rem;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--c-smarald) 14%, transparent), transparent 34%),
    var(--card);
  box-shadow: var(--shadow);
}
.billing-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12; margin: 0 0 .65rem; }
.billing-hero p { max-width: 650px; margin: 0; }
.billing-current {
  min-width: 160px; display: grid; gap: .45rem; justify-items: end;
  padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--bg);
}
.billing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; align-items: stretch; }
.billing-card {
  position: relative; margin: 0; display: flex; flex-direction: column; gap: .9rem;
  padding: 1.55rem; border-radius: 1rem;
}
.billing-card--featured {
  border-color: var(--c-smarald); border-width: 2px;
  box-shadow: 0 18px 44px rgba(42,96,84,.16);
}
.billing-plan-name { font-size: 1.05rem; font-weight: 800; letter-spacing: .01em; }
.billing-included {
  display: flex; align-items: center; gap: .75rem; padding: .85rem .95rem;
  border: 1px solid var(--line); border-radius: .9rem;
  background: color-mix(in srgb, var(--c-smarald) 6%, var(--bubble));
}
.billing-included strong { color: var(--c-smarald); font-size: 1.45rem; line-height: 1; }
.billing-included span { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.billing-points {
  margin: 0 0 .35rem; padding-left: 1.1rem; color: var(--muted); font-size: .9rem;
  flex: 1;
}
.billing-points li { margin: .4rem 0; }
.billing-card form { margin-top: auto; }

@media (max-width: 900px) {
  .billing-grid { grid-template-columns: 1fr; }
  .billing-hero { align-items: flex-start; flex-direction: column; padding: 1.5rem; }
  .billing-current { justify-items: start; }
}

/* ── Shared inner pages ───────────────────────────────────────────────────── */
.page-hero {
  margin: 1.5rem 0 1.25rem; padding: 1.65rem 1.8rem;
  border: 1px solid var(--line); border-radius: 1.1rem; background: var(--card);
  box-shadow: var(--shadow);
}
.page-hero.compact h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.15; }
.page-hero.compact p:last-child { margin-bottom: 0; }
.page-hero--actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.account-page, .templates-page, .template-edit-page { max-width: 980px; }
.account-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr); gap: 1rem; }
.account-card { margin: 0; }
.account-meta { margin: 0; display: grid; gap: .75rem; }
.account-meta div {
  display: grid; grid-template-columns: 90px 1fr; gap: .75rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.account-meta div:last-child { border-bottom: 0; padding-bottom: 0; }
.account-meta dt { color: var(--muted); font-size: .82rem; }
.account-meta dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.templates-card, .editor-card { margin-top: 0; }
.empty-card { text-align: center; padding: 2.4rem 1rem; }
.empty-card h2 { margin-bottom: .4rem; }
.editor-card textarea {
  min-height: 420px; line-height: 1.55; border-radius: 12px;
  background: color-mix(in srgb, var(--input-bg) 92%, var(--bubble));
}

@media (max-width: 760px) {
  .page-hero--actions { align-items: flex-start; flex-direction: column; }
  .account-grid { grid-template-columns: 1fr; }
  .account-meta div { grid-template-columns: 1fr; gap: .2rem; }
}

/* Din Proiect — picker artefacte */
.fp-list { max-height: 380px; overflow-y: auto; padding: 4px 0; }
.fp-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border: 0; background: transparent; cursor: pointer; text-align: left; border-radius: 8px; }
.fp-item:hover { background: var(--bubble); }
.fp-icon { font-size: 18px; flex-shrink: 0; }
.fp-name { font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-conv { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.fp-empty { padding: 20px 16px; color: var(--muted); font-size: 14px; text-align: center; }


/* ── DXF product pages (/ai-dxf-generator, /image-to-dxf, …) ───────────
   Styles stay HERE, not inline in every template: there are multiple product
   pages and they must look the same. Inline duplicates would desynchronize
   at the first adjustment. */
.dxf-hero { text-align: center; padding: 3rem 1rem 2.5rem; }
.dxf-badge { display: inline-block; background: rgba(42, 96, 84, .10); border: 1px solid rgba(42, 96, 84, .28); color: var(--c-smarald); border-radius: 20px; padding: .35rem 1rem; font-size: .82rem; font-weight: 600; letter-spacing: .02em; margin-bottom: 1.25rem; }
.dxf-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: 1.25rem; text-wrap: balance; }
.dxf-sub { max-width: 600px; margin: 0 auto 1.75rem; font-size: 1.1rem; line-height: 1.7; color: var(--muted); }
.dxf-note { font-size: .85rem; margin-top: .75rem; }
/* Note below the subtitle: states what does NOT happen (a question without an explicit request
   remains a discussion, it does not generate a file). Smaller and more discreet than the subtitle,
   so it does not compete with it, but legible — it is an expectation correction, not a footnote. */
.dxf-sub--nota { font-size: .95rem; margin-top: -.75rem; opacity: .85; }

.dxf-flow { max-width: 900px; margin: 0 auto 3.5rem; padding: 0 1rem; }
.flow-steps { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.flow-step { flex: 1; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; }
.flow-num { width: 36px; height: 36px; background: var(--c-smarald); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; margin-bottom: .75rem; }
.flow-step h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.flow-step p { font-size: .88rem; line-height: 1.6; color: var(--muted); margin: 0; }
.flow-arrow { font-size: 1.5rem; color: var(--c-smarald); align-self: center; flex-shrink: 0; }
@media (max-width: 600px) { .flow-arrow { display: none; } }

.dxf-types { max-width: 960px; margin: 0 auto 3.5rem; padding: 0 1rem; }
.dxf-types h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.dxf-types > p { margin-bottom: 1.5rem; }
.dxf-types-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.dxf-type-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; }
.dxf-type-icon { font-size: 1.8rem; margin-bottom: .75rem; line-height: 1; }
.dxf-type-card h3, .dxf-type-card h2 { font-size: .95rem; font-weight: 700; margin-bottom: .5rem; }
.dxf-type-card p { font-size: .88rem; line-height: 1.6; color: var(--muted); margin: 0; }

.dxf-specs { max-width: 760px; margin: 0 auto 3.5rem; padding: 0 1rem; }
.dxf-specs h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
.dxf-specs-grid { display: flex; flex-direction: column; gap: .75rem; }
.dxf-spec { display: flex; gap: 1rem; align-items: baseline; padding: .75rem 1rem; background: var(--card); border-radius: 8px; border: 1px solid var(--line); }
.spec-label { font-weight: 600; font-size: .85rem; min-width: 110px; flex-shrink: 0; color: var(--c-smarald); }
.spec-val { font-size: .9rem; color: var(--muted); }

.dxf-vs { max-width: 900px; margin: 0 auto 3.5rem; padding: 0 1rem; }
.dxf-vs h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
.dxf-table-wrap { overflow-x: auto; }
.dxf-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dxf-table th { background: var(--card); padding: .7rem 1rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--line); }
.dxf-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--line); }
.dxf-table tbody th { background: transparent; border-bottom: 1px solid var(--line); padding: .65rem 1rem; font-weight: 600; }  /* row header (a11y td-has-header) */
.dxf-table tr:last-child td { border-bottom: none; }

.dxf-faq { max-width: 760px; margin: 0 auto 3.5rem; padding: 0 1rem; }
.dxf-faq h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
.faq-list { display: flex; flex-direction: column; gap: .75rem; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; }
.faq-item summary { font-weight: 600; cursor: pointer; font-size: .95rem; }
.faq-item p { margin: .75rem 0 0; font-size: .9rem; line-height: 1.7; color: var(--muted); }

.dxf-cta { text-align: center; padding: 2rem 1rem 4rem; }
.dxf-cta h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: .75rem; }

/* ── Ghiduri (/guides, /guides/*) ─────────────────────────────────────────── */
.ghid-pasi { max-width: 760px; margin: 0 auto 3.5rem; padding: 0 1rem; }
.pasi-titlu { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
.pas-lista { list-style: none; counter-reset: pas; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .9rem; }
.pas { counter-increment: pas; position: relative; padding: 1.1rem 1.25rem 1.1rem 3.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.pas::before { content: counter(pas); position: absolute; left: 1.1rem; top: 1.05rem;
  width: 26px; height: 26px; border-radius: 50%; background: var(--c-smarald);
  color: #fff; font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.pas h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .35rem; }
.pas p { font-size: .92rem; line-height: 1.65; color: var(--muted); margin: 0; }
/* The step worth not skipping — marked, not shouted. */
.pas.accent { border-color: rgba(42, 96, 84, .35); background: rgba(42, 96, 84, .05); }
.pas.accent p { color: var(--text); }

.exemplu-prompt { background: var(--bubble); border: 1px solid var(--line);
  border-radius: 10px; padding: 1rem 1.15rem; margin-bottom: .9rem; }
.exemplu-eticheta { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--c-smarald); margin-bottom: .45rem; }
.exemplu-text { margin: 0; font-size: .92rem; line-height: 1.65; }

/* ── Examples page (/exemple) ─────────────────────────────────────────────
   The request and the drawing resulting from it stay together: side-by-side on wide screens,
   stacked on mobile — the screenshots are evidence, not decoration, so they do not collapse. */
.exemplu-pereche { margin-bottom: 2.25rem; }
.exemplu-pereche .exemplu-prompt { margin-bottom: .6rem; }
.exemplu-text strong { color: var(--c-smarald); font-weight: 700; }
.exemplu-imagine { margin: 0; }
.exemplu-imagine img { width: 100%; height: auto; display: block;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.exemplu-imagine figcaption { font-size: .82rem; color: var(--muted);
  margin-top: .5rem; line-height: 1.5; }
.exemplu-livrat { margin: .6rem 0 0; font-size: .86rem; line-height: 1.6;
  color: var(--muted); border-top: 1px solid var(--line); padding-top: .6rem; }

.declansator-disciplina { font-size: 1rem; font-weight: 700; margin: 1.75rem 0 .75rem;
  color: var(--c-smarald); }
.declansator-grid { display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.declansator-card { background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; padding: .7rem .85rem; }
.declansator-cuvinte { margin: 0; font-size: .88rem; line-height: 1.55; }
.declansator-cuvinte strong { font-weight: 700; }
.declansator-nu { margin: .35rem 0 0; font-size: .78rem; color: var(--muted);
  line-height: 1.45; }

@media (min-width: 760px) {
  .exemplu-pereche { display: grid; grid-template-columns: 1fr 1.35fr;
    gap: 1.25rem; align-items: start; }
  .exemplu-pereche .exemplu-prompt { margin-bottom: 0; }
}

.fmt { font-size: .68rem; font-weight: 700; letter-spacing: .04em; vertical-align: middle;
  background: rgba(42, 96, 84, .12); color: var(--c-smarald);
  padding: 2px 7px; border-radius: 4px; margin-left: .4rem; }

.ghid-card { display: block; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s; }
.ghid-card:hover { border-color: var(--c-smarald); transform: translateY(-2px); }
.ghid-link { display: inline-block; margin-top: .8rem; font-size: .88rem;
  font-weight: 600; color: var(--c-smarald); }

/* ── DXF interactiv — SVG cu pan/zoom ─────────────────────────────────────── */
/* No own background and no inversion filter: the SVG brings its own background
   rectangle, closed, with open lines — same convention as the PNG preview.
   The first version applied `filter: invert(1)`, which produced a washed-out
   blue; the second forced white, which clashed with the background in the SVG. */

/* ── authentication: Google + email code ──────────────────────────────────
   The Google button respects the Google visual convention (color logo, neutral
   background, "Continue with Google" text): users recognize it by shape,
   and a "creative" styling would only make it look like a fake button. */
.auth-google { display: flex; align-items: center; justify-content: center;
  gap: 10px; text-decoration: none; font-weight: 600; }
.auth-google svg { flex: none; }
.auth-separator { display: flex; align-items: center; gap: 12px;
  margin: 18px 0 4px; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em; }
.auth-separator::before, .auth-separator::after { content: ""; flex: 1;
  border-top: 1px solid var(--line); }
/* The code digits are read from the phone and typed one by one —
   spaced and large, so it's immediately visible how many have been entered. */
.input-cod { font-size: 26px; letter-spacing: .34em; text-align: center;
  font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* The memory sheet on the account page: technical text, read as a data list.
   It fits itself on a narrow screen — a sheet that sticks out of the card would
   suggest there is more hidden beyond the edge. */
.memorie-fisa { font-family: var(--mono);
  font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; margin: 0 0 12px;
  padding: 12px 14px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; overflow-x: auto; color: var(--text); }

/* "requested, not found in drawing" — a note next to the element, not a second title.
   Own class, NOT `.verif-nota`: that is already used in the panel with a different role,
   and a second rule on it would have silently changed the other usages as well. */
.verif-lipsa { color: var(--c-error); font-size: 11.5px; margin-left: 8px;
  white-space: nowrap; }
@media (max-width: 560px) { .verif-lipsa { display: block; margin-left: 0; } }

/* ── DXF viewer ──────────────────────────────────────────────────────
   Dark background, as in any CAD program: drawings use color 7 (white)
   for geometry, so on a light background they would be invisible. */
.dxfv { position: relative; width: 100%; height: 100%; display: flex;
  flex-direction: column; background: #1b1f24; }
.dxfv-bara { flex: none; display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; background: #232830; border-bottom: 1px solid #2f3540; }
.dxfv-hint { flex: 1; font-size: 11px; color: #97a1af; letter-spacing: .01em; }
.dxfv-btn { border: 1px solid #3a424e; background: #2b313a; color: #d7dde6;
  font-size: 11.5px; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.dxfv-btn:hover { background: #333b46; }
.dxfv-scena { flex: 1; min-height: 0; overflow: hidden; cursor: grab;
  touch-action: none; }
.dxfv-scena.trage { cursor: grabbing; }
.dxfv-panza { display: block; }
/* The layer list floats over the drawing: opened in the flow, it would have
   pushed the canvas and triggered a resize on every toggle. */
.dxfv-straturi { position: absolute; right: 8px; top: 40px; z-index: 3;
  max-height: 62%; overflow: auto; padding: 8px 10px; border-radius: 8px;
  background: rgba(24,28,34,.96); border: 1px solid #2f3540;
  font-size: 11.5px; color: #d7dde6; display: flex; flex-direction: column;
  gap: 4px; }
/* `display: flex` above beats `[hidden]` from the browser's default style,
   so the panel remained visible over the drawing even when marked hidden.
   This rule must come AFTER it, otherwise it would have no effect. */
.dxfv-straturi[hidden] { display: none; }
.dxfv-strat { display: flex; align-items: center; gap: 7px; cursor: pointer;
  white-space: nowrap; }
.dxfv-pastila { width: 10px; height: 10px; border-radius: 2px; flex: none;
  border: 1px solid rgba(255,255,255,.25); }
.dxfv-strat-nume { flex: 1; }
.dxfv-strat-n { font-family: var(--mono); font-size: 10.5px; color: #97a1af; }
.dxfv-gol { margin: 0; color: #97a1af; }
/* C-4 — viewport technical status bar: coordinates, zoom, dimensions,
   inventory, unit. Mono + tabular-nums, like any instrument reading. */
.dxfv-stare { flex: none; display: flex; align-items: center; gap: 0; overflow: hidden;
  background: #101215; border-top: 1px solid #2f3540; font-family: var(--mono);
  font-size: 11px; color: #c9d0da; font-variant-numeric: tabular-nums; }
.dxfv-st { padding: 4px 10px; border-right: 1px solid #2f3540; white-space: nowrap; }
.dxfv-st:last-child { border-right: 0; margin-left: auto; color: #8B929C; }
.dxfv-st b { color: #8B929C; font-weight: 600; margin-right: 2px; }
.dxfv-st-xy { min-width: 150px; }
.dxfv-st-masura { color: #00E5FF; }
.dxfv-st-masura b { color: #00E5FF; }
.dxfv-st-sub { color: #8B929C; margin-left: 4px; }
.dxfv-st[hidden] { display: none; }
.dxfv-btn.on { background: #00E5FF; color: #0B0C0E; border-color: #00E5FF; }
.dxfv-scena.masoara { cursor: crosshair; }
.dxfv:focus { outline: none; }
.dxfv:focus-visible { outline: 2px solid #00E5FF; outline-offset: -2px; }
@media (max-width: 640px) {
  .dxfv-st-gabarit, .dxfv-st-inventar { display: none; }
}
.dxf-viewer-eroare { padding: 10px 14px; font-size: 13px; color: var(--muted);
  margin: 0; }

/* ANPC SAL icon (ANPC Order 449/2022 mod. by Order 270/2026): on the
   main page, 250×50, with a link to reclamatiisal.anpc.ro. Until the
   official image is downloaded, a text link with the same destination. */
.footer-anpc { margin-top: 12px; }
.anpc-sal { display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; max-width: 250px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px; line-height: 1.35; text-decoration: none; }
.anpc-sal img { display: block; width: 250px; max-width: 100%; height: auto; }

/* contact@ inbox from Super Admin (Plan C, 11.09.2026). Email body is intentionally
   white: emails are composed for a white background, even in dark mode. */
.mail-bara { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mail-cap { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin: 8px 0 12px; }
.mail-dosare { display: flex; gap: 6px; flex-wrap: wrap; }
.mail-dosare a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--text); font-size: 14px; }
.mail-dosare a.activ { border-color: var(--text); font-weight: 700; }
.mail-cautare { display: flex; gap: 6px; }
.mail-cautare input[type=search] { min-width: 220px; }
.mail-lista tr.necitit td, .mail-lista tr.necitit a { font-weight: 700; }
.mail-paginare { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 4px 2px; }
.mail-titlu { word-break: break-word; }
.mail-antete { display: grid; gap: 4px; margin: 0 0 12px; }
.mail-antete div { display: flex; gap: 10px; }
.mail-antete dt { min-width: 110px; color: var(--muted); }
.mail-antete dd { margin: 0; word-break: break-all; }
.mail-actiuni { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mail-actiuni form { margin: 0; }
.mail-atasamente { list-style: none; padding: 0; margin: 0 0 12px; display: flex;
  gap: 12px; flex-wrap: wrap; }
.mail-corp { width: 100%; min-height: 55vh; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; }
.mail-compunere { margin-top: 16px; }
.mail-compunere textarea { width: 100%; }
.mail-bifa { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.admin-badge-mesaje { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: #c0392b; color: #fff; font-size: 12px; line-height: 20px;
  text-align: center; }
.admin-badge-mesaje[hidden] { display: none; }

/* Public /contact page */
.contact-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px;
  align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form textarea { width: 100%; }
.contact-acord { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 14px; }
.contact-acord input { margin-top: 3px; }
/* Honeypot field: off-screen (not display:none — some bots skip it). */
.contact-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Breadcrumbs — common to pages without their own style (/contact, /presa); others
   declare it identically in the template. */
.breadcrumb { margin-bottom: 2rem; }
.breadcrumb ol { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0; font-size: .875rem; color: var(--muted); }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: .5rem; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* /presa press kit */
.presa-page .card { margin-bottom: 16px; }
.presa-page .card h2 { margin-top: 0; }
.presa-page .card h3 { margin: 16px 0 6px; font-size: 1rem; }
.presa-logo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.presa-logo img { width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--line); }
.presa-logo p { margin: 0; }

/* AI budget exhausted — path to the Start plan, below the chat response */
.upgrade-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.upgrade-card span { flex: 1 1 220px; font-size: 14px; }

/* Choice for a textless PDF (plan): DXF vectorization vs visual analysis */
.pdf-choice { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.pdf-choice-discret .pdf-choice-btn { opacity: .75; font-size: 12.5px; }
.pdf-choice-btn {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--text); font: inherit; font-size: 13px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.pdf-choice-btn:hover { background: var(--bubble); border-color: var(--c-smarald); }
