/* Lineo Web — thème repris de AppColors.swift (sombre forcé, comme preferredColorScheme(.dark) dans LineoApp) */

@font-face { font-family: "Syne"; src: url("../fonts/Syne-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Syne"; src: url("../fonts/Syne-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Syne"; src: url("../fonts/Syne-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Syne"; src: url("../fonts/Syne-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Syne"; src: url("../fonts/Syne-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #060A15;
  --surface: #1C1B24;
  --stroke: #292331;
  --text: #F5F1F7;
  --text2: #A59CAB;
  --accent: #922CB6;
  --red: #FF453A;
  --green: #30D158;
  --orange: #FF9F0A;
  --yellow: #FFD60A;
  --bg-gradient: linear-gradient(180deg, #06070F 0%, #16111F 50%, #301E35 100%);
  --bg-gradient-inv: linear-gradient(0deg, #06070F 0%, #16111F 50%, #301E35 100%);
  --btn-gradient: linear-gradient(135deg, #3f32CA 0%, #922CB6 100%);
  --btn-gradient-inv: linear-gradient(135deg, #922CB6 0%, #3f32CA 100%);
  --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --app-width: 520px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Le thème clair existe dans l'app mais n'est pas utilisé (TODO « Beau Light Mode » côté iOS) */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F3F6; --surface: #FFFFFF; --stroke: #E0DDE3; --text: #1A181C; --text2: #77717D; --accent: #8B5CF6;
  --bg-gradient: linear-gradient(180deg, #F5F5F3 0%, #F8F7F9 50%, #F5F3F6 100%);
  --bg-gradient-inv: linear-gradient(0deg, #F5F5F3 0%, #F8F7F9 50%, #F5F3F6 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sys);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.ic { display: inline-block; vertical-align: middle; flex: none; }

/* Colonne de l'app : largeur d'un téléphone, centrée sur grand écran */
#app {
  position: relative;
  height: 100dvh;
  max-width: var(--app-width);
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-gradient);
}
@media (min-width: 560px) {
  body { background: #030409; }
  #app { box-shadow: 0 0 0 0.5px var(--stroke), 0 0 80px rgba(146, 44, 182, 0.12); }
}

/* Écrans empilés (fullScreenCover) et feuilles (sheet) */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg-gradient);
  overflow: hidden;
}
.screen.inv { background: var(--bg-gradient-inv); }
.screen.enter { animation: cover-in 0.32s cubic-bezier(.2,.8,.2,1); }
.screen.leave { animation: cover-out 0.25s ease-in forwards; }
.screen.fade-enter { animation: fade-in 0.4s ease; }
.screen.fade-leave { animation: fade-out 0.4s ease forwards; }
@keyframes cover-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes cover-out { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

/* Typo Syne (Font.syne) */
.syne { font-family: "Syne", var(--sys); }
.w4 { font-weight: 400; } .w5 { font-weight: 500; } .w6 { font-weight: 600; } .w7 { font-weight: 700; } .w8 { font-weight: 800; }
.t1 { color: var(--text); } .t2 { color: var(--text2); } .ta { color: var(--accent); } .tred { color: var(--red); }

/* Bouton fermer (xmark dans un rond) */
.close-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text2);
  box-shadow: inset 0 0 0 0.5px var(--stroke);
}
.round-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text);
  box-shadow: inset 0 0 0 0.5px var(--stroke);
}

/* Champs (padding 16, rayon 14, contour 0.5 → 1.5 accent au focus) */
.field {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; min-height: 54px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: inset 0 0 0 0.5px var(--stroke);
  transition: box-shadow .15s;
}
.field:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.field.error { box-shadow: inset 0 0 0 1.5px var(--red); }
.field input, .field textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 17px; padding: 16px 0; color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(165, 156, 171, 0.6); }
.field .clear, .field .eye { color: var(--text2); display: inline-flex; }
.field-msg { font-size: 12px; color: var(--red); padding: 0 4px; line-height: 1.35; }

/* Boutons pleins (rayon 14, padding vertical 16) */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; border-radius: 14px;
  font-size: 16px; font-weight: 600; color: #fff;
  background: var(--btn-gradient);
  transition: opacity .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled, .btn.off { background: rgba(165, 156, 171, 0.3); }
.btn.light { background: var(--text); color: rgba(28, 27, 36, 0.6); border-radius: 16px; }
.btn.surface { background: var(--surface); color: var(--text); font-weight: 500; border-radius: 16px; box-shadow: inset 0 0 0 0.5px var(--stroke); }
.link-btn { color: var(--accent); font-size: 14px; }

/* GlassCard.swift : surface 55 % + reflet + contour dégradé */
.glass {
  position: relative;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02) 50%, transparent),
    rgba(28, 27, 36, 0.55);
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 0.8px;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(41, 35, 49, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* Indicateur de chargement (ProgressView) */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.spinner.dim { border-color: rgba(165,156,171,0.25); border-top-color: var(--text2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Alerte (style .alert iOS) */
.alert-backdrop {
  position: absolute; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45); animation: fade-in .2s;
}
.alert {
  width: 270px; border-radius: 14px; overflow: hidden; text-align: center;
  background: rgba(37, 36, 46, 0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: alert-in .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes alert-in { from { transform: scale(1.15); opacity: 0; } }
.alert-body { padding: 20px 16px 16px; }
.alert-title { font-size: 17px; font-weight: 600; }
.alert-msg { font-size: 13px; margin-top: 4px; line-height: 1.4; white-space: pre-line; }
.alert-actions { display: flex; border-top: 0.5px solid rgba(255,255,255,0.15); }
.alert-actions.vertical { flex-direction: column; }
.alert-actions button { flex: 1; padding: 11px 8px; font-size: 17px; color: #0A84FF; }
.alert-actions button + button { border-left: 0.5px solid rgba(255,255,255,0.15); }
.alert-actions.vertical button + button { border-left: 0; border-top: 0.5px solid rgba(255,255,255,0.15); }
.alert-actions button.bold { font-weight: 600; }
.alert-actions button.destructive { color: var(--red); }

/* Feuille (sheet) */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); animation: fade-in .25s; z-index: 50; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: 10px; z-index: 51;
  display: flex; flex-direction: column;
  border-radius: 12px 12px 0 0; overflow: hidden;
  background: var(--bg-gradient);
  animation: cover-in .35s cubic-bezier(.2,.8,.2,1);
}
.sheet.leave { animation: cover-out .25s ease-in forwards; }
.sheet-backdrop.leave { animation: fade-out .25s forwards; }

/* Toast */
.toast {
  position: absolute; left: 50%; top: calc(16px + var(--safe-top)); z-index: 1100;
  transform: translateX(-50%);
  padding: 10px 16px; border-radius: 20px; font-size: 14px; font-weight: 500;
  background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--stroke), 0 8px 30px rgba(0,0,0,.4);
  animation: toast-in .3s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } }

.hidden { display: none !important; }

/* SplashView : ligne dégradée 2×220 qui se déroule, 3 points (16 px, espacés de 48) qui apparaissent en ressort */
.splash { align-items: center; justify-content: center; z-index: 20; }
.splash-mark { position: relative; width: 16px; height: 220px; }
.splash-line {
  position: absolute; left: 7px; top: 0; width: 2px; height: 220px;
  background: linear-gradient(180deg, #3f32CA, #922CB6);
  transform-origin: top; transform: scaleY(0);
}
.splash-dots { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 48px; }
.splash-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--text), 0 0 12px rgba(59, 130, 246, 0.6);
  opacity: 0; transform: scale(0.2);
}
.splash-title { margin-top: 50px; font-size: 36px; opacity: 0; transform: translateY(12px); }
.splash-msg { margin-top: 50px; font-size: 15px; min-height: 20px; text-align: center; padding: 0 24px; }
.splash.run .splash-line { animation: splash-line 1.1s ease-in-out forwards; }
.splash.run .splash-dot { animation: splash-dot 0.45s cubic-bezier(.3,1.6,.5,1) forwards; }
.splash.run .splash-dot:nth-child(2) { animation-delay: .25s; }
.splash.run .splash-dot:nth-child(3) { animation-delay: .5s; }
.splash.run .splash-title { animation: splash-title .5s ease-out 1.3s forwards; }
@keyframes splash-line { to { transform: scaleY(1); } }
@keyframes splash-dot { to { opacity: 1; transform: scale(1); } }
@keyframes splash-title { to { opacity: 1; transform: none; } }

/* LandingView */
.landing { align-items: center; padding: 0 24px calc(50px + var(--safe-bottom)); }
.landing-logo {
  width: 90px; height: 90px; border-radius: 20px; object-fit: cover;
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.35);
}
.landing-name { font-size: 40px; margin-top: 30px; }
.landing-slogan { font-size: 17px; margin-top: 5px; }
.landing-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; }

/* Écrans de connexion (SignIn, SignUp, ForgotPassword…) */
.auth-body { flex: 1; display: flex; flex-direction: column; padding: 0 24px calc(16px + var(--safe-bottom)); overflow-y: auto; }
.auth-body > .grow { flex: 1; min-height: 24px; }
.auth-title { font-size: 28px; line-height: 1.15; }
.auth-sub { font-size: 15px; margin-top: 8px; line-height: 1.35; }
.auth-fields { display: flex; flex-direction: column; gap: 12px; }
.code-input {
  width: 100%; border: 0; outline: 0; background: transparent; text-align: center;
  font: 700 28px var(--mono); letter-spacing: 8px; color: var(--text); padding: 16px 0;
}

/* ContentView + CustomTabBar */
.content { background: var(--bg-gradient); }
.tab-host { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tab-host > * { flex: 1; min-height: 0; }
.tabbar {
  position: relative; z-index: 10;
  display: flex; align-items: flex-start;
  padding: 12px 8px calc(8px + var(--safe-bottom));
  background: var(--surface);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08), 0 -4px 12px rgba(0,0,0,0.08);
  transition: transform .25s ease, opacity .25s ease;
}
.tabbar.gone { transform: translateY(100%); opacity: 0; position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }
.tabbar > button[data-tab] {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text2); font-size: 10px; font-weight: 500;
}
.tabbar > button.on { color: var(--accent); }
.tabbar > button.on .ic[fill="none"] { fill: currentColor; fill-opacity: .25; }
.tab-add {
  margin: -16px 8px 0; padding: 15px; border-radius: 50px;
  background: var(--btn-gradient); color: rgba(255,255,255,0.9);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  display: inline-flex;
}
.tab-add .ic { stroke-width: 2.6; }
.acc-ic { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.acc-ic img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; opacity: .5; }
.tabbar > button.on .acc-ic img { opacity: 1; }
.filled-person { fill: currentColor; }
/* Écrans connectés */

/* ---------- HomeView ---------- */
.home-head { display: flex; align-items: center; gap: 8px; padding: calc(15px + var(--safe-top)) 20px 10px; }
.home-head > div { flex: 1; }
.home-stats {
  width: 44px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--stroke); color: var(--text2);
}
.home-label { font-size: 13px; font-weight: 600; color: var(--text2); }

