.flashcard-page {
    --fc-green: #0d7a45;
    --fc-green-dark: #105536;
    --fc-ink: #243b2e;
    --fc-muted: #6f7e75;
    --fc-line: rgba(36, 59, 46, 0.12);
    --fc-paper: #ffffff;
    --fc-tint: #e9f8ee;
    --fc-strong: #1aa35e;
    --fc-warm: #fff5d7;
    min-height: 100vh;
    background: #f5fbf3;
}

.flashcard-page button,
.flashcard-page input {
    font: inherit;
}

.flashcard-main {
    min-height: 70vh;
}

.flashcard-hero {
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(13, 122, 69, 0.08);
    border-bottom: 1px solid rgba(13, 122, 69, 0.08);
    background:
        radial-gradient(circle at 13% 28%, rgba(140, 198, 63, 0.18) 0 3px, transparent 4px),
        radial-gradient(circle at 84% 22%, rgba(237, 30, 121, 0.12) 0 4px, transparent 5px),
        linear-gradient(135deg, #e7f8dd 0%, #f7fff2 48%, #fff6d7 100%);
}

.flashcard-hero::before,
.flashcard-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.flashcard-hero::before {
    width: 340px;
    height: 340px;
    top: -230px;
    left: 34%;
    border: 55px solid rgba(255, 255, 255, 0.5);
}

.flashcard-hero::after {
    width: 170px;
    height: 170px;
    right: -70px;
    bottom: -90px;
    background: rgba(255, 255, 255, 0.5);
}

.flashcard-hero__inner {
    position: relative;
    z-index: 1;
    min-height: 290px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.7fr);
    align-items: center;
    gap: 2rem;
    padding-top: 2.6rem;
    padding-bottom: 2.6rem;
}

.flashcard-hero__copy {
    max-width: 760px;
}

.flashcard-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    color: var(--fc-green-dark);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 24px rgba(36, 59, 46, 0.08);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flashcard-hero h1 {
    margin: 0.72rem 0 0.55rem;
    color: var(--fc-green-dark);
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-size: clamp(2.3rem, 5vw, 4.45rem);
    line-height: 0.96;
    letter-spacing: -0.035em;
}

.flashcard-hero__copy > p {
    max-width: 660px;
    margin: 0;
    color: #4d6657;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.62;
}

.flashcard-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.flashcard-hero__badges span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.65rem;
    border: 1px solid rgba(13, 122, 69, 0.12);
    border-radius: 8px;
    color: #51675a;
    background: rgba(255, 255, 255, 0.64);
    font-size: 0.8rem;
    font-weight: 800;
}

.flashcard-hero__badges b {
    color: var(--fc-green);
}

.flashcard-hero__art {
    position: relative;
    min-height: 205px;
}

.flashcard-hero__card {
    position: absolute;
    width: 205px;
    height: 154px;
    display: grid;
    place-items: center;
    border: 7px solid #fff;
    border-radius: 23px;
    box-shadow: 0 24px 44px rgba(36, 59, 46, 0.17);
}

.flashcard-hero__card--back {
    top: 34px;
    right: 54px;
    transform: rotate(-10deg);
    color: rgba(16, 85, 54, 0.5);
    background: #d8f1de;
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
}

.flashcard-hero__card--front {
    top: 4px;
    right: 0;
    transform: rotate(7deg);
    align-content: center;
    gap: 0.1rem;
    color: #4f3b1d;
    background: #fff3bf;
}

.flashcard-hero__card--front i {
    font-size: 2.4rem;
    font-style: normal;
}

.flashcard-hero__card--front strong {
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.7rem;
}

.flashcard-hero__card--front small {
    color: #8b744e;
}

.flashcard-app-shell {
    display: grid;
    grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    padding-top: 1.45rem;
    padding-bottom: 4rem;
}

