/* ───────────── Rythme — styles ───────────── */
:root {
  --bg: #F4F1EA;
  --surface: #FFFFFF;
  --surface-2: #EEEAE1;
  --ink: #16151A;
  --ink-2: #44414B;
  --muted: #858190;
  --line: #E3DED3;
  --line-soft: #EDE9E0;
  --accent: #FF5A36;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFE4DC;
  --ok: #1FA874;
  --danger: #E5484D;
  --shadow: 0 1px 2px rgba(22, 21, 26, .05), 0 8px 24px -12px rgba(22, 21, 26, .18);
  --shadow-lg: 0 24px 60px -20px rgba(22, 21, 26, .35);
  --radius: 18px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111014; --surface: #1B1A20; --surface-2: #24222A; --ink: #F3F0EA; --ink-2: #C9C5CF;
    --muted: #8D8996; --line: #2C2A32; --line-soft: #232128; --accent: #FF6B47; --accent-soft: #3A1F18;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111014; --surface: #1B1A20; --surface-2: #24222A; --ink: #F3F0EA; --ink-2: #C9C5CF;
  --muted: #8D8996; --line: #2C2A32; --line-soft: #232128; --accent: #FF6B47; --accent-soft: #3A1F18;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
ion-icon { display: block; flex: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── Shell ── */
.app { min-height: 100%; }
main {
  position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px); outline: none;
}
main > * { max-width: 860px; margin-left: auto; margin-right: auto; }
main.wide > * { max-width: 1180px; }

/* Tab bar verre dépoli, flat (mobile) : capsule fixe + bouton rond séparé */
:root {
  --glass-bg: rgba(255,255,255,.72);
  --glass-border: rgba(22,21,26,.07);
  --glass-shadow: 0 8px 24px -14px rgba(22,21,26,.30);
  --glass-lens: rgba(22,21,26,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --glass-bg: rgba(36,34,42,.74); --glass-border: rgba(255,255,255,.08); --glass-shadow: 0 8px 24px -12px rgba(0,0,0,.7); --glass-lens: rgba(255,255,255,.09); }
}
:root[data-theme="dark"] { --glass-bg: rgba(36,34,42,.74); --glass-border: rgba(255,255,255,.08); --glass-shadow: 0 8px 24px -12px rgba(0,0,0,.7); --glass-lens: rgba(255,255,255,.09); }

.tabbar {
  position: fixed; z-index: 30; left: 14px; right: 14px; bottom: max(8px, calc(var(--safe-b) - 6px));
  display: flex; align-items: center; gap: 10px; pointer-events: none; transform: translateZ(0);
}
.tabbar > * { pointer-events: auto; }
.glass {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.tabs {
  flex: 1; height: 60px; border-radius: 999px; padding: 4px;
  display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); align-items: stretch;
}
.tab[data-view="week"] { display: none; }
.tab-lens {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 3)); border-radius: 999px; z-index: 0;
  background: var(--glass-lens);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .35s cubic-bezier(.3, 1.2, .5, 1);
}
.brand { display: none; }
.tab { position: relative; z-index: 1; -webkit-user-select: none; user-select: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-2); font-size: 10.5px; font-weight: 700; border-radius: 999px; transition: color .2s, transform .15s; }
.tab ion-icon { font-size: 23px; }
.tab.active { color: var(--accent); }
.tab:active { transform: scale(.92); }
.fab {
  width: 60px; height: 60px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
  background: var(--accent) !important; border-color: transparent !important;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 90%, transparent) !important;
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.fab:active { transform: scale(.9); }
.fab ion-icon { font-size: 30px; }
.fab-label { display: none; }

/* Logo mobile dans l'en-tête */
.mlogo { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.mlogo img, .brand img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 2px 6px -2px rgba(0,0,0,.35); }

