/* EcaVault PWA — mobile-first */
:root {
  --bleu: #1a3a5c;
  --bleu-2: #224872;
  --bleu-light: #e7eef5;
  --orange: #e8740a;
  --orange-light: #fde6d0;
  --rouge: #c0392b;
  --vert: #27ae60;
  --gris: #f4f6f8;
  --gris-2: #d8dee5;
  --texte: #1f2937;
  --muted: #6b7280;
  --blanc: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(26,58,92,0.08);
  --nav-h: 64px;
  --top-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--gris); overscroll-behavior: contain; }
button, input, select, textarea { font-family: inherit; font-size: 16px; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

/* Topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h);
  background: var(--bleu); color: var(--blanc);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; z-index: 50;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--top-h) + env(safe-area-inset-top));
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; }
.iconbtn {
  min-width: 44px; min-height: 44px;
  color: var(--blanc); font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.iconbtn:active { background: rgba(255,255,255,0.15); }

/* View */
.view {
  padding: 16px;
  padding-top: calc(var(--top-h) + env(safe-area-inset-top) + 16px);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  min-height: 100vh;
}
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .25s; }
@keyframes fadeIn { from {opacity:0; transform: translateY(4px);} to {opacity:1; transform: translateY(0);} }

/* Login */
.login-wrap { padding-top: 32px; }
.logo { text-align: center; margin-bottom: 32px; }
.logo-badge {
  width: 80px; height: 80px; margin: 0 auto 16px;
  background: var(--bleu); color: var(--blanc);
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; box-shadow: var(--shadow);
}
.logo h1 { font-size: 28px; color: var(--bleu); margin: 0; }
.subtitle { color: var(--muted); margin-top: 4px; font-size: 14px; }

.card {
  background: var(--blanc); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; font-weight: 600; }
.card input, .card select, .card textarea {
  width: 100%; padding: 14px; border: 1px solid var(--gris-2); border-radius: 8px; background: var(--blanc);
  min-height: 48px;
}
.card input:focus, .card select:focus, .card textarea:focus { outline: 2px solid var(--bleu); border-color: var(--bleu); }

.btn-primary {
  width: 100%; min-height: 52px; margin-top: 16px;
  background: var(--bleu); color: var(--blanc); border-radius: 10px;
  font-size: 16px; font-weight: 600;
}
.btn-primary:active { background: var(--bleu-2); transform: scale(.99); }
.btn-secondary {
  width: 100%; min-height: 48px; margin-top: 10px;
  background: var(--bleu-light); color: var(--bleu); border-radius: 10px;
  font-weight: 600;
}
.btn-secondary.small { width: auto; padding: 0 16px; min-height: 36px; font-size: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }

/* Greet / dashboard */
.greet h2 { margin: 0; color: var(--bleu); font-size: 22px; }
.role-badge { display: inline-block; background: var(--bleu-light); color: var(--bleu); padding: 4px 10px; border-radius: 16px; font-size: 12px; font-weight: 600; margin-top: 4px; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.kpi {
  background: var(--blanc); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow);
}
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 22px; font-weight: 700; color: var(--bleu); margin-top: 4px; }
.kpi.alert .value { color: var(--orange); }
.kpi.danger .value { color: var(--rouge); }

h3 { color: var(--bleu); font-size: 16px; margin: 24px 0 12px; }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qa-btn {
  background: var(--blanc); border-radius: var(--radius); padding: 18px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow); font-weight: 600; color: var(--bleu);
  min-height: 88px;
}
.qa-btn:active { transform: scale(.97); }
.qa-icon { font-size: 28px; }

