@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&display=swap');

/* ==========================================================================
   DEKLINAATOR — EDITORIAL (warm paper, crimson accent)
   Fraunces display / Newsreader body. Restrained, typographic, hairline rules.
   ========================================================================== */

:root,
[data-theme="light"] {
    --bg: #F2ECE0;
    --surface: #FBF7EE;
    --surface-raised: #FFFBF2;
    --ink: #1C1917;
    --ink-soft: #3D3834;
    --ink-muted: #7A7068;
    --ink-faint: #B3A896;
    --accent: #8B2E2E;
    --accent-soft: #B5584A;
    --rule: #D4CCBF;
    --rule-soft: #E6DFD2;
    --signal-wrong: #B8362A;
    --signal-correct: #3E6B32;
    --signal-near: #B8872A;
    --shadow: 0 1px 0 rgba(28, 25, 23, 0.04), 0 18px 40px -18px rgba(28, 25, 23, 0.18);
    --selection: rgba(139, 46, 46, 0.18);
}

[data-theme="dark"] {
    --bg: #14110E;
    --surface: #1C1915;
    --surface-raised: #22201B;
    --ink: #E8E0D2;
    --ink-soft: #C4BCAD;
    --ink-muted: #928779;
    --ink-faint: #524B42;
    --accent: #C9A06B;
    --accent-soft: #E6BC86;
    --rule: #2A2620;
    --rule-soft: #221F1A;
    --signal-wrong: #E88370;
    --signal-correct: #9AC174;
    --signal-near: #D9A94D;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 20px 45px -15px rgba(0, 0, 0, 0.55);
    --selection: rgba(201, 160, 107, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scrollbar-gutter: stable;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    font-size: 19px;
    line-height: 1.6;
    font-variation-settings: 'opsz' 16;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.028;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-theme="dark"] body::after {
    opacity: 0.06;
    mix-blend-mode: screen;
}

::selection {
    background: var(--selection);
    color: var(--ink);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0;
}

p { margin: 0 0 1em; }

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    transition: color 0.2s ease, border-color 0.2s ease;
}
a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.eyebrow {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

hr.hairline {
    height: 1px;
    background: var(--rule);
    border: none;
    margin: 0;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    font-family: 'Newsreader', serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 0.75em 1.5em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
    button:hover {
        background: var(--ink);
        color: var(--bg);
    }
}
button[data-variant="accent"] {
    border-color: var(--accent);
    color: var(--accent);
}
@media (hover: hover) {
    button[data-variant="accent"]:hover {
        background: var(--accent);
        color: var(--surface);
    }
}
button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

select {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule);
    padding: 0.3em 1.4em 0.3em 0.1em;
    font-family: inherit;
    font-style: italic;
    cursor: pointer;
    color: var(--ink);
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
        linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
    background-position: right 0.5em center, right 0.15em center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    transition: border-color 0.2s ease, color 0.2s ease;
}
select:hover, select:focus {
    outline: none;
    border-color: var(--accent);
    color: var(--accent);
}
select option {
    background: var(--surface);
    color: var(--ink);
    font-style: normal;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.98rem;
    color: var(--ink-soft);
    padding: 0.25rem 0;
    transition: color 0.2s ease;
    user-select: none;
    line-height: 1.35;
}
.check:hover { color: var(--ink); }
.check input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--ink-muted);
    background: transparent;
    margin: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.check input[type="checkbox"]:hover { border-color: var(--ink); }
.check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.check input[type="checkbox"]:checked::after {
    content: "";
    width: 7px;
    height: 4px;
    border-left: 1.5px solid var(--surface);
    border-bottom: 1.5px solid var(--surface);
    transform: translateY(-1px) rotate(-45deg);
}
.check.disabled,
.check.disabled:hover {
    color: var(--ink-faint);
    cursor: not-allowed;
}
.check.disabled input[type="checkbox"] {
    border-color: var(--ink-faint);
    cursor: not-allowed;
}

