/* iMessage iOS 26 — Design System Authentique Apple */

:root {
  --ios-blue: #007AFF;
  --ios-green: #34C759;
  --ios-gray: #8E8E93;
  --ios-gray2: #AEAEB2;
  --ios-gray3: #C7C7CC;
  --ios-gray4: #D1D1D6;
  --ios-gray5: #E5E5EA;
  --ios-gray6: #F2F2F7;
  --ios-separator: rgba(60, 60, 67, 0.12);
  --ios-separator-opaque: #C6C6C8;
  --ios-label: #000000;
  --ios-label-secondary: rgba(60, 60, 67, 0.60);
  --ios-label-tertiary: rgba(60, 60, 67, 0.30);
  --ios-bg: #F2F2F7;
  --ios-bg2: #FFFFFF;
  --sidebar-width: 310px; /* Légèrement plus petit pour économiser de la place */
  --font-stack: -apple-system, "SF Pro Text", "SF Pro Display", BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --bubble-out: #007AFF;
  --bubble-out-bot: #34C759;
  --bubble-in: #E9E9EB;
  --bubble-in-text: #000000;
  --bubble-out-text: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-blur: blur(20px) saturate(180%);
  /* Inset clavier iPad/iOS — mis à jour via visualViewport dans app.js */
  --keyboard-inset: 0px;
  /* Insets zone sûre — définis par JS (env() unreliable en PWA) */
  --inset-top: 0px;
  --inset-bottom: 0px;
  --inset-left: 0px;
  --inset-right: 0px;
  --safe-top: var(--inset-top);
  --safe-bottom: var(--inset-bottom);
  --safe-left: var(--inset-left);
  --safe-right: var(--inset-right);
}

/* Variables Mode Sombre */
html.dark-theme,
body.dark-theme {
  --ios-bg: #1C1C1E;
  --ios-bg2: #1C1C1E;
  --ios-gray: #8E8E93;
  --ios-gray2: #8E8E93;
  --ios-gray3: #3A3A3C;
  --ios-gray4: #48484A;
  --ios-gray5: #2C2C2E;
  --ios-gray6: #2C2C2E;
  --ios-separator: rgba(84, 84, 88, 0.3);
  --ios-separator-opaque: #38383A;
  --ios-label: #FFFFFF;
  --ios-label-secondary: rgba(235, 235, 245, 0.60);
  --ios-label-tertiary: rgba(235, 235, 245, 0.30);
  --bubble-in: #262629;
  --bubble-in-text: #FFFFFF;
  --glass-bg: rgba(28, 28, 30, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Shell plein écran (stretch via inset, sans height forcée). */
html, body {
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  font-family: var(--font-stack);
  background-color: var(--ios-bg2);
  color: var(--ios-label);
  font-size: 16px;
  line-height: 1.3;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */
.app-container {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--ios-bg2);
  overflow: hidden;
}

/* ==========================================
   BOUTONS STYLE LIQUID GLASS
   ========================================== */
.liquid-glass-btn {
  position: relative;
  border-radius: 50%;
  border: 1px solid rgba(0, 122, 255, 0.15);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 122, 255, 0.03) 100%);
  color: var(--ios-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.liquid-glass-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.liquid-glass-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.16) 0%, rgba(0, 122, 255, 0.06) 100%);
  border-color: rgba(0, 122, 255, 0.25);
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.liquid-glass-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(0, 122, 255, 0.1);
}

body.dark-theme .liquid-glass-btn {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0px rgba(255, 255, 255, 0.1);
}

body.dark-theme .liquid-glass-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   SIDEBAR — LISTE DES DISCUSSIONS
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ios-bg2);
  border-right: 1px solid var(--ios-separator-opaque);
  flex-shrink: 0;
  transition: background 0.3s ease;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) 8px calc(16px + var(--safe-left));
  background: var(--ios-bg2);
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.sidebar-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
}

.sidebar-header-actions {
  display: flex;
  gap: 8px;
}

/* Zone visuelle sous Dynamic Island — fond seulement, pas de toucher */
.ios-notch-fill {
  display: none;
  flex-shrink: 0;
  width: 100%;
  pointer-events: none;
}

.sidebar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 28px; /* Plus petit et sobre */
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ios-label);
  line-height: 1.05;
}

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-stack);
  font-size: 15px;
  color: var(--ios-blue);
  padding: 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.nav-btn:active {
  opacity: 0.5;
}

.nav-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--ios-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  position: relative;
}

.nav-icon-btn:hover {
  background: rgba(0, 122, 255, 0.08);
}

.nav-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff3b30;
  color: #fff !important;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  box-shadow: 0 0 0 1.5px var(--ios-bg2, #fff);
  z-index: 2;
}

body.dark-theme .nav-notif-badge {
  box-shadow: 0 0 0 1.5px var(--ios-bg2, #1c1c1e);
}

.juri-inbox-trigger {
  margin-left: 2px;
}

.juri-inbox-sheet {
  max-width: 520px;
}

/* ——— Stats dashboard (quasi plein écran) ——— */
#stats-modal.stats-overlay,
.stats-overlay {
  padding: 5vh 5vw !important;
  align-items: center !important;
  justify-content: center !important;
}

#stats-modal .stats-sheet.ios-modal-sheet,
.stats-sheet.ios-modal-sheet {
  width: 90vw !important;
  max-width: 1400px !important;
  height: 90vh !important;
  max-height: 90vh !important;
  border-radius: 16px !important;
  background: #f2f2f7;
  border: none;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  overflow: hidden;
}

body.dark-theme #stats-modal .stats-sheet.ios-modal-sheet,
body.dark-theme .stats-sheet.ios-modal-sheet {
  background: #0b0b0d;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#stats-modal .stats-header {
  flex-shrink: 0;
  background: transparent;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  padding: 12px 20px;
}

body.dark-theme #stats-modal .stats-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

#stats-modal .stats-toolbar {
  flex-shrink: 0;
  padding: 12px 20px 0;
  background: transparent;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
}

body.dark-theme #stats-modal .stats-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.stats-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-chip {
  border: 1px solid transparent;
  background: rgba(120, 120, 128, 0.14);
  color: inherit;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.stats-chip.is-active {
  background: #007aff;
  color: #fff;
  border-color: #007aff;
}

.stats-date-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  .stats-date-row {
    grid-template-columns: 1fr 1fr;
  }
  .stats-sim-field {
    grid-column: 1 / -1;
  }
}

.stats-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8e8e93;
}

.stats-date-field input,
.stats-date-field select {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
  background: rgba(120, 120, 128, 0.12);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 11px;
  width: 100%;
  box-sizing: border-box;
}

body.dark-theme .stats-date-field input,
body.dark-theme .stats-date-field select {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
}

.stats-meta {
  margin: 10px 0 0;
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.35;
}