/* Card list */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.list-card {
  background: var(--blanc); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px;
}
.list-card .icon { font-size: 24px; min-width: 40px; text-align: center; }
.list-card .body { flex: 1; min-width: 0; }
.list-card .title { font-weight: 600; color: var(--bleu); margin: 0 0 2px; }
.list-card .meta { font-size: 12px; color: var(--muted); margin: 0; }
.list-card .badge { padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge.faible { background: #d4edda; color: var(--vert); }
.badge.moyen { background: var(--bleu-light); color: var(--bleu); }
.badge.eleve { background: var(--orange-light); color: var(--orange); }
.badge.critique { background: #f8d7da; color: var(--rouge); }

/* Searchbar */
.searchbar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
  background: var(--blanc); padding: 6px; border-radius: 12px; box-shadow: var(--shadow);
}
.searchbar input {
  flex: 1; padding: 12px; border: none; outline: none; background: transparent; font-size: 16px;
  min-height: 44px;
}
.searchbar .iconbtn { color: var(--bleu); background: var(--bleu-light); border-radius: 10px; }

/* Bâtiment detail */
.bat-header {
  background: linear-gradient(135deg, var(--bleu) 0%, var(--bleu-2) 100%);
  color: var(--blanc); padding: 20px; border-radius: var(--radius); margin-bottom: 16px;
}
.bat-header h2 { margin: 0 0 8px; font-size: 20px; }
.bat-header .npa { opacity: .8; font-size: 14px; }
.bat-qr { background: var(--blanc); padding: 16px; border-radius: var(--radius); text-align: center; margin-bottom: 16px; box-shadow: var(--shadow); }
.bat-qr canvas { max-width: 200px; height: auto; }
.bat-qr .qr-id { font-family: monospace; font-size: 12px; color: var(--muted); margin-top: 8px; }
.bat-info { background: var(--blanc); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.bat-info .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gris); }
.bat-info .row:last-child { border-bottom: none; }
.bat-info .key { color: var(--muted); font-size: 13px; }
.bat-info .val { font-weight: 600; text-align: right; }
.score-bar { height: 8px; background: var(--gris-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.score-bar .fill { height: 100%; background: linear-gradient(90deg, var(--vert), var(--orange), var(--rouge)); }

/* Rapport form */
.rapport-form { padding-bottom: 32px; }
.rapport-form h2 { color: var(--bleu); margin: 8px 0; }
.rapport-bat { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.rapport-block {
  background: var(--blanc); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.rapport-block h3 { margin-top: 0; }
.rapport-block select, .rapport-block textarea, .rapport-block input {
  width: 100%; padding: 12px; border: 1px solid var(--gris-2); border-radius: 8px; min-height: 44px;
  font-size: 16px;
}

.check-item {
  display: flex; flex-direction: column; padding: 10px; border-bottom: 1px solid var(--gris);
}
.check-item:last-child { border-bottom: none; }
.check-item .label { font-weight: 600; margin-bottom: 6px; }
.check-item .opts { display: flex; gap: 6px; flex-wrap: wrap; }
.check-item .opt {
  padding: 8px 14px; min-height: 40px; border-radius: 18px;
  background: var(--gris); color: var(--texte); font-size: 13px; font-weight: 600;
  border: 2px solid transparent;
}
.check-item .opt.active.bon { background: #d4edda; color: var(--vert); border-color: var(--vert); }
.check-item .opt.active.moyen { background: var(--bleu-light); color: var(--bleu); border-color: var(--bleu); }
.check-item .opt.active.mauvais { background: var(--orange-light); color: var(--orange); border-color: var(--orange); }
.check-item .opt.active.critique { background: #f8d7da; color: var(--rouge); border-color: var(--rouge); }

/* Photos */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.photo-grid img { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; }

/* Voice */
.voice-controls { display: flex; gap: 8px; margin-bottom: 10px; }
.btn-voice {
  flex: 1; min-height: 48px; background: var(--orange); color: var(--blanc);
  border-radius: 10px; font-weight: 600;
}
.btn-voice.recording { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* Signature */
#signaturePad { border: 2px dashed var(--gris-2); border-radius: 8px; width: 100%; touch-action: none; background: var(--blanc); }

.rapport-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

/* Scan QR */
.scan-wrap { text-align: center; }
#qrVideo { width: 100%; max-height: 60vh; border-radius: var(--radius); background: #000; }
.scan-frame { display: none; }
.scan-hint { color: var(--muted); margin: 16px 0; }

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--gris-2); }
.tl-item {
  position: relative; background: var(--blanc); border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.tl-item::before {
  content: ''; position: absolute; left: -23px; top: 18px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--bleu); border: 2px solid var(--blanc);
}
.tl-item .date { font-size: 12px; color: var(--muted); }
.tl-item .title { font-weight: 600; color: var(--bleu); margin: 2px 0; }

/* Bottom nav */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--blanc);
  display: flex; align-items: center; justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  z-index: 40;
}
.navbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 56px; min-height: 56px; color: var(--muted); font-size: 22px;
}
.navbtn small { font-size: 11px; }
.navbtn.active { color: var(--bleu); }
.navbtn.fab {
  background: var(--bleu); color: var(--blanc); border-radius: 50%;
  width: 56px; height: 56px; transform: translateY(-12px);
  box-shadow: var(--shadow);
}

/* Toast */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 24px); left: 50%;
  transform: translateX(-50%); background: var(--bleu); color: var(--blanc);
  padding: 12px 20px; border-radius: 24px; box-shadow: var(--shadow);
  font-size: 14px; z-index: 100; max-width: 90%;
}
.toast.error { background: var(--rouge); }
.toast.success { background: var(--vert); }

/* Heatmap */
#heatmap { width: 100%; height: auto; max-height: 200px; }

/* Disable hover effects on touch */
@media (hover: none) {
  .qa-btn:hover, .list-card:hover, .btn-primary:hover { background: inherit; }
}

/* ============ AI panel (Vision photo) ============ */
.ai-panel {
  margin-top: 12px; padding: 12px; background: #f4f7fb;
  border-radius: 12px; border-left: 4px solid var(--bleu);
  font-size: 14px;
}
.ai-panel.loading { text-align: center; color: var(--bleu); }
.ai-panel h4 { margin: 0 0 8px 0; font-size: 14px; color: var(--bleu); }
.ai-panel ul { margin: 6px 0; padding-left: 18px; }
.ai-panel li { margin-bottom: 4px; }
.anomaly {
  display: flex; align-items: center; gap: 8px; margin: 6px 0;
  padding: 8px; background: #fff; border-radius: 8px;
  border-left: 3px solid #888;
}
.anomaly.faible { border-left-color: var(--vert); }
.anomaly.moyen  { border-left-color: #f39c12; }
.anomaly.grave  { border-left-color: var(--rouge); }
.severite-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  color: #fff; font-size: 11px; font-weight: 600; text-transform: uppercase;
  min-width: 44px; text-align: center;
}
.severite-badge.faible { background: var(--vert); }
.severite-badge.moyen  { background: #f39c12; }
.severite-badge.grave  { background: var(--rouge); }
.simu-warn {
  font-size: 11px; color: #c77; font-style: italic; margin-top: 6px;
}

/* ============ Risk gauge ============ */
.risk-gauge {
  margin: 10px 0; padding: 14px; background: #fff; border-radius: 12px;
  box-shadow: var(--shadow);
}
.risk-gauge .gauge-bar {
  position: relative; height: 14px; background: linear-gradient(90deg,
    #2ecc71 0%, #f1c40f 40%, #e67e22 70%, #e74c3c 100%);
  border-radius: 7px; overflow: visible;
}
.risk-gauge .gauge-needle {
  position: absolute; top: -4px; bottom: -4px; width: 4px;
  background: #1a3a5c; border-radius: 2px;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.3);
  transition: left .6s ease-out;
}
.risk-gauge .gauge-labels {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 11px; color: #888;
}
.risk-gauge .gauge-score {
  font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 6px;
}
.risk-gauge .gauge-score.faible   { color: var(--vert); }
.risk-gauge .gauge-score.moyen    { color: #f39c12; }
.risk-gauge .gauge-score.eleve    { color: #e67e22; }
.risk-gauge .gauge-score.critique { color: var(--rouge); }
.risk-gauge .gauge-factors { margin-top: 10px; font-size: 13px; }
.risk-gauge .gauge-factors .factor {
  padding: 4px 0; border-bottom: 1px solid #eee;
}
.risk-gauge .gauge-factors .factor:last-child { border-bottom: 0; }

/* ============ Modal bâtiment ============ */
.modal-overlay { position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:200;display:flex;align-items:flex-end;justify-content:center; }
.modal-overlay.hidden { display:none; }
.modal-box { background:#fff;border-radius:16px 16px 0 0;width:100%;max-width:520px;max-height:90vh;overflow-y:auto;padding:20px; }
.modal-header { display:flex;justify-content:space-between;align-items:center;margin-bottom:16px; }
.modal-header h3 { margin:0;font-size:1.1rem;color:var(--primary); }
.modal-form { display:flex;flex-direction:column;gap:12px; }
.modal-form label { display:flex;flex-direction:column;font-size:.85rem;font-weight:600;color:#555;gap:4px; }
.modal-form input, .modal-form select { padding:12px;border:1px solid #ddd;border-radius:8px;font-size:1rem;min-height:44px; }
.modal-form .row2 { display:grid;grid-template-columns:1fr 1fr;gap:10px; }

/* ============ Chatbot ============ */
.chat-fab {
  position: fixed; bottom: calc(var(--nav-h) + 16px); right: 16px;
  width: 56px; height: 56px; min-width: 44px; min-height: 44px;
  border-radius: 28px; border: 0;
  background: var(--bleu); color: #fff; font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 90; cursor: pointer;
}
.chat-fab:active { transform: scale(.95); }
.chat-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200;
}
.chat-drawer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-radius: 16px 16px 0 0;
  z-index: 201; max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 -4px 16px rgba(0,0,0,.2);
  animation: slideUp .25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #eee;
}
.chat-header h3 { margin: 0; font-size: 16px; color: var(--bleu); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 200px;
}
.chat-msg {
  padding: 10px 14px; border-radius: 14px; max-width: 85%;
  font-size: 14px; line-height: 1.4; word-wrap: break-word;
}
.chat-msg.bot  { background: #f0f4f8; color: #222; align-self: flex-start; }
.chat-msg.user { background: var(--bleu); color: #fff; align-self: flex-end; }
.chat-msg.loading { font-style: italic; opacity: .7; }
.chat-suggestions {
  padding: 8px 16px; display: flex; gap: 6px; flex-wrap: wrap;
  border-top: 1px solid #f0f0f0;
}
.chip {
  background: #eef3f8; color: var(--bleu); border: 0;
  padding: 8px 12px; border-radius: 16px; font-size: 12px;
  min-height: 44px; cursor: pointer;
}
.chip:active { background: #d8e3ee; }
.chat-input {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid #eee;
}
.chat-input input {
  flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 24px;
  font-size: 14px; min-height: 44px;
}
.chat-input button { min-width: 56px; min-height: 44px; border-radius: 22px; }

/* ============== OFFLINE BANNER ============== */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--orange);
  color: #fff;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  transition: height 0.25s ease, padding 0.25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.offline-banner.visible {
  height: calc(40px + env(safe-area-inset-top));
}
.offline-banner.syncing {
  background: var(--bleu);
}
.offline-banner.success {
  background: var(--vert);
}
.offline-banner .ob-icon { font-size: 16px; }
.offline-banner .ob-btn {
  background: rgba(255,255,255,0.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  min-height: 28px;
  font-weight: 600;
}
.offline-banner .ob-btn:active { background: rgba(255,255,255,0.4); }

body.offline .topbar,
body.offline .view {
  padding-top: calc(var(--top-h) + env(safe-area-inset-top) + 40px) !important;
}
body.offline .topbar {
  top: calc(40px + env(safe-area-inset-top));
}

/* Sync indicator animated */
.sync-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== PDF & EMAIL BUTTONS ============== */
.pdf-btn, .email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin: 4px;
  border: 1px solid var(--bleu);
}
.pdf-btn {
  background: var(--bleu);
  color: #fff;
}
.pdf-btn:active { background: var(--bleu-2); }
.pdf-btn:disabled { opacity: 0.5; }
.email-btn {
  background: #fff;
  color: var(--bleu);
}
.email-btn:active { background: var(--bleu-light); }

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

/* Indicateur rapport pending dans timeline */
.tl-item.pending {
  border-left: 4px solid var(--orange);
  background: var(--orange-light);
}
.pending-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 700;
}

/* Sync result toast amelioration */
.toast.sync { background: var(--bleu); color: #fff; }

/* ============ Admin Panel ============ */
.admin-top { margin-bottom: 8px; }
.admin-top .btn-primary { margin-top: 0; }
.admin-subtitle { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.loading-hint { text-align: center; color: var(--muted); padding: 24px; font-style: italic; }
.form-error { color: var(--rouge); font-size: 13px; padding: 8px 12px; background: #fde8e8; border-radius: 8px; }

.user-card {
  background: var(--blanc); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px;
  transition: opacity .2s;
}
.user-card.inactive { opacity: 0.5; }

.user-avatar {
  width: 46px; height: 46px; min-width: 46px;
  background: var(--bleu); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; color: var(--bleu); margin: 0 0 2px; font-size: 15px; }
.user-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-inactive {
  display: inline-block; background: var(--rouge); color: #fff;
  font-size: 10px; padding: 2px 8px; border-radius: 8px;
  margin-top: 3px; font-weight: 700; letter-spacing: .3px;
}
.user-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.role-select {
  padding: 8px 10px; border: 1px solid var(--gris-2); border-radius: 8px;
  font-size: 13px; min-height: 40px; background: var(--blanc);
  color: var(--texte); min-width: 108px;
}
.role-select:focus { outline: 2px solid var(--bleu); }

.btn-deactivate, .btn-reactivate {
  min-width: 44px; min-height: 38px; border: 1px solid var(--gris-2);
  border-radius: 8px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  background: none;
}
.btn-deactivate:active { background: #fde; }
.btn-reactivate:active { background: #dfd; }

/* ============ Actions correctives ============ */
.action-card { align-items: flex-start; }
.btn-resolve {
  padding: 4px 10px; border: 1px solid var(--vert, #2a7a4b); border-radius: 8px;
  color: var(--vert, #2a7a4b); background: none; font-size: 12px; white-space: nowrap;
}
.btn-resolve:active { background: #dfd; }

/* ============ Exports ============ */
.export-row {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.btn-secondary.small {
  padding: 8px 14px; font-size: 13px; min-height: 38px;
}

/* ============ Lang toggle ============ */
.lang-toggle {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  cursor: pointer;
  min-width: 34px;
  transition: background 0.15s;
}
.lang-toggle:active { background: rgba(255,255,255,0.3); }

