/* Direction « Craie » : blanc cassé dominant, bleu en touches, formes rondes (Nunito).
   L'orange est réservé à l'essentiel : aujourd'hui, « + », échéances, anniversaires. */
:root {
  --bg: #f5f4f0; --card: #fcfcfa; --ink: #1b2a4a; --muted: #5a647b; --line: #e5e3dc; --soft: #ecebe5; --grey: #d3d1c9;
  --nav: #fcfcfa; --nav-2: #dce5f8; --on-nav: #1b2a4a; --nav-muted: #5a647b;
  --accent: #33559e; --on-accent: #ffffff; --blue: #6e97f0;
  --hot: #ff6a13; --on-hot: #1b2a4a;
  --pro: #33559e; --perso: #17707c; --birthday: #a84300; --absence: #3d68b8; --off: #dce5f8; --danger: #b3261e;
  --radius: 20px;
  --in: #13968a; --out: #33559e; /* graphique : couleurs vérifiées pour le daltonisme */
  --edge: transparent; /* liseré des couleurs de projet en mode sombre */
  --font: Nunito, ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121826; --card: #1b2335; --ink: #f2f1eb; --muted: #acb4c7; --line: #2c3650; --soft: #252f47; --grey: #46516e;
  --nav: #1b2335; --nav-2: #2c3d66; --on-nav: #f2f1eb; --nav-muted: #acb4c7; --accent: #a4bcf6; --on-accent: #121826;
  --pro: #a4bcf6; --perso: #62cdd5; --birthday: #ff9455; --absence: #a4bcf6; --off: #29395f; --danger: #ff8a82; --edge: rgb(255 255 255 / .45); --in: #1fa597; --out: #6a8ae6; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #121826; --card: #1b2335; --ink: #f2f1eb; --muted: #acb4c7; --line: #2c3650; --soft: #252f47; --grey: #46516e;
  --nav: #1b2335; --nav-2: #2c3d66; --on-nav: #f2f1eb; --nav-muted: #acb4c7; --accent: #a4bcf6; --on-accent: #121826;
  --pro: #a4bcf6; --perso: #62cdd5; --birthday: #ff9455; --absence: #a4bcf6; --off: #29395f; --danger: #ff8a82; --edge: rgb(255 255 255 / .45); --in: #1fa597; --out: #6a8ae6; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 15.5px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 800; }
h1 { font-size: 30px; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: 17.5px; }
b { font-weight: 700; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }

/* Navigation */
.mainnav { position: fixed; inset: 0 auto 0 0; width: 216px; padding: 22px 12px; display: flex; flex-direction: column; gap: 3px; background: var(--nav); color: var(--on-nav); z-index: 5; border-right: 1px solid var(--line); }
.mainnav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius); text-decoration: none; font-weight: 500; color: var(--nav-muted); border-radius: 999px; }
.mainnav a span { display: flex; font-size: 17px; }
.mainnav a:hover, .mainnav a.on { background: var(--nav-2); color: var(--on-nav); }
.mainnav a.on { font-weight: 800; }
.mainnav .brand { font-size: 19px; color: var(--on-nav); margin-bottom: 20px; font-size: 20px; }
.mainnav .brand:hover { background: none; }
.fab { order: 1; margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--hot); color: var(--on-hot); border-radius: var(--radius); padding: 12px; font-weight: 700; border-radius: 999px; }
.fab .ic { width: 20px; height: 20px; }
.fab em { font-style: normal; }
.mainnav .settings { order: 2; margin-top: auto; }
.gear { display: none; }
main { margin-left: 216px; padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1340px; }

