@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Backgrounds */
    --color-background-primary: #ffffff;
    --color-background-secondary: #f5f4ef;
    --color-background-tertiary: #eceae3;
/*    --color-background-primary: #fff8f2;
    --color-background-secondary: #f4ede4;
    --color-background-tertiary: #e8ddd1;*/
    /* Brand Purple */
    --color-purple-50: #F4EFFE;
    --color-purple-100: #DECCF7;
    --color-purple-200: #C5A8EE;
    --color-purple-400: #9B6DD6;
    --color-purple-600: #6B42AD;
    --color-purple-800: #4A2885;
    --color-purple-900: #231A3C;
    --color-text-translation: #4A2885;
    /* Accent Red */
    --color-red-50: #FCEBEB;
    --color-red-400: #E24B4A;
    --color-red-800: #791F1F;
    --color-reddish-brown: #c73f3e;
    /* Text */
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #5a5855;
    --color-text-tertiary: #9c9890;
    /* Borders */
    --color-border-primary: #aba8a0;
    --color-border-secondary: #cbc8c0;
    --color-border-tertiary: #e5e3dc;
    /* Border Radius */
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Navbar Colors - Light Theme */
    --navbar-logo-color: #1a1a1a;
    --navbar-logo-subtitle-color: #6B42AD;
    --navbar-text-color: #1a1a1a;
    --navbar-icon-color: rgba(0, 0, 0, 0.65);
    --navbar-icon-hover-color: rgba(0, 0, 0, 0.9);
    --navbar-btn-border: rgba(0, 0, 0, 0.2);
    --navbar-btn-text: rgba(0, 0, 0, 0.75);
    --navbar-btn-border-hover: rgba(0, 0, 0, 0.4);
    --navbar-btn-text-hover: #1a1a1a;
    --navbar-search-bg: rgba(0, 0, 0, 0.06);
    --navbar-search-bg-focus: rgba(0, 0, 0, 0.1);
    --navbar-search-text: #1a1a1a;
    --navbar-search-placeholder: rgba(0, 0, 0, 0.45);
    --navbar-search-icon: rgba(0, 0, 0, 0.45);
    --navbar-border: rgba(0, 0, 0, 0.08);
}

.suggestion-success {
    color: #0f6b2f;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #e7f6ec;
    border-radius: var(--border-radius-md);
}

.suggestion-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border-tertiary, #e0e0e0);
    margin-bottom: 1rem;
    gap: 0;
}

.suggestion-tab {
    flex: 1;
    padding: 8px 6px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    transition: color 0.15s, border-color 0.15s;
}

