@font-face {
    font-family: "Li Subha Letterpress";
    src: url("../fonts/LiSubhaLetterpress-Regular.ttf") format("truetype");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Li Subha Letterpress";
    src: url("../fonts/LiSubhaLetterpress-Italic.ttf") format("truetype");
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Noto Sans Bengali Fallback";
    src: url("../fonts/NotoSansBengali-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #2a160e;
    --ink-soft: #6a4634;
    --paper: #f3e4c4;
    --paper-deep: #e6d0a6;
    --card: transparent;
    --brass: #7a4a22;
    --brass-deep: #5c3416;
    --terracotta: #6e2414;
    --leaf: #35523c;
    --line: rgba(58, 30, 16, 0.22);
    --shadow: none;
    --rule: #4a2814;
    --headword: #6a1e12;
    --font: "Li Subha Letterpress", "Noto Sans Bengali Fallback", "Noto Sans Bengali", Georgia, serif;
    --floret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='6.4' r='5.4' fill='%237a4a22'/%3E%3Ccircle cx='25.2' cy='13.2' r='5.4' fill='%237a4a22'/%3E%3Ccircle cx='21.7' cy='24.4' r='5.4' fill='%237a4a22'/%3E%3Ccircle cx='10.3' cy='24.4' r='5.4' fill='%237a4a22'/%3E%3Ccircle cx='6.8' cy='13.2' r='5.4' fill='%237a4a22'/%3E%3Ccircle cx='16' cy='16' r='4' fill='%23f6e8c8'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    color: var(--ink);
    font-family: var(--font);
    font-synthesis: none;
    line-height: 1.7;
    overflow-x: hidden;
}

html {
    background-color: #27160e;
}

body {
    margin: 0;
    padding: 0;
    background-color: #27160e;
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -8%, #4a2e1c 0%, transparent 62%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.09) 0 1px, transparent 1px 8px),
        repeating-linear-gradient(12deg, rgba(255, 210, 150, 0.035) 0 1px, transparent 1px 11px),
        linear-gradient(180deg, #3a2418 0%, #1e110c 100%);
}

h1, h2, h3, h4, h5, .brand-title, .entry-word, .wotd-word, .word-group-name,
.users-last-word a, .desk-tile strong {
    font-family: var(--font);
    font-weight: 400;
    letter-spacing: 0.01em;
}

a { color: var(--terracotta); }
a:hover { color: var(--brass-deep); }

.btn,
.form-control,
.form-select,
.alert,
.card,
.modal-content,
.page-link,
.input-group > .form-control,
.input-group > .btn {
    border-radius: 0 !important;
}

.form-control,
.form-select {
    background: rgba(255, 248, 230, 0.45);
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: var(--font);
    min-height: 2.65rem;
}

.form-control:focus,
.form-select:focus {
    background: #fff8e6;
    border-color: var(--rule);
    box-shadow: none;
    color: var(--ink);
}

.btn {
    font-family: var(--font);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--terracotta);
    border: 1px solid #4a160c;
    color: #f6ead0;
}
.btn-primary:hover,
.btn-primary:focus {
    background: #54180c;
    border-color: #3a1008;
    color: #f6ead0;
}
.btn-success { background: var(--leaf); border-color: #24382a; }
.btn-success:hover { background: #2a4230; border-color: #1c2e22; }
.btn-outline-secondary {
    border-color: var(--rule);
    color: var(--ink);
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}
.btn-info { background: #3d4e58; border-color: #2a363c; color: #fff; }
.btn-danger { background: #7a2218; border-color: #4a120c; }

.folio-wrap,
body.is-staff .folio-wrap {
    width: min(70rem, calc(100% - 2.5rem));
    max-width: 70rem;
    margin: 1.35rem auto 2.2rem;
}

.folio,
.book-page {
    position: relative;
    min-height: calc(100vh - 3.9rem);
    padding: 1.7rem 2.15rem 1.9rem;
    background-color: #f2e2bc;
    background-image:
        radial-gradient(ellipse 70% 38% at 6% 4%, rgba(140, 78, 36, 0.11), transparent 55%),
        radial-gradient(ellipse 55% 32% at 96% 96%, rgba(110, 62, 28, 0.1), transparent 50%),
        radial-gradient(circle at 18% 72%, rgba(130, 80, 30, 0.045) 0 1.1px, transparent 1.4px),
        radial-gradient(circle at 78% 22%, rgba(90, 50, 20, 0.04) 0 0.9px, transparent 1.2px),
        linear-gradient(90deg, rgba(78, 42, 18, 0.16) 0, rgba(78, 42, 18, 0.05) 1.7rem, transparent 3.4rem),
        linear-gradient(#f6e8c8, #ead4a8);
    border: 1px solid #c4a06a;
    box-shadow:
        0 0 0 1px #d8bc8c,
        0 0 0 10px #c9a874,
        0 0 0 11px #7a5228,
        0 28px 55px rgba(0, 0, 0, 0.42);
}

.folio::before,
.book-page::before {
    content: "";
    position: absolute;
    top: 0.7rem;
    left: 1.9rem;
    right: 1.9rem;
    height: 6px;
    border-top: 2px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    pointer-events: none;
}

.folio::after,
.book-page::after {
    content: "";
    position: absolute;
    bottom: 0.7rem;
    left: 1.9rem;
    right: 1.9rem;
    height: 6px;
    border-top: 1px solid var(--rule);
    border-bottom: 2px solid var(--rule);
    pointer-events: none;
}

.site-header {
    position: relative;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
    border: 0;
    padding: 0.85rem 0 0.35rem;
    text-align: center;
}

.masthead {
    display: block;
    text-decoration: none !important;
    color: var(--ink) !important;
    padding: 0.15rem 0 0.55rem;
}

.brand-kicker {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 0.2rem;
}

.brand-title {
    display: block;
    font-size: clamp(1.15rem, 2.6vw, 1.7rem);
    line-height: 1.35;
    color: var(--headword);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.15rem 0.15rem;
    padding: 0.2rem 0 0.65rem;
    border-bottom: 1px solid var(--line);
}

.site-nav a {
    color: var(--ink) !important;
    text-decoration: none;
    padding: 0.2rem 0.7rem;
    font-size: 0.95rem;
}

.site-nav a:hover {
    color: var(--headword) !important;
    text-decoration: underline;
    text-underline-offset: 0.22em;
}

.hero-ornament {
    width: min(40rem, 96%);
    margin: 0.15rem auto 0.55rem;
    color: var(--brass);
    line-height: 0;
}

.hero-ornament svg {
    display: block;
    width: 100%;
    height: auto;
}

.folio-body { padding: 0.7rem 0 1.1rem; }

.flash-wrap .alert {
    border: 1px solid var(--rule);
    border-left: 4px solid var(--headword);
    background: rgba(255, 244, 214, 0.7);
    color: var(--ink);
    box-shadow: none;
}

.hero {
    text-align: center;
    margin: 0.2rem 0 1.35rem;
}

.hero h1 {
    font-size: clamp(1.5rem, 4vw, 2.3rem);
    margin-bottom: 0.35rem;
    color: var(--headword);
}

.hero p {
    color: var(--ink-soft);
    max-width: 34rem;
    margin: 0 auto;
    font-style: italic;
}

.home-stage {
    display: grid;
    gap: 1.5rem;
    margin: 0.35rem 0 1.5rem;
}

.wotd-card,
.home-panel,
.thanks-card,
.welcome-card,
.stat-card,
.entry-card,
.admin-home .card,
.auth-card,
.user-form-card,
.words-filter,
.words-table-wrap,
.users-table-wrap,
.desk-tile,
.sibling-card,
.upload-progress {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.plate {
    position: relative;
    padding: 1.2rem 1.15rem 1.3rem;
    background:
        linear-gradient(180deg, rgba(255, 248, 230, 0.42), rgba(246, 232, 200, 0.18));
    border: 1px solid rgba(90, 50, 20, 0.28);
    box-shadow:
        inset 0 0 0 4px rgba(246, 232, 200, 0.55),
        inset 0 0 0 5px rgba(90, 50, 20, 0.16);
}

.plate::before {
    content: "";
    position: absolute;
    inset: 7px;
    pointer-events: none;
    background-image: var(--floret), var(--floret), var(--floret), var(--floret);
    background-repeat: no-repeat;
    background-size: 18px 18px;
    background-position: left top, right top, left bottom, right bottom;
}

.plate-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-align: center;
    color: var(--headword);
    font-size: 1.12rem;
    margin: 0 0 0.85rem;
}

.plate-head::before,
.plate-head::after {
    content: "";
    width: 1.2rem;
    height: 1.2rem;
    background: var(--floret) center / contain no-repeat;
    flex: 0 0 auto;
}

.wotd-card.plate {
    text-align: center;
    padding: 1.35rem 1.25rem 1.45rem;
}

.wotd-kicker,
.desk-tile-kicker,
.visit-years-head,
.dict-picker-label {
    margin: 0 0 0.3rem;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: var(--brass-deep);
    font-style: italic;
}

.wotd-word {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    margin: 0.15rem 0 0.35rem;
    color: var(--headword);
    display: inline-block;
    padding: 0 0.4rem 0.2rem;
    border-bottom: 1px solid rgba(122, 74, 34, 0.35);
}

.wotd-source,
.wotd-snippet,
.home-muted,
.thanks-meta,
.desk-kicker,
.users-note {
    color: var(--ink-soft);
}

.wotd-source { margin: 0 0 0.55rem; font-size: 0.92rem; font-style: italic; }
.wotd-snippet { margin: 0 auto 0.85rem; font-size: 1.05rem; line-height: 1.75; max-width: 38rem; }

.home-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
}

.home-panel { padding-top: 1.15rem; }

.popular-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.55rem;
}

.popular-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.28rem 0.7rem 0.3rem;
    border: 1px solid rgba(90, 50, 20, 0.22);
    background: rgba(255, 248, 230, 0.45);
    text-decoration: none !important;
    color: var(--ink) !important;
    border-radius: 0;
}

.popular-chip:hover {
    border-color: var(--rule);
    color: var(--headword) !important;
    background: rgba(255, 248, 230, 0.8);
}
.popular-hits { font-size: 0.78rem; color: var(--ink-soft); font-style: italic; }

.quiz-prompt {
    padding: 0.7rem 0.85rem 0.8rem;
    border: 1px solid rgba(90, 50, 20, 0.16);
    background: rgba(255, 248, 230, 0.35);
    line-height: 1.7;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.quiz-options { display: grid; gap: 0.45rem; }

.quiz-choice {
    position: relative;
    min-height: 2.55rem;
    border: 1px solid rgba(90, 50, 20, 0.22);
    border-radius: 0;
    background: rgba(255, 248, 230, 0.4);
    color: var(--ink);
    text-align: left;
    padding: 0.45rem 0.85rem 0.45rem 1.7rem;
    font-size: 1.02rem;
    font-family: var(--font);
    cursor: pointer;
}

.quiz-choice::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    top: 50%;
    width: 0.7rem;
    height: 0.7rem;
    transform: translateY(-50%);
    background: var(--floret) center / contain no-repeat;
}

.quiz-choice:hover {
    border-color: var(--rule);
    background: rgba(255, 248, 230, 0.85);
}

.thanks-form-grid {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) 1fr;
    gap: 0.85rem;
}

.hp-field {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

.thanks-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem 1.2rem;
}

.thanks-card {
    padding: 0.8rem 0.9rem 0.85rem;
    border: 1px solid rgba(90, 50, 20, 0.2);
    background: rgba(255, 248, 230, 0.38);
    position: relative;
}
.thanks-card::before {
    content: "";
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    width: 0.8rem;
    height: 0.8rem;
    background: var(--floret) center / contain no-repeat;
    opacity: 0.7;
}
.thanks-text { margin: 0 0 0.4rem; line-height: 1.65; }
.thanks-meta { margin: 0; font-size: 0.82rem; font-style: italic; }
.thanks-admin-list { display: grid; gap: 0.75rem; }
.thanks-admin-card form { margin-top: 0.65rem; }

#quiz,
#thanks { scroll-margin-top: 1.5rem; }

.search-panel {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    padding: 1rem 0 1.1rem;
    box-shadow: none;
}

.search-bar.input-group {
    flex-wrap: nowrap;
    align-items: stretch;
    border-bottom: 1.5px solid var(--ink);
}

.search-bar .form-control {
    border: 0 !important;
    background: transparent !important;
    min-height: 48px;
    font-size: 1.12rem;
    padding-left: 0.15rem;
    box-shadow: none !important;
}

.search-bar .btn {
    min-width: 6.4rem;
    background: transparent;
    border: 0;
    border-left: 1.5px solid var(--ink);
    color: var(--ink);
    font-weight: 400;
}

.search-bar .btn:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.search-suggest-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.search-suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 40;
    display: grid;
    gap: 0;
    max-height: min(70vh, 22rem);
    overflow: auto;
    border: 1px solid var(--line);
    background: rgba(255, 250, 238, 0.98);
    box-shadow: 0 10px 28px rgba(60, 30, 12, 0.12);
}
.search-suggest-item {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    gap: 0.25rem 0.7rem;
    align-items: baseline;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    padding: 0.55rem 0.75rem;
    font-family: var(--font);
    color: var(--ink);
    cursor: pointer;
}
.search-suggest-item:last-child { border-bottom: 0; }
.search-suggest-item:hover,
.search-suggest-item.is-active {
    background: rgba(166, 74, 42, 0.08);
}
.search-suggest-word {
    font-weight: 600;
    color: var(--headword);
}
.search-suggest-hint {
    color: var(--ink-soft);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-suggest-dict {
    color: var(--brass-deep);
    font-size: 0.8rem;
    white-space: nowrap;
}

.letter-rail {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.15rem 0 0.45rem;
}

.letter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.95rem;
    height: 1.95rem;
    padding: 0 0.4rem;
    border-radius: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.98rem;
}

.letter-chip:hover {
    border-color: var(--line);
    color: var(--headword);
}

.letter-chip.is-active {
    background: transparent;
    color: var(--headword);
    border-color: var(--rule);
    border-bottom-width: 2px;
}

.dict-picker {
    margin-top: 0.15rem;
    padding-top: 0.75rem;
    border-top: 1px dotted var(--line);
}

.dict-picker-label {
    font-size: 0.88rem;
    margin-bottom: 0.45rem;
    cursor: pointer;
}

.dict-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
}