/* Briques */
.card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; min-width: 0; padding: 18px 20px; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.card.flush { padding: 8px; padding: 10px; }
.stack, .col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.narrow { max-width: 640px; }
.narrow p { margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--grey); background: transparent; font-weight: 700; text-decoration: none; white-space: nowrap; border-radius: 999px; padding-inline: 18px; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 34px; padding: 4px 11px; font-size: 13px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border: 0; border-radius: var(--radius); background: transparent; font-size: 20px; line-height: 1; border-radius: 999px; }
.icon-btn:hover { background: var(--soft); }
.more { font-size: 13px; color: var(--muted); text-decoration: none; font-weight: 700; }
.linkish { background: none; border: 0; padding: 0; }
.empty { color: var(--muted); padding: 10px 0 4px; }
.note { background: var(--soft); border-radius: var(--radius); padding: 11px 14px; margin: 8px 0; font-size: 14px; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius); background: var(--soft); white-space: nowrap; border-radius: 999px; }
.pill.soonish, .pill.hot { background: var(--hot); color: var(--on-hot); }
.pill.late { background: var(--danger); color: var(--card); }

.pro { --c: var(--pro); } .perso { --c: var(--perso); } .birthday { --c: var(--birthday); } .absence { --c: var(--absence); } .neutral, .holiday { --c: var(--muted); }

.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 11px 0; }
.card > header + .row, .card > .row:first-child { border-top: 0; }
.row::before { content: ""; width: 3px; align-self: stretch; background: var(--c); flex: none; border-radius: 4px; width: 4px; }
.row .time { width: 46px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.row .time small { display: block; font-weight: 400; color: var(--muted); }
.row .time .ic { width: 20px; height: 20px; color: var(--c); }
.row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.row .what small { color: var(--muted); }
.row .tag { font-size: 12px; font-weight: 700; color: var(--c); }

.chip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; padding: 2px 6px; border-radius: 3px; background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 78%, var(--ink)); border-radius: 8px; font-weight: 600; }

/* Aujourd'hui */
.demo { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; border: 1px dashed var(--grey); border-radius: var(--radius); padding: 7px 8px 7px 14px; margin-bottom: 14px; font-size: 13.5px; }
.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 12px; padding: 26px 28px; border-radius: var(--radius); background: var(--nav); color: var(--on-nav); padding: 26px 28px; }
.hello { min-width: 0; flex: 1 1 300px; }
.hero h1 { font-size: 40px; margin: 2px 0 8px; }
.eyebrow { font-weight: 500; color: var(--muted); }
.hero .eyebrow { color: var(--nav-muted); }
.summary { font-size: 16px; }
.status { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; padding: 5px 12px; border-radius: var(--radius); background: var(--nav-2); font-weight: 700; font-size: 13.5px; border-radius: 999px; }
.status .ic { color: var(--hot); color: var(--pro); }
.weather { display: flex; gap: 16px; align-items: center; background: var(--nav-2); border-radius: var(--radius); padding: 16px 20px; flex: 0 1 480px; min-width: min(100%, 320px); color: var(--ink); }
.weather .muted { color: var(--nav-muted); color: var(--muted); }
.wicon { display: flex; color: var(--hot); color: var(--pro); }
.wicon .ic { width: 46px; height: 46px; stroke-width: 1.4; }
.advice { display: flex; align-items: flex-start; gap: 7px; font-weight: 700; margin: 4px 0 2px; }
.advice .ic { margin-top: 2px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.section { margin: 26px 0 10px; }
.soon { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.bubble { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 18px; border: 0; border-radius: var(--radius); background: var(--card); text-align: left; text-decoration: none; }
.bubble > .ic { box-sizing: content-box; width: 24px; height: 24px; padding: 10px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); margin-bottom: 8px; }
.bubble.birthday > .ic { background: var(--hot); color: var(--on-hot); }
.bubble b { font-weight: 800; font-size: 19px; font-size: 19px; }
.bubble small { color: var(--muted); overflow-wrap: anywhere; }
.weekcard { margin-top: 24px; }
.avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--soft); }
.row.birthday:has(.avatar)::before { display: none; }
.row.past { opacity: .5; }
.soonrow::before { display: none; }
.bico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.soonrow.birthday .bico { background: var(--hot); color: var(--on-hot); }
.weekline { display: flex; gap: 12px; width: 100%; align-items: flex-start; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 9px 0; }
header + .weekline { border-top: 0; }
.weekline .when { width: 74px; flex: none; }
.weekline .chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.weekline.static { cursor: default; }
.static .chip { white-space: normal; }

