/* Vlastní styly webu sdileni.wattery.cz (site.css je převzatý ze spotu).
   Barvy grafů drží významy z aplikace (deye-monitor web/v2/base.css): spotřeba modrá (--home),
   síť šedá; nasdílená elektřina = akcent značky. */
:root {
  --c-shared: #1fa775;
  --c-cons: #2563eb;
  --c-cons-soft: rgba(37, 99, 235, .2);
  --c-feed: #9aaba6;
  --c-short: #e0a21b;
}
[data-theme='dark'] {
  --c-shared: #4adda0;
  --c-cons: #60a5fa;
  --c-cons-soft: rgba(96, 165, 250, .26);
  --c-feed: #5d7773;
  --c-short: #fbbf24;
}

.faq { max-width: 52rem; }

/* Kotvy na jednostránkovém webu: nadpis nemá zajet pod pevnou hlavičku. */
section[id] { scroll-margin-top: calc(var(--header-h, 4.5rem) + .5rem); }

/* ── Hero: živá čtvrthodina místo slideshow ────────────────────────────── */
.hero-share {
  background:
    radial-gradient(50rem 36rem at 76% 42%, rgba(74, 221, 160, .11), transparent 62%),
    var(--band-gradient);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: end;
}
.hero-share .hero-content { grid-column: 1; grid-row: 1; max-width: 44rem; }
.hero-share.hero-immersive h1 { font-size: clamp(2.1rem, min(4.2vw, 7vh), 3.3rem); }

/* Hlavička: logo, devět odkazů a tlačítko potřebují na jednom řádku ~1 140 px. Pod 1200 px proto
   menu padá do druhého řádku (site.css), těsně nad tím se ještě utáhne — jako na spot.wattery.cz. */
