header {
    border: none;
}

header .brand {
    text-align: center;
}

header .brand img {
    height: 66px;
}

header .locale-selection {
    display: none !important;
}

.container {
    flex: 1 0 auto;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.search-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.search-container .ph-magnifying-glass {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: light-dark(var(--stone-500), var(--stone-400));
    font-size: 1.25rem;
    pointer-events: none;
    z-index: 2;
    transition: color 0.15s ease;
}

.reset-btn,
.clear-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: light-dark(var(--stone-400), var(--stone-500));
    font-size: 1.125rem;
    cursor: pointer;
    display: none;
    z-index: 2;
    transition: color 0.15s ease;
}

.reset-btn {
    right: 3.25rem;
}

.clear-btn {
    right: 1.25rem;
}

.reset-btn:hover,
.clear-btn:hover {
    color: light-dark(var(--graphite), #ffffff);
}

.reset-btn.visible,
.clear-btn.visible {
    display: block;
}

.search-box {
    width: 100%;
    box-sizing: border-box;
    border-radius: 32px;
    padding: 0.875rem 3.25rem 0.875rem 3.25rem;
    font-size: 1.1rem;
    background-color: light-dark(#ffffff, var(--graphite));
    color: light-dark(var(--graphite), #ffffff);
    border: 1px solid light-dark(var(--stone-300), var(--stone-700));
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, border-radius 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px light-dark(rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.2));
}

.search-box:focus {
    border-color: light-dark(var(--color), oklch(70% 0.232 292.759));
    box-shadow: 0 4px 12px light-dark(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.3));
}

.search-container:has(.search-box:focus) .ph-magnifying-glass {
    color: light-dark(var(--color), oklch(70% 0.232 292.759));
}

.search-container:has(.clear-btn.visible) #loading {
    right: 5rem;
}

.search-container:has(.suggestions.visible) .search-box {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: light-dark(var(--color), oklch(70% 0.232 292.759));
}

.suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: light-dark(#ffffff, var(--graphite));
    border: 1px solid light-dark(var(--stone-300), var(--stone-700));
    border-top: none;
    border-radius: 0 0 24px 24px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px light-dark(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.4));
    box-sizing: border-box;
}

.suggestions.visible {
    display: block;
}

.suggestion-item {
    padding: 12px 20px 12px 3.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid light-dark(var(--stone-200), var(--stone-800));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: light-dark(var(--gravel), var(--stone-800));
}

.suggestion-word {
    font-weight: 600;
    color: light-dark(var(--graphite), #ffffff);
    font-size: 1rem;
}

.suggestion-redirect {
    font-size: 0.875rem;
    color: var(--flint);
    font-style: italic;
    margin-left: 8px;
}

#loading {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--flint);
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

#loading.visible {
    opacity: 1;
}

