/* =========================================================
   My Nutri Plan — finitions v168
   Dernière couche de l’interface : harmonisation des détails,
   sans changer les textes ni le fonctionnement.
   ========================================================= */

/* ---------- À table ensemble : deux chemins clairs ---------- */
.together-paths{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 14px}
.together-path{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-height:100%;padding:18px;border:1.5px solid var(--card-line,#ece1db);border-radius:var(--r-lg,24px);background:#fff;color:var(--wine);text-align:left;font:inherit;cursor:pointer;transition:border-color .25s,box-shadow .3s,transform .3s cubic-bezier(.2,.8,.2,1),background-color .25s}
.together-path:hover{border-color:#d9c3bd;transform:translateY(-1px)}
.together-path:focus-visible{outline:2px solid var(--wine);outline-offset:3px}
.together-path[aria-pressed=true]{border-color:var(--wine);background:#fffaf6;box-shadow:0 14px 30px -18px rgba(53,25,32,.45)}
.together-path[aria-pressed=true]::after{content:"";position:absolute;top:16px;right:16px;width:22px;height:22px;border-radius:50%;background:var(--wine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.4 6.2 2.3 2.3 4.9-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat}
.together-path-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--peach,#f6e1d6);color:var(--wine)}
.together-path[aria-pressed=true] .together-path-icon{background:var(--wine);color:var(--paper,#fffaf6)}
.together-path-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.together-path-text{display:grid;gap:4px}
.together-path-text strong{font-size:1rem;font-weight:650;line-height:1.25}
.together-path-text small{font-size:.84rem;line-height:1.45;color:var(--muted)}
.together-path-badge{position:absolute;top:16px;right:46px;padding:3px 9px;border-radius:999px;background:var(--lime,#e1e7a8);color:var(--wine);font:700 .64rem/1.4 var(--sans);letter-spacing:.08em;text-transform:uppercase;font-style:normal}
.together-path:not([aria-pressed=true]) .together-path-badge{right:16px}

#together-start-panel{margin-bottom:18px;animation:together-panel-in .45s cubic-bezier(.2,.8,.2,1) both}
@keyframes together-panel-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
#together-start-panel .eyebrow{margin:0 0 6px;font-size:.66rem;letter-spacing:.2em}
#together-start-panel.together-create .eyebrow{color:#e0e5a8}
#together-start-panel>h2{margin-top:0}
#together-start-panel .button{width:100%;min-height:52px}
.together-next-hint{display:flex;gap:8px;margin:14px 0 0!important;font-size:.82rem!important;opacity:.75}
.together-join{border:1.5px solid var(--card-line,#ece1db)}
.together-join.has-invitation{border-color:var(--wine)}
.together-join .button{background:var(--wine);border-color:var(--wine);color:var(--paper,#fffaf6)}
.together-received{display:flex;align-items:flex-start;gap:12px;margin:0 0 18px!important;padding:14px 16px;border-radius:var(--r-md,18px);background:var(--lime-soft,#f3f5d9);color:var(--wine)}
.together-received svg{flex:none;width:26px;height:26px;padding:4px;border-radius:50%;background:var(--wine);fill:none;stroke:var(--paper,#fffaf6);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.together-received span{display:grid;gap:2px;font-size:.86rem;line-height:1.45}
.together-received strong{font-size:.95rem}
#member-content [data-together-join]>label{margin-bottom:-6px}
.together-join-field{display:flex;align-items:stretch;gap:8px}
.together-join-field input{flex:1;min-width:0}
#member-content .together-join-field input[name=code]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.06em;font-size:1rem}
.together-paste{flex:none;min-width:84px;padding:0 16px;border:1px solid var(--line);border-radius:var(--r-sm,14px);background:#fffaf6;color:var(--wine);font:650 .9rem/1 var(--sans);cursor:pointer;transition:background-color .2s,border-color .2s}
.together-paste:hover{background:#fff;border-color:var(--wine)}
html[data-view=ensemble] .together-steps{margin-top:4px}

/* Invitation dans la carte « Notre foyer » */
.together-household .together-invitation{display:grid;gap:14px;margin:20px 0 6px;padding:18px;border-radius:var(--r-md,18px);background:var(--paper,#fffaf6);color:var(--wine)}
.together-household .together-invitation.is-empty{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.together-household .together-invitation.is-empty p{margin:0;font-size:.88rem;color:var(--muted)}
.together-invitation-head{display:flex;align-items:center;gap:12px}
.together-invitation-head p{display:grid;gap:2px;margin:0!important}
.together-invitation-head strong{font-size:1rem;font-weight:650;color:var(--wine)}
.together-invitation-head small{font-size:.82rem;line-height:1.4;color:var(--muted)}
.together-invitation-step{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--lime,#e1e7a8);color:var(--wine);font:italic 400 1.2rem/1 var(--serif)}
.together-share-main{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;background:var(--wine)!important;border-color:var(--wine)!important;color:var(--paper,#fffaf6)!important}
.together-share-main svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.together-share-options{display:flex;flex-wrap:wrap;gap:8px;margin:0}
.together-share-options .button{flex:1 1 30%;min-height:44px;padding-inline:12px;font-size:.88rem}
.together-code-box{position:relative;display:grid;gap:10px;padding:14px;border:1px dashed #d9c3bd;border-radius:var(--r-sm,14px);background:var(--app-bg,#f7f2ec)}
.together-household .together-invitation .together-code-label{margin:0;font-size:.7rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.together-code-input{position:absolute;width:1px;height:1px;padding:0;border:0;opacity:0;pointer-events:none}
.together-code-box.is-revealed .together-code-input{position:static;width:100%;height:auto;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;opacity:1;pointer-events:auto;font:500 .95rem/1.3 ui-monospace,SFMono-Regular,Menlo,monospace}
.together-code-groups{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0!important}
.together-code-groups span{padding:7px 0;border-radius:8px;background:#fff;text-align:center;font:600 clamp(.82rem,3.3vw,.98rem)/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.06em;color:var(--wine);user-select:all;-webkit-user-select:all}
.together-code-actions{display:flex;flex-wrap:wrap;gap:8px}
.together-chip{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--wine);font:600 .84rem/1 var(--sans);cursor:pointer;transition:border-color .2s,background-color .2s}
.together-chip:hover{border-color:var(--wine)}
.together-chip svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.together-household .together-invitation .together-invitation-note{margin:0;font-size:.78rem;line-height:1.5;color:var(--muted)}

@media(min-width:1100px){
  html[data-view=ensemble] #member-content>.together-paths{grid-column:1;grid-template-columns:1fr;align-self:start;margin-bottom:12px}
  html[data-view=ensemble] #member-content>.together-paths~.together-steps{grid-column:1;grid-template-columns:1fr;gap:0;align-self:start;margin:6px 0 18px;padding:6px 20px;border:1px solid var(--card-line,#ece1db);border-radius:var(--r-lg,24px);background:rgba(255,255,255,.55)}
  html[data-view=ensemble] #member-content>.together-paths~.together-steps li{display:grid;grid-template-columns:44px 1fr;column-gap:8px;padding:14px 0;border:0;border-radius:0;background:none}
  html[data-view=ensemble] #member-content>.together-paths~.together-steps li+li{border-top:1px solid var(--card-line,#ece1db)}
  html[data-view=ensemble] #member-content>.together-paths~.together-steps span{grid-row:span 2;margin:0}
  html[data-view=ensemble] #member-content>#together-start-panel{grid-column:2;grid-row:span 2}
  .together-path{flex-direction:row;align-items:center;padding:20px}
  .together-path-text{padding-right:34px}
}
@media(max-width:760px){
  .together-paths{gap:10px}
  .together-path{padding:14px;gap:10px;border-radius:20px}
  .together-path-icon{width:38px;height:38px;border-radius:12px}
  .together-path-icon svg{width:20px;height:20px}
  .together-path-text strong{font-size:.92rem}
  .together-path-text small{font-size:.76rem}
  .together-path[aria-pressed=true]::after{top:12px;right:12px;width:20px;height:20px}
  .together-path-badge{top:14px;right:38px}
  .together-path:not([aria-pressed=true]) .together-path-badge{right:12px}
  .together-household .together-invitation{padding:14px;margin-inline:-6px}
  .together-code-box{padding:12px}
  .together-code-actions .together-chip{flex:1;justify-content:center}
}
.together-share-options .button{flex:1 1 40%}
.together-chip{white-space:nowrap}
@media(max-width:760px){.together-chip{padding:0 10px;font-size:.8rem;gap:6px}}
.skip-link:focus:not(:focus-visible){top:-100px}
.together-received-code{margin:0}
.together-received-code .text-link{justify-self:start;font-size:.84rem}
.together-join .together-code-label{margin:0;font-size:.7rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}

/* ---------- Page d’invitation (lien partagé) ---------- */
.invite-page .connection-card h2{margin-bottom:14px}
.invite-page .invite-open{width:100%;margin:6px 0 0}
.invite-page .invite-hint{margin:12px 0 22px;font-size:.84rem;line-height:1.55;color:var(--muted)}
.invite-ticket{position:relative;display:grid;gap:10px;margin:0 0 16px;padding:16px;border:1px dashed #d9c3bd;border-radius:var(--r-md,18px);background:var(--app-bg,#f7f2ec)}
.invite-ticket>p{margin:0;font-size:.7rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.invite-code{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.invite-code span{padding:8px 0;border-radius:8px;background:#fff;text-align:center;font:600 clamp(.82rem,3.4vw,1rem)/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.06em;color:var(--wine)}
.invite-ticket .text-link{justify-self:start;font-size:.86rem}
.invite-help{margin:0 0 16px;padding:12px 16px;border-radius:var(--r-md,18px);background:#fff;border:1px solid var(--card-line,#ece1db)}
.invite-help summary{cursor:pointer;font-size:.9rem;font-weight:600;color:var(--wine);list-style:none;display:flex;justify-content:space-between;gap:12px}
.invite-help summary::-webkit-details-marker{display:none}
.invite-help summary::after{content:"+";font-weight:400;font-size:1.2rem;line-height:1}
.invite-help[open] summary::after{content:"–"}
.invite-help p{margin:10px 0 0;font-size:.86rem;line-height:1.55;color:var(--muted)}
.invite-account{margin:0;font-size:.9rem;color:var(--muted)}
.invite-account small{display:block;margin-top:8px;font-size:.78rem;line-height:1.5}

/* ---------- Proposition de notifications (accueil) : plus légère ---------- */
.patient-notification-welcome{position:relative;display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:16px;align-items:start;padding:20px 22px!important;border-radius:var(--r-lg,24px)!important}
.patient-notification-welcome::before{content:"";grid-row:1/span 6;width:44px;height:44px;border-radius:14px;background:var(--wine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fffaf6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16.5V11a6 6 0 0 1 12 0v5.5l1.5 2h-15z'/%3E%3Cpath d='M10 20.5a2.2 2.2 0 0 0 4 0'/%3E%3C/svg%3E") center/22px no-repeat}
.patient-notification-welcome>*{grid-column:2;margin-block:0!important}
.patient-notification-welcome .eyebrow{margin-bottom:4px!important;font-size:.62rem;letter-spacing:.18em}
.patient-notification-welcome h2{margin-bottom:6px!important;font-size:1.05rem!important;line-height:1.3}
.patient-notification-welcome>p:not(.eyebrow){font-size:.86rem;line-height:1.55;color:var(--muted)}
.patient-notification-welcome>p+p{margin-top:6px!important}
.patient-notification-welcome .button{justify-self:start;margin:12px 0 0!important;min-height:44px}
.patient-notification-welcome .text-link{justify-self:start;margin:12px 0 0!important}
.patient-notification-welcome .button+p{font-size:.78rem!important}
.patient-notification-welcome .text-link+p{margin-top:8px!important;font-size:.76rem!important;opacity:.85}
@media(min-width:900px){.patient-notification-welcome{grid-template-columns:44px minmax(0,1fr) auto;column-gap:20px}.patient-notification-welcome>*{grid-column:2}.patient-notification-welcome .button,.patient-notification-welcome .text-link{grid-column:3;grid-row:2;align-self:center;justify-self:end;margin:0!important}.patient-notification-welcome .button+p{grid-column:2}.patient-notification-welcome .button~.text-link{grid-row:3}}
@media(max-width:760px){.patient-notification-welcome{grid-template-columns:38px minmax(0,1fr);column-gap:12px;padding:16px!important}.patient-notification-welcome::before{width:38px;height:38px;border-radius:12px;background-size:19px}}

/* ---------- Barre latérale : liens d’aide alignés ---------- */
.member-sidebar .sidebar-end .sidebar-guide{display:flex!important;align-items:center;gap:9px;width:auto}
.member-sidebar .sidebar-end .sidebar-support{align-items:flex-start}
.member-sidebar .sidebar-end .sidebar-support svg{margin-top:1px}

/* ---------- Ma diététicienne sur ordinateur : conversation à hauteur d’écran ---------- */
@media(min-width:761px){
  html[data-view=contact] .patient-chat-layout{align-items:stretch}
  html[data-view=contact] .patient-chat-layout .chat-shell{display:flex;flex-direction:column;height:max(560px,calc(100vh - 290px))}
  html[data-view=contact] .patient-chat-layout .chat-scroll{flex:1;height:auto;min-height:0}
  html[data-view=contact] .patient-chat-aside{align-self:start;position:sticky;top:100px}
  .patient-chat-layout .chat-composer{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"note note" "label label" "input input" "pending pending" "status status" "attach send" "help help";column-gap:12px;padding:16px 20px 14px!important}
  .patient-chat-layout .chat-policy-note{grid-area:note}
  .patient-chat-layout .chat-input-label{grid-area:label;position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .patient-chat-layout .chat-composer textarea{grid-area:input;min-height:56px!important;height:56px;max-height:180px;resize:none!important;border-radius:16px!important;padding:14px 16px!important;font-size:15px!important}
  .patient-chat-layout .chat-pending{grid-area:pending}
  .patient-chat-layout .chat-status{grid-area:status}
  .patient-chat-layout .chat-attach-actions{grid-area:attach;align-items:center;margin-top:10px!important}
  .patient-chat-layout .chat-attach-actions [data-chat-refresh]{margin-left:4px!important}
  .patient-chat-layout .chat-composer-actions{grid-area:send;display:flex!important;align-items:center;gap:12px;margin-top:10px!important;flex-wrap:nowrap}
  .patient-chat-layout .chat-policy-next{min-width:0;max-width:260px;text-align:right}
  .patient-chat-layout .chat-help{grid-area:help;margin-top:6px}
}

/* ---------- Champs de fichier : bouton assorti ---------- */
input[type=file]{max-width:100%;font:500 .88rem/1.4 var(--sans,inherit);color:var(--muted,#7e6868)}
input[type=file]::file-selector-button{margin-right:12px;padding:10px 16px;border:1px solid var(--line,#e6dad2);border-radius:999px;background:#fff;color:var(--wine,#4b202b);font:600 .86rem/1 var(--sans,inherit);cursor:pointer;transition:border-color .2s,background-color .2s}
input[type=file]::file-selector-button:hover{border-color:var(--wine,#4b202b)}

/* ---------- Mes courses : état vide ---------- */
#shopping-list:not(:has(*)){display:grid;justify-items:center;gap:10px;margin-top:4px;padding:28px 20px;border:1px dashed var(--card-line,#e6dad2);border-radius:var(--r-lg,24px);text-align:center;font-size:.92rem;line-height:1.5;color:var(--muted)}
#shopping-list:not(:has(*))::before{content:"";width:46px;height:46px;border-radius:15px;background:var(--peach,#f6e1d6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b202b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8h13l-1 11.5a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 0 1-1.5-1.5z'/%3E%3Cpath d='M9 10.5V7a3 3 0 0 1 6 0v3.5'/%3E%3C/svg%3E") center/22px no-repeat}
.track-save-note:empty{display:none}

/* =========================================================
   Espace professionnel : repères visuels et rythme
   ========================================================= */
.professional-page details>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;list-style:none;cursor:pointer}
.professional-page details>summary::-webkit-details-marker{display:none}
.professional-page details>summary::after{content:"";flex:none;width:30px;height:30px;border-radius:50%;background:#f6f0ea url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b202b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center/16px no-repeat;transition:transform .3s cubic-bezier(.2,.8,.2,1),background-color .2s}
.professional-page details[open]>summary::after{transform:rotate(180deg)}
.professional-page details>summary:hover::after{background-color:#efe4dd}
.professional-page details>summary:focus-visible{outline:2px solid var(--wine);outline-offset:4px;border-radius:8px}
.professional-page details.panel>summary{min-height:32px}
.professional-page .panel details:not(.panel){margin:18px 0;padding:14px 0 0;border-top:1px solid var(--card-line,#ece1db)}
.professional-page .panel details:not(.panel)>summary{font-size:.95rem;font-weight:650;color:var(--wine)}
.professional-page .panel details:not(.panel)[open]>summary{margin-bottom:14px}
.professional-page .panel details:not(.panel)>.email-toggle{margin:0 0 10px}
.professional-page .panel>.page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:16px 0}
.professional-page .panel>.page-actions>span{font-size:.88rem;color:var(--muted)}
.professional-page .email-toggle{display:flex;align-items:center;gap:10px}
.professional-page .email-toggle input{width:18px;height:18px;flex:none;accent-color:var(--wine)}
.professional-page form>.button{margin-top:6px}
/* Barre latérale : chaque rubrique a son pictogramme */
.professional-page .member-sidebar nav a{display:flex;align-items:center;gap:12px}
.professional-page .member-sidebar nav a [data-support-counter]:not(:empty){margin-left:auto;min-width:22px;padding:2px 7px;border-radius:999px;background:var(--lime,#e1e7a8);color:var(--wine);font-size:.72rem;font-weight:700;text-align:center}
/* Liste des dossiers : en-tête et ligne plus nettes sur téléphone */
@media(max-width:760px){
  .professional-page .page-heading,.professional-page .view-heading{gap:12px}
  .professional-page .panel{padding:20px 18px}
}
@media(max-width:760px){
  .professional-page .pro-directory-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px 8px}
  .professional-page .pro-directory-tools>label:first-child{grid-column:1;min-width:0}
  .professional-page .pro-directory-tools>.button{grid-column:2;min-height:48px;padding-inline:16px}
  .professional-page .pro-directory-tools>.pro-archive-filter{grid-column:1/-1;width:auto;font-size:.86rem}
  .professional-page .pro-list-caption{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 14px}
  .professional-page .pro-list-caption h2{flex:1 0 100%;margin:0}
  .professional-page .pro-list-caption>span{margin-left:auto;font-size:.8rem}
}
.professional-page h3:has(>.text-link){font-size:1rem;font-weight:600;line-height:1.5}
.professional-page h3>.text-link{font:inherit;min-height:0}
@media(min-width:1100px){
  html[data-view=ensemble] #member-content>.together-household,html[data-view=ensemble] #member-content>.shared-organisation{align-self:start}
  html[data-view=ensemble] #member-content>.together-household>.together-leave{margin-top:22px}
}
.shopping-panel select{font-size:1rem!important;font-weight:550}
#member-content .together-create [data-together-create] label:not(.together-consent){color:rgba(255,250,246,.82)}