.dict-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.4rem;
    padding: 0.2rem 0.15rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    box-shadow: none;
}

.dict-chip:hover {
    color: var(--headword);
    transform: none;
    box-shadow: none;
}

.dict-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dict-chip-mark {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0;
    border: 1px solid var(--ink);
    background: transparent;
    position: relative;
    flex-shrink: 0;
}

.dict-chip input:checked + .dict-chip-mark {
    background: var(--ink);
    border-color: var(--ink);
}

.dict-chip input:checked + .dict-chip-mark::after {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.02rem;
    width: 0.28rem;
    height: 0.48rem;
    border: solid var(--paper);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dict-chip:has(input:checked) {
    background: transparent;
    border-color: transparent;
}

.dict-chip-all {
    background: transparent;
    color: var(--ink);
    border: 0;
    font-style: italic;
}

.dict-chip-all .dict-chip-mark {
    border-color: var(--ink);
    background: transparent;
}

.dict-chip-all:hover { color: var(--headword); }

.dict-chip-all:has(input:checked) {
    background: transparent;
    border-color: transparent;
}

.dict-chip-all input:checked + .dict-chip-mark {
    background: var(--ink);
    border-color: var(--ink);
}

.dict-chip-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.25;
}

.dict-chip-text { font-weight: 400; }
.dict-chip-count {
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-style: italic;
}
.dict-chip-all .dict-chip-count,
.dict-chip-all .dict-chip-text { color: inherit; }