.language-selector-wrapper {
    position: relative;
    display: flex;
    justify-content: end;
    margin-top: 1rem;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: light-dark(var(--gravel), var(--stone-800));
    color: light-dark(var(--stone-700), var(--stone-300));
    border: 1px solid light-dark(var(--stone-200), var(--stone-700));
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-btn:hover {
    background-color: light-dark(var(--stone-200), var(--stone-700));
    color: light-dark(var(--graphite), #ffffff);
    border-color: light-dark(var(--stone-300), var(--stone-500));
}

.lang-btn b {
    color: light-dark(var(--graphite), #ffffff);
    font-weight: 600;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    background-color: light-dark(#ffffff, var(--graphite));
    border: 1px solid light-dark(var(--stone-200), var(--stone-700));
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 20px light-dark(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.3));
    z-index: 100;
    min-width: 160px;
    flex-direction: column;
    gap: 2px;
}

.lang-dropdown.visible {
    display: flex;
}

.lang-option {
    padding: 8px 12px;
    color: light-dark(var(--stone-700), var(--stone-300));
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-option:hover {
    background-color: light-dark(var(--gravel), var(--stone-800));
    color: light-dark(var(--color), oklch(70% 0.232 292.759));
    text-decoration: none !important;
}

.definition-card {
    /* background-color: light-dark(#ffffff, var(--graphite)); */
    /* border: 1px solid light-dark(var(--stone-200), var(--stone-800)); */
    /* border-radius: 20px; */
    /* box-shadow: 0 4px 16px light-dark(rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.3)); */
    padding: 32px;
    margin-top: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    overflow-x: scroll;
}

.definition-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.word-header {
    margin-bottom: 24px;
    border-bottom: 1px solid light-dark(var(--stone-200), var(--stone-700));
    padding-bottom: 12px;
}

.word-title {
    font-size: 2rem;
    font-weight: 700;
    color: light-dark(var(--graphite), #ffffff);
    margin: 0 0 8px 0;
}

.word-redirect {
    font-size: 1rem;
    color: var(--flint);
    font-style: italic;
    margin-bottom: 8px;
}

.word-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.phonetics {
    font-family: 'Charis Regular', Inter, sans-serif;
    font-size: 1.125rem;
    color: var(--flint);
}

.pos-gender {
    font-size: 0.875rem;
    font-weight: lighter;
    background-color: light-dark(var(--gravel), var(--stone-800));
    padding: 2px 10px;
    border-radius: 6px;
}

.word-etymology {
    margin-top: 20px;
    padding: 16px;
    background-color: light-dark(var(--gravel), var(--stone-800));
    border-left: 3px solid light-dark(var(--color), oklch(70% 0.232 292.759));
    border-radius: 8px;
}

.etymology-text {
    font-size: 0.95rem;
    color: light-dark(var(--stone-700), var(--stone-300));
    line-height: 1.6;
}

.part-of-speech-section {
    margin-top: 24px;
}

.part-of-speech-section:first-child {
    margin-top: 0;
}

.part-of-speech {
    font-size: 1.25rem;
    font-weight: 600;
    color: light-dark(var(--graphite), #ffffff);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid light-dark(var(--stone-200), var(--stone-800));
}

.definition-card table {
    margin-top: 1em;
    margin-bottom: 1em;
}

.definition-card th {
    background-color: light-dark(var(--stone-200), var(--stone-800));
}

.definition-card ol {
    margin-bottom: 1rem;
}

.definition-card li {
    margin-bottom: 0.5rem;
}

.definition-card li::marker {
    color: light-dark(var(--color), oklch(70% 0.232 292.759)) !important;
    font-size: smaller;
}

.definition-card ol ol {
    padding-left: 28px;
    list-style-type: lower-alpha;
}

.definition-card ol ol ol {
    list-style-type: lower-roman;
    padding-left: 24px;
}

.definition-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: light-dark(var(--graphite), var(--stone-200));
}

.no-results,
.welcome-message {
    text-align: center;
    color: var(--flint);
    font-size: 1.125rem;
    margin-top: 48px;
    font-style: italic;
}

.word-footer-links {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed light-dark(var(--stone-300), var(--stone-700));
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.875rem;
}

.word-footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: light-dark(var(--stone-700), var(--stone-300));
    text-decoration: none;
    transition: color 0.15s ease;
}

.word-footer-links button {
    color: light-dark(var(--stone-700), var(--stone-300));
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.word-footer-links a:hover,
.word-footer-links button:hover {
    color: light-dark(var(--color), oklch(70% 0.232 292.759)) !important;
    text-decoration: none !important;
}

.word-footer-links .spread-the-world::after {
    content: "Share link"
}

.word-footer-links .success {
    color: light-dark(var(--color), oklch(70% 0.232 292.759)) !important;
}

@media (max-width: 700px) {
    #announce {
        display: none;
    }

    body {
        padding: .5em;
    }

    .container {
        padding: 0;
    }

    .definition-card {
        padding: 10px;
        margin-top: -.5em;
    }

    .definition-card li {
        margin-left: -1rem;
    }
}