.flashcard-library,
.flashcard-workspace {
    border: 1px solid var(--fc-line);
    border-radius: 20px;
    background: var(--fc-paper);
    box-shadow: 0 16px 38px rgba(36, 59, 46, 0.08);
}

.flashcard-library {
    position: sticky;
    top: 1rem;
    overflow: hidden;
}

.flashcard-library__head {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    border-bottom: 1px solid var(--fc-line);
    background: linear-gradient(135deg, #f6fcf5, #fff);
}

.flashcard-library__head span,
.flashcard-workspace__identity p {
    display: block;
    margin: 0 0 0.2rem;
    color: var(--fc-green);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.flashcard-library__head h2,
.flashcard-workspace__identity h2 {
    margin: 0;
    color: var(--fc-ink);
    font-family: 'Baloo 2', sans-serif;
    line-height: 1.05;
}

.flashcard-library__head h2 {
    font-size: 1.25rem;
}

.flashcard-library__head > strong {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--fc-green);
}

.flashcard-library__sets {
    max-height: 530px;
    overflow-y: auto;
    padding: 0.55rem;
}

.flashcard-set-option {
    --set-tint: #fff4c9;
    width: 100%;
    min-height: 70px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--fc-ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.flashcard-set-option + .flashcard-set-option {
    margin-top: 0.25rem;
}

.flashcard-set-option:hover {
    background: #f7faf7;
}

.flashcard-set-option.is-active {
    border-color: color-mix(in srgb, var(--set-tint), var(--fc-green) 18%);
    background: color-mix(in srgb, var(--set-tint), white 35%);
}

.flashcard-set-option__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--set-tint);
    font-size: 1.38rem;
}