.customize-grid label { font-size: 0.92rem; color: var(--ink-soft); }
.customize-grid .form-select,
.customize-grid .form-control {
    background: rgba(255, 248, 230, 0.45);
    border-color: var(--line);
    border-radius: 0;
}

.field-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
}

.field-pills label {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0.15rem 0;
    margin: 0;
    cursor: pointer;
}

.field-pills input { margin-right: 0.3rem; }

.stat-row,
.entry-grid { display: grid; gap: 0; }

.stat-row {
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    margin: 1.25rem 0 0.55rem;
    border: 1px solid rgba(90, 50, 20, 0.28);
    box-shadow:
        inset 0 0 0 4px rgba(246, 232, 200, 0.5),
        inset 0 0 0 5px rgba(90, 50, 20, 0.14);
    background: rgba(255, 248, 230, 0.28);
}

.stat-card {
    padding: 0.85rem 0.6rem 0.9rem;
    text-align: center;
    border-right: 1px solid var(--line);
}
.stat-card:last-child { border-right: 0; }
.stat-card strong {
    display: block;
    font-size: 1.45rem;
    color: var(--headword);
    line-height: 1.2;
}

.visit-years { margin: 0.85rem 0 1.2rem; }
.visit-years-head { margin: 0 0 0.45rem; }
.visit-year-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.visit-year-card {
    text-align: center;
    border-right: 1px solid var(--line);
}
.visit-year-card:last-child { border-right: 0; }