@media (min-width: 900px) {
  .tabbar {
    top: 0; left: 0; right: auto; bottom: 0; width: 232px; padding: 28px 16px; border-right: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 4px; background: var(--bg); pointer-events: auto;
  }
  .tabs { display: flex; flex-direction: column; height: auto; padding: 0; border-radius: 0; gap: 4px;
    background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tab-lens { display: none; }
  .tab[data-view="week"] { display: flex; }
  .brand { order: -2; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 22px; padding: 0 10px 22px; letter-spacing: -.02em; }
  .brand img { width: 36px; height: 36px; border-radius: 10px; }
  .mlogo { display: none; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; font-weight: 600; padding: 11px 12px; border-radius: 12px; color: var(--muted); }
  .tab ion-icon { font-size: 21px; }
  .tab.active { background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
  .fab { order: -1; width: 100%; height: 46px; margin: 0 0 14px; border-radius: 14px; display: flex; gap: 8px; justify-content: center; font-weight: 700; }
  .fab::before { display: none; }
  .fab ion-icon { font-size: 22px; }
  .fab-label { display: inline; }
  main { left: 232px; padding: 0 32px 48px; }
}

/* ── Topbar ── */
.topbar { padding: calc(var(--safe-t) + 18px) 20px 10px; display: flex; align-items: flex-end; gap: 12px; }
.topbar .titles { flex: 1; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.h1 { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.02; letter-spacing: -.03em; margin: 4px 0 0; }
.h1 small { font-weight: 500; color: var(--muted); font-size: .6em; letter-spacing: -.01em; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--ink);
  background: var(--surface); box-shadow: var(--shadow); font-size: 20px; flex: none;
}
.pill-btn { height: 40px; padding: 0 14px; border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; }
.btn-group { display: flex; gap: 8px; }

/* ── Week strip ── */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 8px 16px 6px; }
.strip button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 9px; border-radius: 14px; color: var(--muted); }
.strip .dn { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.strip .dd { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--ink); }
.strip .dots { display: flex; gap: 3px; height: 5px; }
.strip .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.strip .dots i.on { background: var(--accent); }
.strip button.today .dd { color: var(--accent); }
.strip button.sel { background: var(--ink); color: color-mix(in srgb, var(--bg) 70%, transparent); }
.strip button.sel .dd { color: var(--bg); }
.strip button.sel .dots i { background: color-mix(in srgb, var(--bg) 35%, transparent); }
.strip button.sel .dots i.on { background: var(--accent); }

/* ── Sections ── */
.section { margin: 14px 16px 0; }
.sec-head { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.sec-head h2 { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0; flex: 1; }
.sec-head .count { color: var(--muted); font-weight: 600; font-size: 13px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.ring { width: 34px; height: 34px; flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--ok); stroke-linecap: round; transition: stroke-dashoffset .4s ease; transform: rotate(-90deg); transform-origin: 50% 50%; }

/* ── Checklist ── */
.check { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line-soft); position: relative; }
.check:first-child { border-top: 0; }
.cbox {
  width: 26px; height: 26px; border-radius: 9px; border: 2px solid color-mix(in srgb, var(--c, var(--muted)) 70%, var(--line));
  display: grid; place-items: center; flex: none; color: #fff; font-size: 17px; transition: background .15s, border-color .15s, transform .15s;
}
.cbox ion-icon { opacity: 0; transform: scale(.4); transition: .18s; }
.check.done .cbox { background: var(--c, var(--ok)); border-color: var(--c, var(--ok)); }
.check.done .cbox ion-icon { opacity: 1; transform: none; }
.cbox:active { transform: scale(.9); }
.check .body { flex: 1; min-width: 0; }
.check .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin-top: 2px; flex-wrap: wrap; }
.meta ion-icon { font-size: 13px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.tico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex: none;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); }
.more { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 14px; }
.empty ion-icon { font-size: 30px; margin: 0 auto 8px; color: var(--line); }