.theme-sunny { --set-tint: #fff0b8; --theme-strong: #d89b14; }
.theme-mint { --set-tint: #dff5e5; --theme-strong: #168b50; }
.theme-sky { --set-tint: #dceefc; --theme-strong: #347fb1; }
.theme-coral { --set-tint: #ffe1e0; --theme-strong: #cc5d5b; }
.theme-violet { --set-tint: #eae2fb; --theme-strong: #7757b2; }

.flashcard-set-option__copy {
    min-width: 0;
}

.flashcard-set-option__copy strong,
.flashcard-set-option__copy small {
    display: block;
}

.flashcard-set-option__copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.flashcard-set-option__copy small {
    margin-top: 0.2rem;
    color: var(--fc-muted);
    font-size: 0.72rem;
}

.flashcard-set-option__arrow {
    color: #8ca095;
    font-size: 1.5rem;
}

.flashcard-library__sync {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.2rem 0.55rem 0.65rem;
    padding: 0.72rem;
    border-radius: 12px;
    color: #6b795f;
    background: #f7faed;
}

.flashcard-library__sync > span {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    flex: 0 0 31px;
    border-radius: 50%;
    background: #fff;
}

.flashcard-library__sync > span.is-synced {
    color: #fff;
    background: var(--fc-green);
}

.flashcard-library__sync p,
.flashcard-library__sync strong,
.flashcard-library__sync small {
    display: block;
    margin: 0;
}

.flashcard-library__sync strong {
    font-size: 0.76rem;
}

.flashcard-library__sync small {
    margin-top: 0.1rem;
    color: var(--fc-muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.flashcard-library__sync a {
    color: var(--fc-green);
    font-weight: 900;
}

.flashcard-workspace {
    --set-tint: #dff5e5;
    --theme-strong: #168b50;
    min-width: 0;
    padding: clamp(1rem, 2.4vw, 1.55rem);
}

.flashcard-workspace__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.flashcard-workspace__identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.flashcard-workspace__identity > span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    border-radius: 14px;
    background: var(--set-tint);
    font-size: 1.55rem;
}

.flashcard-workspace__identity h2 {
    overflow: hidden;
    max-width: 570px;
    font-size: clamp(1.35rem, 2.7vw, 1.9rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flashcard-mode-switch {
    display: flex;
    padding: 0.25rem;
    border: 1px solid var(--fc-line);
    border-radius: 11px;
    background: #f7faf8;
}

.flashcard-mode-switch button {
    min-height: 38px;
    padding: 0.45rem 0.78rem;
    border: 0;
    border-radius: 8px;
    color: var(--fc-muted);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.flashcard-mode-switch button.is-active {
    color: var(--fc-green-dark);
    background: #fff;
    box-shadow: 0 5px 13px rgba(36, 59, 46, 0.09);
}

.flashcard-set-description {
    margin: 0.65rem 0 0;
    color: var(--fc-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.flashcard-progress-row {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--fc-line);
}

.flashcard-progress-copy {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--fc-muted);
    font-size: 0.75rem;
}

.flashcard-progress-copy strong {
    color: var(--fc-ink);
}

.flashcard-progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 99px;
    background: #e9eee9;
}

.flashcard-progress-track i {
    width: 0;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--theme-strong);
    transition: width 0.3s ease;
}

.flashcard-shuffle {
    min-height: 36px;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--fc-line);
    border-radius: 9px;
    color: var(--fc-muted);
    background: #fff;
    font-size: 0.74rem;
    font-weight: 850;
    cursor: pointer;
}

.flashcard-shuffle[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--theme-strong), transparent 70%);
    color: var(--theme-strong);
    background: var(--set-tint);
}

.flashcard-stage {
    min-height: 410px;
    display: grid;
    place-items: center;
    padding: 1.25rem 0 1rem;
    perspective: 1400px;
}

.flashcard-card {
    position: relative;
    width: min(100%, 660px);
    min-height: 360px;
    padding: 0;
    border: 0;
    outline: 0;
    border-radius: 26px;
    color: var(--fc-ink);
    background: transparent;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.58s cubic-bezier(0.2, 0.72, 0.25, 1);
}

.flashcard-card:focus-visible {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-strong), transparent 70%);
}

.flashcard-card.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-card__side {
    position: absolute;
    inset: 0;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: clamp(1.25rem, 4vw, 2.4rem);
    border: 1px solid color-mix(in srgb, var(--theme-strong), transparent 78%);
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.8) 0 5px, transparent 6px),
        radial-gradient(circle at 86% 84%, rgba(255, 255, 255, 0.75) 0 7px, transparent 8px),
        linear-gradient(145deg, color-mix(in srgb, var(--set-tint), white 38%), #fff);
    box-shadow: 0 23px 48px rgba(36, 59, 46, 0.13);
    backface-visibility: hidden;
}

.flashcard-card__side::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -72px;
    bottom: -76px;
    border: 24px solid color-mix(in srgb, var(--set-tint), transparent 18%);
    border-radius: 50%;
}

.flashcard-card__back {
    transform: rotateY(180deg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.45) 25%, transparent 25%) 0 0 / 28px 28px,
        linear-gradient(145deg, #fff, color-mix(in srgb, var(--set-tint), white 52%));
}