.hero-pager {
  display: flex; height: 300px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: 20px;
}
.hero-pager::-webkit-scrollbar { display: none; }
.hero-card { flex: 0 0 100%; scroll-snap-align: start; overflow: hidden; display: flex; flex-direction: column; }
.hero-btn {
  padding: 10px 14px; border-radius: 12px; background: var(--btn-gradient);
  color: #fff; font-size: 15px; font-weight: 600;
}
.hero-illu { margin-top: 15px; height: 100px; position: relative; }
.hero-projector {
  position: absolute; right: 15px; bottom: 110px; width: 135px; height: 135px;
  transform: rotate(2deg); opacity: .075; pointer-events: none;
}
.hero-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.hero-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--stroke); transition: background .2s; cursor: pointer; }
.hero-dots span.on { background: var(--accent); }

.tl-curve { display: block; overflow: visible; }
.tl-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tl-draw 1s ease-in-out forwards; }
.tl-reveal { transform-box: fill-box; transform-origin: left; transform: scaleX(0); animation: tl-reveal 1s ease-in-out forwards; }
@keyframes tl-draw { to { stroke-dashoffset: 0; } }
@keyframes tl-reveal { to { transform: scaleX(1); } }
.tl-dot-h {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--text); opacity: 0; transform: scale(.3);
  animation: tl-pop .3s cubic-bezier(.3,1.6,.5,1) forwards;
  transition: background 2.2s ease-in-out;
}
.tl-dot-h.purple { background: #922CB6; }
@keyframes tl-pop { to { opacity: 1; transform: none; } }

.film-strip { height: 100px; overflow: hidden; }
.film-track { display: flex; gap: 8px; width: max-content; animation: film-roll 16s linear infinite; }
@keyframes film-roll { to { transform: translateX(calc(-6 * (110px + 8px))); } }
.film-frame {
  position: relative; width: 110px; height: 75px; border-radius: 2px;
  background: color-mix(in srgb, var(--c) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 24%, transparent);
  display: flex; flex-direction: column; justify-content: space-between;
}
.sprockets { height: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.sprockets i {
  width: 8px; height: 5px; border-radius: 1px; background: rgba(28,27,36,.55);
  box-shadow: inset 0 0 0 .6px color-mix(in srgb, var(--c) 25%, transparent);
}

.card-surface {
  background: var(--surface); border-radius: 20px; overflow: hidden;
  box-shadow: inset 0 0 0 0.5px var(--stroke);
}
.appear { animation: appear .4s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px;
  background: var(--surface); box-shadow: inset 0 0 0 .3px var(--accent);
  font-size: 12px; color: var(--text2);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.btn-invert {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 14px; background: var(--text); color: var(--surface);
  font-size: 15px; font-weight: 600;
}

.bc-illu { position: relative; height: 148px; overflow: hidden; }
.bc-axis { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1.5px dashed rgba(245,241,247,.1); }
.bc-branch { position: absolute; height: 1px; background: rgba(245,241,247,.1); }
.bc-dot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--text);
  opacity: 0; transform: scale(.2); animation: bc-dot .5s cubic-bezier(.3,1.5,.5,1) .3s forwards;
}
@keyframes bc-dot { to { opacity: var(--o); transform: none; } }
.bc-pulse {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(59,130,246,.12); animation: bc-pulse 1.6s ease-in-out infinite alternate;
}
@keyframes bc-pulse { from { transform: scale(.9); } to { transform: scale(1.15); } }
.bc-star {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: #3B82F6; color: #fff; display: flex; align-items: center; justify-content: center;
}

.sc-illu {
  position: relative; height: 130px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(146,44,182,.15), rgba(255,255,255,.08));
}
.sc-illu > span:not([class]) { position: absolute; line-height: 1; }
.sc-glow1, .sc-glow2 { position: absolute; border-radius: 50%; transform: translate(-10px, 5px); }
.sc-glow1 { width: 160px; height: 160px; background: rgba(63,50,202,.12); filter: blur(25px); }
.sc-glow2 { width: 90px; height: 90px; background: rgba(255,255,255,.18); filter: blur(15px); }

