:root {
    --ink: #1d2a25; --muted: #66716b; --paper: #f7f4ed; --surface: #fffdf8;
    --line: #ddd9cf; --green: #255b45; --green-soft: #dbe9df;
    --terracotta: #d56745; --terracotta-dark: #b95134; --yellow: #edc967;
    --shadow: 0 18px 50px rgba(43, 57, 50, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; min-width: 320px; color: var(--ink);
    background: radial-gradient(circle at 5% 6%, rgba(237, 201, 103, 0.13), transparent 22rem), var(--paper);
    font-family: "DM Sans", "Noto Sans Bengali", sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
.page-shell { max-width: 1600px; margin: 0 auto; min-height: 100vh; }

.topbar {
    min-height: 76px; padding: 0 3.5vw; display: flex; align-items: center;
    justify-content: space-between; border-bottom: 1px solid var(--line);
}
.brand {
    color: var(--ink); text-decoration: none; display: inline-flex; align-items: center;
    gap: 11px; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.03em;
}
.brand-mark {
    width: 35px; height: 35px; border-radius: 50% 50% 44% 56%; display: grid;
    place-items: center; background: var(--terracotta); color: white; font-family: Georgia, serif;
    font-size: 1.25rem; transform: rotate(-4deg);
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.language-switch {
    padding: 4px; border: 1px solid var(--line); border-radius: 999px;
    background: rgba(255,255,255,.55); display: flex;
}
.language-btn {
    border: 0; padding: 7px 14px; border-radius: 999px; background: transparent;
    color: var(--muted); cursor: pointer; font-size: .82rem; font-weight: 600;
}
.language-btn.active { background: var(--ink); color: #fff; }
.icon-button {
    width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%;
    background: transparent; cursor: pointer; font-size: 1rem;
}
.usage-button {
    min-height: 38px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
    background: rgba(255,255,255,.55); cursor: pointer; display: flex; align-items: center; gap: 8px;
    color: var(--muted); font-size: .68rem;
}
.usage-button strong { color: var(--green); font-size: .75rem; }
.usage-button:hover, .icon-button:hover { border-color: var(--green); }

.hero { padding: 76px 3.5vw 58px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::after {
    content: "Aa"; position: absolute; right: 5vw; top: 18px; color: rgba(37, 91, 69, 0.045);
    font-family: Georgia, serif; font-size: clamp(9rem, 24vw, 22rem); line-height: 1; pointer-events: none;
}
.eyebrow, .section-kicker {
    margin: 0 0 18px; color: var(--green); font-size: .72rem; font-weight: 700; letter-spacing: .17em;
}
.eyebrow { display: flex; gap: 8px; align-items: center; }
.eyebrow span { width: 28px; height: 2px; background: var(--terracotta); }
.hero h1 {
    margin: 0; max-width: 780px; font-family: "Noto Sans Bengali", sans-serif;
    font-size: clamp(2.7rem, 6.2vw, 5.7rem); letter-spacing: -.065em; line-height: 1.12;
    font-weight: 600; position: relative; z-index: 1;
}
.hero h1 em { color: var(--terracotta); font-family: Georgia, "Noto Sans Bengali", serif; font-weight: 400; }
.hero > p:not(.input-hint) {
    max-width: 610px; margin: 25px 0 34px; color: var(--muted); line-height: 1.8;
    font-family: "Noto Sans Bengali", sans-serif; position: relative; z-index: 1;
}
.word-form {
    display: flex; max-width: 720px; padding: 7px; background: var(--surface);
    border: 1px solid #d5d0c5; border-radius: 13px; box-shadow: var(--shadow);
    position: relative; z-index: 2; transition: border-color .2s, box-shadow .2s;
}
.word-form:focus-within { border-color: var(--green); box-shadow: 0 18px 50px rgba(37, 91, 69, .12); }
.word-form.loading { opacity: .72; pointer-events: none; }
.word-form input {
    min-width: 0; flex: 1; border: 0; outline: 0; background: transparent;
    padding: 13px 15px; color: var(--ink); font-size: 1.05rem;
}
.word-form input::placeholder { color: #9a9f9b; }
.word-form button {
    border: 0; border-radius: 9px; padding: 12px 19px; display: flex; align-items: center;
    gap: 16px; background: var(--green); color: white; cursor: pointer; font-weight: 600;
}
.word-form button:hover { background: #194c37; }
.input-meta { max-width: 720px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.input-hint { margin: 10px 9px 0; color: #89908c; font-size: .76rem; }
.bulk-toggle {
    margin-top: 10px; padding: 0; border: 0; background: transparent; color: var(--green);
    font-size: .76rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.bulk-toggle:hover { color: var(--terracotta-dark); }
.bulk-panel {
    max-width: 720px; margin-top: 16px; padding: 18px; border: 1px solid var(--line);
    border-radius: 13px; background: rgba(255,253,248,.82); box-shadow: var(--shadow);
    position: relative; z-index: 2; animation: bulkIn .22s ease both;
}
.bulk-panel[hidden] { display: none; }
@keyframes bulkIn { from { opacity: 0; transform: translateY(-6px); } }
.bulk-heading, .bulk-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.bulk-heading strong { display: block; font-family: "Noto Sans Bengali", sans-serif; font-size: .88rem; }
.bulk-heading span { display: block; margin-top: 3px; color: var(--muted); font-family: "Noto Sans Bengali", sans-serif; font-size: .7rem; }
.bulk-heading button { align-self: flex-start; border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.bulk-panel textarea {
    width: 100%; margin: 15px 0 12px; padding: 12px 14px; resize: vertical; border: 1px solid var(--line);
    border-radius: 9px; outline: 0; background: var(--surface); color: var(--ink); line-height: 1.6;
}
.bulk-panel textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37,91,69,.08); }
.bulk-footer > span { color: var(--muted); font-size: .72rem; }
.bulk-footer button {
    border: 0; border-radius: 8px; padding: 10px 15px; background: var(--terracotta);
    color: white; cursor: pointer; font-size: .78rem; font-weight: 700;
}
.bulk-footer button:hover { background: var(--terracotta-dark); }
.bulk-panel.loading { opacity: .65; pointer-events: none; }

.dictionary { padding: 58px 3.5vw 85px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 23px; }
.section-kicker { margin-bottom: 10px; }
.section-heading h2 {
    margin: 0; font-family: "Noto Sans Bengali", sans-serif;
    font-size: clamp(1.55rem, 3vw, 2.35rem); letter-spacing: -.045em;
}
.section-heading h2 span {
    display: inline-grid; place-items: center; min-width: 29px; height: 29px; padding: 0 8px;
    border-radius: 99px; background: var(--yellow); font-family: "DM Sans", sans-serif;
    font-size: .75rem; vertical-align: middle;
}
.meaning-control { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: .78rem; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 38px; height: 22px; border-radius: 99px; background: #c9cbc7; padding: 3px; transition: background .2s; }
.switch-track span { display: block; width: 16px; height: 16px; border-radius: 50%; background: white; transition: transform .2s; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.switch input:checked + .switch-track { background: var(--terracotta); }
.switch input:checked + .switch-track span { transform: translateX(16px); }

.word-table { border-top: 1px solid var(--ink); }
.table-header, .word-row {
    display: grid; grid-template-columns: minmax(130px, .65fr) minmax(200px, 1.15fr) minmax(170px, .85fr) minmax(290px, 1.55fr) minmax(115px, .45fr);
}
.table-header {
    min-height: 48px; align-items: center; color: #7d8580; font-size: .66rem;
    letter-spacing: .13em; font-weight: 700; border-bottom: 1px solid var(--line);
}
.table-header span, .cell { padding: 0 20px; }
.table-header span:first-child, .word-cell { padding-left: 0; }
.table-header span + span, .cell + .cell { border-left: 1px solid var(--line); }
.word-row { min-height: 166px; border-bottom: 1px solid var(--line); animation: rowIn .35s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }
.cell { padding-top: 14px; padding-bottom: 14px; min-width: 0; }
.word-cell { display: flex; flex-direction: column; justify-content: space-between; }
.word-number { color: #9a9f9b; font-size: .67rem; letter-spacing: .13em; font-weight: 700; }
.word-title { margin: auto 0; font-family: Georgia, serif; font-size: clamp(1.55rem, 2.25vw, 2.15rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
.delete-word { align-self: flex-start; border: 0; padding: 0; background: none; color: #9a9f9b; cursor: pointer; font-size: .72rem; }
.delete-word:hover { color: var(--terracotta-dark); }
.meaning-cell, .pronunciation-cell { display: flex; flex-direction: column; justify-content: center; }
.meaning-type { margin: 0 0 5px; color: var(--terracotta); font-size: .61rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.meaning-text { margin: 0; font-family: "Noto Sans Bengali", sans-serif; font-size: .9rem; line-height: 1.5; transition: filter .2s, opacity .2s; }
.meaning-subtext { margin: 5px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.42; transition: filter .2s, opacity .2s; }
.translation-status { display: flex; align-items: center; gap: 9px; color: var(--green); font-size: .78rem; font-weight: 600; }
.translation-status small { display: block; color: var(--muted); font-weight: 400; }
.translation-spinner { width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid var(--green-soft); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
.translation-status.error { color: var(--terracotta-dark); }
.translation-status.error .translation-spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.meanings-hidden .meaning-text, .meanings-hidden .meaning-subtext { filter: blur(7px); opacity: .2; user-select: none; }
.phonetic { margin: 0 0 9px; font-family: Georgia, serif; font-size: 1rem; color: #4d5852; }
.listen-button {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px;
    border: 1px solid var(--line); border-radius: 99px; background: transparent; cursor: pointer;
    font-size: .77rem; font-weight: 600;
}
.listen-button:hover { border-color: var(--green); color: var(--green); }
.sound-icon { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: .65rem; }

.image-cell { padding: 10px 14px 10px 16px; display: flex; flex-direction: column; }
.image-panel {
    flex: 1; min-height: 144px; overflow: hidden; border: 1px dashed #b7b7ac;
    border-radius: 10px; background: rgba(255,255,255,.38); display: flex;
    flex-direction: column; position: relative;
}
.image-panel.dragging { border-color: var(--terracotta); background: rgba(213, 103, 69, .08); }
.image-flipper { flex: 1; height: 122px; min-height: 122px; perspective: 1000px; }
.image-flipper.can-flip { cursor: pointer; }
.image-flip-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .58s cubic-bezier(.2,.75,.25,1); }
.image-flipper.flipped .image-flip-inner { transform: rotateY(180deg); }
.image-face {
    position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden;
    -webkit-backface-visibility: hidden; background: #f1f0eb;
}
.image-front { display: flex; flex-direction: column; }
.image-back {
    transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 11px 16px; text-align: center; background: var(--green); color: white;
}
.image-back .back-label { margin: 0 0 4px; color: #bcd6c9; font-size: .52rem; font-weight: 700; letter-spacing: .14em; }
.image-back .back-meaning { margin: 4px 0 0; max-height: 67px; overflow: auto; font-family: "Noto Sans Bengali", sans-serif; font-size: .86rem; font-weight: 600; line-height: 1.5; }
.image-back .back-hint { margin-top: auto; color: #bcd6c9; font-size: .6rem; }
.image-preview {
    width: 100%; height: 100%; min-height: 0; object-fit: contain; object-position: center;
    background: #f1f0eb; display: block;
}
.image-preview[hidden] { display: none; }
.image-placeholder { flex: 1; min-height: 0; padding: 8px; display: grid; place-items: center; text-align: center; color: var(--muted); cursor: pointer; }
.image-placeholder[hidden] { display: none; }
.image-placeholder strong { display: block; margin-top: 4px; color: var(--ink); font-size: .7rem; }
.image-placeholder small { display: block; margin-top: 2px; font-size: .59rem; }
.upload-symbol { width: 28px; height: 28px; margin: auto; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: .9rem; }
.image-actions { display: flex; border-top: 1px solid var(--line); }
.image-actions button { flex: 1; border: 0; padding: 6px 7px; background: var(--surface); cursor: pointer; font-size: .63rem; font-weight: 600; }
.image-actions button + button { border-left: 1px solid var(--line); }
.image-actions button:hover { color: var(--terracotta-dark); }
.image-caption { padding: 6px 9px; background: var(--green); color: white; font-size: .66rem; font-family: "Noto Sans Bengali", sans-serif; }
.image-caption[hidden] { display: none; }
.meanings-hidden .image-caption { display: none; }
.image-tools-cell { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 14px 0 14px 14px; }
.image-tools-cell button { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; background: var(--surface); cursor: pointer; color: var(--ink); font-size: .66rem; font-weight: 700; line-height: 1.25; }
.image-tools-cell button span { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 3px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.image-tools-cell button:hover { border-color: var(--green); color: var(--green); }
.image-tools-cell button:disabled { opacity: .55; cursor: wait; }
.generating .image-placeholder { animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

.empty-state { padding: 80px 20px; text-align: center; border-bottom: 1px solid var(--line); }
.empty-illustration { width: 96px; height: 75px; margin: 0 auto 20px; position: relative; }
.empty-illustration span { position: absolute; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 8px; color: white; font-family: Georgia, "Noto Sans Bengali", serif; font-size: 1.5rem; }
.empty-illustration span:first-child { left: 3px; top: 0; background: var(--green); transform: rotate(-7deg); }
.empty-illustration span:last-child { right: 3px; bottom: 0; background: var(--terracotta); transform: rotate(7deg); }
.empty-state h3 { margin: 0 0 8px; font-family: "Noto Sans Bengali", sans-serif; font-size: 1.18rem; }
.empty-state p { max-width: 450px; margin: 0 auto; color: var(--muted); font-family: "Noto Sans Bengali", sans-serif; font-size: .84rem; line-height: 1.7; }

footer { margin: 0 3.5vw; padding: 24px 0 35px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
footer span { color: var(--ink); letter-spacing: .14em; font-weight: 700; }
footer p { margin: 0; font-family: "Noto Sans Bengali", sans-serif; }
.clear-all-button { border: 1px solid #dfb9ad; border-radius: 8px; padding: 7px 10px; background: transparent; color: var(--terracotta-dark); cursor: pointer; font-size: .67rem; font-weight: 600; }
.clear-all-button:hover { background: rgba(213,103,69,.08); border-color: var(--terracotta); }

.ai-dialog { width: min(94vw, 610px); max-height: 90vh; border: 0; padding: 0; border-radius: 15px; background: var(--surface); color: var(--ink); box-shadow: 0 25px 90px rgba(22, 32, 27, .25); }
.ai-dialog::backdrop { background: rgba(24, 34, 29, .58); backdrop-filter: blur(3px); }
.dialog-card { padding: 30px; position: relative; overflow-y: auto; max-height: 90vh; }
.dialog-close { position: absolute; top: 13px; right: 15px; border: 0; background: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); }
.dialog-card h2 { margin: 0 0 8px; font-family: "Noto Sans Bengali", sans-serif; }
.dialog-card > p:not(.section-kicker):not(.privacy-note) { margin: 0 0 24px; color: var(--muted); font-size: .86rem; }
.dialog-card label { display: block; margin-bottom: 7px; font-size: .77rem; font-weight: 700; }
.dialog-card select, .dialog-card input[type="text"], .dialog-card input[type="number"] {
    width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px;
    padding: 9px 11px; outline: 0; background: var(--surface); color: var(--ink);
}
.dialog-card select:focus, .dialog-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(37,91,69,.08); }
.provider-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 18px; padding: 4px; border-radius: 10px; background: #eeece5; }
.provider-button { border: 0; border-radius: 7px; padding: 9px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; font-size: .78rem; }
.provider-button.active { background: var(--surface); color: var(--green); box-shadow: 0 2px 8px rgba(29,42,37,.08); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 12px; align-items: end; margin-bottom: 17px; }
.estimate-box { min-height: 42px; padding: 7px 10px; border: 1px solid #c9ddcf; border-radius: 9px; background: #edf5ef; }
.estimate-box span { display: block; color: var(--muted); font-size: .59rem; }
.estimate-box strong { color: var(--green); font-size: .71rem; }
.custom-model-fields { grid-template-columns: 1.5fr 1fr; gap: 12px; margin: -5px 0 17px; padding: 13px; border: 1px dashed #c8c8bd; border-radius: 10px; background: rgba(247,244,237,.72); }
.custom-model-fields:not([hidden]) { display: grid; }
.key-field { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.key-field:focus-within { border-color: var(--green); }
.key-field input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 11px 12px; background: transparent; }
.key-field button { border: 0; border-left: 1px solid var(--line); padding: 0 12px; background: transparent; cursor: pointer; font-size: .73rem; }
.privacy-note { margin: 7px 0 18px; color: #8c928e; font-size: .68rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.dialog-actions button { border-radius: 8px; padding: 10px 15px; cursor: pointer; font-weight: 600; font-size: .8rem; }
.secondary-action { border: 1px solid var(--line); background: transparent; }
.primary-action { border: 1px solid var(--green); background: var(--green); color: white; }
.usage-dialog { width: min(94vw, 720px); }
.usage-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 20px 0 14px; }
.usage-stat { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(247,244,237,.65); }
.usage-stat span { display: block; color: var(--muted); font-size: .65rem; }
.usage-stat strong { display: block; margin-top: 5px; color: var(--green); font-family: Georgia, serif; font-size: 1.22rem; font-weight: 400; }
.usage-stat small { color: #8c928e; font-size: .6rem; }
.usage-breakdown { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.provider-total { padding: 6px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: .68rem; font-weight: 600; }
.usage-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 15px; border-top: 1px solid var(--line); }
.usage-history-heading h3 { margin: 0; font-size: .86rem; }
.danger-text { border: 0; padding: 0; background: transparent; color: var(--terracotta-dark); cursor: pointer; font-size: .68rem; }
.usage-history { margin-top: 10px; max-height: 225px; overflow-y: auto; }
.usage-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.usage-entry strong, .usage-entry span { display: block; font-size: .7rem; }
.usage-entry span { color: var(--muted); margin-top: 2px; font-size: .62rem; }
.usage-entry-cost { color: var(--green); text-align: right; font-weight: 700; font-size: .72rem; }
.usage-empty { padding: 27px 10px; color: var(--muted); text-align: center; font-size: .75rem; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(360px, calc(100vw - 48px)); padding: 12px 16px; border-radius: 9px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: .78rem; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
    .table-header { display: none; }
    .word-table { border-top: 0; }
    .word-row { grid-template-columns: 1fr 1fr; min-height: auto; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.28); }
    .word-cell, .meaning-cell, .pronunciation-cell, .image-cell { min-height: 190px; padding: 21px; }
    .cell + .cell { border-left: 0; }
    .meaning-cell { border-left: 1px solid var(--line) !important; }
    .pronunciation-cell, .image-cell { border-top: 1px solid var(--line); }
    .image-cell { border-left: 1px solid var(--line) !important; }
    .image-tools-cell { grid-column: 1 / -1; min-height: 0; padding: 13px 20px; flex-direction: row; border-left: 0 !important; border-top: 1px solid var(--line) !important; }
}

@media (max-width: 620px) {
    .topbar { padding: 0 18px; min-height: 66px; }
    .brand { font-size: 1.05rem; }
    .brand-mark { width: 31px; height: 31px; }
    .language-btn { padding: 6px 9px; font-size: .7rem; }
    .header-actions { gap: 6px; }
    .usage-button { padding: 6px 9px; }
    .usage-button span { display: none; }
    .icon-button { width: 34px; height: 34px; }
    .hero { padding: 55px 18px 40px; }
    .hero h1 { font-size: clamp(2.4rem, 13vw, 3.8rem); }
    .hero::after { right: -25px; top: 65px; }
    .word-form { display: block; padding: 6px; }
    .word-form input { width: 100%; padding: 13px 11px; }
    .word-form button { width: 100%; justify-content: space-between; }
    .input-meta { align-items: flex-start; }
    .bulk-panel { padding: 15px; }
    .dictionary { padding: 42px 18px 60px; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
    .meaning-control { width: 100%; justify-content: space-between; }
    .word-row { grid-template-columns: 1fr; }
    .word-cell, .meaning-cell, .pronunciation-cell, .image-cell { min-height: 0; padding: 20px; }
    .meaning-cell, .pronunciation-cell, .image-cell, .image-tools-cell { border-left: 0 !important; border-top: 1px solid var(--line); }
    .image-tools-cell { grid-column: auto; padding: 14px 20px 20px; }
    .image-panel { min-height: 230px; }
    .image-flipper { height: 230px; }
    footer { margin: 0 18px; align-items: flex-start; flex-direction: column; gap: 8px; }
    .dialog-card { padding: 25px 18px; }
    .settings-grid, .custom-model-fields { grid-template-columns: 1fr; }
    .usage-stats { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
