:root{
  color-scheme:light;
  --stip-bg:#f3f6f8;
  --stip-bg-strong:#e8eef2;
  --stip-surface:#ffffff;
  --stip-surface-soft:#edf2f5;
  --stip-surface-tint:#e3edf2;
  --stip-ink:#103a55;
  --stip-ink-2:#2c5369;
  --stip-muted:#5f737e;
  --stip-muted-2:#7d8f98;
  --stip-accent:#0b7ea6;
  --stip-accent-soft:#dceff5;
  --stip-line:#cdd9df;
  --stip-line-soft:#e5ebee;
  --stip-danger:#b32634;
  --stip-warning:#986000;
  --stip-success:#247253;
  /* Shifts — palette métier unique, volontairement très distincte */
  --stip-shift-m:#087cff;
  --stip-shift-j:#00b85a;
  --stip-shift-j4:#ff9500;
  --stip-shift-s:#ffd500;
  --stip-shift-n:#000000;
  --stip-shift-m-soft:#dcebff;
  --stip-shift-j-soft:#dcf8e8;
  --stip-shift-j4-soft:#fff0d6;
  --stip-shift-s-soft:#fff3a3;
  --stip-shift-n-soft:#eceff1;
  --stip-shift-s-ink:#3a2b00;
  --stip-shift-s-text:#8a6500;
  /* Calendriers 1 mois — taille canonique des pictogrammes (référence ✈️). */
  --stip-month-icon-size:1.45rem;
  --stip-month-number-lift:0px;
  --stip-month-event-gap:6px;
  --stip-month-event-offset:0px;
  --stip-month-grid-column-gap:5px;
  --stip-month-grid-row-gap:10px;
  --stip-month-cell-min-height:88px;
  --stip-month-cell-height:88px;
  --stip-month-number-row:22px;
  --stip-month-visual-row:22px;
  --stip-month-events-row:24px;
  --stip-month-internal-gap:6px;
  --stip-radius-xs:8px;
  --stip-radius-sm:12px;
  --stip-radius-md:18px;
  --stip-radius-lg:24px;
  --stip-radius-xl:30px;
  --stip-shadow-soft:0 5px 16px rgba(16,58,85,.09),0 1px 2px rgba(16,58,85,.04);
  --stip-shadow:0 12px 30px rgba(16,58,85,.12),0 2px 7px rgba(16,58,85,.05);
  --stip-shadow-strong:0 18px 46px rgba(16,58,85,.18),0 4px 12px rgba(16,58,85,.08);
  /* Signature officielle des cartes STIP — accent contextuel, géométrie commune. */
  --stip-card-accent:var(--stip-accent);
  --stip-card-surface:linear-gradient(160deg,#ffffff 0%,#fbfdfe 54%,#f4f8fa 100%);
  --stip-card-border:color-mix(in srgb,var(--stip-card-accent) 13%,var(--stip-line));
  --stip-card-shadow:0 14px 34px rgba(16,58,85,.105),0 3px 9px rgba(16,58,85,.045),inset 0 1px 0 rgba(255,255,255,.98);
  --stip-card-shadow-active:0 17px 40px color-mix(in srgb,var(--stip-card-accent) 15%,transparent),0 4px 11px rgba(16,58,85,.07),inset 0 1px 0 rgba(255,255,255,.99);
  --stip-card-liseret-height:3px;
  --stip-card-liseret-inset:14px;
  --stip-page-pad:clamp(10px,2.6vw,18px);
  --stip-gap:clamp(4px,1vw,7px);
  --stip-calendar-cell:minmax(0,1fr);
  --stip-tap:scale(.975);
  --stip-motion:160ms cubic-bezier(.2,.8,.2,1);
  --stip-surface-raised:linear-gradient(180deg,#ffffff 0%,#f8fafb 100%);
  --stip-surface-active:linear-gradient(180deg,#f5fcfe 0%,#e3f3f7 100%);
  --stip-line-strong:#b5c6cf;
  --stip-focus-ring:rgba(11,126,166,.28);
  --stip-on-accent:#fff;

  /* Compatibilité : les anciennes couches héritent maintenant du thème maître. */
  --cp-ink:var(--stip-ink);--cp-muted:var(--stip-muted);--cp-bg:var(--stip-bg);--cp-card:var(--stip-surface);--cp-line:var(--stip-line);--cp-shadow:var(--stip-shadow);
  --rh-navy:var(--stip-ink);--rh-cyan:var(--stip-accent);--rh-cyan2:var(--stip-accent);--rh-line:var(--stip-line);--rh-muted:var(--stip-muted);--rh-bg:var(--stip-bg);--rh-card:var(--stip-surface);--rh-soft:var(--stip-surface-soft);--rh-shadow:var(--stip-shadow);
  --ink:var(--stip-ink);--muted:var(--stip-muted);--line:var(--stip-line);--accent:var(--stip-accent);--soft:var(--stip-accent-soft);--surface:var(--stip-surface);
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--stip-bg)!important;color:var(--stip-ink)!important;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button,input,textarea,select{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{transition:transform var(--stip-motion),background-color var(--stip-motion),border-color var(--stip-motion),box-shadow var(--stip-motion),opacity var(--stip-motion)}
button:active:not(:disabled){transform:var(--stip-tap)}
::selection{background:var(--stip-accent-soft);color:var(--stip-ink)}

/* Primitives officielles */
.stip-page{box-sizing:border-box;width:100%;max-width:760px;margin:0 auto;padding:calc(16px + env(safe-area-inset-top)) var(--stip-page-pad) calc(28px + env(safe-area-inset-bottom))}
.stip-surface{background:var(--stip-surface-raised);border:1px solid var(--stip-line);border-radius:var(--stip-radius-lg);box-shadow:var(--stip-shadow)}
.stip-surface-soft{background:var(--stip-surface-soft);border:1px solid var(--stip-line);border-radius:var(--stip-radius-md);box-shadow:var(--stip-shadow-soft)}
.stip-kicker{display:block;color:var(--stip-accent);font-size:.62rem;font-weight:950;letter-spacing:.12em;text-transform:uppercase}
.stip-title{margin:4px 0 0;color:var(--stip-ink);font-size:clamp(1.9rem,7vw,2.6rem);line-height:.98;letter-spacing:-.04em;font-weight:900}
.stip-subtitle{margin:7px 0 0;color:var(--stip-muted);font-size:.78rem;line-height:1.4}
.stip-muted{color:var(--stip-muted)}.stip-accent{color:var(--stip-accent)}
.stip-locked{opacity:.46;filter:saturate(.35)}
.stip-search{width:100%;min-height:52px;border:1px solid var(--stip-line-strong);border-radius:16px;background:rgba(255,255,255,.98);box-shadow:var(--stip-shadow-soft)}
.stip-btn{min-height:44px;border:0;border-radius:14px;padding:0 15px;background:var(--stip-ink);color:#fff;font-weight:900}
.stip-btn.secondary{background:var(--stip-surface);color:var(--stip-ink);border:1px solid var(--stip-line-strong);box-shadow:var(--stip-shadow-soft)}
.stip-icon-tile{display:grid;place-items:center;border-radius:16px;background:var(--stip-accent-soft);color:var(--stip-accent)}
.stip-skeleton{position:relative;overflow:hidden;background:#e8f0f2;border-radius:12px}
.stip-skeleton:after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.72),transparent);animation:stip-shimmer 1.1s infinite}
@keyframes stip-shimmer{100%{transform:translateX(100%)}}

/* Accueil : on garde l'identité actuelle mais toutes les surfaces parlent le même langage. */
#homeView{background:var(--stip-bg)!important}
.hs-home{color:var(--stip-ink)!important}
.cp-head h1,.cp-profile-main>strong,.cp-card,.cp-tool{color:var(--stip-ink)!important}
.cp-head h1{font-weight:820!important;letter-spacing:-.045em!important}
.cp-head h1 strong{font-weight:950!important}
.cp-date,.cp-head p,.cp-profile-main>small,.cp-tool small,.cp-day small{color:var(--stip-muted)!important}
.cp-profile,.cp-card,.cp-tool,.cp-bell{background:var(--stip-surface)!important;border-color:var(--stip-line)!important;box-shadow:var(--stip-shadow)!important}
.cp-profile{border-radius:var(--stip-radius-md)!important}
.cp-card{border-radius:var(--stip-radius-lg)!important}
.cp-tool{border-radius:var(--stip-radius-md)!important}
.cp-profile-details span{background:var(--stip-surface-soft)!important;color:var(--stip-ink)!important}
.cp-day{border-color:var(--stip-line)!important;box-shadow:var(--stip-shadow-soft)!important}
.cp-day.today{border-color:var(--stip-ink)!important;box-shadow:0 0 0 2px rgba(16,63,81,.08),var(--stip-shadow-soft)!important}
.hs-panel{background:var(--stip-bg)!important;color:var(--stip-ink)!important}
.hs-panel-head{background:rgba(246,247,248,.97)!important;border-color:var(--stip-line)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

/* Planning perso : composant de référence STIP */
#planningView{background:var(--stip-bg)!important}
#planningView .ph-shell{max-width:760px!important;padding:16px var(--stip-page-pad) calc(96px + env(safe-area-inset-bottom))!important}
#planningView .ph-head{margin:4px 2px 14px!important;gap:12px!important}
#planningView .ph-head h1{font-size:clamp(2rem,7.7vw,2.65rem)!important;line-height:.96!important;letter-spacing:-.035em!important;color:var(--stip-ink)!important}
#planningView .ph-head span{color:var(--stip-accent)!important}
#planningView .ph-head small{font-size:.78rem!important;color:var(--stip-muted)!important}
#planningView .ph-back{border-radius:16px!important;background:#fff!important;box-shadow:var(--stip-shadow-soft)!important}
#planningView .ph-content{border:1px solid var(--stip-line)!important;border-radius:var(--stip-radius-lg)!important;background:var(--stip-surface)!important;box-shadow:var(--stip-shadow)!important;overflow:hidden!important}
#planningView .ph-month-card{padding:clamp(8px,2vw,12px)!important;background:var(--stip-surface)!important;border-radius:var(--stip-radius-lg)!important}
#planningView .ph-month-card>.ph-month-hero{display:grid!important;grid-template-columns:clamp(72px,19vw,92px) minmax(0,1fr)!important;gap:clamp(8px,2.2vw,14px)!important;align-items:stretch!important;margin:0 0 12px!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
#planningView .phmh-person{display:grid!important;grid-template-rows:20px 1fr!important;min-width:0!important}
#planningView .phmh-year{display:flex!important;align-items:center!important;justify-content:center!important;color:var(--stip-muted-2)!important;font-size:.67rem!important;font-weight:950!important;letter-spacing:.08em!important}
#planningView .phmh-avatar{aspect-ratio:1/1!important;height:auto!important;border-radius:20px!important;overflow:hidden!important;background:var(--stip-surface-soft)!important;border:1px solid var(--stip-line)!important;display:grid!important;place-items:center!important}
#planningView .phmh-avatar img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center top!important}
#planningView .phmh-carousel{display:grid!important;grid-template-columns:minmax(44px,18%) 1fr minmax(44px,18%)!important;align-items:center!important;min-height:108px!important;height:auto!important;border-radius:20px!important;background:#f9fcfd!important;border:1px solid var(--stip-line)!important;overflow:hidden!important;touch-action:pan-y!important}
#planningView .phmh-arrow{height:100%!important;border:0!important;background:transparent!important;color:var(--stip-ink)!important;padding:0!important;display:grid!important;place-items:center!important}
#planningView .phmh-arrow svg{width:clamp(30px,8vw,40px)!important;height:clamp(30px,8vw,40px)!important;fill:none!important;stroke:currentColor!important;stroke-width:4!important;stroke-linecap:round!important;stroke-linejoin:round!important}
#planningView .phmh-arrow:disabled{opacity:.12!important}
#planningView .phmh-center{height:100%!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;padding:4px 0!important}
#planningView .phmh-center img{display:block!important;width:min(96%,230px)!important;height:min(86px,18vw)!important;min-height:62px!important;object-fit:contain!important}
#planningView .ph-month-grid{display:grid!important;grid-template-columns:repeat(7,var(--stip-calendar-cell))!important;margin-top:0!important;align-items:stretch!important}
#planningView .ph-day-head{min-width:0!important;padding:7px 1px 6px!important;text-align:center!important;font-size:clamp(.46rem,1.65vw,.62rem)!important;font-weight:950!important;letter-spacing:-.015em!important;color:var(--stip-ink)!important;border-bottom:3px solid var(--stip-ink)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:clip!important}
#planningView .ph-empty{min-height:var(--stip-month-cell-height)!important}
#planningView .ph-day-cell{min-width:0!important;border:1px solid var(--stip-line)!important;border-radius:15px!important;background:linear-gradient(180deg,#fff,#fbfdfe)!important;box-shadow:var(--stip-shadow-soft)!important}
#planningView .ph-day-cell>b{color:#111!important}
#planningView .ph-shift-slot{line-height:1!important}
#planningView .ph-shift-img{display:block!important;max-width:96%!important;max-height:clamp(52px,15.5vw,76px)!important;width:auto!important;height:auto!important;object-fit:contain!important;filter:saturate(1.32) contrast(1.10) brightness(1.04) drop-shadow(0 2px 3px rgba(0,0,0,.08))!important}
#planningView .ph-shift-img[alt="J4"]{filter:saturate(1.55) contrast(1.16) brightness(1.02) hue-rotate(-4deg) drop-shadow(0 2px 3px rgba(0,0,0,.08))!important}
#planningView .ph-shift-img[alt="S"]{filter:saturate(1.55) contrast(1.12) brightness(1.10) drop-shadow(0 2px 3px rgba(0,0,0,.08))!important}

/* Responsable : même app, pas une seconde identité visuelle. */
.responsable-home-page,.resp-panel,.ra-native-panel .resp-panel-body{background:var(--stip-bg)!important;color:var(--stip-ink)!important}
.resp-top{background:rgba(255,255,255,.97)!important;border-color:var(--stip-line)!important}
.resp-top .brand,.resp-head h1,.resp-label,.resp-card,.resp-preview,.resp-empty{color:var(--stip-ink)!important}
.resp-top .home,.resp-head .kicker,.ra-kicker,.resp-eyebrow{color:var(--stip-accent)!important}
.resp-head p,.resp-card p,.resp-preview p,.resp-empty p{color:var(--stip-muted)!important}
.resp-refresh,.resp-card,.resp-preview,.resp-empty,.resp-operational{background:var(--stip-surface)!important;border-color:var(--stip-line)!important;box-shadow:var(--stip-shadow)!important}
.resp-icon{border-radius:20px!important;box-shadow:var(--stip-shadow-soft)!important}
.resp-app.selected .resp-icon{box-shadow:0 0 0 3px var(--stip-accent-soft),0 0 0 5px rgba(7,152,181,.38),var(--stip-shadow)!important}
.resp-panel{transition:transform var(--stip-motion)!important}
.resp-panel-head{background:rgba(246,247,248,.97)!important;border-color:var(--stip-line)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.ra-search{background:rgba(255,255,255,.97)!important;border-color:var(--stip-line)!important;box-shadow:var(--stip-shadow-soft)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.ra-group,.ra-absence-group,.ra-person{background:var(--stip-surface)!important;border-color:var(--stip-line)!important;box-shadow:none!important}
.ra-person:active{background:var(--stip-surface-soft)!important}
.ra-avatar{background:var(--stip-accent-soft)!important;color:var(--stip-ink)!important}
.ra-day-head h1,.ra-person-copy b,.ra-group>header>div>span{color:var(--stip-ink)!important}
.ra-day-head p,.ra-person-copy small,.ra-absence-group summary small,.ra-empty{color:var(--stip-muted)!important}

/* Lecture agent : ressemble au STIP de l'agent, le badge readonly reste discret. */
.ro-shell,.ro-page{color:var(--stip-ink)!important}
.ro-control span,.ro-badge,.ro-chip{background:var(--stip-accent-soft)!important;color:var(--stip-ink-2)!important;border:1px solid rgba(7,152,181,.08)!important}
.ro-profile,.ro-week button,.ro-appbtn,.ro-list,.ro-placeholder,.ro-team article,.ro-search{background:var(--stip-surface)!important;border-color:var(--stip-line)!important;box-shadow:var(--stip-shadow-soft)!important}
.ro-profile{border-radius:var(--stip-radius-lg)!important;box-shadow:var(--stip-shadow)!important}
.ro-avatar,.ro-appbtn>span{background:var(--stip-accent-soft)!important;color:var(--stip-accent)!important}
.ro-head h1,.ro-sub h1,.ro-details strong,.ro-appbtn>b{color:var(--stip-ink)!important}
.ro-head p,.ro-sub p,.ro-details p,.ro-appbtn>small,.ro-week small{color:var(--stip-muted)!important}
.ro-appbtn.locked{background:#edf2f3!important;color:#7b8c92!important;box-shadow:none!important;opacity:.7}
.ro-week button.today{border:2px solid var(--stip-accent)!important;background:#eefafb!important}
.ro-search{box-shadow:none!important}
.ro-load i,.ra-load i{border-color:var(--stip-line)!important;border-top-color:var(--stip-accent)!important}

/* États partagés */
.route-loading,.ph-page-load,.ph-live-load,.ra-load,.ro-load{color:var(--stip-muted)!important}
.ph-error,.ph-live-error,.ra-error,.ro-error{color:var(--stip-muted)!important}
.ph-error b,.ph-live-error b,.ra-error b,.ro-error b{color:var(--stip-ink)!important}

@media(max-width:390px){
  :root{--stip-page-pad:6px;--stip-gap:3px}
  #planningView .ph-shell{padding-inline:6px!important}
  #planningView .ph-month-card{padding:7px!important}
  #planningView .ph-month-card>.ph-month-hero{grid-template-columns:70px minmax(0,1fr)!important;gap:7px!important}
  #planningView .phmh-person{grid-template-rows:17px 1fr!important}
  #planningView .phmh-avatar{border-radius:17px!important}
  #planningView .phmh-carousel{min-height:92px!important;border-radius:17px!important}
  #planningView .phmh-center img{height:68px!important;min-height:58px!important}
  #planningView .ph-shift-img{max-height:52px!important}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}

/* Visiter les lieux : photos terrain des trois hôpitaux, stockées localement dans STIP. */
a.destination.primary[href="#/place/hfme"]{background:linear-gradient(90deg,rgba(16,43,61,.84),rgba(16,43,61,.64)),url("images/hospitals/hfme.jpg") center 48%/cover no-repeat!important}
a.destination.primary[href="#/place/pw"]{background:linear-gradient(90deg,rgba(16,43,61,.86),rgba(16,43,61,.66)),url("images/hospitals/neuro.jpg") center/cover no-repeat!important}
a.destination.primary[href="#/place/hlp"]{background:linear-gradient(90deg,rgba(16,43,61,.86),rgba(16,43,61,.66)),url("images/hospitals/cardio.jpg") center/cover no-repeat!important}
a.destination.primary[href="#/place/hfme"] .destination-arrow,a.destination.primary[href="#/place/pw"] .destination-arrow,a.destination.primary[href="#/place/hlp"] .destination-arrow{background:rgba(4,38,63,.64)!important;backdrop-filter:blur(1px)}

/* Visiter les lieux : rupture claire entre le moteur de recherche et la carte de base. */
#homeView .search-wrap + .group{position:relative;margin-top:0!important;padding-top:46px}
#homeView .search-wrap + .group:before{content:""!important;position:absolute!important;left:8%!important;right:8%!important;top:17px!important;height:1px!important;background:var(--stip-line)!important;box-shadow:none!important}
#homeView .search-wrap + .group:after{display:none!important}
@media(max-width:430px){#homeView .search-wrap + .group{padding-top:42px}#homeView .search-wrap + .group:before{top:15px}#homeView .search-wrap + .group:after{top:9px;width:11px;height:11px}}

/* IRM : photo entière, titre lisible sur l'image, informations secondaires sous l'image. */
#detailView .detail-hero.irm-photo-hero{display:flex!important;flex-direction:column!important;min-height:0!important;padding:0 18px 18px!important;background:#fff!important;color:var(--stip-ink)!important;border:1px solid var(--stip-line)!important;box-shadow:var(--stip-shadow)!important;text-shadow:none!important;overflow:hidden!important}
#detailView .detail-hero.irm-photo-hero:before{content:"";display:block!important;flex:0 0 auto;width:calc(100% + 36px);aspect-ratio:3/2;margin:0 -18px 0;background:linear-gradient(180deg,rgba(4,22,35,.12) 0%,rgba(4,22,35,.08) 55%,rgba(4,22,35,.58) 100%),url("images/irm/irm-header.jpg") center/contain no-repeat,#0b2539!important}
#detailView .detail-hero.irm-photo-hero .detail-type{position:relative!important;z-index:2!important;align-self:flex-start!important;margin:-94px 0 8px!important;color:#fff!important;text-shadow:0 2px 8px rgba(0,0,0,.8)!important}
#detailView .detail-hero.irm-photo-hero h1{position:relative!important;z-index:2!important;margin:0 0 49px!important;color:#fff!important;font-size:clamp(1.85rem,8.2vw,2.35rem)!important;line-height:1!important;text-shadow:0 3px 12px rgba(0,0,0,.82)!important}
#detailView .detail-hero.irm-photo-hero .detail-official{margin:0 0 6px!important;color:var(--stip-ink)!important;font-size:.88rem!important;font-weight:900!important;text-shadow:none!important}
#detailView .detail-hero.irm-photo-hero .detail-meta{margin:0!important;color:#315866!important;font-size:.8rem!important;font-weight:900!important;text-shadow:none!important}
#detailView .detail-hero.irm-photo-hero>p:not(.detail-official):not(.detail-meta){margin:7px 0 0!important;color:#5d7680!important;font-size:.79rem!important;line-height:1.4!important;font-weight:720!important;text-shadow:none!important}
@media(max-width:430px){#detailView .detail-hero.irm-photo-hero{padding-left:14px!important;padding-right:14px!important}#detailView .detail-hero.irm-photo-hero:before{width:calc(100% + 28px);margin-left:-14px;margin-right:-14px}#detailView .detail-hero.irm-photo-hero .detail-type{margin-top:-88px!important}#detailView .detail-hero.irm-photo-hero h1{margin-bottom:47px!important}}

:root{--stip-opportunity:#7C3AED;--stip-opportunity-soft:#F3EDFF}
