/* ==========================================================================
   Token App 2.0 · espace client
   Langage visuel des apps de Quentin (Tilinks, Boîte à outils) : typo système,
   fonds blancs, gris doux, filets légers, callouts, mode sombre automatique.
   ========================================================================== */

:root {
    --accent: #0071e3;
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #fbfbfd;
    --fill: rgba(120, 120, 128, .12);
    --fill-2: rgba(120, 120, 128, .07);
    --line: rgba(60, 60, 67, .12);
    --line-2: rgba(60, 60, 67, .2);
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #a1a1a6;
    --green: #248a3d; --green-bg: rgba(52, 199, 89, .14);
    --orange: #b25000; --orange-bg: rgba(255, 149, 0, .15);
    --red: #d70015; --red-bg: rgba(255, 59, 48, .12);
    --purple: #8944ab; --purple-bg: rgba(175, 82, 222, .13);
    --blue: #0060c7; --blue-bg: rgba(0, 113, 227, .11);
    --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .04);
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px -14px rgba(0, 0, 0, .14);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
    --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
    --r: 16px;
    --ease: cubic-bezier(.2, .9, .25, 1);
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000; --surface: #1c1c1e; --surface-2: #242426;
        --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .14);
        --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .17);
        --text: #f5f5f7; --text-2: #98989d; --text-3: #636366;
        --green: #30d158; --orange: #ff9f0a; --red: #ff6961; --purple: #da8fff; --blue: #4aa3ff;
        --shadow-sm: 0 0 0 .5px rgba(255, 255, 255, .07); --shadow: 0 0 0 .5px rgba(255, 255, 255, .08);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.qtm { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
.qtm a { color: var(--accent); text-decoration: none; }
.qtm a:hover { text-decoration: underline; text-underline-offset: 2px; }
.qtm h1, .qtm h2, .qtm h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
.qtm h1 { font-size: 28px; font-weight: 700; }
.qtm h2 { font-size: 17px; font-weight: 650; }
.qtm h3 { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.qtm p { margin: 0 0 .6em; }
.qtm p:last-child { margin-bottom: 0; }
.qi { flex-shrink: 0; display: block; }
.qmuted { color: var(--text-2); }
.qhint { color: var(--text-2); font-size: 13px; margin: 2px 0 0; }
.qtm [hidden] { display: none !important; }
.qtm :focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.qbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 14.5px var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .15s var(--ease), background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.qbtn:hover { background: var(--surface-2); }
.qbtn:active { transform: scale(.97); }
.qbtn.is-primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.qbtn.is-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.qbtn.is-small { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.qbtn.is-block { width: 100%; }
.qbtn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.qlinkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: 500 13.5px var(--font); display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.qlinkbtn.is-danger { color: var(--red); }
.qicon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--text-2); cursor: pointer; }
.qicon-btn:hover { background: var(--fill-2); color: var(--text); }
.qicon-btn em { position: absolute; top: 2px; right: 2px; font: 700 10px var(--font); font-style: normal; background: var(--accent); color: #fff; border-radius: 8px; padding: 0 4px; }
.qicon-btn em:empty { display: none; }

/* ── Champs ──────────────────────────────────────────────────────────────── */
.qform { display: flex; flex-direction: column; gap: 14px; }
.qfield { display: flex; flex-direction: column; gap: 6px; }
.qfield > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.qfield > span i { font-weight: 400; font-style: normal; color: var(--text-3); }
.qtm input[type=text], .qtm input[type=email], .qtm input[type=password], .qtm input[type=url], .qtm input[type=date], .qtm input[type=number], .qtm select, .qtm textarea {
    width: 100%; font: 15px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 13px; min-height: 44px; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.qtm textarea { resize: vertical; min-height: 44px; line-height: 1.45; }
.qtm select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9l5-5 5 5M7 15l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.qtm input:focus, .qtm select:focus, .qtm textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.qtm ::placeholder { color: var(--text-3); }
.qpass { position: relative; display: block; }
.qpass input { padding-right: 46px; }
.qpass button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; border-radius: 10px; }
.qgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qswitch { display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; }
.qswitch input { position: absolute; opacity: 0; pointer-events: none; }
.qswitch span { flex-shrink: 0; width: 44px; height: 26px; border-radius: 13px; background: var(--fill); position: relative; transition: background .2s; }
.qswitch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.qswitch input:checked + span { background: #34c759; }
.qswitch input:checked + span::after { transform: translateX(18px); }
.qdrop { position: relative; display: flex; align-items: center; gap: 10px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: 14px; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; font-size: 14px; }
.qdrop:hover, .qdrop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.qdrop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.qdrop small { color: var(--text-3); }
.qdrop.is-form { margin: 12px 0 16px; }

/* Types de demande */
.qtypes { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.qtypes legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.qtype input { position: absolute; opacity: 0; }
.qtype span { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; height: 100%; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.qtype span:hover { transform: translateY(-1px); }
.qtype i { font-style: normal; font-size: 20px; line-height: 1.2; }
.qtype b { font-size: 14px; }
.qtype small { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.qtype input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qtype input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.qamounts { display: flex; gap: 8px; }
.qamounts label { flex: 1; }
.qamounts input { position: absolute; opacity: 0; }
.qamounts span { display: block; text-align: center; padding: 10px 0; border-radius: 12px; border: 1px solid var(--line-2); font: 700 16px var(--round); cursor: pointer; }
.qamounts input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ── Callouts, pastilles, étiquettes ─────────────────────────────────────── */
.qcallout { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; background: var(--fill-2); font-size: 14.5px; margin: 0 0 16px; }
.qcallout .qi { margin-top: 2px; color: var(--text-2); }
.qcallout.is-ok { background: var(--green-bg); }
.qcallout.is-ok .qi { color: var(--green); }
.qcallout.is-warn { background: var(--orange-bg); }
.qcallout.is-info { background: var(--blue-bg); }
.qcallout.is-soft { background: var(--surface); border: 1px solid var(--line); }
.qquote { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); }
.qpill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--fill-2); color: var(--text-2); }
.qpill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.qpill.is-green { background: var(--green-bg); color: var(--green); }
.qpill.is-orange { background: var(--orange-bg); color: var(--orange); }
.qpill.is-blue { background: var(--blue-bg); color: var(--blue); }
.qpill.is-purple { background: var(--purple-bg); color: var(--purple); }
.qtag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; background: var(--fill-2); color: var(--text-2); font-size: 12px; font-weight: 500; }
.qtag.is-link { color: var(--accent); }
.qwarn { display: flex; gap: 6px; align-items: center; color: var(--orange); font-size: 13.5px; font-weight: 500; margin: 8px 0 0; }

/* ── Avatars, marque ─────────────────────────────────────────────────────── */
.qmark, .qav { --c: var(--accent); display: inline-grid; place-items: center; flex-shrink: 0; color: #fff; font: 700 13px var(--round); letter-spacing: 0; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.qmark { width: 36px; height: 36px; border-radius: 11px; }
.qav { width: 34px; height: 34px; border-radius: 50%; font-size: 12px; }
.qav.is-sm { width: 30px; height: 30px; font-size: 11px; }

/* ── Barre du haut et onglets ────────────────────────────────────────────── */
.qbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.qbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.qbar-brand { display: flex; align-items: center; gap: 10px; color: var(--text) !important; text-decoration: none !important; min-width: 0; }
.qbar-brand b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbar-brand small { display: block; font-size: 12px; color: var(--text-2); }
.qbar-act { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.qtabs { display: flex; gap: 2px; margin-left: 10px; }
.qtabs a { position: relative; display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: 14px; text-decoration: none !important; }
.qtabs a:hover { background: var(--fill-2); color: var(--text); }
.qtabs a.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.qtabs a .qi { width: 17px; height: 17px; }
.qtabs em { font-style: normal; font: 700 11px var(--font); background: var(--accent); color: #fff; border-radius: 9px; padding: 1px 6px; }
.qadmin-band { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; background: #1d1d1f; color: #f5f5f7; font-size: 13px; }
.qadmin-band a { color: #8cc4ff; }
.qmain .qadmin-band { border-radius: 12px; margin-bottom: 20px; }

/* ── Mode test (2.1) ─────────────────────────────────────────────────────── */
.qtest-band { position: relative; z-index: 25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 20px; background: #2c2a6b; color: #f2f1ff; font-size: 13px; line-height: 1.4; }
.qtest-band b { color: #fff; }
.qtest-dot { width: 8px; height: 8px; border-radius: 50%; background: #a5a3ff; box-shadow: 0 0 0 4px rgba(165, 163, 255, .25); animation: qpulse 1.6s ease-in-out infinite; flex-shrink: 0; }
.qtest-band > span:nth-child(2) { flex: 1; min-width: 220px; }
.qtest-act { display: flex; gap: 8px; flex-wrap: wrap; }
.qtest-act a { display: inline-flex; align-items: center; gap: 5px; color: #d9d8ff !important; font-weight: 600; padding: 5px 10px; border-radius: 8px; text-decoration: none !important; }
.qtest-act a:hover { background: rgba(255, 255, 255, .1); }
.qtest-act a.is-main { background: #fff; color: #2c2a6b !important; }
@keyframes qpulse { 50% { opacity: .45; } }

/* ── Mise en page ────────────────────────────────────────────────────────── */
.qmain { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.qmain.is-narrow { max-width: 780px; }
.qpage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.qpage-head h1 { margin-bottom: 4px; }
.qback { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.qsection { margin: 30px 0 0; }
.qsection > h2, .qsection-head { margin-bottom: 12px; }
.qsection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qsection-head a { font-size: 14px; font-weight: 500; }
.qcols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.qcols .qsection { margin-top: 30px; }
.qcols > *, .qsplit > *, .qstats > * { min-width: 0; }
.qsplit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.qaside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); }
.qcard.is-soft { background: var(--surface); box-shadow: none; }
.qbignum { font: 700 30px/1.1 var(--round); letter-spacing: -.03em; margin: 2px 0 6px !important; }
.qbignum small { font: 500 14px var(--font); color: var(--text-2); }
.qticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-2); }
.qticks li { display: flex; gap: 8px; }
.qticks li::before { content: "✓"; color: #34c759; font-weight: 700; }
.qtm .qfoot { text-align: center; color: var(--text-3); font-size: 12.5px; margin-top: 48px; }
.qtm .qfoot a { color: var(--text-2); }

/* ── Accueil ─────────────────────────────────────────────────────────────── */
.qhello h1 { font-size: 32px; margin: 2px 0 14px; }
.qhello .qcallout { max-width: 720px; }
.qstats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-top: 6px; }
.qstat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--text) !important; text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s; }
.qstat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.qstat-lbl { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.qstat-num { font: 700 34px/1.1 var(--round); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.qstat-num small { font: 500 14px var(--font); color: var(--text-2); letter-spacing: 0; }
.qstat-sub { font-size: 13px; color: var(--text-2); }
.qstat.is-todo .qstat-num { color: var(--orange); }
.qstat.is-low .qstat-num { color: var(--red); }
.qbarline { display: block; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 6px 0 2px; }
.qbarline i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s var(--ease); }
.is-low .qbarline i { background: #ff3b30; }
.qbarline.is-big { height: 10px; border-radius: 5px; }

/* ── Listes ──────────────────────────────────────────────────────────────── */
.qlist { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.qrowlink { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--text) !important; text-decoration: none !important; border-top: 1px solid var(--line); transition: background .12s; min-width: 0; }
.qrowlink:first-child { border-top: 0; }
a.qrowlink:hover { background: var(--surface-2); }
.qrowlink.is-new .qrow-tx b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; }
.qrow-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qrow-tx b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow-tx small { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.qrow-emoji { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--fill-2); font-size: 17px; }
.qrow-ic { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--fill-2); color: var(--text-2); }
.qrow-ic.is-green { background: var(--green-bg); color: var(--green); }
.qrow-ic.is-orange { background: var(--orange-bg); color: var(--orange); }
.qrow-ic.is-purple { background: var(--purple-bg); color: var(--purple); }
.qrow-ic.is-blue { background: var(--blue-bg); color: var(--blue); }
.qrow-go { display: flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.qamount { font: 700 15px var(--round); font-variant-numeric: tabular-nums; color: var(--text-2); }
.qamount.is-plus { color: var(--green); }
.qempty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 30px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); color: var(--text-2); }
.qempty.is-big { padding: 60px 20px; }
.qempty .qi { color: var(--text-3); }
.qchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.qchips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--fill-2); color: var(--text-2); font-size: 13.5px; font-weight: 550; text-decoration: none !important; }
.qchips a.is-on { background: var(--text); color: var(--bg); }
.qchips em { font-style: normal; opacity: .6; font-size: 12px; }
.qquick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.qquick a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--text) !important; font-weight: 550; text-decoration: none !important; }
.qquick a:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.qquick a .qi { color: var(--accent); }
.qfeed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.qfeed li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.qfeed li:first-child { border-top: 0; }
.qfeed li > span:nth-child(2) { flex: 1; }
.qfeed time { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.qdot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; transform: translateY(-1px); }
.qdot.is-accent { background: var(--accent); }

/* Comment ça marche */
.qhow { margin-top: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 18px; }
.qhow summary { display: flex; align-items: center; gap: 8px; padding: 15px 0; font-weight: 600; cursor: pointer; list-style: none; }
.qhow summary::-webkit-details-marker { display: none; }
.qhow summary::after { content: "+"; margin-left: auto; color: var(--text-3); font-size: 20px; font-weight: 400; }
.qhow[open] summary::after { content: "−"; }
.qsteps { list-style: none; counter-reset: s; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.qsteps li { counter-increment: s; display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--fill-2); border-radius: 14px; font-size: 13px; color: var(--text-2); }
.qsteps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font: 700 12px var(--round); color: var(--text); margin-bottom: 4px; }
.qsteps b { color: var(--text); font-size: 14px; }
.qrules { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; }
.qrules span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--fill-2); font-size: 13px; color: var(--text-2); }

