/* ============================================
   Kamusi ya Vina — Modern Design System
   ============================================ */

/* ── CSS Custom Properties ── */
:root {
    /* Colors */
    --bg: #f5f2ea;
    --bg-gradient: linear-gradient(135deg, #f5f2ea 0%, #efeade 100%);
    --surface: #ffffff;
    --surface-soft: #faf8f3;
    --surface-hover: #f3efe6;
    --text: #1d2520;
    --text-secondary: #5a6b5f;
    --text-muted: #889a8e;
    --line: #ddd6c7;
    --line-light: #e8e3d6;
    --brand: #177245;
    --brand-light: #1f8a54;
    --brand-dark: #0f5734;
    --brand-glow: rgba(23, 114, 69, 0.15);
    --gold: #f0c36a;
    --gold-light: #f8d98a;
    --accent: #b13b2e;
    --accent-light: #d44a3a;
    --success: #15803d;
    --success-bg: #e8f5ee;
    --error: #b13b2e;
    --error-bg: #fbe9e7;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(26, 31, 27, 0.06);
    --shadow-md: 0 4px 16px rgba(26, 31, 27, 0.08);
    --shadow-lg: 0 12px 40px rgba(26, 31, 27, 0.1);
    --shadow-xl: 0 22px 60px rgba(26, 31, 27, 0.12);
    --shadow-glow: 0 0 20px rgba(23, 114, 69, 0.12);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.25s;
    --duration-slow: 0.4s;

    /* Layout */
    --content-max: 1200px;
    --content-padding: clamp(16px, 4vw, 32px);
}

/* ── Dark Mode ── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17191d;
        --bg-gradient: linear-gradient(135deg, #17191d 0%, #1d2025 100%);
        --surface: #24272d;
        --surface-soft: #2a2e34;
        --surface-hover: #32363d;
        --text: #ecedee;
        --text-secondary: #c4c8cc;
        --text-muted: #8f9499;
        --line: #3a3e45;
        --line-light: #2f3339;
        --brand: #3dd68c;
        --brand-light: #5ce8a0;
        --brand-dark: #2db874;
        --brand-glow: rgba(61, 214, 140, 0.18);
        --gold: #e0b84c;
        --gold-light: #f0cc60;
        --accent: #f06a5a;
        --accent-light: #ff8778;
        --success: #4ade80;
        --success-bg: #1a2e22;
        --error: #f06a5a;
        --error-bg: #2e1c1a;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
        --shadow-xl: 0 22px 60px rgba(0, 0, 0, 0.55);
        --shadow-glow: 0 0 20px rgba(61, 214, 140, 0.12);
    }

    .word-dialog::backdrop {
        background: rgba(0, 0, 0, 0.65);
    }
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg);
    background-image: var(--bg-gradient);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    transition: color var(--duration-fast) var(--ease-out);
}

img {
    max-width: 100%;
    display: block;
}

.sr-only {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Selection ── */
::selection {
    background: var(--brand-glow);
    color: var(--brand);
}

/* ── Focus ── */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════
   HEADER / NAVIGATION
   ═══════════════════════════════════════════ */

.site-header {
    margin: 0 auto;
    max-width: var(--content-max);
    width: min(100% - var(--content-padding), var(--content-max));
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 0;
    min-width: 0;
    animation: fadeDown 0.6s var(--ease-out) both;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand {
    align-items: center;
    display: flex;
    gap: 14px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: var(--radius-md);
    color: #17251d;
    display: inline-flex;
    font-weight: 800;
    font-size: 18px;
    height: 48px;
    justify-content: center;
    width: 48px;
    transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
    box-shadow: 0 2px 8px rgba(240, 195, 106, 0.3);
}

.brand:hover .brand-mark {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 4px 16px rgba(240, 195, 106, 0.4);
}

.brand-text strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
}

.brand-text small {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}

.brand-text {
    line-height: 1.3;
    min-width: 0;
}

.site-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.site-nav a {
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    min-width: 0;
    overflow-wrap: anywhere;
}

.site-nav a:hover {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.site-nav a:active {
    transform: translateY(0);
}

/* ── Mobile menu toggle ── */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
    width: 44px;
    height: 44px;
    padding: 0;
    min-height: 44px;
    transition: all var(--duration-fast) var(--ease-out);
}

.menu-toggle:hover {
    background: var(--surface-soft);
    border-color: var(--text-muted);
}

.menu-toggle svg {
    width: 22px;
    height: 22px;
}

/* ═══════════════════════════════════════════
   VINA PICKER (Dropdown only)
   ═══════════════════════════════════════════ */

.vina-picker {
    margin: 0 auto;
    max-width: var(--content-max);
    width: min(100% - var(--content-padding), var(--content-max));
    margin-bottom: 28px;
    animation: fadeDown 0.5s var(--ease-out) 0.1s both;
}

.vina-picker-inner {
    max-width: 400px;
    position: relative;
}

.vina-picker-label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.vina-picker-select {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    height: 48px;
    padding: 0 40px 0 14px;
    width: 100%;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23889a8e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 14px center;
    background-size: 16px;
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    box-shadow: var(--shadow-sm);
    text-align: left;
}

.vina-picker-select:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.vina-picker-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow-lg);
}

