/* ===========================================================
   Reverse Webphone — Web3 sobre · Poppins + Syne
   Glassmorphism doux, glow discret, palette feutrée
   =========================================================== */

:root {
  --bg-0: #07080f;
  --bg-1: #0c0e1a;
  --bg-2: #131628;
  --text: #f3f4f8;
  --muted: rgba(243, 244, 248, 0.62);
  --muted-2: rgba(243, 244, 248, 0.42);

  --accent: #7aa6ff;        /* bleu doux */
  --accent-2: #9b8ce8;      /* violet doux */
  --accent-3: #d292ff;      /* lavande pastel */
  --mint: #7ce0b6;
  --danger: #ef6f8a;

  --grad-primary: linear-gradient(135deg, #7aa6ff 0%, #9b8ce8 100%);
  --grad-call: linear-gradient(135deg, #7ce0b6 0%, #6cc1d9 100%);
  --grad-hangup: linear-gradient(135deg, #ef6f8a 0%, #d292ff 100%);

  --glass-bg: rgba(15, 18, 34, 0.62);
  --glass-bg-strong: rgba(15, 18, 34, 0.82);
  --glass-border: rgba(140, 160, 210, 0.16);
  --glass-border-bright: rgba(140, 160, 210, 0.32);

  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;

  --shadow-soft: 0 6px 24px rgba(0, 0, 0, 0.32);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --font-display: "Syne", "Poppins", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* L'attribut hidden doit gagner sur display:flex des panneaux */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 0% 0%, rgba(122, 166, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 45% at 100% 0%, rgba(155, 140, 232, 0.10), transparent 60%),
    radial-gradient(ellipse 90% 50% at 50% 100%, rgba(210, 146, 255, 0.06), transparent 65%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Décorations background : grille + halos doux ---- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: linear-gradient(rgba(140, 160, 210, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 160, 210, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, black 5%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, black 5%, transparent 75%);
  pointer-events: none;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  will-change: opacity;
}

.glow-1 {
  top: -200px;
  left: -180px;
  width: 480px;
  height: 480px;
  background: var(--accent);
  opacity: 0.18;
}

.glow-2 {
  bottom: -220px;
  right: -180px;
  width: 520px;
  height: 520px;
  background: var(--accent-2);
  opacity: 0.18;
}

.glow-3 {
  top: 45%;
  right: -200px;
  width: 360px;
  height: 360px;
  background: var(--accent-3);
  opacity: 0.10;
}

/* ---- Coque ---- */

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 30rem);
  margin: 0 auto;
  padding: clamp(14px, 3.6vw, 28px) clamp(14px, 4vw, 24px) max(20px, env(safe-area-inset-bottom, 20px));
}

@media (min-width: 720px) {
  .shell {
    width: min(100%, 32rem);
    padding-top: clamp(28px, 5vw, 56px);
  }
}

/* ---- Verre / cartes ---- */

.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(22px) saturate(1.1);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  overflow: hidden;
}

.glass-inner {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(140, 160, 210, 0.08);
  border-radius: var(--radius-sm);
  padding: clamp(11px, 3vw, 16px);
  margin-bottom: clamp(12px, 3vw, 18px);
}

/* ---- Telegram banner ---- */

.tg-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: clamp(10px, 2.6vw, 14px);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(122, 166, 255, 0.08), rgba(155, 140, 232, 0.08));
  border: 1px solid rgba(140, 160, 210, 0.22);
  animation: bannerIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  overflow: hidden;
}

.tg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tg-info { min-width: 0; flex: 1; }

.tg-hello {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
}

.tg-name {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(122, 166, 255, 0.10);
  border: 1px solid rgba(140, 160, 210, 0.22);
  color: var(--accent);
  flex-shrink: 0;
}

.tg-badge svg { width: 12px; height: 12px; }