.stats-tabs {
  display: flex;
  gap: 0;
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.stats-tabs::-webkit-scrollbar {
  display: none;
}

.stats-tab {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: #8e8e93;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px 11px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.stats-tab.is-active {
  color: #007aff;
  border-bottom-color: #007aff;
}

#stats-modal .stats-body.ios-modal-body {
  flex: 1;
  min-height: 0;
  padding: 20px;
  background: transparent !important;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-content {
  display: block;
}

.stats-loading,
.stats-error {
  padding: 48px 16px;
  text-align: center;
  color: #8e8e93;
  font-size: 15px;
}

.stats-error {
  color: #ff453a;
}

.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.stats-panel[hidden] {
  display: none !important;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 800px) {
  .stats-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stats-kpi {
  background: #fff;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 14px;
  padding: 14px 16px;
  min-width: 0;
  overflow: hidden;
}

body.dark-theme .stats-kpi {
  background: #161618;
  border-color: rgba(255, 255, 255, 0.08);
}

/* KPI imbriqués dans une carte : pas de double cadre */
.stats-card > .stats-kpi-grid {
  gap: 0;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

body.dark-theme .stats-card > .stats-kpi-grid {
  border-color: rgba(255, 255, 255, 0.08);
}

.stats-card > .stats-kpi-grid .stats-kpi {
  background: transparent;
  border: none;
  border-radius: 0;
  border-right: 1px solid rgba(60, 60, 67, 0.1);
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  padding: 14px 16px;
}

body.dark-theme .stats-card > .stats-kpi-grid .stats-kpi {
  border-right-color: rgba(255, 255, 255, 0.06);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

@media (min-width: 800px) {
  .stats-card > .stats-kpi-grid .stats-kpi:nth-child(4n) {
    border-right: none;
  }
  .stats-card > .stats-kpi-grid .stats-kpi:nth-last-child(-n + 4) {
    border-bottom: none;
  }
}

@media (max-width: 799px) {
  .stats-card > .stats-kpi-grid .stats-kpi:nth-child(2n) {
    border-right: none;
  }
  .stats-card > .stats-kpi-grid .stats-kpi:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}

.stats-kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #8e8e93;
  margin-bottom: 8px;
  line-height: 1.25;
}

.stats-kpi-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #1c1c1e;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

body.dark-theme .stats-kpi-value {
  color: #f5f5f7;
}

@media (max-width: 520px) {
  .stats-kpi-value {
    font-size: 22px;
  }
}

.stats-kpi-sub {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: #8e8e93;
}

.stats-card {
  background: #fff;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 14px;
  padding: 16px 18px 18px;
  min-width: 0;
  overflow: hidden;
}

body.dark-theme .stats-card {
  background: #161618;
  border-color: rgba(255, 255, 255, 0.08);
}

.stats-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.stats-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #1c1c1e;
}

body.dark-theme .stats-section-title {
  color: #f5f5f7;
}

.stats-card-hint {
  font-size: 12px;
  color: #8e8e93;
}

.stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 960px) {
  .stats-grid-2 {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* Chart : hauteur auto, pas de débordement */
.stats-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(44px, 1fr);
  align-items: end;
  justify-items: center;
  gap: 8px;
  height: auto;
  min-height: 0;
  padding: 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.stats-chart.is-single {
  grid-auto-columns: minmax(52px, 1fr);
}

.stats-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: auto;
  width: 100%;
  min-width: 0;
}

.stats-bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 160px;
}

.stats-bar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  flex: 0 0 auto;
  width: 28px;
}

.stats-bar-col.is-single .stats-bar-stack {
  width: 32px;
}

.stats-bar-value {
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #1c1c1e;
  white-space: nowrap;
}

body.dark-theme .stats-bar-value {
  color: #f5f5f7;
}

.stats-bar-value.is-zero {
  opacity: 0.35;
  font-weight: 500;
}

.stats-bar-seg {
  width: 100%;
  max-width: 22px;
  min-width: 8px;
  border-radius: 5px 5px 2px 2px;
  min-height: 2px;
}

.stats-bar-seg.out {
  background: #007aff;
}

.stats-bar-seg.in {
  background: #30d158;
}

.stats-bar-seg.is-zero {
  opacity: 0.2;
  min-height: 2px;
}

.stats-bar-label {
  font-size: 11px;
  font-weight: 500;
  color: #8e8e93;
  white-space: nowrap;
  line-height: 1;
}

.stats-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: #8e8e93;
}

.stats-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: 0;
}

.stats-legend .lg-out {
  background: #007aff;
}

.stats-legend .lg-in {
  background: #30d158;
}

.stats-table-wrap {
  overflow-x: auto;
  border-radius: 0;
  background: transparent;
  -webkit-overflow-scrolling: touch;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.stats-table th,
.stats-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}

body.dark-theme .stats-table th,
body.dark-theme .stats-table td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.stats-table th {
  font-size: 11px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

body.dark-theme .stats-table th {
  background: #161618;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table td.num,
.stats-table th.num {
  text-align: right;
}

.stats-hbar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-hbar-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr 44px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.stats-hbar-track {
  height: 8px;
  background: rgba(120, 120, 128, 0.18);
  border-radius: 999px;
  overflow: hidden;
}

.stats-hbar-fill {
  height: 100%;
  background: #007aff;
  border-radius: 999px;
}

.stats-hbar-row .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #8e8e93;
}

.stats-footnote {
  font-size: 12px;
  color: #8e8e93;
  margin: 0;
}

@media (max-width: 700px) {
  #stats-modal.stats-overlay,
  .stats-overlay {
    padding: 0 !important;
  }
  #stats-modal .stats-sheet.ios-modal-sheet,
  .stats-sheet.ios-modal-sheet {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
  }
  #stats-modal .stats-body.ios-modal-body {
    padding: 16px;
  }
}

.juri-inbox-empty {
  padding: 24px 20px;
  text-align: center;
  color: var(--ios-label-secondary, #8e8e93);
  font-size: 15px;
}

.juri-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 8px;
}

.juri-inbox-card {
  background: var(--ios-bg2, #fff);
  border: 0.5px solid var(--ios-separator-opaque, rgba(60, 60, 67, 0.29));
  border-radius: 12px;
  padding: 12px 14px 14px;
}

body.dark-theme .juri-inbox-card {
  background: rgba(120, 120, 128, 0.12);
  border-color: rgba(84, 84, 88, 0.65);
}

.juri-inbox-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ios-label-secondary, #8e8e93);
}

.juri-inbox-card-source {
  font-weight: 600;
  color: var(--ios-blue);
}

.juri-inbox-card-summary {
  font-size: 13px;
  color: var(--ios-label, #1c1c1e);
  margin: 0 0 10px;
  line-height: 1.35;
}

body.dark-theme .juri-inbox-card-summary {
  color: #f2f2f7;
}

.juri-inbox-excerpt {
  margin: 0 0 12px;
  border-radius: 10px;
  background: rgba(120, 120, 128, 0.1);
  padding: 8px 10px;
}

.juri-inbox-excerpt > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--ios-blue);
  list-style: none;
  user-select: none;
}

.juri-inbox-excerpt > summary::-webkit-details-marker {
  display: none;
}

.juri-inbox-excerpt > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.juri-inbox-excerpt[open] > summary::before {
  transform: rotate(90deg);
}

.juri-inbox-excerpt-body {
  margin-top: 8px;
}

.juri-inbox-reported {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 149, 0, 0.12);
  border-left: 3px solid #ff9500;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ios-label, #1c1c1e);
  white-space: pre-wrap;
  word-break: break-word;
}

body.dark-theme .juri-inbox-reported {
  color: #f2f2f7;
}

.juri-inbox-excerpt .bot-sav-conv {
  max-height: 160px;
  margin: 0;
  background: transparent;
  border: none;
  padding: 0;
}

