/* MCX Core (labo) — client de test */
@font-face { font-family: Plex; src: url(/fonts/plex-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Plex; src: url(/fonts/plex-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Plex; src: url(/fonts/plex-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
:root {
  --bg: #0f1214; --panel: #171b1e; --panel-2: #1e2327; --line: #2a3135; --text: #e8ecea; --muted: #9aa4a0; --faint: #6d7773;
  --idle: #4a5450; --rx: #2f8fd8; --tx: #e5484d; --queue: #e0a93b; --ok: #2fa86b; --sos: #ff453a;
  --r: 12px; --f: Plex, 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--f); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--queue); outline-offset: 2px; }
.app { min-height: 100dvh; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }

.login { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--tx); stroke-width: 2; stroke-linecap: round; }
.brand em { font-style: normal; font-size: 12px; color: var(--queue); border: 1px solid var(--queue); border-radius: 10px; padding: 0 7px; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }
.btn { height: 46px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { background: var(--tx); border-color: var(--tx); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

.main { display: flex; flex-direction: column; min-height: 100dvh; padding: env(safe-area-inset-top) 0 0; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; color: var(--faint); font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--queue); box-shadow: 0 0 0 3px rgba(224,169,59,.2); }
.dot.is-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(47,168,107,.2); }
.dot.is-ko { background: var(--tx); box-shadow: 0 0 0 3px rgba(229,72,77,.2); }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.status-line { padding: 0 14px 8px 34px; font-size: 12px; color: var(--faint); }

.available { margin: 4px 14px 8px; padding: 10px 12px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.available.is-sos { border-color: var(--sos); }

.call-card { margin: 4px 14px 10px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.call-card.is-sos { border: 2px solid var(--sos); }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cc-k { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cc-t { font-size: 18px; font-weight: 600; margin-top: 2px; }
.badge { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.badge.sos { color: #fff; background: var(--sos); border-color: var(--sos); }
.floor { margin: 12px 0 10px; padding: 12px; border-radius: 12px; background: var(--panel-2); display: flex; align-items: center; gap: 12px; border-left: 5px solid var(--idle); }
.floor b { display: block; font-size: 16px; }
.floor small { color: var(--muted); }
.floor.rx { border-left-color: var(--rx); } .floor.tx { border-left-color: var(--tx); } .floor.queue { border-left-color: var(--queue); } .floor.duplex { border-left-color: var(--ok); }
.floor .meter { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 18px; }
.members { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.members li { font-size: 13px; padding: 3px 10px; border-radius: 14px; background: var(--panel-2); color: var(--muted); }
.members li.is-talk { background: var(--rx); color: #fff; } .members li.is-me.is-talk { background: var(--tx); }
.members li.is-off { opacity: .5; }
.cc-actions { display: flex; gap: 8px; margin-top: 12px; }
.cc-actions .btn { flex: 1; }

.tabs { display: flex; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; height: 42px; border: 0; background: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tab.is-on { color: var(--text); border-bottom-color: var(--text); }
.list { list-style: none; margin: 0; padding: 6px 14px 220px; display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.item.is-sel { border-color: var(--text); }
.item .grow { flex: 1; min-width: 0; }
.item b { display: block; font-weight: 600; }
.item small { color: var(--muted); font-size: 12.5px; }
.item .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pres { width: 9px; height: 9px; border-radius: 50%; background: var(--idle); flex: none; }
.pres.on { background: var(--ok); } .pres.busy { background: var(--queue); }
.sw { position: relative; width: 42px; height: 24px; flex: none; }
.sw input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw span { position: absolute; inset: 0; border-radius: 12px; background: var(--idle); transition: background .15s; pointer-events: none; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw input:checked + span { background: var(--ok); }
.sw input:checked + span::after { transform: translateX(18px); }
.log li { font-size: 13px; color: var(--muted); padding: 4px 2px; border-bottom: 1px solid var(--line); }
.log time { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 8px; }

.ptt-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(15,18,20,0), var(--bg) 26%); display: grid; justify-items: center; gap: 8px; }
.ptt-target { font-size: 13px; color: var(--muted); }
.ptt { position: relative; width: 168px; height: 168px; border-radius: 50%; border: 0; background: var(--idle); color: #fff; display: grid; place-content: center; text-align: center; gap: 2px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 8px 30px rgba(0,0,0,.45); transition: background-color .12s, transform .08s; }
.ptt:active { transform: scale(.97); }
.ptt-label { font-weight: 600; font-size: 16px; max-width: 130px; line-height: 1.25; }
.ptt-sub { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.ptt-ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; }
.ptt.rx { background: var(--rx); } .ptt.tx { background: var(--tx); } .ptt.tx .ptt-ring { border-color: rgba(229,72,77,.45); }
.ptt.queue { background: var(--queue); color: #1c1407; } .ptt.wait { background: #5d6762; }
.ptt.sos { box-shadow: 0 0 0 4px var(--sos), 0 8px 30px rgba(0,0,0,.45); }
.ptt:disabled { opacity: .45; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 20px; z-index: 20; }
.modal-card { width: min(360px, 100%); padding: 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.modal-card h2 { margin: 6px 0 18px; font-size: 22px; }
.modal-k { margin: 0; color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; } .row .btn { flex: 1; }
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 30; max-width: 92vw; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 500; font-size: 14px; }

@media (min-width: 900px) {
  .main { max-width: 560px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .ptt-bar { max-width: 560px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