.flashcard-card__hint {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    color: color-mix(in srgb, var(--theme-strong), #3d4f45 42%);
    background: rgba(255, 255, 255, 0.75);
    font-size: 0.68rem;
    font-weight: 850;
}

.flashcard-card__visual {
    position: relative;
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 6px solid rgba(255, 255, 255, 0.92);
    border-radius: 22px;
    background: var(--set-tint);
    box-shadow: 0 12px 28px rgba(36, 59, 46, 0.12);
    font-size: 3.2rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.flashcard-card__visual.has-image {
    width: min(100%, 280px);
    aspect-ratio: 16 / 9;
    height: auto;
    padding: 0;
    border: 4px solid #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(36, 59, 46, 0.13);
    background: #ffffff;
}

.flashcard-card__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flashcard-card__term {
    margin-top: 1rem;
    font-family: 'Baloo 2', sans-serif;
    font-size: clamp(2.45rem, 6vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.flashcard-card__phonetics {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.55rem;
}

.flashcard-card__phonetics i {
    color: #60756a;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92rem;
    font-style: normal;
}

.flashcard-card__phonetics b {
    padding: 0.28rem 0.52rem;
    border-radius: 6px;
    color: #fff;
    background: var(--theme-strong);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.flashcard-card__flip {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #728179;
    font-size: 0.7rem;
    font-weight: 850;
}

.flashcard-card__back > small {
    color: var(--fc-muted);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flashcard-card__meaning {
    margin-top: 0.35rem;
    color: var(--theme-strong);
    font-family: 'Baloo 2', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    text-align: center;
}

.flashcard-card__example {
    width: min(100%, 490px);
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--fc-line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.72);
}

.flashcard-card__example q {
    color: var(--fc-ink);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.45;
}

.flashcard-card__example em {
    color: var(--fc-muted);
    font-size: 0.82rem;
    font-style: normal;
    line-height: 1.4;
}

.flashcard-nav-controls {
    width: min(100%, 660px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.6rem;
    margin: 0 auto;
}

.flashcard-nav-controls button {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--fc-line);
    border-radius: 12px;
    color: var(--fc-ink);
    background: #fff;
    font-weight: 850;
    cursor: pointer;
}

.flashcard-nav-controls button:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--theme-strong), transparent 67%);
    background: color-mix(in srgb, var(--set-tint), white 55%);
}

.flashcard-nav-controls .flashcard-speak {
    color: #fff;
    background: var(--theme-strong);
    border-color: var(--theme-strong);
}

.flashcard-nav-controls .flashcard-speak:hover:not(:disabled) {
    color: #fff;
    background: color-mix(in srgb, var(--theme-strong), black 12%);
    border-color: color-mix(in srgb, var(--theme-strong), black 12%);
    box-shadow: 0 4px 14px rgba(13, 122, 69, 0.22);
}

.flashcard-nav-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.flashcard-rating {
    width: min(100%, 660px);
    margin: 0.9rem auto 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--fc-line);
}

.flashcard-rating > p {
    margin: 0 0 0.55rem;
    color: var(--fc-muted);
    font-size: 0.76rem;
    font-weight: 850;
    text-align: center;
}

.flashcard-rating > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.flashcard-rating button {
    min-height: 66px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid;
    border-radius: 13px;
    text-align: left;
    cursor: pointer;
}

.flashcard-rating button > span {
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
}

.flashcard-rating button strong,
.flashcard-rating button small {
    display: block;
}

.flashcard-rating button small {
    opacity: 0.72;
}

.flashcard-rating__again {
    border-color: rgba(197, 91, 65, 0.2);
    color: #9a4633;
    background: #fff5f1;
}

.flashcard-rating__again > span {
    background: #c55b41;
}

.flashcard-rating__known {
    border-color: rgba(22, 139, 80, 0.2);
    color: #116c40;
    background: #effaf3;
}

.flashcard-rating__known > span {
    background: #168b50;
}

.flashcard-keyboard-hint {
    margin: 0.8rem 0 0;
    color: #97a099;
    font-size: 0.68rem;
    text-align: center;
}

.flashcard-keyboard-hint span {
    padding: 0.12rem 0.32rem;
    border: 1px solid var(--fc-line);
    border-radius: 4px;
    color: #738079;
    background: #fff;
    font-family: ui-monospace, monospace;
}

.flashcard-list-view {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--fc-line);
}

.flashcard-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.flashcard-list-toolbar label {
    width: min(420px, 100%);
}

.flashcard-list-toolbar input {
    width: 100%;
    min-height: 48px;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--fc-line);
    border-radius: 13px;
    outline: 0;
    color: var(--fc-ink);
    background: #f9fbfa;
    font: inherit;
    font-size: 0.9rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.flashcard-list-toolbar input:focus {
    border-color: var(--theme-strong);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-strong), transparent 88%);
}

