/* ================================================
   STATUS KSEF - Redesign sesja 131 (na bazie makiety #4)

   Ladowany PO style.css i tokens.css.
   Override starych komponentow + nowe komponenty zgodne z makieta.

   Kolejnosc sekcji w pliku odpowiada sekcji na stronie:
     1. RESET / TYPOGRAFIA (Inter, skala 11-32px)
     2. NAV (logo + 6 linkow + subskrybuj/zaloguj)
     3. HERO 2-kolumnowy (radar+rekomendacja LEWY / panel "CO SIE DZIEJE TERAZ" PRAWY)
     4. WSKAZNIKI SYSTEMU (4 KPI cards z konkretnymi wartosciami)
     5. RYZYKO + WYKRES 24h (2 kolumny)
     6. INCYDENTY + PODSUMOWANIE (2 kolumny)
     7. FEATURE CARDS (4)
     8. NEWSLETTER + RATING
     9. FOOTER
   ================================================ */

/* ============================================================
   1. RESET / TYPOGRAFIA - Inter, dokladne rozmiary z makiety
   ============================================================ */
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  letter-spacing: var(--tracking-normal);
}

h1, .h1 {
  font-family: var(--font-sans);
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-h1);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h2, .h2 {
  font-family: var(--font-sans);
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-h2);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h3, .h3 {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-h2);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-normal);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.body-2 {
  font-size: var(--text-body-sm);
  letter-spacing: var(--tracking-wide);
}

.caption {
  font-size: var(--text-caption);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ============================================================
   2. NAV - z makiety #1 (logo + 6 linkow + 2 buttony)
   ============================================================ */
#nav, .nav-redesign {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: var(--weight-bold);
  color: var(--brand-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity var(--duration-fast) var(--ease);
}

.nav-logo:hover { opacity: 0.85; }

.nav-logo__icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.35));
}

.nav-logo__icon path {
  stroke: var(--brand-primary);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  padding: 6px 0;
  position: relative;
  transition: color var(--duration-fast) var(--ease);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a.active {
  color: var(--brand-primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--brand-primary);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-normal);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn--primary {
  background: var(--brand-primary);
  color: var(--on-brand);
}

.btn--primary:hover {
  background: var(--brand-primary-hover);
}

.btn--primary:active {
  background: var(--brand-primary-active);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn--secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn--secondary:hover {
  background: var(--surface-3);
}

.btn--danger {
  background: var(--state-down);
  color: var(--text-on-state);
}

.nav-theme-redesign {
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}

.nav-theme-redesign:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

@media (max-width: 900px) {
  .nav-inner { padding: 12px 16px; gap: 12px; }
  .nav-links { display: none; }
  .nav-actions .btn-text { display: none; }
}

/* ============================================================
   3. HERO 2-kolumnowy
   ============================================================ */
.hero-redesign {
  background: var(--bg-base);
  padding: 32px 0 24px;
}

.hero-redesign .hero-inner-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .hero-redesign .hero-inner-grid {
    grid-template-columns: 1fr;
  }
}

/* --- LEWY: status main + recommendation --- */
.status-main-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 700px) {
  .status-main-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px;
  }
}

.status-main-radar {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-main-radar__rings {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--brand-primary);
  opacity: 0.15;
}

.status-main-radar__rings::before,
.status-main-radar__rings::after {
  content: '';
  position: absolute;
  inset: 18px;
  border: 2px solid var(--brand-primary);
  border-radius: 50%;
  opacity: 0.3;
}

.status-main-radar__rings::after {
  inset: 36px;
  opacity: 0.5;
}

.status-main-radar__core {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: var(--glow-brand);
}

.status-main-radar__core .material-symbols-outlined {
  font-size: 48px;
  color: var(--brand-primary);
  font-variation-settings: 'FILL' 1, 'wght' 700;
}

.status-main-content { min-width: 0; }

.status-main-caption {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.status-main-headline {
  font-size: 36px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-h1);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.status-main-headline em {
  color: var(--brand-primary);
  font-style: normal;
}

.status-main-sub {
  color: var(--text-secondary);
  font-size: var(--text-body);
  line-height: var(--leading-relaxed);
  margin-bottom: 20px;
}

.recommendation-card {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.20);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
}