/* ---- Header / brand ---- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.brand-text { position: relative; min-width: 0; }

.brand-kicker {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 1.75rem);
  letter-spacing: 0.02em;
  margin: 2px 0 0;
  color: var(--text);
}

.brand-circuit {
  margin-top: 6px;
  height: 1px;
  width: min(180px, 100%);
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(140, 160, 210, 0.5) 30%,
    rgba(140, 160, 210, 0.5) 70%,
    transparent
  );
}

/* ---- Status & reconnect ---- */

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: clamp(0.72rem, 2.6vw, 0.78rem);
  font-weight: 500;
  background: rgba(15, 18, 34, 0.55);
  border: 1px solid rgba(140, 160, 210, 0.16);
  backdrop-filter: blur(8px);
  max-width: min(16rem, 55vw);
  transition: border-color 0.25s, color 0.25s;
}

.status-pill #statusText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.25s;
}

.status-pill[data-state="registered"] {
  border-color: rgba(124, 224, 182, 0.35);
}

.status-pill[data-state="registered"] .status-dot {
  background: var(--mint);
  animation: pulseDot 1.8s ease-in-out infinite;
}

.status-pill[data-state="calling"] .status-dot,
.status-pill[data-state="incall"] .status-dot {
  background: var(--accent);
  animation: pulseDot 1.1s ease-in-out infinite;
}

.status-pill[data-state="error"] {
  border-color: rgba(239, 111, 138, 0.35);
}

.status-pill[data-state="error"] .status-dot {
  background: var(--danger);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.reconnect-btn {
  padding: 8px 12px;
  min-width: 42px;
  font-size: 1rem;
  background: rgba(15, 18, 34, 0.55);
  border: 1px solid rgba(140, 160, 210, 0.22);
  border-radius: var(--radius-xs);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  backdrop-filter: blur(6px);
}

.reconnect-btn:hover {
  background: rgba(122, 166, 255, 0.10);
  border-color: rgba(140, 160, 210, 0.45);
}

.reconnect-btn:active { transform: scale(0.94) rotate(180deg); }

.account-line {
  margin: 0 0 16px;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-weight: 400;
}

.account-line strong {
  color: var(--accent);
  font-weight: 600;
}

/* ---- Panel ---- */

.panel {
  padding: clamp(16px, 4.4vw, 24px);
  margin-bottom: 12px;
}

.dial-panel {
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s, filter 0.3s;
}

/* ---- Display (numéro composé) ---- */

.display-wrap { position: relative; margin-bottom: clamp(12px, 3vw, 16px); }

.dial-display {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 5.5vw, 2rem);
  letter-spacing: 0.04em;
  text-align: center;
  padding: clamp(16px, 4vw, 22px) clamp(14px, 3vw, 18px);
  min-height: 3.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(140, 160, 210, 0.18);
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  outline: none;
  caret-color: var(--accent);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dial-display::placeholder {
  color: var(--muted-2);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.dial-display:focus {
  border-color: rgba(140, 160, 210, 0.45);
  box-shadow: 0 0 0 3px rgba(122, 166, 255, 0.12);
}

/* ---- + et 00 ---- */

.dial-extras {
  display: flex;
  gap: 10px;
  margin-bottom: clamp(10px, 2.4vw, 14px);
  justify-content: center;
}

.dial-extras .key-small {
  flex: 1;
  max-width: 130px;
  padding: 9px 10px;
  font-size: 1rem;
  min-height: 2.6rem;
  touch-action: manipulation;
}

/* ---- Media toolbar ---- */

.media-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: clamp(8px, 2.5vw, 12px);
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field span {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: var(--muted-2);
}

.field.compact { margin-bottom: 0; }

.field input,
.select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(140, 160, 210, 0.16);
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.85rem, 3vw, 0.92rem);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237aa6ff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field input:focus,
.select:focus {
  border-color: rgba(140, 160, 210, 0.5);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(122, 166, 255, 0.10);
}

/* ---- Boutons génériques ---- */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, filter 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(0.4);
}