.flashcard-list-toolbar p {
    margin: 0;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    color: var(--fc-muted);
    background: color-mix(in srgb, var(--set-tint), white 58%);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}

.flashcard-vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.flashcard-word-row {
    min-width: 0;
    min-height: 104px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid var(--fc-line);
    border-radius: 16px;
    background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--set-tint), white 91%));
    box-shadow: 0 8px 22px rgba(36, 59, 46, 0.055);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.flashcard-word-row:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--theme-strong), transparent 68%);
    box-shadow: 0 13px 28px rgba(36, 59, 46, 0.1);
}

.flashcard-word-row[data-status="known"] {
    border-color: color-mix(in srgb, #168b50, transparent 72%);
}

.flashcard-word-row__visual {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: var(--set-tint);
    font-size: 1.65rem;
}

.flashcard-word-row__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flashcard-word-row__copy {
    min-width: 0;
}

.flashcard-word-row__termline {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.flashcard-word-row__termline strong {
    overflow: hidden;
    color: var(--fc-ink);
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flashcard-word-row__termline i {
    color: var(--fc-muted);
    font-size: 0.72rem;
    font-style: normal;
    white-space: nowrap;
}

.flashcard-word-row__copy > span {
    display: block;
    margin-top: 0.15rem;
    color: var(--theme-strong);
    font-size: 0.82rem;
    font-weight: 800;
}

.flashcard-word-row__copy small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 0.22rem;
    color: var(--fc-muted);
    font-size: 0.7rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.flashcard-word-row__actions {
    display: grid;
    justify-items: end;
    gap: 0.35rem;
}

.flashcard-word-row__actions button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--fc-line);
    border-radius: 50%;
    color: var(--theme-strong);
    background: #fff;
    box-shadow: 0 5px 13px rgba(36, 59, 46, 0.08);
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.flashcard-word-row__actions button:hover,
.flashcard-word-row__actions button:focus-visible {
    transform: scale(1.06);
    border-color: var(--theme-strong);
    outline: 0;
    background: var(--set-tint);
}

.flashcard-word-row__status {
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    color: #9a7b2f;
    background: #fff5d8;
    font-size: 0.62rem;
    font-weight: 900;
    white-space: nowrap;
}

.flashcard-word-row__status.is-known {
    color: #168b50;
    background: #e4f7eb;
}

.flashcard-list-empty,
.flashcard-empty-state {
    text-align: center;
}

.flashcard-list-empty {
    padding: 2rem;
    color: var(--fc-muted);
}

.flashcard-empty-state {
    grid-column: 1 / -1;
    padding: 4rem 1rem;
    border: 1px dashed var(--fc-line);
    border-radius: 22px;
    background: #fff;
}

.flashcard-empty-state > span {
    font-size: 3.5rem;
}

.flashcard-empty-state h2 {
    margin: 0.7rem 0 0.3rem;
    color: var(--fc-green-dark);
    font-family: 'Baloo 2', sans-serif;
}

.flashcard-empty-state p {
    margin: 0 0 1rem;
    color: var(--fc-muted);
}

.flashcard-empty-state a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    color: #fff;
    background: var(--fc-green);
    font-weight: 850;
    text-decoration: none;
}

.flashcard-toast {
    position: fixed;
    z-index: 1000;
    right: 1rem;
    bottom: 1rem;
    max-width: min(360px, calc(100vw - 2rem));
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-radius: 11px;
    color: #fff;
    background: #263c2f;
    box-shadow: 0 16px 34px rgba(36, 59, 46, 0.2);
    font-size: 0.82rem;
    font-weight: 800;
}

.flashcard-toast[data-tone="error"] {
    background: #943f3f;
}

@media (max-width: 980px) {
    .flashcard-app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .flashcard-library {
        position: static;
    }

    .flashcard-library__sets {
        display: grid;
        grid-auto-columns: minmax(220px, 0.75fr);
        grid-auto-flow: column;
        gap: 0.4rem;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
    }

    .flashcard-set-option {
        scroll-snap-align: start;
    }

    .flashcard-set-option + .flashcard-set-option {
        margin-top: 0;
    }

    .flashcard-library__sync {
        display: none;
    }
}

@media (max-width: 760px) {
    .flashcard-hero__inner {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .flashcard-hero__art {
        display: none;
    }

    .flashcard-workspace__head,
    .flashcard-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .flashcard-mode-switch {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .flashcard-progress-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .flashcard-progress-copy {
        grid-column: 1 / -1;
        justify-content: space-between;
    }

    .flashcard-stage {
        min-height: 360px;
    }

    .flashcard-card,
    .flashcard-card__side {
        min-height: 330px;
    }

    .flashcard-vocabulary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .flashcard-hero__badges span:nth-child(3),
    .flashcard-keyboard-hint {
        display: none;
    }

    .flashcard-app-shell {
        padding-top: 0.8rem;
        padding-bottom: 2.5rem;
    }

    .flashcard-library,
    .flashcard-workspace {
        border-radius: 15px;
    }

    .flashcard-workspace {
        padding: 0.8rem;
    }

    .flashcard-workspace__identity > span {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .flashcard-progress-row {
        gap: 0.55rem;
    }

    .flashcard-shuffle {
        padding: 0.35rem 0.5rem;
        font-size: 0.68rem;
    }

    .flashcard-stage {
        min-height: 330px;
        padding-top: 0.9rem;
    }

    .flashcard-card,
    .flashcard-card__side {
        min-height: 305px;
        border-radius: 19px;
    }

    .flashcard-card__visual {
        width: 82px;
        height: 82px;
        font-size: 2.7rem;
    }

    .flashcard-card__hint {
        top: 0.7rem;
        left: 0.7rem;
    }

    .flashcard-card__flip {
        right: 0.7rem;
        bottom: 0.7rem;
    }

    .flashcard-nav-controls button b {
        display: none;
    }

    .flashcard-nav-controls button {
        min-height: 44px;
        font-size: 1.15rem;
    }

    .flashcard-rating > div {
        grid-template-columns: minmax(0, 1fr);
    }

    .flashcard-word-row {
        min-height: 94px;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 0.62rem;
        padding: 0.72rem;
        border-radius: 14px;
    }

    .flashcard-word-row__visual {
        width: 44px;
        height: 44px;
        border-radius: 11px;
        font-size: 1.4rem;
    }

    .flashcard-word-row__termline {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.05rem;
    }

    .flashcard-word-row__actions button {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flashcard-card,
    .flashcard-progress-track i {
        transition: none !important;
    }
}

/* ==========================================================================
   FLASHCARD SPEAKING PRACTICE & ACCURACY EVALUATION PANEL
   ========================================================================== */

.flashcard-speech-action-wrap {
    width: min(100%, 660px);
    margin: 0.75rem auto 0;
}

.flashcard-speech-btn {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.2rem;
    border: 2px solid var(--fc-green);
    border-radius: 14px;
    color: var(--fc-green-dark);
    background: linear-gradient(135deg, #e6f9ed, #ffffff 80%);
    font-size: 1.02rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(13, 122, 69, 0.08);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.flashcard-speech-btn:hover:not(:disabled) {
    color: var(--fc-green-dark);
    border-color: var(--fc-green);
    background: linear-gradient(135deg, #cbf3d7 0%, #e2f7eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 122, 69, 0.16);
}

.flashcard-speech-btn.is-active {
    border-color: var(--fc-green);
    color: #ffffff;
    background: linear-gradient(135deg, #0d7a45 0%, #149c5a 100%);
    box-shadow: 0 6px 20px rgba(13, 122, 69, 0.3);
}

.flashcard-speech-btn.is-active:hover:not(:disabled) {
    color: #ffffff;
    background: linear-gradient(135deg, #0a6538 0%, #10874d 100%);
}

.flashcard-speech-panel {
    width: min(100%, 660px);
    margin: 1.15rem auto 0;
    padding: 1.25rem 1.4rem;
    border: 2px solid color-mix(in srgb, var(--theme-strong), transparent 75%);
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff, color-mix(in srgb, var(--set-tint), white 60%));
    box-shadow: 0 16px 36px rgba(36, 59, 46, 0.09);
    animation: speechPanelFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes speechPanelFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flashcard-speech-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--fc-line);
}

.flashcard-speech-panel__title {
    flex: 1 1 270px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.flashcard-speech-panel__title > span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--set-tint);
    font-size: 1.2rem;
}

.flashcard-speech-panel__title strong {
    display: block;
    color: var(--fc-ink);
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.1rem;
    line-height: 1.1;
}

.flashcard-speech-panel__title small {
    display: block;
    margin-top: 0.15rem;
    color: var(--fc-muted);
    font-size: 0.76rem;
}

.flashcard-speech-panel__tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 0.35rem;
    padding: 0.2rem;
    border-radius: 99px;
    background: rgba(36, 59, 46, 0.06);
}

.flashcard-speech-panel__tabs button {
    min-width: 84px;
    padding: 0.3rem 0.75rem;
    border: 0;
    border-radius: 99px;
    color: var(--fc-muted);
    background: transparent;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flashcard-speech-panel__tabs button.is-active {
    color: var(--fc-ink);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.flashcard-speech-panel__target {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.85rem;
    padding: 0.65rem 0.95rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--fc-line);
}

.flashcard-speech-target-label {
    color: var(--fc-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.flashcard-speech-target-text {
    color: var(--theme-strong);
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
}

.flashcard-speech-panel__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1.1rem;
}

.flashcard-mic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0.75rem 2.2rem;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    font-size: 1.06rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.38), 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.flashcard-mic-btn::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.35) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.flashcard-mic-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.48);
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.flashcard-mic-btn:hover::before {
    opacity: 1;
}

.flashcard-mic-btn:active {
    transform: translateY(0) scale(0.98);
}

.flashcard-mic-btn__icon {
    font-size: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.flashcard-mic-btn:hover .flashcard-mic-btn__icon {
    transform: scale(1.18);
}

.flashcard-mic-btn.is-recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 26px rgba(239, 68, 68, 0.48);
    animation: micBtnRecordingPulse 1.4s ease-in-out infinite;
}

.flashcard-mic-btn.is-recording:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 12px 34px rgba(239, 68, 68, 0.58);
}

.flashcard-mic-btn.is-recording .flashcard-mic-btn__icon {
    animation: micIconBlink 0.8s ease-in-out infinite alternate;
}

@keyframes micBtnRecordingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5), 0 8px 24px rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 18px rgba(239, 68, 68, 0), 0 8px 24px rgba(239, 68, 68, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 8px 24px rgba(239, 68, 68, 0.4);
    }
}

@keyframes micIconBlink {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.5; transform: scale(1.15); }
}

@keyframes micPulseWave {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.18, 1.35);
        opacity: 0;
    }
}

