/* YAA Money V2 - CSS sans style inline (compatible CSP style-src 'self') */
:root {
  --bg: #f4f6f5; --card: #ffffff; --text: #14211b; --muted: #5f6f67; --line: #dfe6e2;
  --primary: #0b6b4a; --primary-d: #084f37; --accent: #f28c28; --ok: #1a7f4b; --warn: #b36b00; --err: #b3261e;
  --ok-bg: #e3f4ea; --warn-bg: #fff1d6; --err-bg: #fde7e5; --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#0e1512; --card:#16201b; --text:#e8f0ec; --muted:#9bb0a5; --line:#26352d; --primary:#2fb585; --primary-d:#238f68;
    --ok-bg:#12301f; --warn-bg:#3a2a0a; --err-bg:#3a1512; --ok:#58d38e; --warn:#f0b24a; --err:#ff8a80; }
}
:root[data-theme="dark"] { --bg:#0e1512; --card:#16201b; --text:#e8f0ec; --muted:#9bb0a5; --line:#26352d; --primary:#2fb585; --primary-d:#238f68;
  --ok-bg:#12301f; --warn-bg:#3a2a0a; --err-bg:#3a1512; --ok:#58d38e; --warn:#f0b24a; --err:#ff8a80; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; } h2 { font-size: 1.15rem; margin: 0 0 .75rem; } h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; } .nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---- Structure */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--primary); color: #fff; display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; }
.topbar a { color: #fff; } .brand { font-weight: 800; letter-spacing: .3px; font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: inline-grid; place-items: center; color: #fff; font-weight: 900; font-size: .9rem; }
.topbar .spacer { flex: 1; }
.icon-btn { background: rgba(255,255,255,.14); border: 0; color: #fff; border-radius: 10px; padding: .4rem .65rem; cursor: pointer; font: inherit; position: relative; }
.icon-btn:hover { background: rgba(255,255,255,.25); text-decoration: none; }
.pill { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 .4rem; min-width: 18px; text-align: center; }
.shell { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 54px); }
.side { display: none; background: var(--card); border-right: 1px solid var(--line); padding: 1rem .75rem; }
.side a { display: block; padding: .55rem .8rem; border-radius: 10px; color: var(--text); margin-bottom: 2px; }
.side a:hover { background: var(--bg); text-decoration: none; } .side a.active { background: var(--primary); color: #fff; }
.side .sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1rem .8rem .3rem; }
main { padding: 1rem; max-width: 1100px; width: 100%; margin: 0 auto; padding-bottom: 5.5rem; }
.public main { max-width: 480px; padding-top: 2rem; }
.public main.wide { max-width: 960px; }
.bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { text-align: center; padding: .55rem .2rem; color: var(--muted); font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottom a.active { color: var(--primary); font-weight: 700; } .bottom svg { width: 22px; height: 22px; } .bottom a:hover { text-decoration: none; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 240px 1fr; } .side { display: block; } .bottom { display: none; } main { padding-bottom: 2rem; }
}

/* ---- Composants */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; } .g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.stat { font-size: 1.5rem; font-weight: 800; } .stat-sm { font-size: 1.1rem; font-weight: 700; }
.wallet { background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.wallet .cur { opacity: .8; font-size: .85rem; } .wallet .bal { font-size: 1.7rem; font-weight: 800; letter-spacing: .3px; }
.wallet.alt { background: linear-gradient(135deg, #25405a, #172b3d); }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
.actions a { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .3rem; text-align: center; color: var(--text); font-size: .85rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .3rem; align-items: center; }
.actions a:hover { text-decoration: none; border-color: var(--primary); } .actions svg { width: 26px; height: 26px; color: var(--primary); }
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .25rem; }
input, select, textarea { width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: .4rem; }
.hint { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.btn { display: inline-block; border: 0; background: var(--primary); color: #fff; padding: .75rem 1.2rem; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
.btn:hover { background: var(--primary-d); text-decoration: none; } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { display: block; width: 100%; } .btn.sec { background: transparent; color: var(--primary); border: 1px solid var(--primary); } .btn.danger { background: var(--err); } .btn.small { padding: .4rem .8rem; font-size: .85rem; border-radius: 9px; }
.btn.sec:hover { background: var(--bg); }
.flash { padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; }
.flash.success { background: var(--ok-bg); color: var(--ok); } .flash.error { background: var(--err-bg); color: var(--err); } .flash.info { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--line); color: var(--text); }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.err { background: var(--err-bg); color: var(--err); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; } th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); } .scroll { overflow-x: auto; }
.tx { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); color: var(--text); }
.tx:last-child { border-bottom: 0; } .tx:hover { text-decoration: none; background: var(--bg); }
.tx .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; }
.ico.in { background: var(--ok-bg); color: var(--ok); } .ico.out { background: var(--err-bg); color: var(--err); } .ico.swap { background: var(--warn-bg); color: var(--warn); }
.tx .body { flex: 1; min-width: 0; } .tx .body b, .tx .body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt.in { color: var(--ok); font-weight: 700; } .amt.out { color: var(--err); font-weight: 700; }
.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; } .pager a, .pager span { padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.pager span.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.summary { background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; }
.summary dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; } .summary dt { color: var(--muted); } .summary dd { margin: 0; font-weight: 700; text-align: right; }
.qr { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; line-height: 0; border: 1px solid var(--line); } .qr svg { width: 220px; height: 220px; }
.seg { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; } .seg a { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 99px; color: var(--text); background: var(--card); }
.seg a.active { background: var(--primary); color: #fff; border-color: var(--primary); } .seg a:hover { text-decoration: none; }
dialog { border: 0; border-radius: 18px; padding: 1.3rem; width: min(92vw, 420px); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.result { text-align: center; padding: .5rem 0; } .result .big { font-size: 3rem; line-height: 1; }
.hero { text-align: center; padding: 2rem 0 1rem; } .hero h1 { font-size: 2rem; } .hero p { color: var(--muted); font-size: 1.05rem; }
.feat { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 2rem 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.video { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 4/3; object-fit: cover; }
.inline-form { display: inline; } .inline-form button { vertical-align: middle; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .35rem 1rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.ok-text { color: var(--ok); } .err-text { color: var(--err); }
.install { display: none; } .install.show { display: inline-block; }
@media print { .topbar, .side, .bottom, .no-print { display: none !important; } body { background: #fff; color: #000; } .card { box-shadow: none; border: 1px solid #999; } .shell { display: block; } }
.row.center { justify-content: center; }
.w-260 { max-width: 260px; } .w-120 { max-width: 120px; } .mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.scroll { overflow-x: auto; } .scroll table { min-width: 560px; } .inline { display: inline; }
.row.nowrap input { flex: 1; min-width: 0; }
.row.nowrap { flex-wrap: wrap; }
.row.nowrap input { flex: 1 1 100%; }
.row.nowrap .btn { flex: 1 1 auto; }
main > .grid, main > .card + .grid { margin-bottom: 14px; }
.result .big { color: var(--brand, #0b6b4a); font-weight: 700; }

/* ---- Ajouts version procédurale */
.summary + .hint, [data-summary] .hint { margin: .6rem 0; }
.tx .row { gap: .4rem; }
dialog label input { margin-top: .35rem; }
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn { display: inline-flex; align-items: center; }