.juri-inbox-excerpt-empty {
  margin: 0;
  font-size: 12px;
  color: var(--ios-label-secondary, #8e8e93);
}

.juri-inbox-open-conv {
  margin-top: 8px;
  border: none;
  background: none;
  color: var(--ios-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.juri-inbox-open-conv:active {
  opacity: 0.6;
}

.juri-inbox-card .bot-sav-juri-label {
  margin-top: 6px;
}

.juri-inbox-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 0.5px solid var(--ios-separator-opaque, rgba(60, 60, 67, 0.15));
}

/* Barre de recherche iOS */
.search-container,
.filter-container {
  flex-shrink: 0;
}

.search-container {
  padding: 8px 16px 12px;
  background: var(--ios-bg2);
  border-bottom: 1px solid var(--ios-separator);
  transition: background 0.3s ease;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ios-gray6);
  border-radius: 10px;
  padding: 6px 10px;
  transition: all 0.2s ease;
}

.search-icon {
  color: var(--ios-gray);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ios-label);
  font-family: var(--font-stack);
  font-size: 15px;
  outline: none;
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--ios-gray);
}

.mic-icon {
  color: var(--ios-gray);
  flex-shrink: 0;
}

/* Filtre d'étiquettes iOS style */
.filter-container {
  padding: 8px 16px;
  background: var(--ios-bg2);
  border-bottom: 1px solid var(--ios-separator);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ios-filter-select {
  width: 100%;
  border: none;
  background: var(--ios-gray6);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--ios-label);
  font-family: var(--font-stack);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238E8E93'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.ios-unread-filter {
  flex-shrink: 0;
  border: 1px solid var(--ios-separator);
  background: var(--ios-gray6);
  color: var(--ios-label);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ios-unread-filter.is-active {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
}

/* Badges d'étiquettes dans les conversations */
.contact-labels-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.contact-label-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
  text-shadow: 0 1px 0px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Liste des conversations */
.conversations-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.conversations-list::-webkit-scrollbar {
  width: 0;
}

.loading-placeholder {
  padding: 32px 20px;
  text-align: center;
  color: var(--ios-gray);
  font-size: 14px;
}

/* Item de conversation */
.conversation-item {
  display: flex;
  align-items: center;
  padding: 10px 16px 10px 28px; /* Augmenté à gauche pour le badge non-lu */
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
  min-height: 64px;
}

.conversation-item::after {
  content: '';
  position: absolute;
  left: 68px; /* Aligné avec la réduction de taille d'avatar */
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: var(--ios-separator);
}

.conversation-item:hover {
  background: var(--ios-gray6);
}

.contacts-load-more {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 20px;
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ios-blue);
  background: var(--ios-gray6);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.contacts-load-more.is-loading {
  color: var(--ios-secondary-label);
  cursor: wait;
}

.contacts-load-more:active:not(:disabled) {
  opacity: 0.75;
}

.contacts-load-more[hidden] {
  display: none;
}

/* Badge bleu non-lu bien séparé */
.unread-dot {
  position: absolute;
  left: 10px; /* Placé bien à gauche et séparé */
  width: 8px;
  height: 8px;
  background: var(--ios-blue);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Avatar plus petit (40px) */
.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  margin-right: 12px;
  user-select: none;
}

/* Contenu de l'item */
.item-content {
  flex: 1;
  min-width: 0;
}

.item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
  gap: 8px;
}

.item-name {
  font-weight: 600;
  font-size: 15px; /* Plus petit et sobre */
  color: var(--ios-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-date {
  font-size: 13px;
  color: var(--ios-gray2);
  white-space: nowrap;
  flex-shrink: 0;
}

.item-bottom-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-snippet {
  font-size: 14px;
  color: var(--ios-label-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.item-snippet.unread {
  color: var(--ios-label);
  font-weight: 500;
}

.conv-draft-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #FF9500;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
}

.conv-draft-badge:hover {
  opacity: 0.9;
}

body.dark-theme .conv-draft-badge {
  background: #FF9F0A;
}

.item-chevron {
  color: var(--ios-gray3);
  flex-shrink: 0;
  line-height: 0;
}

/* ==========================================
   ZONE DE CHAT
   ========================================== */
.chat-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ios-bg2);
  overflow: hidden;
  transition: background 0.3s ease;
}

/* État vide */
.empty-chat-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ios-bg);
  text-align: center;
  transition: background 0.3s ease;
}

.welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
}

.welcome-icon {
  width: 48px;
  height: 48px;
  background: var(--ios-gray6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-gray);
  margin-bottom: 4px;
}

.welcome-card h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ios-label);
}

.welcome-card p {
  font-size: 13px;
  color: var(--ios-gray);
  max-width: 240px;
  line-height: 1.4;
}

/* Conteneur de discussion active */
.active-chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* En-tête de discussion */
.chat-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: calc(10px + var(--safe-top)) calc(16px + var(--safe-right)) 10px calc(8px + var(--safe-left));
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 0.5px solid var(--ios-separator-opaque);
  min-height: calc(52px + var(--safe-top));
  z-index: 10;
  flex-shrink: 0;
}

.chat-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
}

.back-btn {
  display: none;
  background: none;
  border: none;
  color: var(--ios-blue);
  cursor: pointer;
  padding: 4px;
  margin-right: 4px;
}

.contact-header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.contact-header-center-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.tram-progress-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: rgba(0, 122, 255, 0.12);
  color: var(--ios-blue);
  border-radius: 14px;
  padding: 4px 8px 4px 6px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.tram-progress-btn:hover {
  background: rgba(0, 122, 255, 0.2);
}

.tram-progress-badge {
  font-variant-numeric: tabular-nums;
}

.bot-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 149, 0, 0.14);
  color: #ff9500;
  border-radius: 14px;
  padding: 6px 8px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 12;
}

.bot-report-btn:hover {
  background: rgba(255, 149, 0, 0.24);
}

body.dark-theme .bot-report-btn {
  color: #ffb340;
}

.bot-takeover-banner {
  margin: 0 12px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 149, 0, 0.12);
  color: #c93400;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.rdv-banner {
  margin: 0 12px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(202, 138, 4, 0.14);
  color: #a16207;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rdv-banner[hidden] {
  display: none !important;
}

.rdv-banner svg {
  flex-shrink: 0;
  opacity: 0.9;
}

body.dark-theme .rdv-banner {
  background: rgba(234, 179, 8, 0.16);
  color: #fbbf24;
}

.bot-takeover-banner[hidden],
.bot-sav-panel[hidden] {
  display: none !important;
}

.bot-sav-show-btn {
  border: none;
  background: rgba(0, 122, 255, 0.15);
  color: var(--ios-blue);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.bot-sav-panel {
  margin: 0 10px 8px;
  border-radius: 12px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.92));
  border: 0.5px solid rgba(255, 149, 0, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

body.dark-theme .bot-sav-panel {
  background: rgba(28, 28, 30, 0.95);
  border-color: rgba(255, 149, 0, 0.4);
}

.bot-sav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 149, 0, 0.1);
  border-bottom: 0.5px solid rgba(255, 149, 0, 0.2);
}

.bot-sav-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.bot-sav-panel-title-wrap strong {
  font-size: 13px;
}

.bot-sav-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 149, 0, 0.2);
  color: #c93400;
}

.bot-sav-status-badge.done {
  background: rgba(52, 199, 89, 0.2);
  color: #248a3d;
}

.bot-sav-status-badge.progress {
  background: rgba(0, 122, 255, 0.15);
  color: var(--ios-blue);
}

.bot-sav-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 149, 0, 0.25);
  border-top-color: #ff9500;
  border-radius: 50%;
  animation: bot-sav-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes bot-sav-spin {
  to { transform: rotate(360deg); }
}