.entry-grid { gap: 0.9rem; }

.entry-card {
    position: relative;
    padding: 0.95rem 1.05rem 1.05rem;
    border: 1px solid rgba(90, 50, 20, 0.22);
    background: rgba(255, 248, 230, 0.32);
    box-shadow: inset 0 0 0 3px rgba(246, 232, 200, 0.5);
}

.entry-card::before {
    content: "";
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 0.85rem;
    height: 0.85rem;
    background: var(--floret) center / contain no-repeat;
    opacity: 0.55;
}

.plate .entry-card::before { display: none; }
.entry-word {
    font-size: 1.55rem;
    margin: 0 0 0.15rem;
    color: var(--headword);
    line-height: 1.3;
}
.entry-pos { color: var(--brass-deep); font-size: 0.95rem; font-style: italic; }
.entry-def { margin: 0.45rem 0 0.3rem; font-size: 1.05rem; }
.entry-note, .entry-source { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.entry-source { margin-top: 0.55rem; font-style: italic; }

.sense-count {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
    font-style: italic;
}

.entry-senses { display: grid; gap: 0.55rem; }

.sense-block {
    padding: 0.15rem 0 0.25rem 0.15rem;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.entry-senses .sense-block:only-child { padding: 0.15rem 0; }

.sense-source {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.25rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-style: italic;
}

.word-group-head td {
    background: rgba(90, 50, 20, 0.08);
    font-weight: 400;
}

.word-group-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.words-toolbar,
.users-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--rule);
}

.words-toolbar h2,
.users-toolbar h2 { margin: 0; color: var(--headword); }

.words-actions,
.users-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.words-filter {
    margin-bottom: 1.1rem;
    padding: 0.75rem 0 0.9rem;
    border-top: 1px dotted var(--line);
    border-bottom: 1px dotted var(--line);
}

.words-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(10rem, 1fr)) minmax(10rem, 1fr) minmax(12rem, 1.2fr) auto;
    gap: 0.7rem 0.85rem;
    align-items: end;
}

.words-filter-grid .form-label {
    margin-bottom: 0.25rem;
    color: var(--ink-soft);
}

.words-filter-submit {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.words-filter-note {
    margin: 0.65rem 0 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.bulk-review-stats {
    color: var(--ink-soft);
}
.bulk-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.bulk-review-table textarea,
.bulk-review-table input[type="text"] {
    width: 100%;
    min-width: 8rem;
    font-family: var(--font);
}
.bulk-review-table .col-check { width: 3.2rem; }
.bulk-review-table tr.is-duplicate { opacity: 0.72; }
.bulk-review-table tr.is-variation td:nth-child(2) { color: var(--terracotta); }
.bulk-review-table tr.is-new td:nth-child(2) { color: var(--brass-deep); }

.words-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.words-row-actions form { display: inline; margin: 0; }

.words-table-wrap,
.users-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    background: rgba(255, 248, 230, 0.28);
}

.words-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
    border: 0;
    word-break: normal;
}

.words-table.is-grouped { min-width: 0; }

.words-table thead th,
.users-table thead th,
.table thead {
    white-space: nowrap;
    vertical-align: middle;
    background: rgba(90, 50, 20, 0.1);
    border-color: var(--line);
    padding: 0.65rem 0.8rem;
    color: var(--headword);
}

.words-table tbody td {
    vertical-align: top;
    border-color: var(--line);
    padding: 0.65rem 0.8rem;
}

.words-table .col-word { width: 14%; }
.words-table .col-pos { width: 22%; }
.words-table .col-def { width: 40%; }
.words-table .col-dict { width: 14%; }
.words-table .col-user { width: 12%; }
.words-table .col-note { width: 12%; }
.words-table .col-actions { width: 16%; }
.words-table.is-grouped .col-def { width: 68%; }
.words-table.is-grouped .col-dict { width: 18%; }
.words-table.is-grouped .col-actions { width: 14%; }

.words-cell {
    max-height: 8.5rem;
    overflow: auto;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.word-group-name { font-size: 1.15rem; color: var(--headword); }

.words-table td.words-row-actions {
    overflow-wrap: normal;
    min-width: 6.5rem;
}

.word-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.repeat-field-head label { display: block; margin-bottom: 0.15rem; }

.repeat-hint {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.45;
    font-style: italic;
}

.repeat-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.repeat-row {
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 248, 230, 0.28);
    overflow: visible;
}

.repeat-row-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.4rem 0.5rem;
    background: rgba(90, 50, 20, 0.08);
}

.repeat-serial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.3rem;
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.85rem;
}

.repeat-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
}

.repeat-btn,
.repeat-add {
    border: 1px solid var(--line);
    background: rgba(255, 248, 230, 0.5);
    color: var(--ink);
    border-radius: 0;
    min-height: 2.4rem;
    min-width: 2.4rem;
    padding: 0.2rem 0.7rem;
    font-size: 0.9rem;
    line-height: 1;
    font-family: var(--font);
}

