.unified-word-card {
    --word-card-scene-height: clamp(430px, 56vh, 520px);
    container-type: inline-size;
    width: 100%;
    max-width: 100%;
    max-inline-size: 56.25rem;
    margin-inline: auto;
    color: var(--text-primary, #24332d);
    background: #fff;
    border: 1px solid rgba(74, 101, 88, 0.12);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(45, 70, 58, 0.12);
    overflow-x: hidden;
    outline: none;
}

.unified-word-card *,
.unified-word-card *::before,
.unified-word-card *::after {
    box-sizing: border-box;
}

.unified-word-card button {
    font: inherit;
}

.unified-word-card:focus-visible {
    box-shadow: 0 18px 48px rgba(45, 70, 58, 0.12), 0 0 0 3px rgba(76, 139, 104, 0.26);
}

.unified-word-card__notice {
    position: relative;
    z-index: 4;
    margin: 14px 18px -4px;
    padding: 9px 13px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.unified-word-card__notice--loading {
    color: #486158;
    background: #edf5f0;
}

.unified-word-card__notice--error {
    color: #9b3f3f;
    background: #fff0ee;
    border: 1px solid #f2d0cb;
}

.unified-word-card__scene {
    min-height: var(--word-card-scene-height);
    perspective: 1200px;
}

.unified-word-card__inner {
    position: relative;
    width: 100%;
    min-height: inherit;
    transform-style: preserve-3d;
    transition: transform 420ms cubic-bezier(0.22, 0.78, 0.32, 1);
}

.unified-word-card.is-flipped .unified-word-card__inner {
    transform: rotateY(180deg);
}

.unified-word-card__face {
    position: absolute;
    inset: 0;
    width: 100%;
    min-width: 0;
    min-height: var(--word-card-scene-height);
    overflow: hidden;
    background: #fff;
    backface-visibility: hidden;
}

.unified-word-card__face[aria-hidden="true"] {
    pointer-events: none;
}

.unified-word-card__face--back {
    transform: rotateY(180deg);
}

.unified-word-card__face--front {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.unified-word-card__front-content {
    display: flex;
    min-height: var(--word-card-scene-height);
    padding: clamp(28px, 5cqi, 52px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: clamp(14px, 2.4cqi, 22px);
    text-align: center;
    background: linear-gradient(145deg, #f4f7f4 0%, #fbfcfa 56%, #f3f7f1 100%);
}

.unified-word-card__back-scroll {
    height: var(--word-card-scene-height);
    min-height: var(--word-card-scene-height);
    max-height: var(--word-card-scene-height);
    padding: clamp(26px, 4cqi, 42px) clamp(24px, 5cqi, 52px);
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    text-align: left;
    scrollbar-gutter: stable;
}

/* Kept for older embedded card layouts that still use this selector. */
.unified-word-card__layout {
    display: grid;
    grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.45fr);
}

.unified-word-card__media {
    position: relative;
    width: min(100%, 320px);
    aspect-ratio: 32 / 19;
    flex: none;
    overflow: hidden;
    background: #eef3ee;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(45, 70, 58, 0.1);
}

.unified-word-card__media-stage,
.unified-word-card__media-figure {
    width: 100%;
    height: 100%;
    margin: 0;
}

.unified-word-card__media-figure {
    position: relative;
    display: grid;
    overflow: hidden;
    background: #eef3ee;
}

.unified-word-card__media-figure > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background: #eef3ee;
    object-fit: contain;
}

.unified-word-card__media-figure figcaption {
    position: absolute;
    right: 10px;
    bottom: 8px;
    max-width: calc(100% - 20px);
    padding: 4px 8px;
    overflow: hidden;
    color: #fff;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(28, 42, 35, 0.58);
    border-radius: 7px;
}

.unified-word-card__media-error {
    display: none;
    width: 100%;
    height: 100%;
    padding: 18px;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #718078;
    text-align: center;
    background: #eef3ee;
}

.unified-word-card__media-error img {
    width: min(100%, 230px);
    max-height: 120px;
    object-fit: contain;
    border-radius: 10px;
}

.unified-word-card__media-figure.is-error > img,
.unified-word-card__media-figure.is-error > figcaption {
    display: none;
}

.unified-word-card__media-figure.is-error .unified-word-card__media-error {
    display: grid;
}

.unified-word-card__media-stage > .unified-word-card__image-placeholder,
.unified-word-card__media-empty {
    display: grid;
    width: 100%;
    height: 100%;
    padding: 20px;
    place-items: center;
    align-content: center;
    gap: 6px;
    color: #718078;
    text-align: center;
    background: #eef3ee;
}

.unified-word-card__image-placeholder strong {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    color: #fff;
    font-family: Lora, Georgia, serif;
    font-size: 2rem;
    background: #4c8b68;
    border-radius: 50%;
}

.unified-word-card__image-placeholder span {
    color: #2b3b33;
    font-family: Lora, Georgia, serif;
    font-weight: 700;
}

.unified-word-card__identity {
    width: 100%;
}

.unified-word-card__word-line,
.unified-word-card__example-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.unified-word-card__word-line {
    flex-wrap: wrap;
}

.unified-word-card__front-content .unified-word-card__word-line {
    justify-content: center;
}

.unified-word-card__word-line > div:first-child {
    flex: 1 1 12rem;
    min-width: 0;
}

.unified-word-card__identity h2 {
    margin: 0;
    color: #24332d;
    font-family: Lora, Georgia, serif;
    font-size: clamp(2rem, 8cqi, 4.4rem);
    font-weight: 600;
    line-height: 1.05;
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
}

.unified-word-card__back-scroll .unified-word-card__identity h2 {
    font-size: clamp(2rem, 6cqi, 3.4rem);
}

.unified-word-card__answer {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 14px;
}

.unified-word-card__answer-head .unified-word-card__word-line {
    align-items: center;
    flex-wrap: nowrap;
}

.unified-word-card__answer-head .unified-word-card__word-line > div:first-child {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px 12px;
}

.unified-word-card__answer-head .unified-word-card__phonetic {
    margin: 0;
}

.unified-word-card__phonetic {
    margin: 8px 0 0;
    color: #6f7c75;
    font-size: clamp(0.95rem, 2.5cqi, 1.15rem);
}

.unified-word-card__pronunciation {
    display: flex;
    flex: none;
}

.unified-word-card__example-line button,
.unified-word-card__front-example button,
.unified-word-card__switch,
.unified-word-card__community {
    min-height: 34px;
    padding: 5px 12px;
}

.unified-word-card__audio-icon,
.unified-word-card__example-line button,
.unified-word-card__front-example button,
.unified-word-card__switch,
.unified-word-card__community {
    color: #397454;
    background: #edf5f0;
    border: 1px solid #d5e7dc;
    border-radius: 999px;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.unified-word-card__audio-icon {
    display: grid;
    width: 40px;
    height: 40px;
    padding: 9px;
    place-items: center;
}

.unified-word-card__audio-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    fill: currentColor;
}

.unified-word-card__audio-icon path + path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.unified-word-card__front-example {
    display: grid;
    width: min(100%, 44rem);
    max-width: 44rem;
    gap: 9px;
    padding: 15px 17px;
    text-align: left;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dfe9e2;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(45, 70, 58, 0.06);
}

.unified-word-card__front-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.unified-word-card__front-section-head > strong {
    color: #397454;
    font-size: 0.92rem;
}

.unified-word-card__front-section-head > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.unified-word-card__front-example-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.unified-word-card__answer-example-content {
    display: grid;
    grid-template-columns: minmax(7rem, 0.35fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.unified-word-card__front-example-body.is-single {
    grid-template-columns: 1fr;
}

.unified-word-card__front-example-copy {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.unified-word-card__example-sense {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 9px 10px;
    color: #315f46;
    background: #edf5f0;
    border-radius: 11px;
    overflow-wrap: anywhere;
}

.unified-word-card__example-sense span {
    width: fit-content;
    padding: 2px 7px;
    color: #397454;
    background: #fff;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.unified-word-card__example-sense strong {
    font-size: 0.9rem;
    line-height: 1.45;
}

.unified-word-card__front-method {
    display: grid;
    width: min(100%, 44rem);
    gap: 9px;
    padding: 15px 17px;
    color: #5f4b35;
    text-align: left;
    background: linear-gradient(135deg, #fffaf2, #fffdf8);
    border: 1px solid #f0dcc3;
    border-radius: 15px;
}

.unified-word-card__front-method .unified-word-card__front-section-head > strong {
    color: #b56724;
}

.unified-word-card__front-method .unified-word-card__community {
    color: #b56724;
    background: #fff;
    border-color: #e8c49f;
}

.unified-word-card__front-method p {
    margin: 0;
    font-size: clamp(0.98rem, 2.4cqi, 1.15rem);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.unified-word-card__front-example p,
.unified-word-card__answer-example p {
    margin: 0;
    color: #40534a;
    font-family: Lora, Georgia, serif;
    font-size: clamp(1.05rem, 3cqi, 1.4rem);
    line-height: 1.65;
}

.unified-word-card__front-example .unified-word-card__front-translation {
    color: #718078;
    font-family: inherit;
    font-size: 0.92rem;
}

.unified-word-card__target {
    padding: 0 0.18em;
    color: inherit;
    background: #dff2e4;
    border-radius: 0.25em;
}

.unified-word-card__flip-hint {
    margin: 2px 0 0;
    color: #75837b;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.unified-word-card__answer-meaning,
.unified-word-card__answer-method,
.unified-word-card__answer-example {
    min-width: 0;
    overflow-wrap: anywhere;
}

.unified-word-card__meaning-list {
    display: grid;
    gap: 6px;
}

.unified-word-card__meaning {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

.unified-word-card__meaning span,
.unified-word-card__answer-method-head span {
    padding: 2px 8px;
    color: #397454;
    background: rgba(255, 255, 255, 0.74);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.unified-word-card__meaning p,
.unified-word-card__answer-method p,
.unified-word-card__example-line p,
.unified-word-card__translation,
.unified-word-card__empty,
.unified-word-card__answer-relations p {
    margin: 0;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.unified-word-card__answer-method {
    padding: 16px;
    background: #edf5f0;
    border-radius: 14px;
}

.unified-word-card__answer-method-head,
.unified-word-card__answer-method-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.unified-word-card__answer-method-head {
    justify-content: space-between;
    margin-bottom: 8px;
    color: #315f46;
}

.unified-word-card__answer-method-copy > strong {
    display: block;
    margin-bottom: 3px;
}

.unified-word-card__answer-method-actions {
    margin-top: 10px;
}

.unified-word-card__answer-relations {
    margin-top: 10px;
    padding-top: 9px;
    color: #4d6257;
    border-top: 1px solid rgba(76, 139, 104, 0.18);
}

.unified-word-card__answer-relations summary {
    width: fit-content;
    color: #397454;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
}

.unified-word-card__answer-relations > div {
    display: grid;
    gap: 5px;
    padding-top: 7px;
}

.unified-word-card__warning {
    display: block;
    margin-top: 8px;
    color: #b56d25;
    font-weight: 700;
}

.unified-word-card__switch,
.unified-word-card__community {
    margin: 0;
    background: rgba(255, 255, 255, 0.72);
}

.unified-word-card__community {
    color: #397454;
    border-color: #cfe2d6;
}

.unified-word-card__answer-example {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.unified-word-card__answer-example-item + .unified-word-card__answer-example-item {
    padding-top: 10px;
    border-top: 1px solid #e8eee9;
}

.unified-word-card__translation {
    margin-top: 3px;
    color: #65736c;
    font-family: inherit;
    font-size: 0.96rem;
}

.unified-word-card__answer-example-item > small {
    display: block;
    margin-top: 4px;
    color: #7a8780;
}

.unified-word-card__empty {
    color: #7a8780;
}

.unified-word-card button:not(:disabled):hover {
    transform: translateY(-1px);
}

.unified-word-card button:focus-visible {
    outline: 3px solid rgba(76, 139, 104, 0.28);
    outline-offset: 2px;
}

@container (max-width: 420px) {
    .unified-word-card__layout {
        grid-template-columns: 1fr;
    }
}

@container (max-width: 520px) {
    .unified-word-card__front-example-body {
        grid-template-columns: 1fr;
    }

    .unified-word-card__answer-example-content {
        grid-template-columns: 1fr;
    }

    .unified-word-card__example-sense {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }
}

@container (min-width: 680px) {
    .unified-word-card__front-content {
        display: grid;
        grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.35fr);
        grid-template-areas:
            "media identity"
            "media example"
            "method method"
            "hint hint";
        align-content: center;
        align-items: center;
        column-gap: 28px;
        row-gap: 14px;
        padding: 24px 30px;
        text-align: left;
    }

    .unified-word-card__front-content .unified-word-card__media {
        grid-area: media;
        justify-self: center;
    }

    .unified-word-card__front-content .unified-word-card__identity {
        grid-area: identity;
        align-self: end;
    }

    .unified-word-card__front-content .unified-word-card__word-line {
        justify-content: flex-start;
    }

    .unified-word-card__front-content .unified-word-card__front-example {
        grid-area: example;
        align-self: start;
    }

    .unified-word-card__front-content .unified-word-card__front-method {
        grid-area: method;
        width: 100%;
        max-width: none;
    }

    .unified-word-card__front-content .unified-word-card__flip-hint {
        grid-area: hint;
        text-align: center;
    }
}

@media (max-width: 760px) {
    .unified-word-card__back-scroll {
        padding: 26px 24px;
    }

    .unified-word-card__front-content {
        padding: 28px 22px;
    }

    .unified-word-card__media {
        max-height: 190px;
    }
}

@media (max-width: 480px) {
    .unified-word-card {
        --word-card-scene-height: clamp(480px, 68svh, 540px);
        border-radius: 16px;
    }

    .unified-word-card__back-scroll {
        padding: 20px 16px;
        scrollbar-gutter: auto;
    }

    .unified-word-card__front-content {
        padding: 24px 16px;
        gap: 18px;
    }

    .unified-word-card__media {
        max-height: 168px;
    }

    .unified-word-card__example-line {
        align-items: stretch;
        flex-direction: column;
    }

    .unified-word-card__front-section-head {
        align-items: flex-start;
    }

    .unified-word-card__identity .unified-word-card__word {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .unified-word-card__front-content .unified-word-card__pronunciation {
        align-self: center;
    }

    .unified-word-card__answer {
        gap: 12px;
    }

    .unified-word-card__audio-icon {
        width: 44px;
        height: 44px;
    }

    .unified-word-card__answer-method-actions button,
    .unified-word-card__example-line button {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .unified-word-card,
    .unified-word-card *,
    .unified-word-card *::before,
    .unified-word-card *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

}