.bot-sav-panel-actions {
  display: flex;
  gap: 4px;
}

.bot-sav-icon-btn {
  border: none;
  background: rgba(120, 120, 128, 0.15);
  color: var(--ios-label-secondary, #636366);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.bot-sav-panel-body {
  padding: 10px 12px 12px;
  max-height: 220px;
  overflow-y: auto;
}

.bot-sav-panel.collapsed .bot-sav-panel-body {
  display: none;
}

.bot-sav-summary {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ios-label, #000);
  line-height: 1.4;
}

.bot-sav-facts {
  margin: 0 0 10px;
}

.bot-sav-fact {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 0.5px solid var(--ios-separator-opaque, rgba(60, 60, 67, 0.15));
}

.bot-sav-fact p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.bot-sav-conv {
  margin: 0;
  padding: 8px;
  max-height: 180px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--ios-fill-tertiary, rgba(120, 120, 128, 0.12));
  border-radius: 8px;
  color: var(--ios-label, #000);
}

.bot-sav-timeline {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
}

.bot-sav-timeline li {
  margin-bottom: 4px;
}

.bot-sav-timeline li.pending {
  color: var(--ios-label-secondary, #636366);
  list-style-type: "○ ";
}

.bot-sav-timeline li.active {
  color: #c93400;
  font-weight: 600;
  list-style-type: "◌ ";
}

.bot-sav-timeline li.done {
  color: #248a3d;
  list-style-type: "✓ ";
}

.bot-sav-block-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ios-label-secondary, #636366);
  margin-bottom: 4px;
}

.bot-sav-ai-block,
.bot-sav-juri-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 0.5px solid var(--ios-separator-opaque, rgba(60, 60, 67, 0.15));
}

.bot-sav-ai-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.bot-sav-ai-cause {
  margin-top: 4px !important;
  font-size: 12px !important;
  color: var(--ios-label-secondary, #636366) !important;
}

.bot-sav-juri-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ios-label-secondary, #636366);
  margin: 8px 0 3px;
}

.bot-sav-juri-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0.5px solid var(--ios-separator-opaque, rgba(60, 60, 67, 0.29));
  background: var(--ios-secondary-system-grouped-background, #fff);
  color: var(--ios-label, #1c1c1e);
  resize: vertical;
}

.bot-sav-juri-input:disabled {
  opacity: 0.65;
}

body.dark-theme .bot-sav-juri-input {
  background: rgba(120, 120, 128, 0.18);
  color: #f2f2f7;
  border-color: rgba(84, 84, 88, 0.65);
}

.bot-sav-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 0.5px solid var(--ios-separator-opaque, rgba(60, 60, 67, 0.15));
}

.bot-sav-action-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(120, 120, 128, 0.16);
  color: var(--ios-label, #1c1c1e);
}

.bot-sav-action-btn.primary {
  background: rgba(52, 199, 89, 0.2);
  color: #248a3d;
}

.bot-sav-action-btn.danger {
  background: rgba(255, 59, 48, 0.16);
  color: #d70015;
}

body.dark-theme .bot-sav-action-btn {
  color: #f2f2f7;
}

body.dark-theme .bot-sav-action-btn.primary {
  color: #30d158;
}

body.dark-theme .bot-sav-action-btn.danger {
  color: #ff6961;
}

body.dark-theme .bot-takeover-banner {
  color: #ffb340;
}

.bot-report-preview blockquote {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ios-secondary-bg, rgba(120, 120, 128, 0.12));
  font-size: 14px;
  line-height: 1.4;
  color: var(--ios-label-secondary, #636366);
  white-space: pre-wrap;
}

.bot-msg-report-btn {
  border: none;
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
  border-radius: 8px;
  padding: 2px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.bot-msg-report-btn:hover {
  background: rgba(255, 149, 0, 0.28);
}

.tram-modal-sheet {
  max-height: min(78vh, 560px);
}

.tram-modal-step {
  min-width: 44px;
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  color: var(--ios-blue);
  font-variant-numeric: tabular-nums;
}

.tram-checklist {
  list-style: none;
  margin: 0;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tram-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ios-secondary-grouped-bg, var(--ios-grouped-bg));
  border-radius: 12px;
}

.tram-check-item.done {
  opacity: 0.92;
}

.tram-check-item.current {
  outline: 1.5px solid var(--ios-blue);
  outline-offset: 0;
}

.tram-check-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--ios-gray3, #c7c7cc);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: #fff;
  background: transparent;
}

.tram-check-item.done .tram-check-box {
  background: var(--ios-blue);
  border-color: var(--ios-blue);
}

.tram-check-body {
  min-width: 0;
  flex: 1;
}

.tram-check-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ios-label);
}

.tram-check-desc {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ios-secondary-label, #8e8e93);
}

.tram-updated-at {
  padding: 4px 16px 20px;
  font-size: 11px;
  color: var(--ios-secondary-label, #8e8e93);
  text-align: center;
}

/* Avatar d'en-tête réduit */
.contact-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.contact-name-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--ios-label);
  display: flex;
  align-items: center;
  gap: 3px;
}

.contact-name-header .chevron-right {
  color: var(--ios-gray3);
  line-height: 0;
}

/* Fil des messages */
.chat-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--ios-bg2);
  -webkit-overflow-scrolling: touch;
  transition: background 0.3s ease;
}

.chat-feed::-webkit-scrollbar {
  width: 0;
}

/* Séparateur de date dans le fil */
.date-separator {
  text-align: center;
  font-size: 11px;
  color: var(--ios-gray);
  margin: 12px 0 6px;
  font-weight: 400;
  letter-spacing: 0.1px;
}

/* Rangées de messages */
.message-row {
  display: flex;
  width: 100%;
  margin-bottom: 6px;
}

.message-row.sent {
  justify-content: flex-end;
}

.message-row.received {
  justify-content: flex-start;
}

.message-stack {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  min-width: 0;
  position: relative;
  overflow: visible;
}

.message-row.sent .message-stack {
  align-items: flex-end;
}

.message-row.received .message-stack {
  align-items: flex-start;
}

.message-row.has-reaction {
  margin-top: 10px;
}

/* Regroupement de bulles : espacement réduit entre messages du même envoyeur */
.message-row + .message-row.sent,
.message-row + .message-row.received {
  margin-top: 0;
}

.message-row.sent + .message-row.received,
.message-row.received + .message-row.sent {
  margin-top: 8px;
}

/* Suite d'une série envoyée (même minute) : meta compacte / collée */
.message-row.group-continued {
  margin-bottom: 2px;
}

.message-row.group-continued .message-meta {
  margin-top: 1px;
  min-height: 0;
}

/* Bulles */
.message-bubble {
  max-width: 100%;
  padding: 8px 14px;
  font-size: 16px;
  line-height: 1.35;
  position: relative;
  overflow: visible;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message-row.sent .message-bubble {
  background: var(--bubble-out);
  color: var(--bubble-out-text);
  border-radius: 18px 18px 4px 18px;
}

/* Sortants BOT — vert (UI reste bleu iOS) */
.message-row.sent.sent-bot .message-bubble {
  background: var(--bubble-out-bot);
  color: var(--bubble-out-text);
}

.message-row.received .message-bubble {
  background: var(--bubble-in);
  color: var(--bubble-in-text);
  border-radius: 18px 18px 18px 4px;
}

.message-bubble a.message-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  cursor: pointer;
}

