.ks-header {
    z-index: 120;
    padding: 1.15rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 1.25rem;
    background: rgba(23, 18, 11, 0.86);
    backdrop-filter: blur(18px);
}

.ks-header-row {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    margin-bottom: 1rem;
}

.ks-header h1 {
    font-size: 2rem;
    margin: 0;
    color: var(--ks-accent);
    font-weight: 500;
    letter-spacing: 0.08em;
}

.ks-masthead {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
    flex: 1 1 auto;
}

.ks-masthead-overline {
    color: var(--ks-text-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ks-masthead-dedication {
    margin: 0;
    color: var(--ks-text-secondary);
    font-size: 0.95rem;
}

.ks-masthead-name {
    color: #ffe0b2;
}

.ks-search-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    max-width: 32rem;
    padding: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.ks-search-shell .material-symbols-outlined {
    color: var(--ks-accent);
    font-size: 1.2rem;
}

.ks-search-input {
    border: none;
    background: transparent;
    padding: 0.9rem 0;
    box-shadow: none;
    border-radius: 0;
    outline: none;
}

.ks-search-input:focus {
    border: none;
    background: transparent;
    box-shadow: none;
}

.ks-search-input::placeholder {
    color: var(--ks-text-muted);
}

.ks-mobile-nav {
    display: none;
    position: relative;
    flex: 0 0 auto;
}

.ks-mobile-nav-trigger {
    flex-shrink: 0;
}

.ks-section-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ks-section-tabs {
    min-width: 16rem;
}

.ks-section-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ks-section-tab {
    border: none;
    background: transparent;
    color: var(--ks-text-secondary);
    font: inherit;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}

.ks-section-tab:hover {
    color: var(--ks-text-primary);
}

.ks-section-tab.is-active {
    background: var(--ks-accent-dim);
    color: var(--ks-accent-hover);
}

.ks-section-add {
    flex-shrink: 0;
}

.ks-header-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    flex: 0 0 auto;
}

.ks-menu-trigger {
    flex-shrink: 0;
}

.ks-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 12.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(49, 38, 28, 0.98), rgba(33, 26, 18, 0.98));
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(18px);
    z-index: 180;
}

.ks-mobile-nav .ks-menu-dropdown {
    left: 0;
    right: auto;
}

.ks-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    border-radius: 0.8rem;
    background: transparent;
    color: var(--ks-text-primary);
    padding: 0.72rem 0.85rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.ks-menu-item:hover {
    background: rgba(255, 185, 92, 0.14);
    color: var(--ks-accent-hover);
}

.ks-menu-item:active {
    transform: scale(0.99);
}

.ks-menu-item[aria-current="true"] {
    background: var(--ks-accent-dim);
    color: var(--ks-accent-hover);
}

.ks-menu-divider {
    margin: 0.5rem 0.25rem;
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
}

.ks-material-menu {
    position: absolute;
    z-index: 150;
}

.ks-surface-card {
    position: relative;
    overflow: hidden;
}

.ks-surface-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    pointer-events: none;
}
.ks-header-row h1 {
    margin: 0;
}

.ks-masthead-dedication {
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 0.78rem;
    line-height: 1.45;
    letter-spacing: 0.015em;
    color: var(--ks-text-muted);
    position: relative;
    padding-left: 1.75rem;
    max-width: 38rem;
    animation: ks-dedication-rise 900ms ease-out 120ms both;
}

.ks-masthead-dedication::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.68em;
    width: 1.15rem;
    height: 1px;
    background: linear-gradient(
        90deg,
        var(--ks-accent) 0%,
        var(--ks-accent) 55%,
        rgba(201, 168, 76, 0) 100%
    );
    opacity: 0.75;
    transform-origin: left center;
    animation: ks-dedication-rule 700ms ease-out 200ms both;
}

.ks-masthead-name {
    color: var(--ks-text-secondary);
    font-style: italic;
    white-space: normal;
}

@keyframes ks-dedication-rise {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ks-dedication-rule {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 0.75;
    }
}

@media (max-width: 640px) {
    .ks-masthead-dedication {
        font-size: 0.72rem;
        padding-left: 1.4rem;
        line-height: 1.5;
    }
    .ks-masthead-dedication::before {
        width: 0.9rem;
        top: 0.72em;
    }
    .ks-masthead { gap: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ks-masthead-dedication,
    .ks-masthead-dedication::before {
        animation: none;
    }
}