/* Projets et jours travaillés (--p : couleur du projet, --t : texte posé dessus) */
.workchips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.col .workchips { flex-direction: column; }
.col .wchip { min-height: 48px; border-radius: 16px; }
.wchip { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; min-height: 40px; padding: 6px 13px 6px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: none; font-weight: 500; font-size: 13.5px; text-align: left; border-radius: 999px; }
.wchip i { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 3px; border: 2px solid var(--p); box-shadow: 0 0 0 1px var(--grey); font-style: normal; color: var(--t); border-radius: 50%; }
.wchip.on { background: var(--soft); border-color: var(--ink); }
.wchip.on i { background: var(--p); }
.sub { font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.mt { margin-top: 10px; }
.band { display: block; height: 17px; flex: none; padding: 0 6px; border-radius: 3px; background: var(--p); color: var(--t); font-size: 11px; font-weight: 700; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 999px; padding: 0 8px; }
.band.ghost { visibility: hidden; }
.band.cl { margin-left: -8px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.band.cr { margin-right: -8px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.band.future, .tl-row .on.future { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--p) 45%, var(--card)) 0 4px, color-mix(in srgb, var(--p) 12%, var(--card)) 4px 8px); color: var(--ink); }
.timeline { overflow-x: auto; position: relative; padding-bottom: 14px; }
.tl { min-width: calc(var(--n) * 30px); }
.tl-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.tl-row > * { display: flex; align-items: center; justify-content: center; height: 32px; min-width: 0; padding: 0; border: 0; border-radius: 3px; background: var(--soft); font-size: 12px; border-radius: 9px; }
.tl-row .we { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.tl-row .away { background: var(--off); }
.tl-row .on { background: var(--p); color: var(--t); box-shadow: inset 0 0 0 1px var(--edge); }
.tl-row .now { outline: 2px solid var(--hot); outline-offset: -2px; }
.tl-row .due { color: var(--on-hot); background: var(--hot); }
.tl-head > * { height: 42px; background: none; box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; }
.tl-head small { color: var(--muted); font-size: 11px; font-weight: 400; }
.tl-head .we { color: var(--muted); }
.tl-head .now { background: var(--hot); color: var(--on-hot); outline: 0; }
.tl-head .now small { color: var(--on-hot); }
.tl-project { margin-top: 14px; }
.tl-name { position: sticky; left: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; max-width: min(100%, 78vw); margin-bottom: 5px; padding: 0; border: 0; background: none; text-align: left; }
.tl-name i { width: 11px; height: 11px; background: var(--p); box-shadow: 0 0 0 1px var(--grey); flex: none; border-radius: 50%; }
.tl-name b { max-width: calc(100% - 22px); }
.tl-name small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches label { position: relative; width: 36px; height: 36px; cursor: pointer; }
.swatches input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatches i { position: absolute; inset: 4px; border-radius: 3px; background: var(--p); box-shadow: 0 0 0 1px var(--grey); pointer-events: none; border-radius: 50%; }
.swatches input:checked + i { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.swatches input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 5px; }
.picker { background: var(--soft); border-radius: var(--radius); padding: 8px 10px 10px; border-radius: 18px; }
.picker p { font-size: 12.5px; margin-top: 6px; }
.pick-head { display: flex; justify-content: space-between; align-items: center; text-transform: capitalize; }
.pick-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.pick-grid button { height: 38px; padding: 0; border: 0; border-radius: 3px; background: var(--card); font-weight: 700; border-radius: 12px; }
.pick-grid .we { background: transparent; color: var(--muted); }
.pick-grid .now { box-shadow: inset 0 0 0 2px var(--hot); }
.pick-grid .on { background: var(--accent); color: var(--on-accent); }
.projlegend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.projlegend li { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 9px; align-items: center; }
.projlegend i { width: 12px; height: 12px; background: var(--p); box-shadow: 0 0 0 1px var(--grey); border-radius: 50%; }
.projlegend span { grid-column: 2; font-size: 13px; color: var(--muted); }

.band, .row.project::before { box-shadow: inset 0 0 0 1px var(--edge); }
.mission::before { box-shadow: inset 0 0 0 1px var(--edge); }

/* Calendrier */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stepper { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stepper h1 { min-width: 230px; text-align: center; font-size: 25px; }
.stepper h2 { min-width: 70px; text-align: center; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--soft); border-radius: var(--radius); padding: 3px; gap: 2px; border-radius: 999px; }
.segmented button { border: 0; background: none; border-radius: 4px; padding: 7px 14px; font-weight: 700; border-radius: 999px; }
.segmented button.on { background: var(--accent); color: var(--on-accent); }
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--grey); background: none; border-radius: var(--radius); padding: 7px 14px; font-weight: 700; color: var(--muted); border-radius: 999px; }
.toggle::before { content: ""; width: 11px; height: 11px; border: 2px solid var(--c); border-radius: 2px; border-radius: 50%; }
.toggle.on { background: var(--card); border-color: var(--ink); color: var(--ink); }
.toggle.on::before { background: var(--c); }
.toggle.work { --c: var(--blue); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dh { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 5px 0; }
.day { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 112px; padding: 5px; border: 1.5px solid transparent; border-radius: var(--radius); background: none; text-align: left; min-width: 0; border-radius: 14px; }
.day:hover { background: var(--soft); }
.day.we { background: color-mix(in srgb, var(--soft) 70%, transparent); }
.day.off, .md.off { background: var(--off); }
.day.out { opacity: .38; }
.day.sel { border-color: var(--ink); }
.day .n { font-weight: 700; font-size: 13px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.today .n, .md.today { background: var(--hot) !important; color: var(--on-hot) !important; }
.more-n { font-size: 11.5px; color: var(--muted); padding-left: 4px; }
.day i { display: none; }
i u, .legend u { width: 6px; height: 6px; border-radius: 50%; background: var(--c); display: inline-block; }
u.birthday, .legend u.birthday { background: var(--hot); }
.legend u.absence { width: 12px; height: 12px; border-radius: 2px; background: var(--off); box-shadow: 0 0 0 1px var(--grey); border-radius: 50%; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mini h2 { margin-bottom: 6px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.md { border: 0; background: none; border-radius: 4px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; padding: 0; border-radius: 10px; }
.md.we { color: var(--muted); }
.md i { display: flex; gap: 2px; height: 6px; font-style: normal; }
.md i u { width: 5px; height: 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend s { width: 16px; height: 12px; border-radius: 4px; background: var(--p, var(--pro)); box-shadow: 0 0 0 1px var(--edge); text-decoration: none; }
.legend s.plan { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--pro) 55%, var(--card)) 0 3px, color-mix(in srgb, var(--pro) 12%, var(--card)) 3px 6px); }
.legend s.off { background: var(--off); box-shadow: 0 0 0 1px var(--grey); }
.phone-only { display: none; }
.cal-layout .legend { margin: 0; }

/* Pro et perso */
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--grey); margin-bottom: 18px; }
.subnav a { padding: 9px 13px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; }
.subnav a.on { color: var(--ink); border-color: var(--hot); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; }
.board-filter { display: none; }
.lane { background: var(--soft); border-radius: var(--radius); padding: 8px; min-height: 140px; display: flex; flex-direction: column; gap: 8px; }
.lane h2 { padding: 4px; display: flex; justify-content: space-between; }
.lane h2 small { color: var(--muted); }
.lane .empty { padding: 4px; font-size: 13px; }
.mission { background: var(--card); border-radius: 16px; padding: 13px 14px; overflow-wrap: anywhere; }
.mission::before { content: ""; display: block; width: 32px; height: 6px; margin-bottom: 8px; border-radius: 999px; background: var(--p); }
.mission[draggable] { cursor: grab; }
.mission-title { background: none; border: 0; padding: 0; text-align: left; font-weight: 700; line-height: 1.3; }
.mission h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.delivs { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.deliv { font-size: 13px; font-weight: 700; color: var(--pro); }
.mfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-top: 10px; }
.weekgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat small { color: var(--muted); font-weight: 700; }
.stat b { font-weight: 800; font-size: 30px; }
.stat .muted { font-size: 12.5px; }
.meter { height: 6px; background: var(--soft); overflow: hidden; margin: 3px 0; border-radius: 99px; }
.meter span { display: block; height: 100%; background: var(--blue); }

