:root {
    --background: #0F172A;
    --surface: #1E293B;
    --surface-subtle: #172033;
    --border: #334155;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --purple: #8B5CF6;
    --purple-hover: #7C3AED;
    --purple-light: #A78BFA;
    --purple-subtle: #2E1B4E;
    --amber: #F59E0B;
    --amber-light: #FBBF24;
    --amber-subtle: #451A03;
    --blue: #60A5FA;
    --blue-light: #93C5FD;
    --blue-subtle: #172554;
    --sidebar-width: 248px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--background);
    color-scheme: dark;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text-primary);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--purple-light);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: .75rem;
    left: .75rem;
    z-index: 100;
    padding: .65rem .85rem;
    border-radius: 8px;
    background: var(--purple);
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--surface-subtle);
    transition: width .2s ease;
}

.sidebar-header {
    display: flex;
    min-height: 76px;
    padding: 1rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand {
    color: inherit;
    text-decoration: none;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .75rem;
}

.brand-mark {
    display: inline-grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid #5B3AA2;
    border-radius: 10px;
    background: var(--purple-subtle);
    color: var(--purple-light);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.brand-name {
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
}

.sidebar-toggle,
.mobile-menu-button {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.sidebar-toggle:hover,
.mobile-menu-button:hover {
    border-color: var(--purple);
    background: var(--purple-subtle);
    color: var(--text-primary);
}

.sidebar-toggle svg,
.mobile-menu-button svg,
.nav-icon svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.close-icon {
    display: none;
}

.sidebar-nav {
    padding: 1rem;
}

.sidebar-nav ul {
    display: grid;
    margin: 0;
    padding: 0;
    gap: .35rem;
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    min-height: 48px;
    padding: .7rem .75rem;
    align-items: center;
    gap: .85rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text-primary);
}

.sidebar-nav a:active {
    border-color: var(--purple);
    color: var(--purple-light);
}

.nav-icon {
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    color: var(--blue);
}

.nav-label {
    overflow: hidden;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-subjects {
    margin: .1rem 1rem 0;
    padding: .85rem .25rem 0;
    border-top: 1px solid var(--border);
}

.sidebar-subjects-label {
    margin: 0 0 .35rem .55rem;
    color: var(--text-muted);
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-subjects-list {
    display: grid;
    margin: 0;
    padding: 0;
    gap: .1rem;
    list-style: none;
}

.sidebar-subjects-link {
    display: flex;
    min-height: 36px;
    padding: .4rem .55rem .4rem .75rem;
    align-items: center;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 650;
    letter-spacing: .025em;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.sidebar-subjects-link:hover,
.sidebar-subjects-link:focus-visible {
    background: var(--surface);
    color: var(--text-secondary);
}

.sidebar-subjects-link[aria-current="location"] {
    background: rgb(46 27 78 / 48%);
    box-shadow: inset 2px 0 0 var(--purple);
    color: var(--text-primary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem 1.35rem;
    color: var(--text-muted);
    font-size: .78rem;
    white-space: nowrap;
}

.sidebar-footer::before {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: .5rem;
    border-radius: 50%;
    background: var(--amber);
    content: "";
    vertical-align: .08em;
}

.page-shell {
    display: flex;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    flex-direction: column;
    transition: margin-left .2s ease;
}

.mobile-bar {
    display: none;
}

.site-main {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 4.5rem 2.5rem 4rem;
    flex: 1;
}

.intro {
    max-width: 760px;
    margin-bottom: 3.25rem;
}

.intro-rule {
    display: block;
    width: 32px;
    height: 2px;
    margin-bottom: 1.25rem;
    background: var(--amber);
}

h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(2.4rem, 5vw, 3.85rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.study-line {
    max-width: 620px;
    margin: 1rem 0 0;
    color: var(--blue-light);
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.65;
}

.section-links {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.page-card {
    display: flex;
    min-width: 0;
    min-height: 226px;
    padding: 1.75rem;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color .15s ease, background-color .15s ease;
}

.page-card:hover {
    border-color: #5B3AA2;
}

.card-about {
    grid-column: span 7;
}

.card-projects {
    grid-column: span 5;
    background: var(--surface-subtle);
}

.card-subjects {
    display: grid;
    min-height: 170px;
    grid-column: 1 / -1;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
}

.card-number {
    margin: 0 0 1rem;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.card-subjects .card-number {
    margin: 0;
    align-self: start;
    padding-top: .25rem;
}

.page-card h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.35rem;
    letter-spacing: -.02em;
}

.page-card p {
    max-width: 55ch;
    margin: .75rem 0 1.5rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.card-action {
    display: inline-flex;
    width: fit-content;
    min-height: 44px;
    margin-top: auto;
    padding: .65rem 1rem;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border: 1px solid var(--purple);
    border-radius: 8px;
    background: var(--purple);
    color: var(--text-primary);
    font-weight: 750;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.card-action:hover,
.card-action:focus-visible {
    border-color: var(--purple-hover);
    background: var(--purple-hover);
}

.card-subjects .card-action {
    margin-top: 0;
    white-space: nowrap;
}

.site-footer {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 1.35rem 2.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .9rem;
}

html.sidebar-collapsed {
    --sidebar-width: 76px;
}

html.sidebar-collapsed .brand-name {
    display: none;
}

html.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    justify-content: center;
    padding-right: .75rem;
    padding-left: .75rem;
}

html.sidebar-collapsed .collapse-icon {
    transform: rotate(180deg);
}

html.sidebar-collapsed .sidebar-nav {
    padding-right: .75rem;
    padding-left: .75rem;
}

html.sidebar-collapsed .sidebar-nav a {
    padding-right: 0;
    padding-left: 0;
    justify-content: center;
}

html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .sidebar-footer {
    display: none;
}

@media (min-width: 821px) {
    html.sidebar-collapsed .sidebar-subjects {
        display: none;
    }
}

.sidebar-scrim[hidden] {
    display: none;
}

@media (min-width: 821px) and (max-width: 980px) {
    .card-about,
    .card-projects {
        min-height: 190px;
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    :root,
    html.sidebar-collapsed {
        --sidebar-width: 0px;
    }

    .sidebar {
        width: min(280px, 86vw);
        transform: translateX(-102%);
        transition: transform .2s ease;
    }

    html.sidebar-open .sidebar {
        transform: translateX(0);
    }

    html.sidebar-collapsed .sidebar-brand {
        display: flex;
    }

    html.sidebar-collapsed .brand-name {
        display: block;
    }

    html.sidebar-collapsed .sidebar-header {
        flex-direction: row;
        padding: 1rem;
        justify-content: space-between;
    }

    html.sidebar-collapsed .sidebar-nav {
        padding: 1rem;
    }

    html.sidebar-collapsed .sidebar-nav a {
        padding: .7rem .75rem;
        justify-content: flex-start;
    }

    html.sidebar-collapsed .nav-label,
    html.sidebar-collapsed .sidebar-footer {
        display: block;
    }

    .sidebar-subjects {
        margin-right: 1rem;
        margin-left: 1rem;
    }

    .sidebar-subjects-link {
        min-height: 42px;
    }

    .collapse-icon {
        display: none;
    }

    .close-icon {
        display: block;
    }

    .page-shell {
        margin-left: 0;
    }

    .mobile-bar {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        min-height: 60px;
        padding: .5rem 1rem;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border);
        background: var(--background);
    }

    .mobile-menu-button {
        gap: .55rem;
        padding: .55rem .75rem;
    }

    .mobile-brand {
        color: var(--text-muted);
        font-size: .82rem;
        font-weight: 750;
        letter-spacing: .08em;
    }

    .site-main {
        padding: 2.75rem 1.15rem 3rem;
    }

    .intro {
        margin-bottom: 2.5rem;
    }

    .section-links {
        grid-template-columns: 1fr;
    }

    .card-about,
    .card-projects,
    .card-subjects {
        grid-column: 1;
    }

    .page-card {
        min-height: 210px;
        padding: 1.4rem;
    }

    .card-subjects {
        display: flex;
        min-height: 210px;
        align-items: stretch;
        gap: 0;
    }

    .card-subjects .card-number {
        margin-bottom: 1rem;
        padding-top: 0;
    }

    .card-subjects .card-action {
        margin-top: auto;
    }

    .site-footer {
        padding-right: 1.15rem;
        padding-left: 1.15rem;
    }

    .sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 40;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgb(2 6 23 / 72%);
    }

    html.sidebar-open body {
        overflow: hidden;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 2.25rem;
    }

    .site-main {
        padding-top: 2.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* Shared content pages */
.sidebar-nav a[aria-current="page"] {
    border-color: #5B3AA2;
    background: var(--purple-subtle);
    color: var(--text-primary);
}

.sidebar-nav a[aria-current="page"] .nav-icon {
    color: var(--purple-light);
}

.content-page {
    padding-top: 3rem;
}

.back-link {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 2rem;
    align-items: center;
    gap: .35rem;
    color: var(--blue-light);
    font-weight: 700;
    text-decoration: none;
    text-underline-offset: .22em;
}

.back-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.error-links {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-intro {
    max-width: 780px;
    margin: 0 0 2.75rem;
}

.page-intro::before {
    display: block;
    width: 32px;
    height: 2px;
    margin-bottom: 1.25rem;
    background: var(--amber);
    content: "";
}

.page-intro h1 {
    margin: 0;
}

.page-intro > p:last-child {
    margin: 1rem 0 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-page h2,
.content-page h3 {
    color: var(--text-primary);
    letter-spacing: -.02em;
}

.content-page p,
.content-page li,
.content-page td {
    color: var(--text-secondary);
    line-height: 1.65;
}

.button-link,
.card-action {
    display: inline-flex;
    width: fit-content;
    min-height: 44px;
    padding: .65rem 1rem;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border: 1px solid var(--purple);
    border-radius: 8px;
    background: var(--purple);
    color: var(--text-primary);
    font-weight: 750;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.button-link:hover,
.button-link:focus-visible,
.card-action:hover,
.card-action:focus-visible {
    border-color: var(--purple-hover);
    background: var(--purple-hover);
}

.prose-layout {
    max-width: 760px;
}

.prose-section {
    padding: 1.75rem 0;
    border-top: 1px solid var(--border);
}

.prose-section h2 {
    margin: 0 0 .75rem;
    font-size: 1.35rem;
}

.prose-section p {
    margin: 0;
}

.empty-state,
.project-entry {
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.empty-state h2,
.project-entry h2 {
    margin: 0 0 .75rem;
    font-size: 1.35rem;
}

.empty-state p,
.project-entry p {
    max-width: 62ch;
    margin: 0;
}

.no-script-nav {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
}

.no-script-nav a {
    margin-right: 1rem;
    color: var(--blue-light);
}

@media (max-width: 820px) {
    .content-page {
        padding-top: 2.25rem;
    }

    .back-link {
        margin-bottom: 1.5rem;
    }
}

/* Global search / command palette */
.search-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.sidebar-search {
    padding: .9rem 1rem 0;
}

.sidebar-search-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    padding: .65rem .75rem;
    align-items: center;
    gap: .8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.sidebar-search-button:hover,
.sidebar-search-button:focus-visible,
html.search-open .sidebar-search-button {
    border-color: var(--purple);
    background: var(--purple-subtle);
    color: var(--text-primary);
}

.sidebar-search-icon,
.search-input-icon {
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    color: var(--blue);
}

.sidebar-search-icon svg,
.search-input-icon svg,
.search-close-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sidebar-search-label {
    overflow: hidden;
    font-weight: 650;
    white-space: nowrap;
}

.sidebar-search-shortcut {
    margin-left: auto;
    padding: .2rem .35rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    font-size: .68rem;
    line-height: 1.2;
    white-space: nowrap;
}

html.sidebar-collapsed .sidebar-search {
    padding-right: .75rem;
    padding-left: .75rem;
}

html.sidebar-collapsed .sidebar-search-button {
    padding-right: 0;
    padding-left: 0;
    justify-content: center;
}

html.sidebar-collapsed .sidebar-search-label,
html.sidebar-collapsed .sidebar-search-shortcut {
    display: none;
}

.search-overlay[hidden] {
    display: none;
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    padding: max(4rem, 10vh) 1.25rem 1.25rem;
    align-items: flex-start;
    justify-content: center;
    background: rgb(2 6 23 / 74%);
}

.search-dialog {
    display: flex;
    width: min(680px, 100%);
    max-height: min(680px, calc(100dvh - 2.5rem));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 18px 45px rgb(2 6 23 / 42%);
}

.search-input-row {
    display: flex;
    min-height: 64px;
    padding: .55rem .65rem .55rem 1rem;
    align-items: center;
    gap: .7rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
}

.search-input-icon {
    color: var(--purple-light);
}

.search-input {
    min-width: 0;
    min-height: 44px;
    padding: .35rem 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 1.05rem;
}

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

.search-input::-webkit-search-cancel-button {
    display: none;
}

.search-input:focus-visible {
    outline: 0;
}

.search-input-row:focus-within {
    box-shadow: inset 0 -2px 0 var(--purple);
}

.search-close-button {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    padding: .45rem .55rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.search-close-button:hover,
.search-close-button:focus-visible {
    border-color: var(--purple);
    background: var(--purple-subtle);
    color: var(--text-primary);
}

.search-close-button svg {
    display: none;
}

.search-close-key {
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.search-results-shell {
    display: flex;
    min-height: 240px;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.search-summary {
    margin: 0;
    padding: .8rem 1rem .4rem;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.search-results {
    min-height: 0;
    margin: 0;
    padding: .25rem .5rem .6rem;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
}

.search-result-item {
    margin: 0;
    padding: 0;
}

.search-result {
    display: flex;
    min-height: 82px;
    padding: .75rem .9rem;
    flex-direction: column;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
}

.search-result:hover,
.search-result.is-active {
    border-color: #5B3AA2;
    background: var(--purple-subtle);
}

.search-result.is-active {
    box-shadow: inset 2px 0 0 var(--purple);
}

.search-result-metadata {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem .55rem;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .06em;
    line-height: 1.35;
    text-transform: uppercase;
}

.search-result-type {
    color: var(--blue);
}

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

.search-result-context::before {
    margin-right: .55rem;
    color: var(--border);
    content: "·";
}

.search-result-title {
    margin-top: .22rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.35;
}

.search-result-description {
    display: -webkit-box;
    margin-top: .2rem;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: .84rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.search-empty {
    display: grid;
    min-height: 190px;
    margin: 0;
    padding: 2rem 1rem;
    flex: 1;
    place-items: center;
    color: var(--text-muted);
    text-align: center;
}

.search-empty[hidden] {
    display: none;
}

.search-footer {
    display: flex;
    min-height: 44px;
    padding: .55rem 1rem;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-size: .72rem;
}

.search-footer span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.search-footer kbd {
    min-width: 22px;
    padding: .15rem .28rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: .68rem;
    line-height: 1.15;
    text-align: center;
}

html.search-open body {
    overflow: hidden;
}

@media (max-width: 820px) {
    html.sidebar-collapsed .sidebar-search {
        padding: .9rem 1rem 0;
    }

    html.sidebar-collapsed .sidebar-search-button {
        padding: .65rem .75rem;
        justify-content: flex-start;
    }

    html.sidebar-collapsed .sidebar-search-label,
    html.sidebar-collapsed .sidebar-search-shortcut {
        display: inline;
    }

    .search-overlay {
        padding: .75rem;
    }

    .search-dialog {
        max-height: calc(100dvh - 1.5rem);
    }

    .search-input-row {
        min-height: 60px;
        padding-left: .8rem;
    }

    .search-input {
        font-size: 1rem;
    }

    .search-close-key {
        display: none;
    }

    .search-close-button svg {
        display: block;
    }

    .search-result {
        min-height: 76px;
        padding: .7rem .75rem;
    }

    .search-footer {
        display: none;
    }
}

@media (max-width: 400px) {
    .sidebar-search-shortcut {
        display: none;
    }

    .search-overlay {
        padding: .4rem;
    }

    .search-dialog {
        max-height: calc(100dvh - .8rem);
        border-radius: 9px;
    }
}


/* Restore desktop width before enabling its normal transitions. */
html.sidebar-restoring .sidebar,
html.sidebar-restoring .page-shell {
    transition: none;
}