.vina-picker-loading {
    align-items: center;
    color: var(--brand);
    display: none;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    margin-top: 8px;
}

.vina-picker-loading[hidden] {
    display: none !important;
}

.vina-picker.is-loading .vina-picker-select {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow-lg);
}

.vina-picker.is-loading .vina-picker-loading:not([hidden]) {
    display: inline-flex;
}

.loading-spinner {
    animation: spin 0.7s linear infinite;
    border: 2px solid var(--line);
    border-top-color: var(--brand);
    border-radius: var(--radius-full);
    height: 14px;
    width: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.eyebrow {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

/* ── Form Elements ── */
label, label span {
    display: grid;
    gap: 6px;
}

label span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

input, select, textarea {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    min-height: 46px;
    padding: 10px 14px;
    width: 100%;
    background: var(--surface);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

input:hover, select:hover, textarea:hover {
    border-color: var(--text-muted);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ── Buttons ── */
button, .button {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border: 0;
    border-radius: var(--radius-md);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    min-height: 46px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

button::after, .button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1));
    pointer-events: none;
}

button:hover, .button:hover {
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 114, 69, 0.35);
}

button:active, .button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(23, 114, 69, 0.25);
}

button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ── Notice / Flash Messages ── */
.notice {
    margin: 0 auto;
    max-width: var(--content-max);
    width: min(100% - var(--content-padding), var(--content-max));
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    padding: 14px 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s var(--ease-out) both;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notice-success {
    background: var(--success-bg);
    color: var(--success);
    border-left: 3px solid var(--success);
}

.notice-error {
    background: var(--error-bg);
    color: var(--error);
    border-left: 3px solid var(--error);
}

/* ═══════════════════════════════════════════
   STATS SECTION
   ═══════════════════════════════════════════ */

.stats {
    margin: 0 auto;
    max-width: var(--content-max);
    width: min(100% - var(--content-padding), var(--content-max));
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
    animation: fadeUp 0.6s var(--ease-out) 0.5s both;
}

.stats article,
.results-panel,
.side-panel,
.contribute {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
}

.stats article:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stats article {
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.stats article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--gold));
    opacity: 0.6;
}

.stats span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.stats strong {
    display: block;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════════════════════
   CONTENT GRID
   ═══════════════════════════════════════════ */

.content-grid {
    margin: 0 auto;
    max-width: var(--content-max);
    width: min(100% - var(--content-padding), var(--content-max));
    margin-bottom: 24px;
    min-width: 0;
    animation: fadeUp 0.6s var(--ease-out) 0.55s both;
}

.section-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    min-width: 0;
}

.section-head > * {
    min-width: 0;
}

.section-head h2 {
    margin-bottom: 0;
}

.section-head .eyebrow {
    margin-bottom: 2px;
}

.result-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    flex: 0 1 auto;
    min-width: 0;
}

.view-toggle {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    display: flex;
    padding: 3px;
    gap: 2px;
    max-width: 100%;
}