.repeat-btn:hover,
.repeat-add:hover {
    border-color: var(--rule);
    background: #fff8e6;
}

.repeat-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.repeat-btn.is-danger { color: var(--terracotta); }

.repeat-add {
    width: auto;
    flex: 1 1 calc(50% - 0.4rem);
    margin-top: 0;
    min-height: 2.7rem;
    border-style: dashed;
    border-color: var(--brass);
    color: var(--brass-deep);
    background: transparent;
}

.repeat-add-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.repeat-kind,
.repeat-label {
    border: 1px solid var(--line);
    background: rgba(255, 248, 230, 0.5);
    color: var(--ink);
    border-radius: 0;
    min-height: 2.4rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.88rem;
    font-family: var(--font);
}

.repeat-kind { max-width: 12.5rem; }
.repeat-label { flex: 1 1 8rem; min-width: 7rem; }

.entry-blocks { display: grid; gap: 0.4rem; }
.entry-block.is-pos .entry-block-body { color: var(--brass-deep); font-style: italic; }
.entry-block.is-note .entry-block-body { color: var(--ink-soft); font-size: 0.95rem; }
.entry-block-body.is-senses {
    line-height: 1.7;
}
.entry-sense {
    display: inline;
}
.entry-sense.is-plain {
    color: #5a4638;
}
.entry-sense.is-tag {
    color: var(--terracotta);
}

.repeat-row .rich-wrap,
.repeat-row .rich-toolbar,
.repeat-row .rich-editor { border-radius: 0 !important; }
.repeat-row .rich-wrap { border: 1px solid var(--line); }

.repeat-view {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.1rem 0.45rem;
    align-items: start;
    margin: 0 0 0.42rem;
}
.repeat-view:last-child { margin-bottom: 0; }

.entry-index {
    font-weight: 400;
    color: var(--brass-deep);
    line-height: 1.55;
}

.repeat-view-body {
    min-width: 0;
    overflow-wrap: anywhere;
}

.repeat-row:not([data-kind="definition"]) .rich-editor {
    min-height: 5.2rem;
}

.users-table {
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
    border: 0;
}

.users-table tbody td {
    vertical-align: middle;
    border-color: var(--line);
    padding: 0.65rem 0.85rem;
}

.users-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.users-row-actions form { display: inline; margin: 0; }

.users-last-word a {
    font-weight: 400;
    text-decoration: none;
    color: var(--headword);
}
.users-last-when {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-style: italic;
}

.user-form-card {
    max-width: 36rem;
    border: 1px solid var(--line);
    padding: 1.2rem 0.2rem 0.4rem;
}

.lemma-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 0.15rem;
    border-radius: 0;
    background: transparent;
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-style: italic;
}

.sibling-list { display: grid; gap: 0.75rem; }
.sibling-card {
    padding: 0.55rem 0 0.7rem;
    border-bottom: 1px dotted var(--line);
}
.sibling-card .sense-source { margin-bottom: 0.35rem; }

.entry-card.is-preview .entry-senses {
    max-height: 11rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 8.4rem, transparent 11rem);
    mask-image: linear-gradient(to bottom, #000 8.4rem, transparent 11rem);
}

.entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.7rem;
    align-items: center;
}

.entry-more,
.entry-pdf,
.entry-edit {
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 0;
}

.entry-more { color: var(--terracotta); border-bottom: 1px solid currentColor; }
.entry-edit {
    color: var(--headword);
    background: transparent;
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
}
.entry-edit:hover { color: var(--ink); background: transparent; }
.sense-edit {
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--brass-deep);
    border: 0;
    border-bottom: 1px dotted currentColor;
    padding: 0;
    background: transparent;
    font-style: normal;
}
.wotd-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.wotd-card.plate .wotd-actions { justify-content: center; }

.sense-tagger {
    border: 1px dashed var(--line);
    border-radius: 0;
    padding: 0;
    background: transparent;
    overflow: hidden;
}
.sense-tagger > .rich-toolbar {
    border-bottom: 1px solid var(--line);
}
.sense-tag-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.35rem 0.4rem 0.45rem;
    min-height: 2.5rem;
}
.sense-tag-list,
.sense-plain-list,
.sense-segment-list {
    display: contents;
}
.sense-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 244, 214, 0.65);
    color: var(--ink);
    border-radius: 0;
    padding: 0.2rem 0.45rem 0.2rem 0.55rem;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    font-family: var(--font);
}
.sense-chip.is-tag {
    color: var(--terracotta);
    border-color: rgba(166, 74, 42, 0.45);
    background: rgba(166, 74, 42, 0.08);
}
.sense-chip.is-plain {
    color: #5a4638;
    background: rgba(90, 70, 56, 0.06);
    border-style: solid;
    border-color: rgba(90, 70, 56, 0.35);
}
.sense-chip:hover {
    border-color: var(--rule);
}
.sense-chip-text { overflow-wrap: anywhere; }
.sense-chip-text sub,
.sense-chip-text sup {
    font-size: 0.75em;
}
.sense-chip-x {
    display: inline-grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0;
    background: transparent;
    font-size: 0.95rem;
    line-height: 1;
}
.sense-tag-input {
    width: 100%;
    border: 0;
    background: transparent;
    min-height: 2.2rem;
    color: var(--ink);
    outline: none;
    font-family: var(--font);
}
.sense-tagger .rich-wrap {
    flex: 1 1 8rem;
    min-width: 7rem;
    border: 0;
    background: transparent;
}
.sense-tagger .rich-wrap.is-single .rich-editor {
    min-height: 2.2rem;
    padding: 0.2rem 0.15rem;
}
.sense-tagger .rich-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--ink-soft);
    opacity: 0.7;
    pointer-events: none;
}
.sense-tag-mode {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.35rem 0.5rem 0.45rem;
    border-top: 1px dashed var(--line);
    font-size: 0.86rem;
    color: var(--ink-soft);
    cursor: pointer;
    font-family: var(--font);
}
.sense-tag-mode input {
    margin: 0;
    accent-color: var(--brass-deep);
}

