/* Ghar : feuille de style.
   Direction : la céramique bleue de Multan. Cobalt pour ce qui est à moi, turquoise pour le foyer,
   souci (marigold) réservé aux réussites. Chaque jour est un carreau qui se vernit quand il est fait. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-display: swap; font-weight: 200 800; font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-standard-normal.woff2) format("woff2-variations"), url(fonts/bricolage-grotesque-latin-standard-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-display: swap; font-weight: 200 800; font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format("woff2-variations"), url(fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #1A2238;
  --ink-2: #47516C;
  --ink-3: #7A8399;
  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #EDF1F9;
  --line: #DCE2EE;
  --cobalt: #2348A8;
  --cobalt-ink: #FFFFFF;
  --cobalt-soft: #E3E9F8;
  --turq: #178C9B;
  --turq-soft: #DDF1F3;
  --marigold: #DE9512;
  --marigold-soft: #FBEED2;
  --fire: #C2410C;
  --danger: #B42318;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(26, 34, 56, .06), 0 8px 24px -12px rgba(26, 34, 56, .18);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tile: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"%3E%3Crect width="40" height="40" fill="%23FFFFFF"/%3E%3Cpolygon points="20.0,5.0 23.3,12.1 30.6,9.4 27.9,16.7 35.0,20.0 27.9,23.3 30.6,30.6 23.3,27.9 20.0,35.0 16.7,27.9 9.4,30.6 12.1,23.3 5.0,20.0 12.1,16.7 9.4,9.4 16.7,12.1" fill="%232348A8"/%3E%3Ccircle cx="20" cy="20" r="3.4" fill="%235CC2CE"/%3E%3Cpath d="M0 6L6 0H0Z M40 6L34 0H40Z M0 34L6 40H0Z M40 34L34 40H40Z" fill="%235CC2CE"/%3E%3C/svg%3E');
  --tile-glaze: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"%3E%3Cpolygon points="20.0,5.0 23.3,12.1 30.6,9.4 27.9,16.7 35.0,20.0 27.9,23.3 30.6,30.6 23.3,27.9 20.0,35.0 16.7,27.9 9.4,30.6 12.1,23.3 5.0,20.0 12.1,16.7 9.4,9.4 16.7,12.1" fill="rgba%28255,255,255,.10%29"/%3E%3Ccircle cx="20" cy="20" r="3.4" fill="rgba%28255,255,255,.18%29"/%3E%3Cpath d="M0 6L6 0H0Z M40 6L34 0H40Z M0 34L6 40H0Z M40 34L34 40H40Z" fill="rgba%28255,255,255,.18%29"/%3E%3C/svg%3E');
  --tile-done: #2348A8;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #E7EBF5;
  --ink-2: #B3BCD1;
  --ink-3: #8690A7;
  --bg: #0D1222;
  --surface: #151C31;
  --surface-2: #1D2640;
  --line: #29334F;
  --cobalt: #7C99EE;
  --cobalt-ink: #0D1222;
  --cobalt-soft: #1E2C55;
  --tile-done: #3557C9;
  --turq: #4CC3D1;
  --turq-soft: #12363E;
  --marigold: #F2B640;
  --marigold-soft: #3A2D10;
  --fire: #F08A5D;
  --danger: #F2827A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --tile: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"%3E%3Crect width="40" height="40" fill="%23161D33"/%3E%3Cpolygon points="20.0,5.0 23.3,12.1 30.6,9.4 27.9,16.7 35.0,20.0 27.9,23.3 30.6,30.6 23.3,27.9 20.0,35.0 16.7,27.9 9.4,30.6 12.1,23.3 5.0,20.0 12.1,16.7 9.4,9.4 16.7,12.1" fill="%235B7BE0"/%3E%3Ccircle cx="20" cy="20" r="3.4" fill="%234CC3D1"/%3E%3Cpath d="M0 6L6 0H0Z M40 6L34 0H40Z M0 34L6 40H0Z M40 34L34 40H40Z" fill="%234CC3D1"/%3E%3C/svg%3E');
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
small { font-size: 12.5px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.ic { flex: none; }
:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ===== Marque ===== */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--tile) center / 30px; box-shadow: inset 0 0 0 1px rgba(26, 34, 56, .08); flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 750; font-size: 21px; letter-spacing: -0.02em; }
.brand-ur { font-size: 17px; color: var(--turq); margin-left: -2px; line-height: 1; }
.brand-lockup.compact .brand-name { font-size: 19px; }
.brand-lockup.compact .brand-mark { width: 26px; height: 26px; background-size: 26px; }

