/* Maquettes « comme dans l'application » de la page d'accueil (thème Pro, voir home-app-tokens.css).
   Statiques et décoratives : elles reprennent la mise en page des vraies pages (calendrier, éditeur, journal). */

.hm-app { font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: var(--color-text); text-align: left; letter-spacing: 0; }
.hm-app strong { font-weight: 600; }
.hm-app pc-icon { vertical-align: middle; }
.hma-window { background: var(--color-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.hma-window-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--color-surface); border-bottom: 1px solid var(--color-divider); font-weight: 600; }
.hma-window-bar .hma-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-neutral-400); }
.hma-window-bar strong { margin-left: 8px; }
.hma-body { padding: 14px; }
.hma-card { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-sm); }

/* Barre d'outils du calendrier */
.hma-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.hma-title { font-size: 17px; font-weight: 600; margin-inline: 4px; }
.hma-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface); font-size: 12px; font-weight: 600; }
.hma-btn-group { display: inline-flex; gap: 0; }
.hma-btn-group .hma-btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.hma-btn-group .hma-btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; margin-left: -1px; }
.hma-seg { display: inline-flex; margin-left: auto; }
.hma-seg span { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid var(--color-divider); background: var(--color-surface); font-size: 12px; font-weight: 600; margin-left: -1px; }
.hma-seg span:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); margin-left: 0; }
.hma-seg span:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.hma-seg .is-on { background: var(--pc-fill); border-color: var(--pc-fill); color: var(--pc-on-fill); }

/* Pastilles d'événement (mêmes couleurs que les statuts de l'application) */
.hma-ev { display: block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.3; overflow: hidden; }
.hma-ev time { display: flex; align-items: center; gap: 3px; font-weight: 600; }
.hma-ev span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hma-ev--scheduled { background: var(--pc-st-scheduled-bg); color: var(--pc-st-scheduled-fg); border: var(--pc-st-scheduled-border); }
.hma-ev--publishing { background: var(--pc-st-publishing-bg); color: var(--pc-st-publishing-fg); border: var(--pc-st-publishing-border); }
.hma-ev--published { background: var(--pc-st-published-bg); color: var(--pc-st-published-fg); border: var(--pc-st-published-border); }

/* Vue semaine */
.hma-layout { display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: 10px; min-width: 0; }
.hma-week { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-lg); overflow: hidden; display: grid; grid-template-columns: 38px repeat(5, minmax(0, 1fr)); grid-template-rows: auto repeat(5, 42px); min-width: 0; }
.hma-week > * { border-bottom: 1px solid var(--color-divider); border-left: 1px solid var(--color-divider); min-width: 0; }
.hma-week > :nth-child(6n + 1) { border-left: 0; }
.hma-dow { padding: 6px 2px; text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); background: var(--color-surface-2); }
.hma-dow--today { background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface-2)); color: var(--color-text); font-weight: 700; }
.hma-hour { padding: 3px 4px; font-size: 10px; color: var(--color-text-muted); text-align: right; }
.hma-slot { padding: 2px; }
.hma-slot--today { background: color-mix(in srgb, var(--color-accent) 7%, transparent); }
.hma-slot--drop { background: color-mix(in srgb, var(--color-accent) 18%, transparent); outline: 2px dashed var(--color-accent); outline-offset: -2px; display: flex; align-items: flex-end; justify-content: center; font-size: 10px; font-weight: 600; color: var(--color-accent-700); padding-bottom: 3px; }
.hma-side { display: flex; flex-direction: column; gap: 6px; }
.hma-side strong { font-size: 13px; }
.hma-draft { display: flex; gap: 6px; align-items: flex-start; padding: 7px 8px; border: var(--pc-st-draft-border); border-radius: var(--radius-md); background: var(--color-surface); font-size: 11.5px; line-height: 1.3; }
.hma-draft pc-icon { margin-top: 1px; color: var(--color-text-muted); }
.hma-draft--drag { transform: rotate(-2.5deg) translateX(-30px); box-shadow: var(--shadow-md); position: relative; z-index: 2; }

/* Vue mois */
.hma-month { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-lg); overflow: hidden; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.hma-month > * { border-left: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); min-width: 0; }
.hma-month > :nth-child(7n + 1) { border-left: 0; }
.hma-month > :nth-last-child(-n + 7) { border-bottom: 0; }
.hma-month-dow { padding: 6px 2px; text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); background: var(--color-surface-2); }
.hma-day { min-height: 62px; padding: 3px 3px 4px; display: flex; flex-direction: column; gap: 3px; }
.hma-day > b { font-weight: 500; font-size: 11px; text-align: right; padding-right: 3px; }
.hma-day--today > b { align-self: flex-end; background: var(--pc-fill); color: var(--pc-on-fill); border-radius: var(--radius-pill); min-width: 20px; text-align: center; padding: 0 4px; }