.enter-key {
    font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1;
    color: var(--ink);
    opacity: 1;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.enter-key.ready {
    color: var(--accent);
    border-color: var(--accent);
}
button.enter-key:hover {
    background: var(--accent);
    color: var(--surface);
    border-color: var(--accent);
}

.blazor-error-boundary {
    background: var(--accent);
    color: var(--surface);
    padding: 0.9rem 1.2rem;
    font-family: 'Newsreader', serif;
    font-style: italic;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--rule); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }

:focus-visible {
    outline: 1px dashed var(--accent);
    outline-offset: 3px;
}

/* ==========================================================================
   LAYOUT — MainLayout
   ========================================================================== */

.shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.shell-nav {
    border-right: 1px solid var(--rule);
    padding: 2.75rem 0 2rem;
    background: var(--surface);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.shell-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.shell-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1.3rem 3rem;
    border-bottom: 1px solid var(--rule);
    min-height: 68px;
}

.shell-header-tools {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.shell-content {
    flex: 1;
    padding: 1.5rem 3rem 5rem;
    min-width: 0;
}

.theme-toggle {
    position: relative;
    width: 34px;
    height: 34px;
    border: none;
    padding: 0;
    background: transparent;
    color: var(--ink-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    letter-spacing: 0;
    text-transform: none;
    font-size: inherit;
    border-radius: 50%;
    transition: color 0.25s ease, background-color 0.25s ease;
}
.theme-toggle:hover {
    background: transparent;
    color: var(--accent);
}

.theme-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    transition:
        opacity 0.35s cubic-bezier(0.4, 0.0, 0.2, 1),
        transform 0.45s cubic-bezier(0.4, 0.0, 0.2, 1);
}
[data-theme="light"] .theme-icon-sun {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}
[data-theme="light"] .theme-icon-moon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(-40deg);
}
[data-theme="dark"] .theme-icon-sun {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(40deg);
}
[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

#blazor-error-ui {
    background: var(--accent);
    color: var(--surface);
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.8rem 1.4rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-style: italic;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.7rem;
    border-bottom: none;
    color: var(--surface);
}

@media (max-width: 860px) {
    .shell {
        grid-template-columns: 1fr;
    }
    .shell-nav {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--rule);
        padding: 1.5rem 0;
    }
    .shell-header, .shell-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .shell-content { padding-top: 1.25rem; }
}

/* ==========================================================================
   NAV MENU
   ========================================================================== */

.nav-root {
    padding: 0 1.75rem;
    font-family: 'Newsreader', serif;
}

.nav-mark {
    font-family: 'Fraunces', serif;
    font-size: 1.4rem;
    color: var(--accent);
    opacity: 0.7;
    line-height: 1;
    letter-spacing: 0.2em;
    margin: 0 0 1.1rem;
    user-select: none;
}
.nav-mark::before {
    content: "⁂";
}

.brand {
    display: block;
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.4rem;
    color: var(--ink);
    border-bottom: 1px solid var(--rule);
    padding: 0 0 0.85rem;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    font-variation-settings: 'opsz' 48;
    transition: color 0.2s ease, border-color 0.2s ease;
    user-select: none;
}
.brand:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.nav-language .culture-select {
    width: 100%;
}

.nav-language .culture-trigger {
    width: 100%;
}

.nav-language-label {
    display: block;
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 0.2rem;
}

.nav-language .culture-menu {
    left: 0;
    right: auto;
}