/* Wariant bez ikony - 1 kolumna, wyrownany do lewej zgodnie z reszta hero */
.recommendation-card--noicon {
  display: block;
  grid-template-columns: none;
  gap: 0;
}

.recommendation-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
}

.recommendation-card__icon .material-symbols-outlined {
  font-size: 18px;
}

.recommendation-card__caption {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  color: var(--brand-primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.recommendation-card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.recommendation-card__desc {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}

.status-main-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: var(--text-body-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--state-ok-bg);
  color: var(--state-ok);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--state-ok);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

/* --- PRAWY: panel "CO SIE DZIEJE TERAZ" --- */
.live-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.live-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.live-panel__title {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.live-panel__rows {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.live-panel__row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.live-panel__row:last-child {
  border-bottom: none;
}

.live-panel__row-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.live-panel__row-icon .material-symbols-outlined {
  font-size: 22px;
  color: var(--brand-primary);
}

.live-panel__row-label {
  font-size: var(--text-body);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.live-panel__row-value {
  text-align: right;
}

.live-panel__row-main {
  display: block;
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-h2);
  line-height: 1;
}

.live-panel__row-main--ok { color: var(--brand-primary); }

.live-panel__row-sub {
  display: block;
  font-size: var(--text-caption);
  color: var(--text-muted);
  margin-top: 4px;
}

.live-panel__cta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.live-panel__cta button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}

.live-panel__cta button:hover {
  background: var(--surface-3);
}

/* ============================================================
   4. WSKAZNIKI SYSTEMU (4 KPI cards z konkretnymi wartosciami)
   ============================================================ */
.kpi-section {
  background: var(--bg-base);
  padding: 24px 0;
}

.kpi-section__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.kpi-section__title {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
}

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; padding: 16px; gap: 12px; }
}

.kpi-card-redesign {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-card-redesign__label {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
}

.kpi-card-redesign__value {
  font-size: 32px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-h1);
  line-height: 1;
  color: var(--text-primary);
}

.kpi-card-redesign__value--ok { color: var(--brand-primary); }
.kpi-card-redesign__value--warn { color: var(--state-warn); }
.kpi-card-redesign__value--down { color: var(--state-down); }

.kpi-card-redesign__sub {
  font-size: var(--text-caption);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   5. WYKRES 24h + TWOJE RYZYKO DZIS (2 kolumny)
   ============================================================ */
.chart-risk-section {
  background: var(--bg-base);
  padding: 12px 0 24px;
}

.chart-risk-section__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

@media (max-width: 1100px) {
  .chart-risk-section__inner {
    grid-template-columns: 1fr;
  }
}

/* --- WYKRES --- */
.chart-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
}