.view-toggle a {
    border: 0;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 13px;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.view-toggle a.active,
.view-toggle a:hover {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(23, 114, 69, 0.25);
}

.clear-link {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    transition: all var(--duration-fast) var(--ease-out);
}

.clear-link:hover {
    background: var(--surface-soft);
    color: var(--text);
}

h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
}

h3, p {
    margin-top: 0;
}

/* ═══════════════════════════════════════════
   WORD GRID / CARDS
   ═══════════════════════════════════════════ */

.word-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    padding: 20px;
    min-width: 0;
}

.word-card {
    background: var(--surface-soft);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
    animation: cardIn 0.4s var(--ease-out) both;
}

.word-card:nth-child(1)  { animation-delay: 0.02s; }
.word-card:nth-child(2)  { animation-delay: 0.04s; }
.word-card:nth-child(3)  { animation-delay: 0.06s; }
.word-card:nth-child(4)  { animation-delay: 0.08s; }
.word-card:nth-child(5)  { animation-delay: 0.10s; }
.word-card:nth-child(6)  { animation-delay: 0.12s; }
.word-card:nth-child(7)  { animation-delay: 0.14s; }
.word-card:nth-child(8)  { animation-delay: 0.16s; }
.word-card:nth-child(9)  { animation-delay: 0.18s; }
.word-card:nth-child(10) { animation-delay: 0.20s; }
.word-card:nth-child(11) { animation-delay: 0.22s; }
.word-card:nth-child(12) { animation-delay: 0.24s; }

@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.word-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.word-card[open] {
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: var(--shadow-glow);
}

.word-card summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    list-style: none;
    min-height: 52px;
    padding: 12px 14px;
    user-select: none;
}

.word-card summary::-webkit-details-marker {
    display: none;
}

.word-card summary::marker {
    display: none;
    content: '';
}

.word-card summary:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

.word-name {
    font-size: 17px;
    font-weight: 800;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.word-ending {
    background: rgba(23, 114, 69, 0.08);
    border-radius: var(--radius-full);
    color: var(--brand);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 5px 9px;
    text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
    .word-ending {
        background: rgba(61, 214, 140, 0.15);
        color: var(--brand);
    }
}

.word-details {
    border-top: 1px solid var(--line);
    padding: 14px;
}

.word-details p {
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    font-size: 14px;
}

.word-details blockquote {
    border-left: 3px solid var(--brand);
    color: var(--text-muted);
    margin: 10px 0 0;
    padding-left: 12px;
    font-style: italic;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Comma View ── */
.comma-view {
    color: var(--text-secondary);
    line-height: 2.4;
    padding: 20px;
    font-size: 15px;
}

.comma-word {
    background: transparent;
    border: 0;
    border-radius: var(--radius-full);
    color: var(--brand);
    cursor: pointer;
    display: inline;
    font-size: 16px;
    font-weight: 700;
    min-height: 0;
    padding: 4px 9px;
    transition: all var(--duration-fast) var(--ease-out);
}

.comma-word:hover,
.comma-word.active {
    background: rgba(23, 114, 69, 0.08);
    color: var(--brand-dark);
    transform: translateY(-1px);
}

.comma-word:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.comma-sep {
    color: var(--text-muted);
}

.muted {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   WORD DIALOG
   ═══════════════════════════════════════════ */

.word-dialog {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 28px 80px rgba(26, 31, 27, 0.3);
    color: var(--text);
    max-width: 460px;
    padding: 28px;
    width: min(calc(100% - 32px), 460px);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: dialogIn 0.25s var(--ease-out) both;
}

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

.word-dialog::backdrop {
    background: rgba(23, 37, 29, 0.5);
    animation: backdropIn 0.2s ease both;
}

@keyframes backdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.word-dialog .word-ending {
    display: inline-flex;
    margin-bottom: 10px;
}

.word-dialog h2 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.word-dialog p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
    font-size: 15px;
}

.word-dialog blockquote {
    border-left: 3px solid var(--brand);
    color: var(--text-muted);
    margin: 14px 0 0;
    padding-left: 12px;
    font-style: italic;
    line-height: 1.5;
}

.dialog-close {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    float: right;
    font-size: 20px;
    height: 36px;
    justify-content: center;
    min-height: 36px;
    padding: 0;
    transition: all var(--duration-fast) var(--ease-out);
    width: 36px;
}

.dialog-close:hover {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error);
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════════
   VINA LIST (Sidebar)
   ═══════════════════════════════════════════ */

.vina-list {
    display: grid;
}

.vina-list a {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 14px 22px;
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease-out);
    gap: 12px;
}

.vina-list a:hover {
    background: var(--surface-soft);
}

.vina-list a:last-child {
    border-bottom: 0;
}

.vina-list strong {
    font-size: 15px;
    font-weight: 700;
}

.vina-list span {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    background: var(--surface-soft);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    flex-shrink: 0;
}

.vina-list a:hover span {
    background: var(--surface-hover);
}

/* ═══════════════════════════════════════════
   CONTRIBUTE SECTION
   ═══════════════════════════════════════════ */

.contribute {
    margin: 0 auto;
    max-width: var(--content-max);
    width: min(100% - var(--content-padding), var(--content-max));
    align-items: start;
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    margin-bottom: 28px;
    padding: 28px;
    animation: fadeUp 0.6s var(--ease-out) 0.6s both;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.contribute::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--brand), var(--gold));
    opacity: 0.5;
}

