/* ── EtG Calculator – Styles ─────────────────────────────────────────────── */

.etg-calc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 760px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 28px rgba(0,0,0,0.08);
  color: #1e293b;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.etg-calc__header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.etg-calc__icon {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.etg-calc__title {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  color: #0f172a;
}

.etg-calc__desc {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* ── Info / Disclaimer banners ───────────────────────────────────────────── */

.etg-calc__info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 0.86rem;
  color: #1e3a8a;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.etg-calc__disclaimer-banner {
  background: #fef9c3;
  border: 1.5px solid #fde68a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.83rem;
  color: #78350f;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ── Unit toggle ─────────────────────────────────────────────────────────── */

.etg-calc__toggle-wrap {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.etg-calc__toggle {
  padding: 0.42rem 1.1rem;
  border: 2px solid #334155;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.etg-calc__toggle--active {
  background: #334155;
  color: #fff;
}

/* ── Fieldsets ───────────────────────────────────────────────────────────── */

.etg-calc__fieldset {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 0 0 1.4rem;
}

.etg-calc__legend {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  padding: 0 0.3rem;
}

.etg-calc__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.9rem;
}

.etg-calc__row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 560px) {
  .etg-calc__row,
  .etg-calc__row--3 { grid-template-columns: 1fr; }
}

.etg-calc__field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.etg-calc__field label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #374151;
}

.etg-calc__field input[type="number"],
.etg-calc__field select {
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.97rem;
  color: #0f172a;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.etg-calc__field input:focus,
.etg-calc__field select:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
  background: #fff;
}

.etg-calc__hint {
  font-size: 0.73rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* ── Threshold radio cards ───────────────────────────────────────────────── */

.etg-calc__threshold-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.9rem;
}

@media (max-width: 560px) {
  .etg-calc__threshold-group { grid-template-columns: 1fr; }
}

.etg-calc__threshold-option {
  cursor: pointer;
}

.etg-calc__threshold-option input[type="radio"] {
  display: none;
}

.etg-calc__threshold-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.etg-calc__threshold-card strong {
  font-size: 1rem;
  color: #0f172a;
}

.etg-calc__threshold-card small {
  font-size: 0.73rem;
  color: #64748b;
  line-height: 1.4;
}

.etg-calc__threshold-option input[type="radio"]:checked + .etg-calc__threshold-card {
  border-color: #7c3aed;
  background: #f5f3ff;
}

.etg-calc__threshold-option input[type="radio"]:checked + .etg-calc__threshold-card strong {
  color: #7c3aed;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.etg-calc__btn-wrap {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.etg-calc__btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  background: #7c3aed;
  color: #fff;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.etg-calc__btn:hover  { background: #6d28d9; }
.etg-calc__btn:active { transform: scale(0.97); }

.etg-calc__btn--reset {
  background: #e2e8f0;
  color: #334155;
}
.etg-calc__btn--reset:hover { background: #cbd5e1; }

/* ── Results ─────────────────────────────────────────────────────────────── */

.etg-calc__results {
  margin-top: 2rem;
  border-top: 2px solid #f1f5f9;
  padding-top: 1.75rem;
}

.etg-calc__results-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 1.1rem;
}

/* Status card */
.etg-calc__status-wrap {
  margin-bottom: 1.25rem;
}

.etg-calc__status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  transition: background 0.3s, border-color 0.3s;
}

.etg-calc__status-card[data-status="clear"]   { background:#f0fdf4; border-color:#86efac; }
.etg-calc__status-card[data-status="low"]     { background:#fefce8; border-color:#fde047; }
.etg-calc__status-card[data-status="medium"]  { background:#fff7ed; border-color:#fdba74; }
.etg-calc__status-card[data-status="high"]    { background:#fef2f2; border-color:#fca5a5; }

.etg-calc__status-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.etg-calc__status-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.etg-calc__status-headline {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.etg-calc__status-sub {
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.4;
}

/* Timeline */
.etg-calc__timeline-wrap {
  margin-bottom: 1.5rem;
}

.etg-calc__timeline-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.4rem;
}

.etg-calc__timeline-bar {
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
}

.etg-calc__timeline-elapsed {
  background: #94a3b8;
  height: 100%;
  transition: width 0.6s ease;
  border-radius: 999px 0 0 999px;
}

.etg-calc__timeline-remaining {
  height: 100%;
  transition: width 0.6s ease;
  background: linear-gradient(90deg, #f97316, #dc2626);
}

.etg-calc__timeline-remaining[data-status="clear"]  { background: #22c55e; }
.etg-calc__timeline-remaining[data-status="low"]    { background: linear-gradient(90deg, #facc15, #f97316); }
.etg-calc__timeline-remaining[data-status="medium"] { background: linear-gradient(90deg, #f97316, #dc2626); }
.etg-calc__timeline-remaining[data-status="high"]   { background: #dc2626; }

.etg-calc__timeline-legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.etg-calc__tl-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 600;
}

.etg-calc__tl-legend-item::before {
  content: '';
  width: 14px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.etg-calc__tl-legend--elapsed::before   { background: #94a3b8; }
.etg-calc__tl-legend--remaining::before { background: linear-gradient(90deg, #f97316, #dc2626); }

/* Result cards grid */
.etg-calc__results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 520px) {
  .etg-calc__results-grid { grid-template-columns: 1fr; }
}

.etg-calc__result-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.etg-calc__result-card--highlight {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.etg-calc__result-card--safe {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.etg-calc__result-label {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
}

.etg-calc__result-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.etg-calc__result-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* Detection window table */
.etg-calc__window-table-wrap {
  margin-bottom: 1rem;
  overflow-x: auto;
}

.etg-calc__table-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.65rem;
}

.etg-calc__window-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.etg-calc__window-table th {
  background: #f1f5f9;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e2e8f0;
}

.etg-calc__window-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}

.etg-calc__window-table tr.etg-row--current {
  background: #fef9c3;
  font-weight: 700;
}

.etg-pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
}

.etg-pill--positive { background: #fee2e2; color: #dc2626; }
.etg-pill--negative { background: #dcfce7; color: #15803d; }
.etg-pill--borderline { background: #fef9c3; color: #a16207; }

/* ── Facts panel ─────────────────────────────────────────────────────────── */

.etg-calc__facts {
  margin-top: 1.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}

.etg-calc__facts-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #374151;
  margin: 0 0 0.9rem;
}

.etg-calc__facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

@media (max-width: 520px) {
  .etg-calc__facts-grid { grid-template-columns: 1fr; }
}

.etg-calc__fact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
}

.etg-calc__fact strong {
  font-size: 0.85rem;
  color: #0f172a;
}

/* ── Disclaimer / Error ──────────────────────────────────────────────────── */

.etg-calc__disclaimer {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-top: 1rem;
}

.etg-calc__error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 0.9rem;
  font-weight: 600;
}