/* Éditeur */
.hma-editor { display: flex; flex-direction: column; gap: 10px; }
.hma-label { font-weight: 600; font-size: 13px; }
.hma-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.hma-tool { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); }
.hma-tool--off { opacity: .4; }
.hma-sep { width: 1px; height: 20px; margin-inline: 3px; background: var(--color-divider); }
.hma-textarea { border: 1px solid var(--color-neutral-400); border-radius: var(--radius-md); background: var(--color-surface); padding: 10px 12px; min-height: 104px; font-size: 14px; line-height: 1.5; }
.hma-count { text-align: right; font-size: 12px; color: var(--color-text-muted); }

/* Aperçu façon LinkedIn (identique à celui de l'éditeur) */
.hma-frame { padding: 12px; border-radius: var(--radius-lg); background: var(--color-surface-2); }
.hma-frame-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: block; }
.hma-li { background: #fff; color: #1d2226; border: 1px solid var(--color-divider); border-radius: var(--radius-lg); overflow: hidden; font-family: system-ui, sans-serif; }
[data-theme="dark"] .hm-app .hma-li { background: #1b1f23; color: #e8e8e8; }
.hma-li-head { display: flex; gap: 9px; padding: 10px 12px 4px; align-items: center; }
.hma-li-head > span:last-child { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.hma-li-head small { color: #666; font-size: 11px; }
[data-theme="dark"] .hm-app .hma-li-head small { color: #aaa; }
.hma-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--color-accent-200); color: var(--color-accent-800); flex: none; }
.hma-li-text { padding: 4px 12px 8px; font-size: 13px; line-height: 1.45; }
.hma-more { display: block; text-align: right; padding: 0 12px; color: #0a66c2; text-decoration: underline; font-size: 13px; }
[data-theme="dark"] .hm-app .hma-more { color: #70b5f9; }
.hma-rest { padding: 2px 12px 10px; font-size: 13px; line-height: 1.45; color: #8a8d91; }
.hma-li-foot { display: flex; justify-content: space-around; padding: 7px; border-top: 1px solid var(--color-divider); font-size: 12px; color: #666; }
.hma-li-foot span { display: inline-flex; align-items: center; gap: 5px; }
[data-theme="dark"] .hm-app .hma-li-foot { color: #aaa; }

/* Journal (page Historique) */
.hma-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hma-log li { display: flex; gap: 11px; align-items: flex-start; }
.hma-dot2 { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--color-surface-2); color: var(--color-text-muted); }
.hma-dot2--success { background: var(--pc-success-bg); color: var(--pc-success-fg); }
.hma-dot2--danger { background: var(--pc-danger-bg); color: var(--pc-danger-fg); }
.hma-dot2--info { background: var(--pc-info-bg); color: var(--pc-info-fg); }
.hma-log-main { min-width: 0; font-size: 13.5px; }
.hma-log-msg { color: var(--color-text-muted); font-size: 12.5px; }
.hma-log-msg--error { color: var(--pc-danger-fg); }
.hma-log-date { color: var(--color-text-muted); font-size: 12px; }

@media (max-width: 520px) {
    .hma-layout { grid-template-columns: 1fr; }
    .hma-side { display: none; }
    .hma-seg { margin-left: 0; }
}

/* Éditeur et aperçu superposés, avec une flèche de l'édition vers le post.
   L'éditeur reste dessous (sa barre d'outils reste visible) ; l'aperçu remonte à la moitié de sa hauteur,
   décalé vers la droite. La flèche reprend le magenta de la page (variable --hma-arrow, hors du thème Pro). */
.hma-stack { --hma-arrow: #d6006c; --hma-arrow-dark: #aa0b56; position: relative; display: block; padding-bottom: 6px; }
[data-theme="dark"] .hma-stack { --hma-arrow: #ff6fb2; --hma-arrow-dark: #d6458f; }
.hma-stack .hma-editor { width: 86%; position: relative; z-index: 1; }
.hma-stack .hma-frame { position: relative; z-index: 2; width: 86%; margin: -126px 0 0 auto; box-shadow: var(--shadow-lg); }
/* La flèche est rattachée au bord haut de la carte d'aperçu : elle suit la carte quelle que soit la hauteur de l'éditeur.
   Elle part du bord droit de l'éditeur (83,7 % de la largeur de la carte) et sa pointe touche le haut de la carte. */
.hma-arrow { --arrow-w: 126px; position: absolute; z-index: 3; left: calc(83.72% - 2px); top: calc(var(--arrow-w) * -.72); width: var(--arrow-w); height: calc(var(--arrow-w) * .9206); filter: drop-shadow(0 2px 3px rgb(0 0 0 / .18)); pointer-events: none; }
/* Mobile : même composition, en plus petit (éditeur et aperçu se chevauchent, flèche réduite). */
@media (max-width: 520px) {
    .hma-stack .hma-editor, .hma-stack .hma-frame { width: 84%; }
    .hma-arrow { --arrow-w: 70px; left: calc(81% - 2px); }
    /* Pied de l'aperçu : quatre actions dans moins de 270 px, on garde les libellés et on retire les pictogrammes. */
    .hma-stack .hma-li-foot { padding-inline: 4px; font-size: 11px; }
    .hma-stack .hma-li-foot pc-icon { display: none; }
}