.contribute h2 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.contribute p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
    font-size: 15px;
}

.contribute-form {
    display: grid;
    gap: 16px;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.site-footer {
    margin: 0 auto;
    max-width: var(--content-max);
    width: min(100% - var(--content-padding), var(--content-max));
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 22px 0 32px;
    color: var(--text-muted);
    font-size: 14px;
}

.site-footer a {
    font-weight: 700;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    transition: all var(--duration-fast) var(--ease-out);
}

.site-footer a:hover {
    background: var(--surface-soft);
    color: var(--text);
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */

.empty {
    color: var(--text-muted);
    grid-column: 1 / -1;
    margin: 0;
    padding: 24px;
    text-align: center;
    font-size: 14px;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: grid;
    gap: 10px;
    max-width: 400px;
    width: calc(100% - 40px);
}

.toast {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s var(--ease-out) both;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--error);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(20px); }
}

/* ═══════════════════════════════════════════
   SCROLL INDICATOR
   ═══════════════════════════════════════════ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--gold));
    width: 0%;
    transition: width 0.1s linear;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
    .contribute {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    .menu-toggle {
        display: flex;
        flex-shrink: 0;
    }

    .site-nav {
        display: none;
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        gap: 4px;
        padding: 12px 0 4px;
        border-top: 1px solid var(--line);
        margin-top: 4px;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        width: 100%;
        max-width: 100%;
        text-align: center;
        justify-content: center;
        font-size: 15px;
        padding: 12px 16px;
        border-radius: var(--radius-md);
        border: 0;
        background: var(--surface-soft);
        color: var(--text);
    }

    .site-nav a:hover {
        background: var(--surface-hover);
    }

    .site-header {
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        max-width: 100%;
    }

    .site-header .brand {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .site-header .brand-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .site-header .menu-toggle {
        order: 1;
    }

    .site-header .site-nav.open {
        order: 2;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .result-actions {
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
    }

    .view-toggle {
        flex: 1 1 100%;
    }

    .view-toggle a {
        flex: 1 1 0;
        text-align: center;
    }

    .word-grid {
        grid-template-columns: 1fr 1fr;
        padding: 14px;
        gap: 8px;
    }

    .comma-view {
        padding: 14px;
        font-size: 14px;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .comma-word {
        font-size: 14px;
        padding: 3px 7px;
    }

    .word-dialog {
        padding: 20px;
        width: min(calc(100% - 24px), 460px);
        max-height: 80vh;
        overflow-y: auto;
    }

    .word-dialog h2 {
        font-size: 22px;
    }

    .contribute {
        padding: 20px;
        gap: 24px;
    }

    .contribute h2 {
        font-size: 24px;
    }

    .site-footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .word-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Print ── */
@media print {
    .site-nav,
    .contribute,
    .site-footer {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }
}