.suggestion-tab:hover {
    color: var(--color-purple-600, #6a4bc4);
}

.suggestion-tab.active {
    color: var(--color-purple-600, #6a4bc4);
    border-bottom-color: var(--color-purple-600, #6a4bc4);
}

.suggestion-dialog textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--color-border-secondary, #ccc);
    border-radius: var(--border-radius-sm, 4px);
    padding: 6px 8px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}

html.dark {
/*    --color-background-primary: #1a1a1a;
    --color-background-secondary: #242420;
    --color-background-tertiary: #2e2e28;*/
    --color-background-primary: #1f1a18;
    --color-background-secondary: #2a2421;
    --color-background-tertiary: #362f2b;
    --color-text-primary: #f0ede8;
    --color-text-secondary: #b0ada8;
    --color-text-tertiary: #706d68;
    --color-border-primary: #4e4c48;
    --color-border-secondary: #3e3c38;
    --color-border-tertiary: #2e2c28;
    --color-text-translation: #C5A8EE;
    
    /* Navbar Colors - Dark Theme */
    --navbar-logo-color: white;
    --navbar-logo-subtitle-color: #C5A8EE;
    --navbar-text-color: white;
    --navbar-icon-color: rgba(255, 255, 255, 0.6);
    --navbar-icon-hover-color: rgba(255, 255, 255, 0.95);
    --navbar-btn-border: rgba(255, 255, 255, 0.3);
    --navbar-btn-text: rgba(255, 255, 255, 0.85);
    --navbar-btn-border-hover: rgba(255, 255, 255, 0.6);
    --navbar-btn-text-hover: white;
    --navbar-search-bg: rgba(255, 255, 255, 0.15);
    --navbar-search-bg-focus: rgba(255, 255, 255, 0.22);
    --navbar-search-text: white;
    --navbar-search-placeholder: rgba(255, 255, 255, 0.5);
    --navbar-search-icon: rgba(255, 255, 255, 0.55);
    --navbar-border: rgba(255, 255, 255, 0.08);
}

/* ============================================
   BASE STYLES
   ============================================ */

html {
    background: var(--color-background-tertiary);
    font-family: 'DM Sans', sans-serif;
    color: var(--color-text-primary);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.main {
    max-width: 860px;
    width: 100%;
    margin: 4rem auto;
    padding: 0 2rem;
    flex: 1;
    box-sizing: border-box;
}

.admin-panel {
    margin: 1.5vw;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    /*background: var(--color-purple-900);*/
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 60px;
    border-bottom: 1px solid var(--navbar-border);
    overflow: visible;
}

.logo {
    flex: 1;
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--navbar-logo-color);
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-decoration: none;
}

.logo span {
    color: var(--navbar-logo-subtitle-color);
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 0.04em;
    margin-left: 6px;
    text-transform: lowercase;
}

/* SEARCH WRAP */
.search-wrap {
    flex: 0 0 clamp(280px, 40vw, 560px);
    position: relative;
    height: 36px; /* fixed height so search-icon centers correctly */
    align-self: center;
}

/* ICON */
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--navbar-search-icon);
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
}

/* INPUT — targets both class and bare element so either works */
.search-wrap input,
.search-input {
    width: 100%;
    height: 36px;
    border-radius: 20px;
    border: none;
    padding: 0 1rem 0 2.2rem;
    box-sizing: border-box;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: var(--navbar-search-bg);
    color: var(--navbar-search-text);
    outline: none;
    transition: background 0.15s;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

/* Remove browser-native clear button on type=search */
.search-wrap input::-webkit-search-decoration,
.search-wrap input::-webkit-search-cancel-button,
.search-wrap input::-webkit-search-results-button,
.search-wrap input::-webkit-search-results-decoration {
    display: none;
}

    .search-wrap input::placeholder,
    .search-input::placeholder {
        color: var(--navbar-search-placeholder);
    }

    .search-wrap input:focus,
    .search-input:focus {
        background: var(--navbar-search-bg-focus);
    }

/* DROPDOWN */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    color: #1a1a1a; /* prevent white-on-white from navbar inheritance */
    font-family: 'DM Sans', sans-serif;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(74,40,133,0.18), 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 999;
    max-height: min(60vh, 420px);
    overflow-y: auto;
}

.dropdown-section-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9c9890;
    padding: 10px 14px 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    min-height: 44px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.1s;
}

    .dropdown-item:hover,
    .dropdown-item.active {
        background: #F4EFFE;
    }

.item-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #DECCF7;
    color: #4A2885;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.item-text {
    flex: 1;
    min-width: 0;
}
/* min-width:0 prevents text overflow breaking layout */