/* ── Timeline (jour) ── */
.timeline { position: relative; margin: 0; padding: 10px 0; }
.tl-inner { position: relative; }
.hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.hour span { position: absolute; left: 12px; top: -9px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface); padding-right: 6px; font-variant-numeric: tabular-nums; }
.half { position: absolute; left: 58px; right: 0; border-top: 1px dashed var(--line-soft); }
.evts { position: absolute; left: 58px; right: 10px; top: 0; bottom: 0; }
.evt {
  position: absolute; border-radius: 12px; padding: 6px 9px; overflow: hidden; text-align: left;
  background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--ink);
  border-left: 3px solid var(--c); box-shadow: 0 1px 0 rgba(0,0,0,.02);
  display: flex; flex-direction: column; gap: 1px; transition: transform .12s;
}
.evt:active { transform: scale(.985); }
.evt .et { font-weight: 700; font-size: 13.5px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.evt .et span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt .et ion-icon { font-size: 15px; color: var(--c); }
.evt .eh { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.evt .ea { font-size: 11.5px; color: var(--ink-2); display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt .ea ion-icon { font-size: 12px; flex: none; }
.evt.short { flex-direction: row; align-items: center; gap: 8px; padding-top: 2px; padding-bottom: 2px; }
.evt.done { opacity: .5; }
.evt.done .et span { text-decoration: line-through; }
.evt .tick { position: absolute; right: 7px; top: 6px; font-size: 16px; color: var(--c); }
.nowline { position: absolute; left: 50px; right: 0; height: 2px; background: var(--accent); z-index: 3; pointer-events: none; }
.nowline::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* ── Semaine ── */
.week-wrap { margin: 8px 16px 0; }
.week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.wgrid { display: grid; grid-template-columns: 46px repeat(7, minmax(92px, 1fr)); min-width: 690px; }
.whead { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.whead button { padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; }
.whead .dn { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.whead .dd { font-family: var(--display); font-size: 20px; font-weight: 700; }
.whead .today .dd { color: #fff; background: var(--accent); border-radius: 10px; padding: 0 8px; }
.wfloat { border-bottom: 1px solid var(--line); padding: 6px 4px; display: flex; flex-direction: column; gap: 3px; min-height: 34px; }
.wfloat .chip { font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--ink-2); display: flex; gap: 4px; align-items: center; }
.wfloat .chip.done { opacity: .45; text-decoration: line-through; }
.wfloat .chip ion-icon { font-size: 11px; color: var(--c); }
.wcol { position: relative; border-left: 1px solid var(--line-soft); }
.wtimes { position: relative; }
.wtimes span { position: absolute; right: 6px; font-size: 10.5px; font-weight: 600; color: var(--muted); transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.wline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.wcol.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.wevt { position: absolute; display: flex; flex-direction: column; justify-content: flex-start; border-radius: 8px; padding: 3px 5px; overflow: hidden; text-align: left; font-size: 11px; line-height: 1.2;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-left: 2.5px solid var(--c); }
.wevt b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wevt i { font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wevt.done { opacity: .45; }
.wlabel { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; border-bottom: 1px solid var(--line); }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 12.5px; padding: 12px 6px 0; flex-wrap: wrap; }

/* ── Liste des tâches ── */
.search { display: flex; align-items: center; gap: 10px; margin: 8px 16px 0; padding: 0 14px; height: 46px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 15px; color: var(--ink); }
.trow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; border-top: 1px solid var(--line-soft); }
.trow:first-child { border-top: 0; }
.trow .body { flex: 1; min-width: 0; }
.trow .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .chev { color: var(--muted); font-size: 16px; }
.seg-filter { display: flex; gap: 6px; margin: 12px 16px 0; overflow-x: auto; }
.seg-filter button { padding: 8px 14px; border-radius: 99px; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.seg-filter button.on { background: var(--ink); color: var(--bg); }

/* ── Réglages ── */
.list .row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line-soft); width: 100%; text-align: left; }
.list .row:first-child { border-top: 0; }
.list .row .body { flex: 1; min-width: 0; }
.list .row .sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.list .row .val { color: var(--muted); font-weight: 600; font-size: 14px; }
.list .row.danger { color: var(--danger); }
.sico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 17px; flex: none; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.status.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.status.warn { background: var(--accent-soft); color: var(--accent); }
.status.off { background: var(--surface-2); color: var(--muted); }
.note { color: var(--muted); font-size: 12.5px; padding: 8px 6px 0; line-height: 1.5; }
.note b { color: var(--ink-2); }
.mini-select, .mini-input { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 10px; font-weight: 600; font-size: 14px; outline: none; }
.mini-input { width: 150px; }

/* ── Feuilles (sheets) ── */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 9, 12, .38); opacity: 0; transition: opacity .22s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--safe-t) - 28px);
  background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .9, .25, 1); display: flex; flex-direction: column;
}
.sheet.show { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px 12px; flex: none; }
.sheet-head h3 { flex: 1; margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sheet-body { overflow-y: auto; padding: 0 18px calc(18px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; background: var(--bg); }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 540px; max-height: 88vh; border-radius: 24px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .25s, opacity .2s; }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet-head { padding-top: 18px; }
}