/* ── Une demande ─────────────────────────────────────────────────────────── */
.qreq-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.qreq-emoji { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); font-size: 26px; flex-shrink: 0; }
.qreq-head h1 { font-size: 24px; margin-bottom: 8px; }
.qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--text-2); font-size: 13.5px; }
.qmeta span { display: inline-flex; align-items: center; gap: 5px; }
.qtrack { list-style: none; margin: 0 0 6px; padding: 0; display: flex; }
.qtrack li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); position: relative; text-align: center; }
.qtrack li::before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--fill); z-index: 0; }
.qtrack li:first-child::before { display: none; }
.qtrack li i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--fill); color: #fff; }
.qtrack li.is-done { color: var(--text-2); }
.qtrack li.is-done i { background: #34c759; border-color: #34c759; }
.qtrack li.is-done::before, .qtrack li.is-now::before { background: #34c759; }
.qtrack li.is-now { color: var(--text); font-weight: 650; }
.qtrack li.is-now i { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.qtrack-hint { text-align: center; font-size: 13.5px; margin: 6px 0 20px !important; }
.qaction { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r); margin-bottom: 20px; }
.qaction.is-orange { background: var(--orange-bg); }
.qaction.is-purple { background: var(--purple-bg); }
.qaction-main { display: flex; gap: 16px; align-items: center; flex: 1; min-width: 260px; }
.qaction-num { font: 800 36px/1 var(--round); letter-spacing: -.03em; display: flex; flex-direction: column; align-items: center; min-width: 76px; }
.qaction-num small { font: 600 12px var(--font); color: var(--text-2); letter-spacing: 0; }
.qaction-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; color: var(--purple); }
.qaction-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.qaction .qwarn { flex-basis: 100%; }
.qinline { position: relative; }
.qinline summary { list-style: none; }
.qinline summary::-webkit-details-marker { display: none; }
.qinline[open] form { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); z-index: 5; gap: 10px; }
.qreq-body { margin-bottom: 16px; }
.qreq-body .qform { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.qcancel { margin-top: 12px; }
.qprose { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.qprose img { max-width: 100%; height: auto; border-radius: 12px; }
.qprose h2 { font-size: 20px; margin: 1.4em 0 .5em; }
.qprose h3 { font-size: 16.5px; margin: 1.2em 0 .4em; }
.qprose ul, .qprose ol { padding-left: 1.3em; }
.qprose li { margin: .25em 0; }
.qprose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 1em 0; }
.qprose th, .qprose td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.qprose th { color: var(--text-2); font-weight: 600; font-size: 13px; }
.qprose blockquote { margin: 1em 0; padding: 12px 16px; background: var(--fill-2); border-radius: 12px; }
.qprose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.qprose code { background: var(--fill-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* Fil de messages */
.qthread { margin-top: 26px; }
.qthread > h2 { margin-bottom: 14px; }
.qmsg { display: flex; gap: 10px; margin-bottom: 14px; max-width: 88%; }
.qmsg.is-mine { margin-left: auto; flex-direction: row-reverse; }
.qmsg-b { background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 6px; padding: 10px 14px; min-width: 0; }
.qmsg.is-mine .qmsg-b { background: var(--accent-soft); border-color: transparent; border-radius: 16px 16px 6px 16px; }
.qmsg-h { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; margin-bottom: 2px; }
.qmsg-h time { color: var(--text-3); }
.qmsg-t { font-size: 14.5px; overflow-wrap: anywhere; }
.qreply { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 8px; margin-top: 18px; transition: box-shadow .15s, border-color .15s; }
.qreply:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.qreply textarea { border: 0 !important; box-shadow: none !important; padding: 8px 10px; min-height: 42px; background: transparent; }
.qreply-bar { display: flex; justify-content: space-between; align-items: center; }

/* Fichiers */
.qfiles { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.qfiles.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.qfiles.is-sm { margin-top: 8px; }
.qfile { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text) !important; text-decoration: none !important; min-width: 0; }
.qfile:hover { border-color: var(--line-2); }
.qfile-th { width: 40px; height: 40px; border-radius: 9px; background: var(--fill-2) center/cover no-repeat; flex-shrink: 0; display: grid; place-items: center; }
.qfile-th.is-ext { font: 700 10px var(--round); color: var(--text-2); letter-spacing: .02em; }
.qfile-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qfile-tx b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qfile-tx small { font-size: 12px; color: var(--text-2); }
.qfile-dl { color: var(--text-3); }

/* ── Document partagé ────────────────────────────────────────────────────── */
.qdoc { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 40px 44px; box-shadow: var(--shadow-sm); }
.qdoc-head { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.qdoc-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-2); font-size: 13.5px; margin-bottom: 12px; }
.qdoc-head h1 { font-size: 32px; letter-spacing: -.025em; }
.qdoc-approve { flex-wrap: wrap; justify-content: space-between; align-items: center; }
.qapprove { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
.qapprove textarea { min-height: 44px; }
.qdoc-files { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.qlinkcard { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 0 0 20px; border: 1px solid var(--line-2); border-radius: 14px; color: var(--text) !important; text-decoration: none !important; }
.qlinkcard:hover { box-shadow: var(--shadow-sm); }
.qlinkcard > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.qlinkcard small { color: var(--text-2); }
.qlinkcard-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.qcta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.qcta > div { flex: 1; min-width: 240px; }
.qdoc-wrap { max-width: 820px; }

/* ── Tokens ──────────────────────────────────────────────────────────────── */
.qwallet { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); margin-bottom: 8px; }
.qwallet-main { display: flex; flex-direction: column; gap: 4px; }
.qwallet-num { font: 800 54px/1 var(--round); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.qwallet-num small { font: 500 16px var(--font); color: var(--text-2); letter-spacing: 0; margin-left: 6px; }
.qwallet.is-low .qwallet-num { color: var(--red); }
.qwallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.qwallet-grid div { background: var(--fill-2); border-radius: 14px; padding: 12px 14px; }
.qwallet-grid dt { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.qwallet-grid dd { margin: 2px 0 0; font: 700 22px var(--round); font-variant-numeric: tabular-nums; }

/* ── Hub de connexion ────────────────────────────────────────────────────── */
.qhub { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 18px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%); }
.qhub-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 30px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.qhub-card.is-center { text-align: center; align-items: center; }
.qhub-card h1 { font-size: 24px; }
.qhub-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.qhub-brand b { display: block; }
.qhub-brand small { color: var(--text-2); font-size: 13px; }
.qhub-brand .qmark { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }
.qhub-card .qcallout { margin: 0; }
.qhub-alt { text-align: center; font-size: 14px; }
.qhub-foot { margin-top: 20px; color: var(--text-2); font-size: 13px; }
.qhub-spaces { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.qhub-spaces a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--text) !important; font-weight: 550; text-decoration: none !important; }
.qhub-spaces a:first-child { border-top: 0; }
.qhub-spaces a:hover { background: var(--surface-2); }
.qhub-spaces a .qi:last-child { margin-left: auto; color: var(--text-3); }
.qseg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: var(--fill-2); border-radius: 12px; }
.qseg button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; padding: 8px; border-radius: 9px; font: 600 13.5px var(--font); color: var(--text-2); cursor: pointer; }
.qseg button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.qbig-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--fill-2); color: var(--text-2); }

