/* Le Foyer — même univers visuel que CareStay : Playfair Display + DM Sans, vert profond, bronze. */
:root{
  color-scheme:light;
  --bg:#f3f7f4; --surface:#ffffff; --surface2:#eaf1ed; --text:#17302d; --muted:#687976; --line:#dce5e2; --ring:#b3c5c0;
  --accent:#2f6e63; --accent-strong:#255b53; --on-accent:#ffffff; --accent-soft:#dcebe5;
  --bronze:#8f6238; --bronze-soft:#f5eadc;
  --deep:#17302d; --on-deep:#ffffff; --on-deep-muted:#c8d6d2; --deep-line:rgba(255,255,255,.16); --fill-on-deep:#d9ab78;
  --paper:#ffffff; --ink:#17302d; --badge-ink:#ffffff;
  --danger:#a13f37; --danger-soft:#f7e4e1; --ok:#2f6e63; --ok-soft:#dcebe5;
  --shadow:0 24px 60px rgba(22,48,45,.10);
  --font:"DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif; --serif:"Playfair Display",Georgia,serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0d1a18; --surface:#142623; --surface2:#1a302c; --text:#e5efec; --muted:#95aaa5; --line:#25403c; --ring:#3f605a;
    --accent:#5db5a3; --accent-strong:#79c8b7; --on-accent:#0b1c19; --accent-soft:#1c3a35;
    --bronze:#d9ab78; --bronze-soft:#33291e; --badge-ink:#1c1408;
    --deep:#1b423b; --on-deep:#f3f9f7; --on-deep-muted:#b5cbc6;
    --danger:#e6948a; --danger-soft:#3a2321; --ok-soft:#1c3a35;
    --shadow:0 24px 60px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0d1a18; --surface:#142623; --surface2:#1a302c; --text:#e5efec; --muted:#95aaa5; --line:#25403c; --ring:#3f605a;
  --accent:#5db5a3; --accent-strong:#79c8b7; --on-accent:#0b1c19; --accent-soft:#1c3a35;
  --bronze:#d9ab78; --bronze-soft:#33291e; --badge-ink:#1c1408;
  --deep:#1b423b; --on-deep:#f3f9f7; --on-deep-muted:#b5cbc6;
  --danger:#e6948a; --danger-soft:#3a2321; --ok-soft:#1c3a35;
  --shadow:0 24px 60px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:15px;line-height:1.5;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
a{color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
[hidden]{display:none!important}
svg.ic{width:1.25em;height:1.25em;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
#root{height:100%;position:relative;z-index:1}
/* Fond personnel en filigrane : image choisie dans le profil, visible seulement par son propriétaire. */
#bgmark{position:fixed;inset:0;z-index:0;pointer-events:none;background-size:cover;background-position:center;background-repeat:no-repeat;opacity:0}
html.has-bg .app{background:transparent}
html.has-bg .card,html.has-bg .cat,html.has-bg .day,html.has-bg .mcell,html.has-bg .who-btn,html.has-bg .hub-item,html.has-bg .star-chip{background:color-mix(in srgb,var(--surface) 86%,transparent)}
html.has-bg .tabs{background:color-mix(in srgb,var(--surface) 92%,transparent)}
html.has-bg .chat-form{background:color-mix(in srgb,var(--bg) 88%,transparent)}
html.has-bg .msg.you{background:color-mix(in srgb,var(--surface) 88%,transparent)}

.app{height:100%;max-width:520px;margin:0 auto;display:flex;flex-direction:column;background:var(--bg);border-inline:1px solid var(--line)}
@media (max-width:520px){.app{border-inline:0}}

/* En-tête */
.top{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:calc(12px + env(safe-area-inset-top,0px)) 16px 8px}
.brand{display:flex;align-items:center;gap:11px;min-width:0}
.brand-mark{width:38px;height:38px;border-radius:13px;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;font-family:var(--serif);font-size:24px;flex:none}
.wordmark strong{display:block;font-size:21px;line-height:1;font-weight:700;letter-spacing:-.025em}
.wordmark small{display:block;margin-top:5px;font-size:9.5px;line-height:1;letter-spacing:.12em;color:var(--muted);font-weight:500;text-transform:uppercase;white-space:nowrap}
.who-btn{display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:5px 12px 5px 6px}
.who-btn .ic{color:var(--muted);width:1.05em;height:1.05em}
.sync-dot{width:8px;height:8px;border-radius:50%;background:var(--ring);flex:none}
.sync-dot.ok{background:var(--accent)}
.sync-dot.err{background:var(--danger)}

.main{flex:1;overflow-y:auto;padding:6px 16px 28px;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}
.view{display:flex;flex-direction:column;gap:22px}

/* Typographie */
.eyebrow{margin:0 0 8px;text-transform:uppercase;letter-spacing:.12em;font-size:12px;font-weight:700;color:var(--accent)}
.page-title{margin:0;font-family:var(--serif);font-weight:600;font-size:clamp(32px,9vw,42px);line-height:1.06;text-wrap:balance}
h2{margin:0;font-family:var(--serif);font-weight:600;font-size:24px;line-height:1.15}
h3{margin:0}
.sec-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}
.link{border:0;background:none;color:var(--accent);font-weight:700;font-size:14px;padding:6px 0}
.muted{color:var(--muted)}
.small{font-size:13px}
.num{font-variant-numeric:tabular-nums}
.back{display:inline-flex;align-items:center;gap:4px;border:0;background:none;color:var(--accent);font-weight:700;padding:6px 0 6px;margin-left:-4px}

/* Surfaces */
.card{background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:6px 16px}
.card.pad{padding:18px}
.deep{background:var(--deep);color:var(--on-deep);border-radius:28px;padding:22px;box-shadow:var(--shadow)}
.deep .eyebrow{color:var(--on-deep-muted)}
.banner{display:flex;gap:12px;align-items:center;justify-content:space-between;background:var(--bronze-soft);border-radius:16px;padding:12px 14px;font-size:13.5px}
.banner b{color:var(--bronze)}
.banner .b-btn{flex:none;border:1px solid var(--bronze);background:transparent;color:var(--bronze);font-weight:700;border-radius:10px;padding:8px 12px;font-size:13px;text-decoration:none}
.banner.info{background:var(--accent-soft)}
.banner.info b{color:var(--accent)}
.banner.info .b-btn{border-color:var(--accent);color:var(--accent)}
.banner.err{background:var(--danger-soft)}
.banner.err b{color:var(--danger)}

/* Boutons */
.btn{display:inline-flex;justify-content:center;align-items:center;gap:8px;min-height:48px;padding:0 18px;border-radius:14px;font-weight:700;border:1px solid transparent;text-decoration:none;background:transparent}
.btn.primary{background:var(--accent);color:var(--on-accent)}
.btn.primary:hover{background:var(--accent-strong)}
.btn.soft{background:var(--accent-soft);color:var(--accent)}
.btn.line{border-color:var(--line);background:var(--surface)}
.btn.paper{background:var(--paper);color:var(--ink)}
.btn.ghost-deep{border-color:rgba(255,255,255,.4);color:var(--on-deep);background:rgba(255,255,255,.06)}
.btn.sm{min-height:40px;padding:0 14px;font-size:14px}
.btn.block{width:100%}
.btn.danger{color:var(--danger);border-color:var(--line);background:transparent}
.btn.google{border-color:var(--line);background:var(--surface);color:var(--text);min-height:52px;font-size:16px}
.btn.google svg{width:20px;height:20px}
.btn:disabled{opacity:.5}
.icon-btn{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--surface);display:grid;place-items:center;color:var(--muted);flex:none}

/* Avatars */
.av{--c:var(--accent);width:30px;height:30px;border-radius:50%;background:var(--c);color:#fff;display:inline-grid;place-items:center;font-weight:700;font-size:13px;flex:none;border:2px solid var(--surface)}
.av.sm{width:24px;height:24px;font-size:11px}
.av.xs{width:18px;height:18px;font-size:10px;border-width:0;margin-right:6px;vertical-align:-4px}
.av.lg{width:44px;height:44px;font-size:18px}
.av.xl{width:84px;height:84px;font-size:34px;border-width:3px}
img.av{object-fit:cover;display:inline-block;background:var(--c)}
.avs{display:inline-flex}
.avs .av+.av{margin-left:-8px}

/* Lignes */
.row{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
.row:first-child{border-top:0}
.row .grow{flex:1;min-width:0;cursor:pointer}
.row .t{font-weight:600;overflow-wrap:anywhere}
.row .meta{font-size:13px;color:var(--muted);margin-top:1px}
.row .late{color:var(--danger);font-weight:600}
.row.is-done .t{text-decoration:line-through;color:var(--muted);font-weight:500}
.pts{display:inline-flex;align-items:center;gap:3px;background:var(--bronze-soft);color:var(--bronze);border-radius:99px;padding:1px 8px;font-size:12px;font-weight:700;font-variant-numeric:tabular-nums}
.pts .ic{width:12px;height:12px;fill:currentColor;stroke:none}
.chk{width:28px;height:28px;border-radius:50%;border:2px solid var(--ring);background:transparent;display:grid;place-items:center;color:transparent;flex:none;padding:0;transition:background .15s,border-color .15s}
.chk.on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.chk .ic{width:16px;height:16px;stroke-width:2.6}
.chk.big{width:32px;height:32px}
.group-title{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 6px;font-size:12px;text-transform:uppercase;letter-spacing:.1em;font-weight:700;color:var(--muted)}
.group-title.late{color:var(--danger)}
.group{margin-bottom:16px}
.empty{text-align:center;color:var(--muted);padding:26px 12px}
.empty b{display:block;color:var(--text);font-family:var(--serif);font-weight:600;font-size:19px;margin-bottom:4px}

/* Puces et onglets internes */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips.scroll{flex-wrap:nowrap;overflow-x:auto;margin-inline:-16px;padding-inline:16px;scrollbar-width:none}
.chips.scroll::-webkit-scrollbar{display:none}
.chip{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:12px;padding:9px 14px;font-weight:600;font-size:14px;white-space:nowrap;flex:none}
.chip.on{background:var(--deep);color:var(--on-deep);border-color:var(--deep)}
.chip .av{width:20px;height:20px;font-size:10px;border:0}
.seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;background:var(--surface2);border-radius:14px;padding:4px}
.seg button{border:0;background:transparent;border-radius:11px;min-height:42px;font-weight:700;color:var(--muted)}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.12)}

