/* Hangul Match translation context tags v1 */
.hm-context-composer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 14px 0 10px;
}
.hm-context-tags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.hm-context-chip,
.hm-context-add-button {
    appearance: none;
    border: 1px solid #d8eaff;
    background: #f6faff;
    color: #1265b8;
    min-height: 36px;
    border-radius: 999px;
    padding: 7px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}
.hm-context-chip { background: #eaf4ff; border-color: #c7e2ff; }
.hm-context-chip span { margin-left: 7px; color: #7b9ab8; font-weight: 700; }
.hm-context-add-button { display: inline-flex; align-items: center; gap: 7px; background: #fff; color: #52677b; }
.hm-context-add-button:hover, .hm-context-chip:hover { border-color: #329eff; }
.hm-context-add-hash { color: #329eff; font-size: 16px; font-weight: 950; }
.hm-translator-input-panel-context { position: relative; }
.hm-translator-bottom-row-clean { align-items: center; }
.hm-auto-language-note { color: #8a9bad; font-size: 12px; font-weight: 700; }

.hm-context-popover[hidden] { display: none !important; }
.hm-context-popover { position: fixed; inset: 0; z-index: 1600; }
.hm-context-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(16, 35, 54, .18); cursor: default; }
.hm-context-sheet {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid #dceaf7;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(18, 38, 58, .20);
    padding: 22px;
}
.hm-context-sheet-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.hm-context-sheet-kicker { display: block; color: #329eff; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.hm-context-sheet h2 { margin: 4px 0 0; color: #12263a; font-size: 22px; }
.hm-context-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3f7fb; color: #60758a; font-size: 22px; cursor: pointer; }
.hm-context-sheet-lead { margin: 10px 0 18px; color: #718398; font-size: 13px; line-height: 1.6; }
.hm-context-group-list { display: grid; gap: 18px; }
.hm-context-group-label { margin: 0 0 7px; color: #8a9bad; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.hm-context-option-list { overflow: hidden; border: 1px solid #e4edf6; border-radius: 15px; background: #fff; }
.hm-context-option {
    width: 100%;
    min-height: 46px;
    display: grid;
    grid-template-columns: 26px 1fr 24px;
    align-items: center;
    gap: 6px;
    border: 0;
    border-bottom: 1px solid #edf3f8;
    padding: 10px 13px;
    background: #fff;
    color: #26384a;
    text-align: left;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}
.hm-context-option:last-child { border-bottom: 0; }
.hm-context-option:hover { background: #f8fbff; }
.hm-context-option-hash { color: #a4b8ca; font-size: 17px; font-weight: 900; }
.hm-context-option-check { opacity: 0; color: #329eff; font-weight: 950; text-align: right; }
.hm-context-option.is-selected { background: #eef7ff; color: #1265b8; }
.hm-context-option.is-selected .hm-context-option-hash { color: #329eff; }
.hm-context-option.is-selected .hm-context-option-check { opacity: 1; }
.hm-context-sheet-foot { position: sticky; bottom: -22px; display: flex; justify-content: space-between; gap: 10px; margin: 20px -22px -22px; padding: 14px 22px 18px; border-top: 1px solid #edf3f8; background: rgba(255,255,255,.96); }
.hm-context-clear, .hm-context-done { min-height: 42px; border-radius: 12px; padding: 9px 15px; font: inherit; font-size: 13px; font-weight: 850; cursor: pointer; }
.hm-context-clear { border: 1px solid #e1eaf2; background: #fff; color: #6a7c8f; }
.hm-context-done { border: 0; background: #329eff; color: #fff; }
body.hm-context-open { overflow: hidden; }

@media (max-width: 767px) {
    .hm-context-composer { margin: 10px 2px 8px; }
    .hm-context-chip, .hm-context-add-button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
    .hm-auto-language-note { display: none; }
    .hm-context-backdrop { background: rgba(16,35,54,.24); }
    .hm-context-sheet {
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-height: 82vh;
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
        padding: 18px 16px;
        box-shadow: 0 -16px 48px rgba(18,38,58,.16);
    }
    .hm-context-sheet h2 { font-size: 20px; }
    .hm-context-sheet-foot { bottom: -18px; margin: 16px -16px -18px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
}