/* ── Versions ────────────────────────────────────────────────────────────── */
.qversions { display: flex; flex-direction: column; gap: 14px; }
.qversion { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.qversion header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qversion h2 { font: 700 20px var(--round); }
.qversion h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 14px 0 6px; }
.qversion ul { margin: 0; padding-left: 1.2em; }
.qversion li { margin: 4px 0; font-size: 14.5px; }
.qversion-title { font-weight: 600; }

/* ── Message après action ────────────────────────────────────────────────── */
.qtoast { position: fixed; z-index: 50; left: 50%; top: 76px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 14px; background: #1d1d1f; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .4); animation: qtoast .4s var(--ease); }
.qtoast.is-ok .qi { color: #30d158; }
.qtoast.is-warn .qi { color: #ff9f0a; }
.qtoast.is-hide { opacity: 0; transform: translate(-50%, -10px); transition: .3s; }
@keyframes qtoast { from { opacity: 0; transform: translate(-50%, -12px); } }

/* ── Téléphone ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .qsplit, .qcols, .qwallet { grid-template-columns: 1fr; }
    .qaside { position: static; }
    .qsteps { grid-template-columns: 1fr 1fr; }
    .qstats { grid-template-columns: 1fr 1fr; }
    .qstat.is-balance { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    body.is-space { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    /* Un flou d'arrière-plan sur la barre piégerait la barre d'onglets fixe : fond plein sur téléphone. */
    .qbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
    .qbar-in { padding: 9px 16px; gap: 10px; }
    .qtabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
    .qtabs a { flex-direction: column; gap: 2px; padding: 5px 4px; font-size: 10.5px; font-weight: 600; flex: 1; border-radius: 10px; }
    .qtabs a.is-on { background: none; box-shadow: none; color: var(--accent); }
    .qtabs a .qi { width: 22px; height: 22px; }
    .qtabs em { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10px; }
    .qbar-new span { display: none; }
    .qbar-new { width: 36px; padding: 0; }
    .qmain { padding: 20px 16px 40px; }
    .qtm h1 { font-size: 25px; }
    .qhello h1 { font-size: 27px; }
    .qdoc { padding: 24px 20px; border-radius: 18px; }
    .qdoc-head h1 { font-size: 25px; }
    .qgrid2 { grid-template-columns: 1fr; }
    .qmsg { max-width: 100%; }
    .qinline[open] form { position: static; width: 100%; margin-top: 8px; }
    .qtoast { top: 12px; }
    .qtrack li span { font-size: 11px; }
}
@media (max-width: 480px) {
    .qsteps { grid-template-columns: 1fr; }
    .qtypes { grid-template-columns: 1fr 1fr; }
    .qwallet-num { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
