/* Warstwa kalkulatorów osadzona we wspólnym layoucie terroryzm.edu.pl. */

:root {
  --ink: #1f2937;
  --muted: #56606b;
  --line: #e5e7eb;
  --bg-soft: #f8fafc;
  --accent: #1d4ed8;
}

* { box-sizing: border-box; }

.calc-main {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  color: var(--ink);
  line-height: 1.55;
}

.page-title { font-size: 1.6rem; margin: 0 0 4px; }
.calc-header { margin-bottom: 12px; }
.calc-breadcrumb { font-size: 0.85rem; color: var(--muted); }
.calc-breadcrumb a { color: var(--accent); text-decoration: none; }

.calc-main h2 { font-size: 1.2rem; margin: 28px 0 12px; }
.calc-main h3 { font-size: 1rem; margin: 20px 0 8px; }

.calc-main a { color: var(--accent); }

.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.92rem; }
.alert-info  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a5f; }
.alert-warn  { background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; }
.alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
.alert-ok    { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }

.calc-main form { max-width: 720px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.help-text { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }

.calc-main input[type="number"],
.calc-main input[type="text"],
.calc-main select,
.calc-main textarea {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}
.calc-main textarea { width: 100%; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.85rem; }

.calc-main button, .calc-main .btn {
  font: inherit;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary { background: #fff; color: var(--ink); border-color: #cbd5e1; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.results-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.results-table th, .results-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.results-table th { background: var(--bg-soft); font-weight: 600; }
.results-table td:nth-child(2) { font-variant-numeric: tabular-nums; }

.panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.chart-wrap { overflow-x: auto; margin: 8px 0 20px; }
.chart-wrap svg { max-width: 100%; height: auto; display: block; }

.legend { font-size: 0.8rem; color: var(--muted); margin: -4px 0 20px; }

.plume-map-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 8px 0 10px;
}
.plume-map-controls label { font-size: 0.84rem; font-weight: 600; }
.plume-map-controls input { width: 76px; margin-left: 6px; }
.plume-map-controls .btn { padding: 6px 12px; font-size: 0.84rem; }
.plume-map {
  width: 100%;
  height: 440px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  overflow: hidden;
}
.plume-map-help { margin: 6px 0 20px; color: var(--muted); font-size: 0.8rem; }
.plume-map .leaflet-control-attribution { font-size: 10px; }
@media (max-width: 720px) {
  .plume-map { height: 360px; }
}

.sources { background: #f1f5f9; border-radius: 6px; font-size: 0.8rem; color: #374151; padding: 12px 16px; margin-top: 8px; }

/* Indeks kalkulatorów — kolorowe kafle po trzy w rzędzie. */
.calc-index-intro { margin-bottom: 38px; }
.calc-index-intro .page-title { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -0.045em; }
.calc-index-intro .alert { margin-top: 40px; }
.calc-group { margin: 0 0 44px; }
.calc-group:last-child { margin-bottom: 0; }
.calc-group-title {
  margin: 0 0 16px;
  padding-bottom: 9px;
  border-bottom: 1px solid #dfe5ea;
  color: #56606b;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.calc-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.calc-main a.calc-card {
  display: flex;
  min-width: 0;
  min-height: 190px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--card-border, #3b82f6);
  border-radius: 13px;
  background: var(--card-bg, #eff6ff);
  color: #172033;
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(30, 41, 59, 0.05);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.calc-main a.calc-card:hover,
.calc-main a.calc-card:focus {
  color: #111827;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(30, 41, 59, 0.11);
}
.calc-card__title { font-size: 1.08rem; font-weight: 700; line-height: 1.25; }
.calc-card__description { margin: 11px 0 18px; color: #425066; font-size: 0.86rem; line-height: 1.55; }
.calc-card__tag {
  align-self: flex-start;
  margin-top: auto;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--card-border, #3b82f6) 45%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #475569;
  font-size: 0.7rem;
  line-height: 1.35;
}

@media (max-width: 820px) {
  .calc-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .calc-card-grid { grid-template-columns: 1fr; }
  .calc-main a.calc-card { min-height: 0; }
}