.nav-link {
    display: block;
    padding: 0.4rem 0 0.4rem 1.25rem;
    color: var(--ink-soft);
    font-size: 0.98rem;
    font-style: italic;
    border-bottom: none;
    position: relative;
    transition: color 0.2s ease, padding-left 0.25s ease;
}
.nav-link::before {
    content: "·";
    position: absolute;
    left: 0.25rem;
    top: 0.4rem;
    color: var(--ink-faint);
    transition: color 0.2s ease;
    font-size: 1.1em;
    line-height: 1.35;
    background: none;
    width: auto;
    height: auto;
    clip-path: none;
    transform: none;
}
.nav-link:hover {
    color: var(--ink);
    padding-left: 1.5rem;
}
.nav-link:hover::before {
    color: var(--accent);
}
.nav-link.active {
    color: var(--accent);
    font-style: normal;
}
.nav-link.active::before {
    content: "—";
    color: var(--accent);
    font-size: 0.85em;
    top: 0.55rem;
    background: none;
    width: auto;
    height: auto;
    clip-path: none;
}

/* ==========================================================================
   HOME / LANDING
   ========================================================================== */

.landing {
    max-width: 640px;
    margin: 4rem auto 0;
    text-align: center;
    padding: 2rem 1rem;
}

/* Markup text is the deco glyph ("◆"); hide it with font-size: 0 and
   render "§" via ::after instead. */
.landing-mark {
    font-family: 'Fraunces', serif;
    font-size: 0;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 1.25rem;
    letter-spacing: 0.1em;
    user-select: none;
    display: block;
    gap: 0;
}
.landing-mark::before {
    content: none;
}
.landing-mark::after {
    content: "§";
    display: inline-block;
    font-size: 2rem;
    font-family: 'Fraunces', serif;
    font-style: normal;
    color: var(--accent);
    opacity: 0.7;
    letter-spacing: 0.1em;
}

.landing-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(3rem, 8vw, 5.5rem);
    color: var(--ink);
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0 0 2rem;
    font-variation-settings: 'opsz' 144, 'SOFT' 50;
    text-transform: none;
    user-select: none;
}

.landing-rule {
    border: none;
    height: 1px;
    width: 64px;
    background: var(--rule);
    margin: 2rem auto 2.25rem;
}

.landing-search {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    max-width: 440px;
    margin: 0 auto 0.5rem;
    border: none;
    border-bottom: 1px solid var(--rule);
    box-shadow: none;
    padding: 0;
    background: transparent;
    transition: border-color 0.25s ease;
}
.landing-search:focus-within {
    border-color: transparent;
    border-bottom-color: var(--accent);
    box-shadow: none;
}

.landing-search-hint {
    max-width: 440px;
    margin: 0 auto 2.25rem;
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--ink-muted);
    text-align: left;
    letter-spacing: 0.01em;
}

.landing-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.5rem 0.1rem 0.7rem;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--ink);
    min-width: 0;
}
.landing-search-input::placeholder {
    color: var(--ink-faint);
    font-style: italic;
}
.landing-search-input::-webkit-search-cancel-button { appearance: none; }

.landing-search-submit {
    padding: 0 0.35rem;
    cursor: pointer;
}

.landing-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 0;
}

.landing-links a {
    display: inline-flex;
    align-items: baseline;
    gap: 0.75rem;
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    font-style: italic;
    font-weight: 400;
    color: var(--ink);
    border: none;
    border-bottom: 1px solid var(--rule);
    padding: 0.3rem 0;
    letter-spacing: normal;
    text-transform: none;
    background: transparent;
    transition: color 0.2s ease, border-color 0.2s ease, gap 0.25s ease;
    font-variation-settings: 'opsz' 24;
}

.landing-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    letter-spacing: normal;
    gap: 1.1rem;
}

.landing-link-arrow {
    font-style: normal;
    color: var(--ink-muted);
    transition: color 0.2s ease;
    transform: none;
}

.landing-links a:hover .landing-link-arrow {
    color: var(--accent);
    transform: none;
}

/* ==========================================================================
   CONJUGATION PRACTICE (specimen)
   ========================================================================== */

.specimen {
    background: var(--surface);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow);
    padding: 4.25rem 3.5rem 3.25rem;
    width: 100%;
    max-width: 620px;
    margin: 1rem auto 0;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.45s ease, border-color 0.3s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.4s ease;
}

