:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #6b7484;
  --accent: #2f6fed;
  --line: #eef0f5;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
.frame {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(0,0,0,.06);
}

/* ── Header ── */
header {
  background: linear-gradient(135deg, #2f6fed, #4f8bff);
  color: #fff;
  padding: 30px 20px 22px;
}
header h1 { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
header p  { font-size: 13px; opacity: .85; margin-top: 4px; }

/* ── Grille des tuiles ── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 16px;
}
.tile {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(20,30,60,.07);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  text-align: left;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
.tile:active { transform: scale(.97); }
.tile .img { height: 118px; overflow: hidden; position: relative; }
.tile .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .body { padding: 13px 14px 15px; }
.tile .body h2 { font-size: 15px; font-weight: 700; }
.tile .body p {
  font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Détail ── */
.view { display: none; }
.view.on { display: block; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 16px 0; }
.back {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--card); border: none; font-size: 20px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); color: var(--ink);
}
.hero { margin: 14px 16px; border-radius: 20px; height: 180px; overflow: hidden; box-shadow: 0 6px 18px rgba(20,30,60,.10); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-title { padding: 0 18px; }
.hero-title h2 { font-size: 23px; font-weight: 800; }
.hero-title p  { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.sections { padding: 14px 16px 34px; display: grid; gap: 12px; }
.section {
  background: var(--card); border-radius: 16px; padding: 16px 16px 14px;
  box-shadow: 0 3px 12px rgba(20,30,60,.06);
  border-top: 3px solid var(--accent);
}
.section h3 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent);
  margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
}
.sec-ico { font-size: 16px; }
.section ul { list-style: none; }
.section li {
  position: relative; padding: 6px 0 6px 20px; font-size: 13.5px; line-height: 1.45;
  color: var(--ink); border-bottom: 1px dashed var(--line);
}
.section li:last-child { border-bottom: none; }
.section li::before {
  content: ""; position: absolute; left: 4px; top: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* ── Documents (perso) ── */
.section.perso { border-top-color: #94a3b8; }
.section.perso h3 { color: #64748b; }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.doc:last-child { border-bottom: none; }
.doc a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.doc .ico { font-size: 20px; flex-shrink: 0; }
.doc .name { font-weight: 600; font-size: 13px; }
.doc .meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.empty { color: var(--muted); font-size: 13px; padding: 2px 0; }

/* ── Skeleton / chargement ── */
.skeleton { height: 40px; border-radius: 10px; background: linear-gradient(90deg,#eef0f5 25%,#f8fafc 50%,#eef0f5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