.stat-mini { flex: 1; min-width: 0; min-height: 108px; padding: 20px; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 20px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.recent-chip { width: 100px; flex: none; text-align: left; }
.rc-thumb {
  width: 100px; height: 70px; border-radius: 10px; background: var(--surface); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- TimelineView ---------- */
.tl-filters-wrap { padding: calc(20px + var(--safe-top)) 0 10px; }
.tl-filters { display: flex; gap: 8px; overflow-x: auto; padding: 11px 18px 4px; scrollbar-width: none; }
.tl-filters::-webkit-scrollbar { display: none; }
.tl-chip {
  position: relative; flex: none; min-width: 70px; padding: 7px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border-radius: 10px; background: rgba(28,27,36,.5); box-shadow: inset 0 0 0 .5px rgba(41,35,49,.4);
}
.tl-chip .lbl { font-size: 11px; font-weight: 500; color: var(--text2); white-space: nowrap; }
.tl-chip.on { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tl-chip.on .lbl { color: var(--text); }
.tl-chip.cat.on { background: var(--cc12); box-shadow: inset 0 0 0 1.2px var(--cc60); }
.tl-chip.cat.on .lbl { color: var(--cc); }
.tl-count {
  position: absolute; top: -6px; right: -6px; min-width: 14px; height: 14px; padding: 0 4px; border-radius: 7px;
  font-size: 9px; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center;
}
.tl-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tl-stage > :first-child { flex: 1; min-height: 0; }
.tl-tools { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; pointer-events: none; z-index: 3; }
.tl-tools > * { pointer-events: auto; }
.tl-mode {
  margin-left: 10px; width: 40px; height: 57.5px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--text2);
}
.tl-mode .ic { box-sizing: content-box; padding: 11px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 .5px var(--stroke); }
.age-jump {
  margin: 12px 20px 10px 0; padding: 7px 12px; border-radius: 10px; background: var(--bg);
  font-size: 12px; font-weight: 500; color: var(--text2);
  border: .8px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, linear-gradient(90deg, #1A6CF6, #6E3BFF) border-box;
}

.tl-content { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.tl-scroll { position: relative; }
.tl-ptr { height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--text2); transition: height .2s; }
.tl-ptr.ready .ic { transform: rotate(180deg); color: var(--accent); }
.tl-inner { position: relative; padding-top: 10px; }
.tl-axis { position: absolute; left: 30px; top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, #3f32CA, #922CB6); opacity: .8; }
.tl-content.traveling .tl-scroll { filter: blur(9px); }
.tl-scroll { transition: filter .3s ease; }
.tl-year-head {
  position: sticky; top: 0; z-index: 2;
  margin-left: 40px; padding: 12px 20px; background: var(--bg);
  font-size: 25px; font-weight: 700; color: var(--text);
}
.tl-row { margin-top: 11px; }
.tl-row { position: relative; display: flex; align-items: flex-start; gap: 16px; min-height: 80px; transition: transform .3s ease-out, opacity .3s ease-out; }
.tl-row.dim { transform: scale(.9); opacity: .15; }
.tl-row::before {
  content: ""; position: absolute; left: 52px; right: 20px; top: 0; bottom: 22px; border-radius: 16px;
  background: var(--btn-gradient); filter: blur(16px); opacity: 0; transition: opacity .3s ease-out; pointer-events: none;
}
.tl-row.highlight::before { opacity: .45; }
.tl-dot-col { width: 20px; margin-left: 21px; display: flex; justify-content: center; flex: none; }
.tl-event-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--text); }
.tl-birth-dot {
  width: 20px; height: 20px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px #fff;
}
.ec { position: relative; flex: 1; min-width: 0; margin: 0 22px 12px 10px; padding-bottom: 10px; cursor: pointer; z-index: 1; }
.ec-film {
  position: relative; display: flex; height: 190px; border-radius: 16px; overflow: visible;
  background: var(--bg-gradient-inv);
}
.ec-film::after { content: ""; position: absolute; inset: 0; border-radius: 16px; box-shadow: inset 0 0 0 .5px var(--stroke); pointer-events: none; }
.ec-film.pressed { transform: scale(.98); transition: transform .2s; }
.sprocket-col {
  width: 20px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
}
.ec-film > .sprocket-col:first-child { border-radius: 16px 0 0 16px; }
.ec-film > .sprocket-col:nth-child(3) { border-radius: 0 16px 16px 0; }
.sprocket-col i {
  width: 6px; height: 8px; border-radius: 2px; background: rgba(0,0,0,.85);
  box-shadow: inset 0 0 0 .4px rgba(255,255,255,.6);
}
.ec-visual { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.ec-visual > img, .ec-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ec-fill { display: flex; align-items: center; justify-content: center; }
.ec-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, transparent 66%, rgba(0,0,0,.35) 100%); }
.ec-shade.strong { background: linear-gradient(180deg, transparent 0%, transparent 33%, rgba(0,0,0,.5) 66%, #000 100%); }
.ec-top { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 6px; align-items: center; }
.ec-capsule {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
  padding: 5px 8px; border-radius: 99px; background: rgba(0,0,0,.5); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.15);
  color: #fff; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ec-bottom { position: absolute; left: 8px; right: 16px; bottom: 8px; }
.ec-title { color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-desc {
  color: rgba(255,255,255,.85); font-size: 12px; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ec-emoji {
  position: absolute; top: -10px; right: -5px; width: 32px; height: 30px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: var(--surface); border: 1.5px solid; box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.ec-meta { display: flex; justify-content: space-between; gap: 8px; padding: 8px 5px 0; font-size: 11px; font-style: italic; color: rgba(165,156,171,.6); }
.tl-gap { display: flex; align-items: center; gap: 5px; padding: 10px 20px 10px 35px; }
.tl-gap-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(165,156,171,.35); margin-left: 28px; flex: none; }
.tl-gap-txt { font-size: 11px; font-style: italic; color: rgba(165,156,171,.35); white-space: nowrap; }
.tl-gap-line { flex: 1; height: .5px; background: rgba(165,156,171,.25); margin-top: 2px; }

.tt-overlay { position: absolute; inset: 0; z-index: 5; background: rgba(6,10,21,.6); animation: fade-in .3s; display: flex; align-items: center; justify-content: center; }
.tt-overlay.out { animation: fade-out .4s forwards; }
.tt-stars i { position: absolute; border-radius: 50%; background: #fff; animation: twinkle 1s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .2; transform: scale(.6); } to { opacity: 1; transform: scale(1.2); } }
.tt-label { font-size: 14px; font-weight: 500; color: var(--text2); margin-bottom: 100px; position: relative; }

.sheet.half { top: 45%; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: rgba(165,156,171,.4); margin: 6px auto 0; flex: none; }
.divider { height: .5px; background: rgba(84,84,88,.6); flex: none; }
.age-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 24px; animation: age-in .4s cubic-bezier(.2,.9,.3,1.1) backwards; }
@keyframes age-in { from { opacity: 0; transform: translateY(10px); } }
.age-bubble { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.age-bubble img { width: 100%; height: 100%; object-fit: cover; }

.empty-mem { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.em-stage { position: relative; height: 280px; width: 280px; display: flex; align-items: center; justify-content: center; }
.em-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(26,108,246,.3); animation: ring 1.8s ease-in-out infinite; }
.em-ring.r1 { width: 180px; height: 180px; }
.em-ring.r2 { width: 260px; height: 260px; border-color: rgba(26,108,246,.2); animation-delay: .6s; opacity: .2; }
@keyframes ring { from { transform: scale(1); opacity: .3; } to { transform: scale(1.25); opacity: 0; } }
.em-dot { position: absolute; border-radius: 50%; background: #922CB6; animation: em-dot 1.2s ease-in-out infinite alternate; }
@keyframes em-dot { from { opacity: 0; } to { opacity: .6; } }
.em-add {
  position: relative; width: 72px; height: 72px; border-radius: 50%; background: var(--btn-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(26,108,246,.4);
  animation: em-pulse 1.4s ease-in-out infinite alternate;
}
@keyframes em-pulse { to { transform: scale(1.1); } }

/* Menu contextuel */
.ctx-backdrop { position: absolute; inset: 0; z-index: 900; background: rgba(0,0,0,.25); animation: fade-in .15s; }
.ctx-menu {
  position: absolute; width: 230px; border-radius: 13px; overflow: hidden;
  background: rgba(37,36,46,.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: alert-in .18s ease-out;
}
.ctx-menu button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 16px; color: var(--text); }
.ctx-menu button + button { border-top: .5px solid rgba(255,255,255,.12); }
.ctx-menu button.destructive { color: var(--red); }

/* ---------- EventDetailView ---------- */
.nav-bar {
  display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 16px 10px;
  background: var(--bg); flex: none;
}
.nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-more {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface); color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 .5px var(--stroke);
}
.nav-bar .close-btn { width: 28px; height: 28px; margin-right: 8px; }
.carousel { position: relative; height: 280px; }
.car-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: zoom-in; }
.car-track::-webkit-scrollbar { display: none; }
.car-track img { flex: 0 0 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.car-count {
  position: absolute; right: 12px; bottom: 12px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: rgba(40,40,46,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.detail-placeholder { height: 220px; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--text2); }
.detail-content { padding: 20px 20px 0; }
.cat-badge { display: inline-flex; gap: 4px; padding: 5px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-label { font-size: 11px; font-weight: 600; color: var(--text2); margin-top: 10px; }
.detail-thumb { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; flex: none; cursor: zoom-in; }
.detail .hscroll { padding: 2px 0; }
.music-card, .link-card { background: var(--surface); border-radius: 10px; overflow: hidden; }
.music-card { display: flex; align-items: center; gap: 12px; padding: 12px; box-shadow: inset 0 0 0 .5px var(--stroke); }
.mc-art { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--surface); flex: none; }
.mc-art img { width: 100%; height: 100%; object-fit: cover; }
.mc-play { display: inline-flex; }
.link-card { box-shadow: inset 0 0 0 2px var(--stroke); }
.lc-img img { display: block; width: 100%; height: 140px; object-fit: cover; }
.lc-row { display: flex; align-items: center; gap: 8px; padding: 12px; }
.detail-map-wrap { position: relative; }
.detail-map { height: 180px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 .5px var(--stroke); background: #1b1b1f; }
.map-open {
  position: absolute; right: 10px; bottom: 10px; z-index: 500; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 .5px var(--stroke);
}
.map-pin { display: flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: #FF3B30; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.addr { font-size: 12px; color: rgba(165,156,171,.5); padding: 0 5px; margin-top: 6px; }

.lp { position: relative; height: 64px; }
.lp-line { position: absolute; left: 7px; right: 7px; top: 30px; height: 1px; background: linear-gradient(90deg, #922CB6, #3f32CA); }
.lp-col { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; transform: translateX(-50%); white-space: nowrap; }
.lp-start { left: 26px; } .lp-today { left: calc(100% - 26px); }
.lp-cap { font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: rgba(165,156,171,.7); line-height: 11px; }
.lp-birth { width: 14px; height: 14px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1.2px #fff; margin-top: -2px; }
.lp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--text); }
.lp-now { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1.5px var(--bg); }
.lp-arrow { color: var(--text); opacity: 0; height: 11px; display: flex; transition: opacity .35s; }
.lp-arrow.on { opacity: 1; animation: lp-bounce .65s ease-in-out infinite alternate; }
@keyframes lp-bounce { from { transform: translateY(-3px); } to { transform: translateY(3px); } }

/* ---------- FullScreenPhotoViewer ---------- */
.pv { background: #000; z-index: 60; }
.pv-pager { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; }
.pv-pager::-webkit-scrollbar { display: none; }
.pv-page { flex: 0 0 100%; height: 100%; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pv-page img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; will-change: transform; }
.pv-close {
  position: absolute; top: calc(30px + var(--safe-top)); right: 16px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: rgba(60,60,67,.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

/* ---------- AddEventView ---------- */
.ae-body { padding: 0 20px; }
.ae-box {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px;
  border-radius: 12px; box-shadow: inset 0 0 0 1px var(--stroke); text-align: left;
}
.ae-box:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
.ae-cat:disabled { cursor: default; }
.ae-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; padding: 14px; }
.ae-clear { color: var(--text2); display: inline-flex; padding-right: 14px; }
.ae-count { text-align: right; font-size: 11px; color: var(--text2); padding: 5px 6px 0 0; }
.ae-small { flex: 1; min-width: 0; font-size: 14px; }
.ae-small .date-lbl { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-date { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; border: 0; }
.ae-text {
  width: 100%; min-height: 120px; resize: none; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 15px; padding: 14px; line-height: 1.4;
}
.ae-text::placeholder, .ae-input::placeholder { color: rgba(165,156,171,.5); }
.opt-btn {
  position: relative; flex: 1; min-width: 0; height: 90px; border-radius: 12px; cursor: pointer;
  border: 1.5px dashed rgba(165,156,171,.4); display: flex; align-items: center; justify-content: center;
}
.opt-btn.filled { border-style: solid; border-color: rgba(146,44,182,.5); }
.opt-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text2); font-size: 11px; font-weight: 500; }
.opt-plus, .opt-clear { position: absolute; top: 6px; right: 6px; display: inline-flex; }
.opt-filled { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 8px; }
.opt-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.ae-cover { height: 160px; border-radius: 14px; background: var(--surface); overflow: hidden; }
.ae-cover img { width: 100%; height: 100%; object-fit: cover; }
.ae-add-photo {
  width: 80px; height: 80px; flex: none; border-radius: 12px; border: 1.5px dashed rgba(165,156,171,.4);
  display: flex; align-items: center; justify-content: center;
}
.ae-photo { position: relative; width: 80px; height: 80px; flex: none; border-radius: 12px; cursor: grab; }
.ae-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.ae-photo.cover img { box-shadow: 0 0 0 2px var(--accent); }
.ae-photo.dragging { opacity: .4; }
.ae-remove { position: absolute; top: 4px; right: 4px; display: inline-flex; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
.ae-star {
  position: absolute; left: 12px; bottom: 6px; width: 21px; height: 21px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center;
}
.nav-check {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 .5px var(--stroke);
  display: inline-flex; align-items: center; justify-content: center; color: rgba(26,108,246,.4);
}
.nav-check.on { color: #1A6CF6; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
.cat-cell {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px;
  border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 .5px var(--stroke); color: var(--text2);
}
.cat-cell.on { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.cat-cell:disabled { opacity: .4; }

.search-field {
  display: flex; align-items: center; gap: 8px; margin: 12px 16px 8px; padding: 12px;
  border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 .5px var(--stroke);
}
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 17px; }
.search-field .ae-clear { padding: 0; }
.loc-row { display: block; width: 100%; text-align: left; padding: 10px 20px; border-bottom: .5px solid var(--stroke); }
.music-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 20px; }
.music-row img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface); flex: none; }
.lk-card { background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 .5px var(--stroke); }
.sheet.h430 { top: auto; height: min(470px, 90%); }

.crop { z-index: 70; }
.crop-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; display: flex; align-items: center; justify-content: center; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; opacity: .55; }
.crop-frame { position: relative; z-index: 1; box-shadow: 0 0 0 1px rgba(255,255,255,.8); pointer-events: none; overflow: hidden; }
.crop-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px calc(16px + var(--safe-bottom)); color: #fff; font-size: 17px; }
.crop-hint { font-size: 13px; color: rgba(255,255,255,.7); }