.specimen::before,
.specimen::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 1px;
    background: var(--accent);
    opacity: 0.55;
}
.specimen::before { top: 18px; }
.specimen::after { bottom: 18px; }

.specimen:hover {
    border-color: var(--ink-muted);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(28, 25, 23, 0.04), 0 26px 55px -20px rgba(28, 25, 23, 0.22);
}

.specimen-eyebrow {
    font-family: 'Newsreader', serif;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 auto 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    row-gap: 0.2rem;
    min-height: 4.5rem;
    padding: 0 0.75rem 0.75rem;
    border-bottom: 1px solid var(--rule);
    width: 22rem;
    max-width: 100%;
    text-align: center;
    line-height: 1.25;
    position: static;
}
.specimen-eyebrow::before,
.specimen-eyebrow::after {
    content: none;
}

.specimen-eyebrow-line {
    display: block;
    min-height: 1.25em;
}

.specimen-eyebrow-line-tense {
    min-height: 2.5em;
}

.specimen-baseform {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1.05;
    color: var(--ink);
    font-variation-settings: 'opsz' 144, 'SOFT' 50;
    margin: 0 0 1.5rem;
    letter-spacing: -0.025em;
}

.specimen-baseform.specimen-empty {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: var(--ink-muted);
}

.specimen-rule {
    width: 56px;
    height: 1px;
    background: var(--rule);
    margin: 1.5rem auto 1.75rem;
    opacity: 1;
    position: static;
}
.specimen-rule::before {
    content: none;
}

.specimen-pronoun {
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-size: 1.3rem;
    color: var(--ink-soft);
    margin-bottom: 1.1rem;
    min-height: 2.1rem;
    line-height: 1.6;
}

.specimen-answer {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 500;
    line-height: 1.1;
    height: calc(1.1em + 1.25rem + 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    letter-spacing: -0.015em;
    font-variation-settings: 'opsz' 144;
}

.specimen-answer.revealed {
    animation: specimen-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes specimen-reveal {
    from { opacity: 0; transform: translateY(6px); letter-spacing: -0.03em; }
    to   { opacity: 1; transform: translateY(0); letter-spacing: -0.015em; }
}

.specimen-placeholder {
    display: inline-block;
    color: var(--ink-faint);
    letter-spacing: 0.4em;
    font-size: 0.8em;
    font-style: normal;
    animation: specimen-placeholder-breath 2.6s ease-in-out infinite;
}

@keyframes specimen-placeholder-breath {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.35; }
}

.specimen-hint {
    margin-top: 2.25rem;
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1.5;
    min-height: 3em;
}

.specimen-tools {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.specimen-tool {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ink-muted);
    letter-spacing: 0;
    text-transform: none;
    font-size: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.specimen-tool svg {
    width: 22px;
    height: 22px;
}
.specimen-tool:hover {
    background: var(--rule-soft);
    color: var(--accent);
    border-color: transparent;
}
.specimen-tool.copied {
    color: var(--accent);
    border-color: transparent;
}
.specimen-tool.copied:hover {
    background: transparent;
}

.specimen-mode {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 2;
}

.specimen-mode .check span {
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
}

.specimen-input {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 500;
    font-style: italic;
    line-height: 1.1;
    letter-spacing: -0.015em;
    font-variation-settings: 'opsz' 144;
    color: var(--accent);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule);
    text-align: center;
    padding: 0.1rem 0.25rem;
    width: min(100%, 16ch);
    outline: none;
    caret-color: var(--accent);
    transition: color 0.2s ease, border-color 0.2s ease, caret-color 0.2s ease;
}

.specimen-input:focus {
    border-color: var(--ink-muted);
}

.specimen-input.wrong {
    color: var(--signal-wrong);
    border-color: var(--signal-wrong);
    caret-color: var(--signal-wrong);
}

.specimen-input.correct {
    color: var(--signal-correct);
    border-color: var(--signal-correct);
    caret-color: transparent;
}

.specimen-input.near {
    color: var(--signal-near);
    border-color: var(--signal-near);
    caret-color: transparent;
}

.missed-diacritic {
    background: transparent;
    color: var(--signal-near);
    text-decoration: underline;
    text-decoration-color: var(--signal-near);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.22em;
}

.specimen-input::placeholder {
    color: var(--ink-faint);
    font-style: italic;
}

.specimen-chars {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.1rem;
}

.specimen-chars.hidden {
    visibility: hidden;
    pointer-events: none;
}

.specimen-char {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--ink-muted);
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 0.35rem 0.55rem;
    min-width: 2rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.specimen-char:hover,
.specimen-char:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    outline: none;
}

