/* =========================================================================
   Pasek „zapis pod linkiem" — wspólny dla kalkulatora energii i fotowoltaiki (js/calc-sync.js).
   Marker w wtyczkach: <div data-calc-sync hidden></div>; skrypt go odkrywa i wypełnia.
   Kolory jak w calc.css / photovoltaics.css; stan paska w atrybucie data-state.
   ========================================================================= */
.cs-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    margin: 0; padding: 11px 16px;
    background: #f4f9f1; border: 1px solid #dde4df; border-radius: 12px;
    color: #15332b; font-size: 14px; line-height: 1.45;
    box-sizing: border-box;
}
.cs-bar *, .cs-bar *::before, .cs-bar *::after { box-sizing: border-box; }
.cs-bar[hidden] { display: none; }

.cs-bar__icon {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e4f2dc; color: #1f6b4f;
}
.cs-bar__text { flex: 1 1 240px; min-width: 0; }
.cs-bar__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-bar__actions:empty { display: none; }

.cs-btn {
    appearance: none; -webkit-appearance: none;
    margin: 0; padding: 8px 16px; border: 1.5px solid #133d33; border-radius: 999px;
    background: #133d33; color: #fff;
    font: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap;
    cursor: pointer; transition: filter .15s ease, background .15s ease;
}
.cs-btn:hover { filter: brightness(1.15); }
.cs-btn:focus-visible { outline: 3px solid #f5d93a; outline-offset: 2px; }
.cs-btn--ghost { background: transparent; color: #133d33; border-color: #c7d2cb; }
.cs-btn--ghost:hover { background: #fff; filter: none; border-color: #133d33; }

/* Komunikat tylko dla czytników ekranu. */
.cs-sr {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Ręczne kopiowanie, gdy schowek jest niedostępny. */
.cs-bar__manual {
    flex: 1 1 100%; width: 100%; margin: 0; padding: 8px 10px;
    border: 1.5px solid #c7d2cb; border-radius: 8px; background: #fff;
    font: inherit; font-size: 13px; color: #15332b;
}

/* Stany ostrzegawcze. */
.cs-bar[data-state="offline"], .cs-bar[data-state="rejected"], .cs-bar[data-state="loaderror"] {
    background: #fdf1ef; border-color: #f0cdc7;
}
.cs-bar[data-state="offline"] .cs-bar__icon, .cs-bar[data-state="rejected"] .cs-bar__icon, .cs-bar[data-state="loaderror"] .cs-bar__icon {
    background: #f8d9d4; color: #a3392b;
}
.cs-bar[data-state="conflict"], .cs-bar[data-state="notfound"], .cs-bar[data-state="expired"], .cs-bar[data-state="badformat"] {
    background: #fff9e0; border-color: #efe0a0;
}
.cs-bar[data-state="conflict"] .cs-bar__icon, .cs-bar[data-state="notfound"] .cs-bar__icon,
.cs-bar[data-state="expired"] .cs-bar__icon, .cs-bar[data-state="badformat"] .cs-bar__icon {
    background: #f9ecb0; color: #7a5d00;
}
.cs-bar[data-state="idle"] { background: #fff; }
.cs-bar[data-state="idle"] .cs-bar__text { color: #4d6a61; }
.cs-bar[data-state="saving"] .cs-bar__text, .cs-bar[data-state="loading"] .cs-bar__text { color: #4d6a61; }

@media (max-width: 575px) {
    .cs-bar { padding: 12px 14px; }
    .cs-bar__actions { width: 100%; }
    .cs-btn { flex: 1 1 auto; white-space: normal; }
}

@media print {
    .cs-bar { display: none !important; }
}
