:root {
  /* Krayti: tableau vert ardoise + jaune crayon, fond craie légèrement vert */
  --ink: #16302A;
  --ink-2: #24463D;
  --ink-soft: #2F4740;
  --muted: #4E5F58;
  --line: #DDE4E0;
  --line-2: #C3CEC8;
  --ground: #F1F4F1;
  --card: #FFFFFF;
  --accent: #F2B705;
  --accent-dark: #DDA600;
  --accent-soft: #FCF0C8;
  --accent-text: #7A5300;
  --link: #1B6B4B;
  --link-dark: #124B34;
  --peach: #F2C94C;
  --on-dark-muted: #C9D6D0;
  --ok: #166534;
  --ok-soft: #DCFCE7;
  --warn: #8A4B00;
  --warn-soft: #FEF3C7;
  --bad: #B42318;
  --bad-soft: #FEE4E2;
  --info: #1F4E79;
  --info-soft: #DCEBF7;
  --blue: #1F6FB2;
  --chip: #E6ECE8;
  --r: 14px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; }
img { max-width: 100%; display: block; }
a { color: var(--link); }
a:hover { color: var(--link-dark); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.4px; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(28px, 6vw, 44px); font-weight: 800; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 24px; }
.hide { display: none !important; }

/* header */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); box-shadow: inset 0 -3px 0 rgba(22,48,42,.18); display: flex; align-items: center; justify-content: center; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.8px; text-transform: lowercase; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a.link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 12px 10px; border-radius: 10px; }
.nav a.link:hover { background: var(--ground); }
.icon-btn { width: 44px; height: 44px; border: none; background: transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; position: relative; color: var(--ink); }
.icon-btn:hover { background: var(--ground); }
.dot { position: absolute; top: 7px; right: 7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--ink); font-family: var(--display); font-weight: 800; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; object-fit: cover; }
.avatar.lg { width: 84px; height: 84px; font-size: 26px; }
.avatar.md { width: 56px; height: 56px; font-size: 19px; }

