:root {
  --bg: #f4f6f9; --surface: #fff; --text: #1d2733; --muted: #6b7785; --line: #e1e6ec;
  --primary: #0b5cab; --primary-d: #084a8a; --primary-l: #e8f1fb; --accent: #f5a623;
  --ok: #2e9e6a; --ok-l: #e6f5ee; --err: #d64545; --err-l: #fbeaea; --warn: #b7791f; --warn-l: #fdf4e3;
  --r: 8px; --shadow: 0 1px 3px rgba(20, 30, 50, .08), 0 1px 2px rgba(20, 30, 50, .04);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.25rem; margin: 1.2rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 0 0 .6rem; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: .85em; }
pre { background: #0f1b2a; color: #dfe8f3; padding: .8rem 1rem; border-radius: var(--r); overflow: auto; font-size: .85rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.ok-text { color: var(--ok); font-weight: 600; } .err-text { color: var(--err); } .warn-text { color: var(--warn); font-weight: 600; }
.row { display: flex; align-items: center; } .row.gap { gap: .5rem; } .row.wrap, .wrap { flex-wrap: wrap; } .row.between, .between { justify-content: space-between; }
.grow { flex: 1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; } .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .5rem .95rem; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: #c5ced8; background: #f8fafc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; } .btn.primary:hover { background: var(--primary-d); }
.btn.danger { color: var(--err); border-color: #f0c4c4; } .btn.danger:hover { background: var(--err-l); }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; } .btn.lg { padding: .75rem 1.3rem; font-size: 1.05rem; } .btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-size: .88rem; }
.linkbtn.danger { color: var(--err); }
input, select, textarea { font: inherit; padding: .5rem .65rem; border: 1px solid #cdd5de; border-radius: 6px; background: #fff; color: var(--text); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(11, 92, 171, .25); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
select.sm { padding: .2rem .4rem; font-size: .85rem; width: auto; }
label { display: block; font-size: .88rem; font-weight: 500; color: #3b4652; }
label > input, label > select, label > textarea { margin-top: .25rem; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.form-grid { display: grid; gap: .8rem; }
form.inline { display: inline; }

/* Barre du haut */
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0 1.2rem; height: 56px; background: #0f2a47; color: #fff; position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff !important; font-weight: 700; font-size: 1.05rem; text-decoration: none !important; }
.brand img { width: 30px; height: 30px; }
.mainnav { display: flex; gap: .2rem; flex: 1; overflow-x: auto; }
.mainnav.right { justify-content: flex-end; align-items: center; gap: .8rem; }
.mainnav a { color: #c9d6e5; padding: .4rem .75rem; border-radius: 6px; white-space: nowrap; text-decoration: none; }
.mainnav a:hover, .mainnav a.on { background: rgba(255, 255, 255, .1); color: #fff; }
.mainnav a.btn { color: #fff; }
.usermenu { display: flex; align-items: center; gap: .8rem; }
.usermenu .muted { color: #9fb2c8; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff !important; display: grid; place-items: center; font-weight: 700; text-decoration: none !important; }
.projbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: .6rem 1.2rem 0; }
.projtitle { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.subnav { display: flex; gap: .2rem; margin-top: .4rem; overflow-x: auto; }
.subnav a { padding: .5rem .85rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.subnav a.on { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.2rem; flex: 1; }
.container.full { max-width: none; } .container.narrow { max-width: 760px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.2rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); background: var(--surface); }

/* Composants */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagehead p { margin: 0; }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .9rem; }
.toolbar input:not([type=checkbox]), .toolbar select { width: auto; }
.toolbar #fq, .toolbar input[name=q] { min-width: 220px; }
.alert { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; background: var(--ok-l); color: #1e6b48; border: 1px solid #bfe3d1; }
.alert.err { background: var(--err-l); color: #9b2c2c; border-color: #f0c4c4; }
.alert.warn { background: var(--warn-l); color: #7a5214; border-color: #f0dcb4; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: #eef1f5; color: var(--muted); }
.badge.deployed, .badge.st-approved { background: var(--ok-l); color: var(--ok); }
.badge.draft, .badge.st-pending { background: var(--primary-l); color: var(--primary); }
.badge.archived { background: #eee; color: #888; } .badge.st-rejected { background: var(--err-l); color: var(--err); }
.chip { display: inline-block; background: var(--primary-l); color: var(--primary); border: 0; border-radius: 99px; padding: .1rem .6rem; font-size: .8rem; cursor: pointer; margin: 2px; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .9rem; }
.table th, .table td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { background: #f8fafc; font-weight: 600; color: #4a5562; font-size: .82rem; position: sticky; top: 0; }
.table.compact th, .table.compact td { padding: .4rem .5rem; }
.table .num { text-align: right; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: #f8fbff; }
.table.projects { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.table.kv th { width: 38%; font-weight: 500; color: #3b4652; } .table.kv tr.sec th { background: var(--primary-l); color: var(--primary); }
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); max-height: calc(100vh - 260px); background: var(--surface); }
.table.data td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { height: 34px; border-radius: 4px; } .photo { max-width: 100%; max-height: 320px; border-radius: 6px; }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; padding: .7rem 0; flex-wrap: wrap; }
.copyline { display: flex; gap: .4rem; margin: .3rem 0 .6rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat b { display: block; font-size: 1.7rem; color: var(--primary); }
.stat span { color: var(--muted); font-size: .85rem; }
.grid-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 1rem; }
.qrwrap { display: flex; gap: 1rem; align-items: center; margin-top: .5rem; }
.qrwrap #qr img, .qrwrap #qr canvas { border: 6px solid #fff; box-shadow: var(--shadow); }
.activity { list-style: none; padding: 0; margin: 0; } .activity li { padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); min-width: 190px; z-index: 30; padding: .3rem 0; }
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: .45rem .9rem; color: var(--text); cursor: pointer; text-decoration: none; }
.dropdown-menu a:hover { background: var(--primary-l); }
.meter { height: 8px; background: #eef1f5; border-radius: 99px; overflow: hidden; margin-top: .3rem; }
.meter div { height: 100%; background: var(--primary); } .meter div.hot { background: var(--err); }
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.usage span { display: block; color: var(--muted); font-size: .85rem; }
.danger-zone { border-color: #f0c4c4; }
.map { height: calc(100vh - 230px); min-height: 400px; border-radius: var(--r); border: 1px solid var(--line); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gallery img, .gallery video { width: 100%; height: 170px; object-fit: cover; display: block; background: #eef1f5; }
.gallery audio { width: 100%; margin: .6rem 0; }
.gallery figcaption { padding: .5rem .6rem; font-size: .8rem; color: var(--muted); }
.filebox { display: grid; place-items: center; height: 170px; background: #f8fafc; }
.report-q h3 { margin: 0; }
.report-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.2rem; margin-top: .8rem; align-items: start; }
.samples { margin: .5rem 0 0; padding-left: 1.1rem; } .samples li { padding: .15rem 0; }
.printonly { display: none; }
.doc h3 { margin-top: 1.2rem; }

/* Modales et notifications */
.modal { display: none; position: fixed; inset: 0; background: rgba(15, 25, 40, .45); z-index: 100; padding: 4vh 1rem; overflow: auto; }
.modal.open { display: block; }
.modal-box { position: relative; background: #fff; max-width: 560px; margin: 0 auto; border-radius: 10px; padding: 1.4rem 1.5rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-box.wide { max-width: 860px; }
.modal-x { position: absolute; right: .8rem; top: .6rem; border: 0; background: none; font-size: 1.6rem; color: var(--muted); cursor: pointer; }
.seg { display: flex; gap: .4rem; flex-wrap: wrap; }
.seg label { border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem; display: flex; gap: .35rem; align-items: center; cursor: pointer; font-weight: 400; }
#toasts { position: fixed; bottom: 1rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: #1d2733; color: #fff; padding: .65rem 1rem; border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: 360px; animation: tin .2s; }
.toast.err { background: var(--err); } .toast.warn { background: var(--warn); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* Authentification */
.auth-page main { display: grid; place-items: start center; }
.auth-card { background: #fff; width: 100%; max-width: 420px; margin: 5vh auto; padding: 2rem; border-radius: 12px; box-shadow: 0 10px 40px rgba(15, 42, 71, .1); border: 1px solid var(--line); }
.auth-card.wide { max-width: 560px; }
body.auth-page:not(:has(.topbar)) { padding: 1rem; }

/* Page d'accueil */
.landing .container { max-width: 1140px; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; }
.hero .accent { color: var(--primary); }
.lead { font-size: 1.1rem; color: #4a5562; margin-bottom: 1.5rem; }
.hero-card { background: #fff; border-radius: 16px; padding: 1.2rem; box-shadow: 0 20px 50px rgba(15, 42, 71, .15); border: 1px solid var(--line); }
.mock-q { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; margin-bottom: .7rem; }
.mock-q b { display: block; margin: .3rem 0 .5rem; }
.mock-q .tag { font-size: .7rem; background: var(--primary-l); color: var(--primary); padding: .1rem .5rem; border-radius: 99px; }
.mock-q .opt { border: 1px solid var(--line); border-radius: 6px; padding: .35rem .6rem; margin-top: .3rem; font-size: .9rem; }
.mock-q .opt.on { border-color: var(--primary); background: var(--primary-l); }
.mock-sync { font-size: .82rem; color: var(--ok); background: var(--ok-l); padding: .5rem .7rem; border-radius: 6px; }
.features, .pricing, .contact { padding: 2rem 0; }
.features h2, .pricing h2, .contact h2 { text-align: center; font-size: 1.6rem; margin-bottom: 1.5rem; }
.feat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem; }
.feat p { margin: 0; color: #4a5562; font-size: .93rem; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--primary); box-shadow: 0 10px 30px rgba(11, 92, 171, .12); }
.plan .price { font-size: 1.7rem; font-weight: 700; margin: .3rem 0 .8rem; } .plan .price small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.plan ul { padding-left: 1.1rem; flex: 1; color: #4a5562; }
.contact { text-align: center; }

/* Constructeur */
.builder { display: grid; grid-template-columns: 220px 1fr 360px; gap: 1rem; align-items: start; }
.palette, .props { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .9rem; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.palette h4 { margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.palette .btn { margin-bottom: .4rem; }
.pal-title { font-size: .75rem; color: var(--muted); margin: .6rem 0 .2rem; font-weight: 600; }
.pal-item { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .35rem .45rem; border: 1px solid transparent; background: none; border-radius: 5px; cursor: grab; font: inherit; font-size: .87rem; text-align: left; color: var(--text); }
.pal-item:hover { background: var(--primary-l); border-color: #cfe1f5; }
.ico, .qtype { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; background: #eef1f5; font-size: .78rem; font-weight: 700; color: #4a5562; flex-shrink: 0; }
.canvas { min-height: 60vh; }
.canvas-head { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: .8rem; }
.title-input { flex: 1; min-width: 220px; font-size: 1.25rem; font-weight: 600; border: 1px solid transparent; background: transparent; max-width: 520px; }
.title-input:hover, .title-input:focus { border-color: var(--line); background: #fff; }
.qlist { display: flex; flex-direction: column; gap: .4rem; }
.qcard { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .65rem .7rem; cursor: pointer; transition: border-color .1s; }
.qcard:hover { border-color: #b8c6d6; }
.qcard.sel { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 92, 171, .12); }
.qcard.is-section { background: #f0f6fd; border-left: 4px solid var(--primary); margin-top: .6rem; }
.qcard.dragging { opacity: .4; }
.qcard.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.drag { color: #b0bac5; cursor: grab; letter-spacing: -2px; }
.qmain { flex: 1; min-width: 0; }
.qlabel { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.qnum { color: var(--muted); }
.qmeta { font-size: .78rem; color: var(--muted); }
.qmeta .logic { color: var(--warn); }
.qactions { display: flex; gap: 2px; opacity: 0; transition: opacity .1s; }
.qcard:hover .qactions, .qcard.sel .qactions { opacity: 1; }
.qactions button { border: 0; background: #f1f4f7; border-radius: 4px; width: 26px; height: 26px; cursor: pointer; font-size: .8rem; }
.qactions button:hover { background: #e2e8ee; } .qactions .danger:hover { background: var(--err-l); }
.req { color: var(--err); }
.props label { margin-bottom: .6rem; }
.props-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.props-head select { margin-left: auto; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.tabs button { border: 0; background: none; padding: .45rem .7rem; cursor: pointer; font: inherit; font-size: .87rem; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.choices-ed { border: 1px solid var(--line); border-radius: 6px; padding: .6rem; margin-bottom: .7rem; }
.chrow { display: grid; grid-template-columns: 1fr 70px 26px 26px; gap: .3rem; margin: .3rem 0; }
.chrow input { padding: .35rem .45rem; font-size: .87rem; }
.chrow button, .rule .r-del { border: 0; background: #f1f4f7; border-radius: 4px; cursor: pointer; }
.rule { display: grid; grid-template-columns: 1fr; gap: .3rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: .5rem; margin: .5rem 0; position: relative; }
.rule select, .rule input { padding: .35rem .45rem; font-size: .85rem; }
.rule .r-del { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); }
.vars { margin: -.3rem 0 .6rem; }
.phone-frame { max-width: 480px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; background: var(--bg); }

/* Moteur de formulaire */
.fr-title { margin-top: 0; }
.fr-q { margin-bottom: 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid #eef1f5; }
.fr-q.fr-hidden, .fr-q.fr-offpage { display: none; }
.fr-label { font-size: .98rem; font-weight: 600; color: var(--text); margin-bottom: .2rem; }
.fr-hint { margin: 0 0 .4rem; font-size: .84rem; color: var(--muted); }
.fr-section { color: var(--primary); border-bottom: 2px solid var(--primary-l); padding-bottom: .3rem; margin: .4rem 0 .2rem; }
.fr-note { background: var(--primary-l); padding: .7rem .9rem; border-radius: 6px; }
.fr-input { margin-top: .35rem; }
.fr-err { color: var(--err); font-size: .84rem; margin-top: .25rem; }
.fr-q.has-err input, .fr-q.has-err select, .fr-q.has-err textarea { border-color: var(--err); }
.fr-choices { display: flex; flex-direction: column; gap: .35rem; }
.fr-choices.horizontal { flex-direction: row; flex-wrap: wrap; }
.fr-choice { display: flex; gap: .55rem; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: .55rem .7rem; cursor: pointer; font-weight: 400; background: #fff; }
.fr-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-l); }
.fr-other { margin-top: .4rem; }
.fr-clear { margin-top: .3rem; font-size: .8rem; }
.fr-stars { display: flex; gap: .2rem; }
.fr-stars .star { font-size: 1.9rem; border: 0; background: none; cursor: pointer; color: #d5dbe2; padding: 0 .1rem; }
.fr-stars .star.on { color: var(--accent); }
.fr-range { display: flex; gap: .8rem; align-items: center; } .fr-range output { font-weight: 700; min-width: 2.5rem; }
.fr-calc { display: inline-block; background: #f1f4f7; padding: .35rem .7rem; border-radius: 6px; min-width: 4rem; font-weight: 600; }
.fr-preview { margin-top: .5rem; } .fr-preview img { max-width: 100%; max-height: 240px; border-radius: 6px; }
.fr-sig { width: 100%; max-width: 600px; height: 180px; border: 1px dashed #b0bac5; border-radius: 6px; background: #fff; touch-action: none; }
.fr-geo-out { margin-top: .4rem; }
.fr-geo-manual { margin-top: .4rem; }
.fr-scan { width: 100%; max-width: 360px; margin-top: .5rem; border-radius: 6px; }
.fr-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.fr-actions .btn { min-width: 120px; }
.fr-progress { height: 5px; background: #eef1f5; border-radius: 99px; overflow: hidden; margin-top: .5rem; }
.fr-progress div { height: 100%; background: var(--primary); transition: width .2s; }
.fr-msg { margin-top: .8rem; font-size: .9rem; } .fr-msg.err { color: var(--err); } .fr-msg pre { white-space: pre-wrap; }

/* Pages formulaire public et collecte */
.form-page { background: var(--bg); }
.form-shell { max-width: 720px; width: 100%; margin: 0 auto; padding: 1rem; }
.big-ok { font-size: 3rem; color: var(--ok); }
.powered { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 1.5rem; }
.netstate { font-size: .85rem; padding: 0; text-align: center; border-radius: 6px; margin-bottom: .6rem; }
.netstate.off { background: var(--warn-l); color: var(--warn); padding: .45rem; }
.netstate.on { color: var(--ok); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; }
.tile { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: .3rem; box-shadow: var(--shadow); color: var(--text); }
.tile:hover { border-color: var(--primary); }

/* Adaptatif */
@media (max-width: 1100px) {
  .builder { grid-template-columns: 190px 1fr; }
  .props { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 760px) {
  .topbar { gap: .6rem; padding: 0 .6rem; height: auto; min-height: 56px; flex-wrap: wrap; }
  .brand span { display: none; }
  .mainnav { order: 3; width: 100%; padding-bottom: .4rem; }
  .usermenu { margin-left: auto; }
  .container { padding: .8rem; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; } .hero .row { flex-wrap: wrap; } .grid3 { grid-template-columns: minmax(0, 1fr); } .hero h1 { font-size: 1.8rem; }
  .builder { grid-template-columns: 1fr; }
  .palette { position: static; max-height: none; }
  #palette { display: flex; flex-wrap: wrap; gap: .2rem; } .pal-group { display: contents; } .pal-title { display: none; }
  .pal-item { width: auto; border: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .table.projects td:nth-child(3), .table.projects th:nth-child(3), .table.projects td:nth-child(6), .table.projects th:nth-child(6) { display: none; }
  .qactions { opacity: 1; }
}
@media print {
  .topbar, .projbar, .footer, .noprint { display: none !important; }
  .printonly { display: block; }
  body { background: #fff; } .card { box-shadow: none; break-inside: avoid; }
}
