/* Composants propres à Réticule (le reste vient de kit/kit.css). Tokens --kit-* et --rq-* uniquement.
   Le kit est ici resserré en « instrument » : angles de 6 px, filets d'un pixel, données en mono. */

/* ---------- coquille ---------- */
.kit-content { padding: 0; gap: 0; }
.kit-top { border-bottom: 1px solid var(--kit-line); min-height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 8px 0 18px; }
.kit-title { font-size: 21px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.kit-title small { font: 400 13px var(--rq-mono); color: var(--kit-muted); letter-spacing: 0; white-space: nowrap; }
.kit-act { border-radius: 6px; background: none; color: var(--kit-fg); }
.kit-act[data-kit-action="close"] { width: auto; padding: 0 14px; height: 38px; margin-right: 6px; border: 1px solid var(--kit-accent); color: var(--kit-accent); }
.kit-tabs { padding: 0 0 env(safe-area-inset-bottom, 0px); gap: 0; }
.kit-tab { position: relative; min-height: 64px; justify-content: center; gap: 3px; font-size: 14px; font-weight: 400; }
.kit-tab-pill { width: auto; height: auto; border-radius: 0; background: none !important; }
.kit-tab.is-on { font-weight: 500; }
.kit-tab.is-on::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--kit-accent); }
.kit-ic { stroke-width: 1.5; }

.kit-btn { min-height: 48px; font-size: 15px; padding: 0 var(--kit-space-4); gap: 7px; }
.kit-btn .kit-ic { width: 20px; height: 20px; }
.kit-btn-ghost { background: var(--rq-panel-2); color: var(--kit-fg); border: 1px solid var(--kit-line); }
.kit-seg { background: none; border: 1px solid var(--kit-line); border-radius: 6px; padding: 0; overflow: hidden; }
.kit-seg-opt { border-radius: 0; min-height: 44px; font-weight: 500; }
.kit-seg-opt + .kit-seg-opt { border-left: 1px solid var(--kit-line); }
.kit-seg-opt[aria-checked="true"] { background: var(--kit-accent-soft); color: var(--kit-accent); box-shadow: inset 0 -2px 0 var(--kit-accent); }
.kit-toggle { width: 48px; height: 26px; border-radius: 4px; background: var(--kit-bg); border: 1px solid var(--kit-line); }
.kit-toggle::after { top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 2px; background: var(--kit-muted); box-shadow: none; }
.kit-toggle[aria-checked="true"] { background: var(--kit-accent-soft); border-color: var(--kit-accent); }
.kit-toggle[aria-checked="true"]::after { left: 25px; background: var(--kit-accent); }
.kit-sheet { border-radius: 14px 14px 0 0; border-top: 1px solid var(--kit-accent); }
.kit-sheet-grip { height: 3px; }
.kit-toast { font-family: var(--rq-mono); font-size: 14px; border-radius: 6px; }

/* ---------- Réglages ---------- */
.kit-settings { gap: 0; }
.kit-settings .kit-group-title { height: 32px; display: flex; align-items: center; margin: 0; padding: 0 18px; background: var(--rq-panel-2); border-top: 1px solid var(--kit-line); border-bottom: 1px solid var(--kit-line); font: 500 14px var(--rq-mono); color: var(--kit-muted); text-transform: lowercase; }
.kit-settings .kit-rows { border: 0; border-radius: 0; background: none; }
.kit-settings .kit-rows.is-bare { padding: 12px 18px; }
.kit-settings .kit-row { min-height: 54px; padding: 0 18px; border-top: 0; border-bottom: 1px solid var(--kit-line); font-size: 15px; }
.kit-settings .kit-row em { font: 400 15px var(--rq-mono); }
.kit-settings .kit-row .kit-ic { color: var(--kit-muted); }
.kit-settings .kit-note { margin: 10px 18px; font-family: var(--rq-mono); font-size: 13px; }
.rq-hint { display: block; font-size: 13px; color: var(--kit-muted); line-height: 1.25; }

