/**
 * hm-modal — v3 Editorial 톤의 alert/confirm/prompt 대체 모달
 * 의존: 없음 (테마 v3 CSS 변수가 있으면 자동 사용, 없으면 폴백)
 */
#hm-modal-root {
    position: fixed; inset: 0; pointer-events: none; z-index: 99999;
}
#hm-modal-root .hm-modal__backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 14, 12, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    pointer-events: auto;
    animation: hmModalFadeIn 140ms ease-out;
}
@keyframes hmModalFadeIn { from { opacity: 0; } to { opacity: 1; } }

#hm-modal-root .hm-modal__box {
    background: var(--v3-bg-paper, #f7f4ee);
    border: 1px solid var(--v3-fg, #1a1a1a);
    width: 100%; max-width: 460px;
    padding: 32px 32px 24px;
    font-family: var(--v3-sans, system-ui, -apple-system, "Segoe UI", sans-serif);
    color: var(--v3-fg, #1a1a1a);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: hmModalSlideIn 180ms ease-out;
    position: relative;
}
@keyframes hmModalSlideIn {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#hm-modal-root .hm-modal__eyebrow {
    font-family: var(--v3-mono, ui-monospace, "SF Mono", Menlo, monospace);
    font-size: 11px; letter-spacing: 0.20em; text-transform: uppercase;
    color: var(--v3-fg-muted, #6b6b6b);
    margin: 0 0 16px;
    display: flex; align-items: baseline; gap: 10px;
}
#hm-modal-root .hm-modal__eyebrow::before {
    content: ""; width: 24px; height: 1px; background: var(--v3-fg, #1a1a1a); display: inline-block;
}

#hm-modal-root .hm-modal__title {
    font-family: var(--v3-serif, "EB Garamond", Georgia, "Times New Roman", serif);
    font-weight: 700; font-size: 24px; letter-spacing: -0.018em; line-height: 1.25;
    margin: 0 0 12px;
    color: var(--v3-fg, #1a1a1a);
}

#hm-modal-root .hm-modal__body {
    font-size: 15px; line-height: 1.65;
    color: var(--v3-fg, #1a1a1a);
    margin: 0 0 22px;
    white-space: pre-line;
}

#hm-modal-root .hm-modal__input {
    width: 100%;
    padding: 10px 0 8px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--v3-fg, #1a1a1a);
    font-family: inherit;
    font-size: 17px;
    color: var(--v3-fg, #1a1a1a);
    outline: none;
    margin: 0 0 24px;
    transition: border-color 100ms;
}
#hm-modal-root .hm-modal__input::placeholder {
    color: var(--v3-fg-muted, #9a9a9a);
}
#hm-modal-root .hm-modal__input:focus {
    border-bottom-color: var(--v3-accent, #b94720);
}

#hm-modal-root .hm-modal__hint {
    font-family: var(--v3-mono, ui-monospace, monospace);
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--v3-fg-muted, #6b6b6b);
    margin: -16px 0 22px;
}

#hm-modal-root .hm-modal__actions {
    display: flex; gap: 8px; justify-content: flex-end;
    border-top: 1px solid var(--v3-border, #d8d3c8);
    padding-top: 18px;
    margin-top: 4px;
}

#hm-modal-root .hm-modal__btn {
    font-family: var(--v3-mono, ui-monospace, "SF Mono", Menlo, monospace);
    font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
    padding: 11px 20px;
    cursor: pointer;
    border: 1px solid var(--v3-fg, #1a1a1a);
    background: transparent;
    color: var(--v3-fg, #1a1a1a);
    transition: background 90ms ease, color 90ms ease, border-color 90ms ease;
}
#hm-modal-root .hm-modal__btn:hover {
    background: var(--v3-fg, #1a1a1a);
    color: var(--v3-bg-paper, #f7f4ee);
}
#hm-modal-root .hm-modal__btn:focus-visible {
    outline: 2px solid var(--v3-accent, #b94720);
    outline-offset: 2px;
}
#hm-modal-root .hm-modal__btn--solid {
    background: var(--v3-fg, #1a1a1a);
    color: var(--v3-bg-paper, #f7f4ee);
}
#hm-modal-root .hm-modal__btn--solid:hover {
    background: var(--v3-accent, #b94720);
    border-color: var(--v3-accent, #b94720);
}
#hm-modal-root .hm-modal__btn--ghost {
    border-color: var(--v3-border, #d8d3c8);
    color: var(--v3-fg-muted, #6b6b6b);
}
#hm-modal-root .hm-modal__btn--ghost:hover {
    background: var(--v3-border, #d8d3c8);
    color: var(--v3-fg, #1a1a1a);
}

#hm-modal-root .hm-modal__error {
    background: var(--v3-bg-card, #fff);
    border-left: 3px solid var(--v3-accent, #b94720);
}
#hm-modal-root .hm-modal__error .hm-modal__eyebrow {
    color: var(--v3-accent, #b94720);
}
#hm-modal-root .hm-modal__error .hm-modal__eyebrow::before {
    background: var(--v3-accent, #b94720);
}

@media (max-width: 480px) {
    #hm-modal-root .hm-modal__backdrop { padding: 12px; align-items: flex-end; }
    #hm-modal-root .hm-modal__box { padding: 24px 22px 20px; max-width: 100%; }
    #hm-modal-root .hm-modal__title { font-size: 21px; }
    #hm-modal-root .hm-modal__actions { flex-direction: column-reverse; gap: 6px; }
    #hm-modal-root .hm-modal__btn { width: 100%; padding: 14px 20px; }
}
