/* Tandem — feuille de style. Mobile d'abord ; deux colonnes à partir de 980 px. */
@font-face { font-family: 'Figtree'; src: url(/fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F6F1EA;
  --surface: #FFFDF9;
  --surface-2: #F0E9DF;
  --surface-3: #E8DFD2;
  --ink: #25201C;
  --ink-2: #665D55;
  --ink-3: #9A9088;
  --line: #E4DACD;
  --line-2: #D6CABB;
  --focus: #25201C;
  --school: rgba(64, 132, 160, .10);
  --school-ink: #2F6F86;
  --ferie: #B04A3E;
  --shadow-1: 0 1px 2px rgba(60, 40, 20, .06), 0 2px 8px rgba(60, 40, 20, .05);
  --shadow-2: 0 10px 40px rgba(50, 30, 10, .16), 0 2px 8px rgba(50, 30, 10, .08);
  --radius: 18px;
  --radius-s: 12px;
  --t-ecole: #4A6CC0; --t-activite: #3B9466; --t-sante: #C14E47; --t-fete: #C88216; --t-vacances: #23949F; --t-autre: #85796E; --t-visite: #2E7D8C;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16130F; --surface: #1F1B17; --surface-2: #29241F; --surface-3: #332D27;
  --ink: #F3EDE5; --ink-2: #B9AEA3; --ink-3: #847A70; --line: #332D27; --line-2: #443C35; --focus: #F3EDE5;
  --school: rgba(90, 170, 200, .10); --school-ink: #7CC3DA; --ferie: #EE8B7E;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 10px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130F; --surface: #1F1B17; --surface-2: #29241F; --surface-3: #332D27;
    --ink: #F3EDE5; --ink-2: #B9AEA3; --ink-3: #847A70; --line: #332D27; --line-2: #443C35; --focus: #F3EDE5;
    --school: rgba(90, 170, 200, .10); --school-ink: #7CC3DA; --ferie: #EE8B7E;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 20px; height: 20px; flex: none; stroke-width: 2; }
svg.i.s { width: 16px; height: 16px; }
svg.i.xs { width: 14px; height: 14px; }

/* ------------------------------------------------------------- marque */
.logo-mark { position: relative; width: 26px; height: 18px; flex: none; }
.logo-mark i { position: absolute; top: 0; width: 18px; height: 18px; border-radius: 50%; mix-blend-mode: multiply; }
.logo-mark i:first-child { left: 0; background: var(--p1, #2E7D8C); }
.logo-mark i:last-child { right: 0; background: var(--p2, #D2665A); }
:root[data-theme="dark"] .logo-mark i { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-mark i { mix-blend-mode: screen; } }
.logo-mark.big { width: 64px; height: 44px; margin: 0 auto 14px; }
.logo-mark.big i { width: 44px; height: 44px; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; transition: opacity .25s; }
.boot-mark { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- boutons, champs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--ferie); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--ferie); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--c); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 0;
}
.avatar.s { width: 22px; height: 22px; font-size: 11px; }
.avatar.xs { width: 18px; height: 18px; font-size: 10px; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; }
.avatar-btn .avatar { width: 34px; height: 34px; font-size: 14px; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--surface-3); }
.form-error { min-height: 0; margin: 0; color: var(--ferie); font-size: 14px; font-weight: 500; }
.form-error:empty { display: none; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; border-radius: 10px; }

/* segmented & chips */
.seg { display: flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.seg button {
  flex: 1; min-height: 38px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap;
}
.chip[aria-pressed="true"] { border-color: var(--c, var(--ink)); background: color-mix(in srgb, var(--c, var(--ink)) 12%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--c, var(--ink)); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.day-chips .chip { min-width: 42px; justify-content: center; padding: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); position: relative; flex: none; transition: background .2s; margin: 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }
.switch .sw-text { display: grid; }
.switch .sw-sub { font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------- connexion */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); text-align: center; }
.login-title { font: 600 40px/1 var(--serif); letter-spacing: -.02em; margin: 0; font-variation-settings: 'SOFT' 100, 'WONK' 0; }
.login-sub { color: var(--ink-2); margin: 8px 0 28px; }
.login-who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.who-btn {
  display: grid; justify-items: center; gap: 10px; padding: 18px 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 16px; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.who-btn .avatar { width: 52px; height: 52px; font-size: 22px; }
.who-btn[aria-checked="true"] { border-color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c), var(--shadow-1); }
.who-btn:active { transform: scale(.98); }
.login-form { display: grid; gap: 14px; text-align: left; }

/* ------------------------------------------------------------- structure */
.app { min-height: 100dvh; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 18px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.brand { display: flex; align-items: center; gap: 9px; font: 600 21px/1 var(--serif); letter-spacing: -.01em; }
.tabs { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.offline-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); margin-right: 4px; }
.desk { display: none !important; }
.layout { padding: 4px 16px calc(96px + var(--safe-b)); max-width: 1320px; margin: 0 auto; }
.side { display: none; }
.main { outline: none; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  padding: 6px 8px calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line);
}
.bn { display: grid; justify-items: center; gap: 2px; border: 0; background: none; padding: 6px 0; font-size: 11.5px; font-weight: 600; color: var(--ink-3); border-radius: 12px; }
.bn[aria-current="page"] { color: var(--ink); }
.bn[aria-current="page"] svg { stroke-width: 2.4; }
.bn-add { justify-self: center; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; box-shadow: var(--shadow-2); margin-top: -18px; }
.bn-add svg { width: 26px; height: 26px; }

@media (min-width: 980px) {
  .desk { display: inline-flex !important; }
  .bottom-nav { display: none; }
  .top { padding: 14px 28px; border-bottom: 1px solid var(--line); }
  .tabs { display: flex; margin-left: 28px; }
  .tabs .seg button { min-width: 110px; }
  .layout { display: grid; grid-template-columns: 340px 1fr; gap: 28px; padding: 24px 28px 48px; align-items: start; }
  .side { display: grid; gap: 18px; position: sticky; top: 88px; }
}

/* ------------------------------------------------------------- cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 2px 10px; }
.section-title h2 { margin: 0; font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.section-title .link { border: 0; background: none; font-weight: 600; color: var(--ink-2); font-size: 14px; padding: 4px; }

/* Aujourd'hui */
.today { padding: 20px 20px 18px; position: relative; overflow: hidden; }
.today-date { font: 500 14px/1.2 var(--sans); color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.today-head { font: 600 27px/1.12 var(--serif); letter-spacing: -.015em; margin: 6px 0 0; font-variation-settings: 'SOFT' 60; }
.today-head .who { color: var(--c); }
.today-sub { margin-top: 8px; color: var(--ink-2); font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.today-sub b { color: var(--ink); font-weight: 600; }
.ho-list { display: grid; gap: 8px; margin-top: 16px; }
.handover {
  width: 100%; border: 0; text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2);
}
.handover .ho-in { font-weight: 500; color: var(--ink-3); }
.handover .ho-when { font-weight: 700; }
.handover .ho-txt { font-size: 14px; color: var(--ink-2); }
.handover .ho-arrow { display: flex; align-items: center; gap: 4px; }
.kidline { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.kidline:first-of-type { border-top: 0; }
.kid-stack { display: flex; }
.kid-stack .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.today-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.today-empty { color: var(--ink-3); font-size: 14px; }

.pending-card { padding: 14px 16px; display: grid; gap: 10px; border-color: color-mix(in srgb, var(--t-fete) 40%, var(--line)); background: color-mix(in srgb, var(--t-fete) 7%, var(--surface)); }
.pending-card h3 { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; }

/* listes d'évènements */
.ev-list { display: grid; gap: 8px; }
.ev {
  display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px 12px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-align: left; width: 100%;
  position: relative; transition: border-color .15s, transform .1s;
}
.ev:hover { border-color: var(--line-2); }
.ev:active { transform: scale(.995); }
.ev::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--tc); }
.ev-time { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.15; }
.ev-time small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.ev-main { min-width: 0; }
.ev-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.ev-meta { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.ev-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ev-right { display: flex; gap: 4px; align-items: center; }
.ev.pending { border-style: dashed; border-color: color-mix(in srgb, var(--t-fete) 55%, var(--line)); }
.ev.declined .ev-title { text-decoration: line-through; color: var(--ink-3); }
.ev.compact { grid-template-columns: 50px 1fr auto; padding: 9px 12px 9px 10px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.wait { background: color-mix(in srgb, var(--t-fete) 18%, var(--surface)); color: color-mix(in srgb, var(--t-fete) 80%, var(--ink)); }
.tag.no { background: color-mix(in srgb, var(--ferie) 15%, var(--surface)); color: var(--ferie); }
.tag.school { background: var(--school); color: var(--school-ink); }
.tag.ferie { background: color-mix(in srgb, var(--ferie) 12%, var(--surface)); color: var(--ferie); }

.day-group { margin-top: 22px; }
.day-group:first-child { margin-top: 6px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; flex-wrap: wrap; }
.day-head .dnum { font: 600 26px/1 var(--serif); letter-spacing: -.02em; min-width: 32px; }
.day-head .dname { font-weight: 600; text-transform: capitalize; }
.day-head .dmonth { color: var(--ink-3); }
.day-head.is-today .dnum { color: var(--c, var(--ink)); }
.day-head .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--ink-3); padding: 34px 12px; }
.empty .big { font: 600 20px/1.2 var(--serif); color: var(--ink-2); margin-bottom: 6px; }

/* ------------------------------------------------------------- calendrier */
.cal-head { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px; }
.cal-title { font: 600 28px/1.05 var(--serif); letter-spacing: -.02em; margin: 0 auto 0 2px; text-transform: capitalize; font-variation-settings: 'SOFT' 50; }
.cal-title span { color: var(--ink-3); font-weight: 400; }
.cal { user-select: none; touch-action: pan-y; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }
.cal-dow div { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cell {
  position: relative; display: flex; flex-direction: column; align-items: stretch; min-height: 64px; padding: 6px 4px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.cell:hover { border-color: var(--line-2); }
.cell.out { background: transparent; border-color: transparent; opacity: .45; }
.cell.school { background-image: linear-gradient(var(--school), var(--school)); }
.cell.weekend:not(.out) { background-color: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); }
.cell .n { align-self: center; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.cell.today .n { background: var(--ink); color: var(--bg); }
.cell.ferie .n { color: var(--ferie); }
.cell.today.ferie .n { color: var(--bg); background: var(--ferie); }
.cell .dots { display: flex; justify-content: center; gap: 3px; margin-top: 5px; flex-wrap: wrap; padding: 0 2px; }
.cell .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--tc); }
.cell .dots i.pending { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tc); }
.cell .chipsx { display: none; }
.cell .ferie-name, .cell .school-name { display: none; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 2px 0; font-size: 13px; color: var(--ink-2); align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cal-legend .sw.school { height: 12px; width: 16px; border-radius: 4px; background: var(--school); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--school-ink) 30%, transparent); }