.btn:not(:disabled):active { transform: scale(0.97); }

.btn.icon-only {
  padding: 10px 14px;
  min-width: 46px;
  align-self: flex-end;
  font-size: 1.05rem;
  background: rgba(15, 18, 34, 0.55);
  border-color: rgba(140, 160, 210, 0.18);
  color: var(--accent);
}

.btn.icon-only:hover {
  background: rgba(122, 166, 255, 0.10);
  border-color: rgba(140, 160, 210, 0.4);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(140, 160, 210, 0.16);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(140, 160, 210, 0.10);
  border-color: rgba(140, 160, 210, 0.36);
}

.btn.square { min-width: 52px; }

/* ---- Clavier numérique ---- */

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.8vw, 12px);
  margin-bottom: clamp(12px, 2.6vw, 16px);
}

.key {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.8vw + 0.2rem, 1.3rem);
  padding: clamp(13px, 2.4vw, 16px) 10px;
  min-height: 3rem;
  touch-action: manipulation;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(140, 160, 210, 0.12);
  background: linear-gradient(180deg, rgba(140, 160, 210, 0.06), rgba(15, 18, 34, 0.4));
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
  user-select: none;
}

.key:hover {
  border-color: rgba(140, 160, 210, 0.36);
  background: linear-gradient(180deg, rgba(140, 160, 210, 0.10), rgba(15, 18, 34, 0.5));
}

.key:active {
  transform: scale(0.95);
  border-color: rgba(155, 140, 232, 0.5);
  background: linear-gradient(180deg, rgba(155, 140, 232, 0.12), rgba(15, 18, 34, 0.5));
}

.key.key-small {
  font-size: 1rem;
  padding: 9px 10px;
}

/* ---- Barre d'appel ---- */

.call-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: clamp(8px, 2.2vw, 12px);
  margin-top: clamp(8px, 2vw, 12px);
}

.btn.call-primary {
  flex: 1 1 8.5rem;
  min-height: 50px;
  background: var(--grad-call);
  border: none;
  color: #07120e;
  font-weight: 700;
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  letter-spacing: 0.04em;
}

.btn.call-primary:not(:disabled):hover {
  filter: brightness(1.06);
}

.btn.call-red {
  flex: 1 1 8.5rem;
  min-height: 50px;
  background: var(--grad-hangup);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  letter-spacing: 0.04em;
}

.btn.call-red:not(:disabled):hover { filter: brightness(1.06); }

.call-bar .btn.ghost.square {
  flex: 0 0 auto;
  min-width: 50px;
  min-height: 50px;
}

/* ===========================================================
   Call View (overlay pendant un appel)
   =========================================================== */

.call-view {
  padding: clamp(18px, 4.4vw, 26px);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vw, 18px);
  animation: panelIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.call-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.call-direction {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.call-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(15, 18, 34, 0.55);
  border: 1px solid rgba(140, 160, 210, 0.22);
  color: var(--accent);
  transition: color 0.2s, border-color 0.2s;
}

.call-state-pill[data-state="ringing"] {
  color: var(--accent);
  border-color: rgba(122, 166, 255, 0.4);
}

.call-state-pill[data-state="incall"] {
  color: var(--mint);
  border-color: rgba(124, 224, 182, 0.4);
}

.call-state-pill[data-state="held"] {
  color: var(--accent-3);
  border-color: rgba(210, 146, 255, 0.4);
}

.call-state-pill[data-state="error"],
.call-state-pill[data-state="ended"] {
  color: var(--danger);
  border-color: rgba(239, 111, 138, 0.4);
}

.pulse-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}

.pulse-ring::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0;
  animation: pulseRing 1.6s ease-out infinite;
}

@keyframes pulseRing {
  0% { opacity: 0.5; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.6); }
}

.call-state-pill[data-state="incall"] .pulse-ring::after,
.call-state-pill[data-state="held"] .pulse-ring::after {
  animation: none;
  opacity: 0;
}