/* Vue partagée : neutre, toujours claire */
.shared { --ink: #202227; --card: #ffffff; --soft: #f0f0f1; --line: #e0e0e2; --grey: #c9cacd; --muted: #5d5f66; --accent: #202227; --on-accent: #ffffff; --hot: #202227; --on-hot: #ffffff; --pro: #202227; --absence: #5d5f66; --off: #dfe5ee; --danger: #b3261e; --edge: transparent; --radius: 14px; display: flex; flex-direction: column; gap: 16px; margin-top: 12px; padding: 18px; border: 1px solid var(--grey); border-radius: var(--radius); background: var(--card); color: var(--ink); color-scheme: light; }
.shared .card { border: 1px solid var(--line); }
.shared .mission { border: 1px solid var(--line); }
.shared .board { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.shared div.day:hover { background-color: transparent; }
.shared div.day.we:hover { background: color-mix(in srgb, var(--soft) 70%, transparent); }
.shared div.day.off:hover { background: var(--off); }

/* Livrables */
.delivs-card > header { flex-wrap: wrap; }
.delivrow { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; }
.sub + .delivrow { border-top: 0; }
.delivrow:hover { background: var(--soft); }
.delivrow .date { width: 44px; flex: none; text-align: center; line-height: 1.15; }
.delivrow .date b { display: block; font-size: 19px; }
.delivrow .date small { color: var(--muted); }
.delivrow .what { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.delivrow .what small { color: var(--muted); }
.delivrow .what i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--p); box-shadow: 0 0 0 1px var(--edge); }
.delivrow .open { flex: none; padding: 6px 12px; border: 1px solid var(--grey); border-radius: 999px; font-size: 13px; font-weight: 700; }

/* Dépôt de fichiers */
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 16px; border: 2px dashed var(--accent); border-radius: 20px; background: var(--soft); text-align: center; cursor: pointer; }
.drop .ic { width: 34px; height: 34px; color: var(--accent); }
.drop span { color: var(--muted); }
.drop.over { background: var(--nav-2); }
.drop:focus-within { outline: 2px solid var(--blue); }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.files .what { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.files small { color: var(--muted); }
.files .failed small { color: var(--danger); font-weight: 700; }
.files .meter { display: block; }
.sheet-body .wide.btn { grid-column: 1 / -1; }
[hidden] { display: none !important; }
.thumb { width: 64px; height: 46px; flex: none; object-fit: cover; border-radius: 10px; background: var(--soft); }

/* Argent */
.moneygrid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; margin-bottom: 12px; }
.moneygrid b { font-size: 26px; white-space: nowrap; }
.in { color: var(--perso); }
.neg { color: var(--danger); }
.txn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.sub + .txn { border-top: 0; }
.txn .what { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.txn small { color: var(--muted); }
.txn .amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.catline { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; }
.catline .meter { grid-column: 1 / -1; display: block; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
.facts .pill { width: 96px; justify-content: center; }
.facts .alert .pill { background: var(--hot); color: var(--on-hot); }
.facts .good .pill { background: var(--nav-2); }
.chart { position: relative; padding-top: 18px; }
.chart .top { position: absolute; top: 0; left: 0; font-size: 12px; color: var(--muted); }
.plot { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--line); }
.col-m { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0 0 5px; border: 0; border-radius: 12px; background: none; }
.col-m:hover { background: var(--soft); }
.col-m.on { background: var(--soft); }
.col-m.on small { font-weight: 800; }
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; width: 100%; height: 150px; border-bottom: 1px solid var(--grey); }
.bars i { width: min(22px, 40%); border-radius: 4px 4px 0 0; }
.k-in { background: var(--in); }
.k-out { background: var(--out); }
.legend s.k-in { background: var(--in); }
.legend s.k-out { background: var(--out); }
.readout { margin-top: 8px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 0; text-align: right; border-top: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
.txn.static { cursor: default; }
.goal { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.card > header + .goal { border-top: 0; }
.goalhead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.goal .meter, .catline .meter { display: block; }
.meter.big { height: 10px; }
.meter.over span { background: var(--danger); }
.simresult { margin-top: 6px; font-size: 16px; }
input[type=range] { accent-color: var(--accent); }

.card.todo { margin-bottom: 12px; border: 2px solid var(--hot); }
.todo > p { margin-bottom: 12px; overflow-wrap: anywhere; }
.todo > header { flex-wrap: wrap; }
.mainnav a.todo-dot { position: relative; }
.mainnav a.todo-dot::after { content: ""; position: absolute; top: 6px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--hot); }
.accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.account { border: 0; text-align: left; align-items: flex-start; }
.account:hover { background: var(--soft); }
.account b { font-size: 26px; white-space: nowrap; }
.check.balance { flex-wrap: wrap; padding: 12px; border-radius: 16px; background: var(--nav-2); }

.check-txn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; align-items: center; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
.check-txn input[name=label], .check-txn select[name=cat] { grid-column: 1 / -1; }
.check-txn .keep { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check-txn .keep input { width: 20px; height: 20px; accent-color: var(--accent); }
.check-txn .pill { justify-self: end; }
.check-txn.dup { background: var(--soft); }
.options textarea { margin: 6px 0 8px; }

/* Saisie */
.options > summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 8px 0; }
.options > .formgrid { padding-top: 8px; }
.group { font-size: 13px; color: var(--muted); margin: 4px 0 -4px; }
dialog { width: min(560px, calc(100vw - 24px)); max-height: 88dvh; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); border-radius: 24px; }
dialog::backdrop { background: rgb(6 12 28 / .55); }
dialog form > header, dialog footer { display: flex; align-items: center; gap: 8px; padding: 14px 18px; position: sticky; background: var(--card); z-index: 1; }
dialog form > header { top: 0; justify-content: space-between; border-bottom: 1px solid var(--line); }
dialog footer { bottom: 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sheet-body, .formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheet-body { padding: 16px 18px; }
.wide, .sheet-body > .note { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
input:not([type=checkbox]):not([type=file]), select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid var(--grey); border-radius: var(--radius); background: var(--card); font-size: 16px; border-radius: 14px; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: 19px; height: 19px; accent-color: var(--accent); }
.error { grid-column: 1 / -1; color: var(--danger); font-weight: 700; }
.error:empty { display: none; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) 165px auto; gap: 6px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.link-row input[name=l-label] { grid-area: 1 / 1 / 2 / 3; }
.link-row input[name=l-url] { grid-area: 2 / 1; }
.link-row input[name=l-date] { grid-area: 2 / 2; }
.link-row .icon-btn { grid-area: 1 / 3; align-self: center; }
.field .btn { align-self: flex-start; }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border: 0; border-radius: 18px; background: color-mix(in srgb, var(--c) 11%, transparent); text-align: left; }
.add .ic { width: 24px; height: 24px; color: var(--c); }
.add b { font-size: 14px; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: var(--card); padding: 11px 18px; border-radius: var(--radius); font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; width: max-content; max-width: calc(100vw - 32px); border-radius: 999px; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Tableau de bord plein écran (iPad 9,7 pouces : 1024 × 768) */
body.guest .mainnav, body.guest .gear, body.wall-mode .mainnav, body.wall-mode .gear { display: none; }
body.guest main { margin: 0 auto; }
body.wall-mode main { margin: 0; padding: 0; max-width: none; }
.wall { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); overflow: hidden; }
.w-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.w-clock { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w-date { font-size: 19px; font-weight: 700; margin-top: 4px; }
.wall .weather { flex: 0 1 520px; padding: 12px 18px; }
.w-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-height: 0; }
.w-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.w-side > .w-box:last-child { flex: 1; }
.w-box { overflow: hidden; padding: 12px 14px; min-height: 0; }
.w-box h2 { font-size: 19px; margin-bottom: 4px; }
.w-box .sub { margin: 8px 0 0; font-size: 14px; }
.w-todo { border: 2px solid var(--hot); }
.w-todo .w-what small { white-space: normal; }
.w-line { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.w-box h2 + .w-line, .w-box .sub + .w-line { border-top: 0; }
.w-lead { display: flex; justify-content: center; width: 50px; flex: none; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--c, var(--ink)); }
.w-lead .ic { width: 24px; height: 24px; }
.w-line.birthday .w-lead { color: var(--birthday); }
.w-line.todo .w-lead { width: 30px; }
.w-line.project::before { content: ""; width: 5px; align-self: stretch; border-radius: 4px; background: var(--c); box-shadow: 0 0 0 1px var(--edge); }
.w-what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.w-what b { font-size: 15.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-what small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-what em { font-style: normal; font-weight: 800; padding: 0 7px; border-radius: 99px; background: var(--hot); color: var(--on-hot); }
.w-what em.late { background: var(--danger); color: var(--card); }
.w-what em.calm { padding: 0; background: none; color: inherit; font-weight: 600; }
.w-more, .w-none { color: var(--muted); font-size: 14px; padding-top: 4px; }
.w-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.w-day { display: flex; flex-direction: column; gap: 3px; min-height: 76px; padding: 7px 8px; border-radius: 14px; background: var(--card); font-size: 12.5px; min-width: 0; }
.w-day.off { background: var(--off); }
.w-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.w-foot span { flex: 1; }
@media (orientation: portrait) {
  .w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1.5fr) minmax(0, 1fr); }
  .w-side { grid-column: 1 / -1; flex-direction: row; }
  .w-side > * { flex: 1; min-width: 0; }
  .w-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .grid, .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .board, .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* iPhone */
