/* /factura-explicata/ — tokens only (the one literal is #fff); figures tabular;
   no content animated from opacity:0.

   Loaded only on the invoice pages (landing + result), so it may also tune the
   page title there. Layout principle for the result: the answer first and large,
   the breakdown beside it, forms next to each other — no card stretched across
   the page with its right half empty. */

/* ── Page title on the result pages (renderSimplePage) ──────────
   A compact title: the result must start on the first screen. */
.lp-simple-hero{padding-block:var(--sp-8) var(--sp-5)}
.lp-simple-hero h1{font-size:clamp(2rem,3.6vw,3rem);margin-bottom:0;max-width:none}

/* ── Card ──────────────────────────────────────────────────────── */
.fx-card{background:var(--surface-card);border:1px solid var(--border-subtle);border-radius:var(--r-xl);padding:clamp(var(--sp-5),2.2vw,var(--sp-8));margin:0 0 var(--sp-4);box-shadow:var(--sh-sm)}
.fx-card h2{font-family:var(--font-u);font-size:var(--fs-xl);font-weight:600;letter-spacing:-.015em;line-height:var(--lh-snug);margin:0 0 var(--sp-3);color:var(--green-900)}
.fx-card h3{font-size:var(--fs-base);font-weight:600;margin:var(--sp-6) 0 var(--sp-2);color:var(--green-900)}
.fx-card p{line-height:var(--lh-normal);color:var(--text-secondary);margin:var(--sp-1) 0 0}
.fx-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* ── Upload card ───────────────────────────────────────────────── */
.fx-upload{max-width:720px}
.lp-article-hero-aside .fx-upload{max-width:none;margin:0;box-shadow:var(--sh-md)}
.fx-drop{display:flex;flex-direction:column;align-items:center;gap:var(--sp-2);padding:var(--sp-8) var(--sp-5);border:2px dashed var(--border-default);border-radius:var(--r-lg);background:var(--surface-subtle);cursor:pointer;text-align:center;transition:border-color var(--dur-xs) var(--ease-out),background var(--dur-xs) var(--ease-out)}
.fx-drop:hover{border-color:var(--border-brand);background:var(--surface-accent)}
.fx-drop.has-file{border-color:var(--border-brand);background:var(--surface-accent)}
.fx-drop strong{font-size:var(--fs-xl);font-weight:600;letter-spacing:-.015em;color:var(--green-900)}
.fx-drop span{color:var(--text-muted);font-size:var(--fs-sm)}
.fx-drop input[type=file]{max-width:100%;margin-top:var(--sp-2);font:inherit;font-size:var(--fs-sm);color:var(--text-muted)}
.fx-drop input[type=file]::file-selector-button{margin-right:var(--sp-3);padding:var(--sp-2) var(--sp-4);border:1px solid var(--border-default);border-radius:var(--r-full);background:#fff;color:var(--green-900);font:inherit;font-weight:600;cursor:pointer}
.fx-drop:focus-within{border-color:var(--focus-ring)}
.fx-upload .fx-btn{width:100%}

/* ── Buttons, links, small print, alerts ───────────────────────── */
.fx-btn{display:inline-flex;align-items:center;justify-content:center;min-height:52px;margin-top:var(--sp-4);padding:0 var(--sp-6);border:0;border-radius:var(--r-full);background:var(--interactive);color:#fff;font:inherit;font-size:var(--fs-base);font-weight:600;cursor:pointer;text-decoration:none;transition:background var(--dur-xs) var(--ease-out),transform var(--dur-sm) var(--ease-out-expo),box-shadow var(--dur-sm) var(--ease-out-expo)}
.fx-btn:hover{background:var(--interactive-h);color:#fff;text-decoration:none;transform:translateY(-2px);box-shadow:var(--sh-brand)}
.fx-btn:focus-visible,.fx-link:focus-visible,.fx-card summary:focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
.fx-btn:disabled{background:var(--stone-400);cursor:wait;transform:none;box-shadow:none}
.fx-link{background:none;border:0;padding:0;margin-top:var(--sp-2);color:var(--text-brand);font:inherit;font-size:var(--fs-sm);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.fx-fine,.fx-fine p{font-size:var(--fs-sm);line-height:var(--lh-normal);color:var(--text-muted)}
.fx-upload .fx-fine{margin-top:var(--sp-3)}
.fx-center{text-align:center}
.fx-alert{padding:var(--sp-3) var(--sp-4);border-radius:var(--r-md);margin:var(--sp-3) 0;font-weight:500}
.fx-alert.is-err{background:var(--neg-50);color:var(--neg-600)}
.fx-alert.is-ok{background:var(--pos-50);color:var(--pos-600)}

/* ── Result layout ─────────────────────────────────────────────
   One column on phones. From 1024px a 12-column grid: the answer (5)
   beside the breakdown (7); the bars (7) beside the verdict (5); the
   two forms side by side. `dense` lets a block fill the free place in
   a row, and the :has() rules widen a block when its neighbour is not
   on the page (a non-prosumer invoice has no bars and no production). */
#fx-result{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--sp-4)}
#fx-result>*{margin:0;min-width:0}
@media(min-width:1024px){
  #fx-result{grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-flow:dense}
  #fx-result>*{grid-column:1/-1}
  #fx-result>.fx-hero{grid-column:span 5}
  #fx-result>.fx-tiles{grid-column:span 7}
  #fx-result>.fx-viz{grid-column:span 7}
  #fx-result>.fx-verdict{grid-column:span 5}
  #fx-result:not(:has(>.fx-viz))>.fx-verdict{grid-column:1/-1}
  /* The two forms have different heights: each keeps its own, no stretched empty card. */
  #fx-result>#fx-prod{grid-column:span 5;align-self:start}
  #fx-result>.fx-gate{grid-column:span 7;align-self:start}
  #fx-result:not(:has(>#fx-prod))>.fx-gate{grid-column:1/-1}
  #fx-result:has(>#fx-raport)>.fx-fix{grid-column:span 7}
}

/* ── The answer ────────────────────────────────────────────────
   Dark, with the amount as the one lime figure of the page. */
.fx-hero{display:flex;flex-direction:column;justify-content:center;background:var(--surface-ink);border-color:transparent;color:var(--text-on-ink)}
.fx-hero p,.fx-hero small{color:color-mix(in srgb,var(--text-on-ink) 80%,transparent)}
.fx-hero small{font-size:var(--fs-md)}
.fx-hero p b{color:#fff;font-weight:600}
.fx-hero p+p{margin-top:var(--sp-2)}
.fx-hero a{color:var(--lime-500);text-underline-offset:3px}
.fx-kind{display:flex;flex-wrap:wrap;gap:var(--sp-2) var(--sp-5);margin:var(--sp-4) 0 0;padding:0;border:0}
.fx-kind legend{float:left;width:100%;margin-bottom:var(--sp-2);font-weight:600;color:var(--text-primary)}
.fx-kind label{display:inline-flex;align-items:center;gap:var(--sp-2);min-height:44px;cursor:pointer}
.fx-kind input{width:20px;height:20px;accent-color:var(--green-600)}
.fx-eyebrow{font-size:var(--fs-xs);font-weight:500;letter-spacing:var(--tr-caps);text-transform:uppercase;color:var(--text-muted);margin:0 0 var(--sp-4)!important}
.fx-hero .fx-eyebrow{color:color-mix(in srgb,var(--text-on-ink) 64%,transparent)}
.fx-big,.fx-t>b,.fx-t>strong,.fx-bar,.fx-table .num{font-family:var(--font-m);font-variant-numeric:tabular-nums}
.fx-big{font-family:var(--font-d);font-size:clamp(3.4rem,6vw,5.25rem);font-weight:700;line-height:.95;color:var(--lime-500)!important;margin:var(--sp-2) 0 var(--sp-4)!important}
.fx-big u{text-decoration:none;font-family:var(--font-u);font-size:var(--fs-xl);font-weight:500;color:var(--text-on-ink)}

/* ── Breakdown tiles ───────────────────────────────────────────── */
.fx-tiles{display:grid;grid-template-columns:1fr 1fr;gap:var(--sp-3)}
.fx-tiles:has(>.fx-t:only-child){grid-template-columns:1fr}
.fx-t{display:flex;flex-direction:column;gap:2px;border-radius:var(--r-lg);padding:var(--sp-4) var(--sp-5);border:1px solid var(--border-subtle)}
.fx-t i{display:flex;align-items:center;gap:var(--sp-2);font-style:normal;font-size:var(--fs-sm);font-weight:600}
.fx-t i::before{content:"";flex-shrink:0;width:8px;height:8px;border-radius:50%;background:currentColor}
.fx-t>b,.fx-t>strong{display:block;color:var(--text-primary)}
.fx-t>b{font-family:var(--font-d);font-size:2.25rem;font-weight:700;line-height:1;margin-top:var(--sp-2)}
.fx-t small{font-family:var(--font-u);font-size:var(--fs-sm);font-weight:500}
.fx-t>strong{font-size:var(--fs-lg);font-weight:600}
.fx-t p{font-size:var(--fs-sm);margin-top:auto;padding-top:var(--sp-2)}
.fx-t1{background:var(--viz-grid-bg)}.fx-t1 i{color:var(--viz-grid)}
.fx-t2{background:var(--solar-50)}.fx-t2 i{color:var(--solar-600)}
.fx-t3{background:var(--green-50)}.fx-t3 i{color:var(--green-600)}
.fx-t4{background:var(--viz-rep-bg)}.fx-t4 i{color:var(--viz-rep)}
.fx-badge{display:inline-block;font-size:var(--fs-2xs);background:var(--surface-card);border:1px dashed var(--solar-500);border-radius:var(--r-sm);padding:1px 6px;color:var(--solar-600)}
.fx-badge.is-est{font-weight:600;border-style:solid;background:var(--solar-100)}

/* ── Bars ──────────────────────────────────────────────────────── */
.fx-viz{display:flex;flex-direction:column;justify-content:center}
.fx-viz h2{font-size:var(--fs-base);margin-bottom:var(--sp-2)}
.fx-bar{display:flex;height:40px;border-radius:var(--r-full);overflow:hidden;font-size:var(--fs-sm);font-weight:600;color:#fff}
.fx-bar span{display:flex;align-items:center;justify-content:center;white-space:nowrap;overflow:hidden;padding-inline:var(--sp-2)}
.fx-leg{display:flex;flex-wrap:wrap;gap:var(--sp-1) var(--sp-4);font-size:var(--fs-sm);margin:var(--sp-2) 0 var(--sp-5)!important}
.fx-leg:last-child{margin-bottom:0!important}
.fx-leg i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px}
.is-sun{background:var(--solar-300);color:var(--stone-900)}.is-off{background:var(--green-500)}.is-rep{background:var(--viz-rep)}.is-grid{background:var(--viz-grid)}

/* ── Verdict ───────────────────────────────────────────────────── */
.fx-verdict{border-left:6px solid var(--stone-400)}
.fx-verdict.is-pass{border-left-color:var(--pos-500)}
.fx-verdict.is-warn{border-left-color:var(--solar-500)}
.fx-verdict.is-fail{border-left-color:var(--neg-500)}
.fx-note{background:var(--solar-50);border-left:4px solid var(--solar-500);border-radius:var(--r-sm);padding:var(--sp-3) var(--sp-4);margin-top:var(--sp-3);font-size:var(--fs-md);line-height:var(--lh-normal);color:var(--text-secondary)}
.fx-note b{display:block;color:var(--solar-600);font-weight:600}
.fx-note.is-fail{background:var(--neg-50);border-color:var(--neg-500)}.fx-note.is-fail b{color:var(--neg-600)}
.fx-card details,.fx-fix{font-size:var(--fs-md)}
.fx-card summary{cursor:pointer;color:var(--text-brand);font-weight:600}
.fx-verdict summary{margin-top:var(--sp-4)}
.fx-checks{list-style:none;margin:var(--sp-3) 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:var(--sp-1) var(--sp-5)}
.fx-checks li{display:flex;gap:var(--sp-2);align-items:center;padding:var(--sp-1) 0}
.fx-ic{flex:0 0 1.375rem;height:1.375rem;border-radius:var(--r-full);display:grid;place-items:center;font-weight:700;font-size:var(--fs-xs);background:var(--stone-100)}
.is-pass .fx-ic{background:var(--pos-50);color:var(--pos-600)}
.is-warn .fx-ic{background:var(--solar-100);color:var(--solar-600)}
.is-fail .fx-ic{background:var(--neg-50);color:var(--neg-600)}

/* ── Forms ─────────────────────────────────────────────────────── */
.fx-in{display:flex;gap:var(--sp-2);margin-top:var(--sp-4)}
.fx-in input,.fx-form input,.fx-gate .nl-input{min-width:0;min-height:52px;padding:0 var(--sp-5);border:1px solid var(--border-default);border-radius:var(--r-full);background:#fff;color:var(--text-primary);font:inherit;font-family:var(--font-m);font-variant-numeric:tabular-nums}
.fx-in input:focus-visible,.fx-form input:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px;border-color:var(--green-600)}
.fx-in input{flex:1}
.fx-in .fx-btn{margin:0;flex:0 0 auto}
.fx-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--sp-3) var(--sp-4);margin-top:var(--sp-4)}
.fx-form label,.fx-gate label{display:flex;flex-direction:column;gap:var(--sp-1);font-size:var(--fs-sm);font-weight:600;color:var(--text-secondary)}
/* A caption can take one line or two: the inputs of a row stay on one line. */
.fx-form label{justify-content:flex-end}
.fx-form .fx-btn{grid-column:1/-1;justify-self:start}
.fx-gate .nl-consent{flex-direction:row;font-weight:400;margin-top:var(--sp-3)}
.fx-gate .fx-btn{align-self:flex-start}

/* ── Full report ───────────────────────────────────────────────
   Wide screens set the tables in two columns instead of stretching
   seven columns of figures across the whole page. */
.fx-scroll{overflow-x:auto}
.fx-table{width:100%;border-collapse:collapse;font-size:var(--fs-sm)}
.fx-table th,.fx-table td{padding:var(--sp-2) var(--sp-3);border-bottom:1px solid var(--border-subtle);text-align:left}
.fx-table th{font-size:var(--fs-2xs);font-weight:600;letter-spacing:var(--tr-label);text-transform:uppercase;color:var(--text-muted);white-space:nowrap;border-bottom-color:var(--border-default)}
.fx-table th:not(:first-child){text-align:right}
.fx-table td:first-child{color:var(--text-secondary);font-weight:500}
.fx-table tr:hover td{background:var(--surface-subtle)}
.fx-table tr:last-child td{border-bottom:0}
.fx-table .num{text-align:right;white-space:nowrap;color:var(--text-primary)}
@media(min-width:1100px){
  /* The seven-column table of invoice lines keeps the full width; the short
     tables under it (meter, carried energy, month by month) share two columns. */
  #fx-raport{columns:2;column-gap:var(--sp-12)}
  #fx-raport>h2,#fx-raport>h2+.fx-scroll,#fx-raport>.fx-fine{column-span:all}
  #fx-raport>.fx-fine{margin-bottom:var(--sp-2)}
  #fx-raport>.fx-scroll{break-inside:avoid}
  #fx-raport>h3{break-after:avoid;margin-top:var(--sp-5)}
}

/* ── Foot of the result ────────────────────────────────────────── */
.fx-again{justify-self:center;margin-top:var(--sp-2)}
