/* =====================================================================
   CalculatoareOnline.ro – design system v2
   Sobru, clar, cu contururi definite. Culoarea are sens, nu decor.
   ===================================================================== */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-3: #e8eaee;
  --border: #dde0e5;
  --border-strong: #c2c7cf;
  --line: #eceef1;
  --text: #121418;
  --text-2: #363b44;
  --muted: #5f6672;
  --faint: #8a919c;
  --accent: #0b5cd5;
  --accent-hover: #0949ad;
  --accent-soft: #eaf1fc;
  --accent-ink: #0a4db3;
  --focus: 0 0 0 3px rgba(11, 92, 213, .28);
  --good: #11804a;
  --good-soft: #e6f4ec;
  --warn: #a35a00;
  --warn-soft: #fdf2e1;
  --bad: #c4161c;
  --bad-soft: #fdecec;

  --c: #0b5cd5; --c-soft: #eaf1fc; --c-ink: #0a4db3;
  --s1: #0b5cd5; --s2: #1a9a5a; --s3: #e8890c; --s4: #8a4fd8; --s5: #e0435f; --s6: #1aa3c9; --s7: #9aa1ab;

  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 8px;
  --shadow-pop: 0 10px 30px rgba(17, 20, 24, .12), 0 2px 6px rgba(17, 20, 24, .06);
  --shadow-1: none;
  --shadow-2: 0 2px 10px rgba(17, 20, 24, .06);
  --shadow-3: 0 10px 30px rgba(17, 20, 24, .12);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1160px;
  --gutter: 16px;
  --topbar: 56px;
  --tabbar: 0px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --surface: #16191e; --surface-2: #1d2128; --surface-3: #272c35;
    --border: #2a2f38; --border-strong: #3b424e; --line: #23272f;
    --text: #eef0f3; --text-2: #c9ced6; --muted: #98a0ab; --faint: #737b86;
    --accent: #5b9bff; --accent-hover: #7aaeff; --accent-soft: rgba(91, 155, 255, .14); --accent-ink: #8fb9ff;
    --focus: 0 0 0 3px rgba(91, 155, 255, .35);
    --good: #3fc47e; --good-soft: rgba(63, 196, 126, .14); --warn: #f2a33a; --warn-soft: rgba(242, 163, 58, .14); --bad: #ff6b6b; --bad-soft: rgba(255, 107, 107, .14);
    --s1: #5b9bff; --s2: #3fc47e; --s3: #f2a33a; --s4: #a98bff; --s5: #ff6f8a; --s6: #4cc3e6; --s7: #6f7782;
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--border);
    --shadow-2: 0 2px 10px rgba(0, 0, 0, .3); --shadow-3: 0 10px 30px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #16191e; --surface-2: #1d2128; --surface-3: #272c35;
  --border: #2a2f38; --border-strong: #3b424e; --line: #23272f;
  --text: #eef0f3; --text-2: #c9ced6; --muted: #98a0ab; --faint: #737b86;
  --accent: #5b9bff; --accent-hover: #7aaeff; --accent-soft: rgba(91, 155, 255, .14); --accent-ink: #8fb9ff;
  --focus: 0 0 0 3px rgba(91, 155, 255, .35);
  --good: #3fc47e; --good-soft: rgba(63, 196, 126, .14); --warn: #f2a33a; --warn-soft: rgba(242, 163, 58, .14); --bad: #ff6b6b; --bad-soft: rgba(255, 107, 107, .14);
  --s1: #5b9bff; --s2: #3fc47e; --s3: #f2a33a; --s4: #a98bff; --s5: #ff6f8a; --s6: #4cc3e6; --s7: #6f7782;
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--border);
  --shadow-2: 0 2px 10px rgba(0, 0, 0, .3); --shadow-3: 0 10px 30px rgba(0, 0, 0, .5);
}