.item-title {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-sub {
    font-size: 11px;
    color: #9c9890;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-tag {
    font-size: 10px;
    background: #DECCF7;
    color: #4A2885;
    border-radius: 8px;
    padding: 2px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.dropdown-footer {
    padding: 9px 14px;
    font-size: 12px;
    color: #9c9890;
    border-top: 0.5px solid #e5e3dc;
    cursor: pointer;
    transition: background 0.1s;
}

    .dropdown-footer:hover {
        background: #f5f4ef;
        color: #4A2885;
    }
.nav-actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-right: 1vw;
}

.btn-random {
    background: transparent;
    border: none;
    color: var(--navbar-icon-color);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: color 0.15s;
}

.btn-random:hover {
    color: var(--navbar-icon-hover-color);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-theme {
    background: transparent;
    border: none;
    color: var(--navbar-icon-color);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.15s;
}

.btn-theme:hover {
    color: var(--navbar-icon-hover-color);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--navbar-btn-border);
    color: var(--navbar-btn-text);
    border-radius: 4px;
    padding: 6px 16px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
    border-color: var(--navbar-btn-border-hover);
    color: var(--navbar-btn-text-hover);
}

.btn-accent {
    background: var(--color-red-400);
    border: none;
    color: white;
    border-radius: 4px;
    padding: 6px 16px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: background 0.15s;
}

.btn-accent:hover {
    background: var(--color-reddish-brown);
}

/* ============================================
   WORD CARD
   ============================================ */
.word-card {
    background: var(--color-background-primary);
    border-radius: var(--border-radius-lg);
    border: 0.5px solid var(--color-border-tertiary);
    overflow: hidden;
    background-clip: content-box;
}

.word-header {
    background: var(--color-purple-800);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.word-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.word-language {
    font-size: 12px;
    color: var(--color-purple-200);
    margin-top: 4px;
    font-style: italic;
}

.word-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 10px;
    line-height: 1.6;
    max-width: 36rem;
}
.word-link {
    color: var(--color-purple-400);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-purple-400);
    transition: color 0.15s, border-color 0.15s;
}

.word-link:hover {
    color: var(--color-purple-600);
    border-bottom-color: var(--color-purple-600);
    border-bottom-style: solid;
}

html.dark .word-link {
    color: var(--color-purple-200);
    border-bottom-color: var(--color-purple-200);
}

html.dark .word-link:hover {
    color: var(--color-purple-100);
    border-bottom-color: var(--color-purple-100);
}

.word-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
}

/* ============================================
   EXAMPLE SENTENCES
   ============================================ */
.example-sentences {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.example-sentence {
    margin: 0;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
    border-left: 3px solid var(--color-purple-200);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0 8px 8px 0;
}

.example-sentence p {
    margin: 0 0 0.4rem;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.65;
    font-style: italic;
}

.example-sentence footer {
    font-size: 12px;
    color: var(--color-purple-200);
}

.example-sentence cite {
    font-style: normal;
    font-weight: 500;
}

.sentence-book {
    opacity: 0.8;
}

.sentence-meta {
    opacity: 0.65;
}

/* ============================================
   SORT BAR
   ============================================ */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 1.5rem;
    border-bottom: 0.5px solid var(--color-border-tertiary);
    background: var(--color-background-secondary);
}

.sort-label {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.sort-btn {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    border: 0.5px solid var(--color-border-secondary);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}

.sort-btn.active {
    background: var(--color-purple-50);
    color: var(--color-purple-800);
    border-color: var(--color-purple-200);
    font-weight: 500;
}

/* ============================================
   TRANSLATION ROWS
   ============================================ */
.translation-row {
    padding: 1rem 1.5rem;
    background: var(--color-background-secondary);
    border-bottom: 0.5px solid var(--color-border-tertiary);
    border-radius: 10px;
    margin: 0 0 0 1em;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    cursor: help;
    transition: background 0.15s ease;
}

.translation-row:hover {
    background: var(--color-background-primary);
}

.translation-row:last-of-type {
    border-bottom: none;
}

.trans-content {
    overflow: hidden;
}

.trans-content a {
    color: var(--color-text-translation);
    text-decoration: none;
    cursor: pointer;
}

.trans-content a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.trans-text {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    color: var(--color-text-primary);
    font-weight: 400;
}

.trans-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-top: 4px;
}

.trans-meta {
    font-size: 11px;
    color: var(--color-text-tertiary);
    margin-top: 6px;
}

.trans-expanded-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                transform 0.25s ease;
}

.trans-expanded-content.visible {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease 0.05s,
                transform 0.3s ease 0.05s;
}

.trans-word-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 0.5px solid var(--color-border-tertiary);
}

.trans-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ============================================
   BUTTONS & INTERACTIONS
   ============================================ */
.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text-tertiary);
    line-height: 1;
    padding: 0;
}