.desk-kicker { color: var(--ink-soft); font-style: italic; }
.desk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
    gap: 0;
    border-top: 1px solid var(--rule);
}
.desk-tile {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 0.85rem 1.05rem 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-decoration: none !important;
    color: var(--ink) !important;
    transition: none;
}
.desk-tile:hover {
    transform: none;
    color: var(--headword) !important;
}
.desk-tile-kicker { font-size: 0.75rem; }
.desk-tile strong { font-size: 1.12rem; color: var(--headword); }
.desk-tile span:last-child { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.5; }
.admin-stat-row { margin-top: 0; }

.entry-pdf {
    color: var(--brass-deep);
    border: 0;
    border-bottom: 1px solid currentColor;
    padding: 0;
    background: transparent;
}

.entry-more:hover,
.entry-pdf:hover { color: var(--ink); }

mark {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    box-shadow: inset 0 -0.35em 0 rgba(196, 140, 48, 0.35);
}

.results-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1.15rem 0 0.55rem;
    font-style: italic;
    color: var(--ink-soft);
}

.results-meta .btn,
.results-meta .btn-outline-secondary {
    border: 0;
    background: transparent;
    color: var(--terracotta);
    min-height: 0;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    box-shadow: none;
}

.results-meta .btn:hover {
    background: transparent;
    color: var(--ink);
}

.pagination .page-link {
    color: var(--ink);
    border-color: var(--line);
    background: transparent;
    font-family: var(--font);
}

.pagination .page-item.active .page-link {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.empty-state { padding: 1.15rem 0; text-align: center; }
.welcome-card.plate,
.wotd-card.plate { padding: 1.2rem 1.15rem 1.3rem; }
.wotd-card.plate { padding: 1.35rem 1.25rem 1.45rem; }

.site-footer {
    border: 0;
    padding: 0.55rem 0 0.35rem;
    color: var(--ink-soft);
    text-align: center;
    background: transparent;
    font-size: 0.88rem;
    font-style: italic;
}

.table {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
}

.auth-card {
    max-width: 26rem;
    margin: 1.4rem auto 0.4rem;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 1.2rem 0.15rem 1.4rem;
}

.admin-home .card { height: 100%; }
.admin-home .card-body { padding: 1.1rem 0; }

.upload-progress {
    margin: 0 0 1rem;
    padding: 0.7rem 0;
    border-top: 1px dotted var(--line);
    border-bottom: 1px dotted var(--line);
}

.upload-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.upload-progress-track {
    height: 6px;
    border-radius: 0;
    background: var(--paper-deep);
    overflow: hidden;
    border: 1px solid var(--line);
}

.upload-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 0;
    background: var(--headword);
    transition: width 0.16s ease-out;
}

.rich-wrap {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 248, 230, 0.55);
    overflow: visible;
}

.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    padding: 0.4rem 0.45rem;
    background: rgba(90, 50, 20, 0.08);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    position: relative;
}

.rich-btn,
.rich-symbol {
    border: 1px solid var(--line);
    background: rgba(255, 248, 230, 0.7);
    color: var(--ink);
    border-radius: 0;
    min-height: 2rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.86rem;
    line-height: 1;
    font-family: var(--font);
}

.rich-btn:hover,
.rich-symbol:hover {
    border-color: var(--rule);
    background: #fff8e6;
}

.rich-symbols { position: relative; }

.rich-symbols-panel {
    position: absolute;
    left: 0;
    top: calc(100% + 0.3rem);
    z-index: 20;
    width: min(34rem, 80vw);
    max-height: 18rem;
    overflow: auto;
    padding: 0.65rem 0.7rem;
    background: #f6e8c8;
    border: 1px solid var(--rule);
    border-radius: 0;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.rich-symbols-title {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin: 0.35rem 0 0.3rem;
}

.rich-symbols-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.45rem;
}

.rich-symbol { min-width: 2rem; font-size: 1.05rem; }

.rich-editor {
    min-height: 5.5rem;
    padding: 0.7rem 0.8rem;
    outline: none;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent;
    font-family: var(--font);
}

.rich-wrap.is-single .rich-editor { min-height: 2.6rem; }