.specimen-char:active {
    background: var(--rule-soft);
}

@media (max-width: 560px) {
    .specimen {
        padding: 2.5rem 0.5rem 1.5rem;
        margin-top: 0;
        max-width: none;
        border: 0;
        box-shadow: none;
        background: transparent;
    }
    .specimen::before,
    .specimen::after {
        content: none;
    }
    .specimen-eyebrow {
        margin: 0 auto 1rem;
        min-height: 2.5rem;
        padding: 0 0.75rem 0.5rem;
    }
    .specimen-baseform {
        margin: 0 0 0.75rem;
    }
    .specimen-rule {
        margin: 0.75rem auto 1rem;
    }
    .specimen-pronoun {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
        min-height: 1.5rem;
    }
    .specimen-hint {
        margin-top: 1rem;
        min-height: 1.5em;
    }
    .specimen-mode { display: none; }
    .specimen-chars.hidden { display: none; }
    .specimen-tools { top: 6px; right: 6px; }
    .specimen:hover {
        box-shadow: none;
        transform: none;
        border-color: transparent;
    }
    .specimen-baseform,
    .specimen-answer { overflow-wrap: anywhere; }
}

/* ==========================================================================
   VERB FILTER (aside)
   ========================================================================== */

.filter-panel {
    font-family: 'Newsreader', serif;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0.25rem 0 2rem;
}

.filter-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--ink);
    letter-spacing: -0.015em;
    margin: 0 0 0.55rem;
    font-variation-settings: 'opsz' 18;
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    text-align: left;
    text-transform: none;
}
.filter-title::before {
    content: "§";
    font-style: normal;
    font-size: 0.95em;
    color: var(--accent);
    opacity: 0.7;
}

.filter-divider {
    border: none;
    height: 1px;
    background: var(--rule);
    margin: 0 0 1.9rem;
    width: auto;
    opacity: 1;
}

.filter-search {
    margin-bottom: 2rem;
}

.filter-search-field {
    position: relative;
    width: 100%;
}

.filter-search-input {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule);
    padding: 0.35rem 1.7rem 0.5rem 0.1rem;
    color: var(--ink);
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.05rem;
    font-variation-settings: 'opsz' 18;
    letter-spacing: -0.005em;
    outline: none;
    transition: border-color 160ms ease;
}

.filter-search-input::placeholder {
    color: var(--ink-muted);
    opacity: 0.7;
}

.filter-search-input:focus {
    border-bottom-color: var(--accent);
}

.filter-search-input::-webkit-search-cancel-button {
    filter: grayscale(1) opacity(0.55);
    cursor: pointer;
}

.filter-search-enter {
    position: absolute;
    right: 0.1rem;
    top: 50%;
    transform: translateY(-55%);
    pointer-events: none;
}

.filter-search-hint {
    margin: 0.45rem 0 0;
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--ink-muted);
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.filter-search-suggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 20;
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-top: 1px solid var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    max-height: 16rem;
    overflow-y: auto;
}

.filter-search-suggestion {
    padding: 0.35rem 0.7rem;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--ink);
    cursor: pointer;
    line-height: 1.35;
}