.star-btn.liked {
    color: #e9a800;
}

.like-count {
    font-size: 11px;
    color: var(--color-text-tertiary);
    text-align: center;
}

.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-tertiary);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.share-btn:hover {
    color: var(--color-purple-800);
}

.hashtag {
    font-size: 11px;
    color: var(--color-purple-200);
    font-weight: 500;
}

/* ============================================
   LINKED PREVIEW
   ============================================ */
.linked-preview {
    display: none;
    margin-top: 10px;
    background: var(--color-background-primary);
    border: 0.5px solid var(--color-purple-200);
    border-left: 3px solid var(--color-purple-400);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    padding: 10px 12px;
}

.linked-preview.show {
    display: block;
}

.linked-preview-title {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-purple-800);
}

.linked-preview-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 3px;
    line-height: 1.5;
}

/* ============================================
   COMMENTS SECTION
   ============================================ */
.comments-section {
    margin-top: 1.5rem;
    background: var(--color-background-primary);
    border-radius: var(--border-radius-lg);
    border: 0.5px solid var(--color-border-tertiary);
    overflow: hidden;
}

.comments-header {
    padding: 1rem 1.5rem;
    border-bottom: 0.5px solid var(--color-border-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comments-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.comment-item {
    padding: 1rem 1.5rem;
    border-bottom: 0.5px solid var(--color-border-tertiary);
    display: flex;
    gap: 12px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-purple-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-purple-800);
    flex-shrink: 0;
}

.comment-user {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.comment-ref {
    display: inline;
    font-size: 12px;
    background: var(--color-purple-50);
    color: var(--color-purple-800);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
}

.comment-text {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    line-height: 1.6;
}

.comment-date {
    font-size: 11px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}

.comment-input-row {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-input-row input {
    flex: 1;
    height: 36px;
    border-radius: 20px;
    border: 0.5px solid var(--color-border-secondary);
    padding: 0 1rem;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    background: var(--color-background-secondary);
    color: var(--color-text-primary);
}

.comment-input-row input:focus {
    outline: none;
    border-color: var(--color-purple-200);
}

.send-btn {
    background: var(--color-purple-800);
    border: none;
    color: white;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
}

.send-btn:hover {
    background: var(--color-purple-400);
}

.login-notice {
    font-size: 12px;
    color: var(--color-text-tertiary);
    text-align: center;
    padding: 10px;
}

/* Login dialog */
.login-dialog {
    border: none;
    padding: 0;
    background: transparent;
    max-width: none;
    max-height: none;
}

.login-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: backdrop-fade-in 0.15s ease;
}

@keyframes backdrop-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.login-dialog-panel {
    position: relative;
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    width: 360px;
    max-width: 95vw;
    background: var(--color-background-primary);
    color: var(--color-text-primary);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    animation: dialog-pop-in 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialog-pop-in {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.login-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-dialog-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.login-dialog-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--color-text-tertiary);
    padding: 0.25rem 0.4rem;
    border-radius: var(--border-radius-md);
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.login-dialog-close:hover {
    color: var(--color-text-primary);
    background: var(--color-background-tertiary);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.login-field label {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.login-field input {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--border-radius-md);
    background: var(--color-background-secondary);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.15s;
}

.login-field input:focus {
    border-color: var(--color-purple-400);
}

.login-btn {
    width: 100%;
    padding: 0.6rem;
    border: none;
    border-radius: var(--border-radius-md);
    background: var(--color-purple-600);
    color: #fff;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    margin-top: 0.25rem;
    transition: background 0.15s;
}

.login-btn:hover {
    background: var(--color-purple-400);
}

.login-error {
    color: var(--color-red-400);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-red-50);
    border-radius: var(--border-radius-md);
}

.nav-username {
    font-size: 0.85rem;
    color: var(--navbar-text-color);
    padding: 0 0.25rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .page {
        zoom: 1;
    }

    .main {
        max-width: 70vw;
    }

    .navbar {
        height: auto;
        min-height: 60px;
        padding: 0.75rem 1rem;
        border-radius: 28px;
        gap: 0.75rem;
    }
}

@media (max-width: 900px) {
    .main {
        max-width: 100%;
        width: 100%;
        margin: 1rem 0;
        padding: 0 1rem;
    }

    .navbar {
        margin: 0.75rem;
        flex-wrap: wrap;
        align-items: stretch;
        border-radius: 20px;
        height: auto;
        min-height: 60px;
        padding: 0.75rem 1rem;
    }

    .logo {
        flex: 0 0 auto;
        order: 1;
        font-size: 22px;
    }

    .logo span {
        font-size: 13px;
    }

    .nav-actions {
        flex: 0 0 auto;
        order: 2;
        margin-left: auto;
        width: auto;
        padding-right: 0;
        gap: 6px;
    }

    .search-wrap {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 40px;
        margin: 8px 0 0;
    }

    .search-wrap input,
    .search-input {
        height: 40px;
        font-size: 15px;
    }

    .nav-username {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .btn-ghost,
    .btn-accent {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 600px) {
    .navbar {
        padding: 0.6rem 0.75rem;
        gap: 0.55rem;
    }

    .logo {
        font-size: 20px;
        flex: 1 1 auto;
    }

    .logo span {
        display: none;
    }

    .nav-actions {
        flex: 0 0 auto;
        width: auto;
        justify-content: flex-end;
        gap: 0.45rem;
        flex-wrap: nowrap;
    }

    .nav-username {
        display: none;
    }

    .btn-random,
    .btn-theme {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-ghost,
    .btn-accent {
        font-size: 13px;
        padding: 6px 12px;
        white-space: nowrap;
    }

    .search-wrap {
        margin: 6px 0 0;
    }

    .search-dropdown {
        left: -4px;
        right: -4px;
        top: calc(100% + 4px);
    }

    .word-title {
        font-size: 24px;
    }
}

/* ── Admin sentences split layout ──────────────────────────────────────────── */
.as-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 60px);
    overflow: hidden;
}

.as-sidebar {
    width: 220px;
    min-width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ddd;
    background: #fafafa;
    overflow: hidden;
}

.as-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 6px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.as-sidebar-count {
    font-weight: 400;
    color: #888;
    font-size: 11px;
}

.as-sidebar-filter {
    margin: 6px 8px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.as-sidebar-list {
    flex: 1;
    overflow-y: auto;
}

.as-sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.as-sidebar-item:hover {
    background: #f0ecff;
}

.as-sidebar-item.selected {
    background: #e6e0ff;
    font-weight: 600;
}

.as-sidebar-item.missing {
    color: #b05000;
}

.as-badge-missing {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #e07000;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── CENTER COLUMN ── */
.as-center {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-width: 0;
}

/* ── RIGHT PANEL ── */
.as-panel {
    width: 0;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.as-panel.as-panel--active {
    width: 320px;
    overflow-y: auto;
}

.as-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 8px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    background: #f9f6ff;
    flex-shrink: 0;
}

.as-panel-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
    line-height: 1;
}

.as-panel-close:hover {
    color: #333;
}

.as-panel-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.as-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.as-field label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.as-field input,
.as-field textarea {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

.as-panel-save {
    margin-top: 6px;
    padding: 8px 12px;
    background: #6a4bc4;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}

.as-panel-save:hover:not(:disabled) {
    background: #5538b0;
}

.as-panel-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--color-background-secondary);
    border-top: 1px solid var(--color-border-tertiary);
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0;
}

.footer-text a {
    color: var(--color-purple-600);
    text-decoration: none;
    font-weight: 500;
}

.footer-text a:hover {
    text-decoration: underline;
}

.footer-license-img {
    height: 31px;
    width: auto;
    opacity: 0.85;
}

@media (max-width: 600px) {
    .site-footer {
        padding: 1.25rem 1rem;
    }
    
    .footer-text {
        font-size: 0.8rem;
    }
    
    .footer-license-img {
        height: 50px;
    }
}