/* Courses */
.shop-hero{display:flex;flex-direction:column;gap:14px}
.shop-hero .big{display:flex;align-items:baseline;gap:10px}
.shop-hero .big strong{font-family:var(--serif);font-weight:600;font-size:52px;line-height:1}
.shop-hero .big span{color:var(--on-deep-muted)}
.bar{height:8px;border-radius:99px;background:var(--deep-line);overflow:hidden}
.bar>i{display:block;height:100%;border-radius:99px;background:var(--fill-on-deep);transition:width .3s}
.bar.light{background:var(--surface2)}
.bar.light>i{background:var(--accent)}
.hero-actions{display:flex;gap:8px;flex-wrap:wrap}
.search{position:relative}
.search input{width:100%;padding:14px 14px 14px 44px;border:1px solid var(--line);border-radius:14px;background:var(--surface);font-size:16px}
.search .ic{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--muted)}
.cat{background:var(--surface);border:1px solid var(--line);border-radius:22px;overflow:hidden}
.cat+.cat{margin-top:10px}
.cat-h{width:100%;display:flex;align-items:center;gap:10px;border:0;background:none;padding:15px 16px;text-align:left}
.cat-name{flex:1;font-size:13px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--bronze)}
.cat-count{background:var(--accent);color:var(--on-accent);border-radius:99px;font-size:12px;font-weight:700;min-width:22px;height:22px;padding:0 7px;display:inline-grid;place-items:center}
.cat-tot{color:var(--muted);font-size:12px}
.cat-h .ic{color:var(--muted);transition:transform .2s}
.cat-h[aria-expanded="true"] .ic{transform:rotate(180deg)}
.cat-body{padding:0 16px 8px;border-top:1px solid var(--line)}
.item{display:flex;align-items:center;gap:12px;min-height:48px;padding:6px 0;border-top:1px solid var(--line);cursor:pointer}
.item:first-child{border-top:0}
.bubble{width:24px;height:24px;border-radius:50%;border:2px solid var(--ring);display:grid;place-items:center;flex:none;color:transparent;transition:background .15s,border-color .15s}
.bubble .ic{width:14px;height:14px;stroke-width:2.8}
.item.on .bubble{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.item .nm{flex:1;min-width:0;overflow-wrap:anywhere}
.item.on .nm{font-weight:600}
.qty{display:inline-flex;align-items:center;gap:2px;background:var(--surface2);border-radius:12px;padding:2px}
.qty b{min-width:26px;text-align:center;font-variant-numeric:tabular-nums}
.qb{width:34px;height:34px;border:0;border-radius:10px;background:transparent;font-size:20px;line-height:1;color:var(--accent);font-weight:700;display:grid;place-items:center}
.qb:disabled{opacity:.3}
.qb.del{color:var(--muted);font-size:22px}
.add-inline{display:flex;gap:8px;padding:8px 0 6px;border-top:1px solid var(--line)}
.add-inline input{flex:1;min-width:0;border:1px dashed var(--ring);border-radius:12px;padding:10px 12px;background:transparent;font-size:16px}
.add-inline button{width:44px;border:0;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}
.qtag{font-weight:700;color:var(--bronze);font-variant-numeric:tabular-nums}
.cart-cat{margin:0 0 4px;font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--bronze);padding-top:8px}
.addnew{display:flex;align-items:center;gap:10px;width:100%;border:1px dashed var(--accent);background:var(--accent-soft);color:var(--accent);border-radius:14px;padding:13px 14px;font-weight:700;text-align:left;margin-bottom:10px}