@media (min-width: 640px) {
  .cell { min-height: 84px; }
}
@media (min-width: 980px) {
  .cal-grid { gap: 6px; }
  .cell { min-height: 112px; padding: 7px 7px 8px; }
  .cell .n { align-self: flex-start; width: 28px; height: 28px; }
  .cell .dots { display: none; }
  .cell .chipsx { display: grid; gap: 3px; margin-top: 4px; }
  .cx { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--tc) 12%, var(--surface)); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
  .cx b { font-weight: 700; color: color-mix(in srgb, var(--tc) 75%, var(--ink)); font-variant-numeric: tabular-nums; }
  .cx.pending { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 60%, transparent); }
  .cx.more { background: none; color: var(--ink-3); }
  .cell .ferie-name { display: block; position: absolute; top: 12px; right: 8px; left: 40px; text-align: right; font-size: 11px; font-weight: 700; color: var(--ferie); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cell .school-name { display: block; font-size: 11px; font-weight: 700; color: var(--school-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
}

/* ------------------------------------------------------------- mémos */
.memo-add { display: flex; gap: 8px; }
.memo-add .input { flex: 1; }
.memo-kids { margin-top: 10px; }
.memo-list { display: grid; gap: 6px; margin-top: 14px; }
.memo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.memo .tick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); background: none; display: grid; place-items: center; flex: none; color: transparent; }
.memo.done .tick { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.memo .mt { flex: 1; min-width: 0; }
.memo .mt p { margin: 0; overflow-wrap: anywhere; }
.memo.done .mt p { color: var(--ink-3); text-decoration: line-through; }
.memo .mm { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.memo .del { opacity: .6; }

/* ------------------------------------------------------------- feuilles (bottom sheets / modales) */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 14, 8, .38); animation: fade .2s ease; }
.sheet {
  position: relative; width: 100%; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-2); animation: up .28s cubic-bezier(.2, .9, .3, 1);
  padding-bottom: var(--safe-b);
}
.sheet.closing { animation: down .2s ease forwards; }
.sheet-wrap.closing .sheet-backdrop { animation: fade .2s ease reverse forwards; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes down { to { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px 8px 22px; flex: none; }
.sheet-head h2 { margin: 0; font: 600 22px/1.15 var(--serif); letter-spacing: -.01em; flex: 1; min-width: 0; }
.sheet-head h2 small { display: block; font: 500 13px/1.3 var(--sans); color: var(--ink-3); letter-spacing: 0; margin-top: 3px; }
.sheet-body { overflow-y: auto; padding: 6px 22px 18px; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 22px 16px; border-top: 1px solid var(--line); flex: none; background: var(--bg); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.ghost { flex: 0 0 auto; }
.form { display: grid; gap: 18px; }
.row2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; }
.group-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 6px 0 0; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 24px; max-height: 88dvh; animation: pop .22s cubic-bezier(.2, .9, .3, 1); }
  .sheet.closing { animation: popout .16s ease forwards; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 18px; }
  @keyframes pop { from { transform: scale(.97); opacity: 0; } }
  @keyframes popout { to { transform: scale(.97); opacity: 0; } }
}