.message-bubble a.message-link:hover {
  opacity: 0.85;
}

.message-row.sent .message-bubble a.message-link {
  text-decoration-color: rgba(255, 255, 255, 0.55);
}

.message-row.received .message-bubble a.message-link {
  color: #0a84ff;
  text-decoration-color: rgba(10, 132, 255, 0.45);
}

body.dark-theme .message-row.received .message-bubble a.message-link {
  color: #64d2ff;
  text-decoration-color: rgba(100, 210, 255, 0.45);
}

/* Badge réaction iOS (tapback) — ancré sur .message-stack, hors clip bulle */
.message-reaction {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 15px;
  line-height: 1;
  background: var(--bubble-out-bot);
  color: #111;
  border: 2px solid var(--ios-bg2);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  user-select: none;
}

.message-row.received .message-reaction {
  top: -12px;
  right: -6px;
}

.message-row.sent .message-reaction {
  top: -12px;
  left: -6px;
}

/* Meta sous la bulle (heure + cost + status) */
.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  padding: 0 4px;
  max-width: 100%;
}

.message-row.sent .message-meta {
  justify-content: flex-end;
}

.message-row.received .message-meta {
  justify-content: flex-start;
}

.message-time {
  font-size: 10px;
  color: var(--ios-gray);
}

.read-sim-toggle {
  border: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 8px;
  letter-spacing: 0.01em;
}

.read-sim-toggle.is-read {
  background: rgba(52, 199, 89, 0.18);
  color: #34c759;
}

.read-sim-toggle.is-unread {
  background: rgba(255, 149, 0, 0.2);
  color: #ff9500;
}

.read-sim-toggle:hover {
  filter: brightness(1.08);
}

.message-cost {
  font-size: 10px;
  color: var(--ios-green);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.message-row.sent.sent-bot .message-cost {
  color: #34C759;
}

.message-row.sent:not(.sent-bot) .message-cost {
  color: #a16207;
}

body.dark-theme .message-cost {
  color: #30D158;
}

body.dark-theme .message-row.sent:not(.sent-bot) .message-cost {
  color: #fbbf24;
}

/* Indicateur "Distribué" */
.delivery-status {
  font-size: 10px;
  color: var(--ios-gray);
}

.delivery-status.unsent {
  color: #FF9500;
  font-weight: 600;
}

body.dark-theme .delivery-status.unsent {
  color: #FF9F0A;
}

/* Pastille « non envoyé » à droite de la bulle */
.message-bubble-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.message-bubble-row .message-bubble {
  max-width: calc(100% - 28px);
}

.msg-draft-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #FF9500;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(255, 149, 0, 0.35);
}

.msg-draft-badge:hover {
  opacity: 0.9;
}

body.dark-theme .msg-draft-badge {
  background: #FF9F0A;
}

.message-row.has-draft-unsent .message-bubble {
  box-shadow: 0 0 0 1.5px rgba(255, 149, 0, 0.45);
}

.chat-cost-total {
  font-size: 10px;
  font-weight: 500;
  color: var(--ios-green);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

body.dark-theme .chat-cost-total {
  color: #30D158;
}

/* ==========================================
   BARRE DE SAISIE INFÉRIEURE (NETTOYÉE ET SOBRE)
   ========================================== */
.chat-footer {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 0.5px solid var(--ios-separator-opaque);
  padding: 10px calc(16px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(16px + var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  flex-shrink: 0;
}

.input-row {
  display: flex;
  align-items: flex-end;
  width: 100%;
  gap: 8px;
}

.relaunch-wrap {
  position: relative;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
}

.relaunch-wrap[hidden] {
  display: none !important;
}

.relaunch-draft-btn {
  flex-shrink: 0;
  border: none;
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-stack);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.relaunch-draft-btn:hover:not(:disabled) {
  background: rgba(234, 179, 8, 0.28);
}

.relaunch-draft-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

body.dark-theme .relaunch-draft-btn {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}

body.dark-theme .relaunch-draft-btn:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.28);
}

.relaunch-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(320px, calc(100vw - 32px));
  max-height: min(360px, 55vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  z-index: 40;
  overflow: hidden;
}

.relaunch-popover[hidden] {
  display: none !important;
}

body.dark-theme .relaunch-popover {
  background: #2c2c2e;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.relaunch-popover-title {
  padding: 12px 14px 2px;
  font-size: 13px;
  font-weight: 600;
  color: #1c1c1e;
}

body.dark-theme .relaunch-popover-title {
  color: #f5f5f7;
}

.relaunch-popover-hint {
  padding: 0 14px 8px;
  font-size: 11px;
  color: #8e8e93;
}

.relaunch-templates-list {
  overflow-y: auto;
  flex: 1;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-theme .relaunch-templates-list {
  border-color: rgba(255, 255, 255, 0.08);
}

.relaunch-template-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-theme .relaunch-template-row {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.relaunch-template-row:last-child {
  border-bottom: none;
}

.relaunch-template-pick {
  flex: 1;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  color: #1c1c1e;
  font-family: var(--font-stack);
  cursor: pointer;
}

.relaunch-template-pick:hover {
  background: rgba(234, 179, 8, 0.12);
}

body.dark-theme .relaunch-template-pick {
  color: #f5f5f7;
}

body.dark-theme .relaunch-template-pick:hover {
  background: rgba(251, 191, 36, 0.14);
}

.relaunch-template-del {
  flex-shrink: 0;
  width: 40px;
  border: none;
  background: transparent;
  color: #8e8e93;
  font-size: 18px;
  cursor: pointer;
  font-family: var(--font-stack);
}

.relaunch-template-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.relaunch-popover-add {
  display: flex;
  gap: 6px;
  padding: 10px;
  align-items: center;
}

.relaunch-popover-add input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-stack);
  background: #f2f2f7;
  color: #1c1c1e;
  outline: none;
}

body.dark-theme .relaunch-popover-add input {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

.relaunch-template-add-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-stack);
  background: rgba(234, 179, 8, 0.22);
  color: #a16207;
  cursor: pointer;
}

body.dark-theme .relaunch-template-add-btn {
  background: rgba(251, 191, 36, 0.22);
  color: #fbbf24;
}

.relaunch-templates-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: #8e8e93;
  text-align: center;
}

.proofread-btn {
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
  border: none;
  background: rgba(142, 142, 147, 0.16);
  color: #636366;
  border-radius: 16px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-stack);
  font-style: italic;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.proofread-btn:hover:not(:disabled) {
  background: rgba(10, 132, 255, 0.16);
  color: #0a84ff;
}

.proofread-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.proofread-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

body.dark-theme .proofread-btn {
  background: rgba(142, 142, 147, 0.22);
  color: #aeaeb2;
}

body.dark-theme .proofread-btn:hover:not(:disabled) {
  background: rgba(10, 132, 255, 0.22);
  color: #64d2ff;
}

/* Champ texte style iOS — multi-lignes auto */
.imessage-input-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: var(--ios-bg2);
  border: 1px solid var(--ios-gray3);
  border-radius: 20px;
  padding: 6px 12px;
  min-height: 36px;
  transition: border-color 0.2s ease, background 0.3s ease;
}

.imessage-input-wrapper:focus-within {
  border-color: var(--ios-gray2);
}

.imessage-input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ios-label);
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.35;
  outline: none;
  min-width: 0;
  resize: none;
  overflow-y: auto;
  max-height: 140px;
  min-height: 22px;
  padding: 2px 0;
  margin: 0;
  field-sizing: content;
}

