/* Turnstile ("portique", module gate): the counter's top-bar pill and popover, the refusal cards, the reason dialog,
   the owner's Entrées log and Réglages › Portique. Tokens only (DESIGN.md); the pill is the crowd pill's sibling. */

/* ---- counter: pill + popover ---- */
.gt-pillbox{position:relative;display:inline-flex}
.gt-pill{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 14px;border-radius:999px;border:1.5px solid var(--text);background:var(--panel);color:var(--text);
  font:inherit;font-size:calc(14px*var(--k));font-weight:600;white-space:nowrap;flex:none;cursor:pointer}
.gt-pill .ic{width:18px;height:18px;color:var(--accent-2)}
.gt-pill[aria-expanded="true"]{box-shadow:0 0 0 3px rgba(47,80,255,.22)}
.gt-pill:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.gt-pill .cnt{margin-inline-start:2px}
.gt-pop{position:absolute;top:calc(100% + 10px);inset-inline-end:0;z-index:40;width:min(420px,calc(100vw - 32px));background:var(--panel);color:var(--text);border-radius:10px;
  box-shadow:0 0 0 1px var(--line-2),0 30px 50px -24px rgba(11,21,48,.55);padding:16px 18px 14px;display:grid;gap:10px;white-space:normal;font-size:calc(14px*var(--k));text-align:start}
.gt-pop[hidden]{display:none}
.gt-pop-h{display:flex;align-items:center;gap:10px}
.gt-pop-h .tag{margin-inline-start:auto}
.gt-feed{max-height:min(46vh,400px);overflow:auto;margin:0;padding:0}
.gt-feed .r,.gt-log .r{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:44px;padding:6px 0}
.gt-dir{width:18px;height:18px;color:var(--muted)}
/* An exit is the entry arrow leaving: mirrored, and the row reads quieter. */
.gt-dir.out{transform:scaleX(-1)}
[dir="rtl"] .gt-dir.in{transform:scaleX(-1)}
[dir="rtl"] .gt-dir.out{transform:none}
.gt-log .is-out .gt-who a,.gt-log .is-out .gt-who b,.gt-feed .gt-ev:not(.is-refused) .gt-dir.out+.sr-only+.gt-who{color:var(--text-2)}
.gt-log .is-out .gt-who a{font-weight:500;text-decoration-color:var(--line-2)}
.gt-lim{justify-self:end}
.gt-ev.is-refused .gt-dir{color:var(--bad)}
.gt-who{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gt-who .num{color:var(--text-2);margin-inline-start:4px}
.gt-feed .v,.gt-log .v{display:inline-flex;align-items:center;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.gt-hm{color:var(--text-2);min-width:3.2em;text-align:end}
.gt-empty{grid-template-columns:1fr !important;color:var(--muted)}
.gt-acts{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.gt-all{margin-inline-start:auto}
.gt-say{font-size:calc(13.5px*var(--k));font-weight:600;color:var(--text-2);min-height:20px}
.gt-say.bad{color:var(--bad)}
.gt-say.warn{color:var(--warn)}

/* ---- counter: refusal cards (bottom of the screen) ---- */
.gt-cards{position:fixed;inset-inline-start:16px;bottom:16px;z-index:60;display:grid;gap:10px;width:min(400px,calc(100vw - 32px));pointer-events:none}
.gt-card{pointer-events:auto;display:grid;grid-template-columns:52px minmax(0,1fr);gap:12px;align-items:start;padding:14px 14px 12px;border-radius:12px;background:var(--panel);color:var(--text);
  box-shadow:0 0 0 1px var(--line-2),0 22px 40px -18px rgba(11,21,48,.55);border-inline-start:4px solid var(--bad);animation:gt-in .2s var(--ease-out,ease-out)}
.gt-av{width:52px;height:52px;font-size:20px}
.gt-av img{width:100%;height:100%;object-fit:cover;border-radius:inherit}
.gt-cb{display:grid;gap:6px;min-width:0}
.gt-ch{display:flex;align-items:baseline;gap:8px;min-width:0}
.gt-ch b{font-size:calc(17px*var(--k));font-weight:650;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gt-ch .num{color:var(--text-2);font-variant-numeric:tabular-nums}
.gt-cacts{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.gt-cacts form{margin:0}
.gt-x{margin-inline-start:auto}
.gt-card .gt-say{grid-column:1/-1}
@keyframes gt-in{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.gt-card{animation:none}}

/* ---- reason dialog ---- */
.gt-why-f{gap:14px;width:min(520px,calc(100vw - 32px))}
.gt-why-f .ivs .ic{width:18px;height:18px;color:var(--accent-2)}
.gt-reasons .chip{cursor:pointer;min-height:44px;height:auto;position:relative}
.gt-reasons .chip input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.gt-reasons .chip:has(input:checked){background:var(--text);color:var(--page);border-color:var(--text)}
.gt-reasons .chip:has(input:focus-visible){outline:3px solid var(--focus);outline-offset:2px}

/* ---- counter: the RFID panel's "last unknown badge" ---- */
.gt-assign{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px 12px;border-radius:9px;background:var(--sunken);margin:0 0 12px}
.gt-assign .btn{margin-inline-start:auto}

/* ---- owner: Entrées ---- */
.gt-day{display:inline-flex;align-items:center;gap:6px}
.gt-day .input{width:auto;min-width:0}
.gt-stats{margin:4px 0 18px}
.gt-log{margin:0;padding:0}
.gt-log .r{grid-template-columns:3.4em 22px minmax(0,1fr) auto;border-bottom:1px solid var(--line)}
.gt-log .gt-t{font-variant-numeric:tabular-nums;color:var(--text-2);font-weight:600}
.gt-log .gt-who a{font-weight:650}
.gt-gates{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.gt-more{margin:16px 0 0}

/* ---- Réglages › Portique ---- */
.gt-setgrid{display:grid;gap:8px;max-width:880px}
.gt-glist .r{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;align-items:center}
.gt-glist .ivs{grid-column:1/-1}
.gt-staff .r{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px;align-items:center}
.gt-staff form{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0}
.gt-staff .input{width:170px}
.gt-keybox .mb-path{margin:4px 0}
.gt-rules-fixed{display:flex;flex-wrap:wrap;gap:8px}
.gt-dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;align-items:end}

@media (max-width:720px){
  .gt-pill .w{display:none}
  .gt-log .r{grid-template-columns:3.2em 18px minmax(0,1fr);row-gap:2px}
  .gt-log .v{grid-column:2/-1;justify-content:flex-start}
  .gt-staff .r{grid-template-columns:minmax(0,1fr)}
  .gt-staff .input{width:100%}
}

/* ---- counter: the idle counter's turnstile row (gate-pill.ejs) ---- */
.gt-row{position:relative}
.gt-rowv{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
.gt-row .gt-pill{height:40px;padding:0 12px;border-width:1px;border-color:var(--line-2);font-size:calc(13.5px*var(--k))}
.gt-row .gt-pill>.ic{width:14px;height:14px;color:var(--muted)}
.gt-rowv>.gt-say{flex-basis:100%;text-align:end}
.btn .gt-dir,.gt-why-f .gt-dir{color:inherit;width:18px;height:18px}