/* détail */
.detail-top { display: flex; gap: 14px; align-items: flex-start; }
.type-badge { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 15%, var(--surface)); color: var(--tc); flex: none; }
.dl { display: grid; gap: 12px; margin: 18px 0 4px; }
.dl > div { display: flex; gap: 12px; align-items: flex-start; }
.dl svg { color: var(--ink-3); margin-top: 1px; }
.dl .v { min-width: 0; overflow-wrap: anywhere; }
.dl .v small { display: block; color: var(--ink-3); font-size: 13px; }
.notes { white-space: pre-wrap; }
.status-box { margin-top: 16px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--t-fete) 12%, var(--surface)); display: grid; gap: 12px; }
.status-box.no { background: color-mix(in srgb, var(--ferie) 10%, var(--surface)); }
.status-box p { margin: 0; }
.status-box .acts { display: flex; gap: 8px; }
.status-box .acts .btn { flex: 1; }
.meta-line { margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.actions-row .btn { flex: 1 1 auto; }

/* activité */
.act { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.act.unread { position: relative; }
.act.unread::after { content: ''; position: absolute; right: 6px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--ferie); }
.act p { margin: 0; padding-right: 16px; }
.act small { color: var(--ink-3); font-size: 12.5px; }

/* réglages */
.set-sec { margin-bottom: 26px; }
.set-sec h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
.set-card > * + * { border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row small { display: block; color: var(--ink-3); font-size: 13px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 0; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.color-dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.url-box { display: flex; gap: 8px; margin: 10px 0; }
.url-box input { flex: 1; min-width: 0; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.inline-input { border: 0; background: transparent; padding: 6px 0; font-weight: 600; min-width: 0; width: 100%; outline: none; border-bottom: 1px dashed transparent; }
.inline-input:focus { border-bottom-color: var(--ink-3); }
details.howto { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
details.howto summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.howto ol { margin: 6px 0 4px; padding-left: 20px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-2); font-weight: 500; display: flex; gap: 10px; align-items: center; animation: up .25s ease; pointer-events: auto; }
.toast.err { background: var(--ferie); color: #fff; }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 4px; }
@media (min-width: 980px) { .toasts { bottom: 28px; } }

/* vue Aujourd'hui (mobile) */
.home-grid { display: grid; gap: 14px; }
.mini-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 12px 10px 14px; }
.mw { display: grid; justify-items: center; gap: 4px; border: 0; background: none; padding: 4px 0 2px; border-radius: 10px; }
.mw .d { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; }
.mw .n { font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.mw.today .n { background: var(--ink); color: var(--bg); }
.mw .dots { display: flex; gap: 2px; height: 6px; }
.mw .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--tc); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.form > *, .row2 > *, .field { min-width: 0; }
.sheet-body { overflow-x: hidden; }
.handover .ho-in { white-space: nowrap; }
.set-card > .hint { border-top: 0; }
.pending-card .ev-title { white-space: normal; }