.imessage-input-wrapper textarea::placeholder {
  color: var(--ios-gray);
}

.imessage-input-wrapper textarea:disabled {
  opacity: 1;
  cursor: default;
}

.mic-send-btn {
  background: none;
  border: none;
  color: var(--ios-gray2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: color 0.15s ease;
  margin-bottom: 1px;
}

.mic-send-btn.active {
  color: var(--ios-blue);
}

/* ==========================================
   RESPONSIVE MOBILE
   ========================================== */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }

  html, body {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  html.ios-device {
    --inset-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Fond sous Dynamic Island — une seule marge haute (env natif iOS) */
  .ios-notch-fill {
    display: block;
    height: env(safe-area-inset-top, 47px);
    background: var(--ios-top-fill, var(--ios-bg2));
  }

  .ios-notch-fill-sidebar {
    background: var(--ios-top-fill, var(--ios-bg2));
  }

  .ios-notch-fill-chat,
  .ios-notch-fill-modal {
    background: var(--ios-top-fill, var(--ios-bg2));
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
  }

  .ios-modal-body {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-header {
    padding: 0 calc(16px + var(--safe-right)) 8px calc(16px + var(--safe-left));
  }

  .chat-header {
    padding: 0 calc(16px + var(--safe-right)) 10px calc(8px + var(--safe-left));
    min-height: 0;
    gap: 0;
  }

  .chat-header-row {
    min-height: 44px;
  }

  :root {
    --ios-top-fill: var(--ios-bg2);
  }

  .app-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    flex-direction: column;
    width: 100%;
  }

  .sidebar {
    width: 100%;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .sidebar.sidebar-away {
    transform: translateX(-100%);
    pointer-events: none;
  }

  .chat-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    display: none;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    touch-action: pan-y;
  }

  .chat-area.swiping {
    transition: none;
  }

  .chat-area.visible,
  .chat-area.swiping {
    display: flex;
    visibility: visible;
    pointer-events: auto;
  }

  .chat-area.visible:not(.swiping) {
    transform: translateX(0);
  }

  .chat-area:not(.visible):not(.swiping) {
    transform: translateX(100%);
  }

  /* Zone chat entièrement masquée hors conversation — pas de position:fixed */
  .chat-area:not(.visible) .active-chat-container,
  .chat-area:not(.visible) .chat-footer {
    display: none !important;
  }

  /* Filet de sécurité : jamais de barre de saisie sur la liste (cache PWA) */
  :root:not(.chat-open) .chat-footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }

  .chat-area.visible .active-chat-container {
    display: flex !important;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    margin-bottom: var(--keyboard-inset, 0px);
  }

  .chat-area.visible .chat-footer {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    background: var(--ios-bg2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 10px 16px max(10px, env(safe-area-inset-bottom, 0px));
  }

  :root.keyboard-open .chat-area.visible .chat-footer {
    padding-bottom: 10px;
  }

  /*
   * Liste conversations : flex dans le sidebar.
   */
  .conversations-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    background: var(--ios-bg2);
  }

  .chat-area.visible .chat-feed {
    flex: 1;
    min-height: 0;
    padding-bottom: 8px;
  }

  /*
   * Modales : fond plein écran, boutons décalés via padding header.
   */
  .ios-modal-overlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .ios-modal-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    animation: slideUpModalMobile 0.32s cubic-bezier(0.15, 0.85, 0.35, 1);
    overflow: hidden;
  }

  .tram-modal-sheet {
    max-height: none;
  }

  @keyframes slideUpModalMobile {
    from { transform: translateY(24px); opacity: 0.92; }
    to { transform: translateY(0); opacity: 1; }
  }

  .ios-modal-header {
    min-height: 44px;
    padding: 10px 16px;
    align-items: center;
    flex-shrink: 0;
  }

  .modal-nav-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    padding: 0 8px;
  }

  .ios-modal-body {
    padding-bottom: 16px;
  }

  .mobile-notif-banner {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  :root.chat-open .mobile-notif-banner {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + var(--keyboard-inset, 0px));
  }

  :root.chat-open.keyboard-open .mobile-notif-banner {
    bottom: calc(72px + var(--keyboard-inset, 0px));
  }

  .back-btn {
    display: flex;
  }

  .empty-chat-state {
    display: none;
  }
}

/* ==========================================
   SÉLECTEUR SIM
   ========================================== */
.sim-selector-container {
  padding: 8px 16px 12px;
  background: var(--ios-bg2);
  border-bottom: 0.5px solid var(--ios-separator-opaque);
  transition: background 0.3s ease;
  touch-action: pan-y;
}

.sim-tabs-viewport {
  margin: 0 -16px 6px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
}

.sim-tabs-viewport::-webkit-scrollbar {
  display: none;
}

.sim-tabs {
  display: flex;
  gap: 8px;
  width: max-content;
  min-width: 100%;
}

.sim-tab {
  flex: 0 0 auto;
  min-width: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--ios-gray4);
  background: var(--ios-gray6);
  color: var(--ios-label);
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  scroll-snap-align: start;
  white-space: nowrap;
}

/* ≤2 SIMs : étirer pour remplir la largeur */
.sim-tabs[data-count="1"] .sim-tab,
.sim-tabs[data-count="2"] .sim-tab {
  flex: 1 1 0;
  min-width: 0;
}

.sim-tab.active {
  background: var(--ios-blue);
  border-color: var(--ios-blue);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.2);
}

.sim-dot {
  width: 6px;
  height: 6px;
  background: #34C759;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 0 6px #34C759;
}

.sim-draft-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #FF9500;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.sim-tab.active .sim-draft-badge {
  background: #fff;
  color: #FF9500;
}

.sim-status-bar .sim-drafts-link {
  color: #FF9500;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 2px;
}

.sim-status-bar .sim-drafts-link:hover {
  opacity: 0.85;
}

body.dark-theme .sim-draft-badge {
  background: #FF9F0A;
}

body.dark-theme .sim-tab.active .sim-draft-badge {
  background: #1c1c1e;
  color: #FF9F0A;
}

.sim-drafts-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--ios-secondary-label);
  font-size: 15px;
}

.sim-drafts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 24px;
}

.sim-draft-item {
  border: 0.5px solid var(--ios-separator-opaque);
  border-radius: 12px;
  background: var(--ios-bg);
  padding: 12px 14px;
}

.sim-draft-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sim-draft-item-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ios-label);
}

.sim-draft-item-date {
  font-size: 12px;
  color: var(--ios-secondary-label);
  white-space: nowrap;
}

.sim-draft-item-phone {
  font-size: 12px;
  color: var(--ios-secondary-label);
  margin-bottom: 6px;
}