/* Culoarea categoriei – folosită discret (iconițe, marcaj rezultat) */
[data-c="blue"]   { --c: #0b5cd5; --c-soft: #eaf1fc; --c-ink: #0a4db3; }
[data-c="green"]  { --c: #11804a; --c-soft: #e6f4ec; --c-ink: #0d6b3d; }
[data-c="amber"]  { --c: #b86a00; --c-soft: #fdf2e1; --c-ink: #8f5200; }
[data-c="orange"] { --c: #c8500f; --c-soft: #fdeee5; --c-ink: #a3400b; }
[data-c="indigo"] { --c: #4a46c9; --c-soft: #eeedfb; --c-ink: #3b37a8; }
[data-c="purple"] { --c: #8a3fc0; --c-soft: #f4ebfa; --c-ink: #6f2f9d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-c="blue"]   { --c: #5b9bff; --c-soft: rgba(91,155,255,.14); --c-ink: #8fb9ff; }
  :root:not([data-theme="light"]) [data-c="green"]  { --c: #3fc47e; --c-soft: rgba(63,196,126,.14); --c-ink: #74d9a2; }
  :root:not([data-theme="light"]) [data-c="amber"]  { --c: #f2a33a; --c-soft: rgba(242,163,58,.14); --c-ink: #f6bd6c; }
  :root:not([data-theme="light"]) [data-c="orange"] { --c: #ff8a4c; --c-soft: rgba(255,138,76,.14); --c-ink: #ffab7d; }
  :root:not([data-theme="light"]) [data-c="indigo"] { --c: #8d8aff; --c-soft: rgba(141,138,255,.16); --c-ink: #b1afff; }
  :root:not([data-theme="light"]) [data-c="purple"] { --c: #c88cf0; --c-soft: rgba(200,140,240,.15); --c-ink: #dcb2f6; }
}

/* ---------- Bază ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-bottom: var(--tabbar); min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0; letter-spacing: -.018em; line-height: 1.2; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
code { font: .9em var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 740px) { :root { --gutter: 28px; } body { font-size: 16.5px; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bara de sus ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-in { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-name b { font-weight: 650; color: var(--accent); }
.brand-tld { color: var(--faint); font-weight: 500; }
.nav { display: none; align-self: stretch; gap: 2px; margin-left: auto; }
.nav a { display: flex; align-items: center; height: 100%; padding: 0 11px; color: var(--text-2); font-size: 14.5px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { text-decoration: none; color: var(--text); }
.nav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.search-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 14.5px;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger .i { width: 18px; height: 18px; }
.search-trigger span, .search-trigger kbd { display: none; }
kbd { font: 500 11.5px/1 var(--font); border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px; color: var(--muted); background: var(--surface-2); }
@media (min-width: 1000px) {
  .nav { display: flex; }
  .search-trigger { margin-left: 4px; }
}
@media (min-width: 1200px) {
  .search-trigger { min-width: 210px; }
  .search-trigger span { display: inline; }
  .search-trigger kbd { display: inline; margin-left: auto; }
}

/* ---------- Bara de jos (mobil) ---------- */
.tabbar { display: none; }
@media (max-width: 999px) {
  :root { --tabbar: calc(58px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; height: var(--tabbar); padding: 4px 6px env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
    color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; -webkit-tap-highlight-color: transparent;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .i { width: 23px; height: 23px; }
  .tabbar [aria-current] { color: var(--accent); font-weight: 600; }
}

/* ---------- Butoane ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid transparent; font-weight: 600; font-size: 15px; letter-spacing: -.005em; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .i { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-soft { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-soft:hover { border-color: var(--text-2); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; }
.linklike { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; text-align: left; }
.linklike:hover { text-decoration: underline; }

/* ---------- Antet de pagină ---------- */
.hero { padding-block: 22px 18px; }
.hero h1 { font-size: clamp(28px, 5.4vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; max-width: 24ch; text-wrap: balance; }
.hero .lead { margin-top: 10px; font-size: clamp(16.5px, 2vw, 18.5px); line-height: 1.5; color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.pill { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--c-ink); font-size: 14px; font-weight: 600; }
.pill .i { width: 17px; height: 17px; color: var(--c); }
a.pill:hover { text-decoration: underline; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.meta-row span, .meta-row a { display: inline-flex; align-items: center; gap: 6px; }
.meta-row .i { width: 15px; height: 15px; }
@media (min-width: 740px) { .hero { padding-block: 34px 24px; } }

/* ---------- Calculator ---------- */
.calc-wrap { margin-bottom: 8px; }
.calc { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .calc { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; } }
.calc-in, .calc-out { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; min-width: 0; }
@media (min-width: 740px) { .calc-in, .calc-out { padding: 24px; } }
.calc-in { display: grid; gap: 20px; align-content: start; }
.calc-out { position: relative; display: grid; gap: 18px; border-top: 3px solid var(--c); }
@media (min-width: 900px) { .calc-out { position: sticky; top: calc(var(--topbar) + 16px); } }
.calc-in > h2, .calc-out > h2, .calc-in > h3, .calc-out > h3 { font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }

/* Câmpuri */
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field > label, .field > .label { font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -.005em; }
.hint { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.input {
  display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s; min-height: 48px; overflow: hidden;
}
.input:hover { border-color: var(--faint); }
.input:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.input input, .input select {
  flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; outline: none; padding: 0 13px;
  font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.input input[type="date"] { font-size: 16px; }
.input input::placeholder { color: var(--faint); font-weight: 400; }
.input .prefix, .input .suffix {
  display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted);
  font-size: 14.5px; font-weight: 500; white-space: nowrap; flex: none;
}
.input .suffix { border-left: 1px solid var(--border); }
.input .prefix { border-right: 1px solid var(--border); }
.input .prefix .i { width: 17px; height: 17px; }
.input select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px; font-size: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6672' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 12px center / 18px no-repeat; }
.input.is-invalid { border-color: var(--bad); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
.row-2, .row-3 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 480px) { .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px) { .row-2 { grid-template-columns: minmax(0, 1fr); } }

/* Selector de mod (segmentat). Cu 4+ opțiuni devine grilă de butoane. */
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.seg label { flex: 1 1 0; position: relative; min-width: 0; }
.seg label + label { border-left: 1px solid var(--border-strong); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; height: 100%; padding: 6px 10px; text-align: center;
  font-size: 14.5px; font-weight: 500; line-height: 1.25; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s;
}
.seg span:hover { background: var(--surface-2); }
.seg span .i { width: 16px; height: 16px; }
.seg input:checked + span { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; box-shadow: inset 0 -2px 0 var(--accent); }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--accent); }
.seg:has(> label:nth-child(4)) {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; border-radius: 0; overflow: visible; background: none;
}
@media (min-width: 560px) { .seg:has(> label:nth-child(4)) { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); } }
.seg:has(> label:nth-child(4)) label + label { border-left: 0; }
.seg:has(> label:nth-child(4)) span { border: 1px solid var(--border-strong); border-radius: var(--r-md); justify-content: flex-start; text-align: left; padding: 9px 12px; }
.seg:has(> label:nth-child(4)) input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Valori rapide */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text-2); transition: border-color .15s, background .15s, color .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.chip .i { width: 15px; height: 15px; color: var(--c); }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* Comutator */
.check { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text); cursor: pointer; line-height: 1.4; }
.check small { color: var(--muted); }
.switch { position: relative; flex: none; width: 44px; height: 26px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .2s, border-color .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: var(--focus); }
.switch.is-locked { opacity: .5; }

/* Stepper */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--r-md); height: 48px; overflow: hidden; background: var(--surface); width: max-content; }
.stepper button { width: 46px; border: 0; background: var(--surface-2); font-size: 20px; line-height: 1; color: var(--text); }
.stepper button:hover { background: var(--surface-3); }
.stepper button:first-child { border-right: 1px solid var(--border); }
.stepper button:last-child { border-left: 1px solid var(--border); }
.stepper input { width: 54px; text-align: center; border: 0; background: transparent; font-size: 17px; font-weight: 600; outline: none; font-variant-numeric: tabular-nums; }

.range { width: 100%; accent-color: var(--accent); height: 28px; }

/* Opțiuni avansate */
.more { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; font-size: 15px; font-weight: 600; color: var(--text); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary .i { width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease); }
.more[open] > summary { border-bottom: 1px solid var(--border); }
.more[open] > summary .i { transform: rotate(180deg); }
.more-body { display: grid; gap: 16px; padding: 16px 14px; }

/* Rânduri dinamice */
.rows { display: grid; gap: 10px; }
.row-item { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); position: relative; }
.row-item .input { min-height: 44px; }
.row-item .input input, .row-item .input select { height: 42px; font-size: 16px; }
.row-head { display: flex; align-items: center; gap: 8px; }
.row-head .input { flex: 1; }
.row-del { flex: none; width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--muted); display: grid; place-items: center; }
.row-del:hover { background: var(--bad-soft); color: var(--bad); }
.row-del .i { width: 18px; height: 18px; }
.add-row { justify-self: start; }

/* Rezultat */
.out-hero { display: grid; gap: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.out-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.out-value {
  display: block; font-family: var(--font-display); font-size: clamp(34px, 7vw, 46px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--text); word-break: break-word;
}
.out-value small { font-size: .45em; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 5px; }
.out-sub { font-size: 14.5px; color: var(--text-2); line-height: 1.45; }
.out-list { margin: 0; display: grid; }
.out-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.out-list > div:last-child { border-bottom: 0; }
.out-list dt { color: var(--text-2); font-size: 15px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.out-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.out-list .is-total { background: var(--surface-2); border-radius: var(--r-sm); padding: 11px 12px; margin: 4px 0; border-bottom: 0; }
.out-list .is-total dt, .out-list .is-total dd { font-weight: 700; color: var(--text); font-size: 16px; }
.out-list .is-minus dd { color: var(--text-2); font-weight: 500; }
.out-list .is-good dd { color: var(--good); }
.out-list .is-bad dd { color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 2px; flex: none; background: var(--dot, var(--s7)); }
.out-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.stat { padding: 11px 13px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-last-child(-n+2):nth-child(odd), .stat:last-child { border-bottom: 0; }
.stat span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.35; }
.stat strong { display: block; margin-top: 3px; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.015em; }
.out-note { font-size: 13.5px; color: var(--muted); line-height: 1.5; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-md); }
.out-note:empty { display: none; }
.out-note strong { color: var(--text-2); }
.out-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); font-size: 14px; color: var(--text-2); line-height: 1.5; }
.alert .i { color: var(--accent); margin-top: 1px; width: 18px; height: 18px; }
.alert.warn { background: var(--warn-soft); }
.alert.warn .i { color: var(--warn); }
.calc-out .formula { border-left-width: 1px; font-size: 14px; background: var(--surface-2); }

/* Bară stivuită */
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.bar > i { display: block; height: 100%; background: var(--seg, var(--s1)); transition: flex-grow .4s var(--ease), width .4s var(--ease); min-width: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Grafice */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font: 500 11px var(--font); fill: var(--muted); }
.chart .grid line { stroke: var(--line); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }

/* Tabele de date */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--border); -webkit-overflow-scrolling: touch; background: var(--surface); }
.dtable, .ptable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.dtable th, .dtable td, .ptable th, .ptable td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable th:first-child, .dtable td:first-child { text-align: left; }
.dtable thead th, .ptable thead th { position: sticky; top: 0; background: var(--surface-2); font-size: 12.5px; color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--border); }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover td { background: var(--surface-2); }
.dtable tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.ptable th, .ptable td { text-align: left; white-space: normal; vertical-align: top; }
.ptable tbody th { font-weight: 500; color: var(--text-2); }
.ptable td.num { font-weight: 650; white-space: nowrap; }
.ptable small { color: var(--muted); }
.ptable tbody tr:last-child th, .ptable tbody tr:last-child td { border-bottom: 0; }
.table-scroll { max-height: 420px; overflow: auto; }

/* Pastila de rezultat (mobil) */
.result-pill {
  position: fixed; z-index: 44; left: 50%; bottom: calc(var(--tabbar) + 10px); transform: translate(-50%, 160%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 9px 14px; border-radius: var(--r-md);
  border: 0; background: var(--text); color: var(--bg); box-shadow: var(--shadow-pop); font-size: 14px; transition: transform .35s var(--ease); white-space: nowrap;
}
.result-pill strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.result-pill span { opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.result-pill .i { width: 16px; height: 16px; }
.result-pill.is-on { transform: translate(-50%, 0); }
@media (min-width: 900px) { .result-pill { display: none; } }

/* ---------- Conținut ---------- */
.page-body { padding-block: 36px 8px; }
.doc { display: grid; gap: 24px; }
@media (min-width: 1080px) { .doc { grid-template-columns: minmax(0, 720px) 250px; justify-content: space-between; gap: 48px; } }
.doc-aside { display: none; }
@media (min-width: 1080px) {
  .doc-aside { display: block; position: sticky; top: calc(var(--topbar) + 24px); align-self: start; }
  .toc-mobile { display: none; }
}
.toc-title { font-size: 12.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); display: grid; }
.toc-list a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: 14px; line-height: 1.4; }
.toc-list a:hover { color: var(--text); text-decoration: none; border-left-color: var(--border-strong); }
.toc-list a.is-active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.toc-mobile { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.toc-mobile > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 600; font-size: 15px; }
.toc-mobile > summary::-webkit-details-marker { display: none; }
.toc-mobile > summary .i { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.toc-mobile[open] > summary { border-bottom: 1px solid var(--border); }
.toc-mobile[open] > summary .i { transform: rotate(180deg); }
.toc-mobile ol { margin: 0; padding: 8px 14px 12px 34px; display: grid; gap: 2px; }
.toc-mobile li { color: var(--muted); font-size: 14.5px; }
.toc-mobile a { display: block; padding: 5px 0; color: var(--text-2); }
.toc { display: none; }

.prose { max-width: 720px; min-width: 0; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-size: clamp(22px, 3vw, 27px); line-height: 1.22; font-weight: 700; margin-top: 44px; letter-spacing: -.02em; text-wrap: balance; }
.prose h3 { font-size: 19px; line-height: 1.3; font-weight: 650; margin-top: 28px; }
.prose h2 + *, .prose h3 + * { margin-top: 10px; }
.prose p, .prose li { color: var(--text-2); font-size: 16.5px; line-height: 1.7; text-wrap: pretty; }
.prose strong { color: var(--text); font-weight: 650; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--faint); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose blockquote { margin: 22px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose .table-wrap { margin-top: 16px; }
.prose table th, .prose table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--text-2); }
.prose table thead th { background: var(--surface-2); font-size: 13px; color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--border); }
.prose table tbody tr:last-child td { border-bottom: 0; }
.prose table td.r, .prose table th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prose > h2:first-child, .prose > section:first-child > h2:first-child { margin-top: 0; }
.prose > section > h2:first-child { margin-top: 44px; }
.prose > section:first-child > h2:first-child { margin-top: 0; }
.prose section > * + * { margin-top: 16px; }
.formula {
  font-family: var(--mono); font-size: 14.5px; line-height: 1.75; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); padding: 14px 16px; color: var(--text); overflow-x: auto; white-space: pre-wrap;
}
.formula b { color: var(--accent-ink); font-weight: 650; }
.example { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; }
.example > * + * { margin-top: 10px; }
.example h3 { margin-top: 0 !important; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.example h3 .i { color: var(--good); width: 18px; height: 18px; }
.example ol, .example ul { padding-left: 20px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); color: var(--text-2); }
.callout .i { color: var(--accent); margin-top: 3px; width: 18px; height: 18px; }
.callout p { color: var(--text-2); font-size: 15.5px; }
.key-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.key-facts div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.key-facts span { display: block; font-size: 13px; color: var(--muted); }
.key-facts strong { font-size: 19px; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }

/* Întrebări frecvente */
.faq { display: grid; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.faq-item + .faq-item { border-top: 1px solid var(--border); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; font-weight: 600; font-size: 16px; line-height: 1.4; }
.faq-item summary:hover { background: var(--surface-2); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-ico { width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease); }
.faq-item[open] .faq-ico { transform: rotate(45deg); }
.faq-a { padding: 0 18px 16px; color: var(--text-2); line-height: 1.65; }
.faq-a > * + * { margin-top: 10px; }
.faq-a p, .faq-a li { font-size: 15.5px; }

/* Secțiuni */
.section { padding-block: 40px 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(20px, 2.6vw, 24px); font-weight: 700; letter-spacing: -.02em; }
.section-head a { font-size: 14.5px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.section-head a .i { width: 16px; height: 16px; }
.eyebrow { font-size: 12.5px; font-weight: 650; color: var(--c-ink); letter-spacing: .01em; }

/* Liste de calculatoare */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.tile {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.tile:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.tile:hover .tile-txt strong { color: var(--accent-ink); }
.tile-ico { width: 42px; height: 42px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--c-soft); color: var(--c); }
.tile-ico .i { width: 22px; height: 22px; }
.tile-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tile-txt strong { font-size: 16px; font-weight: 650; letter-spacing: -.012em; line-height: 1.3; }
.tile-txt small { font-size: 14px; color: var(--muted); line-height: 1.4; }
.tile-go { width: 16px; height: 16px; color: var(--faint); }

/* Articole */
.posts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.post-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.post-card:hover strong { color: var(--accent-ink); }
.post-art { display: none; }
.post-body { display: grid; gap: 8px; padding: 18px 18px 20px; align-content: start; }
.post-body .eyebrow { display: flex; align-items: center; gap: 6px; }
.post-body strong { font-size: 18px; line-height: 1.3; letter-spacing: -.015em; font-weight: 650; }
.post-body small { font-size: 14.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Prima pagină ---------- */
.home-hero { padding-block: 28px 8px; }
.home-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) { .home-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; } .home-hero { padding-block: 52px 16px; } }
.home-hero h1 { font-size: clamp(30px, 5.6vw, 46px); line-height: 1.08; font-weight: 750; letter-spacing: -.03em; max-width: 18ch; text-wrap: balance; }
.home-hero p.lead { margin-top: 14px; max-width: 54ch; color: var(--muted); font-size: clamp(16.5px, 2vw, 18.5px); line-height: 1.5; }
.hero-search {
  margin-top: 22px; max-width: 560px; width: 100%; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 6px 0 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: text; color: var(--faint); font-size: 16.5px; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.hero-search:hover { border-color: var(--faint); }
.hero-search .i { width: 20px; height: 20px; color: var(--muted); }
.hero-search span { flex: 1; }
.hero-search b { height: 42px; padding: 0 18px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.quick-label { font-size: 13.5px; color: var(--muted); margin-right: 4px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.panel-head small { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.rates { list-style: none; margin: 0; padding: 0; }
.rates li + li { border-top: 1px solid var(--line); }
.rates a { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; align-items: center; padding: 10px 16px; color: var(--text); }
.rates a:hover { background: var(--surface-2); text-decoration: none; }
.rates span { font-size: 14.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.rates span .i { width: 16px; height: 16px; color: var(--c); }
.rates strong { font-size: 16px; font-variant-numeric: tabular-nums; text-align: right; }
.rates strong small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.rates em { grid-column: 1 / -1; font-style: normal; font-size: 12.5px; color: var(--muted); padding-left: 24px; }
.rates b { font-weight: 600; } .trend-up { color: var(--bad); } .trend-down { color: var(--good); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }

.cats { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cats { grid-template-columns: repeat(3, 1fr); } }
.cat-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); }
.cat-card-head { display: flex; align-items: center; gap: 12px; }
.cat-card-head strong { font-size: 17px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.cat-card-head a { color: var(--text); }
.cat-card-head small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.cat-links { list-style: none; margin: 0; padding: 0; display: grid; }
.cat-links a { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; color: var(--text-2); font-size: 15px; border-bottom: 1px solid var(--line); }
.cat-links li:last-child a { border-bottom: 0; }
.cat-links a:hover { color: var(--accent-ink); text-decoration: none; }
.cat-links .i { width: 15px; height: 15px; color: var(--faint); }
.cat-more { margin-top: auto; padding-top: 4px; font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; }
.cat-more .i { width: 16px; height: 16px; }
a.cat-card { grid-template-rows: auto; align-content: start; }
a.cat-card:hover { text-decoration: none; border-color: var(--border-strong); }
a.cat-card > strong { font-size: 16.5px; font-weight: 650; }
a.cat-card > small { color: var(--muted); font-size: 13.5px; }

.promise { display: grid; grid-template-columns: 1fr; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
@media (min-width: 740px) { .promise { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .promise { grid-template-columns: repeat(4, 1fr); } }
.promise > div { padding: 18px 20px; border-bottom: 1px solid var(--line); }
@media (min-width: 1040px) { .promise > div { border-bottom: 0; border-right: 1px solid var(--line); } .promise > div:last-child { border-right: 0; } }
.promise .i { width: 22px; height: 22px; color: var(--accent); margin-bottom: 8px; }
.promise strong { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.promise p { font-size: 14.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* Grupuri pe categorii (hub) */
.cat-group { padding-top: 30px; }
.cat-group h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 12px; }
.cat-group h2 a { color: var(--text); }
.cat-group h2 .tile-ico { width: 32px; height: 32px; border-radius: 8px; }
.cat-group h2 .tile-ico .i { width: 18px; height: 18px; }

/* Filtru blog – file */
.filter { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.filter::-webkit-scrollbar { display: none; }
.filter .chip { height: 44px; border: 0; border-radius: 0; background: none; padding: 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-size: 14.5px; }
.filter .chip:hover { color: var(--text); }
.filter .chip[aria-current] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; background: none; }
.filter .chip .i { color: currentColor; }

/* Articol de blog */
.post-hero { padding-block: 26px 4px; max-width: 760px; }
.post-hero h1 { font-size: clamp(28px, 4.8vw, 40px); line-height: 1.15; letter-spacing: -.025em; font-weight: 700; text-wrap: balance; }
.post-hero .lead { margin-top: 12px; color: var(--muted); font-size: clamp(17px, 2vw, 19px); line-height: 1.5; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.byline span { display: inline-flex; align-items: center; gap: 6px; }
.byline .i { width: 15px; height: 15px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); }
.avatar .i { width: 16px; height: 16px; }
.cta-calc { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); margin: 24px 0; text-decoration: none !important; }
.cta-calc:hover { border-color: var(--accent); }
.cta-calc span { flex: 1; display: grid; gap: 2px; }
.cta-calc .tile-ico { flex: none; }
.cta-calc strong { font-size: 16.5px; line-height: 1.3; }
.cta-calc small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.cta-calc .btn { flex: none; }
@media (max-width: 560px) { .cta-calc { flex-wrap: wrap; } .cta-calc .btn { width: 100%; } }
.post-layout { display: grid; gap: 24px; padding-top: 28px; }
@media (min-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 720px) 250px; justify-content: space-between; gap: 48px; }
  .post-aside { position: sticky; top: calc(var(--topbar) + 24px); align-self: start; }
}
.post-aside { display: none; }
@media (min-width: 1080px) { .post-aside { display: block; } }
.aside-title { display: none; }

/* Surse și actualizare */
.sources { padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.sources a { color: var(--text-2); }
.update-box { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.update-box h3 { font-size: 13px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.update-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--text-2); }
.update-meta span { display: inline-flex; align-items: center; gap: 6px; }
.update-meta .i { width: 15px; height: 15px; color: var(--muted); }

/* ---------- Subsol (breadcrumbs lipite, stil Apple) ---------- */
.footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.45; color: var(--muted); padding-bottom: 24px; }
.footer a { color: var(--text-2); }
.crumbs { border-bottom: 1px solid var(--border); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; min-height: 46px; }
.crumbs li { display: flex; align-items: center; color: var(--text-2); font-size: 12.5px; }
.crumbs li a { color: var(--text-2); display: flex; align-items: center; }
.crumbs li a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--muted); }
.crumbs-logo { width: 18px; height: 18px; }
.crumbs-sep { width: 12px; height: 12px; margin: 0 8px; color: var(--faint); stroke-width: 2; }
.footer-cols { display: grid; padding: 20px 0 8px; grid-template-columns: 1fr; }
.footer-col h2 { font-size: 12.5px; font-weight: 650; color: var(--text); letter-spacing: 0; }
.footer-col h2 a { color: var(--text); }
.footer-col ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 7px; }
.footer-col { padding: 0 0 18px; }
.fold { display: none; }
@media (max-width: 739px) {
  .footer-cols { padding-top: 0; }
  .footer-col { border-bottom: 1px solid var(--line); padding: 0; }
  .footer-col h2 { display: flex; align-items: center; justify-content: space-between; }
  .footer-col h2 a { flex: 1; padding: 13px 0; font-size: 14px; }
  .fold { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; color: var(--muted); }
  .fold .i { width: 16px; height: 16px; transition: transform .2s; }
  .footer-col ul { display: none; margin: 0 0 14px; gap: 11px; }
  .footer-col ul a { font-size: 14px; }
  .footer-col.is-open ul { display: grid; }
  .footer-col.is-open .fold .i { transform: rotate(180deg); }
}
@media (min-width: 740px) { .footer-cols { grid-template-columns: repeat(3, 1fr); gap: 0 24px; } }
@media (min-width: 1040px) { .footer-cols { grid-template-columns: repeat(7, 1fr); gap: 0 18px; } }
.footer-note { border-top: 1px solid var(--border); padding: 14px 0; }
.footer-note p { max-width: 900px; }
.footer-legal { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-legal ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; }
.footer-legal li + li { border-left: 1px solid var(--border); margin-left: 10px; padding-left: 10px; }
.footer-legal button { color: var(--text-2); }

/* ---------- Căutare ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 17, 20, .35); animation: fade .2s; }
.search-sheet {
  position: fixed; z-index: 61; left: 0; right: 0; top: 0; max-height: 100dvh; display: flex; flex-direction: column;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: drop .25s var(--ease); padding-top: env(safe-area-inset-top);
}
@media (min-width: 740px) {
  .search-sheet { top: 10vh; left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--border); border-radius: var(--r-lg); max-height: 72vh; animation: pop .2s var(--ease); }
}
.search-box { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.search-box .i { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; outline: none; font-size: 18px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-close { border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 500; }
.search-results { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.sr-group { font-size: 12px; font-weight: 650; color: var(--muted); padding: 10px 12px 6px; text-transform: uppercase; letter-spacing: .04em; }
.sr { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-md); color: var(--text); }
.sr:hover, .sr.is-active { background: var(--surface-2); text-decoration: none; }
.sr .tile-ico { width: 34px; height: 34px; border-radius: 8px; }
.sr .tile-ico .i { width: 18px; height: 18px; }
.sr span { display: grid; min-width: 0; }
.sr strong { font-weight: 600; font-size: 15px; }
.sr small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr mark { background: none; color: var(--accent-ink); }
.sr-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
@keyframes pop { from { transform: translateX(-50%) translateY(-8px); opacity: 0; } }

/* ---------- Consimțământ cookies ---------- */
.consent { position: fixed; z-index: 70; left: 0; right: 0; bottom: calc(var(--tabbar) + 8px); padding: 0 8px; pointer-events: none; }
.consent-card { pointer-events: auto; max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 16px; display: grid; gap: 12px; animation: rise .35s var(--ease); }
@media (min-width: 740px) { .consent { bottom: 20px; left: 20px; right: auto; padding: 0; } .consent-card { width: 480px; padding: 20px; gap: 14px; } }
.consent-head { display: block; }
.consent-ico { display: none; }
.consent h2 { font-size: 16px; letter-spacing: -.01em; }
.consent p { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.consent-prefs { display: grid; border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 12px; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pref:last-child { border-bottom: 0; }
.pref > span:first-child { display: grid; }
.pref strong { font-size: 14.5px; }
.pref small { font-size: 12.5px; color: var(--muted); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consent-actions .btn { height: 40px; font-size: 14px; }
.consent-actions .btn-ghost { grid-column: 1 / -1; order: 3; height: 32px; }
@media (min-width: 740px) { .consent-actions { display: flex; } .consent-actions .btn-ghost { order: 0; margin-right: auto; padding: 0 6px; } }
.consent-foot { font-size: 12px !important; margin: 0 !important; }
.consent-foot a { color: var(--muted); text-decoration: underline; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 80; left: 50%; top: calc(var(--topbar) + 12px); transform: translate(-50%, -12px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-pop); transition: all .25s var(--ease); pointer-events: none;
}
.toast .i { width: 16px; height: 16px; color: var(--good); }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Navigare AJAX ---------- */
.is-loading main { opacity: .6; transition: opacity .15s .1s; }
.progress { position: fixed; z-index: 90; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); transition: width .3s, opacity .3s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

/* ---------- Tastatură calculator ---------- */
.device { display: grid; gap: 12px; }
.display { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 16px; text-align: right; min-height: 100px; display: grid; align-content: end; gap: 2px; overflow: hidden; }
.display-expr { font: 500 15px/1.4 var(--mono); color: var(--muted); word-break: break-all; min-height: 21px; }
.display-val { font-family: var(--font-display); font-size: clamp(32px, 7vw, 44px); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-all; }
.display-val.is-error { color: var(--bad); font-size: 20px; }
.display-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 650; letter-spacing: .04em; }
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.keys.keys-5 { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.key {
  height: 56px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-size: 20px; font-weight: 500;
  font-variant-numeric: tabular-nums; transition: background .1s; -webkit-tap-highlight-color: transparent; user-select: none;
}
.key:hover { background: var(--surface-2); }
.key:active, .key.is-pressed { background: var(--surface-3); transform: translateY(1px); }
.key-fn { font-size: 15px; color: var(--text-2); background: var(--surface-2); }
.key-fn:hover { background: var(--surface-3); }
.key-op { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; font-size: 22px; }
.key-op.is-on { background: var(--accent); color: #fff; }
.key-eq { background: var(--accent); color: #fff; border-color: var(--accent); }
.key-eq:hover { background: var(--accent-hover); }
.key-clear { color: var(--bad); }
.key-wide { grid-column: span 2; }
.key small { font-size: .7em; }
.keys.keys-5 .key { height: 48px; font-size: 16px; }
@media (max-width: 420px) { .key { height: 54px; } .keys.keys-5 .key { height: 44px; font-size: 14.5px; } }
.history { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.history button { display: grid; text-align: right; gap: 2px; padding: 8px 12px; border: 0; background: transparent; border-radius: var(--r-sm); }
.history button:hover { background: var(--surface-2); }
.history small { font: 13px var(--mono); color: var(--muted); }
.history strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.graph { width: 100%; aspect-ratio: 4 / 3; background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--border); touch-action: none; cursor: grab; display: block; }
.graph:active { cursor: grabbing; }
.swatch { width: 100%; height: 96px; border-radius: var(--r-md); border: 1px solid var(--border); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.swatches button { height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.input input[type="color"] { padding: 4px; height: 46px; cursor: pointer; }
.frac { display: inline-grid; text-align: center; vertical-align: middle; line-height: 1.15; margin: 0 2px; font-variant-numeric: tabular-nums; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 4px; }

/* ---------- 404 / gol ---------- */
.empty { text-align: center; padding-block: 40px; color: var(--muted); }
.empty .big { font-size: clamp(64px, 14vw, 110px); font-weight: 750; letter-spacing: -.05em; color: var(--text); line-height: 1; }
.empty-box { padding: 40px 20px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); text-align: center; color: var(--muted); background: var(--surface); }

/* Print */
@media print {
  .topbar, .tabbar, .footer, .consent, .out-actions, .toc-mobile, .doc-aside, .result-pill, .search-sheet { display: none !important; }
  body { background: #fff; }
  .calc-in, .calc-out { border: 1px solid #ccc; }
}

/* Protecție la depășire în grile (câmpuri, select-uri lungi) */
.field { grid-template-columns: minmax(0, 1fr); }
.input input, .input select { width: 100%; }
.row-2 > *, .row-3 > * { min-width: 0; }
.post-layout > *, .doc > * { min-width: 0; }

.post-body .eyebrow .i { width: 14px; height: 14px; }

.row-item > *, .row-item .input, .row-item select, .row-item input { min-width: 0; }
.out-actions .btn-ghost { margin-left: auto; }
.calc-out > *, .calc-in > * { min-width: 0; }
.out-value .i, .out-label .i, .out-sub .i, p .i, .hint .i { display: inline-block; vertical-align: -0.15em; }
.calc-in, .calc-out, .rows, .row-item { grid-template-columns: minmax(0, 1fr); }
.input { min-width: 0; }