/* ===== Structure ===== */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px 16px; border-right: 1px solid var(--line); background: var(--surface);
}
.sidebar nav { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.nav-title { font-size: 12.5px; color: var(--ink-3); padding: 0 10px 6px; font-weight: 600; }
.nav-group.is-shared .nav-title { color: var(--turq); }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none !important; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--cobalt-soft); color: var(--cobalt); font-weight: 650; }
.nav-group.is-shared .nav-link.active { background: var(--turq-soft); color: var(--turq); }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); }
.sidebar-foot .who { flex: 1; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.topbar .brand-lockup { display: none; }
.topbar-title { flex: 1; font-weight: 600; color: var(--ink-3); visibility: hidden; }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 8px; }
.content { width: 100%; max-width: 1180px; padding: 4px 28px 60px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink); font: 600 14.5px/1 var(--font);
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--line)); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--cobalt); color: var(--cobalt-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--cobalt) 88%, #000); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 9px; }
.btn.big { height: 48px; font-size: 16px; width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; color: var(--ink-2);
  display: inline-grid; place-items: center; cursor: pointer; position: relative; text-decoration: none !important;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.small { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.disabled { visibility: hidden; }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--marigold); color: #1A2238; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.link-quiet { font-size: 13.5px; color: var(--ink-3); font-weight: 500; }
.link-quiet:hover { color: var(--cobalt); }
.link-quiet.warn { color: var(--fire); }

/* ===== Blocs ===== */
.block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.block.shared { border-top: 3px solid var(--turq); }
.block.shared h2 .ic { color: var(--turq); vertical-align: -3px; margin-right: 2px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.block-head h2 { display: flex; align-items: center; gap: 6px; }
.empty { padding: 22px; border: 1.5px dashed var(--line); border-radius: 14px; text-align: center; color: var(--ink-2); }
.empty p { max-width: 46ch; margin: 0 auto 12px; }
.empty-small { color: var(--ink-3); margin: 0; font-size: 14px; }
.hint { color: var(--ink-3); font-size: 13.5px; margin: -6px 0 12px; }

/* ===== Aujourd'hui ===== */
.today-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 38%; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  margin: 6px 0 20px; min-height: 168px;
}
.hero-text { padding: 26px 28px; position: relative; z-index: 1; }
.hero-date { color: var(--turq); font-weight: 650; margin: 0 0 4px; }
.today-hero h1 { font-size: 38px; }
.motto { margin: 10px 0 0; font-size: 17px; color: var(--ink-2); max-width: 40ch; }
.hero-tiles {
  align-self: stretch; background: var(--tile) 0 0 / 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%);
  mask-image: linear-gradient(90deg, transparent 0, #000 45%);
}

.today-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.ritual-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ritual-tile {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 124px; padding: 14px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--ink); font: inherit; cursor: pointer;
  transition: background .25s, border-color .25s, color .25s, transform .1s;
}
.ritual-tile:hover { border-color: color-mix(in srgb, var(--cobalt) 45%, var(--line)); }
.ritual-tile:active { transform: scale(.975); }
.ritual-tile .emoji { font-size: 26px; line-height: 1; margin-bottom: auto; }
.ritual-tile .name { font-weight: 650; font-size: 15.5px; line-height: 1.25; }
.ritual-tile .streak { font-size: 12.5px; color: var(--ink-3); }
.ritual-tile .glaze { position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s; background: var(--tile-glaze) 0 0 / 40px, radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .22), transparent 55%), var(--tile-done); }
.ritual-tile::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
}
.ritual-tile.is-done { border-color: var(--tile-done); color: #fff; }
.ritual-tile.is-done .glaze { opacity: 1; }
.ritual-tile.is-done .streak { color: rgba(255, 255, 255, .8); }
.ritual-tile.is-done::after {
  border-color: transparent; background: #fff url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="m6 12.5 4 4 8-9" fill="none" stroke="%232348A8" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center / 16px no-repeat;
}
.ritual-tile.just-done .glaze::before {
  content: ""; position: absolute; inset: -40%; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .45) 50%, transparent 60%);
  animation: sheen .9s ease-out 1;
}
@keyframes sheen { from { transform: translateX(-60%); } to { transform: translateX(60%); } }