.sim-draft-item-content {
  font-size: 14px;
  color: var(--ios-label);
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.sim-draft-unsent-pill {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(255, 149, 0, 0.18);
  color: #FF9500;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

body.dark-theme .sim-draft-unsent-pill {
  background: rgba(255, 159, 10, 0.22);
  color: #FF9F0A;
}

.sim-draft-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sim-draft-item-actions button {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-stack);
}

.sim-draft-btn-open {
  background: var(--ios-gray5);
  color: var(--ios-label);
}

.sim-draft-btn-resend {
  background: rgba(0, 122, 255, 0.12);
  color: var(--ios-blue);
}

.sim-draft-btn-delete {
  background: rgba(255, 59, 48, 0.12);
  color: #FF3B30;
}

.sim-draft-item-actions button:disabled {
  opacity: 0.5;
  cursor: wait;
}

body.dark-theme .sim-draft-item {
  background: var(--ios-bg2);
}

.sim-tab:not(.active) .sim-dot {
  opacity: 0.7;
}

.sim-status-bar {
  font-size: 11px;
  color: var(--ios-label-secondary);
  font-weight: 400;
  letter-spacing: -0.1px;
}

.sim-limits-tooltip {
  position: fixed;
  z-index: 10000;
  width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(28, 28, 30, 0.96);
  color: #f5f5f7;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}

.sim-limits-tooltip[hidden] {
  display: none !important;
  pointer-events: none;
}

body:not(.dark-theme) .sim-limits-tooltip {
  background: rgba(255, 255, 255, 0.98);
  color: #1c1c1e;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sim-gauge + .sim-gauge {
  margin-top: 10px;
}

.sim-gauge-cost {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
}

.sim-gauge-cost + .sim-gauge-cost {
  margin-top: 6px;
}

.sim-gauge-cost-value {
  font-variant-numeric: tabular-nums;
  opacity: 0.95;
}

.sim-gauge-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
}

.sim-gauge-pct {
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.sim-gauge-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.28);
  overflow: hidden;
}

.sim-gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.sim-gauge-meta {
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.65;
  white-space: pre-line;
}

.sim-tab.limits-loading {
  opacity: 0.85;
}

/* ==========================================
   MODAL DE RÉGLAGES STYLE SHEET (iOS)
   ========================================== */
.ios-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ios-modal-sheet {
  background: var(--ios-bg2);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  animation: slideUpModal 0.3s cubic-bezier(0.15, 0.85, 0.35, 1);
}

@keyframes slideUpModal {
  from { transform: translateY(40px); }
  to { transform: translateY(0); }
}

.ios-modal-header {
  padding: 14px 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--ios-separator-opaque);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  flex-shrink: 0;
}

.ios-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ios-label);
}

.modal-nav-btn {
  background: none;
  border: none;
  color: var(--ios-blue);
  font-family: var(--font-stack);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.modal-nav-btn.bold {
  font-weight: 600;
}

.modal-nav-btn:active {
  opacity: 0.5;
}

.ios-modal-body {
  flex: 1;
  overflow-y: auto;
  background: var(--ios-bg);
  padding: 16px 0;
  -webkit-overflow-scrolling: touch;
}

/* Avatar dans le modal */
.modal-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.modal-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8E8E93 0%, #AEAEB2 100%);
  color: #FFFFFF;
  font-size: 28px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 8px;
}

.modal-phone-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--ios-label-secondary);
}

/* Groupes de réglages iOS */
.ios-settings-group {
  background: var(--ios-bg2);
  margin: 0 16px 20px 16px;
  border-radius: 10px;
  border: 0.5px solid var(--ios-separator-opaque);
  overflow: hidden;
}

.settings-group-title {
  display: block;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--ios-label-secondary);
  padding: 8px 16px 6px 16px;
  letter-spacing: 0.3px;
}

.modal-hint {
  font-size: 13px;
  color: var(--ios-label-secondary);
  padding: 0 16px 8px;
  text-align: center;
}

.ios-setting-item {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--ios-separator);
}

.ios-setting-item:last-child {
  border-bottom: none;
}

.ios-setting-item label {
  font-size: 12px;
  color: var(--ios-label-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.ios-setting-item input,
.ios-setting-item select,
.ios-setting-item textarea {
  border: none;
  background: transparent;
  color: var(--ios-label);
  font-family: var(--font-stack);
  font-size: 15px;
  outline: none;
  width: 100%;
}

.linkedin-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.linkedin-url-row input {
  flex: 1;
  min-width: 0;
}

.linkedin-open-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 102, 194, 0.18);
  color: #0A66C2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.linkedin-open-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.linkedin-open-btn:not(:disabled):active {
  background: rgba(10, 102, 194, 0.32);
}

body.dark-theme .linkedin-open-btn {
  background: rgba(10, 102, 194, 0.28);
  color: #70B5F9;
}

.ios-setting-item textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
  line-height: 1.35;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 142, 147, 0.55) transparent;
}

.ios-setting-item textarea::-webkit-scrollbar {
  width: 4px;
}

.ios-setting-item textarea::-webkit-scrollbar-track {
  background: transparent;
}

.ios-setting-item textarea::-webkit-scrollbar-thumb {
  background: rgba(142, 142, 147, 0.55);
  border-radius: 4px;
}

body.dark-theme .ios-setting-item textarea::-webkit-scrollbar-thumb {
  background: rgba(142, 142, 147, 0.7);
}


/* Interrupteur iOS (Switch Toggle) */
.ios-setting-item-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--ios-label);
}

.ios-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--ios-gray3);
  transition: .3s;
  border-radius: 34px;
}

.ios-switch-slider:before {
  position: absolute;
  content: "";
  height: 27px;
  width: 27px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.ios-switch input:checked + .ios-switch-slider {
  background-color: var(--ios-green);
}

.ios-switch input:checked + .ios-switch-slider:before {
  transform: translateX(20px);
}

/* Scrollbars thème sombre (modal + listes) */
.ios-modal-body,
.status-radio-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 142, 147, 0.55) transparent;
}

.ios-modal-body::-webkit-scrollbar,
.status-radio-list::-webkit-scrollbar {
  width: 6px;
}

.ios-modal-body::-webkit-scrollbar-track,
.status-radio-list::-webkit-scrollbar-track {
  background: transparent;
}

.ios-modal-body::-webkit-scrollbar-thumb,
.status-radio-list::-webkit-scrollbar-thumb {
  background: rgba(142, 142, 147, 0.45);
  border-radius: 999px;
}

body.dark-theme .ios-modal-body::-webkit-scrollbar-thumb,
body.dark-theme .status-radio-list::-webkit-scrollbar-thumb {
  background: rgba(235, 235, 245, 0.28);
}

.status-hint {
  text-align: left;
  padding: 0 16px 8px;
  margin: 0;
}

/* Liste statut unique (catégorie = étiquette) */
.status-radio-list {
  padding: 4px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}

.status-radio-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--ios-label);
  cursor: pointer;
  transition: background 0.15s ease;
}

.status-radio-item:hover {
  background: rgba(142, 142, 147, 0.12);
}

.status-radio-item.selected {
  background: rgba(0, 122, 255, 0.14);
}

body.dark-theme .status-radio-item.selected {
  background: rgba(10, 132, 255, 0.22);
}

.status-radio-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-extra-tag {
  font-size: 11px;
  color: var(--ios-label-secondary);
  font-weight: 400;
}

.status-radio-item input.ios-radio,
.status-radio-item input.ios-check {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ios-radio-mark,
.ios-check-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ios-gray2);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.ios-check-mark {
  border-radius: 6px;
}

.status-radio-item.selected .ios-radio-mark,
.status-radio-item.selected .ios-check-mark,
.status-radio-item:has(input:checked) .ios-radio-mark,
.status-radio-item:has(input:checked) .ios-check-mark {
  border-color: var(--ios-blue);
  background: var(--ios-blue);
}

.ios-radio-mark::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
}

.status-radio-item:has(input:checked) .ios-radio-mark::after {
  transform: translate(-50%, -50%) scale(1);
}