/* ---------- Scanner ---------- */
.rq-scan { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--rq-cam); color: var(--rq-hud); }
.rq-bg, .rq-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rq-bg { background: var(--rq-cam) url(img/scan-cafe.jpg) center / cover no-repeat; }
.rq-scan::before { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--rq-cam-shade); pointer-events: none; }
.rq-scan.is-live::before { background: rgba(10, 16, 26, .42); }
.rq-scan::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(34, 211, 238, .035) 0 1px, transparent 1px 4px); }
.rq-hud, .rq-stage, .rq-zoom, .rq-ctl, .rq-sheet { position: relative; z-index: 3; }
.rq-hud { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px 0; font: 400 13px var(--rq-mono); color: var(--rq-hud); }
.rq-hud span:last-child { color: var(--rq-hud-accent); }
.rq-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 8px 18px; }
.rq-vf { position: relative; width: min(270px, 68vw); aspect-ratio: 1; flex: none; }
.rq-vf i { position: absolute; width: 34px; height: 34px; border: 2px solid var(--rq-hud-accent); }
.rq-vf .a { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.rq-vf .b { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.rq-vf .c { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.rq-vf .d { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.rq-vf .ln { position: absolute; left: 8px; right: 8px; top: 46%; height: 1px; background: var(--rq-hud-accent); box-shadow: 0 0 12px 2px rgba(34, 211, 238, .55); animation: rq-sweep 2.4s ease-in-out infinite alternate; }
.rq-vf .cr { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: .7; background: linear-gradient(var(--rq-hud-accent), var(--rq-hud-accent)) center / 1px 100% no-repeat, linear-gradient(var(--rq-hud-accent), var(--rq-hud-accent)) center / 100% 1px no-repeat; }
.rq-vf .tk { position: absolute; left: -14px; top: 34px; bottom: 34px; width: 8px; background: repeating-linear-gradient(180deg, var(--rq-hud-muted) 0 1px, transparent 1px 15px); }
.rq-vf .tk.r { left: auto; right: -14px; }
@keyframes rq-sweep { from { top: 12%; } to { top: 86%; } }
.rq-state { max-width: 320px; text-align: center; font: 400 15px/1.45 var(--rq-mono); color: var(--rq-hud); }
.rq-state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rq-hud-accent); margin-right: 10px; vertical-align: 1px; }
.rq-state.is-warn::before { background: var(--kit-warn); }
.rq-zoom { margin: 0 18px; display: flex; align-items: center; gap: 12px; font: 400 15px var(--rq-mono); color: var(--rq-hud-muted); }
.rq-zoom input { flex: 1; accent-color: var(--rq-hud-accent); height: 32px; }
.rq-zoom b { color: var(--rq-hud-accent); font-weight: 500; min-width: 3.4em; text-align: right; }
.rq-ctl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin: 12px 18px 16px; }
.rq-ctl .kit-btn { background: rgba(27, 35, 50, .88); color: #E1E8F2; border-color: #34425C; }
.rq-ctl .kit-btn.kit-btn-main { background: var(--rq-hud-accent); color: #04222B; border-color: var(--rq-hud-accent); }
.rq-ctl .kit-btn small { font: 400 13px var(--rq-mono); color: #93A1B9; }
.rq-ctl .kit-btn.is-on { border-color: var(--rq-hud-accent); color: var(--rq-hud-accent); }

/* résultat : même écran, caméra figée sous la feuille */
.rq-scan.is-res .rq-stage { flex: none; justify-content: flex-start; padding-top: 18px; }
.rq-scan.is-res .rq-vf { width: 150px; }
.rq-sheet { margin-top: auto; max-height: 82%; overflow-y: auto; background: var(--rq-panel); color: var(--kit-fg); border-top: 1px solid var(--kit-accent); border-radius: 14px 14px 0 0; padding: 0 16px 16px; }
.rq-grip { display: block; width: 40px; height: 3px; border-radius: 2px; background: var(--kit-line); margin: 8px auto 10px; }
.rq-line1 { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.rq-tag { font: 500 15px var(--rq-mono); color: var(--kit-accent); border: 1px solid var(--kit-accent); border-radius: 4px; padding: 1px 8px; background: var(--kit-accent-soft); }
.rq-line1 .m { flex: 1; color: var(--kit-muted); font: 400 14px var(--rq-mono); }
.rq-x { width: 44px; height: 44px; margin: -4px -8px -4px 0; display: grid; place-items: center; color: var(--kit-muted); }
.rq-pay { margin-top: 10px; background: var(--kit-bg); border: 1px solid var(--kit-line); border-radius: 6px; padding: 11px 12px; font: 400 17px/1.35 var(--rq-mono); overflow-wrap: anywhere; white-space: pre-wrap; max-height: 9.5em; overflow: auto; }
.rq-pay.is-small { font-size: 15px; }
.rq-pay .d { color: var(--kit-muted); }
.rq-pay .h { color: var(--kit-accent); }
.rq-kv { margin-top: 10px; border: 1px solid var(--kit-line); border-radius: 6px; overflow: hidden; }
.rq-kv div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 12px; min-height: 38px; font-size: 15px; }
.rq-kv div + div { border-top: 1px solid var(--kit-line); }
.rq-kv dt { color: var(--kit-muted); flex: none; }
.rq-kv dd { font: 400 15px var(--rq-mono); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.rq-kv dd button { color: var(--kit-accent); margin-left: 10px; border-bottom: 1px solid var(--kit-accent); font: inherit; min-height: 32px; }
.rq-acts { display: grid; gap: 8px; margin-top: 12px; }
.rq-acts.n3 { grid-template-columns: 1.3fr 1fr 1fr; }
.rq-acts.n2 { grid-template-columns: 1.3fr 1fr; }
.rq-acts .kit-btn { width: 100%; padding: 0 6px; }
.rq-acts.wifi { grid-template-columns: 1fr 1fr; }
.rq-acts.wifi .kit-btn-main { grid-column: 1 / -1; }
.rq-acts .kit-btn-danger { background: none; color: var(--kit-danger); border: 1px solid var(--kit-line); }

/* ---------- Historique ---------- */
.rq-search { position: relative; margin: 12px 18px; }
.rq-search .kit-ic { position: absolute; left: 12px; top: 14px; width: 20px; height: 20px; color: var(--kit-muted); pointer-events: none; }
.rq-field { width: 100%; min-height: 48px; border: 1px solid var(--kit-line); border-radius: 6px; background: var(--kit-bg); color: var(--kit-fg); padding: 0 12px; font: 400 15px var(--rq-mono); }
.rq-search .rq-field { padding-left: 40px; }
.rq-field:focus { outline: 0; border-color: var(--kit-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kit-accent) 18%, transparent); }
textarea.rq-field { padding: 12px; min-height: 96px; resize: none; line-height: 1.4; }
.rq-field::placeholder { color: var(--kit-muted); opacity: .8; }
.rq-grp { display: flex; justify-content: space-between; align-items: center; height: 34px; padding: 0 18px; background: var(--rq-panel-2); border-top: 1px solid var(--kit-line); border-bottom: 1px solid var(--kit-line); font: 500 15px var(--rq-mono); }
.rq-grp span { color: var(--kit-muted); font-weight: 400; }
.rq-list { list-style: none; }
.rq-row { display: grid; grid-template-columns: 1fr 48px; align-items: center; min-height: 60px; border-bottom: 1px solid var(--kit-line); }
.rq-row.is-new { background: var(--kit-accent-soft); box-shadow: inset 3px 0 0 var(--kit-accent); }
.rq-open { display: grid; grid-template-columns: 50px 46px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 60px; padding: 0 0 0 18px; text-align: left; width: 100%; }
.rq-open time { font: 400 15px var(--rq-mono); color: var(--kit-muted); }
.rq-open .tg { font: 500 13px var(--rq-mono); color: var(--kit-accent); border: 1px solid var(--kit-line); border-radius: 4px; text-align: center; padding: 2px 0; }
.rq-open b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-open small { display: block; font: 400 14px var(--rq-mono); color: var(--kit-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-del { width: 48px; height: 48px; display: grid; place-items: center; color: var(--kit-muted); }
.rq-del .kit-ic { width: 18px; height: 18px; }
.rq-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 18px 10px; font: 400 14px var(--rq-mono); color: var(--kit-muted); }
.rq-sum button { color: var(--kit-accent); border-bottom: 1px solid var(--kit-accent); min-height: 40px; font: inherit; }
.rq-hist { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.rq-empty { margin: 48px 28px; text-align: center; color: var(--kit-muted); font: 400 15px/1.5 var(--rq-mono); }
.rq-empty .kit-ic { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--kit-accent); stroke-width: 1.3; }

/* ---------- Créer ---------- */
.rq-make { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.rq-pad { padding: 14px 18px 0; }
.rq-lbl { margin: 14px 0 6px; display: flex; justify-content: space-between; gap: 10px; font: 400 14px var(--rq-mono); color: var(--kit-muted); }
.rq-lbl .is-over { color: var(--kit-danger); }
.rq-prev { margin-top: 14px; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 14px; border: 1px solid var(--kit-line); border-radius: 6px; background: var(--rq-panel); padding: 12px; }
.rq-qrw { background: #fff; padding: 6px; width: 176px; height: 176px; display: grid; place-items: center; }
.rq-qr { width: 100%; height: 100%; display: block; color: #0B1220; }
.rq-qrw .rq-none { font: 400 13px/1.4 var(--rq-mono); color: #55637A; text-align: center; padding: 8px; }
.rq-prev dl { display: grid; align-content: space-between; font: 400 14px var(--rq-mono); }
.rq-prev dt { color: var(--kit-muted); }
.rq-prev dd { color: var(--kit-fg); margin-bottom: 2px; font-size: 15px; }
.rq-bt { margin-top: auto; padding: 14px 18px 16px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.rq-bt .kit-btn { width: 100%; }