.word-link {
    color: var(--terracotta);
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.word-link:hover { color: var(--headword); }
.rich-editor .word-link { pointer-events: none; }

.word-mention-menu {
    position: absolute;
    z-index: 40;
    min-width: 12rem;
    max-width: min(22rem, 80vw);
    max-height: 14rem;
    overflow: auto;
    padding: 0.25rem 0;
    background: #f6e8c8;
    border: 1px solid var(--rule);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.word-mention-item,
.word-mention-empty {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.95rem;
    padding: 0.35rem 0.7rem;
}
.word-mention-item:hover,
.word-mention-item.is-active {
    background: rgba(90, 50, 20, 0.12);
}
.word-mention-empty { color: var(--ink-soft); font-style: italic; }

.rich-source {
    display: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.rich-editor sub,
.rich-editor sup,
.entry-word sub, .entry-word sup,
.entry-pos sub, .entry-pos sup,
.entry-def sub, .entry-def sup,
.entry-note sub, .entry-note sup,
.entry-block-body sub, .entry-block-body sup {
    font-size: 0.75em;
    line-height: 0;
}
.rich-editor sup,
.entry-word sup, .entry-pos sup, .entry-def sup, .entry-note sup,
.entry-block-body sup, .sense-chip-text sup { vertical-align: super; }
.rich-editor sub,
.entry-word sub, .entry-pos sub, .entry-def sub, .entry-note sub,
.entry-block-body sub, .sense-chip-text sub { vertical-align: sub; }

@media (min-width: 768px) {
    .entry-grid { grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; }
    .search-panel { padding: 1.15rem 0 1.2rem; }
}

@media (max-width: 767.98px) {
    .folio-wrap,
    body.is-staff .folio-wrap {
        width: calc(100% - 0.8rem);
        max-width: none;
        margin: 0.55rem auto 1.2rem;
    }
    .folio,
    .book-page {
        padding: 1.25rem 0.95rem 1.35rem;
        min-height: calc(100vh - 2rem);
        box-shadow:
            0 0 0 1px #d8bc8c,
            0 0 0 6px #c9a874,
            0 0 0 7px #7a5228,
            0 16px 32px rgba(0, 0, 0, 0.38);
    }
    .folio::before,
    .book-page::before,
    .folio::after,
    .book-page::after {
        left: 0.85rem;
        right: 0.85rem;
    }

    .folio-wrap,
    .site-header,
    .folio-body,
    .site-footer {
        padding-left: max(0rem, env(safe-area-inset-left));
        padding-right: max(0rem, env(safe-area-inset-right));
    }

    .site-header { padding-top: max(0.7rem, env(safe-area-inset-top)); }
    .brand-kicker { font-size: 0.62rem; letter-spacing: 0.16em; }
    .brand-title {
        font-size: clamp(1.02rem, 4.6vw, 1.28rem);
        line-height: 1.35;
    }
    .site-nav a { padding: 0.2rem 0.5rem; font-size: 0.9rem; }

    .hero { margin-bottom: 0.85rem; }
    .hero h1 {
        font-size: clamp(1.15rem, 6vw, 1.55rem);
        line-height: 1.35;
    }
    .hero p {
        font-size: 0.9rem;
        line-height: 1.55;
        max-width: 22rem;
    }

    .search-panel { padding: 0.75rem 0; }
    .search-panel summary {
        min-height: 2.5rem;
        padding: 0.4rem 0;
        cursor: pointer;
        list-style-position: outside;
    }
    .search-bar { flex-wrap: nowrap; }
    .search-bar .form-control {
        min-height: 48px;
        min-width: 0;
        font-size: 16px;
        padding-left: 0.1rem;
    }
    .search-bar .btn {
        min-width: 4.8rem;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
        font-size: 0.95rem;
        white-space: nowrap;
    }
    .customize-grid .form-select,
    .customize-grid .form-control {
        min-height: 48px;
        font-size: 16px;
    }
    .field-pills label {
        min-height: 2.4rem;
        display: inline-flex;
        align-items: center;
    }

    .letter-rail {
        gap: 0.3rem;
        padding: 0.1rem 1.2rem 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 1.2rem), transparent 100%);
    }
    .letter-rail::-webkit-scrollbar { display: none; }
    .letter-chip {
        min-width: 2.4rem;
        height: 2.4rem;
        flex-shrink: 0;
        font-size: 1.02rem;
    }

    .dict-picker > summary.dict-picker-label {
        min-height: 2.5rem;
        padding: 0.4rem 0;
        margin-bottom: 0.3rem;
    }
    .dict-picker-list { gap: 0.35rem; }
    .dict-chip { width: 100%; min-height: 2.6rem; }
    .dict-chip:hover { transform: none; box-shadow: none; }
    .dict-chip-text { overflow-wrap: anywhere; }

    .stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .stat-card {
        padding: 0.55rem 0.2rem;
        font-size: 0.76rem;
        line-height: 1.25;
    }
    .stat-card strong { font-size: 1.12rem; }
    .visit-year-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .visit-year-card:nth-child(2n) { border-right: 0; }

    .welcome-card.plate { padding: 1rem 0.85rem 1.05rem; }
    .entry-card { padding: 0.85rem 0.85rem 0.95rem; }
    .entry-word { font-size: 1.22rem; overflow-wrap: anywhere; }
    .entry-def { font-size: 0.98rem; overflow-wrap: anywhere; }
    .entry-pos,
    .entry-note,
    .sense-source { overflow-wrap: anywhere; }
    .entry-card.is-preview .entry-senses {
        max-height: 9.5rem;
        -webkit-mask-image: linear-gradient(to bottom, #000 7.2rem, transparent 9.5rem);
        mask-image: linear-gradient(to bottom, #000 7.2rem, transparent 9.5rem);
    }
    .entry-actions { gap: 0.7rem; margin-top: 0.65rem; }
    .entry-more,
    .entry-pdf,
    .entry-edit {
        min-height: auto;
        display: inline;
        padding: 0;
        border-radius: 0;
        border: 0;
        border-bottom: 1px solid currentColor;
        background: transparent;
    }
    .entry-edit { background: transparent; color: var(--headword); }
    .sense-tag-input { font-size: 16px; }

    .results-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        margin: 0.95rem 0 0.55rem;
    }
    .results-meta .btn {
        align-self: flex-start;
        min-height: 0;
        display: inline;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .pagination { margin-bottom: 0; }
    .pagination .page-link {
        min-width: 2.5rem;
        min-height: 2.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .site-footer {
        padding: 0.55rem 0 calc(0.55rem + env(safe-area-inset-bottom));
        font-size: 0.84rem;
    }

    .words-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
        margin-bottom: 0.9rem;
    }
    .words-toolbar h2 { font-size: 1.22rem; }
    .words-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
    .words-actions .btn {
        min-height: 2.65rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 0.9rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .words-filter { padding: 0.7rem 0; }
    .words-filter-grid { grid-template-columns: 1fr; }
    .words-filter-grid .form-select,
    .words-filter-grid .form-control {
        min-height: 48px;
        font-size: 16px;
    }
    .words-filter-submit .btn {
        width: 100%;
        min-height: 48px;
    }

    .words-table-wrap {
        overflow: visible;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
    .words-table,
    .words-table.is-grouped,
    .words-table.is-flat,
    .words-table thead,
    .words-table tbody,
    .words-table tr,
    .words-table th,
    .words-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    .words-table { border: 0; }
    .words-table thead { display: none; }
    .words-cell { max-height: none; overflow: visible; }
    .words-table tbody tr {
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0.55rem;
        padding: 0.2rem 0 0.55rem;
    }
    .words-table tbody tr.word-group-head {
        margin-bottom: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        border-bottom: 1px solid var(--rule);
    }
    .words-table tbody tr.word-group-head + tr {
        border-radius: 0;
        margin-top: 0;
        margin-bottom: 0;
        border-top: 0;
        box-shadow: none;
    }
    .words-table tbody tr.is-group-last {
        border-radius: 0;
        margin-bottom: 0.75rem;
        box-shadow: none;
    }
    .words-table td {
        border: 0 !important;
        padding: 0.35rem 0;
        overflow-wrap: anywhere;
    }
    .words-table td:not([data-label]),
    .words-table td[data-label=""] { display: none; }
    .words-table .word-group-head td {
        display: block;
        padding: 0.65rem 0;
    }
    .words-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        color: var(--ink-soft);
        margin-bottom: 0.1rem;
        font-style: italic;
    }
    .word-group-title { gap: 0.4rem; }
    .word-group-title .btn {
        min-height: 2.35rem;
        display: inline-flex;
        align-items: center;
    }
    .words-row-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }
    .words-row-actions .btn,
    .words-row-actions form,
    .words-row-actions form .btn {
        width: 100%;
        min-height: 2.5rem;
        margin: 0;
    }
    .words-back {
        width: 100%;
        min-height: 2.65rem;
    }

    .page-word-form h2,
    .page-user-form h2 { font-size: 1.22rem; }
    .page-word-form .form-control,
    .page-word-form .form-select,
    .page-user-form .form-control,
    .page-user-form .form-select,
    .auth-card .form-control {
        font-size: 16px;
        min-height: 48px;
    }
    .page-word-form textarea.form-control { min-height: 6rem; }
    .repeat-row-bar {
        align-items: flex-start;
        padding: 0.45rem;
    }
    .repeat-row-actions { justify-content: flex-end; }
    .repeat-btn,
    .repeat-add,
    .repeat-kind,
    .repeat-label {
        min-height: 2.65rem;
        min-width: 2.65rem;
        font-size: 16px;
    }
    .repeat-kind,
    .repeat-label { min-width: 0; max-width: none; flex: 1 1 100%; }
    .word-form-actions { display: grid; grid-template-columns: 1fr; }
    .word-form-actions .btn {
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .users-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
    }
    .users-toolbar h2 { font-size: 1.22rem; }
    .users-actions { display: grid; grid-template-columns: 1fr; }
    .users-actions .btn {
        min-height: 2.65rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .users-table-wrap {
        overflow: visible;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
    .users-table,
    .users-table thead,
    .users-table tbody,
    .users-table tr,
    .users-table th,
    .users-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    .users-table { border: 0; }
    .users-table thead { display: none; }
    .users-table tbody tr {
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0.55rem;
        padding: 0.2rem 0 0.55rem;
    }
    .users-table td {
        border: 0 !important;
        padding: 0.35rem 0;
        overflow-wrap: anywhere;
    }
    .users-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        color: var(--ink-soft);
        margin-bottom: 0.1rem;
        font-style: italic;
    }
    .users-row-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }
    .users-row-actions .btn,
    .users-row-actions form,
    .users-row-actions form .btn {
        width: 100%;
        min-height: 2.5rem;
        margin: 0;
    }
    .user-form-card { padding: 0.9rem 0; }

    .home-split,
    .thanks-form-grid { grid-template-columns: 1fr; }
    .quiz-choice { min-height: 2.85rem; font-size: 16px; }
    .wotd-card.plate { padding: 1.1rem 0.9rem 1.2rem; }
    .desk-tile {
        border-right: 0;
        padding-left: 0;
        padding-right: 0;
    }
    .rich-btn {
        min-height: 2.45rem;
        padding: 0.35rem 0.65rem;
        font-size: 0.86rem;
    }
    .rich-symbols-panel {
        width: min(22rem, calc(100vw - 2.2rem));
        max-height: 14rem;
        left: auto;
        right: 0;
    }
    .modal-dialog { margin: 0.75rem; }
    .modal-footer { flex-wrap: wrap; gap: 0.45rem; }
    .modal-footer .btn { min-height: 2.5rem; flex: 1 1 8rem; }
}

@media (max-width: 380px) {
    .brand-title { font-size: 0.98rem; }
    .search-bar .btn { min-width: 4.2rem; font-size: 0.9rem; }
    .hero h1 { font-size: 1.12rem; }
    .stat-card { font-size: 0.7rem; padding: 0.5rem 0.12rem; }
    .stat-card strong { font-size: 1.02rem; }
}