.filter-search-suggestion.highlighted {
    background: var(--rule);
    color: var(--accent);
}

.filter-label {
    font-family: 'Newsreader', serif;
    font-weight: 500;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin: 0 0 0.8rem;
}

.filter-groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 1.75rem;
    row-gap: 0;
}

.filter-group {
    margin-bottom: 1.65rem;
    position: relative;
}
.filter-group + .filter-group::before {
    content: "";
    position: absolute;
    top: -0.9rem;
    left: 0;
    width: 18px;
    height: 1px;
    background: var(--rule);
    opacity: 0.6;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.filter-prefs {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

@media (max-width: 900px) {
    .filter-groups {
        grid-template-columns: minmax(0, 1fr);
    }
}

.filter-clear-top {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}
.filter-clear-top .filter-apply,
.filter-clear-top .filter-clear {
    flex: 1;
}

.filter-apply {
    border-color: var(--accent);
    color: var(--accent);
}
.filter-apply:hover {
    background: var(--accent);
    color: var(--surface);
}

.filter-clear {
    border-color: var(--rule) !important;
    color: var(--ink-muted) !important;
}
.filter-clear:hover {
    background: var(--rule-soft) !important;
    color: var(--ink) !important;
    border-color: var(--ink-muted) !important;
}

/* ==========================================================================
   VERB LAYOUT
   ========================================================================== */

.verb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2.5rem;
    align-items: start;
    max-width: 1400px;
}

@media (min-width: 1750px) {
    .verb-layout {
        grid-template-columns: minmax(0, 1fr) 440px;
        max-width: 1600px;
    }
}

.verb-stage {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.verb-aside {
    padding: 0 0.25rem 0 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

@media (max-width: 1100px) {
    .verb-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 3rem;
    }
    .verb-aside {
        position: static;
        max-height: none;
        max-width: 420px;
        margin: 0 auto;
        width: 100%;
    }
}

/* ==========================================================================
   VERB TABLE
   ========================================================================== */

.verb-table {
    font-family: 'Newsreader', serif;
    width: 100%;
    align-self: stretch;
    padding: 0.25rem 0 1.5rem;
}

.verb-empty {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.75rem;
    color: var(--ink-muted);
    letter-spacing: -0.015em;
    padding: 3rem 0;
    font-variation-settings: 'opsz' 48;
}

.verb-headwords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: baseline;
    padding: 0 0 0.9rem;
    margin: 0 0 1.1rem;
    border: none;
    border-bottom: 1px solid var(--rule);
    box-shadow: none;
    background: transparent;
    position: static;
}
.verb-headwords::before,
.verb-headwords::after {
    content: none;
}

.verb-headword {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.verb-headword-text {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.55rem;
    color: var(--ink);
    letter-spacing: -0.02em;
    font-variation-settings: 'opsz' 48;
    line-height: 1.1;
}

.verb-headword-link {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--ink-muted);
    border: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.verb-headword-link:hover {
    background: var(--rule-soft);
    color: var(--accent);
}

.moodLabel {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--ink);
    margin: 1.1rem 0 0.35rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--rule);
    letter-spacing: -0.015em;
    font-variation-settings: 'opsz' 48;
    text-transform: none;
    display: block;
    gap: 0;
}
.moodLabel::before,
.moodLabel::after {
    content: none;
}

.moodLabel:first-child { margin-top: 0.15rem; }

.moodContainer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 0.4rem;
    align-items: start;
}

.moodContainer.indicative {
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
}

.tenseCell {
    min-width: 0;
    break-inside: avoid;
}

.tenseLabel {
    font-family: 'Newsreader', serif;
    font-weight: 500;
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin: 0.45rem 0 0.2rem;
}

.voiceLabel {
    font-family: 'Newsreader', serif;
    font-style: italic;
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin: 0.25rem 0 0.1rem;
}