/* ---- Centre : avatar + numéro + timer ---- */

.call-target {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.call-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.95);
  position: relative;
  margin-bottom: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.call-avatar svg { width: 34px; height: 34px; }

.call-avatar::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(140, 160, 210, 0.4);
  animation: avatarRing 2.2s ease-out infinite;
  pointer-events: none;
  opacity: 0;
}

.call-view[data-state="ringing-out"] .call-avatar::before,
.call-view[data-state="ringing-in"] .call-avatar::before {
  animation: avatarRing 2s ease-out infinite;
  opacity: 1;
}

.call-view[data-state="held"] .call-avatar { filter: grayscale(0.6) brightness(0.7); }

@keyframes avatarRing {
  0% { inset: -3px; opacity: 0.5; }
  100% { inset: -18px; opacity: 0; }
}

.call-number {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 4.8vw, 1.55rem);
  letter-spacing: 0.04em;
  color: var(--text);
  word-break: break-all;
}

.call-timer {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
  min-height: 1.5em;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.call-view[data-state="incall"] .call-timer,
.call-view[data-state="held"] .call-timer { opacity: 1; }

/* ---- Contrôles (mute/hold/dtmf) ---- */

.call-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2.4vw, 14px);
}

.ctl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(140, 160, 210, 0.16);
  background: rgba(15, 18, 34, 0.5);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s, color 0.2s;
}

.ctl-btn:disabled { opacity: 0.32; cursor: not-allowed; }

.ctl-btn:not(:disabled):hover {
  background: rgba(122, 166, 255, 0.08);
  border-color: rgba(140, 160, 210, 0.4);
}

.ctl-btn:not(:disabled):active { transform: scale(0.96); }

.ctl-btn[data-toggle="on"] {
  background: linear-gradient(135deg, rgba(210, 146, 255, 0.12), rgba(155, 140, 232, 0.12));
  border-color: rgba(210, 146, 255, 0.4);
  color: var(--accent-3);
}

.ctl-icon { width: 28px; height: 28px; display: grid; place-items: center; }
.ctl-icon svg { width: 24px; height: 24px; }

.ctl-icon-inline {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
}

/* ---- Mini DTMF pad ---- */

.dtmf-pad-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(140, 160, 210, 0.14);
  animation: dtmfIn 0.25s ease-out;
}

@keyframes dtmfIn {
  from { opacity: 0; transform: scaleY(0.92); transform-origin: top; }
  to { opacity: 1; transform: scaleY(1); }
}

.dtmf-help {
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  font-weight: 500;
}

.dtmf-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dtmf-key { min-height: 2.6rem; font-size: 1.05rem; }

.dtmf-close { margin-top: 4px; }

/* ---- Bottom : décrocher / raccrocher ---- */

.call-bottom {
  display: flex;
  gap: clamp(10px, 2.6vw, 14px);
  margin-top: 4px;
}

.call-end {
  flex: 1;
  min-height: 56px;
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  font-weight: 700;
}

/* ---- Footer / signature ---- */

.footer-tag {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--font-display);
  font-weight: 500;
}

.footer-tag .dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(140, 160, 210, 0.5);
  margin: 0 8px;
  vertical-align: middle;
}

/* ---- Audio invisible ---- */

#remoteAudio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---- Accessibilité ---- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Responsive : très petits écrans ---- */

@media (max-width: 380px) {
  .brand-circuit { width: min(160px, 100%); }
  .dial-extras .key-small { max-width: none; }
  .media-row { grid-template-columns: 1fr; }
  .btn.icon-only { width: 100%; align-self: stretch; min-height: 44px; }
  .tg-badge { display: none; }
}

/* ---- Responsive : tablette/desktop ---- */

@media (min-width: 720px) {
  .brand-title { font-size: 1.85rem; }
  .key { font-size: 1.3rem; min-height: 3.4rem; }
  .dial-display { font-size: 2.1rem; }
}