.stone-input { display: block; margin-top: 14px; }
.stone-input span { display: block; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.win-line { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-weight: 550; }
.win-line .seal { width: 30px; height: 30px; flex: none; }
.win-line .seal path:first-child { fill: none; stroke: var(--ink-3); stroke-width: 1.6; }
.win-line .seal .tick { stroke: transparent; }
.win-line.won { background: var(--marigold-soft); color: var(--ink); }
.win-line.won .seal path:first-child { fill: var(--marigold); stroke: var(--marigold); }
.win-line.won .seal .tick { stroke: #fff; }
.win-line.won.pop .seal { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) 1; }
@keyframes pop { 0% { transform: scale(.6) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }

.day-plan { display: flex; flex-direction: column; gap: 10px; }
.dp-slot { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: start; }
.dp-label { color: var(--ink-3); font-size: 13.5px; padding-top: 6px; }
.dp-items { display: flex; flex-wrap: wrap; gap: 6px; }
.feux-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 14px; font-size: 13.5px; }
.feux-mini span { color: var(--fire); font-weight: 650; margin-right: 4px; }
.feux-mini b { font-weight: 550; background: color-mix(in srgb, var(--fire) 10%, var(--surface)); color: var(--ink); padding: 3px 9px; border-radius: 99px; }

/* ===== Chips (blocs) ===== */
.cat-business { --c: #2348A8; }
.cat-creatif { --c: #7A4FA0; }
.cat-sante { --c: #2E8B57; }
.cat-famille { --c: #178C9B; }
.cat-foi { --c: #B7791F; }
.cat-perso { --c: #5B6478; }
[data-theme="dark"] .cat-business { --c: #7C99EE; } [data-theme="dark"] .cat-creatif { --c: #B794D9; } [data-theme="dark"] .cat-sante { --c: #5FC08A; }
[data-theme="dark"] .cat-famille { --c: #4CC3D1; } [data-theme="dark"] .cat-foi { --c: #E3B25A; } [data-theme="dark"] .cat-perso { --c: #9AA3B8; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  min-height: 34px; padding: 5px 11px 5px 9px; border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--c, var(--ink-3)) 30%, var(--line));
  border-left: 4px solid var(--c, var(--ink-3));
  background: color-mix(in srgb, var(--c, var(--ink-3)) 9%, var(--surface));
  color: var(--ink); font: 550 14px/1.2 var(--font); cursor: pointer; text-align: left;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.chip:hover { background: color-mix(in srgb, var(--c, var(--ink-3)) 16%, var(--surface)); }
.chip-check { width: 15px; height: 15px; border-radius: 5px; border: 1.5px solid color-mix(in srgb, var(--c) 60%, var(--line)); flex: none; }
.chip.is-done { opacity: .62; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.chip.is-done .chip-check { background: var(--c) url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="m6 12.5 4 4 8-9" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center / 12px no-repeat; border-color: var(--c); }

/* ===== Semaine ===== */
.feux { margin-bottom: 18px; }
.feux > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; margin-bottom: 10px; flex-wrap: wrap; }
.feux > summary::-webkit-details-marker { display: none; }
.feux-title { font-family: var(--font-display); font-weight: 650; color: var(--fire); }
.feux-sum { display: none; gap: 6px; flex-wrap: wrap; }
.feux-sum b { font-weight: 550; font-size: 13.5px; background: color-mix(in srgb, var(--fire) 10%, var(--surface)); padding: 3px 9px; border-radius: 99px; }
.feux:not([open]) .feux-sum { display: flex; }
.feux-chev { margin-left: auto; color: var(--ink-3); transition: transform .2s; }
.feux[open] .feux-chev { transform: rotate(90deg); }
.feux-inputs { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.feux-inputs input { flex: 1; min-width: 0; border-color: color-mix(in srgb, var(--fire) 25%, var(--line)); }

.library { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 16px; margin-bottom: 14px; }
.library .block-head { margin-bottom: 10px; }
.lib-chips { display: flex; flex-direction: column; gap: 8px; }
.lib-group { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: start; }
.lib-group-label { font-size: 13px; color: var(--ink-3); font-weight: 600; padding-top: 7px; }
.lib-group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chip { min-height: 32px; font-size: 13.5px; padding: 4px 10px 4px 8px; }
.lib-chip[draggable="true"] { cursor: grab; }
.lib-chip.picked { outline: 2.5px solid var(--c); outline-offset: 2px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.library.managing .lib-chip { border-style: dashed; cursor: pointer; }
.library.managing .lib-chip::after { content: "✎"; font-size: 12px; color: var(--ink-3); margin-left: 2px; }
[data-hint-touch] { display: none; }
body.touch [data-hint-touch] { display: block; }
body.touch [data-hint-desktop] { display: none; }
.pick-banner { position: sticky; top: 56px; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; margin: -6px 0 12px; border-radius: 12px; background: var(--cobalt); color: var(--cobalt-ink); font-weight: 600; }
.pick-banner .btn { color: inherit; border-color: color-mix(in srgb, var(--cobalt-ink) 40%, transparent); }

.week-board {
  display: grid; grid-auto-flow: column;
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(3, minmax(96px, auto));
  gap: 6px; margin-bottom: 18px;
}
.wb-corner { }
.wb-slotlabel { color: var(--ink-3); font-size: 13px; padding: 10px 6px 0 0; text-align: right; }
.wb-day { display: contents; }
.wb-dayhead { padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.wb-dayhead b { font-family: var(--font-display); font-weight: 650; font-size: 15px; }
.wb-dayhead span { color: var(--ink-3); margin-left: 4px; }
.wb-day.is-today .wb-dayhead { background: var(--cobalt); color: var(--cobalt-ink); border-color: var(--cobalt); }
.wb-day.is-today .wb-dayhead span { color: inherit; opacity: .8; }
.slot {
  display: flex; flex-direction: column; gap: 5px; padding: 6px; min-height: 96px;
  border-radius: 12px; border: 1.5px dashed transparent; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .12s, border-color .12s;
}
.slot .chip { width: 100%; font-size: 12.5px; min-height: 30px; padding: 4px 6px 4px 6px; gap: 5px; position: relative; }
.slot .chip .chip-check { width: 12px; height: 12px; border-radius: 4px; }
.slot .chip .lbl { flex: 1; min-width: 0; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.slot .chip[draggable="true"] { cursor: grab; }
.slot.over, body.picking .slot:hover { border-color: var(--cobalt); background: var(--cobalt-soft); box-shadow: none; }
body.picking .slot { border-color: color-mix(in srgb, var(--cobalt) 35%, transparent); cursor: copy; }
.slot-label { display: none; }
.item-menu { position: absolute; z-index: 40; display: flex; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.week-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Horizons ===== */
.horizons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.hz-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 12px; overflow: hidden; }
.hz-col header { padding: 16px 18px 12px; border-top: 4px solid var(--hz); }
.hz-col header h2 { color: var(--hz); font-size: 20px; }
.hz-col header p { color: var(--ink-3); font-size: 13.5px; margin: 4px 0 0; }
.hz-feu { --hz: var(--fire); }
.hz-mois { --hz: var(--marigold); }
.hz-fond { --hz: var(--ink-3); }
.hz-list { list-style: none; margin: 0; padding: 0 10px; min-height: 40px; display: flex; flex-direction: column; gap: 6px; }
.hz-list.over { background: var(--surface-2); border-radius: 12px; }
.hz-item { display: flex; align-items: center; gap: 8px; padding: 9px 8px 9px 12px; border-radius: 11px; background: var(--surface-2); cursor: grab; }
.hz-text { flex: 1; font-weight: 550; overflow-wrap: anywhere; }
.hz-text input { width: 100%; }
.hz-actions { display: flex; gap: 0; opacity: .25; transition: opacity .15s; }
.hz-item:hover .hz-actions, .hz-item:focus-within .hz-actions, body.touch .hz-actions { opacity: 1; }
.hz-add { display: flex; gap: 6px; padding: 10px 10px 0; }
.hz-add input { flex: 1; }

/* ===== Suivi ===== */
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; }
.num { font-family: var(--font-display); font-weight: 750; font-size: 34px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.num small { font-size: 16px; color: var(--ink-3); font-weight: 600; }
.num.sm { font-size: 24px; }
.lab { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.tile-grid { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tg-days { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; font-size: 10px; color: var(--ink-3); }
.tg-cols { display: flex; gap: 3px; }
.tg-col { display: grid; grid-template-rows: repeat(7, 14px); gap: 3px; }
.tg { width: 14px; height: 14px; border-radius: 3px; display: inline-block; background: var(--surface-2); }
.tg.l1 { background: color-mix(in srgb, var(--cobalt) 28%, var(--surface-2)); }
.tg.l2 { background: color-mix(in srgb, var(--cobalt) 60%, var(--surface-2)); }
.tg.l3 { background: var(--cobalt); }
.tg.won { background: var(--marigold); }
.tg.kid { background: var(--turq); }
.tg.future { background: transparent; }
.tg.today { box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 3px var(--ink-3); }
.tg-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.tg-legend .tg { margin-left: 6px; }

.habit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.habit-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.habit-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.habit-card .emoji { font-size: 20px; }
.hc-nums { display: flex; gap: 22px; margin-bottom: 10px; }
.hc-nums > div { display: flex; flex-direction: column; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart.bars { height: 110px; }
.chart .bar { fill: color-mix(in srgb, var(--cobalt) 32%, var(--surface-2)); }
.chart .bar.hit { fill: var(--cobalt); }
.chart .target { stroke: var(--marigold); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .val { font: 600 10px var(--font); fill: var(--ink-2); }
.chart .lbl, .chart .axis { font: 10.5px var(--font); fill: var(--ink-3); }
.chart.line .axis { font-size: 12px; }
.line-chart { min-height: 190px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .stroke { fill: none; stroke: var(--cobalt); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--surface); stroke: var(--cobalt); stroke-width: 2; }
.chart .pt.last { fill: var(--cobalt); }
.chart-wrap { margin: 4px 0 12px; }
.weight-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.weight-form label { display: flex; flex-direction: column; font-size: 13px; color: var(--ink-2); gap: 4px; }
.entries summary { cursor: pointer; color: var(--ink-2); font-weight: 550; margin-bottom: 8px; }
.entries ul { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.entries li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.entries li span { flex: 1; color: var(--ink-2); }
.habit-admin { list-style: none; margin: 0; padding: 0; }
.habit-admin li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.habit-admin li:last-child { border-bottom: 0; }
.habit-admin .emoji { font-size: 20px; width: 28px; text-align: center; }
.habit-admin .ha-name { flex: 1; font-weight: 600; display: flex; flex-direction: column; }
.habit-admin .ha-name small { font-weight: 400; color: var(--ink-3); }
.habit-admin li.inactive { opacity: .55; }
.ha-move { display: flex; flex-direction: column; margin: -6px 0; }
.ha-move .icon-btn.small { width: 28px; height: 22px; }
.habit-admin li:first-child [data-habit-move=up], .habit-admin li:last-child [data-habit-move=down] { visibility: hidden; }

/* ===== Calendrier ===== */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.cal-month { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--turq); border-radius: var(--radius); padding: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav h2 { min-width: 150px; text-align: center; font-size: 19px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 4px 0; }
.cal-day {
  display: flex; flex-direction: column; gap: 3px; min-height: 104px; padding: 6px;
  border-radius: 10px; background: var(--surface-2); color: var(--ink); text-decoration: none !important; overflow: hidden;
}
.cal-day:hover { box-shadow: inset 0 0 0 1.5px var(--turq); }
.cal-day.out { opacity: .45; }
.cal-day .dnum { font-weight: 650; font-size: 13.5px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .dnum { background: var(--turq); color: #fff; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--turq); background: var(--turq-soft); }
.cal-pills { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pill { font-size: 11.5px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; background: color-mix(in srgb, var(--turq) 18%, var(--surface)); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill.private { background: color-mix(in srgb, var(--cobalt) 15%, var(--surface)); }
.pill.more { background: none; color: var(--ink-3); }
.cal-dots { display: none; gap: 3px; justify-content: center; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--turq); }
.cal-dots i.private { background: var(--cobalt); }

.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.agenda li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.agenda li:last-child { border-bottom: 0; }
.agenda li.agenda-day { font-weight: 650; color: var(--turq); font-size: 13.5px; padding: 12px 0 2px; border: 0; }
.agenda li.agenda-day:first-child { padding-top: 0; }
.agenda .agenda-btn { all: unset; display: flex; gap: 10px; width: 100%; cursor: pointer; align-items: flex-start; }
.agenda li:has(.agenda-btn) { padding: 0; }
.agenda .agenda-btn { padding: 8px 4px; border-radius: 8px; }
.agenda .agenda-btn:hover { background: var(--surface-2); }
.agenda .agenda-btn:focus-visible { outline: 2.5px solid var(--cobalt); }
.agenda .when { width: 58px; flex: none; color: var(--turq); font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.agenda .is-private .when { color: var(--cobalt); }
.agenda .what { flex: 1; font-weight: 550; display: flex; flex-direction: column; min-width: 0; }
.agenda .what small { color: var(--ink-3); font-weight: 400; }
.agenda .lock { color: var(--cobalt); padding-top: 2px; }

/* ===== Famille ===== */
.day-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.day-switch strong { min-width: 160px; text-align: center; font-family: var(--font-display); font-size: 17px; }
.kid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.kid-card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--turq); border-radius: var(--radius); padding: 18px 20px; }
.kid-card header { margin-bottom: 12px; }
.kid-card h2 { font-size: 24px; }
.kid-card header p { margin: 2px 0 0; font-size: 14px; }
.lang-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-btn {
  height: 34px; padding: 0 12px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink-2); font: 600 13.5px var(--font); cursor: pointer; touch-action: manipulation;
}
.lang-btn:hover { border-color: var(--turq); }
.lang-btn.on { background: var(--turq); border-color: var(--turq); color: #fff; }
[data-theme="dark"] .lang-btn.on { color: #0D1222; }
.lang-toggles.big .lang-btn { height: 46px; padding: 0 18px; font-size: 15px; flex: 1; }
.kid-who { margin: 10px 0 14px; }
.kid-stats { display: flex; gap: 24px; margin-bottom: 8px; }
.kid-stats > div { display: flex; flex-direction: column; }
.kid-mood { color: var(--turq); font-weight: 600; margin: 4px 0 14px; }
.lang-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.lb-row { display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 8px; font-size: 13.5px; }
.lb-row b { text-align: right; font-variant-numeric: tabular-nums; }
.lb-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.lb-fill { display: block; height: 100%; border-radius: 4px; background: var(--turq); }
.lb-fill.lang-arabe { background: color-mix(in srgb, var(--turq) 65%, var(--marigold)); }
.lb-fill.lang-urdu { background: color-mix(in srgb, var(--turq) 55%, var(--cobalt)); }
.kid-days { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 12px; }
.kid-quick { display: flex; flex-direction: column; gap: 12px; }
.kq-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kq-name { display: flex; flex-direction: column; }
.kq-name small { color: var(--ink-3); }

/* ===== Notes ===== */
.scope-tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 13px; margin-bottom: 18px; }
.scope-tab { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; text-decoration: none !important; }
.scope-tab.active.mine { background: var(--surface); color: var(--cobalt); box-shadow: var(--shadow); }
.scope-tab.active.shared { background: var(--surface); color: var(--turq); box-shadow: var(--shadow); }
.scope-tab .count { font-size: 12px; background: var(--surface-2); color: var(--ink-3); padding: 1px 7px; border-radius: 99px; }
.filter-input { width: 100%; max-width: 360px; margin-bottom: 14px; }
.note-grid { columns: 3 260px; column-gap: 14px; }
.note-card {
  all: unset; box-sizing: border-box; display: block; width: 100%; break-inside: avoid; margin-bottom: 14px; position: relative;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
}
.note-grid.shared .note-card { border-left: 3px solid var(--turq); }
.note-card:hover { border-color: color-mix(in srgb, var(--cobalt) 40%, var(--line)); }
.note-card:focus-visible { outline: 2.5px solid var(--cobalt); }
.note-card h3 { margin-bottom: 6px; padding-right: 18px; }
.note-body { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; max-height: 220px; overflow: hidden; }
.note-card small { display: block; margin-top: 10px; color: var(--ink-3); }
.note-card .pin { position: absolute; top: 14px; right: 14px; color: var(--marigold); }
.title-input { font-family: var(--font-display); font-size: 20px !important; font-weight: 650; border: 0 !important; padding: 0 !important; height: auto !important; background: transparent !important; box-shadow: none !important; }

/* ===== Tâches ===== */
.task-add { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.task-add.shared { border-top: 3px solid var(--turq); }
.task-add input[name="title"] { flex: 1 1 240px; }
.task-add input[type="date"] { flex: 0 0 160px; }
.task-group { margin-bottom: 18px; }
.task-group h2, .task-group summary { font-size: 15px; color: var(--ink-2); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 650; cursor: default; }
.task-group summary { cursor: pointer; }
.task-group.late h2 { color: var(--fire); }
.task-group .count { font-family: var(--font); font-size: 12px; background: var(--surface-2); color: var(--ink-3); padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.task-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.task-list.compact { background: none; border: 0; }
.task { display: flex; align-items: center; gap: 12px; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-list.compact .task { padding: 6px 0; }
.tick-btn { width: 24px; height: 24px; border-radius: 50%; border: 1.8px solid var(--ink-3); background: transparent; cursor: pointer; flex: none; padding: 0; }
.tick-btn:hover { border-color: var(--cobalt); }
.tick-btn.on { background: var(--cobalt) url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="m6 12.5 4 4 8-9" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center / 14px no-repeat; border-color: var(--cobalt); }
.t-main { all: unset; flex: 1; display: flex; flex-direction: column; padding: 9px 0; cursor: pointer; min-width: 0; }
.t-title { font-weight: 550; overflow-wrap: anywhere; }
.task.is-done .t-title { text-decoration: line-through; color: var(--ink-3); }
.t-meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; align-items: center; }
.t-meta .who { color: var(--turq); font-weight: 600; }
.due { font-size: 12.5px; color: var(--ink-3); }
.due.late { color: var(--fire); font-weight: 650; }
.tag-shared { color: var(--turq); }
.task-list.compact .t-title { flex: 1; }

/* ===== Rappels ===== */
.rem-list { list-style: none; margin: 0; padding: 0; }
.rem { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rem:last-child { border-bottom: 0; }
.rem-time { font-family: var(--font-display); font-weight: 750; font-size: 20px; width: 64px; font-variant-numeric: tabular-nums; }
.rem-main { all: unset; flex: 1; display: flex; flex-direction: column; cursor: pointer; min-width: 0; }
.rem-main small { color: var(--ink-3); }
.rem.off { opacity: .5; }
.block.shared .rem-time { color: var(--turq); }
.block.shared .switch input:checked + span { background: var(--turq); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + span { background: var(--cobalt); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }
.day-chips { display: flex; gap: 6px; }
.day-chips label { position: relative; }
.day-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.day-chips span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 650; color: var(--ink-2); }
.day-chips input:checked + span { background: var(--cobalt); color: var(--cobalt-ink); }
.day-chips input:focus-visible + span { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }

/* ===== Réglages ===== */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 18px; align-items: start; }
.colors { display: flex; gap: 8px; border: 0; padding: 0; margin: 0; flex-wrap: wrap; }
.colors legend { font-size: 13.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; padding: 0; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 9px; background: var(--c); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch input:focus-visible + span { outline: 2.5px solid var(--cobalt); outline-offset: 3px; }
.howto { margin-top: 14px; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--cobalt); }
.howto ol { padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.howto ol li { margin-bottom: 6px; }
.member-list, .kid-admin { list-style: none; margin: 0 0 12px; padding: 0; }
.member-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.member-list li > span:last-child { display: flex; flex-direction: column; }
.member-list small { color: var(--ink-3); }
.kid-admin li { margin-bottom: 8px; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form input[name="name"] { flex: 0 1 130px; }
.inline-form input[name="slot_label"] { flex: 1 1 180px; }
.code-line { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; margin-bottom: 10px; }

/* ===== Formulaires ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.narrow { max-width: 520px; }
.form label, .form legend { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.form label:not(.check):not(.radio):not(.swatch):not(.pill-btn) { display: flex; flex-direction: column; gap: 6px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.form fieldset legend { margin-bottom: 4px; }
.form fieldset.colors { flex-direction: row; gap: 8px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 15px/1.4 var(--font);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 20%, transparent); }
.check, .radio { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; color: var(--ink) !important; font-size: 14.5px !important; cursor: pointer; }
.check input, .radio input { width: 18px; height: 18px; accent-color: var(--cobalt); flex: none; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.emoji-row { grid-template-columns: 90px 1fr; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 12px; align-self: flex-start; flex-wrap: wrap; }
.seg label { position: relative; display: block !important; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2.5px solid var(--cobalt); }
.alert { padding: 11px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); font-weight: 550; margin-bottom: 14px; }
.alert.soft { background: var(--marigold-soft); color: var(--ink); font-weight: 500; }

/* ===== Fenêtres ===== */
dialog.modal {
  width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 22px; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog.modal.wide { width: min(720px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(13, 18, 34, .5); backdrop-filter: blur(2px); }
dialog.modal h2 { font-size: 21px; margin-bottom: 2px; }
.modal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.modal-actions .spacer { flex: 1; }
dialog[open] { animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Notifications ===== */
.notif-panel {
  position: absolute; right: 0; top: 46px; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; z-index: 50;
}
.notif-head { padding: 8px 10px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; color: var(--ink); text-decoration: none !important; font-size: 14px; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.notif-item small { display: block; color: var(--ink-3); }
.notif-item.unread { background: var(--turq-soft); }
.notif-panel .empty-small { padding: 4px 10px 12px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow); transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }


/* ===== Ajout rapide ===== */
.lib-open { display: none; }
.grabber { display: none; }
dialog.quick { padding-top: 14px; }
.quick-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 13px; margin-bottom: 16px; }
.quick-tabs button { all: unset; display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 10px; font-weight: 650; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.quick-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.quick-tabs button:focus-visible { outline: 2.5px solid var(--cobalt); }
.quick-form > input[name=title] { font-size: 17px; min-height: 50px; }
.q-row { display: flex; flex-direction: column; gap: 6px; }
.q-label { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-btn {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; position: relative;
}
.pill-btn.on { background: var(--cobalt); border-color: var(--cobalt); color: var(--cobalt-ink); }
.pill-btn:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }
.date-pill { padding: 0 12px; overflow: hidden; }
.date-pill input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; padding: 0; border: 0; }
.q-more { text-align: center; font-size: 13.5px; color: var(--ink-3); }

/* ===== Prières ===== */
.prayer-row { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.prayer-label { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.prayer-pills { display: flex; gap: 6px; }
.prayer-pills .prayer-pill { flex: 1 1 0; min-width: 0; padding: 0 4px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prayer-pill {
  all: unset; box-sizing: border-box; height: 40px; padding: 0 6px; text-align: center; border-radius: 99px; border: 1.5px solid var(--line);
  font-weight: 650; font-size: 13.5px; color: var(--ink-2); cursor: pointer; touch-action: manipulation; background: var(--surface);
}
.prayer-pill.on { background: var(--tile-done); border-color: var(--tile-done); color: #fff; }
.prayer-pill:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }
.prayer-table { display: flex; flex-direction: column; gap: 8px; }
.pt-row { display: grid; grid-template-columns: 90px auto 1fr; gap: 12px; align-items: center; }
.pt-name { font-weight: 600; }
.pt-week { display: flex; gap: 3px; }
.pt-streak { color: var(--ink-3); font-size: 13px; text-align: right; }

/* ===== Sous-tâches ===== */
.dp-items { flex-direction: column; align-items: flex-start; }
.dp-item { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.dp-todos { list-style: none; margin: 0 0 4px 14px; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.dp-todos li { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; }
.dp-todos li.done span { text-decoration: line-through; color: var(--ink-3); }
.tick-btn.small { width: 20px; height: 20px; }
.tick-btn.small.on { background-size: 12px; }
.todo-badge { flex: none; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: color-mix(in srgb, var(--c) 20%, var(--surface)); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.todo-badge.all { background: var(--marigold-soft); color: var(--ink); }
.todo-list { list-style: none; margin: 10px 0 8px; padding: 0; display: flex; flex-direction: column; }
.todo { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo span { flex: 1; overflow-wrap: anywhere; }
.todo.done span { text-decoration: line-through; color: var(--ink-3); }
.todo-empty { color: var(--ink-3); font-size: 14px; padding: 6px 0; }
.todo-add { display: flex; gap: 6px; margin-bottom: 4px; }
.todo-add input { flex: 1; }

/* ===== Semaine sur téléphone ===== */
.week-board.mobile { display: block; }
.day-pills {
  position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 15;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 6px 0 8px; margin-bottom: 4px; background: var(--bg);
}
.dp-btn {
  all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 0 5px; border-radius: 13px; cursor: pointer; color: var(--ink-3); font-size: 11.5px; font-weight: 650; text-align: center; touch-action: manipulation;
}
.dp-btn b { font-family: var(--font-display); font-size: 19px; color: var(--ink); font-weight: 700; line-height: 1.15; }
.dp-btn .dots { display: flex; gap: 2px; height: 5px; margin-top: 2px; }
.dp-btn .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--cobalt); opacity: .55; }
.dp-btn.is-today b { color: var(--cobalt); }
.dp-btn.on { background: var(--cobalt); color: var(--cobalt-ink); }
.dp-btn.on b { color: var(--cobalt-ink); }
.dp-btn.on .dots i { background: var(--cobalt-ink); opacity: .8; }
.dp-btn:focus-visible { outline: 2.5px solid var(--cobalt); }
.m-day { touch-action: pan-y; }
.m-day.from-right { animation: fromR .22s ease-out; }
.m-day.from-left { animation: fromL .22s ease-out; }
@keyframes fromR { from { transform: translateX(24px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes fromL { from { transform: translateX(-24px); opacity: .3; } to { transform: none; opacity: 1; } }
.m-day-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 650; font-size: 19px; margin: 6px 2px 12px; }
.m-today { font-family: var(--font); font-size: 12px; font-weight: 700; color: var(--cobalt); background: var(--cobalt-soft); padding: 2px 8px; border-radius: 99px; }
.slot.m-slot { display: block; min-height: 0; padding: 12px; margin-bottom: 10px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.m-slot-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.m-slot-head span { font-weight: 650; color: var(--ink-2); font-size: 15px; }
.slot-add { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 13px; border-radius: 99px; background: var(--cobalt-soft); color: var(--cobalt); font-weight: 650; font-size: 14px; cursor: pointer; touch-action: manipulation; }
.slot-add:focus-visible { outline: 2.5px solid var(--cobalt); }
.m-items { display: flex; flex-direction: column; gap: 6px; }
.slot.m-slot .chip { width: 100%; min-height: 48px; font-size: 15.5px; padding: 8px 12px 8px 10px; gap: 10px; }
.slot.m-slot .chip .chip-check { width: 18px; height: 18px; border-radius: 6px; }
.m-empty { color: var(--ink-3); font-size: 14px; margin: 0; padding: 2px; }
#block-picker .lib-group { grid-template-columns: 1fr; gap: 6px; }
#block-picker .lib-chip { min-height: 42px; font-size: 15px; }
#block-picker .lib-chips { margin: 12px 0 6px; max-height: 55vh; overflow-y: auto; }

/* ===== Barre d'onglets : bouton + au centre ===== */
@media (max-width: 900px) {
  .tabbar .tab-add { display: flex; align-items: center; justify-content: center; padding: 0; }
  .tab-add-circle { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--cobalt); color: var(--cobalt-ink); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--cobalt) 70%, transparent); margin-top: -18px; }
  .tabbar .tab-add:active .tab-add-circle { transform: scale(.95); }
  .grabber { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 12px; }
  .sheet .grabber { margin-top: -4px; }
  .quick-tabs button { height: 42px; }
  .pill-btn { height: 40px; }
  .chip { min-height: 40px; }
  .today-hero h1 { font-size: 27px; }
  .hero-text { padding: 16px 18px 12px; }
  .motto { font-size: 15px; margin-top: 6px; }
  .today-hero { margin-bottom: 14px; }
}

/* ===== Mobile ===== */
.tabbar, .sheet { display: none; }

/* ===== Connexion et installation ===== */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 120px; position: relative; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); position: relative; z-index: 1; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 26px; margin: 22px 0 16px; }
.auth-card .form { margin-top: 6px; }
.tile-band { position: fixed; left: 0; right: 0; bottom: 0; height: 80px; background: var(--tile) 0 0 / 40px; -webkit-mask-image: linear-gradient(0deg, #000, transparent); mask-image: linear-gradient(0deg, #000, transparent); }

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

@media (max-width: 900px) {
  body { font-size: 15.5px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px 0 16px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .topbar .brand-lockup { display: inline-flex; }
  .content { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 26px; }
  .page-head { margin: 4px 0 16px; }
  .block { padding: 16px; border-radius: 14px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    all: unset; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0;
    color: var(--ink-3); font-size: 11.5px; font-weight: 600; cursor: pointer; border-radius: 10px; text-align: center;
  }
  .tabbar .active { color: var(--cobalt); }
  .tabbar a:focus-visible, .tabbar button:focus-visible { outline: 2.5px solid var(--cobalt); }
  .sheet { position: fixed; inset: 0; z-index: 60; background: rgba(13, 18, 34, .45); display: flex; align-items: flex-end; }
  .sheet[hidden] { display: none !important; }
  .sheet-inner { width: 100%; background: var(--surface); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: rise .2s ease-out; }
  .sheet-group { margin-bottom: 14px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--surface-2); color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; text-decoration: none !important; }
  .sheet-grid a.active { background: var(--cobalt-soft); color: var(--cobalt); }
  .sheet-logout { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--ink-3); padding: 10px; font-weight: 600; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .today-hero { grid-template-columns: 1fr; min-height: 0; border-radius: 18px; }
  .hero-text { padding: 20px; }
  .today-hero h1 { font-size: 30px; }
  .motto { font-size: 16px; }
  .hero-tiles { height: 30px; background-size: 30px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 70%); mask-image: linear-gradient(90deg, transparent 0, #000 70%); }
  .kq-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .kq-row .lang-toggles .lang-btn { flex: 1; }
  .ritual-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ritual-tile { min-height: 112px; padding: 11px; }
  .ritual-tile .name { font-size: 14px; }
  .ritual-tile .streak { font-size: 11.5px; }
  .ritual-tile::after { top: 9px; right: 9px; width: 20px; height: 20px; }
  .dp-slot { grid-template-columns: 1fr; gap: 4px; }
  .dp-label { padding: 0; }

  .library { padding: 12px 14px; }
  .lib-chips { max-height: 210px; overflow-y: auto; }
  .lib-group { grid-template-columns: 1fr; gap: 4px; }
  .lib-group-label { padding-top: 0; }
  .pick-banner { top: calc(56px + env(safe-area-inset-top)); }
  .library { display: none; }
  .library.open { display: block; }
  .lib-open { display: inline-flex; }
  .lede { display: none; }
  .top-add { display: none; }
  .notif-panel { position: fixed; left: 8px; right: 8px; top: calc(56px + env(safe-area-inset-top)); width: auto; }
  .week-actions .btn { flex: 1; }
  .feux-inputs { flex-direction: column; min-width: 0; width: 100%; }

  .horizons { grid-template-columns: 1fr; }
  .cal-day { min-height: 54px; align-items: center; padding: 4px 2px; }
  .cal-pills { display: none; }
  .cal-dots { display: flex; }
  .cal-month { padding: 10px; }
  .cal-nav h2 { min-width: 0; flex: 1; font-size: 18px; }
  .kid-cards { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .emoji-row { grid-template-columns: 80px 1fr; }
  .note-grid { columns: 1; }
  .task-add input[type="date"], .task-add select { flex: 1 1 140px; }
  .settings { display: block; }
  dialog.modal { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; }
  dialog.modal.wide { width: 100vw; }
  .hc-nums { gap: 18px; }
  .stat-row { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.task-add .btn { height: 44px; }

/* ===== Tâches reliées aux blocs ===== */
.t-block { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; color: var(--ink-2); }
.t-block::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.t-planned { display: inline-flex; align-items: center; gap: 3px; color: var(--cobalt); font-weight: 600; }
.t-planned.past { color: var(--ink-3); font-weight: 500; }
.plan-btn { color: var(--cobalt); flex: none; }
.plan-btn:hover { background: var(--cobalt-soft); color: var(--cobalt); }
.block-filter { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: -4px 0 8px; scrollbar-width: none; }
.block-filter::-webkit-scrollbar { display: none; }
.bf-chip { all: unset; box-sizing: border-box; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.bf-chip span { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bf-chip[class*="cat-"]::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.bf-chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.bf-chip.on span { color: inherit; opacity: .7; }
.bf-chip:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }
.task-add select { flex: 0 1 170px; }

.plan-task-title { font-weight: 600; font-size: 16px; margin: -2px 0 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; }
.plan-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pd-day { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.pd-day b { font-family: var(--font-display); font-size: 17px; color: var(--ink); }
.pd-day.is-today b { color: var(--cobalt); }
.pd-day.past { opacity: .55; }
.pd-day.on { background: var(--cobalt); border-color: var(--cobalt); color: var(--cobalt-ink); opacity: 1; }
.pd-day.on b { color: var(--cobalt-ink); }
.pd-day:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }

.task-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.task-panel > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 650; font-size: 16px; }
.task-panel > summary::-webkit-details-marker { display: none; }
.task-panel > summary > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.task-panel > summary .count { font-family: var(--font); font-size: 12px; background: var(--cobalt-soft); color: var(--cobalt); padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.task-panel > summary .count:empty { display: none; }
.task-panel[open] > summary { margin-bottom: 10px; }
.task-panel[open] .feux-chev { transform: rotate(90deg); }
.task-panel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-height: 340px; overflow-y: auto; }
.tp-group { display: flex; flex-direction: column; gap: 4px; }
.tp-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 2px; }
.tp-head i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.tp-task { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); font-size: 13.5px; cursor: pointer; }
.tp-task[draggable="true"] { -webkit-user-drag: element; cursor: grab; }
.tp-task:hover { background: color-mix(in srgb, var(--cobalt) 10%, var(--surface-2)); }
.tp-task span { overflow-wrap: anywhere; }
.tp-task small { flex: none; color: var(--cobalt); font-weight: 650; font-size: 11.5px; }
.tp-task.planned { opacity: .6; }
.tp-task:focus-visible { outline: 2.5px solid var(--cobalt); }

.sheet-tasks { margin: 6px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--cobalt-soft); }
.sheet-tasks-title { font-size: 13px; font-weight: 700; color: var(--cobalt); margin-bottom: 6px; }
.sheet-tasks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sheet-tasks li { display: flex; align-items: center; gap: 10px; }
.sheet-tasks li span { flex: 1; font-size: 14px; overflow-wrap: anywhere; display: flex; flex-direction: column; }
.sheet-tasks li small { color: var(--ink-3); }

/* ===== Ajustements téléphone (en dernier) ===== */
@media (max-width: 900px) {
  .today-hero h1 { font-size: 26px; }
  .hero-text { padding: 16px 18px 12px; }
  .hero-date { font-size: 14px; }
  .motto { font-size: 15px; margin-top: 4px; }
  .today-hero { margin: 2px 0 14px; }
  .page-head h1 { font-size: 25px; }
  .tab-add-circle { background: var(--tile-done); color: #fff; }
  .block-head { margin-bottom: 12px; }
  .feux { margin-bottom: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
  .feux > summary { margin-bottom: 0; }
  .feux[open] > summary { margin-bottom: 10px; }
}

@media (max-width: 900px) {
  .task-add select { flex: 1 1 140px; }
  .task-panel-list { grid-template-columns: 1fr; max-height: 50vh; }
  .tp-task { min-height: 44px; font-size: 15px; }
  .plan-btn { width: 42px; height: 42px; }
}