.btn { height: 50px; border-radius: 15px; font-weight: 700; font-size: 15.5px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn ion-icon { font-size: 20px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); flex: 1; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.btn.block { width: 100%; }

.field { margin-top: 14px; }
.field > label, .flabel { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 7px 4px; }
.input, .select, textarea.input {
  width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface); padding: 0 14px;
  font-size: 16px; outline: none; box-shadow: var(--shadow); transition: border-color .15s; appearance: none; -webkit-appearance: none;
}
textarea.input { height: 84px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); }
.input.big { height: 56px; font-size: 19px; font-weight: 700; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='none' stroke='%23858190' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; padding-right: 38px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .field { margin-top: 14px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.segmented button { height: 42px; border-radius: 11px; font-weight: 700; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 7px; }
.segmented button ion-icon { font-size: 18px; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.hint { font-size: 12.5px; color: var(--muted); margin: 7px 4px 0; }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { height: 42px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.days button.on { background: var(--ink); color: var(--bg); }

.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; padding: 4px; justify-items: center; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; background: var(--c); position: relative; }
.swatches button.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2.5px solid var(--c); }
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icons button { height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow); }
.icons button.on { background: var(--c); color: #fff; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.collapsible[hidden] { display: none; }

/* Détail */
.detail-hero { display: flex; gap: 14px; align-items: center; padding: 4px 0 16px; }
.detail-hero .tico { width: 52px; height: 52px; border-radius: 16px; font-size: 26px; }
.detail-hero h4 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
.kv { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.kv div { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.kv div:first-child { border-top: 0; }
.kv ion-icon { font-size: 19px; color: var(--muted); }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Toast */
#toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; display: flex; gap: 12px; align-items: center; white-space: nowrap; box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: var(--accent); font-weight: 800; }
@media (min-width: 900px) { #toast { left: calc(50% + 116px); bottom: 28px; } }

/* Install banner */
.install { margin: 14px 16px 0; padding: 14px; border-radius: var(--radius); background: var(--ink); color: var(--bg); display: flex; gap: 12px; align-items: center; }
.install ion-icon { font-size: 26px; color: var(--accent); }
.install p { margin: 0; font-size: 13.5px; flex: 1; }
.install b { display: block; font-size: 15px; }
.install .x { color: color-mix(in srgb, var(--bg) 60%, transparent); font-size: 20px; }

.fade-in { animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Adresse cliquable dans le détail */
.kv a { color: var(--accent); font-weight: 600; text-decoration: none; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-icon { position: relative; }
.input-icon ion-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 19px; pointer-events: none; }
.input-icon .input { padding-left: 42px; }

/* Compteur « X fois par jour » */
.cbox.multi { border-radius: 50%; font-size: 12px; font-weight: 800; color: var(--c); background: conic-gradient(color-mix(in srgb, var(--c) 30%, transparent) calc(var(--p) * 1turn), transparent 0); }
.check.done .cbox.multi { color: #fff; }
.times-dots { display: inline-flex; gap: 3px; }
.times-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.times-dots i.on { background: var(--c); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 44px; border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); font-size: 20px; display: grid; place-items: center; }
.stepper output { min-width: 64px; text-align: center; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }

/* Listes de suggestions (adresses, tâches existantes) */
.suggest-wrap { position: relative; }
.suggest {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; max-height: 280px; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest .sh { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px 4px; }
.suggest button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.suggest button:first-of-type { border-top: 0; }
.suggest button:active, .suggest button.hl { background: var(--surface-2); }
.suggest .tico { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
.suggest .st { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest .ss { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest .body { flex: 1; min-width: 0; }
.suggest .pin { color: var(--muted); font-size: 18px; }
.suggest .use { font-size: 12px; font-weight: 700; color: var(--accent); flex: none; }