.ios-check-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.status-radio-item:has(input:checked) .ios-check-mark::after {
  transform: rotate(45deg) scale(1);
}

.status-manuel .status-name {
  color: var(--ios-label-secondary);
}

/* Bouton Supprimer rouge */
.modal-delete-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 59, 48, 0.2);
  background: var(--ios-bg2);
  color: #FF3B30;
  font-family: var(--font-stack);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-delete-btn:hover {
  background: rgba(255, 59, 48, 0.05);
}

.modal-delete-btn:active {
  background: rgba(255, 59, 48, 0.1);
}

.mobile-user-initials {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mobile-user-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-user-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: var(--ios-bg3, rgba(120, 120, 128, 0.12));
  color: var(--ios-text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.mobile-user-choice:active {
  opacity: 0.75;
}

.mobile-user-choice-name {
  font-weight: 600;
}

.mobile-user-choice-role {
  font-size: 13px;
  color: var(--ios-text-secondary, #8e8e93);
}

.mobile-notif-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(28, 28, 30, 0.92);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.mobile-notif-banner:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.mobile-notif-banner.hidden { display: none; }

.mobile-notif-banner strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.mobile-notif-banner span {
  display: block;
  font-size: 13px;
  opacity: 0.9;
}

.mobile-push-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.mobile-push-status.hidden { display: none; }

.mobile-push-status.ok {
  background: rgba(52, 199, 89, 0.15);
  color: #248a3d;
}

.mobile-push-status.warn {
  background: rgba(255, 149, 0, 0.15);
  color: #c93400;
}

body.dark-theme .mobile-push-status.ok { color: #30d158; }
body.dark-theme .mobile-push-status.warn { color: #ff9f0a; }

.mobile-push-enable-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: #007aff;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.mobile-push-enable-btn.hidden { display: none; }

.mobile-push-enable-btn:active { opacity: 0.85; }

.modal-nav-spacer {
  visibility: hidden;
  pointer-events: none;
}

/* Utilitaire global — requis pour les panneaux auth (login vs compte) */
.hidden {
  display: none !important;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ios-text-secondary, #8e8e93);
}

.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: var(--ios-bg3, rgba(120, 120, 128, 0.12));
  color: var(--ios-text);
  font: inherit;
  font-size: 16px; /* iOS : évite le zoom auto sur focus */
  box-sizing: border-box;
}

.auth-field input:focus {
  outline: 2px solid rgba(0, 122, 255, 0.35);
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ios-text);
  cursor: pointer;
  user-select: none;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: #007aff;
  flex-shrink: 0;
}

.auth-primary-btn {
  width: 100%;
  margin-top: 2px;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: #007aff;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.auth-primary-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.auth-primary-btn:active:not(:disabled) {
  opacity: 0.85;
}

.auth-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 59, 48, 0.12);
  color: #d70015;
  font-size: 12px;
  line-height: 1.35;
}

.auth-error.hidden { display: none !important; }

body.dark-theme .auth-error { color: #ff6961; }

.auth-account-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #007aff;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.auth-account-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ios-text);
}

.auth-account-role {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ios-text-secondary, #8e8e93);
}

.auth-account-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ios-bg3, rgba(120, 120, 128, 0.12));
}

.auth-account-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.auth-account-meta dt {
  margin: 0;
  color: var(--ios-text-secondary, #8e8e93);
}

.auth-account-meta dd {
  margin: 0;
  color: var(--ios-text);
  font-weight: 560;
  text-align: right;
}

.auth-must-change {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 149, 0, 0.15);
  color: #c93400;
  font-size: 12px;
  line-height: 1.35;
}

.auth-must-change.hidden { display: none !important; }

body.dark-theme .auth-must-change { color: #ff9f0a; }

.auth-password-details {
  margin: 8px 0;
  border-radius: 10px;
  background: var(--ios-bg3, rgba(120, 120, 128, 0.08));
  padding: 2px 10px 10px;
}

.auth-password-details summary {
  cursor: pointer;
  padding: 10px 2px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ios-text);
  list-style: none;
}

.auth-password-details summary::-webkit-details-marker { display: none; }

.auth-logout-btn {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 59, 48, 0.12);
  color: #d70015;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.auth-logout-btn:active { opacity: 0.85; }

body.dark-theme .auth-logout-btn { color: #ff6961; }

#mobile-user-modal.auth-modal-blocking {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#mobile-user-modal .modal-hint {
  font-size: 13px;
  line-height: 1.35;
  margin: 0 0 12px;
}

#mobile-user-modal .mobile-user-sheet {
  max-height: min(92dvh, 720px);
}

#mobile-user-modal .ios-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(92dvh - 56px);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
  #mobile-user-modal.auth-modal-blocking {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
    background: rgba(0, 0, 0, 0.45);
  }

  #mobile-user-modal.auth-modal-blocking .mobile-user-sheet {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    max-width: none;
    max-height: min(88dvh, 640px);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
  }

  #mobile-user-modal.auth-modal-account .mobile-user-sheet {
    max-height: min(92dvh, 720px);
  }

  #mobile-user-modal .ios-modal-body {
    max-height: calc(88dvh - 52px - env(safe-area-inset-bottom, 0px));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  #mobile-user-modal .ios-modal-header {
    min-height: 48px;
    padding: 8px 12px;
  }

  #mobile-user-modal .ios-modal-title {
    font-size: 16px;
  }
}

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 9000;
  width: 100%;
  box-sizing: border-box;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: rgba(255, 149, 0, 0.92);
  color: #1c1c1e;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  transform-origin: top center;
  opacity: 0;
  transform: translateY(-8px);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    max-height 0.35s ease,
    padding 0.35s ease;
}

.offline-banner.offline-banner-visible {
  opacity: 1;
  transform: translateY(0);
  /* Assez haut pour safe-area iPhone + 2 lignes de texte */
  max-height: 220px;
  pointer-events: auto;
}

.offline-banner.offline-banner-collapsing {
  opacity: 0;
  transform: translateY(-12px) scaleY(0.35);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.offline-banner.hidden {
  display: none !important;
}

body.dark-theme .offline-banner {
  background: rgba(255, 159, 10, 0.95);
  color: #1c1c1e;
}

.offline-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 149, 0, 0.85);
  box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.35);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  -webkit-tap-highlight-color: transparent;
}

.offline-dot.offline-dot-visible {
  opacity: 1;
  transform: scale(1);
  animation: offline-dot-pulse 2.4s ease-in-out infinite;
}

.offline-dot.hidden {
  display: none !important;
}

.offline-dot:active {
  transform: scale(0.85);
}

@keyframes offline-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(255, 149, 0, 0); }
}

/* Stats modal — overrides late (battre .ios-modal-sheet max-width:440px) */
#stats-modal.ios-modal-overlay {
  padding: 5vh 5vw !important;
  align-items: center !important;
  justify-content: center !important;
}

#stats-modal .stats-sheet {
  width: min(90vw, 1400px) !important;
  max-width: min(90vw, 1400px) !important;
  height: 90vh !important;
  max-height: 90vh !important;
  position: relative !important;
  inset: auto !important;
  border-radius: 16px !important;
}

@media (max-width: 700px) {
  #stats-modal.ios-modal-overlay {
    padding: 0 !important;
  }
  #stats-modal .stats-sheet {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
  }
}

body.dark-theme .offline-dot {
  background: rgba(255, 159, 10, 0.9);
}

html.app-offline .chat-footer {
  opacity: 0.72;
}


