/* Ma Classe Magique — pensé pour l'iPad (paysage et portrait), marche aussi sur ordinateur et téléphone. */
:root {
  --violet: #6C5CE7;
  --violet-2: #8E7CF8;
  --violet-3: #B9AEFF;
  --violet-pale: #F1EEFF;
  --violet-ink: #3A2C9E;
  --rose: #FF6FA5;
  --bg: #F5F3FF;
  --card: #FFFFFF;
  --ink: #2B2545;
  --ink-2: #6B6585;
  --line: #E8E4F7;
  --green: #2EBD7A;
  --green-pale: #E3F8EE;
  --red: #F0566B;
  --red-pale: #FFE7EA;
  --orange: #FF9F43;
  --orange-pale: #FFF1E2;
  --blue: #3D8BFD;
  --blue-pale: #E5F0FF;
  --shadow: 0 6px 20px rgba(76, 58, 180, 0.09);
  --shadow-lg: 0 18px 50px rgba(52, 37, 140, 0.22);
  --r: 22px;
  --r-sm: 14px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --side: 236px;
  --top: 76px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}
input, textarea, select { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--ink-2); }
.small-tx { font-size: 14px; margin-top: 10px; }
.ic { flex: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.center { text-align: center; }
.pad { padding: 20px; }
.big-emoji { font-size: 64px; margin: 6px 0; }
#app { height: 100%; }

/* ---------- Boutons, champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 800; font-size: 16px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.primary { background: linear-gradient(135deg, var(--violet), var(--violet-2)); color: #fff; box-shadow: 0 6px 16px rgba(108, 92, 231, .35); }
.btn.ghost { background: var(--violet-pale); color: var(--violet-ink); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger.ghost { background: var(--red-pale); color: #C22A41; }
.btn.big { min-height: 58px; font-size: 18px; padding: 0 28px; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn.choice { background: var(--violet-pale); color: var(--violet-ink); min-height: 58px; width: 100%; white-space: normal; text-align: center; font-size: 17px; border-radius: 18px; padding: 10px 18px; }
.btn.choice:active { background: var(--violet-3); }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--violet-pale); color: var(--violet-ink); flex: none; }
.icon-btn.small { width: 38px; height: 38px; background: transparent; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.chip.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.chip.idea { background: #FFFBEA; border-color: #FFE7A3; font-weight: 600; }
.dots { display: flex; flex-wrap: wrap; gap: 10px; }
.dot { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.dot.on { box-shadow: 0 0 0 3px var(--violet); }
.seg { display: inline-flex; background: var(--violet-pale); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 800; color: var(--violet-ink); }
.seg button.on { background: #fff; box-shadow: var(--shadow); color: var(--violet); }
.seg.small button { min-height: 36px; padding: 0 12px; font-size: 14px; }
.seg button.on.ok { background: var(--green); color: #fff; }
.seg button.on.ko { background: var(--red); color: #fff; }
input:not([type=checkbox]):not([type=range]), textarea, select {
  width: 100%; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 12px 14px; font-size: 17px; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--violet-2); }
textarea { resize: none; }
label { display: block; font-weight: 800; font-size: 15px; color: var(--ink-2); margin: 14px 0 6px; }
label > input, label > textarea, label > select { margin-top: 6px; color: var(--ink); font-weight: 600; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
label.inline input { width: auto; margin: 0; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); }
label.check input { width: 22px; height: 22px; accent-color: var(--violet); }
label.block { margin-top: 16px; }
input[type=range] { width: 100%; accent-color: var(--violet); height: 34px; }
.switch { display: flex; align-items: center; gap: 12px; color: var(--ink); margin-top: 16px; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 54px; height: 32px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: transform .2s; }
.switch input:checked + span { background: var(--violet); }
.switch input:checked + span::after { transform: translateX(22px); }
.pill { display: inline-flex; align-items: center; gap: 4px; min-width: 24px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--violet-pale); color: var(--violet-ink); font-weight: 800; font-size: 14px; justify-content: center; }
.pill.green { background: var(--green-pale); color: #157A4C; }
.pill.red { background: var(--red-pale); color: #C22A41; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 8px; padding: 2px 8px; margin: 3px 4px 0 0; }
.tag.blue { background: var(--blue-pale); color: #1F5FC7; }
.tag.grey { background: #EEEDF3; color: #5D5873; }
.tag.orange { background: var(--orange-pale); color: #B35F00; }
.bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.35); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #FFD25E, #FF9EC8); }
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }

/* ---------- Écran de démarrage ---------- */
.splash { height: 100%; display: grid; place-content: center; justify-items: center; gap: 18px; background: linear-gradient(160deg, var(--violet), var(--violet-2)); color: #fff; }
.splash img { border-radius: 36px; box-shadow: var(--shadow-lg); }
.splash-title { font-size: 30px; font-weight: 900; }

/* ---------- Création de la classe ---------- */
.onb { height: 100%; overflow-y: auto; background: radial-gradient(circle at 20% 10%, #A99BFF 0, transparent 40%), radial-gradient(circle at 90% 90%, #FFB3D6 0, transparent 35%), linear-gradient(160deg, var(--violet), var(--violet-2)); padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b)); display: flex; align-items: center; justify-content: center; }
.onb-card { width: min(920px, 100%); background: #fff; border-radius: 34px; box-shadow: var(--shadow-lg); padding: 34px; animation: pop .35s ease; }
.onb-hero { text-align: center; padding: 10px 0; }
.onb-hero h1 { font-size: 44px; font-weight: 900; color: var(--violet-ink); margin: 6px 0 10px; }
.onb-hero p { font-size: 20px; color: var(--ink-2); max-width: 560px; margin: 0 auto 26px; }
.onb-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.onb-guide { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.onb-guide .mascot { flex: none; animation: float 3s ease-in-out infinite; }
.bubble { background: var(--violet-pale); color: var(--violet-ink); font-size: 21px; font-weight: 800; padding: 18px 22px; border-radius: 26px 26px 26px 6px; position: relative; }
.onb-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.onb-dots i { width: 34px; height: 8px; border-radius: 9px; background: var(--line); }
.onb-dots i.on { background: var(--violet); }
.niv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.niv { background: var(--violet-pale); border-radius: 24px; padding: 20px 10px; display: grid; justify-items: center; gap: 4px; border: 3px solid transparent; transition: transform .15s; }
.niv:active { transform: scale(.96); }
.niv.on { border-color: var(--violet); background: #fff; box-shadow: var(--shadow); }
.niv-emoji { font-size: 40px; }
.niv b { font-size: 26px; font-weight: 900; color: var(--violet-ink); }
.niv small { color: var(--ink-2); font-weight: 700; }
.onb-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.onb-who { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.onb-av { display: grid; justify-items: center; gap: 12px; }
.onb-av .av { border-radius: 50%; box-shadow: var(--shadow); }
.onb-form { flex: 1; min-width: 260px; }
.onb-form.wide { width: 100%; }
.onb-form .chips { margin-top: 10px; }
.code-in { text-transform: uppercase; letter-spacing: 3px; font-weight: 800; text-align: center; font-size: 22px !important; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; max-height: 52vh; overflow-y: auto; padding: 4px; }
.class-grid.big { max-height: none; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.kid { background: #fff; border-radius: 20px; padding: 12px 6px; display: grid; justify-items: center; gap: 2px; box-shadow: var(--shadow); position: relative; transition: transform .15s; }
.kid:active { transform: scale(.95); }
.kid .av { border-radius: 50%; }
.kid b { font-size: 16px; margin-top: 4px; }
.kid small { color: var(--ink-2); font-size: 13px; }
.kid.small { box-shadow: none; background: var(--violet-pale); padding: 10px 4px; }
.kid-tag { position: absolute; top: 8px; right: 10px; font-size: 16px; }

/* ---------- Mise en page de l'appli ---------- */
.shell { height: 100%; display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: minmax(0, 1fr); }
.side { background: linear-gradient(180deg, var(--violet) 0%, var(--violet-2) 100%); color: #fff; display: flex; flex-direction: column; padding: calc(14px + var(--safe-t)) 12px calc(12px + var(--safe-b)); gap: 10px; overflow-y: auto; }
.me { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px; border-radius: 18px; background: rgba(255,255,255,.13); }
.me .av { border-radius: 50%; border: 3px solid rgba(255,255,255,.7); flex: none; }
.me-tx { display: grid; min-width: 0; }
.me-tx b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-tx small { opacity: .85; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: grid; gap: 3px; margin-top: 6px; }
.nav-btn { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 48px; border-radius: 14px; font-weight: 800; font-size: 16px; color: rgba(255,255,255,.92); position: relative; transition: background .15s; }
.nav-btn:active { background: rgba(255,255,255,.18); }
.nav-btn.on { background: #fff; color: var(--violet); box-shadow: 0 6px 16px rgba(40, 20, 140, .25); }
.nav-badge { margin-left: auto; min-width: 24px; height: 24px; border-radius: 99px; background: var(--rose); color: #fff; font-size: 13px; display: none; place-items: center; padding: 0 7px; }
.nav-badge.show { display: grid; }
.side-foot { margin-top: auto; display: flex; justify-content: center; opacity: .95; }
.mascot-mini .mascot { animation: float 3.5s ease-in-out infinite; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.top { height: calc(var(--top) + var(--safe-t)); padding: var(--safe-t) 20px 0; display: flex; align-items: center; gap: 14px; background: rgba(245, 243, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex: none; }
.top-title { font-size: 26px; font-weight: 900; color: var(--violet-ink); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock-box { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 99px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow); }
.clock { display: grid; line-height: 1.1; }
.clock-day { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.clock-time { display: flex; align-items: baseline; gap: 8px; }
.clock-time b { font-size: 22px; font-weight: 900; color: var(--violet-ink); font-variant-numeric: tabular-nums; }
.clock-time span { font-size: 13px; color: var(--violet); font-weight: 800; white-space: nowrap; }
.clock-ctl { display: flex; gap: 4px; }
.cbtn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--violet-pale); color: var(--violet); font-weight: 900; font-size: 15px; }
.cbtn:active { transform: scale(.92); }
.next-day { min-height: 42px; }
.top-stars { background: #FFF6D8; color: #9A6A00; border-radius: 99px; padding: 0 14px; min-height: 44px; font-weight: 800; white-space: nowrap; }
.top-bell { width: 46px; height: 46px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--violet); position: relative; flex: none; }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--rose); border: 2px solid #fff; display: none; }
.bell-dot.show { display: block; }
.content { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px 20px calc(24px + var(--safe-b)); }
.screen.enter { animation: fade .2s ease; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Accueil ---------- */
.hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, var(--violet) 0%, var(--violet-2) 60%, var(--violet-3) 100%); color: #fff; border-radius: 28px; padding: 22px 26px; box-shadow: 0 14px 34px rgba(108, 92, 231, .3); position: relative; overflow: hidden; }
.hero::after { content: "✦"; position: absolute; right: 190px; top: 10px; font-size: 26px; opacity: .5; }
.hero-tx { flex: 1; min-width: 0; }
.hero h2 { font-size: 30px; font-weight: 900; margin: 2px 0 4px; }
.hero p { margin: 0; opacity: .92; font-weight: 600; }
.hero-date { font-weight: 800 !important; }
.hero-mascot { flex: none; animation: float 3s ease-in-out infinite; }
.level { display: flex; align-items: center; gap: 12px; margin-top: 14px; background: rgba(255,255,255,.16); padding: 10px 14px; border-radius: 16px; max-width: 560px; }
.level-name { font-weight: 900; white-space: nowrap; }
.level-next { font-weight: 800; font-size: 14px; white-space: nowrap; }
.night { display: flex; align-items: center; gap: 16px; margin-top: 16px; background: linear-gradient(120deg, #2E2A6B, #4B3FA6); color: #fff; }
.night p { margin: 0; opacity: .85; }
.night-ic { font-size: 40px; }
.night .btn { margin-left: auto; }
.sits { display: grid; gap: 10px; margin-top: 16px; }
.sit-card { display: flex; align-items: center; gap: 14px; background: #FFF8E6; border: 2px solid #FFE3A0; border-radius: 20px; padding: 14px 16px; text-align: left; animation: wiggle 1.4s ease 2; }
.sit-card > span:nth-child(2) { flex: 1; display: grid; }
.sit-card small { color: var(--ink-2); font-size: 15px; }
.sit-card-emoji { font-size: 38px; }
.dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.dash .card + .card { margin-top: 0; }
.todos { display: grid; gap: 8px; }
.todo { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border-radius: 16px; background: var(--violet-pale); }
.todo > span:last-child { display: grid; }
.todo small { color: var(--ink-2); font-size: 14px; }
.todo-ic { font-size: 24px; width: 34px; text-align: center; }
.todo.urgent { background: var(--orange-pale); }
.todo.done { background: var(--green-pale); }
.todo.done b { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.3); }
.presence { font-size: 17px; margin-bottom: 8px; }
.presence b { font-size: 34px; color: var(--violet); font-weight: 900; }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mini-list li { display: flex; align-items: center; gap: 10px; }
.mini-list .av { border-radius: 50%; flex: none; }
.mini-list small { color: var(--ink-2); }
.notif-list { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.notif-list.small { max-height: none; }
.notif { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px; border-radius: 14px; background: #FAF9FF; width: 100%; }
.notif.new { background: var(--violet-pale); }
.notif-ic { font-size: 22px; width: 30px; text-align: center; flex: none; }
.notif-tx { flex: 1; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-t { font-size: 13px; color: var(--ink-2); flex: none; }
.evts { display: grid; gap: 8px; }
.evt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px; border-radius: 16px; width: 100%; }
.evts.big .evt { padding: 12px; border-bottom: 1px solid var(--line); border-radius: 0; }
.evt.today { background: var(--violet-pale); border-radius: 16px; }
.evt.past { opacity: .5; }
.evt > span:last-of-type, .evt-tx { display: grid; flex: 1; }
.evt small { color: var(--ink-2); font-size: 14px; }
.evt-emoji { font-size: 30px; }
.date-chip { display: grid; justify-items: center; width: 58px; flex: none; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 4px 0; line-height: 1.05; }
.date-chip small { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.date-chip b { font-size: 24px; color: var(--violet-ink); font-weight: 900; }
.menu { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-weight: 700; }
.menu-card { background: linear-gradient(160deg, #fff, #FFF7EC); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: #F4F3F8; filter: grayscale(1); opacity: .5; }
.badge.on { filter: none; opacity: 1; background: #FFF6D8; }
.badge span { font-size: 28px; }
.badge small { font-size: 11px; font-weight: 700; line-height: 1.15; }
.anniv-card { margin-bottom: 16px; background: #FFF0F6; }

/* ---------- Messagerie ---------- */
body[data-screen=messages] .content { padding: 0; overflow: hidden; }
body[data-screen=messages] .content { display: flex; flex-direction: column; }
.screen-messages { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msg-layout { display: grid; grid-template-columns: 360px 1fr; grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 0; }
.conv-list-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #fff; min-height: 0; }
.conv-tools { display: flex; gap: 8px; padding: 14px; align-items: center; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--violet-pale); border-radius: 99px; padding: 0 14px; margin: 0; color: var(--ink-2); }
.search input { border: 0 !important; background: transparent !important; padding: 11px 0 !important; margin: 0 !important; font-size: 16px; }
.conv-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.conv-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-bottom: 1px solid #F1EFFA; }
.conv-row.on { background: var(--violet-pale); }
.conv-row.unread b { color: var(--violet-ink); }
.conv-row.unread .conv-prev { color: var(--ink); font-weight: 700; }
.conv-mid { flex: 1; min-width: 0; display: grid; }
.conv-mid b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.conv-sub { color: var(--violet); font-weight: 800; font-size: 13px; }
.conv-prev { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-right { display: grid; justify-items: end; gap: 4px; flex: none; }
.conv-right small { color: var(--ink-2); font-size: 12px; }
.conv-right .pill { background: var(--violet); color: #fff; }
.av { flex: none; }
.conv-row .av, .head-avs .av, .new-row .av { border-radius: 50%; }
.av-stack { position: relative; flex: none; width: 52px; height: 52px; }
.av-stack > .av { border-radius: 50%; }
.av-mini { position: absolute; right: -6px; bottom: -4px; border: 2px solid #fff; border-radius: 50%; display: flex; }
.av-mini .av { border-radius: 50%; }
.av-group { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #FFD3E8, #D9D0FF); display: grid; place-items: center; font-size: 26px; flex: none; }
.conv-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: linear-gradient(180deg, #F7F5FF, #F2EFFF); }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.head-avs { display: flex; }
.head-avs .av + .av { margin-left: -10px; border: 2px solid #fff; }
.head-tx { flex: 1; display: grid; min-width: 0; }
.head-tx small { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-btn { display: none; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: var(--violet); }
.msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.day-sep { text-align: center; margin: 10px 0; }
.day-sep span { background: rgba(108, 92, 231, .1); color: var(--violet-ink); font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 99px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; }
.bubble-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.b-av .av { border-radius: 50%; }
.bubble-col { display: grid; gap: 2px; }
.mine .bubble-col { justify-items: end; }
.b-name { font-size: 12px; font-weight: 800; color: var(--violet); margin-left: 10px; }
.bubble { background: #fff; padding: 10px 14px; border-radius: 20px 20px 20px 6px; box-shadow: 0 2px 8px rgba(76, 58, 180, .07); font-size: 16px; -webkit-user-select: text; user-select: text; word-break: break-word; }
.mine .bubble { background: linear-gradient(135deg, var(--violet), var(--violet-2)); color: #fff; border-radius: 20px 20px 6px 20px; }
.b-time { font-size: 11px; color: var(--ink-2); margin: 0 8px; }
.bubble.typing { display: flex; gap: 5px; padding: 14px 16px; }
.bubble.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--violet-3); animation: blink 1.2s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .2s; }
.bubble.typing i:nth-child(3) { animation-delay: .4s; }
.empty-conv { margin: auto; text-align: center; color: var(--ink-2); font-weight: 700; max-width: 320px; }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px 0; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick-chip { flex: none; background: #fff; border-color: var(--violet-3); color: var(--violet-ink); font-size: 14px; }
.compose { display: flex; gap: 10px; align-items: flex-end; padding: 10px 14px calc(12px + var(--safe-b)); }
.compose textarea { border-radius: 22px; min-height: 48px; max-height: 140px; padding: 12px 16px; }
.send-btn { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--violet-2)); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px rgba(108, 92, 231, .35); }
.send-btn:active { transform: scale(.92); }
.conv-empty { margin: auto; display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--violet-3); }
.conv-empty p { color: var(--ink-2); font-weight: 700; }
.new-msg h3 { margin-top: 18px; }
.new-row { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px; border-radius: 16px; background: var(--violet-pale); width: 100%; }
.new-row span:last-child { display: grid; }
.new-row small { color: var(--ink-2); }
.new-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.new-kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }

/* ---------- Appel ---------- */
.appel-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.appel-sum .pill { height: 34px; font-size: 15px; padding: 0 14px; }
.appel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.appel-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; background: #fff; border-radius: 20px; padding: 12px; box-shadow: var(--shadow); border: 3px solid transparent; transition: border-color .15s, background .15s; }
.appel-card .av { border-radius: 50%; grid-row: span 2; }
.appel-card.abs { background: #FFF5F6; border-color: #FFC9D1; }
.appel-card.abs .av { filter: grayscale(.7); opacity: .7; }
.appel-id { display: grid; }
.appel-id small { color: var(--ink-2); font-size: 13px; }
.appel-seg { justify-self: start; }
.card.warn { background: var(--orange-pale); margin-bottom: 14px; }
.nj { display: grid; gap: 8px; margin-top: 8px; }
.nj-row { display: flex; align-items: center; gap: 10px; }
.nj-row .av { border-radius: 50%; }
.nj-row b { flex: 1; }

/* ---------- Cahier de textes, agenda, notes ---------- */
.split { display: grid; grid-template-columns: minmax(340px, 1fr) 1.2fr; gap: 16px; align-items: start; }
.split .card + .card { margin-top: 0; }
.form-card label:first-of-type { margin-top: 0; }
.form-card .btn.big { width: 100%; margin-top: 16px; }
.ideas { margin-top: 10px; }
.dv-day { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dv-list { flex: 1; display: grid; gap: 8px; }
.dv { display: flex; align-items: center; gap: 10px; background: var(--violet-pale); border-radius: 14px; padding: 10px 6px 10px 12px; }
.dv > span:nth-child(2) { flex: 1; display: grid; }
.dv b { font-size: 14px; color: var(--violet); }
.dv-emoji { font-size: 26px; }
.form .row label { flex: 1; }
.emo-chip { font-size: 22px; min-width: 52px; justify-content: center; }
.evals { display: grid; gap: 12px; }
.eval-card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; margin: 0 !important; }
.eval-emoji { font-size: 34px; }
.eval-tx { flex: 1; display: grid; }
.eval-tx small { color: var(--ink-2); }
.eval-dist { display: flex; gap: 6px; flex-wrap: wrap; }
.comp { font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 8px; }
.comp.g2, .comp-seg button.on.g2 { background: #1FA866; color: #fff; }
.comp.g1, .comp-seg button.on.g1 { background: var(--green-pale); color: #157A4C; }
.comp.o, .comp-seg button.on.o { background: var(--orange-pale); color: #B35F00; }
.comp.r, .comp-seg button.on.r { background: var(--red-pale); color: #C22A41; }
.grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 4px 20px; }
.grade-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.grade-row .av { border-radius: 50%; }
.grade-row b { flex: 1; }
.grade-row b small { color: var(--ink-2); font-weight: 600; }
.grade-in { width: 84px !important; text-align: center; font-weight: 800; font-size: 19px !important; padding: 8px !important; }
.meteo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.meteo-card { display: grid; justify-items: center; gap: 4px; background: #FAF9FF; border-radius: 18px; padding: 12px 6px; }
.meteo-card .av { border-radius: 50%; }
.meteo-btns { display: flex; gap: 4px; }
.meteo-btns button { width: 40px; height: 40px; border-radius: 50%; font-size: 22px; opacity: .35; filter: grayscale(.6); }
.meteo-btns button.on { opacity: 1; filter: none; background: #fff; box-shadow: var(--shadow); }

/* ---------- Actualités, documents ---------- */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.feed .card + .card { margin-top: 0; }
.actu { padding: 0; overflow: hidden; }
.actu-img { height: 150px; display: grid; place-items: center; position: relative; }
.actu-img span { font-size: 72px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.15)); }
.actu-img em { position: absolute; left: 14px; bottom: 12px; background: rgba(255,255,255,.9); color: var(--violet-ink); font-style: normal; font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 99px; }
.actu-body { padding: 16px 18px; }
.actu-body h3 { margin-bottom: 6px; }
.actu-meta { display: flex; align-items: center; gap: 16px; color: var(--ink-2); font-weight: 700; font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.actu-meta span { display: inline-flex; align-items: center; gap: 4px; }
.actu-meta span:first-child { color: var(--rose); }
.actu-meta small { margin-left: auto; }
.comments { display: grid; gap: 8px; margin-top: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; background: #FAF9FF; padding: 8px; border-radius: 12px; }
.comment .av { border-radius: 50%; }
.illus { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.illu { height: 84px; border-radius: 16px; display: grid; place-items: center; border: 3px solid transparent; }
.illu span { font-size: 34px; }
.illu small { font-weight: 800; font-size: 12px; color: var(--violet-ink); }
.illu.on { border-color: var(--violet); box-shadow: var(--shadow); }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.docs .card + .card { margin-top: 0; }
.doc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.doc-head > span:last-child { display: grid; }
.doc-head small { color: var(--ink-2); font-size: 14px; }
.doc-ic { font-size: 34px; width: 56px; height: 56px; border-radius: 16px; background: var(--violet-pale); display: grid; place-items: center; flex: none; }
.sign-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.sign-bar .bar { background: var(--violet-pale); }
.sign-bar .bar i { background: linear-gradient(90deg, var(--green), #7FE0B0); }

/* ---------- Fiches, réglages ---------- */
.fiche-top { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.fiche-id { flex: 1; min-width: 300px; display: grid; gap: 10px; }
.fiche-id .row input.big-in { flex: 1; min-width: 140px; font-size: 20px; font-weight: 800; }
.fiche h3 { margin-top: 18px; }
.fiche-actions { margin-top: 20px; }
.av-btn { position: relative; border-radius: 50%; flex: none; }
.av-btn .av { border-radius: 50%; box-shadow: var(--shadow); }
.av-btn > span { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; border: 2px solid #fff; }
.av-btn.big > span { width: 36px; height: 36px; right: 4px; bottom: 4px; }
.parents { display: grid; gap: 10px; }
.parent-card { display: flex; gap: 12px; align-items: center; background: #FAF9FF; border-radius: 18px; padding: 10px; }
.parent-fields { flex: 1; display: grid; gap: 8px; }
.parent-fields .row > * { flex: 1; min-width: 110px; }
.parent-fields .row > .btn { flex: none; }
.parent-fields input, .parent-fields select { padding: 9px 12px; font-size: 16px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings .card + .card { margin-top: 0; }
.profile-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.save-card { background: linear-gradient(160deg, #fff, #F1EEFF); }
.code-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 2px dashed var(--violet-3); border-radius: 18px; padding: 12px 16px; margin: 10px 0; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 24px; font-weight: 800; letter-spacing: 2px; color: var(--violet-ink); flex: 1; -webkit-user-select: all; user-select: all; }
.steps { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 6px; }
.settings .row input.code-in { flex: 1; min-width: 200px; font-size: 18px !important; }
.settings .btn.danger { margin-top: 14px; }

/* ---------- Éditeur de portrait ---------- */
.ave { display: flex; gap: 24px; align-items: flex-start; }
.ave-prev { display: grid; justify-items: center; gap: 12px; position: sticky; top: 0; }
.ave-prev .av { border-radius: 50%; box-shadow: var(--shadow); }
.ave-opts { flex: 1; max-height: 58vh; overflow-y: auto; padding-right: 6px; }
.ave-opts label { margin-top: 12px; }
.ave-opts label:first-child { margin-top: 0; }
.ave-wrap .row.end { margin-top: 16px; }

/* ---------- Fenêtres, notifications ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(35, 25, 90, .42); backdrop-filter: blur(4px); display: grid; place-items: center; padding: calc(20px + var(--safe-t)) 16px calc(20px + var(--safe-b)); z-index: 50; animation: fade .18s ease; }
.modal-wrap.out { opacity: 0; transition: opacity .18s; }
.modal { background: #fff; border-radius: 30px; padding: 28px; width: min(560px, 100%); max-height: 100%; overflow-y: auto; box-shadow: var(--shadow-lg); position: relative; animation: pop .25s ease; }
.modal.wide { width: min(860px, 100%); }
.modal > h2 { margin-bottom: 12px; padding-right: 40px; }
.modal-x { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; background: var(--violet-pale); color: var(--violet-ink); display: grid; place-items: center; z-index: 2; }
.confirm p { font-size: 19px; margin: 6px 40px 20px 0; }
.sit, .bilan, .badge-win { text-align: center; display: grid; justify-items: center; gap: 8px; }
.sit-emoji, .badge-big { font-size: 74px; line-height: 1; animation: pop .4s ease; }
.sit-who { display: flex; gap: 8px; }
.sit-who .av { border-radius: 50%; box-shadow: var(--shadow); }
.sit h2 { font-size: 26px; }
.sit-tx { font-size: 20px; margin: 4px 0; }
.sit-q { font-weight: 900; color: var(--violet); margin-top: 6px; }
.sit-choix { display: grid; gap: 10px; width: 100%; }
.bilan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin: 10px 0; }
.bilan-grid div { background: var(--violet-pale); border-radius: 18px; padding: 14px 8px; display: grid; }
.bilan-grid b { font-size: 30px; color: var(--violet-ink); }
.bilan-grid span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.bilan-niv { font-size: 17px; }
#toasts { position: fixed; top: calc(var(--top) + 10px + var(--safe-t)); right: 16px; z-index: 60; display: grid; gap: 8px; width: min(400px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow-lg); border-left: 6px solid var(--violet); animation: slidein .3s ease; font-size: 15px; }
.toast.badge-toast { border-left-color: #F2A900; background: linear-gradient(120deg, #FFF8DC, #fff); }
.toast.badge-toast .toast-ic { font-size: 32px; animation: pop .5s ease; }
.toast.out { opacity: 0; transform: translateX(30px); transition: all .35s; }
.toast-ic { font-size: 24px; flex: none; }
.toast-tx { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.star-pop { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); z-index: 70; display: grid; justify-items: center; pointer-events: none; animation: rise 1.9s ease forwards; }
.star-pop b { font-size: 46px; color: #F2A900; text-shadow: 0 4px 0 #fff, 0 8px 24px rgba(242, 169, 0, .4); }
.star-pop span { background: #fff; padding: 4px 14px; border-radius: 99px; font-weight: 800; color: var(--violet-ink); box-shadow: var(--shadow); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes slidein { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-1deg); } 75% { transform: rotate(1deg); } }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 30% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- iPad en portrait / petit écran ---------- */
@media (max-width: 1180px) {
  .dash { grid-template-columns: 1fr 1fr; }
  .top-stars { display: none; }
}
@media (max-width: 1060px) {
  :root { --side: 96px; }
  .me { justify-content: center; padding: 6px; }
  .me .av { width: 56px; height: 56px; }
  .me-tx { display: none; }
  .nav-btn { flex-direction: column; justify-content: center; gap: 2px; padding: 8px 2px; min-height: 64px; font-size: 11.5px; text-align: center; line-height: 1.1; }
  .nav-badge { position: absolute; top: 4px; right: 10px; margin: 0; min-width: 20px; height: 20px; font-size: 11px; }
  .side-foot { display: none; }
  .msg-layout { grid-template-columns: 300px 1fr; }
  .split, .settings { grid-template-columns: 1fr; }
  .hero::after { display: none; }
}
@media (max-width: 860px) {
  .msg-layout { grid-template-columns: 1fr; }
  .msg-layout.has-conv .conv-list-pane { display: none; }
  .msg-layout:not(.has-conv) .conv-pane { display: none; }
  .back-btn { display: grid; }
  .top-title { font-size: 22px; }
  .clock-day { display: none; }
  .hero-mascot .mascot { width: 100px; height: 100px; }
}
@media (max-width: 700px) {
  :root { --top: 64px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .side { order: 2; flex-direction: row; padding: 6px 6px calc(6px + var(--safe-b)); overflow-x: auto; overflow-y: hidden; }
  .me { display: none; }
  .nav { display: flex; margin: 0; gap: 2px; }
  .nav-btn { min-width: 70px; min-height: 56px; }
  .main { grid-row: 1; }
  .top-title { display: none; }
  .clock-box { flex: 1; justify-content: space-between; }
  .dash { grid-template-columns: 1fr; }
  .hero { flex-direction: column-reverse; text-align: center; }
  .level { margin: 12px auto 0; }
  .onb-card { padding: 22px; border-radius: 26px; }
  .onb-hero h1 { font-size: 32px; }
  .bubble { font-size: 17px; }
  .onb-guide .mascot { width: 80px; height: 80px; }
  .ave { flex-direction: column; align-items: center; }
  .ave-opts { max-height: none; }
  .bubble-row { max-width: 92%; }
  .modal { padding: 22px 18px; border-radius: 24px; }
}

/* ---------- Thèmes de couleur (Boutique) ---------- */
:root[data-theme=rose] { --violet: #E84393; --violet-2: #FD79A8; --violet-3: #FFB3D1; --violet-pale: #FFEEF6; --violet-ink: #A31E62; --bg: #FFF5FA; --line: #F7DDEA; }
:root[data-theme=ocean] { --violet: #0984E3; --violet-2: #48B4F8; --violet-3: #9DD6FF; --violet-pale: #E8F5FF; --violet-ink: #075A9C; --bg: #F2F9FF; --line: #D8EAF8; }
:root[data-theme=foret] { --violet: #00A383; --violet-2: #3DD6A8; --violet-3: #9BEBD4; --violet-pale: #E5F8F2; --violet-ink: #036B56; --bg: #F2FBF8; --line: #D3EFE5; }
:root[data-theme=coucher] { --violet: #F0663A; --violet-2: #FDA65A; --violet-3: #FFD0A8; --violet-pale: #FFF1E8; --violet-ink: #A9401C; --bg: #FFF8F2; --line: #F8E1D2; }
:root[data-theme=nuit] { --violet: #3B3A8F; --violet-2: #6D6AE0; --violet-3: #B4B2F5; --violet-pale: #ECECFD; --violet-ink: #2A2970; --bg: #F3F3FC; --line: #DEDEF5; }

/* ---------- Salle de classe dessinée ---------- */
.salle { position: relative; height: 230px; border-radius: 18px; overflow: hidden; }
.salle.petite { height: 175px; }
.salle-mur { position: absolute; inset: 0 0 34% 0; background: linear-gradient(180deg, #FFF6E5, #FFEBD0); }
.salle-sol { position: absolute; inset: 66% 0 0 0; background: repeating-linear-gradient(90deg, #E7C9A0 0 40px, #DDBB8E 40px 80px); }
.tableau { position: absolute; left: 33%; width: 34%; top: 9%; height: 40%; background: #2F5D50; border: 6px solid #A8774A; border-radius: 8px; display: grid; place-items: center; box-shadow: inset 0 0 18px rgba(0,0,0,.25); }
.tableau span { color: #F4F7F2; font-size: 14px; font-weight: 700; text-align: center; padding: 4px 8px; font-family: "Chalkboard SE", "Comic Sans MS", var(--font); }
.salle.petite .tableau span { font-size: 11px; }
.deco-item { position: absolute; transform: translate(-50%, 0); line-height: 1; filter: drop-shadow(0 3px 3px rgba(0,0,0,.15)); }
.deco-item .aqua { display: inline-grid; place-items: center; width: 1.6em; height: 1.2em; background: linear-gradient(180deg, #CDEFFF, #7CC8F0); border: 3px solid #fff; border-radius: 8px; font-size: .8em; }
.deco-item .cadre { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; background: #fff; border: 4px solid #F2B5D4; border-radius: 6px; font-size: .75em; }
.guirlande { position: absolute; top: 2%; left: 0; right: 0; text-align: center; font-size: 15px; letter-spacing: 6px; white-space: nowrap; overflow: hidden; }
.salle-vide { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); width: 80%; text-align: center; font-size: 13px; font-weight: 700; color: #8A6B4A; background: rgba(255,255,255,.8); border-radius: 10px; padding: 6px 10px; }
.salle-card { padding: 12px; margin-bottom: 16px; }
.salle-mini h3 { justify-content: space-between; }
.dash-top { grid-template-columns: 1.1fr 1fr; }

/* ---------- Boutique ---------- */
.solde { background: #FFF6D8; color: #9A6A00; border-radius: 99px; padding: 10px 18px; font-weight: 800; }
.solde b { font-size: 20px; }
.shop-astuce { margin: -6px 0 14px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.shop-grid .card + .card { margin-top: 0; }
.shop-item { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 16px 10px; }
.shop-item.owned { background: linear-gradient(160deg, #fff, var(--violet-pale)); }
.shop-item b { font-size: 15px; }
.shop-emoji { font-size: 44px; line-height: 1; }
.shop-item .av { border-radius: 50%; }
.theme-pastille { width: 64px; height: 64px; border-radius: 50%; box-shadow: var(--shadow); }

/* ---------- Projets ---------- */
.projet { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--violet-pale); }
.projet + .projet { margin-top: 8px; }
.projet-emoji { font-size: 32px; }
.projet-tx { flex: 1; display: grid; gap: 3px; }
.projet-tx small { color: var(--ink-2); font-size: 14px; }
.projet-points { display: flex; gap: 4px; margin-top: 2px; }
.projet-points i { width: 18px; height: 6px; border-radius: 4px; background: #fff; }
.projet-points i.on { background: var(--violet); }
.fin-annee { margin-top: 12px; }
.sit-card.projet { background: var(--violet-pale); border-color: var(--violet-3); }

/* ---------- Progrès des élèves ---------- */
.mini-progres { width: 70%; height: 5px; border-radius: 4px; background: #EEEBF8; overflow: hidden; margin-top: 4px; }
.mini-progres i { display: block; height: 100%; background: linear-gradient(90deg, #7FE0B0, var(--green)); }
.progres-bloc { margin-top: 14px; display: grid; gap: 6px; }
.progres-bar { background: var(--violet-pale); max-width: 420px; }
.progres-bar i { background: linear-gradient(90deg, #7FE0B0, var(--green)); }

/* ---------- Bulletins ---------- */
.bulletins { display: grid; gap: 10px; margin-top: 12px; }
.bulletin { display: grid; grid-template-columns: 260px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bulletin-id { display: flex; gap: 10px; align-items: center; }
.bulletin-id .av { border-radius: 50%; }
.bulletin-id > div { display: grid; }
.bulletin-id small { color: var(--ink-2); font-size: 13px; }
.bulletin textarea { font-size: 15px; padding: 9px 12px; }

/* ---------- Album ---------- */
.album { background: #FFFDF6; border-radius: 26px; padding: 24px; box-shadow: var(--shadow); border: 10px solid #fff; outline: 2px dashed var(--violet-3); }
.album-tete { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.album-tete .av { border-radius: 50%; box-shadow: var(--shadow); }
.album-annee { color: var(--violet); font-weight: 900; margin: 0; }
.album-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.album-eleve { display: grid; justify-items: center; text-align: center; gap: 2px; background: #fff; border-radius: 16px; padding: 10px 6px; box-shadow: 0 3px 10px rgba(0,0,0,.06); transform: rotate(-1deg); }
.album-eleve:nth-child(2n) { transform: rotate(1.2deg); }
.album-eleve .av { border-radius: 50%; }
.album-eleve small { color: var(--violet-ink); font-weight: 700; font-size: 12px; line-height: 1.2; }
.album-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.album-stats div { background: var(--violet-pale); border-radius: 16px; padding: 12px; display: grid; text-align: center; }
.album-stats b { font-size: 26px; color: var(--violet-ink); }
.album-stats span { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.album-souvenirs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.souvenir { border-radius: 14px; height: 100px; display: grid; place-items: center; text-align: center; padding: 6px; }
.souvenir span { font-size: 34px; }
.souvenir small { font-weight: 800; color: var(--violet-ink); font-size: 12px; }
.album-annees { margin-bottom: 12px; }
.nouvelle-annee { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.nouvelle-annee > div { flex: 1; min-width: 240px; }

/* ---------- Espace parent, classe fermée ---------- */
.hold-btn { position: relative; overflow: hidden; margin-top: 12px; }
.hold-btn::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(108, 92, 231, .25); }
.hold-btn.hold::after { width: 100%; transition: width var(--hold, 3s) linear; }
.parent-actions { margin-top: 18px; }
.verrou { position: fixed; inset: 0; z-index: 80; background: radial-gradient(circle at 30% 20%, #6D6AE0, #2E2A6B 70%); display: grid; place-items: center; padding: 20px; animation: fade .3s ease; }
.verrou-carte { background: #fff; border-radius: 30px; padding: 30px; max-width: 520px; text-align: center; display: grid; justify-items: center; gap: 8px; box-shadow: var(--shadow-lg); }
.verrou-carte h2 { color: var(--violet-ink); }
@media (max-width: 1060px) { .dash-top { grid-template-columns: 1fr; } .bulletin { grid-template-columns: 1fr; } .album-stats { grid-template-columns: repeat(2, 1fr); } }

/* Créer un groupe (messagerie) */
.pick-list { max-height: min(52vh, 520px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 4px; }
.pick-fam h4 { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 16px; }
.pick-row { position: relative; border: 2px solid transparent; }
.pick-row.on { border-color: var(--violet); background: #fff; }
.pick-box { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; background: #fff; }
.pick-row.on .pick-box { background: var(--violet); border-color: var(--violet); }
.pick-row.on .pick-box::after { content: '✓'; color: #fff; font-weight: 900; font-size: 16px; }
.small-chip { min-height: 30px; padding: 0 10px; font-size: 13px; }
.pick-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pick-foot [data-compte] { flex: 1; min-width: 0; font-weight: 700; }
.pick-row > span:nth-child(2) { display: grid; min-width: 0; }

/* Tags @ dans la messagerie */
.tag-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--violet-pale); color: var(--violet); font-weight: 900; font-size: 22px; display: grid; place-items: center; }
.bubble .tag { color: var(--violet); font-weight: 800; }
.bubble-row.mine .bubble .tag { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.pick-raccourcis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