/* buttons */
.btn { min-height: 48px; padding: 0 18px; border-radius: 12px; border: none; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background .15s; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-dark); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-ok, .btn-ok:hover { background: var(--ok); color: #fff; }
.btn-danger-solid:hover { color: #fff; }
.btn-outline { background: var(--card); color: var(--ink); border: 1px solid var(--line-2); }
.btn-outline:hover { background: var(--ground); color: var(--ink); }
.btn-outline-strong { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-danger { background: var(--card); color: var(--bad); border: 1px solid #FCA5A5; }
.btn-danger-solid { background: var(--bad); color: #fff; }
.btn-ghost { background: transparent; color: var(--link); font-weight: 600; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-lg { min-height: 54px; font-size: 17px; }

/* forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; font-size: 16px; color: var(--ink); background: #fff; }
textarea.input { padding: 12px; min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(18,35,61,.12); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-soft); line-height: 1.45; }
.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--ink); }
.hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.form-error { background: var(--bad-soft); color: #991B1B; border-radius: 10px; padding: 10px 12px; font-size: 15px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 15px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; background: var(--chip); color: var(--ink); padding: 4px 10px; border-radius: 999px; }
.badge { display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: #991B1B; }
.b-info { background: var(--info-soft); color: var(--info); }
.b-neutral { background: var(--chip); color: var(--ink); }
.b-accent { background: var(--accent-soft); color: var(--accent-text); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card-link { text-decoration: none; color: var(--ink); display: block; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--line-2); color: var(--ink); }
.empty { background: var(--card); border: 1px dashed var(--line-2); border-radius: 16px; padding: 24px; text-align: center; color: var(--muted); }
.notice { border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.notice.ok { background: var(--ok-soft); color: #14532D; }
.notice.warn { background: var(--warn-soft); color: #78350F; }
.notice.bad { background: var(--bad-soft); color: #7F1D1D; }
.notice.info { background: var(--info-soft); color: #312E81; }

/* hero */
.hero { background: var(--ink); color: #fff; padding: 36px 0 32px; }
.hero-grid { display: grid; gap: 24px; align-items: center; }
.pill { align-self: flex-start; font-size: 13px; font-weight: 600; background: var(--ink-2); color: var(--peach); padding: 6px 12px; border-radius: 999px; display: inline-block; }
.search-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* sections */
.section { padding-top: 28px; padding-bottom: 8px; }
.tp-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.promise { display: flex; gap: 14px; align-items: flex-start; }
.promise-icon { color: var(--accent-text); width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* teacher cards */
.teacher-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tcard { display: flex; flex-direction: column; gap: 12px; }
.tcard-top { display: flex; gap: 12px; align-items: center; }
.price { font-family: var(--display); font-weight: 800; font-size: 21px; }
.stars { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.verified { color: var(--blue); }

/* filter bar */
.filterbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 0; }
.filterbar .row { gap: 8px; }
.filterbar select { min-height: 44px; flex: 1 1 140px; }

/* gallery */
.gallery { position: relative; height: 240px; background: var(--chip); overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,.95); display: flex; align-items: center; justify-content: center; }
.gallery .prev { left: 10px; } .gallery .next { right: 10px; }
.gallery .count { position: absolute; right: 12px; bottom: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.gallery-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-weight: 600; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--ground); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 19px; }
.stat span { font-size: 12px; color: var(--muted); }
.dark-panel { background: var(--ink); color: #fff; }
.dark-panel .stat { background: var(--ink-2); }
.dark-panel .stat span { color: var(--on-dark-muted); }

/* day strip & slots */
.daystrip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.day { min-width: 60px; height: 66px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex-shrink: 0; }
.day small { font-size: 12px; }
.day strong { font-size: 18px; }
.day[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.day[disabled] { background: #EEF0F3; color: #6B7280; border-color: var(--line); cursor: not-allowed; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { min-height: 46px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 15px; }
.slot[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.slot[disabled] { background: #EEF0F3; color: #6B7280; border-color: var(--line); text-decoration: line-through; cursor: not-allowed; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.option { min-height: 62px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 10px 14px; text-align: left; }
.option[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.option small { font-size: 13px; opacity: .85; }

/* tabs */
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { flex: 1 0 auto; min-height: 52px; padding: 0 16px; border: none; background: #fff; font-weight: 700; font-size: 15px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { min-height: 42px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 15px; }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); }

/* lessons */
.lesson { display: flex; flex-direction: column; gap: 12px; }
.lesson-head { display: flex; gap: 12px; align-items: center; }
.time-box { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px; border-radius: 10px; background: var(--ground); }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.inline-panel { background: var(--ground); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.inline-panel.bad { background: #FEF2F2; }

/* week */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week .day { min-width: 0; height: 62px; }
.week .day .mark { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.week .day .mark.on { background: var(--accent-text); }

/* availability editor */
.av-day { display: flex; flex-direction: column; gap: 10px; }
.switch { width: 52px; height: 32px; border-radius: 999px; border: none; padding: 3px; display: flex; background: var(--line-2); justify-content: flex-start; flex-shrink: 0; }
.switch[aria-checked="true"] { background: var(--ok); justify-content: flex-end; }
.switch span { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: block; }
.range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.range select { min-height: 42px; width: auto; padding: 0 8px; }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--chip); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .del { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,.95); font-size: 18px; line-height: 1; }
.photo-add { aspect-ratio: 1 / 1; border-radius: 10px; border: 2px dashed var(--line-2); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.upload-row { display: flex; align-items: center; gap: 10px; min-height: 56px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; padding: 8px 14px; cursor: pointer; font-weight: 600; }

/* progress */
.progress { height: 4px; background: var(--line); }
.progress > div { height: 4px; background: var(--accent); transition: width .2s; }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.checklist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* notifications panel */
.notif-panel { position: absolute; right: 8px; top: 60px; width: min(380px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(18,35,61,.18); z-index: 40; }
.notif { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 15px; }
.notif.unread { background: #FFFAEB; }
.notif small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px; z-index: 100; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
#toast.err { background: var(--bad); }

/* stars input */
.star-btn { width: 44px; height: 44px; border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; }

/* footer */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 24px 0; margin-top: 40px; color: var(--muted); font-size: 14px; }

/* tables */
.table-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 680px; }
table.data th { text-align: left; padding: 12px 14px; background: #F8F9FB; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.data td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }

.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 720px) {
  .hero { padding: 64px 0 56px; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; }
  .subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .teacher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery { height: 340px; border-radius: 16px; margin-top: 16px; }
  .two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; }
  .tp-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); grid-template-areas: "a b" "c b"; align-items: start; column-gap: 24px; }
  .tp-a { grid-area: a; } .tp-b { grid-area: b; position: sticky; top: 80px; } .tp-c { grid-area: c; }
  .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .teacher-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .nav .hide-sm { display: none; }
}

/* hours grid */
.hgrid-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; overflow-x: auto; }
.hgrid { display: grid; grid-template-columns: 34px repeat(7, minmax(38px, 1fr)); gap: 4px; min-width: 320px; }
.hg-day { min-height: 36px; border: none; background: transparent; font-weight: 700; font-size: 13px; color: var(--ink); border-radius: 8px; }
.hg-day:hover { background: var(--ground); }
.hg-h { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; font-variant-numeric: tabular-nums; }
.hg-cell { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--ground); display: flex; align-items: center; justify-content: center; color: #fff; padding: 0; }
.hg-cell:hover { border-color: var(--line-2); }
.hg-cell.open { background: var(--ok); border-color: var(--ok); }
.hg-cell.open svg { width: 16px; height: 16px; }
.hg-cell.busy { background: repeating-linear-gradient(135deg, var(--chip) 0 6px, var(--line) 6px 12px); border-color: var(--line-2); color: var(--ink-soft); font-size: 10px; font-weight: 700; overflow: hidden; }
.hg-cell.busy span { padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-key { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.hg-key.open { background: var(--ok); }
.hg-key.busy { background: repeating-linear-gradient(135deg, var(--chip) 0 4px, var(--line-2) 4px 8px); }
.busy-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 12px; }
details.card > summary { list-style-position: inside; }

/* attendance */
.att-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.att-btn { min-height: 48px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 14px; color: var(--ink); transition: transform .12s, background .15s; }
.att-btn[aria-pressed="true"].att-present { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-btn[aria-pressed="true"].att-late { background: #B45309; border-color: #B45309; color: #fff; }
.att-btn[aria-pressed="true"].att-absent, .att-btn[aria-pressed="true"].att-excluded { background: var(--bad); border-color: var(--bad); color: #fff; }
.report-box { background: var(--ground); border-radius: 10px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); }
table.data.compact { min-width: 560px; }
.card-stat { background: var(--card); border: 1px solid var(--line); }
.hw-row { border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; display: flex; flex-direction: column; gap: 2px; }

/* otp */
.otp { display: flex; gap: 8px; justify-content: center; }
.otp input { width: 46px; height: 56px; border: 1px solid var(--line-2); border-radius: 12px; text-align: center; font: 700 24px var(--display); color: var(--ink); background: #fff; }
.otp input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(22,48,42,.15); }
.otp.shake { animation: shake .35s; }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes shimmer { from { background-position: -200px 0; } to { background-position: 200px 0; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.page-in > * { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.page-in > *:nth-child(2) { animation-delay: .05s; } .page-in > *:nth-child(3) { animation-delay: .1s; } .page-in > *:nth-child(4) { animation-delay: .15s; } .page-in > *:nth-child(5) { animation-delay: .2s; }
.teacher-grid > *, .subject-grid > *, .promises > *, #pane > .card, #pane > article { animation: rise .4s cubic-bezier(.2,.7,.2,1) both; }
.teacher-grid > *:nth-child(2), .subject-grid > *:nth-child(2), .promises > *:nth-child(2) { animation-delay: .06s; }
.teacher-grid > *:nth-child(3), .subject-grid > *:nth-child(3), .promises > *:nth-child(3) { animation-delay: .12s; }
.teacher-grid > *:nth-child(n+4), .subject-grid > *:nth-child(n+4), .promises > *:nth-child(4) { animation-delay: .18s; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(22,48,42,.08); }
.btn, .chip, .slot, .day, .option, .hg-cell, .att-btn, .star-btn { transition: transform .12s, background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:active, .chip:active, .slot:active, .day:active, .option:active, .hg-cell:active, .att-btn:active, .star-btn:active { transform: scale(.96); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(242,183,5,.35); }
.slot[aria-pressed="true"], .day[aria-pressed="true"], .hg-cell.open, .att-btn[aria-pressed="true"] { animation: pop .22s ease-out; }
.success-pop { animation: pop .45s cubic-bezier(.2,.9,.3,1.3) both; }
.inline-panel { animation: rise .25s ease-out both; }
#toast { animation: toastIn .25s ease-out; }
.hero h1 { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.hero .search-card { animation: rise .6s .12s cubic-bezier(.2,.7,.2,1) both; }
.hero .pill { animation: floaty 4s ease-in-out infinite; }
.brand:hover .brand-mark { transform: rotate(-8deg); }
.brand-mark { transition: transform .2s; }
.loading .spinner + * { opacity: .8; }
.skeleton { background: linear-gradient(90deg, var(--chip) 0, var(--line) 60px, var(--chip) 120px); background-size: 400px 100%; animation: shimmer 1.2s linear infinite; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.fav-btn { align-self: flex-start; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.fav-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.next-card { background: var(--ink); color: #fff; border-radius: 16px; padding: 16px; display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }

/* =========================================================
   KRAYTI — style « simple et pro »
   blanc, une seule couleur forte (bleu), grandes photos, espace
   ========================================================= */
:root {
  --ink: #111827;
  --ink-2: #1F2937;
  --ink-soft: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-2: #D1D5DB;
  --ground: #F7F8FA;
  --card: #FFFFFF;
  --accent: #2554E8;
  --accent-dark: #1B42C2;
  --accent-soft: #EAF0FF;
  --accent-text: #1B42C2;
  --link: #2554E8;
  --link-dark: #1B42C2;
  --peach: #9DB5FF;
  --on-dark-muted: #CBD5E1;
  --chip: #F1F3F6;
  --display: 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(17,24,39,.06), 0 8px 24px rgba(17,24,39,.06);
}
body { background: var(--ground); }
h1, h2, h3 { letter-spacing: -0.6px; }
h1 { font-weight: 700; }
.topbar { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.brand-mark { background: var(--accent); border-radius: 10px; box-shadow: none; }
.brand-mark svg path, .brand-mark svg circle { stroke: #fff; }
.brand-mark svg circle { fill: #fff; }
.brand-name { font-weight: 700; font-size: 23px; letter-spacing: -0.6px; text-transform: none; }
.card { border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(17,24,39,.06), 0 16px 32px rgba(17,24,39,.10); }
.btn { border-radius: 12px; font-weight: 700; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; box-shadow: 0 6px 16px rgba(37,84,232,.28); }
.btn-dark { background: var(--ink); color: #fff; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,84,232,.15); }
.chip[aria-pressed="true"], .slot[aria-pressed="true"], .day[aria-pressed="true"], .option[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); }
.hg-cell.open { background: var(--accent); border-color: var(--accent); }
.hg-key.open { background: var(--accent); }
.dot { background: #E5484D; color: #fff; }
.b-accent { background: var(--accent-soft); color: var(--accent-text); }
.avatar { background: var(--accent-soft); color: var(--accent-dark); }
.promise-icon { background: var(--accent-soft); color: var(--accent); }
.progress > div { background: var(--accent); }
.spinner { border-top-color: var(--accent); }
.notif.unread { background: var(--accent-soft); }
.week .day .mark.on { background: var(--accent); }

/* hero: clair, aéré */
.hero { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); padding: 44px 0 40px; }
.hero h1 { font-size: clamp(36px, 7vw, 60px); line-height: 1.04; letter-spacing: -1.6px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted) !important; font-size: 18px; max-width: 34ch; }
.pill { background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; font-weight: 700; }
.search-card { border: 1px solid var(--line); box-shadow: 0 2px 4px rgba(17,24,39,.04), 0 24px 48px rgba(17,24,39,.10); border-radius: 20px; padding: 20px; }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 6px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 20px; }
.hero-stats span { font-size: 13px; color: var(--muted); }

/* panneaux foncés → bleu profond */
.dark-panel { background: #0E1B3D; color: #fff; }
.dark-panel .stat { background: rgba(255,255,255,.08); }
.next-card { background: #0E1B3D; }
.footer { background: #fff; }

/* cartes profs avec grande photo */
.tcard { padding: 0; overflow: hidden; gap: 0; }
.tcard-photo { position: relative; aspect-ratio: 4 / 3; max-width: 100%; background: linear-gradient(135deg, #EAF0FF, #F5F7FF); display: flex; align-items: center; justify-content: center; }
.tcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.tcard-photo .initials { font-size: 54px; font-weight: 700; color: var(--accent); letter-spacing: -1px; }
.tcard-photo .price-tag { position: absolute; left: 12px; bottom: 12px; background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; padding: 6px 10px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.tcard-photo .promo { position: absolute; right: 12px; top: 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; }
.tcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.tcard-body .name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.tcard-body .meta { font-size: 14px; color: var(--muted); }
@media (max-width: 719px) { .tcard-photo { aspect-ratio: 16 / 9; } .tcard-photo .initials { font-size: 44px; } .hero-stats { gap: 14px 20px; } .hero-stats strong { font-size: 16px; } }

/* ===== Messages ===== */
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.conv { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.conv:last-child { border-bottom: none; }
.conv:hover { background: var(--ground); }
.conv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-page { display: flex; flex-direction: column; height: calc(100dvh - 65px - var(--chat-offset, 0px)); padding-top: 12px; padding-bottom: 12px; gap: 10px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-rule { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--ground); border-radius: 12px; padding: 8px 12px; }
.chat-rule svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.chat-day { align-self: center; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 18px; line-height: 1.4; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 2px; animation: pop .18s ease-out; }
.bubble small { font-size: 11px; opacity: .7; align-self: flex-end; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-width: 0; resize: none; min-height: 48px; max-height: 140px; line-height: 1.4; padding-top: 12px; }
.chat-form .btn { width: 48px; height: 48px; padding: 0; flex-shrink: 0; }
body:has(.chat-page) .footer { display: none; }
.nav a { text-decoration: none; }
.krayti-av { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border-radius: 50%; flex-shrink: 0; }
.krayti-av svg { width: 60%; height: 60%; }
.krayti-av svg * { stroke: #fff; }
.krayti-av svg circle { fill: #fff; }

/* ===== admin dossier & messages ===== */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.doc-tile { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.doc-tile img { width: 100%; max-height: 260px; object-fit: contain; background: var(--ground); border-radius: 10px; }
.doc-tile.empty-doc { border-style: dashed; min-height: 120px; justify-content: center; align-items: center; text-align: center; }
.doc-pdf { display: flex; align-items: center; gap: 8px; padding: 18px; background: var(--ground); border-radius: 10px; font-weight: 600; }
.msg-admin { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-admin .conv[aria-current="true"] { background: var(--accent-soft); }
@media (max-width: 900px) { .msg-admin { grid-template-columns: 1fr; } }

/* ===== teacher-only mode ===== */
.prof-bar { position: fixed; left: 0; right: 0; bottom: var(--bar-offset, 0px); z-index: 55; background: #fff; color: var(--ink); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 20px rgba(0,0,0,.15); }
.prof-bar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prof-bar .ellipsis { max-width: 52vw; }
.prof-bar .avatar { width: 36px; height: 36px; font-size: 14px; }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); }
body.has-prof-bar { padding-bottom: calc(68px + var(--bar-offset, 0px) + env(safe-area-inset-bottom, 0px)); }
body.has-prof-bar .chat-page { height: calc(100dvh - 65px - 64px - var(--chat-offset, 0px)); }
body.prof-mode .footer { display: none; }
body.has-prof-bar #toast { bottom: calc(80px + var(--bar-offset, 0px)); }
.topbar .wrap { gap: 10px; }
.brand-hello { font-size: 14px; font-weight: 600; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); line-height: 1.2; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 420px) { .brand-hello { font-size: 12px; max-width: 34vw; white-space: normal; } }
@media (max-width: 340px) { .brand-hello { display: none; } }

/* tabs never hidden on phones + clear upload blocks */
@media (max-width: 640px) {
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .tab { padding: 0 6px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.2; }
}
.doc-up { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.doc-up svg { flex-shrink: 0; color: var(--accent); }
label.btn { cursor: pointer; }

/* ===== pre-launch ===== */
.prelaunch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.prelaunch-prof { border: 2px solid var(--accent); }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; }
.perks svg { color: var(--ok); flex-shrink: 0; }
.join-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* ===== account menu & settings ===== */
.me-btn { border: none; background: transparent; padding: 0; border-radius: 50%; cursor: pointer; }
.me-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.me-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.me-head > div { display: flex; flex-direction: column; }
.me-item { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 16px; border: none; background: #fff; text-align: left; font: 600 15px var(--body); color: var(--ink); text-decoration: none; cursor: pointer; }
.me-item:hover { background: var(--ground); }
.me-item.danger { color: var(--bad); border-top: 1px solid var(--line); }
.set-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.set-row:last-of-type { border-bottom: none; }
.space-btn { border: none; background: transparent; font: 600 15px var(--body); color: var(--ink); cursor: pointer; padding: 8px 10px; border-radius: 10px; min-height: 44px; }
.space-btn:hover { background: var(--ground); }

/* ===== pre-launch v2 ===== */
.pl-hero { background: radial-gradient(1200px 500px at 85% -10%, #4C74FF 0%, transparent 60%), linear-gradient(160deg, #2554E8 0%, #173AB8 100%); color: #fff; }
.pl-in { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding-top: clamp(48px, 9vw, 96px); padding-bottom: clamp(48px, 9vw, 96px); }
.pl-kicker { font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 6px 12px; border-radius: 999px; }
.pl-title { font-size: clamp(32px, 6vw, 56px); line-height: 1.05; letter-spacing: -1px; max-width: 760px; color: #fff; }
.pl-sub { font-size: clamp(16px, 2.2vw, 19px); color: rgba(255,255,255,.82); max-width: 560px; }
.pl-count { display: flex; gap: 10px; margin-top: 6px; }
.pl-box { min-width: 72px; padding: 12px 8px 10px; border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pl-box strong { font-size: clamp(26px, 5vw, 38px); font-variant-numeric: tabular-nums; line-height: 1; }
.pl-box span { font-size: 12px; color: rgba(255,255,255,.75); }
.pl-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; width: 100%; }
.pl-cta .btn { min-width: 200px; }
.pl-btn-main { background: #fff; color: #173AB8; }
.pl-btn-main:hover { background: #EEF2FF; }
.pl-btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.pl-btn-ghost:hover { background: rgba(255,255,255,.1); }
.pl-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.pl-point { display: flex; gap: 12px; align-items: flex-start; }
.pl-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
@media (max-width: 420px) { .pl-box { min-width: 0; flex: 1; } .pl-count { width: 100%; } .pl-cta .btn { width: 100%; } }