.conjugationContainer {
    display: grid;
    grid-template-columns: minmax(2.2em, auto) 1fr;
    column-gap: 0.6rem;
    row-gap: 0;
    align-items: baseline;
    padding: 0.15rem 0 0.2rem 0.5rem;
    border-left: 1px solid var(--rule);
    margin: 0.1rem 0 0.2rem;
}

.conjugationLabel {
    font-style: italic;
    color: var(--ink-muted);
    font-size: 0.76rem;
    line-height: 1.3;
}

.conjugationValue {
    font-family: 'Fraunces', serif;
    font-size: 1rem;
    color: var(--ink);
    font-variation-settings: 'opsz' 24;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
}

.conjugationValueLine + .conjugationValueLine {
    margin-top: 0.05rem;
}

@media (max-width: 620px) {
    .moodContainer {
        grid-template-columns: minmax(0, 1fr);
    }
    .moodContainer.indicative {
        grid-template-rows: none;
        grid-auto-flow: row;
    }
}

/* ==========================================================================
   CULTURE SELECTOR
   ========================================================================== */

.culture-select {
    position: relative;
    display: inline-flex;
    font-family: 'Newsreader', serif;
    font-size: 0.9rem;
}

.culture-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.1rem 0.35rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    font-family: inherit;
    font-style: italic;
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    min-width: 128px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.culture-trigger:hover,
.culture-select.open .culture-trigger {
    background: transparent;
    color: var(--accent);
    border-bottom-color: var(--accent);
    letter-spacing: 0;
}

.culture-current {
    flex: 1;
    text-align: left;
}

.culture-chevron {
    color: var(--ink-muted);
    transition: color 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.culture-globe {
    color: var(--ink-muted);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.culture-trigger:hover .culture-globe,
.culture-select.open .culture-globe {
    color: var(--accent);
}

.culture-trigger:hover .culture-chevron,
.culture-select.open .culture-chevron {
    color: var(--accent);
}

.culture-select.open .culture-chevron {
    transform: rotate(180deg);
}

.culture-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: transparent;
}

.culture-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 100%;
    z-index: 50;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--surface-raised);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow);
    animation: culture-fade 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes culture-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.culture-option {
    padding: 0.4rem 1.2rem 0.4rem 1.2rem;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: inherit;
    font-style: italic;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
    position: relative;
}

.culture-option:hover {
    color: var(--ink);
    background: var(--rule-soft);
}

.culture-option.selected {
    color: var(--accent);
    font-style: normal;
}

.culture-option.selected::before {
    content: "—";
    position: absolute;
    left: 0.5rem;
    top: 0.4rem;
    color: var(--accent);
    font-size: 0.8em;
}

/* ==========================================================================
   HIDE DECO-ONLY MARKUP
   Markup (Razor) is the deco superset; these rules remove decorations that
   don't belong in the editorial style.
   ========================================================================== */

.deco-corner,
.landing-sunburst,
.filter-ornament,
.shell-header-nameplate,
.nav-underline {
    display: none !important;
}

.nav-mark svg,
.landing-mark svg,
.filter-ornament svg {
    display: none;
}

/* ==========================================================================
   PHONE BAR (≤480px) — collapsed nav + tools drawers
   ========================================================================== */

.shell-phone-bar { display: none; }
.specimen-hint .hint-phone { display: none; }
.shell-phone-bar .phone-trigger-filter { display: none; }
.culture-current-short { display: none; }

