/* Hametoo interactions — interface native, isolée du thème. */
:root {
    --hmi-black: #111111;
    --hmi-muted: #737373;
    --hmi-line: #e7e7e7;
    --hmi-soft: #f4f4f4;
    --hmi-danger: #e32636;
}

body.hmi-comments-open { overflow: hidden !important; }

.hametoo-interactions,
.hametoo-interactions * { box-sizing: border-box; }

.hametoo-interactions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 15px 12px;
    padding: 12px 0 10px;
    border-top: 1px solid var(--hmi-line);
    font-family: inherit;
}

.hametoo-interactions__icons { display: flex; align-items: center; gap: 18px; }
.hametoo-interactions__action {
    appearance: none; border: 0; padding: 0; background: transparent;
    color: var(--hmi-black); cursor: pointer; font: inherit;
}
.hametoo-interactions__bubble {
    min-width: 42px; height: 42px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border-radius: 999px; background: #f1f1f1;
}
.hametoo-interactions__action.is-active .hametoo-interactions__bubble { background: var(--hmi-black); color: #fff; }
.hametoo-interactions__heart,
.hametoo-interactions__icon { width: 22px; height: 22px; display: block; }
.hametoo-interactions__heart { fill: none; stroke: currentColor; stroke-width: 1.9; }
.hametoo-interactions__heart-filled { display: none; }
.hametoo-interactions__action.is-active .hametoo-interactions__heart-outline { display: none; }
.hametoo-interactions__action.is-active .hametoo-interactions__heart-filled { display: block; }
.hametoo-interactions__count { font-size: 13px; font-weight: 600; line-height: 1; }
.hametoo-interactions__reactors { display: none; align-items: center; cursor: pointer; }
.hametoo-interactions__reactors.is-visible { display: flex; }
.hametoo-interactions__reactor { width: 27px; height: 27px; margin-left: -7px; border: 2px solid #fff; border-radius: 50%; overflow: hidden; }
.hametoo-interactions__reactor:first-child { margin-left: 0; }
.hametoo-interactions__reactor img { width: 100%; height: 100%; object-fit: cover; }

/* Fenêtre des commentaires */
.hametoo-comments-modal {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; justify-content: flex-end;
    background: rgba(0, 0, 0, .42);
    font-family: inherit; color: var(--hmi-black);
}
.hametoo-comments-modal * { box-sizing: border-box; }
.hametoo-comments-modal__panel {
    width: min(480px, 100%); height: 100dvh;
    display: grid; grid-template-rows: auto minmax(0, 1fr);
    background: #fff; box-shadow: -10px 0 40px rgba(0,0,0,.14);
    animation: hmi-panel-in .22s ease-out both;
}
@keyframes hmi-panel-in { from { transform: translateX(24px); opacity: .7; } to { transform: none; opacity: 1; } }
.hametoo-comments-modal__header {
    min-height: 64px; padding: 0 20px;
    display: flex; align-items: center; justify-content: center;
    position: relative; border-bottom: 1px solid var(--hmi-line); background: #fff;
}
.hametoo-comments-modal__header strong { font-size: 17px; font-weight: 600; }
.hametoo-comments-modal__header strong span { color: var(--hmi-muted); font-size: 13px; font-weight: 500; }
.hametoo-comments-modal__header button {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border: 0; border-radius: 50%;
    background: var(--hmi-soft); color: var(--hmi-black); font-size: 27px; line-height: 1; cursor: pointer;
}
.hametoo-comments-modal__body { min-height: 0; overflow: hidden; background: #fff; }
.hametoo-interactions-comments-content,
.comments-popup-container,
.hametoo-comments-popup,
.hametoo-comments,
.hametoo-comments__inner { height: 100%; min-height: 0; }
.hametoo-comments__inner { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.hametoo-comments__list {
    overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 18px 26px; scrollbar-width: none;
}
.hametoo-comments__list::-webkit-scrollbar { width: 0; height: 0; }
.hametoo-comments__empty,
.hametoo-comments__disabled,
.hametoo-comments__login { padding: 46px 20px; text-align: center; color: var(--hmi-muted); font-size: 14px; }

/* Un commentaire */
.hametoo-comment {
    position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 30px;
    align-items: start; gap: 10px; padding: 0 0 20px;
}
.hametoo-comment__avatar { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: var(--hmi-soft); }
.hametoo-comment__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hametoo-comment__body { min-width: 0; }
.hametoo-comment__author { margin: 1px 0 3px; font-size: 13px; line-height: 1.35; font-weight: 600; }
.hametoo-comment__content { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.hametoo-comment__content p { margin: 0; }
.hametoo-comment__meta { display: flex; align-items: center; gap: 15px; margin-top: 7px; color: var(--hmi-muted); font-size: 12px; }
.hametoo-comment__meta button { appearance: none; border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.hametoo-comment__like { display: inline-flex; align-items: center; gap: 4px; }
.hametoo-comment__like svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.hametoo-comment__like.is-active { color: var(--hmi-danger); }
.hametoo-comment__like.is-active svg { fill: currentColor; stroke: currentColor; }
.hametoo-comment__reply { font-weight: 600 !important; color: #555 !important; }
.hametoo-comment__menu { position: relative; }
.hametoo-comment__more {
    width: 30px; height: 30px; border: 0; background: transparent;
    font-size: 20px; line-height: 1; letter-spacing: 1px; cursor: pointer;
}
.hametoo-comment__dropdown {
    position: absolute; right: 0; top: 30px; z-index: 20; width: 150px;
    padding: 6px; border: 1px solid var(--hmi-line); border-radius: 12px;
    background: #fff; box-shadow: 0 14px 32px rgba(0,0,0,.14);
}
.hametoo-comment__dropdown button {
    width: 100%; min-height: 40px; display: flex; align-items: center; gap: 9px;
    border: 0; border-radius: 8px; padding: 0 10px; background: #fff;
    color: var(--hmi-black); font: 500 13px/1 inherit; cursor: pointer;
}
.hametoo-comment__dropdown button:hover { background: var(--hmi-soft); }
.hametoo-comment__dropdown .is-danger { color: var(--hmi-danger); }
.hametoo-comment-replies { margin-left: 50px; }
.hametoo-comment--reply { grid-template-columns: 34px minmax(0, 1fr) 28px; padding-bottom: 16px; }
.hametoo-comment--reply .hametoo-comment__avatar { width: 34px; height: 34px; }
.hametoo-comment__voice audio { width: min(280px, 100%); height: 36px; margin-top: 5px; }

/* Saisie fixe en bas */
.hametoo-comment-form {
    display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: end; gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--hmi-line); background: #fff;
}
.hametoo-comment-form__avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; }
.hametoo-comment-form__avatar img { width: 100%; height: 100%; object-fit: cover; }
.hametoo-comment-form__input { position: relative; min-width: 0; }
.hametoo-comment-form textarea {
    width: 100%; min-height: 44px; max-height: 120px; resize: none;
    display: block; padding: 11px 82px 10px 15px;
    border: 1px solid #dedede; border-radius: 22px; outline: none;
    background: #f5f5f5; color: var(--hmi-black); font: 400 14px/1.45 inherit;
}
.hametoo-comment-form textarea:focus { border-color: #bdbdbd; box-shadow: none; background: #fff; }
.hametoo-comment-submit,
.hametoo-voice-record {
    position: absolute; bottom: 7px; width: 30px; height: 30px;
    display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.hametoo-voice-record { right: 40px; }
.hametoo-comment-submit { right: 7px; background: var(--hmi-black); }
.hametoo-comment-submit img,
.hametoo-voice-record img { width: 17px; height: 17px; object-fit: contain; }
.hametoo-comment-submit img { filter: brightness(0) invert(1); }
.hametoo-voice-record.is-recording {
    background: #e53935;
    color: #fff;
    z-index: 3;
}
.hametoo-voice-record.is-requesting {
    background: #f1e8f8;
    box-shadow: 0 0 0 4px rgba(92, 35, 126, .12);
    animation: hametoo-mic-wait .8s ease-in-out infinite alternate;
}
@keyframes hametoo-mic-wait {
    to { transform: scale(.9); opacity: .68; }
}
.hametoo-voice-record.is-recording img { display: none; }
.hametoo-voice-record.is-recording::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: #fff;
}
.hametoo-voice-recording-status {
    position: absolute;
    right: 76px;
    bottom: 12px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fff;
    color: #e53935;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: none;
}
.hametoo-comment-form__replying { margin: 0 4px 7px; color: var(--hmi-muted); font-size: 12px; }
.hametoo-comment-form__replying button { border: 0; background: none; cursor: pointer; }
.hametoo-voice-preview { margin-bottom: 7px; display: flex; align-items: center; gap: 5px; }
.hametoo-voice-preview[hidden], .hametoo-voice-recording-status[hidden] { display: none !important; }
.hametoo-voice-preview audio { width: 100%; height: 36px; }
.hametoo-voice-preview button { border: 0; background: none; font-size: 20px; }
.hametoo-comment-form.has-voice textarea,
.hametoo-comment-form.has-voice > .hametoo-comment-form__input > .hametoo-voice-record,
.hametoo-comment-form.has-voice .hametoo-comment-submit { display: none !important; }
.hametoo-comment-form.has-voice .hametoo-voice-preview { display: flex !important; flex-direction: column; align-items: stretch; gap: 10px; margin: 0; }
.hametoo-voice-preview > audio { display: none; }
.hametoo-voice-preview__player { display: flex; align-items: center; gap: 10px; }
.hametoo-voice-preview__play { width: 38px; height: 38px; border-radius: 50% !important; background: #111 !important; color: #fff; }
.hametoo-voice-preview__wave { display: flex; flex: 1; align-items: center; gap: 2px; height: 34px; overflow: hidden; }
.hametoo-voice-preview__wave i { width: 3px; height: 12px; flex: 0 0 3px; border-radius: 4px; background: #d1d5db; }
.hametoo-voice-preview__wave i:nth-child(4n+1) { height: 20px; }
.hametoo-voice-preview__wave i:nth-child(4n+2) { height: 29px; }
.hametoo-voice-preview__wave i.is-played { background: #111; }
.hametoo-voice-preview__duration { font-size: 13px; white-space: nowrap; }
.hametoo-voice-preview__actions { display: grid; grid-template-columns: 40px minmax(110px, 1fr) 42px; align-items: center; gap: 10px; }
.hametoo-voice-preview__delete { width: 38px; height: 38px; border-radius: 50% !important; background: #fff1f4 !important; color: #e11d48; }
.hametoo-voice-retake { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px !important; background: #f2f0f0 !important; font-size: 14px !important; }
.hametoo-voice-retake img { width: 18px; height: 18px; }
.hametoo-voice-preview__send { width: 42px; height: 42px; border-radius: 50% !important; background: #111 !important; }
.hametoo-voice-preview__send img { width: 20px; height: 20px; filter: invert(1); }
.hametoo-comment-form.is-recording textarea { color: transparent; }
.hametoo-comment-form.is-recording .hametoo-voice-record img { display: none; }
.hametoo-voice-stop-icon { display: none; width: 10px; height: 10px; border-radius: 2px; background: #fff; }
.hametoo-comment-form.is-recording .hametoo-voice-stop-icon { display: block; }

.hametoo-comment-edit-form textarea { width: 100%; min-height: 72px; padding: 10px; border: 1px solid var(--hmi-line); border-radius: 10px; font: 400 14px/1.45 inherit; }
.hametoo-comment-edit-form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.hametoo-comment-edit-form__actions button { min-height: 34px; padding: 0 13px; border: 1px solid var(--hmi-line); border-radius: 999px; background: #fff; font-size: 12px; }
.hametoo-comment-edit-form__actions [data-hametoo-comment-save] { background: var(--hmi-black); color: #fff; border-color: var(--hmi-black); }

/* Personnes qui aiment */
.hametoo-reactors-popup { position: fixed; left: 50%; top: 50%; z-index: 2147483001; transform: translate(-50%,-50%); width: min(420px, calc(100% - 28px)); max-height: 70dvh; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.28); overflow: hidden; }
.hametoo-reactors-popup__header { min-height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--hmi-line); }
.hametoo-reactors-popup__close { border: 0; background: transparent; font-size: 26px; cursor: pointer; }
.hametoo-reactors-popup__body { max-height: calc(70dvh - 58px); overflow: auto; padding: 8px; }
.hametoo-reactors-popup__user { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 7px 10px; border-radius: 10px; color: var(--hmi-black); text-decoration: none; }
.hametoo-reactors-popup__user:hover { background: var(--hmi-soft); }
.hametoo-reactors-popup__user img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }

@media (max-width: 767px) {
    .hametoo-comments-modal { align-items: flex-end; background: rgba(0,0,0,.48); }
    .hametoo-comments-modal__panel {
        width: 100%; height: min(88dvh, 760px); border-radius: 18px 18px 0 0;
        box-shadow: 0 -12px 34px rgba(0,0,0,.18);
        animation-name: hmi-sheet-in;
    }
    @keyframes hmi-sheet-in { from { transform: translateY(28px); opacity: .7; } to { transform: none; opacity: 1; } }
    .hametoo-comments-modal__header { min-height: 56px; }
    .hametoo-comments-modal__header:before {
        content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
        width: 42px; height: 4px; border-radius: 99px; background: #d6d6d6;
    }
    .hametoo-comments-modal__header strong { padding-top: 5px; font-size: 15px; }
    .hametoo-comments-modal__header button { width: 34px; height: 34px; right: 10px; font-size: 23px; }
    .hametoo-comments__list { padding: 15px 13px 22px; }
    .hametoo-comment { grid-template-columns: 38px minmax(0,1fr) 26px; gap: 9px; padding-bottom: 18px; }
    .hametoo-comment__avatar { width: 38px; height: 38px; }
    .hametoo-comment-replies { margin-left: 44px; }
    .hametoo-comment-form { grid-template-columns: 34px minmax(0,1fr); padding: 9px 10px calc(9px + env(safe-area-inset-bottom,0px)); }
    .hametoo-comment-form__avatar { width: 34px; height: 34px; }
    .hametoo-comment-form textarea { min-height: 42px; }
    .hametoo-interactions { margin-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .hametoo-comments-modal__panel { animation: none; }
}