@media (max-width: 760px) {
  .mainnav { inset: auto 0 0 0; width: auto; flex-direction: row; align-items: center; justify-content: space-around; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); inset: auto 10px calc(8px + env(safe-area-inset-bottom)) 10px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 6px 24px rgb(27 42 74 / .14); }
  .mainnav .brand, .mainnav .settings, .fab em { display: none; }
  .mainnav a { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11px; flex: 1; border-radius: 999px; }
  .mainnav a span { font-size: 18px; }
  .mainnav a:hover { background: none; }
  .mainnav a.on { background: var(--nav-2); }
  .fab { order: 0; margin: 0 6px; width: 52px; height: 52px; border-radius: 50%; flex: none; padding: 0; }
  .fab .ic { width: 26px; height: 26px; }
  .gear { display: flex; position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; padding: 7px; font-size: 19px; z-index: 2; }
  main { margin: 0; padding: calc(54px + env(safe-area-inset-top)) 14px calc(100px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  h1 { font-size: 25px; }
  .hero { padding: 20px 18px; }
  .hello { flex-basis: 100%; }
  .hero h1 { font-size: 32px; }
  .weather { flex-basis: 100%; padding: 14px; }
  .wicon .ic { width: 36px; height: 36px; }
  .soon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band { height: 5px; padding: 0 2px; font-size: 0; border-radius: 2px; border-radius: 4px; padding: 0 2px; }
  .band.cl { margin-left: -2px; }
  .band.cr { margin-right: -2px; }
  .month { gap: 1px; }
  .day { min-height: 58px; padding: 3px 0; }
  .day .n { align-self: center; }
  .day .chip, .more-n { display: none; }
  .day i { display: flex; gap: 2px; justify-content: center; font-style: normal; }
  .stepper h1 { min-width: 180px; font-size: 21px; }
  .phone-only { display: flex; }
  .moneygrid { grid-template-columns: 1fr 1fr; }
  .moneygrid .total { grid-column: 1 / -1; }
  .moneygrid b { font-size: 21px; }
  .account b { font-size: 21px; }
  .board { display: block; }
  .board-filter { display: flex; margin-bottom: 12px; }
  .board-filter button { flex: 1; padding: 7px 2px; font-size: 13px; }
  .board .lane { display: none; margin-bottom: 10px; }
  .board .lane.on { display: flex; }
  .shared { padding: 12px; }
  .sheet-body, .formgrid { grid-template-columns: minmax(0, 1fr); }
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-row input[name=l-label] { grid-area: 1 / 1; }
  .link-row input[name=l-date] { grid-area: 3 / 1; }
  .link-row .icon-btn { grid-area: 1 / 2; }
  dialog { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 10px 10px 0 0; max-height: 90dvh; border-radius: 26px 26px 0 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
