/* ============================================================
   ハングルマッチ翻訳 - 結果体験 v1
   既存のフォームCSSを上書きせず、翻訳結果だけを完成させる。
   ============================================================ */

.hm-result-v3 {
    margin-top: 22px;
    padding: 26px;
    border: 1px solid var(--haneul-100);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(18, 101, 184, .09);
}

.hm-result-head-v3 {
    margin-bottom: 18px;
}

.hm-result-head-v3 h2 {
    margin: 4px 0 3px;
    color: var(--ink);
    font-size: 24px;
    line-height: 1.35;
    font-weight: 900;
    letter-spacing: -.02em;
}

.hm-result-direction {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.hm-result-action {
    min-height: 38px;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 12px;
}

.hm-result-action-primary {
    background: var(--haneul-50);
}

.hm-result-source-section,
.hm-ocr-section {
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid #e5edf5;
    border-radius: 12px;
    background: #f8fbff;
}

.hm-result-source-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.hm-result-source-type {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 800;
}

.hm-result-source-section p,
.hm-ocr-section p {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.hm-result-primary-v3 {
    padding: 22px 22px 24px;
    border: 1px solid var(--haneul-100);
    border-left: 5px solid var(--haneul);
    border-radius: 14px;
    background: #fff;
}

.hm-result-primary-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 7px;
}

.hm-result-primary-head .hm-result-label {
    margin-bottom: 0;
}

.hm-result-translation {
    font-size: clamp(25px, 2.7vw, 34px);
    line-height: 1.55;
}

.hm-result-speak,
.hm-mini-action {
    border: 1px solid var(--haneul-100);
    background: var(--haneul-50);
    color: var(--bada);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.hm-result-speak:hover,
.hm-mini-action:hover {
    border-color: var(--haneul);
}

.hm-result-grid-v3 {
    gap: 10px;
    padding: 12px 0;
}

.hm-result-panel {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
    padding: 16px;
    border-radius: 12px;
    background: #fff;
}

.hm-result-panel-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--haneul-50);
    color: var(--bada);
    font-size: 12px;
    font-weight: 900;
}

.hm-result-panel-nuance .hm-result-panel-icon {
    background: #fff4eb;
    color: var(--gyul-dark);
}

.hm-result-panel p {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.75;
}

.hm-result-label {
    margin-bottom: 5px;
    font-size: 11px;
    letter-spacing: .03em;
}

.hm-result-tone {
    margin-bottom: 12px;
    padding: 14px 16px 16px;
    border: 1px solid var(--haneul-100);
    border-radius: 12px;
    background: var(--haneul-50);
}

.hm-result-tone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.hm-result-tone-head .hm-result-label {
    margin: 0;
}

.hm-result-tone-head small {
    color: var(--ink-soft);
    font-size: 10px;
}

.hm-result-tone-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.hm-result-tone-item {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid rgba(50,158,255,.14);
    border-radius: 10px;
    background: #fff;
}

.hm-result-tone-item > small {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 700;
}

.hm-result-tone-item > strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.hm-result-address-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hm-result-address-terms span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--haneul-50);
    color: var(--bada);
    font-size: 11px;
    font-weight: 850;
}

.hm-linking-box-v3 {
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 15px 16px;
    border-color: #ffd9bf;
    background: #fff9f4;
}

.hm-linking-box-v3 strong {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-size: 14px;
}

.hm-linking-box-v3 p {
    font-size: 11px;
    line-height: 1.6;
}

.hm-details-v3 {
    padding-top: 0;
    border-top: 0;
    border: 1px solid var(--haneul-100);
    border-radius: 12px;
    overflow: hidden;
}

.hm-details-v3 > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    list-style: none;
}

.hm-details-v3 > summary::-webkit-details-marker {
    display: none;
}

.hm-details-v3 > summary::after {
    content: '＋';
    color: var(--haneul);
    font-size: 18px;
    font-weight: 700;
}

.hm-details-v3[open] > summary::after {
    content: '−';
}

.hm-details-v3 > summary small {
    margin-left: auto;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 700;
}

.hm-details-content-v3 {
    gap: 0;
    padding: 0 16px 4px;
    background: #fff;
}

.hm-detail-block {
    padding: 18px 0;
    border-top: 1px solid #edf2f7;
}

.hm-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.hm-detail-no {
    flex: 0 0 auto;
    color: var(--haneul);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.hm-detail-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
}

.hm-detail-head p {
    margin: 2px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
}

.hm-word-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.hm-word-result-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--haneul-100);
    border-radius: 11px;
    background: #fff;
}

.hm-word-result-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.hm-word-result-surface {
    color: var(--ink);
    font-size: 17px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.hm-word-result-pos {
    flex: 0 0 auto;
    color: var(--bada);
    font-size: 9px;
    font-weight: 850;
}

.hm-word-result-meaning {
    margin: 4px 0 5px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.55;
}

.hm-word-result-meta {
    color: var(--ink-soft);
    font-size: 10px;
}

.hm-grammar-result-list,
.hm-alternative-result-list {
    display: grid;
    gap: 8px;
}

.hm-grammar-result-card,
.hm-alternative-result-card {
    padding: 12px 13px;
    border: 1px solid var(--haneul-100);
    border-radius: 11px;
    background: #fff;
}

.hm-grammar-result-card strong,
.hm-alternative-result-card strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
}

.hm-grammar-result-card span,
.hm-alternative-result-card p {
    display: block;
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.65;
}

.hm-alternative-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.hm-alternative-label {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--bada);
    font-size: 10px;
    font-weight: 900;
}

.hm-alternative-result-actions {
    display: flex;
    gap: 5px;
}

.hm-alt-action {
    border: 1px solid var(--haneul-100);
    background: #fff;
    color: var(--bada);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

.hm-alt-action-use {
    border-color: #ffd9bf;
    background: #fff7f1;
    color: var(--gyul-dark);
}

.hm-pronunciation-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 11px;
    background: var(--haneul-50);
}

.hm-pronunciation-result p {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.65;
}

.hm-result-empty-detail {
    padding: 10px 0;
    color: var(--ink-soft);
    font-size: 11px;
}

@media (max-width: 720px) {
    .hm-result-v3 {
        margin-top: 16px;
        padding: 18px 14px;
        border-radius: 16px;
    }

    .hm-result-head-v3 {
        gap: 10px;
    }

    .hm-result-head-v3 h2 {
        font-size: 20px;
    }

    .hm-result-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .hm-result-action {
        min-height: 36px;
        font-size: 11px;
    }

    .hm-result-primary-v3 {
        padding: 18px 16px 20px;
    }

    .hm-result-translation {
        font-size: 23px;
        line-height: 1.6;
    }

    .hm-result-grid-v3,
    .hm-result-tone-grid,
    .hm-word-result-grid {
        grid-template-columns: 1fr;
    }

    .hm-result-panel p,
    .hm-result-source-section p,
    .hm-ocr-section p {
        font-size: 14px;
    }

    .hm-result-tone-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .hm-linking-box-v3 {
        flex-direction: column;
    }

    .hm-details-v3 > summary {
        align-items: flex-start;
        padding: 14px;
    }

    .hm-details-v3 > summary small {
        display: none;
    }

    .hm-details-content-v3 {
        padding: 0 14px 4px;
    }

    .hm-alternative-result-card {
        grid-template-columns: 1fr;
    }

    .hm-alternative-result-actions {
        justify-content: flex-start;
    }

    .hm-pronunciation-result {
        align-items: flex-start;
        flex-direction: column;
    }
}