.chart-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.chart-card__select {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 6px 32px 6px 12px;
  font-size: var(--text-body-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394A3B8'><path d='M7 10l5 5 5-5'/></svg>");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

/* SESJA 135 fix #5: kontener selektorow nad wykresem (srodowisko + zakres) */
.chart-card__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-card__canvas {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-card__canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-card__legend {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--text-caption);
  color: var(--text-muted);
  flex-wrap: wrap;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chart-legend-dot {
  width: 10px;
  height: 2px;
  display: inline-block;
  border-radius: 1px;
}

/* --- PANEL RYZYKA --- */
.risk-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.risk-panel__title {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.risk-panel__title .hint-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  text-transform: none;
  letter-spacing: 0;
}

.risk-panel__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.risk-panel__label {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.risk-panel__select {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 32px 10px 12px;
  font-size: var(--text-body);
  font-family: var(--font-sans);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394A3B8'><path d='M7 10l5 5 5-5'/></svg>");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

.risk-panel__select:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-color: var(--brand-primary);
}

.risk-result {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.20);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
}

.risk-result__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
}

.risk-result__caption {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.risk-result__level {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  color: var(--brand-primary);
  letter-spacing: var(--tracking-h2);
  line-height: 1;
  margin: 4px 0;
}

.risk-result__desc {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
}

.risk-rec {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.risk-rec__label {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.risk-rec__value {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--brand-primary);
}

.risk-rec__time {
  font-size: var(--text-body);
  color: var(--text-secondary);
}

.risk-rec__time strong {
  color: var(--brand-primary);
}

.risk-panel__update {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

/* ============================================================
   6. OSTATNIE INCYDENTY + PODSUMOWANIE (2 kolumny)
   ============================================================ */
.incidents-summary-section {
  background: var(--bg-base);
  padding: 12px 0 24px;
}

.incidents-summary-section__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 1100px) {
  .incidents-summary-section__inner {
    grid-template-columns: 1fr;
  }
}

/* --- INCYDENTY --- */
.incidents-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.incidents-card__title {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.incidents-card__date {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.incidents-list {
  display: flex;
  flex-direction: column;
  position: relative;
  flex: 1;
  /* Override stary CSS z style.css linia 1258 (max-height: 200px overflow auto) */
  max-height: none !important;
  overflow: visible !important;
}

/* Status radar - pulsacja rings (animowany krag wokol radaru) */
.status-main-radar__rings {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--state-ok, #22c55e);
  opacity: 0;
  animation: status-radar-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
.status-main-radar__rings::before,
.status-main-radar__rings::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--state-ok, #22c55e);
  opacity: 0;
  animation: status-radar-pulse 2.4s ease-out infinite;
}
.status-main-radar__rings::before { animation-delay: 0.8s; }
.status-main-radar__rings::after { animation-delay: 1.6s; }

@keyframes status-radar-pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Stan warn/down/maint - inny kolor pulsacji */
body.state-warn .status-main-radar__rings,
body.state-warn .status-main-radar__rings::before,
body.state-warn .status-main-radar__rings::after { border-color: var(--state-warn, #eab308); }

body.state-down .status-main-radar__rings,
body.state-down .status-main-radar__rings::before,
body.state-down .status-main-radar__rings::after { border-color: var(--state-down, #ef4444); }

body.state-maint .status-main-radar__rings,
body.state-maint .status-main-radar__rings::before,
body.state-maint .status-main-radar__rings::after { border-color: var(--state-maint, #3b82f6); }

.incidents-list::before {
  content: '';
  position: absolute;
  left: 38px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border-subtle);
}

.incident-item {
  display: grid;
  grid-template-columns: 50px 100px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  position: relative;
}

.incident-item__time {
  font-size: var(--text-body-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  position: relative;
}

.incident-item__time::after {
  content: '';
  position: absolute;
  left: 38px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 3px solid var(--bg-base);
  box-shadow: 0 0 0 1px var(--brand-primary);
  z-index: 1;
}

.incident-item--ok .incident-item__time::after { background: var(--state-ok); box-shadow: 0 0 0 1px var(--state-ok); }
.incident-item--warn .incident-item__time::after { background: var(--state-warn); box-shadow: 0 0 0 1px var(--state-warn); }
.incident-item--down .incident-item__time::after { background: var(--state-down); box-shadow: 0 0 0 1px var(--state-down); }
.incident-item--maint .incident-item__time::after { background: var(--state-maint); box-shadow: 0 0 0 1px var(--state-maint); }

.incident-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  width: fit-content;
}

.incident-badge--ok { background: var(--state-ok-bg); color: var(--state-ok); border: 1px solid var(--state-ok-bg-strong); }
.incident-badge--warn { background: var(--state-warn-bg); color: var(--state-warn); border: 1px solid var(--state-warn-bg-strong); }
.incident-badge--down { background: var(--state-down-bg); color: var(--state-down); border: 1px solid var(--state-down-bg-strong); }
.incident-badge--maint { background: var(--state-maint-bg); color: var(--state-maint); border: 1px solid var(--state-maint-bg-strong); }

.incident-item__content { min-width: 0; }

.incident-item__title {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.incident-item__desc {
  font-size: var(--text-body-sm);
  color: var(--text-muted);
  line-height: var(--leading-snug);
}

.incidents-card__cta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.incidents-card__cta button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--duration-fast) var(--ease);
}

.incidents-card__cta button:hover {
  background: var(--surface-3);
}

/* --- PODSUMOWANIE --- */
.summary-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
}

.summary-card__title {
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .summary-stats { grid-template-columns: 1fr; gap: 12px; }
}

.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-stat__label {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.summary-stat__value {
  font-size: 28px;
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-h1);
  line-height: 1;
}

.summary-stat__value-unit {
  font-size: 16px;
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-left: 4px;
}

.summary-stat__sub {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

.summary-stat__bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}

.summary-stat__bar-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: var(--radius-full);
}

.weekly-bars {
  margin-top: 16px;
}

.weekly-bars__title {
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.weekly-bars__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 100px;
  align-items: end;
  position: relative;
  padding-left: 38px;
}

/* SESJA 135 fix #7: dynamiczna os Y - wartosci wstrzykiwane przez JS (bo zmienne, np. 96%-100% lub 95%-100%) */
.weekly-bars__y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
}

.weekly-bars__y-label {
  position: absolute;
  left: 0;
  font-size: var(--text-caption);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.weekly-bars__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: end;
}

.weekly-bars__bar {
  width: 100%;
  max-width: 24px;
  background: var(--brand-primary);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  min-height: 8px;
  transition: all var(--duration-normal) var(--ease);
}

.weekly-bars__label {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

/* SESJA 136 hotfix BUG 1: legenda kolorow pod wykresem 7 dni - eliminuje pusta przestrzen na dole karty Podsumowanie */
.weekly-bars__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  font-size: var(--text-caption);
  color: var(--text-muted);
}

.weekly-bars__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.weekly-bars__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.weekly-bars__legend-dot--ok { background: var(--state-ok); }
.weekly-bars__legend-dot--warn { background: var(--state-warn); }
.weekly-bars__legend-dot--down { background: var(--state-down); }

/* ============================================================
   7. FEATURE CARDS (Co robic / Symulator / API) - SESJA 136: 4->3 karty
   ============================================================ */
.features-section {
  background: var(--bg-base);
  padding: 24px 0;
}

.features-section__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* SESJA 136 hotfix BUG 2: 4->3 karty (Alerty przeniesiona do newsletter-section) - Symulator+API maja teraz 33% szerokosci zamiast 25%, etykiety Optym/Realnie/Pesym mieszcza w pelni */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* SESJA 136 hotfix #2: min-width: 0 zapobiega CSS Grid blow-up gdy children maja non-wrappable content (.feature-card__code z white-space:pre + dluga linia ~95 znakow). Bez tego trzecia kolumna repeat(3, 1fr) urasta do min-content - 330/330/524px zamiast rownych 395/395/395px. */
.feature-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(34, 197, 94, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
}

.feature-card__icon .material-symbols-outlined {
  font-size: 22px;
}

.feature-card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

/* SESJA 135 fix #3: badge "Wkrótce: API v1" - zoltawe podswietlenie obok tytulu */
.feature-card__badge {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: var(--weight-medium, 500);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--state-warn, #d4af37);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: var(--radius-full, 999px);
  vertical-align: middle;
  white-space: nowrap;
}

.feature-card__desc {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  line-height: var(--leading-snug);
  flex: 1;
}

.feature-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feature-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.feature-card__pill .material-symbols-outlined {
  font-size: 14px;
}

.feature-card__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-card__list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.feature-card__list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  flex-shrink: 0;
}

.feature-card__input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-card__input-group label {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

.feature-card__input {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: var(--text-body);
  font-family: var(--font-sans);
}

.feature-card__estimate {
  font-size: var(--text-body-sm);
  color: var(--text-muted);
}

.feature-card__estimate strong {
  color: var(--brand-primary);
  font-weight: var(--weight-semibold);
}

/* SESJA 136 hotfix #2: max-width: 100% gwarantuje ze code box nie wylewa sie poza karte gdy ma dluga linie. overflow-x: auto (juz bylo) daje poziomy scrollbar zamiast push grid. white-space: pre zachowane - zachowuje formatowanie kodu z znakami nowej linii. */
.feature-card__code {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--text-secondary);
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  line-height: 1.5;
}

.feature-card__code .code-method { color: var(--brand-primary); font-weight: var(--weight-semibold); }
.feature-card__code .code-status { color: var(--state-ok); }
.feature-card__code .code-key { color: var(--state-info); }
.feature-card__code .code-value { color: var(--text-primary); }
/* SESJA 135 hotfix #2: HTML embed badge syntax highlight */
.feature-card__code .code-tag { color: #ec4899; }
.feature-card__code .code-attr { color: #f59e0b; }
.feature-card__code .code-comment { color: var(--text-tertiary, #6b7280); font-style: italic; }

.feature-card__cta {
  margin-top: auto;
  padding-top: 8px;
}

.feature-card__cta button {
  width: 100%;
  padding: 10px 16px;
  background: var(--brand-primary);
  color: var(--on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--duration-fast) var(--ease);
}

.feature-card__cta button:hover {
  background: var(--brand-primary-hover);
}

.feature-card__cta button.btn--ghost {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.feature-card__cta button.btn--ghost:hover {
  background: var(--surface-3);
}

/* ============================================================
   8. NEWSLETTER + RATING (na pelnej szerokosci, 2 kolumny)
   ============================================================ */
.newsletter-redesign {
  background: var(--bg-base);
  padding: 24px 0 32px;
}

/* SESJA 136 hotfix BUG 3: 2fr+1fr -> 1fr+1fr (rowna szerokosc kart Alerty + Niezalezny monitoring) */
.newsletter-redesign__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .newsletter-redesign__inner { grid-template-columns: 1fr; }
}

/* SESJA 136 hotfix BUG 3: layout zmieniony z grid na flex column (icon + body z pillsami + form + note) - mniej cisniete, lepsza hierarchia */
.newsletter-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.newsletter-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.newsletter-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(34, 197, 94, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
}

.newsletter-card__icon .material-symbols-outlined {
  font-size: 24px;
}

.newsletter-card__title {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.newsletter-card__desc {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.newsletter-card__form {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  flex-wrap: wrap;
}

.newsletter-card__input {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: var(--text-body);
  font-family: var(--font-sans);
  flex: 1 1 240px;
  min-width: 0;
}

.newsletter-card__input:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-color: var(--brand-primary);
}

.newsletter-card__submit {
  padding: 10px 20px;
  background: var(--brand-primary);
  color: var(--on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--duration-fast) var(--ease);
}

.newsletter-card__submit:hover {
  background: var(--brand-primary-hover);
}

/* SESJA 136 hotfix BUG 3: usuniecie grid-column (newsletter-card to teraz flex) */
.newsletter-card__note {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

/* SESJA 136 hotfix BUG 3: pillsy Email/SMS/Webhook (Email aktywny, pozostale --soon) */
.newsletter-card__channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.newsletter-card__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.newsletter-card__pill .material-symbols-outlined {
  font-size: 14px;
}

.newsletter-card__pill--soon {
  opacity: 0.65;
  cursor: default;
}

.newsletter-card__pill--soon small {
  font-size: 10px;
  opacity: 0.85;
  font-weight: var(--weight-normal, 400);
}

/* --- RATING / NIEZALEZNY MONITORING --- */
/* SESJA 136 hotfix BUG 3: stretch na pelna wysokosc kart Alerty po lewej (rowna szerokosc + rowna wysokosc) */
.rating-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rating-card__title {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.rating-card__stars {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 8px;
}

.rating-card__star {
  color: #FBBF24;
  font-size: 22px;
}

.rating-card__value {
  font-size: var(--text-body);
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

.rating-card__value strong {
  color: var(--brand-primary);
  font-weight: var(--weight-bold);
}

.rating-card__sub {
  font-size: var(--text-caption);
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

/* ============================================================
   9. FOOTER REDESIGN
   ============================================================ */
.footer-redesign {
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  margin-top: 24px;
}

.footer-redesign__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
}

@media (max-width: 700px) {
  .footer-redesign__inner { grid-template-columns: 1fr; text-align: center; }
}

.footer-redesign__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-redesign__logo {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--weight-bold);
  color: var(--brand-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.footer-redesign__copy {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

.footer-redesign__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-redesign__links a {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
}

.footer-redesign__links a:hover {
  color: var(--text-primary);
}

.footer-redesign__social {
  display: flex;
  gap: 8px;
}

.footer-redesign__social a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}

.footer-redesign__social a:hover {
  background: var(--surface-3);
  color: var(--brand-primary);
}

/* ============================================================
   UKRYJ STARE KOMPONENTY (zostana zastapione w kolejnych krokach)
   ============================================================ */
.hero-redesign-active .hero { display: none !important; }
.hero-redesign-active .api-info-bar { display: none !important; }
.hero-redesign-active .envs-detail-section { display: none !important; }
.hero-redesign-active .search-section { display: none !important; }
.hero-redesign-active #stats { display: none !important; }
.hero-redesign-active #tools { display: none !important; }
.hero-redesign-active #faq { display: none !important; }
.hero-redesign-active .newsletter { display: none !important; }
.hero-redesign-active .footer { display: none !important; }
.hero-redesign-active .alert-banner { display: none !important; }
.hero-redesign-active .spike-banner { display: none !important; }

/* ============================================================
   MODAL (Subscribe alerty + Login placeholder)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-backdrop);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease);
}

.modal-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-2xl);
  position: relative;
  z-index: var(--z-modal);
  transform: translateY(12px);
  transition: transform var(--duration-normal) var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-backdrop--open .modal-card { transform: translateY(0); }

.modal-card__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  transition: all var(--duration-fast) var(--ease);
}

.modal-card__close:hover { background: var(--surface-3); color: var(--text-primary); }

.modal-card__title {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-card__desc {
  font-size: var(--text-body);
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: var(--leading-relaxed);
}

.modal-card__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-card__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-card__label {
  font-size: var(--text-body-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.modal-card__input,
.modal-card__select {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: var(--text-body);
  font-family: var(--font-sans);
}

.modal-card__input:focus,
.modal-card__select:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-color: var(--brand-primary);
}

.modal-card__type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
}

.modal-card__type-tab {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--duration-fast) var(--ease);
}

.modal-card__type-tab:hover { color: var(--text-primary); }
.modal-card__type-tab .material-symbols-outlined { font-size: 18px; }

.modal-card__type-tab--active {
  background: var(--brand-primary);
  color: var(--on-brand);
}

.modal-card__events {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-card__event {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: var(--text-body-sm);
  cursor: pointer;
  user-select: none;
  transition: all var(--duration-fast) var(--ease);
}

.modal-card__event input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand-primary);
}

.modal-card__event:has(input:checked) {
  background: rgba(34, 197, 94, 0.10);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.modal-card__submit {
  padding: 12px 20px;
  background: var(--brand-primary);
  color: var(--on-brand);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--duration-fast) var(--ease);
}

.modal-card__submit:hover:not(:disabled) { background: var(--brand-primary-hover); }
.modal-card__submit:disabled { opacity: 0.6; cursor: wait; }

.modal-card__message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-body-sm);
  margin-top: 8px;
}

.modal-card__message--ok {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--state-ok);
}

.modal-card__message--err {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--state-down);
}

/* TOAST inline (dla newsletter) */
.form-toast {
  display: none;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  grid-column: 1 / -1;
}

.form-toast--ok {
  display: block;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--state-ok);
}

.form-toast--err {
  display: block;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--state-down);
}

/* ========== SYMULATOR OPÓŹNIEŃ (live, dane z API) ========== */

.simulator-presets {
  display: flex;
  gap: 6px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}

.simulator-presets__chip {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}

.simulator-presets__chip:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

.simulator-presets__chip--active {
  background: var(--brand-primary);
  color: var(--on-brand);
  border-color: var(--brand-primary);
}

.simulator-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.simulator-result {
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.simulator-result--avg {
  border-color: var(--brand-primary);
  background: rgba(34, 197, 94, 0.08);
}

.simulator-result__label {
  font-size: 10.5px;
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.simulator-result__value {
  font-size: 14px;
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.simulator-result--avg .simulator-result__value {
  color: var(--brand-primary);
  font-size: 15px;
}

.simulator-result--avg {
  box-shadow: 0 0 0 1px var(--brand-primary) inset;
  background: rgba(34, 197, 94, 0.10);
}

.simulator-result__sub {
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.simulator-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.20);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.simulator-tip__icon {
  font-size: 16px;
  color: var(--state-warn);
  flex-shrink: 0;
  margin-top: 1px;
}

.simulator-tip--ok {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.20);
}

.simulator-tip--ok .simulator-tip__icon {
  color: var(--state-ok);
}

.simulator-tip--down {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.20);
}

.simulator-tip--down .simulator-tip__icon {
  color: var(--state-down);
}

.simulator-result__value--ok { color: var(--state-ok); }
.simulator-result__value--warn { color: var(--state-warn); }
.simulator-result__value--down { color: var(--state-down); }

/* ===========================================================
 * SESJA 142 - SEO "awaria ksef" (cite-bait + visible FAQ)
 * ============================================================ */

/* Cite-bait block - AI Overview / Perplexity / ChatGPT czytaja */
.trust-bar {
  padding: 24px 0 32px;
}

.trust-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(242, 202, 80, 0.06), rgba(184, 134, 11, 0.04));
  border: 1px solid rgba(242, 202, 80, 0.18);
  border-radius: 16px;
}

.trust-bar__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.trust-bar__title::before {
  content: "";
  width: 6px;
  height: 22px;
  background: var(--accent-gold);
  border-radius: 3px;
  display: inline-block;
}

.trust-bar__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.trust-bar__list li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  padding: 12px 14px 12px 30px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  position: relative;
}

.trust-bar__list li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 18px;
  width: 8px;
  height: 8px;
  background: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(242, 202, 80, 0.18);
}

.trust-bar__list strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Light mode adjust */
:root.light .trust-bar__inner {
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.06), rgba(242, 202, 80, 0.04));
  border-color: rgba(184, 134, 11, 0.20);
}

:root.light .trust-bar__list li {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

/* Visible FAQ "Awaria KSeF" section */
.awaria-section {
  padding: 56px 0;
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.awaria-section__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 28px;
}

.awaria-section__header {
  text-align: center;
  margin-bottom: 36px;
}

.awaria-section__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.awaria-section__sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
}

.awaria-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.awaria-faq__item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.awaria-faq__item:hover {
  border-color: rgba(242, 202, 80, 0.30);
  background: rgba(255, 255, 255, 0.04);
}

.awaria-faq__item[open] {
  border-color: rgba(242, 202, 80, 0.40);
  background: rgba(242, 202, 80, 0.04);
}

.awaria-faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
}

.awaria-faq__item summary::-webkit-details-marker { display: none; }

.awaria-faq__ico {
  font-size: 22px !important;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.awaria-faq__q {
  flex: 1;
  line-height: 1.4;
}

.awaria-faq__arrow {
  font-size: 22px !important;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.awaria-faq__item[open] .awaria-faq__arrow {
  transform: rotate(180deg);
}

.awaria-faq__a {
  padding: 0 22px 22px 56px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.awaria-faq__a p {
  margin: 0 0 12px;
}

.awaria-faq__a p:last-child {
  margin-bottom: 0;
}

.awaria-faq__a ul,
.awaria-faq__a ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.awaria-faq__a li {
  margin-bottom: 8px;
}

.awaria-faq__a strong {
  color: var(--text-primary);
  font-weight: 600;
}

.awaria-faq__a a {
  color: var(--accent-gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 202, 80, 0.30);
  transition: border-color 0.2s ease;
}

.awaria-faq__a a:hover {
  border-bottom-color: var(--accent-gold);
}

.awaria-section__cta {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.awaria-section__cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Light mode */
:root.light .awaria-section {
  background: rgba(0, 0, 0, 0.01);
  border-top-color: rgba(0, 0, 0, 0.06);
}

:root.light .awaria-faq__item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

:root.light .awaria-faq__item:hover {
  background: rgba(0, 0, 0, 0.04);
}

:root.light .awaria-faq__item[open] {
  background: rgba(184, 134, 11, 0.06);
  border-color: rgba(184, 134, 11, 0.30);
}

/* Mobile */
@media (max-width: 640px) {
  .trust-bar__inner {
    padding: 18px 16px;
  }
  .trust-bar__list {
    grid-template-columns: 1fr;
  }
  .awaria-section {
    padding: 40px 0;
  }
  .awaria-section__inner {
    padding: 0 16px;
  }
  .awaria-faq__item summary {
    padding: 14px 16px;
    font-size: 15px;
    gap: 10px;
  }
  .awaria-faq__a {
    padding: 0 16px 18px 44px;
    font-size: 14px;
  }
  .awaria-section__cta {
    flex-direction: column;
  }
  .awaria-section__cta .btn {
    width: 100%;
    justify-content: center;
  }
}
