:root {
  color-scheme: dark;
  --fond: #0f1115; --carte: #171a21; --bord: #262b36;
  --texte: #e7e9ee; --doux: #9aa3b2;
  --attente: #f59e0b; --tenue: #4ade80; --alerte: #f87171;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
header, main, footer { max-width: 46rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.35rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
     color: var(--doux); margin: 1.6rem 0 .6rem; font-weight: 600; }
.count { color: var(--attente); }
.sync { margin: .35rem 0 0; font-size: .8rem; color: var(--doux); }
.sync.stale { color: var(--alerte); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.row {
  background: var(--carte); border: 1px solid var(--bord); border-radius: .7rem;
  padding: .8rem .9rem; display: grid; gap: .3rem; width: 100%;
  text-align: left; color: inherit; font: inherit; cursor: pointer;
}
.row:hover, .row:focus-visible { border-color: #3a4152; outline: none; }
.row.waiting { border-left: 3px solid var(--attente); }
.row.held { border-left: 3px solid var(--tenue); }
.alias { font-weight: 600; font-variant-numeric: tabular-nums; }
.meta { display: flex; gap: .85rem; flex-wrap: wrap;
        font-size: .82rem; color: var(--doux); font-variant-numeric: tabular-nums; }
.empty { color: var(--doux); text-align: center; padding: 2.5rem 1rem; }
dialog { border: 1px solid var(--bord); border-radius: .8rem; background: var(--carte);
         color: var(--texte); max-width: 34rem; width: calc(100% - 2rem); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.65); }
dialog article { padding: 1rem 1.1rem 1.2rem; }
.detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.detail-head h2 { margin: 0; font-size: 1.05rem; text-transform: none;
                  letter-spacing: 0; color: var(--texte); }
#d-close { background: none; border: 1px solid var(--bord); color: var(--doux);
           border-radius: .4rem; padding: .3rem .6rem; cursor: pointer; font: inherit; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem;
     margin: 1rem 0; font-size: .9rem; }
dt { color: var(--doux); }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.notice { font-size: .84rem; color: var(--doux); border-top: 1px solid var(--bord);
          padding-top: .8rem; margin: .8rem 0 0; }
.readonly { color: var(--attente); }
footer { color: var(--doux); font-size: .78rem; }

.fil { max-height: 46vh; overflow-y: auto; display: grid; gap: .55rem;
       margin: .2rem 0 .4rem; padding-right: .2rem; }
.tour { display: grid; gap: .15rem; padding: .55rem .7rem; border-radius: .55rem;
        background: #12151c; border: 1px solid var(--bord); }
.tour.client { border-left: 3px solid #60a5fa; }
.tour.agent { border-left: 3px solid var(--doux); }
.tour.operator { border-left: 3px solid var(--tenue); }
.qui { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
       color: var(--doux); font-weight: 600; }
.tour p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- actions operateur (Phase 2b) ------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.actions.secondaires { margin-top: 1rem; }
.verdict { display: flex; flex-wrap: wrap; gap: .5rem; width: 100%; }

/* 44 px de haut : la cible tactile minimale confortable sur telephone. */
.actions button, .composer button {
  min-height: 44px; padding: .7rem 1.1rem; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent;
}
button.principal { background: #2f6df6; color: #fff; }
button.secondaire { background: transparent; color: #cdd4e0; border-color: #39415280; }
button.discret {
  background: none; border: none; color: #8a93a5; font-weight: 400;
  text-decoration: underline; padding: .7rem .2rem;
}
.actions button:disabled, .composer button:disabled { opacity: .45; cursor: progress; }
.actions button:focus-visible, .composer :focus-visible {
  outline: 2px solid #7aa2ff; outline-offset: 2px;
}

.composer { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.composer label { font-size: .85rem; color: #8a93a5; }
.composer textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 5.5rem;
  padding: .7rem; border-radius: 10px; border: 1px solid #39415280;
  background: #12151c; color: #e6e9ef;
  /* 16 px exactement : en dessous, iOS zoome de force au focus. */
  font: 400 16px/1.45 inherit;
}
.composer textarea:disabled { opacity: .5; }
.composer-pied { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.compteur { font-size: .8rem; color: #8a93a5; font-variant-numeric: tabular-nums; }

.notice.bandeau {
  border-left: 3px solid #e0a33e; padding-left: .7rem; color: #e9d5ae;
}
.notice.message { color: #cdd4e0; }

@media (max-width: 420px) {
  .actions button, .composer button { flex: 1 1 100%; }
  .composer-pied { flex-wrap: wrap; }
}