@media (min-width: 1201px) and (max-width: 1290px) {
  .main-nav { gap: .8rem; font-size: .85rem; }
  .header-inner { gap: 1rem; }
}
.hero-scene {
  grid-column: 2; grid-row: 1;
  align-self: center; justify-self: center;
  width: min(100%, 38rem);
  padding: 0 clamp(1rem, 3vw, 3rem) 1.5rem 0;
}
.qh-scene { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-display); }
.qh-wire { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 2; }
.qh-flow {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 2 12; animation: qh-flow var(--flow-s, 1s) linear infinite;
  opacity: 0; transition: opacity .4s;
}
.qh-flow.is-on { opacity: 1; }
@keyframes qh-flow { to { stroke-dashoffset: -14; } }
.qh-seg { fill: none; stroke-width: 15; stroke: rgba(255, 255, 255, .09); transition: stroke .3s; }
.qh-seg.is-ok { stroke: var(--accent); }
.qh-seg.is-short { stroke: #f4b740; }
.qh-dial.is-done .qh-seg { stroke: var(--accent); }
.qh-time { fill: rgba(255, 255, 255, .72); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qh-pct { fill: #fff; font-size: 46px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; transition: fill .3s; }
.qh-pct.is-short { fill: #f4b740; }
.qh-sub { fill: rgba(255, 255, 255, .62); font-size: 13px; font-weight: 600; }
.qh-node circle { fill: rgba(255, 255, 255, .06); stroke: rgba(74, 221, 160, .5); stroke-width: 1.5; }
.qh-prod circle { fill: rgba(74, 221, 160, .14); stroke: var(--accent); }
.qh-ic { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qh-sun { fill: none; stroke: #fbbf24; stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .5s; }
.qh-sun.is-on { opacity: 1; }
.qh-name { fill: #fff; font-size: 14px; font-weight: 700; }
.qh-val { fill: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; transition: fill .3s; }
.qh-val.is-spike { fill: #f4b740; }
.qh-caption {
  margin: .2rem auto 0; max-width: 28rem; min-height: 2.9em; text-align: center;
  font-family: var(--font-display); font-weight: 600; font-size: .95rem; line-height: 1.45;
  color: rgba(255, 255, 255, .82);
}

@media (max-width: 980px) {
  .hero-share { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero-share.hero-immersive { min-height: 0; }
  .hero-scene { grid-column: 1; grid-row: 1; width: min(100%, 27rem); padding: 0 1.25rem; }
  .hero-share .hero-content { grid-row: 2; padding-top: .5rem; }
  .qh-caption { font-size: .85rem; }
}

/* ── Karty „proč tak málo“ ─────────────────────────────────────────────── */
.cards-why { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.card-svg {
  display: block; width: 2rem; height: 2rem; margin-bottom: .8rem;
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Přepínač (stejný vzor jako .seg v aplikaci) ───────────────────────── */
.seg {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--radius-pill);
  background: var(--chip-bg); border: 1px solid var(--line);
}
.seg button {
  font: 600 .9rem var(--font-display); color: var(--text-soft); background: transparent;
  border: 0; border-radius: var(--radius-pill); padding: .5rem 1.1rem; min-height: 2.5rem; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--card-bg-top); color: #fff; }
[data-theme='dark'] .seg button[aria-pressed='true'] { background: var(--accent); color: var(--text-on-accent); }

/* ── Ukázka jednoho dne (scripts/demo.js) ──────────────────────────────── */
.sd {
  background: var(--page-bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: clamp(1rem, 2.6vw, 1.8rem);
  display: grid;
  gap: 1rem;
}
.sd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.sd-kpi { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin: 0; }
.sd-kpi div { min-width: 7rem; }
.sd-kpi dt { font-size: .78rem; color: var(--text-soft); font-weight: 600; max-width: 11rem; line-height: 1.3; }
.sd-kpi dd { margin: .15rem 0 0; font-family: var(--font-display); font-size: .95rem; font-weight: 600; color: var(--text-soft); }
.sd-kpi b { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sd-kpi div:first-child b { color: var(--c-shared); }

.sd-chart { position: relative; }
.sd-svg { display: block; width: 100%; height: auto; touch-action: pan-y; font-family: var(--font-display); }
.sd-svg .ax { stroke: var(--line); stroke-width: 1; }
.sd-svg .ax0 { stroke: var(--text-soft); stroke-width: 1; opacity: .5; }
.sd-svg .lbl { fill: var(--text-soft); font-size: 12px; font-weight: 600; }
.sd-svg .lbl-side { fill: var(--text); font-size: 13px; font-weight: 700; }
.sd-svg .b-shared { fill: var(--c-shared); }
.sd-svg .b-cons { fill: var(--c-cons-soft); }
.sd-svg .b-feed { fill: var(--c-feed); opacity: .6; }
.sd-svg .hl { fill: var(--text); opacity: 0; transition: opacity .2s; }
.sd-svg .hl.is-on { opacity: .07; }
.sd-svg .cur { stroke: var(--text); stroke-width: 1; opacity: .45; }
.sd-tip {
  position: absolute; top: .25rem; pointer-events: none; z-index: 2;
  background: var(--card-bg-top); color: #fff; border-radius: var(--radius-s);
  padding: .5rem .7rem; font-size: .8rem; line-height: 1.45; box-shadow: var(--card-shadow);
  white-space: nowrap;
}
.sd-tip b { font-family: var(--font-display); }
.sd-tip .t-sh { color: var(--accent); }

.sd-legend { list-style: none; margin: -.3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .8rem; font-weight: 600; color: var(--text-soft); }
.sd-legend li { display: inline-flex; align-items: center; gap: .45rem; }
.sd-legend li::before { content: ''; width: .85rem; height: .85rem; border-radius: 3px; }
.sd-legend .lg-shared::before { background: var(--c-shared); }
.sd-legend .lg-grid::before { background: var(--c-cons-soft); }
.sd-legend .lg-feed::before { background: var(--c-feed); opacity: .6; }

.sd-foot { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem 2rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.sd-story { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; align-content: start; }
.sd-story li {
  display: grid; grid-template-columns: 7.4rem minmax(0, 1fr); gap: .8rem; align-items: baseline;
  padding: .45rem .6rem; border-radius: var(--radius-s); transition: background-color .15s;
}
.sd-story li:hover, .sd-story li:focus, .sd-story li.is-on { background: var(--chip-bg); outline: none; }
.sd-story time { font-family: var(--font-display); font-weight: 700; font-size: .85rem; color: var(--accent-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-story span { color: var(--text-soft); font-size: .93rem; }
.sd-sites h3 { font-size: .95rem; margin-bottom: .8rem; }
.sd-site { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: .2rem .7rem; align-items: center; margin-bottom: .65rem; }
.sd-site span { grid-row: 1 / 3; font-weight: 600; font-size: .92rem; }
.sd-site i { display: block; height: .55rem; border-radius: var(--radius-pill); background: var(--c-cons-soft); overflow: hidden; }
.sd-site b { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c-shared); transition: width .5s ease; }
.sd-site small { font-size: .78rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.demo-note { margin-top: .9rem; max-width: 60rem; }

@media (max-width: 760px) {
  .sd-foot { grid-template-columns: minmax(0, 1fr); }
  .sd-story li { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .sd-kpi { gap: .6rem 1.2rem; width: 100%; }
  .sd-kpi div { min-width: 0; flex: 1 1 5.5rem; }
  .sd-head .seg { width: 100%; }
  .sd-head .seg button { flex: 1; padding-inline: .6rem; }
}

/* ── Jak to funguje: čtyři věci, které řízení dělá ─────────────────────── */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.4rem 1.8rem; }
.how-item { border-top: 2px solid var(--accent); padding-top: 1rem; }
.how-item h3 { margin-bottom: .45rem; }
.how-item p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.how-item a { font-weight: 600; white-space: nowrap; }

/* ── Čtvrthodina pod lupou — tmavý panel v obou motivech ───────────────── */
.lupa {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
  background: var(--band-gradient); color: var(--text-on-dark);
  border-radius: var(--card-radius); padding: clamp(1.3rem, 4vw, 2.6rem);
}
.lupa .kicker {
  display: block; font-family: var(--font-display); font-size: .8rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6rem;
}
.lupa h2 { color: #fff; font-size: clamp(1.35rem, 2.8vw, 1.85rem); }
.lupa p { color: var(--text-on-dark-soft); }
.lupa .muted { color: rgba(255, 255, 255, .6); }
.lupa .seg { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
.lupa .seg button { color: rgba(255, 255, 255, .72); }
.lupa .seg button:hover { color: #fff; }
.lupa .seg button[aria-pressed='true'] { background: var(--accent); color: var(--text-on-accent); }
.lupa-out { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: 1.2rem 0 1rem; }
.lupa-out dt { font-size: .76rem; color: rgba(255, 255, 255, .62); font-weight: 600; }
.lupa-out dd { margin: .1rem 0 0; font: 800 1.25rem var(--font-display); color: #fff; font-variant-numeric: tabular-nums; }
.lupa-out dd[data-lupa-out='shared'] { color: var(--accent); }
.lupa-out dd.is-bad { color: #f4b740; }
.lupa-fig { margin: 0; min-width: 0; }
.lupa-chart { position: relative; }
.lupa-svg { display: block; width: 100%; height: auto; font-family: var(--font-display); }
.lupa-svg .ax { stroke: rgba(255, 255, 255, .12); }
.lupa-svg .lbl { fill: rgba(255, 255, 255, .6); font-size: 12px; font-weight: 600; }
.lupa-svg .l-cons { fill: none; stroke: #7cb2ff; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.lupa-svg .l-exp { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.lupa-svg .gap { fill: rgba(244, 183, 64, .28); }
.lupa-svg .p-cons { fill: rgba(124, 178, 255, .2); }
.lupa-svg .p-exp { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .8; }
.lupa-svg .cur { stroke: rgba(255, 255, 255, .55); stroke-dasharray: 3 4; }
.lupa-svg .note { fill: #f4b740; font-size: 12px; font-weight: 700; }
.lupa-svg .sub { fill: rgba(255, 255, 255, .5); font-size: 11px; font-weight: 600; }
.lupa-play {
  position: absolute; left: 3.2rem; top: .2rem; z-index: 1;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--accent); color: var(--text-on-accent);
  box-shadow: 0 6px 20px -6px var(--accent-glow);
}
.lupa-play svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.lupa-play:disabled { opacity: .5; cursor: default; }
.lupa-fig figcaption { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-top: .5rem; font-size: .8rem; font-weight: 600; color: rgba(255, 255, 255, .72); }
.lupa-fig .lg { display: inline-flex; align-items: center; gap: .45rem; }
.lupa-fig .lg::before { content: ''; width: 1rem; height: 3px; border-radius: 2px; }
.lupa-fig .lg-cons::before { background: #7cb2ff; }
.lupa-fig .lg-exp::before { background: var(--accent); }
.lupa-fig .lg-gap::before { height: .8rem; width: .8rem; border-radius: 3px; background: rgba(244, 183, 64, .5); }
@media (max-width: 900px) {
  .lupa { grid-template-columns: minmax(0, 1fr); }
}

/* ── Alokační klíče ────────────────────────────────────────────────────── */
.feature.keys { border-top: 0; padding-top: 0; }
.keys-fig {
  margin: 0; background: var(--page-bg-raised); border: 1px solid var(--line); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow); padding: clamp(1rem, 3vw, 1.6rem);
}
.keys-fig figcaption { font-family: var(--font-display); font-weight: 700; margin-bottom: .2rem; }
.keys-fig .keys-cap-sub { margin: 0 0 1rem; font-size: .85rem; color: var(--text-soft); }
.keys-rows { display: grid; gap: .85rem; }
.key-row { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: .3rem .8rem; align-items: center; }
.key-row > span { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.key-row > span small { display: block; font-weight: 600; color: var(--text-soft); font-size: .75rem; }
.key-bar { position: relative; height: 1.35rem; border-radius: 6px; background: var(--chip-bg); }
.key-bar .k-need { position: absolute; top: 0; bottom: 0; left: 0; border: 1.5px dashed var(--c-cons); border-radius: 6px; }
.key-bar .k-r1, .key-bar .k-r2 { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }
.key-bar .k-r1 { left: 3px; background: var(--c-shared); }
.key-bar .k-r2 { background: var(--c-shared); opacity: .5; }
.key-row p { grid-column: 2; margin: 0; font-size: .8rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.keys-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: 1rem; font-size: .76rem; color: var(--text-soft); font-weight: 600; }
.keys-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.keys-legend span::before { content: ''; width: .8rem; height: .8rem; border-radius: 3px; box-sizing: border-box; }
.keys-legend .kl-1::before { background: var(--c-shared); }
.keys-legend .kl-2::before { background: var(--c-shared); opacity: .5; }
.keys-legend .kl-n::before { border: 1.5px dashed var(--c-cons); }
.keys-sum { margin: .9rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .92rem; color: var(--text-soft); }
.keys-sum b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Co potřebujete ────────────────────────────────────────────────────── */
.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.2rem; }
.need {
  background: var(--page-bg-raised); border: 1px solid var(--line); border-radius: var(--card-radius);
  padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--card-shadow);
}
.need h3 { margin-bottom: .8rem; }
.need-more { margin: .9rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--text-soft); }
ul.check, ul.dash { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
ul.check li, ul.dash li { position: relative; padding-left: 1.5rem; color: var(--text-soft); font-size: .95rem; }
ul.check li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-text); font-weight: 700; }
ul.dash li::before { content: '–'; position: absolute; left: .2rem; color: var(--text-soft); font-weight: 700; }
.split {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 2.5rem; margin-top: 1.6rem;
  padding: clamp(1.2rem, 3vw, 1.8rem); border-radius: var(--card-radius); background: var(--chip-bg);
}
.split h3 { font-size: 1.05rem; margin-bottom: .7rem; }
@media (max-width: 680px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ── Firmy a obce ──────────────────────────────────────────────────────── */
.audiences { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.2rem; }
.audience {
  background: var(--page-bg-raised); border: 1px solid var(--line); border-radius: var(--card-radius);
  padding: 1.5rem 1.5rem 1.3rem; box-shadow: var(--card-shadow);
}
.audience h3 { margin-bottom: .5rem; }
.audience-lead { margin: 0 0 1rem; color: var(--text); font-size: .98rem; }
.dotace { margin-top: 1.4rem; width: fit-content; }   /* rámeček končí s textem, ne v půlce prázdné šířky */
.dotace h3 { font-size: 1.05rem; margin-bottom: .45rem; }
.dotace p { color: var(--text-soft); font-size: .95rem; max-width: 72ch; }
.who-family { margin: 1.4rem 0 0; max-width: 46rem; color: var(--text-soft); }

/* ── FAQ ───────────────────────────────────────────────────────────────── */
.faq summary:hover { color: var(--accent-text); }

/* ── Formulář: co bude dál ─────────────────────────────────────────────── */
.next { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; color: var(--text-soft); }
.next li::marker { color: var(--accent-text); font-family: var(--font-display); font-weight: 700; }

/* ── Další weby wattery ────────────────────────────────────────────────── */
.sister { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.2rem; }
.sister-card {
  display: grid; align-content: start; gap: .45rem; padding: 1.4rem 1.5rem;
  border-radius: var(--card-radius); background: var(--card-gradient); color: var(--text-on-dark);
  box-shadow: var(--card-shadow); text-decoration: none; transition: transform .15s ease, box-shadow .2s ease;
}
.sister-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--card-hover-shadow); }
.sister-name { font: 700 .82rem var(--font-display); color: var(--accent); }
.sister-card h3 { color: #fff; margin: 0; }
.sister-card p { margin: 0; color: var(--text-on-dark-soft); font-size: .95rem; }

@media (prefers-reduced-motion: reduce) {
  .qh-flow { animation: none; stroke-dasharray: none; }
  /* Návštěvník si scénu pustil tlačítkem (scripts/hero.js) → i čáry tečou.
     !important kvůli plošnému zkrácení animací v global.css. */
  html.motion-ok .qh-flow {
    animation: qh-flow var(--flow-s, 1s) linear infinite !important;
    stroke-dasharray: 2 12;
  }
}
.qh-play {
  display: flex; align-items: center; gap: .45rem;
  margin: .6rem auto 0; padding: .45rem 1rem .45rem .8rem;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer;
  font: 600 .88rem var(--font-display);
}
.qh-play[hidden] { display: none; }
.qh-play svg { width: 1rem; height: 1rem; fill: var(--accent); }
.qh-play:hover { background: rgba(255, 255, 255, .12); border-color: var(--accent); }
.qh-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