.flashcard-speech-status {
    margin: 0;
    color: var(--fc-ink);
    font-size: 0.88rem;
    font-weight: 750;
    text-align: center;
}

.flashcard-speech-countdown {
    margin: -0.3rem 0 0;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    color: #c62828;
    background: #ffebee;
    font-size: 0.76rem;
    font-weight: 850;
}

/* --- RESULT EVALUATION CARD --- */

.flashcard-speech-result {
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px dashed var(--fc-line);
    animation: resultPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes resultPopIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.flashcard-speech-result__head {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 1.1rem;
}

.flashcard-speech-score-badge {
    position: relative;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
}

.flashcard-speech-score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.flashcard-speech-score-ring .ring-bg {
    fill: none;
    stroke: #e9eee9;
    stroke-width: 3.5;
}

.flashcard-speech-score-ring .ring-stroke {
    fill: none;
    stroke: var(--theme-strong);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s ease;
}

.flashcard-speech-score-badge[data-tier="excellent"] .ring-stroke { stroke: #10a352; }
.flashcard-speech-score-badge[data-tier="good"] .ring-stroke { stroke: #2196f3; }
.flashcard-speech-score-badge[data-tier="fair"] .ring-stroke { stroke: #ff9800; }
.flashcard-speech-score-badge[data-tier="low"] .ring-stroke { stroke: #f44336; }

.flashcard-speech-score-badge .score-value {
    position: absolute;
    color: var(--fc-ink);
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
}

.flashcard-speech-stars {
    font-size: 1.15rem;
    letter-spacing: 0.15em;
}

.flashcard-speech-rating-title {
    margin: 0.15rem 0 0.2rem;
    color: var(--fc-ink);
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.25rem;
    line-height: 1.1;
}

.flashcard-speech-feedback-text {
    margin: 0;
    color: var(--fc-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.flashcard-speech-comparison {
    margin-top: 1rem;
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--fc-line);
}

.flashcard-speech-comp-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.flashcard-speech-comp-row > span {
    color: var(--fc-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.flashcard-speech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.speech-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 800;
}

.speech-chip--match {
    color: #0c6b39;
    background: #e1f7e8;
    border: 1px solid rgba(12, 107, 57, 0.2);
}

.speech-chip--mismatch {
    color: #c62828;
    background: #ffebee;
    border: 1px solid rgba(198, 40, 40, 0.2);
}

.flashcard-speech-audio-player {
    margin-top: 0.85rem;
}

.flashcard-speech-play-btn {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--fc-line);
    border-radius: 12px;
    color: var(--fc-ink);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flashcard-speech-play-btn:hover {
    border-color: var(--theme-strong);
    color: var(--theme-strong);
    background: #fff;
}

.flashcard-speech-result__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 1rem;
}

.flashcard-speech-result__actions button {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 850;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-speech-retry {
    border: 1px solid var(--fc-line);
    color: var(--fc-ink);
    background: #fff;
}

.btn-speech-retry:hover {
    border-color: var(--theme-strong);
    color: var(--theme-strong);
}

.btn-speech-listen {
    border: 1px solid var(--theme-strong);
    color: #fff;
    background: var(--theme-strong);
}

.btn-speech-listen:hover {
    filter: brightness(1.08);
}

@media (max-width: 680px) {
    body.flashcard-page.flashcard-list-active .site-chatbot:not(.is-open),
    body.flashcard-page.flashcard-list-active .back-to-top,
    body.flashcard-page.flashcard-list-active .floating-social-links {
        display: none !important;
    }

    .flashcard-speech-panel {
        padding: 1rem;
        border-radius: 16px;
    }

    .flashcard-speech-panel__header {
        align-items: stretch;
        flex-direction: column;
    }

    .flashcard-speech-panel__title {
        flex-basis: auto;
    }

    .flashcard-speech-panel__tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        padding: 0.25rem;
        border-radius: 12px;
    }

    .flashcard-speech-panel__tabs button {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 0.45rem 0.6rem;
        border-radius: 9px;
    }

    .flashcard-speech-panel__target {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .flashcard-speech-result__actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .flashcard-word-row,
    .flashcard-word-row__actions button,
    .flashcard-speech-btn,
    .flashcard-speech-panel,
    .flashcard-speech-result,
    .flashcard-mic-btn,
    .flashcard-mic-btn__icon,
    .flashcard-speech-score-ring .ring-stroke {
        animation: none !important;
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
