/* calcule-electrice.ro — stiluri comune */
:root {
  color-scheme: light;
  --bg: #F3F5F8; --card: #FFFFFF; --ink: #15202B; --muted: #5F6B78; --line: #DCE1E7;
  --acc: #0F766E; --acc-soft: #E3F2F0; --acc-ink: #0B5A54;
  --sans: "Figtree", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); padding-inline: 16px; padding-block: 0 48px; }
.wrap { max-width: 1120px; margin: 0 auto; }

/* antet */
header.site { display: flex; align-items: center; gap: 14px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--acc); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }

/* meniu lateral + conținut */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.side a, .side .soon { color: var(--ink); text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.side a:hover { background: #E9EDF2; }
.side a[aria-current] { background: var(--acc-soft); color: var(--acc-ink); }
.side .soon { color: var(--muted); font-weight: 400; display: flex; justify-content: space-between; gap: 8px; }
.side .soon small { font-size: 12px; }
main { min-width: 0; }

h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 6px 0 16px; text-wrap: balance; }

/* cardul cu tabelul */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(21,32,43,.04), 0 8px 24px -16px rgba(21,32,43,.18); overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
.pill { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--acc-soft); color: var(--acc-ink); white-space: nowrap; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ibtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); display: grid; place-items: center; text-decoration: none; font-weight: 700; font-size: 16px; }
.ibtn:hover { color: var(--ink); border-color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--sans); cursor: pointer; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--acc); background: var(--acc); color: #fff; text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn:focus-visible, .ibtn:focus-visible { outline: 3px solid var(--acc-soft); }
.card-body { padding: 18px 20px 20px; }

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 6px 6px; line-height: 1.3; vertical-align: bottom; }
.tbl th b { display: block; color: var(--ink); font-weight: 600; }
.tbl td { padding: 0 6px; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.in { width: 100%; min-width: 0; font: 500 18px/1.2 var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; text-align: right; font-variant-numeric: tabular-nums; }
.in:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.in.is-calc { background: var(--bg); color: var(--muted); }
.in.is-src { border-color: var(--acc); }
select.in { text-align: left; appearance: none; -webkit-appearance: none; padding-right: 32px; min-width: 124px;
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path d="M1 1l5 5 5-5" fill="none" stroke="%2315202B" stroke-width="1.6"/></svg>') no-repeat right 12px center; }

.result { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 18px; border-radius: 10px; background: var(--acc-soft); color: var(--acc-ink); }
.result .big { font-size: 28px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.result .big small { font-size: 16px; font-weight: 600; margin-left: 4px; }
.result .f { font-size: 14px; }
.status { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.status:empty { display: none; }

/* pagina principală */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.hub a, .hub .soon { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; color: var(--ink); text-decoration: none; }
.hub a:hover { border-color: var(--acc); }
.hub b { display: block; font-size: 16px; margin-bottom: 4px; }
.hub span { color: var(--muted); font-size: 14px; }
.hub .soon { color: var(--muted); }

/* tutorial */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 36px); max-width: 820px; font-size: 16px; line-height: 1.65; }
.prose h2 { font-size: 21px; margin: 36px 0 10px; letter-spacing: -.01em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 17px; margin: 26px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin-bottom: 4px; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: 15px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }
.prose thead th { color: var(--muted); font-weight: 500; font-size: 14px; }
.prose .formula { font-size: 17px; background: var(--bg); border-radius: 8px; padding: 10px 14px; margin: 8px 0 14px; font-variant-numeric: tabular-nums; }
.prose .ex { border-left: 3px solid var(--acc); padding: 8px 14px; background: var(--acc-soft); border-radius: 0 8px 8px 0; margin: 10px 0 18px; }
.prose .ex p { margin: 0 0 6px; }
.prose .ex p:last-child { margin: 0; }
.prose code { font-family: inherit; font-weight: 600; }
.prose .back { margin-top: 30px; }
.toc { margin: 0 0 24px; padding: 14px 18px; background: var(--bg); border-radius: 10px; font-size: 15px; }
.toc ol { margin: 6px 0 0; padding-left: 20px; }
.toc a { color: var(--acc-ink); }

footer.site { margin-top: 40px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer.site a { color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 14px; }
  .side nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .side a, .side .soon { border: 1px solid var(--line); background: #fff; padding: 8px 12px; font-size: 14px; }
  .side .soon small { display: none; }
}
@media (max-width: 600px) {
  .card-head { padding-left: 14px; }
  .pill { display: none; }
  .card-body { padding: 14px; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr { display: block; }
  .tbl td { display: grid; grid-template-columns: 1fr minmax(130px, 46%); align-items: center; gap: 10px; padding: 5px 0; }
  .tbl td::before { content: attr(data-label); font-size: 14px; color: var(--muted); }
  .in { font-size: 17px; padding: 10px 11px; }
  .prose table, .prose thead, .prose tbody, .prose tr, .prose th, .prose td { display: block; }
  .prose thead { display: none; }
  .prose tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .prose th, .prose td { border: 0; padding: 2px 0; }
}
@media (prefers-reduced-motion: no-preference) { .in, .btn, .ibtn { transition: border-color .15s, box-shadow .15s; } }