/* Tâches */
.quick{display:flex;gap:8px}
.quick input{flex:1;min-width:0;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);font-size:16px}
.quick button{width:52px;border:0;border-radius:14px;background:var(--accent);color:var(--on-accent);display:grid;place-items:center}
.toggle-done{display:flex;align-items:center;gap:8px;border:0;background:none;color:var(--muted);font-weight:700;font-size:13px;padding:6px 0}
.stars{display:flex;gap:8px;overflow-x:auto;margin-inline:-16px;padding-inline:16px;scrollbar-width:none}
.stars::-webkit-scrollbar{display:none}
.star-chip{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:8px 12px 8px 8px;flex:none}
.star-chip b{font-variant-numeric:tabular-nums}
.star-chip .ic{width:14px;height:14px;fill:var(--fill-on-deep);stroke:none}

/* Agenda */
.week-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}
.week-nav .lbl{font-weight:700;text-transform:capitalize}
.week{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.day{border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:8px 0 7px;display:flex;flex-direction:column;align-items:center;gap:2px;min-width:0}
.day small{font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:700}
.day b{font-size:17px;font-variant-numeric:tabular-nums}
.day i{width:6px;height:6px;border-radius:50%;background:transparent;margin-top:1px}
.day.has i{background:var(--bronze)}
.day.today{border-color:var(--accent)}
.day.on{background:var(--deep);color:var(--on-deep);border-color:var(--deep)}
.day.on small{color:var(--on-deep-muted)}
.day.on.has i{background:var(--fill-on-deep)}
.month{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.month .dow{text-align:center;font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:700;padding:4px 0}
.mcell{aspect-ratio:1;border:1px solid var(--line);background:var(--surface);border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:0;font-variant-numeric:tabular-nums;font-weight:600}
.mcell i{display:flex;gap:2px;height:5px}
.mcell i s{width:5px;height:5px;border-radius:50%;background:var(--bronze)}
.mcell.other{opacity:.38}
.mcell.today{border-color:var(--accent)}
.mcell.on{background:var(--deep);color:var(--on-deep);border-color:var(--deep)}
.mcell.on i s{background:var(--fill-on-deep)}
.ev{display:flex;gap:14px;align-items:center;padding:14px 0;border-top:1px solid var(--line);cursor:pointer}
.ev:first-child{border-top:0}
.ev .time{width:52px;flex:none;font-weight:700;font-variant-numeric:tabular-nums;color:var(--accent);font-size:15px}
.ev .time.all{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.ev .body{flex:1;min-width:0}
.ev .body b{display:block;overflow-wrap:anywhere}
.ev .meta{font-size:13px;color:var(--muted)}
.tag{display:inline-block;background:var(--bronze-soft);color:var(--bronze);font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;border-radius:8px;padding:2px 7px;margin-right:6px}
.tag.g{background:var(--accent-soft);color:var(--accent)}
.syncline{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.syncline button{margin-left:auto;border:0;background:none;color:var(--accent);font-weight:700;display:flex;align-items:center;gap:4px;padding:4px 0}
.spin .ic{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* Répartition / barres */
.share-row{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:10px 0;border-top:1px solid var(--line)}
.share-row:first-child{border-top:0}
.share-row .n{font-weight:600}
.share-row .s{font-size:12.5px;color:var(--muted)}
.cbar{display:grid;grid-template-columns:86px 1fr auto;gap:10px;align-items:center;padding:6px 0;font-size:14px}
.cbar .bar{height:10px}

/* Mur */
.composer{display:flex;flex-direction:column;gap:10px}
.composer textarea{width:100%;border:0;background:transparent;resize:none;font-size:16px;min-height:64px;padding:0;line-height:1.45}
.composer textarea:focus{outline:none}
.composer .bar-row{display:flex;align-items:center;gap:8px}
.composer .thumb{position:relative;width:88px;height:88px;border-radius:14px;overflow:hidden}
.composer .thumb img{width:100%;height:100%;object-fit:cover}
.composer .thumb button{position:absolute;top:4px;right:4px;width:24px;height:24px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;display:grid;place-items:center;padding:0}
.post{display:flex;flex-direction:column;gap:12px}
.post-head{display:flex;align-items:center;gap:10px}
.post-head b{display:block;line-height:1.2}
.post-head small{color:var(--muted)}
.post-head .icon-btn{margin-left:auto;width:34px;height:34px;border:0;background:transparent}
.post-text{white-space:pre-wrap;overflow-wrap:anywhere}
.post-img{width:100%;max-height:420px;object-fit:cover;border-radius:16px;background:var(--surface2);display:block}
.post-actions{display:flex;gap:6px}
.pa{display:inline-flex;align-items:center;gap:6px;border:0;background:var(--surface2);color:var(--muted);border-radius:99px;padding:7px 12px;font-weight:700;font-size:13.5px}
.pa.on{background:var(--danger-soft);color:var(--danger)}
.pa.on .ic{fill:currentColor}
.comments{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:10px}
.cm{display:flex;gap:8px;align-items:flex-start}
.cm .bub{background:var(--surface2);border-radius:14px;padding:6px 12px;font-size:14px;overflow-wrap:anywhere}
.cm .bub b{display:block;font-size:12px;color:var(--muted)}
.cm-form{display:flex;gap:8px}
.cm-form input{flex:1;min-width:0;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:var(--surface);font-size:16px}
.cm-form button{width:44px;border:0;border-radius:12px;background:var(--accent);color:var(--on-accent);display:grid;place-items:center}

/* Chat */
.chat{display:flex;flex-direction:column;min-height:100%}
.msgs{display:flex;flex-direction:column;gap:4px;flex:1;padding-bottom:12px}
.day-sep{align-self:center;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700;margin:12px 0 6px}
.msg{max-width:82%;padding:8px 13px;border-radius:18px;background:var(--surface);border:1px solid var(--line);overflow-wrap:anywhere;white-space:pre-wrap}
.msg small{display:block;font-size:12px;font-weight:700;color:var(--c,var(--accent));margin-bottom:1px}
.msg time{display:block;font-size:11px;opacity:.6;margin-top:2px;text-align:right}
.msg.me{align-self:flex-end;background:var(--accent);color:var(--on-accent);border-color:var(--accent);border-bottom-right-radius:6px}
.msg.you{align-self:flex-start;border-bottom-left-radius:6px}
.main.chatmode{padding-bottom:0;display:flex;flex-direction:column}
.main.chatmode .chat{flex:1}
.chat-form{position:sticky;bottom:0;margin:0 -16px;padding:10px 16px 12px;background:var(--bg);border-top:1px solid var(--line);display:flex;gap:8px}
.chat-form input{flex:1;min-width:0;padding:13px 16px;border:1px solid var(--line);border-radius:99px;background:var(--surface);font-size:16px}
.chat-form button{width:48px;height:48px;border:0;border-radius:50%;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;flex:none}

/* Plus */
.hub{display:flex;flex-direction:column;gap:10px}
.hub-item{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:12px 14px}
.hub-item .tile{width:44px;height:44px;border-radius:14px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}
.hub-item .tile .ic{width:22px;height:22px}
.hub-item b{display:block}
.hub-item small{color:var(--muted)}
.hub-item>.ic{color:var(--muted);transform:rotate(-90deg)}
.pill-s{display:inline-block;font-size:11.5px;font-weight:700;border-radius:99px;padding:2px 9px;background:var(--surface2);color:var(--muted)}
.pill-s.ok{background:var(--ok-soft);color:var(--ok)}
.pill-s.warn{background:var(--bronze-soft);color:var(--bronze)}
.pill-s.err{background:var(--danger-soft);color:var(--danger)}

/* Photos */
.photos{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
.ph{aspect-ratio:1;border:0;padding:0;border-radius:10px;overflow:hidden;background:var(--surface2)}
.ph img{width:100%;height:100%;object-fit:cover;display:block}
dialog.viewer{border:0;padding:0;background:#000;color:#fff;width:min(560px,100%);max-width:100%;height:100%;max-height:100%;margin:0 auto}
dialog.viewer::backdrop{background:#000}
.viewer .v-in{height:100%;display:flex;flex-direction:column}
.viewer .v-top{display:flex;justify-content:space-between;align-items:center;padding:calc(12px + env(safe-area-inset-top,0px)) 14px 8px}
.viewer img{flex:1;min-height:0;width:100%;object-fit:contain}
.viewer .v-cap{padding:12px 16px calc(16px + env(safe-area-inset-bottom,0px));display:flex;justify-content:space-between;gap:12px;align-items:center}
.viewer .icon-btn{background:rgba(255,255,255,.12);border:0;color:#fff}

/* Onglets du bas */
.tabs{flex:none;display:grid;grid-template-columns:repeat(5,1fr);background:var(--surface);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px))}
.tab{position:relative;border:0;background:none;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;padding:4px 0;font-size:11px;font-weight:600}
.tab .pill{display:grid;place-items:center;width:48px;height:30px;border-radius:999px;transition:background .2s}
.tab.on{color:var(--accent)}
.tab.on .pill{background:var(--accent-soft)}
.tab .badge{position:absolute;top:0;left:calc(50% + 6px);background:var(--bronze);color:var(--badge-ink);font-size:10.5px;font-weight:700;min-width:18px;height:18px;border-radius:99px;display:grid;place-items:center;padding:0 5px;font-variant-numeric:tabular-nums}
.tab .badge:empty{display:none}

/* Feuilles */
dialog.sheet{border:0;padding:0;background:var(--surface);color:var(--text);width:min(520px,100%);max-width:100%;max-height:92dvh;margin:auto auto 0;border-radius:26px 26px 0 0;box-shadow:var(--shadow)}
dialog.sheet::backdrop{background:rgba(8,28,26,.5);backdrop-filter:blur(3px)}
.sheet-in{display:flex;flex-direction:column;gap:18px;padding:20px 18px calc(20px + env(safe-area-inset-bottom,0px))}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.field{display:flex;flex-direction:column;gap:8px}
.field label,.field .lab{font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}
.field input[type=text],.field input[type=date],.field input[type=time],.field input[type=email],.field input[type=tel],.field input[type=number],.field textarea,.field select{width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:16px;min-height:48px}
.field textarea{resize:none;line-height:1.5}
.field .two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.field .two>.field{min-width:0}
.actions{display:flex;flex-direction:column;gap:8px}
.mrow{display:flex;align-items:center;gap:10px}
.mrow input,.mrow select{min-width:0;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:16px}
.mrow input{flex:1}
.swatches{display:flex;gap:10px;flex-wrap:wrap}
.swatch{--c:var(--accent);width:40px;height:40px;border-radius:50%;border:3px solid var(--surface);box-shadow:0 0 0 1.5px var(--ring);background:var(--c);flex:none;padding:0}
.swatch.on{box-shadow:0 0 0 3px var(--text)}
.member{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;padding:12px 0;border-top:1px solid var(--line)}
.member:first-child{border-top:0}
.member .ctrl{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.member select{border:1px solid var(--line);border-radius:10px;background:var(--surface);padding:8px 10px;font-size:14px}

/* Connexion */
.login{min-height:100%;display:grid;place-items:center;padding:calc(24px + env(safe-area-inset-top,0px)) 16px calc(24px + env(safe-area-inset-bottom,0px));background:var(--bg)}
.login-card{width:min(440px,100%);background:var(--surface);border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow);padding:30px 26px;display:flex;flex-direction:column;gap:18px}
.login-card .brand{margin-bottom:6px}
.login-card h1{font-family:var(--serif);font-weight:600;font-size:clamp(32px,9vw,42px);line-height:1.05;margin:0;text-wrap:balance}
.login-card p{margin:0;color:var(--muted)}
.login-note{border-top:1px solid var(--line);padding-top:16px;font-size:12.5px;color:var(--muted)}
.login-note a{color:var(--accent);font-weight:600}

/* Pages publiques (confidentialité, conditions) */
.legal{max-width:720px;margin:0 auto;padding:calc(28px + env(safe-area-inset-top,0px)) 20px calc(48px + env(safe-area-inset-bottom,0px));height:auto}
.legal .brand{margin-bottom:28px;text-decoration:none}
.legal h1{font-family:var(--serif);font-weight:600;font-size:clamp(32px,8vw,44px);line-height:1.08;margin:0 0 6px;text-wrap:balance}
.legal h2{font-size:22px;margin:32px 0 8px}
.legal p,.legal li{max-width:65ch;color:var(--text)}
.legal li{margin-bottom:6px}
.legal .muted{color:var(--muted)}
.legal a{color:var(--accent);font-weight:600}
.legal .foot{margin-top:40px;padding-top:16px;border-top:1px solid var(--line);font-size:13px;color:var(--muted)}
html:has(.legal),body:has(.legal){height:auto}
.dev-box{border:1px dashed var(--bronze);border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;font-size:13px}
.dev-box b{color:var(--bronze)}
.dev-box input,.dev-box select{padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:15px}

/* Notification */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom,0px));background:var(--deep);color:var(--on-deep);border-radius:14px;padding:12px 14px 12px 16px;display:flex;align-items:center;gap:14px;box-shadow:var(--shadow);width:min(440px,calc(100% - 32px));font-size:14px;z-index:20}
.toast button{border:0;background:none;color:var(--fill-on-deep);font-weight:700;padding:4px 6px;margin-left:auto}

@media (prefers-reduced-motion: reduce){*{transition:none!important;scroll-behavior:auto!important;animation:none!important}}

/* Profil */
.prof-photo{display:flex;gap:16px;align-items:center}
.prof-body{flex:1;min-width:0}
.prof-body p{margin:2px 0 10px}
.prof-actions{display:flex;flex-wrap:wrap;gap:8px}
.prof-bg{display:flex;flex-direction:column;gap:12px}
.bg-preview{height:120px;border-radius:16px;border:1px dashed var(--ring);display:grid;place-items:center;position:relative;overflow:hidden;background:var(--bg)}
.bg-preview::before{content:"";position:absolute;inset:0;background:var(--bg-img) center/cover no-repeat;opacity:var(--bg-op,.15)}
.bg-preview>span{position:relative}
input[type=range]{width:100%;accent-color:var(--accent);min-height:32px}

/* Choix de langue (écran de connexion) */
.login-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.lang-switch{display:inline-flex;background:var(--surface2);border-radius:999px;padding:3px;flex:none}
.lang-switch button{border:0;background:transparent;color:var(--muted);font-weight:700;font-size:12.5px;letter-spacing:.06em;border-radius:999px;padding:6px 12px}
.lang-switch button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.12)}
