/* ===== Modal: Toxicity Calculator (RawRu) ===== */
.tox-modal { position: fixed; inset: 0; display: none; z-index: 2000; }
.tox-modal.open { display: block; }
.tox-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: saturate(120%) blur(2px); }
.tox-modal__dialog { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(860px, 96vw); max-height: 90vh; background: var(--white, #fff); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.tox-modal__content { overflow: auto; max-height: 90vh; padding: 24px; border-radius: 14px; }
.tox-modal__close { position: absolute; right: 10px; top: 6px; border: none; background: rgba(255,255,255,0.85); color: #444; font-size: 28px; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display:flex; align-items:center; justify-content:center; box-shadow: 0 2px 6px rgba(0,0,0,.15); z-index: 1; }
.tox-modal__close:hover { background: #fff; }
.tox-subtitle { text-align: center; margin: -6px auto 14px; color: #555; }
.tox-grid { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 14px 18px; }
.tox-field { display: flex; flex-direction: column; background: #f9fbf8; border: 1px solid #e5efe4; border-radius: 10px; padding: 10px 12px; }
.tox-field label { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: .95rem; color: var(--dark, #1B5E20); margin-bottom: 6px; }
.tox-field select { border: 1px solid #d9e7d7; background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 1rem; }
.tox-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.tox-submit { background: linear-gradient(135deg, var(--primary, #4CAF50), var(--primary-dark, #388E3C)); color: #fff; border: none; border-radius: 10px; padding: 12px 18px; cursor: pointer; font-weight: 600; box-shadow: 0 6px 18px rgba(76,175,80,0.25); }
.tox-submit:hover { filter: brightness(1.02); transform: translateY(-1px); }
.tox-score { display: none; margin-top: 16px; background: #f6fff6; border: 1px solid #ddefdd; border-radius: 12px; padding: 14px; }
.tox-score.visible { display: block; }
.tox-score .value { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--dark, #1B5E20); }
.tox-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: .9rem; background: #e8f5e9; color: var(--primary-dark, #388E3C); }
.tox-badge.moderate { background: #fff7e6; color: #c48a00; }
.tox-badge.high { background: #ffebee; color: #c62828; }
.tox-reco { margin-top: 8px; }
.tox-reco ul { padding-left: 18px; }
/* Alert strip */
.tox-alert { margin-top:8px; padding:10px 12px; border-radius:10px; font-weight:700; }
.tox-alert.low { background:#e8f5e9; color:#1B5E20; border:1px solid #cfe8d0; }
.tox-alert.moderate { background:#fff7e6; color:#8a5800; border:1px solid #ffe0b2; }
.tox-alert.high { background:#ffebee; color:#b71c1c; border:1px solid #ffcdd2; }
/* Presets */
.tox-presets { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin: 6px 0 12px; }
.tox-chip { border:1px solid #d9e7d7; background:#fff; color:#2e7d32; border-radius:999px; padding:6px 10px; cursor:pointer; font-weight:600; font-size:.9rem; }
.tox-chip:hover { background:#f2fbf2; }
.tox-chip:focus { outline:2px solid #2e7d32; outline-offset:2px; }
/* Risk meter */
.tox-meter { margin: 8px 0 12px; }
.tox-meter__track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #e8f5e9 0%, #fff7e6 50%, #ffebee 100%); position: relative; overflow: hidden; }
.tox-meter__bar { position:absolute; left:0; top:0; bottom:0; width:0; background: linear-gradient(90deg, #66bb6a, #ffa000, #e53935); transition: width .35s ease; }
.tox-meter__mark { position:absolute; top:50%; transform: translate(-50%, -50%); width: 2px; height: 16px; background:#1B5E20; }
.tox-meter__mark::after { content:''; position:absolute; top:50%; left:50%; transform: translate(-50%,-50%); width:8px; height:8px; border-radius:50%; background:#1B5E20; }
.tox-meter__legend { display:flex; justify-content:space-between; font-size:.8rem; color:#666; margin-top: 4px; }
/* Facts */
.tox-facts summary { cursor:pointer; font-weight:600; color:#1B5E20; }
.tox-facts ul { padding-left:18px; margin-top:6px; }
.tox-note { margin-top:8px; font-size:.85rem; color:#666; }
@media (max-width: 640px){
  .tox-grid { grid-template-columns: 1fr; }
  .tox-modal__dialog { width: 96vw; }
  .tox-modal__content { padding: 16px; }
}