@media (max-width: 480px) {
    :root { --phone-bar-h: 56px; }

    .specimen-hint .hint-desktop { display: none; }
    .specimen-hint .hint-phone { display: inline; }

    body:has(.filter-panel) .phone-trigger-filter {
        display: inline-flex;
    }

    .culture-trigger-ui .culture-current-full { display: none; }
    .culture-trigger-ui .culture-current-short { display: inline; }

    .shell-phone-bar {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        position: sticky;
        top: 0;
        z-index: 60;
        height: var(--phone-bar-h);
        padding: 0 0.5rem;
        background: var(--surface);
        border-bottom: 1px solid var(--rule);
    }
    .phone-trigger {
        background: transparent;
        border: 1px solid var(--rule);
        color: var(--ink);
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
        flex-shrink: 0;
    }
    .phone-trigger:active {
        color: var(--accent);
        border-color: var(--accent);
    }
    .phone-brand {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: center;
        font-family: 'Fraunces', serif;
        font-style: italic;
        font-weight: 400;
        font-size: 1.15rem;
        color: var(--ink);
    }
    .shell-phone-bar .theme-toggle { flex-shrink: 0; }

    .shell {
        margin: 0;
        min-height: calc(100vh - var(--phone-bar-h));
        grid-template-columns: minmax(0, 1fr);
    }
    .shell > .deco-corner { display: none; }
    .shell-nav { display: none; }
    .shell-header { display: none; }
    .shell-header-nameplate { display: none; }
    .shell-header-tools { display: none; }
    .shell-content { padding: 0.6rem 1rem 1rem; }

    [data-drawer="nav"] .shell-nav {
        display: block;
        position: fixed;
        top: var(--phone-bar-h);
        left: 0;
        right: 0;
        z-index: 55;
        max-height: calc(100vh - var(--phone-bar-h));
        overflow-y: auto;
        background: var(--surface);
        border: none;
        border-bottom: 1px solid var(--rule);
        box-shadow: var(--shadow);
        padding: 1.25rem 0.75rem 1.5rem;
        animation: drawer-slide 0.2s ease-out;
    }

    [data-drawer="tools"] .shell-header {
        display: flex;
        position: fixed;
        top: var(--phone-bar-h);
        left: 0;
        right: 0;
        z-index: 55;
        background: var(--surface);
        border-bottom: 1px solid var(--rule);
        box-shadow: var(--shadow);
        padding: 0.75rem 0.25rem;
        justify-content: center;
        animation: drawer-slide 0.2s ease-out;
    }
    [data-drawer="tools"] .shell-header-tools {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.35rem;
        justify-content: center;
        align-items: center;
    }
    [data-drawer="tools"] .shell-header-tools .culture-trigger {
        min-width: 0;
        padding: 0.3rem 0.25rem 0.35rem;
        gap: 0.35rem;
    }

    .landing {
        margin-top: 0;
        padding: 0.75rem 1rem 0.5rem;
    }
    .landing-mark { margin-bottom: 0.5rem; }
    .landing-mark::after { font-size: 1.5rem; }
    .landing-title {
        font-size: clamp(2.5rem, 13vw, 4rem);
        margin: 0 0 0.75rem;
    }
    .landing-rule { margin: 0.75rem auto 1rem; }
    .landing-search-hint { margin-bottom: 1.25rem; }
    .landing-links { gap: 0.6rem; }

    .verb-aside { display: none; }
    [data-drawer="filter"] .verb-aside {
        display: block;
        position: fixed;
        top: var(--phone-bar-h);
        left: 0;
        right: 0;
        z-index: 55;
        max-height: calc(100vh - var(--phone-bar-h));
        max-width: none;
        margin: 0;
        overflow-y: auto;
        background: var(--surface);
        border-bottom: 1px solid var(--rule);
        box-shadow: var(--shadow);
        padding: 1rem;
        animation: drawer-slide 0.2s ease-out;
    }

    @keyframes drawer-slide {
        from { transform: translateY(-8px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
}

@media (max-width: 480px) and (hover: hover) {
    .phone-trigger:hover {
        color: var(--accent);
        border-color: var(--accent);
    }
}

.testing-marker {
    font-family: 'Newsreader', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}
.shell-header > .testing-marker {
    margin-right: auto;
    padding-left: 0.5rem;
}
.phone-brand .testing-marker {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
}
