@font-face {
    font-family: 'Statius';
    src: url('fonts/Statius-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Statius';
    src: url('fonts/Statius-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Zed Plex Sans';
    src: url('fonts/ZedPlexSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Haskoy';
    src: url('fonts/Haskoy-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Instrument Serif';
    src: url('fonts/InstrumentSerif-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Geist Mono';
    src: url('fonts/GeistMono-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'NType 82';
    src: url('fonts/NType82-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'Lettera Mono LL Cond Light';
    src: url('fonts/LetteraMonoLLCondLight-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'iA Writer Quattro S';
    src: url('fonts/iAWriterQuattroS-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'iA Writer Quattro Variable';
    src: url('fonts/iAWriterQuattroV-500-50.ttf') format('truetype');
    font-weight: 500;
    font-stretch: 50%;
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('fonts/BerkeleyMono-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'ABC Arizona Flare';
    src: url('fonts/ABCArizonaFlareVariable-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Hammersmith One';
    src: url('fonts/HammersmithOne-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Fold Grotesque Pro';
    src: url('fonts/FoldGrotesquePro-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Routed Gothic';
    src: url('fonts/routed-gothic.ttf') format('truetype');
}

@font-face {
    font-family: 'SF Camera';
    src: url('fonts/SFCamera-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'Circular';
    src: url('fonts/Circular-Book.otf') format('opentype');
}

@font-face {
    font-family: 'Bianco Serif';
    src: url('fonts/BiancoSerif-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'Native';
    src: url('fonts/Fort Foundry - Native Light Italic.otf') format('opentype');
}

@font-face {
    font-family: 'Windsor D';
    src: url('fonts/WindsorD.otf') format('opentype');
}

@font-face {
    font-family: 'Quadraat OT';
    src: url('fonts/QuadraatOT.otf') format('opentype');
}

@font-face {
    font-family: 'MatrixBook';
    src: url('fonts/MatrixBook.otf') format('opentype');
}

/* General Body Styles */
body {
    background-color: #f9f9f9;
    font-family: 'Zed Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 2rem;
    color: #111;
    font-size: 16px; /* Base font size */
}

p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Main container for all content */
.container {
    display: flex;
    justify-content: space-between;
}

/* Left side content */
.content {
    width: 80%;
    max-width: 1200px;
}

/* Right side navigation */
.navigation {
    width: 18%;
    max-width: 200px;
    text-align: right;
    font-size: 0.9rem;
}

.navigation a {
    text-decoration: none;
    color: #6A7380;
    display: block;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.navigation a.external::after {
    content: url('images/arrow.svg');
    margin-left: 0.5rem;
    display: inline-block;
    vertical-align: baseline;
    width: 0.6em;
    height: 0.6em;
}

/* Header with name */
.header {
    margin-bottom: 4rem;
}

.header-name {
    font-size: 1.35rem;
    font-weight: bold;
    font-family: 'Statius';
    display: flex;
    align-items: center;
}

.header-name a, .header-name a:visited {
    text-decoration: none;
    color: inherit;
}

.header-logo {
    height: 1.5rem;
    margin-right: 0.5rem;
    transform: translateY(2px);
    cursor: pointer;
}

/* Unified styles for page titles and desk section headers */
.page-title,
.desk-content h2 {
    font-size: 1.35rem;
    display: inline-block;
    line-height: 1.8;
    font-family: 'Statius';
    font-weight: bold;
    position: relative;
}

/* Spacing for main page titles (e.g., "From the desk of") */
.page-title {
    margin: 0 0 24px 0; /* 0 top, 24px bottom */
}

/* Spacing for section headers within desk.html */
.desk-content h2[id] {
    padding-top: 0;
    margin: 20px 0;
    scroll-margin-top: 20px;
}

.page-title::before,
.desk-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.25em;
    height: 0.6em;
    background-color: #FFD000;
    z-index: -1;
}

.search-section {
    margin: 3rem 0;
}

.search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    border-bottom: 1px solid transparent;
}

.tag-container {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    z-index: 2;
}

.tag-pill-active {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.remove-tag {
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    display: none;
    padding-left: 0.2rem;
}

.tag-pill-active:hover .remove-tag {
    display: inline-block;
}

.search-input {
    position: relative;
    z-index: 1;
    color: transparent;
    background-color: transparent;
    caret-color: #0051FF;
    outline: none;
    font-weight: bold;
}

.search-input, .search-input-ghost {
    font-family: 'Statius', sans-serif;
    font-size: 1.35rem;
    line-height: 1.8;
    padding: 0 0.5rem;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.search-input::selection {
    color: #111;
    background-color: #B8D6FF; /* subtle blue highlight */
}

body.dark-theme .search-input::selection {
    color: #f9f9f9;
    background-color: #264F78; /* darker blue highlight */
}

.search-input::placeholder {
    color: #999;
    opacity: 1;
    font-weight: normal;
}

.search-input-ghost {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    /* keep default font-weight so width matches the hidden real input */
}

.search-input-ghost .highlight {
    position: relative;
    background-color: transparent;
    font-weight: bold;
    /* keep default font-weight so width matches the hidden real input */
}

.search-input-ghost .highlight::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.15em;
    height: 0.6em;
    background-color: #FFD000;
    z-index: -1;
}

.suggestions-container {
    padding: 0;
    margin-top: 0.5rem;
}

.tag-suggestion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6A7380;
}

.tag-suggestion span:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-key {
    border: 1px solid #ccc;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #6A7380;
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 0.5rem;
    gap: 0.75rem;
    text-decoration: none;
}

.suggestion-item .favicon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.suggestion-text-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.suggestion-top-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-title {
    color: #111;
    font-weight: normal;
    text-decoration: underline;
}

.suggestion-title b {
    font-weight: bold;
    text-decoration: none;
}

.suggestion-description {
    font-size: 0.9rem;
    color: #6A7380;
    font-style: italic;
}

.suggestion-description b {
    font-weight: bold;
    color: #111;
}

.category-pill {
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    flex-shrink: 0;
    border: 1px solid;
}

.category-design {
    background-color: #FDCB4B;
    color: #FE7D19;
    border-color: #FE7D19;
}

.category-medical {
    background-color: #4B5AFD;
    color: #D5D6FF;
    border-color: #D5D6FF;
}

.category-utilities {
    background-color: #D1E5F0;
    color: #4393C3;
    border: 1px solid #4393C3;
}

.category-inspo {
    background-color: #FFACC0;
    color: #FF0000;
    border: 1px solid #FF0000;
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: #f0f0f0;
}

.about-content {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    gap: 0 1rem;
    align-items: center;
    margin-top: 2rem;
}

.about-image {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.about-intro {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    font-style: italic;
    margin: 0;
}

.about-body {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    margin-top: 2rem;
}

.about-body p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.command-section {
    margin: 2rem 0;
}

.command-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 1rem;
}

.command-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.command-pill {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    font-family: 'Zed Plex Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
    min-width: 2rem;
    text-align: center;
}

.command-description {
    font-size: 0.875rem;
    color: #333;
    line-height: 1.4;
}

/* Main content section */
main {
    margin-top: 2rem;
    padding-bottom: 2em;
}

.link-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 1rem;
    column-gap: 1rem;
}

.link-section h2 {
    font-size: 1.08rem;
    font-weight: bold;
    margin-bottom: 1rem;
    font-family: 'Statius';
}

.link-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-section li {
    margin-bottom: 0.5rem;
}

.link-section li:not(:has(img.favicon))::before {
    content: url('images/star.svg');
    display: inline-block;
    width: 16px;
}

.favicon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.link-section a {
    text-decoration: underline;
    color: #111;
    font-size: 0.9rem;
}

.link-section a:hover {
    text-decoration: none;
}

.pinned-title {
    font-size: 1.35rem;
    display: inline-block;
    line-height: 1.8;
    font-family: 'Statius';
    font-weight: bold;
    position: relative;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.pinned-title::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.25em;
    height: 0.6em;
    background-color: #FFD000;
    z-index: -1;
}

.bookmark-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* New Color Page Styles */

/* Systems Section */
.systems-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.system {
    display: grid;
    grid-template-columns: 160px 224px 224px;
    gap: 1rem 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.system-title {
    grid-column: 1 / 2;
    background-color: #0051FF;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    justify-self: start;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 28px);
    grid-auto-rows: 28px;
    gap: 0;
}

.palette-grid:nth-child(2) {
    grid-column: 2 / 3;
}

.palette-grid:nth-child(3) {
    grid-column: 3 / 4;
}

.row {
    display: contents;
}

.cell {
    width: 28px;
    height: 28px;
    background: transparent;
}

.cell:not([style]) {
    background-color: transparent;
}

.sub-palette-title {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    text-align: left;
    font-weight: bold;
    color: #6A7380;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 8px;
}

/* Swatches Section */
.swatches-container {
    display: grid;
    grid-template-columns: repeat(2, 224px); /* 8 * 28px = 224px */
    gap: 2rem;
}

.swatch-block {
    display: grid;
    grid-template-columns: repeat(8, 28px);
    grid-auto-rows: 28px;
    gap: 0;
    margin-bottom: 1rem;
}

/* Mobile Responsive */
@media (max-width: 850px) {
    .system {
        grid-template-columns: 1fr;
        gap: 1rem;
        justify-items: stretch;
    }
    
    /* On mobile, preserve the pill style for the title */
    .system-title {
        grid-column: 1;
    }
    
    /* Stack the palette grids vertically by overriding desktop columns */
    .palette-grid,
    .palette-grid:nth-child(2),
    .palette-grid:nth-child(3) {
        grid-column: 1;
    }
    
    .swatches-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.type-section {
    margin-bottom: 3rem;
    border-top: 1px solid transparent;
    padding-top: 1rem;
}

.type-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.type-section-header h2 {
    font-size: 0.7rem;
    font-weight: bold;
    background-color: #0051FF;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    text-transform: uppercase;
}

.theme-toggle {
    display: flex;
    gap: 0.5rem;
}

.theme-toggle button {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid #111;
    cursor: pointer;
}

.theme-toggle .light-mode {
    background-color: #fff;
}

.theme-toggle .dark-mode {
    background-color: #111;
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.font-showcase {
    border: 1px solid #eee;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.download-font {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    opacity: 0.1;
    width: 20px;
    height: 20px;
}

.download-font img {
    width: 100%;
    height: 100%;
}

.font-preview-content {
    width: 75%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.font-showcase .font-name {
    font-size: 1.62rem;
    margin-bottom: 0.5rem;
    font-weight: normal !important;
}

.font-showcase .font-foundry {
    font-size: 0.72rem;
    color: #666;
    text-transform: uppercase;
}

/* Dark Theme */
body.dark-theme {
    background-color: #111;
    color: #f9f9f9;
}

body.dark-theme .navigation a {
    color: #a9a9a9;
}

body.dark-theme h1.page-title,
body.dark-theme .desk-content h2 {
    color: #111;
    background-color: #FFAE00;
    padding: 0.05em 0.6em;
    border-radius: 0;
    font-family: 'iA Writer Quattro Variable', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-variation-settings: 'wdth' 50;
    letter-spacing: -0.025em;
    margin-bottom: 2rem;
    display: inline-block;
}

body.dark-theme h1.page-title::before,
body.dark-theme .desk-content h2::before {
    display: none; /* Completely remove the underline in dark mode */
}

body.dark-theme .link-section a {
    color: #a9a9a9;
    text-decoration: none;
}

body.dark-theme .font-showcase {
    border: 1px solid #333;
}

body.dark-theme .font-showcase .font-foundry {
    color: #999;
}

body.dark-theme .type-section {
    border-top: 1px solid transparent;
}

body.dark-theme .theme-toggle button {
    border-color: #f9f9f9;
}

body.dark-theme .header-logo {
    filter: invert(1);
}

body.dark-theme .navigation a.external::after {
    filter: invert(1);
}

body.dark-theme .download-font {
    filter: invert(1);
}

body.dark-theme .eligible-groups-box {
    background-color: #222;
}

body.dark-theme .search-input-ghost .highlight,
body.dark-theme .search-input,
body.dark-theme .search-input-ghost {
    letter-spacing: -0.025em; /* match H1 Quattro Variable */
    font-variation-settings: 'wdth' 50; /* condensed width like header */
}

body.dark-theme .search-input-ghost .highlight:empty {
    padding: 0;
}

body.dark-theme .search-input,
body.dark-theme .search-input-ghost {
    font-size: 1.0125rem;
    line-height: 1.5;
    font-family: 'Zed Plex Sans', sans-serif;
    padding: 0 0.5rem;
}

body.dark-theme .search-input {
    caret-color: #f9f9f9;
    text-indent: 0.5em;
    opacity: 1;
}

body.dark-theme .search-input::placeholder {
    color: #888;
    opacity: 1;
    font-weight: normal;
}

body.dark-theme .search-input.is-empty {
    background-color: transparent;
}

body.dark-theme .suggestion-title {
    color: #f9f9f9;
}

body.dark-theme .suggestion-title b {
    color: #f9f9f9;
}

body.dark-theme .suggestion-description {
    color: #aaa;
}

body.dark-theme .suggestion-description b {
    color: #f9f9f9;
}

body.dark-theme .category-medical {
    color: #f9f9f9;
}

body.dark-theme .category-utilities {
    color: #f9f9f9;
}

body.dark-theme .pinned-title {
    font-family: 'Zed Plex Sans', sans-serif;
    background-color: #FFD000;
    color: #000;
    padding: 0.25em 0.5em;
    border-radius: 0.25em;
    line-height: 1.5;
    font-size: 1.0125rem;
    display: inline-block;
}

body.dark-theme .pinned-title::before {
    display: none;
}

body.dark-theme .link-section a {
    color: #f9f9f9;
    text-decoration: none;
}

body.dark-theme .category-design {
    background-color: #FE7D19;
    color: #FDCB4B;
    border-color: #FDCB4B;
}

body.dark-theme .category-medical {
    background-color: #D5D6FF;
    color: #4B5AFD;
    border-color: #4B5AFD;
}

body.dark-theme .category-utilities {
    background-color: #1A4258;
    color: #6AACD7;
    border-color: #6AACD7;
}

body.dark-theme .category-inspo {
    background-color: #FFACC0;
    color: #FF0000;
    border: 1px solid #FF0000;
}

body.dark-theme .search-input.is-empty {
    caret-color: #666;
}

body.dark-theme .tab-key {
    border-color: #555;
    color: #aaa;
}

body.dark-theme .command-section-title {
    color: #666;
}

body.dark-theme .command-pill {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

body.dark-theme .command-description {
    color: #ccc;
}

/* Desk page styles */
.desk-content {
    max-width: 800px;
}

.desk-item {
    margin-bottom: 1rem;
}

.desk-item h3 {
    font-size: 1.08rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    font-family: 'Statius';
}

.desk-item p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.desk-item ul {
    font-family: 'Zed Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 0.9rem;
    line-height: 1.6;
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

body.dark-theme .desk-item h3 {
    color: #f9f9f9;
}

.apps-section .desk-item {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
    margin-bottom: 1rem;
}

.apps-section .desk-item h3,
.apps-section .desk-item p {
    margin-bottom: 0;
}

/* Responsive Styles for Mobile */
@media (max-width: 850px) {
    body {
        margin: 1rem;
    }

    .container {
        flex-direction: column;
    }

    .content {
        width: 100%;
        order: 2;
    }

    .navigation {
        width: 100%;
        max-width: none;
        justify-content: flex-end;
        order: 1;
        margin-bottom: 2rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .navigation a {
        white-space: normal;
        margin-bottom: 0;
    }

    .link-sections {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.125rem;
    }

    .header {
        margin-bottom: 2rem;
    }

    .search-section {
        margin: 2rem 0;
    }

    /* Swap "about" and "photographs" in mobile nav */
    .navigation a:nth-child(4) {
        order: 3;
    } /* photographs */
    .navigation a:nth-child(5) {
        order: 2;
    } /* visual design */
    .navigation a:nth-child(6) {
        order: 1;
    } /* about */

    /* Item page responsive styles */
    .chronic-care-section .chronic-care-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .eligible-groups-box {
        max-width: none;
        width: 100%;
        box-sizing: border-box;
        padding: 0.75rem 1rem;
    }

    .item-section > .item-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .item-list li {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .item-list .nums {
        justify-items: start;
    }

    .item-column {
        padding-left: 0;
        padding-right: 0;
    }

    .apps-section .desk-item h3,
    .apps-section .desk-item p {
        text-align: left;
    }
}

/* Item page styles */
.item-page-content {
    margin-top: 2rem;
}

.item-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.item-column {
    flex: 1;
    padding: 0 1rem;
    min-width: 300px;
}

.item-column:first-child {
    padding-left: 0;
}

.item-column:last-child {
    padding-right: 0;
}

.item-section {
    margin-bottom: 2rem;
}

.item-section h2 {
    font-size: 1.35rem;
    font-family: 'Statius';
    font-weight: bold;
    margin-bottom: 1.5rem;
}

.item-section h3 {
    font-size: 0.9rem;
    font-weight: normal;
    margin-top: 1rem;
    margin-bottom: -0.5rem;
    font-family: 'Zed Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.item-group, .item-grid-col {
    margin-bottom: 2rem;
}

.item-group:first-of-type h3 {
    margin-top: 0;
}

.item-list {
    list-style-type: none;
    padding-left: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 480px;
    font-family: 'Zed Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.item-list.bulleted li {
    position: relative;
    padding-left: 15px;
}

.item-list.bulleted li::before {
    content: "•";
    position: absolute;
    left: 0;
}

.item-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: none;
}

.item-list .desc {
    padding-right: 1rem;
}

.item-list .nums {
    display: flex;
    font-family: "Geist Mono", monospace;
    color: #444;
    letter-spacing: -0.5px;
    gap: 1.5rem;
    white-space: nowrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.item-list .nums span {
    min-width: 40px;
    text-align: right;
    padding: 0 0.25rem;
}

.health-assessment-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.health-assessment-lists {
    flex: 2;
}

.chronic-care-section .chronic-care-content {
    display: block;
    gap: 0;
    align-items: initial;
}

.chronic-care-groups {
    display: block;
    flex: 1;
}

.eligible-groups-box {
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    height: fit-content;
    flex: 1;
}

.eligible-groups-box h4 {
    font-family: 'Statius';
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.eligible-groups-box ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    line-height: 1.8;
}

.eligible-groups-box li {
    margin-bottom: 0.5rem;
}

.eligible-groups-box .tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-right: 0.5rem;
}

.tag-yearly { background-color: #FFC53D; color: #111; }
.tag-once { background-color: #FF5841; color: white; }
.tag-annual { background-color: #419F2B; color: white; }

/* Health Assessments tooltip */
.tooltip-trigger {
    position: relative;
    cursor: help;
}

.tooltip-content {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Zed Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

.tooltip-trigger:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

.tooltip-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tooltip-content li {
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    color: #f1f1f1;
}

.tooltip-content li:last-child {
    margin-bottom: 0;
}

.tooltip-content .tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-right: 0.5rem;
}

.item-grid {
    display: block;
}

.item-grid-col {
    break-inside: avoid;
}

.item-grid-col:first-of-type {
    padding-right: 0;
}
.item-grid-col:last-child {
    padding-left: 0;
}

.item-grid-col h3:first-of-type {
    margin-top: 0;
}

.sub-list {
    padding-left: 20px;
}

#bookmarks-search-input, #bookmarks-search-input-ghost {
    padding-left: 0;
}

body.dark-theme #bookmarks-search-input,
body.dark-theme #bookmarks-search-input-ghost {
    padding-left: 0;
}

body.dark-theme .search-input {
    caret-color: #f9f9f9;
}

/* Tooltip for color cells */
.color-tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Geist Mono', monospace;
    z-index: 1000;
    pointer-events: none; /* So it doesn't interfere with mouse events on the cell */
    white-space: nowrap;
}

/* MBS item number tooltips */
.item-number {
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.item-number:hover {
    color: #0066cc;
}

body.dark-theme .item-number:hover {
    color: #4da6ff;
}

.mbs-tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Zed Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mbs-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.mbs-tooltip .fee-amount {
    font-weight: bold;
    color: #4CAF50;
}

.mbs-tooltip .loading {
    color: #ccc;
    font-style: italic;
}

.mbs-tooltip .error {
    color: #ff6b6b;
    font-style: italic;
}

body.dark-theme .mbs-tooltip {
    background-color: #2a2a2a;
    color: #f1f1f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Typora-style table styling for desk.html */
.typora-table {
    border-collapse: collapse;
    margin: 0 0 32px;
    font-family: 'Zed Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
}

.typora-table td {
    padding: 1rem 0.5rem;
    vertical-align: top;
    border: none;
    line-height: 1.6;
    text-align: left;
}

/* First column (text) should have minimal left padding to align with body text */
.typora-table td:first-child {
    padding-left: 0;
}

/* Last column should have minimal right padding */
.typora-table td:last-child {
    padding-right: 0;
}

/* Subheadings within table cells */
.typora-table td b {
    font-family: 'Statius', serif;
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
    color: inherit;
}

/* Better line spacing for bullet lists */
.desk-content ul {
    line-height: 1.8;
    margin: 1rem 0;
}

.desk-content ul li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* Keyboard shortcut pill styling to match Typora theme */
code {
    color: #1000E0;
    background-color: rgba(0, 51, 255, 0.05);
    border: 1px solid rgba(0, 51, 255, 0.2);
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 0.9em;
    font-family: 'Zed Plex Sans', sans-serif;
    white-space: nowrap;
}

/* Style for keyboard shortcuts that appear as text (not in code tags) */
.magic-key {
    color: #1000E0;
    background-color: rgba(0, 51, 255, 0.05);
    border: 1px solid rgba(0, 51, 255, 0.2);
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 0.9em;
    font-family: 'Zed Plex Sans', sans-serif;
    white-space: nowrap;
    display: inline-block;
}

/* Text column should always be 2/3 width, whether it's first or second */
.typora-table td:has(b):not(:has(img)) {
    width: 66.7%;
}

/* Image column should always be 1/3 width, whether it's first or second */
.typora-table td:has(img) {
    width: 33.3%;
}

/* Fallback for browsers that don't support :has() */
.typora-table td:first-child:not(:has(img)) {
    width: 66.7%;
}

.typora-table td:last-child:not(:has(img)) {
    width: 66.7%;
}

.typora-table td:first-child:has(img) {
    width: 33.3%;
}

.typora-table td:last-child:has(img) {
    width: 33.3%;
}

/* Center only the images, not the text */
.typora-table td img {
    display: block;
    margin: 0 auto;
}

.typora-table img {
    max-width: 200px !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
}

/* Center the specific standalone Layer 6 image */
img[src="content/assets/Layer 6.png"] {
    display: block;
    margin: 0 auto;
}

/* Ensure all headings use Statius bold with consistent styling */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Statius', serif;
    font-weight: bold;
}

/* Ensure paragraphs and table text use Zed Plex Sans with proper sizing */
p, td, li {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
}

/* Dark theme support for typora tables */
body.dark-theme .typora-table {
    color: #e0e0e0;
}

body.dark-theme .typora-table td {
    border-color: #333;
}

body.dark-theme .typora-table td b {
    color: #f1f1f1;
}

/* Dark theme support for section headings */
body.dark-theme .desk-content h2::before {
    background-color: #FFD000;
}

/* Dark theme support for code/keyboard shortcuts */
body.dark-theme code,
body.dark-theme .magic-key {
    color: #6bb6ff;
    background-color: rgba(107, 182, 255, 0.1);
    border-color: rgba(107, 182, 255, 0.3);
}

.toc-nav {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    background-color: #f3f4ff;
    padding: 10px 0;
    border-radius: 20px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    border: 1px solid #dadaff;
    width: 38px;
    box-sizing: border-box;
    opacity: 1;
}

.toc-nav--hidden {
    opacity: 0;
    pointer-events: none;
}

.toc-nav.is-expanded {
    width: 180px;
}

.toc-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.toc-nav li {
    margin: 6px 0;
    transition: all 0.3s ease;
}

.toc-nav a {
    display: block;
    position: relative;
    width: 100%;
    height: 18px;
    text-decoration: none;
    -webkit-user-drag: none; /* prevent link drag on mobile */
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

.toc-nav a .pip {
    position: absolute;
    top: 50%;
    left: 15px; /* (38px container - 8px pip) / 2 */
    transform: translateY(-50%);
    display: block;
    width: 8px;
    height: 8px;
    background-color: #dadaff; /* Unfocused pip color */
    border-radius: 50%;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toc-nav.is-expanded a .pip {
    left: 157px; /* 180px container - 15px margin - 8px pip */
}

.toc-nav a.active .pip {
    background-color: #4354be; /* Focused pip color */
    transform: translateY(-50%) scale(1.1);
}

.toc-nav a.active .title {
    font-weight: bold;
}

.toc-nav a .title {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #4354be; /* Text color */
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    line-height: 1;
}

.toc-nav.is-expanded a .title {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* Add some space to headings for better scrolling */
h2[id] {
    padding-top: 60px;
    margin-top: -40px;
}

/* --- Dark theme overrides (headers & search bars) --- */
body.dark-theme .pinned-title,
body.dark-theme .page-title {
    color: #111;
    background-color: #FFAE00; /* match H1 header style */
    padding: 0.05em 0.6em;
    border-radius: 0;
    font-family: 'iA Writer Quattro Variable', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    font-variation-settings: 'wdth' 50;
    letter-spacing: -0.025em;
    margin-bottom: 2rem;
    display: inline-block;
}

body.dark-theme .pinned-title::before,
body.dark-theme .page-title::before {
    display: none;
}

/* Search bar pill + input styles (dark mode) */
body.dark-theme .search-input-ghost .highlight {
    background-color: #FFAF01;
    color: #000;
    font-family: 'iA Writer Quattro Variable', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    font-variation-settings: 'wdth' 50;
}

body.dark-theme .search-input,
body.dark-theme .search-input-ghost {
    font-family: 'iA Writer Quattro Variable', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    font-variation-settings: 'wdth' 50;
}

/* Improve dark-mode readability of suggestion items on hover */
body.dark-theme .suggestion-item:hover,
body.dark-theme .suggestion-item.active {
    background-color: #333; /* dark grey to preserve contrast with white text */
}

/* Dark theme body text color for better readability */
body.dark-theme p,
body.dark-theme td,
body.dark-theme li {
    color: #908E8C; /* updated for better contrast */
}

/* Dark theme H2-like headers (link sections & table headers) */
body.dark-theme .link-section h2,
body.dark-theme .typora-table td b {
    color: #E5E5DD;
    background: none;
    font-family: 'iA Writer Quattro Variable', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: -0.025em;
    font-variation-settings: 'wdth' 50;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Dark theme body link colors */
body.dark-theme .link-section a,
body.dark-theme p a,
body.dark-theme li a {
    color: #908E8C;
    text-decoration: underline;
}

/* Dark theme desk-content tertiary headers to match H2 style */
body.dark-theme .desk-content h3 {
    color: #E5E5DD;
    background: none;
    font-family: 'iA Writer Quattro Variable', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: -0.025em;
    font-variation-settings: 'wdth' 50;
    margin: 1.5rem 0 1rem;
    display: block;
}

/* Dark theme styling for floating table-of-contents navigation */
body.dark-theme .toc-nav {
    background-color: #1a1a1a; /* dark panel */
    border-color: #333;
}
body.dark-theme .toc-nav a .pip {
    background-color: #555; /* subdued dot */
}
body.dark-theme .toc-nav a.active .pip {
    background-color: #FFD000; /* highlight active */
}
body.dark-theme .toc-nav a .title {
    color: #908E8C; /* subtle text */
}
body.dark-theme .toc-nav a.active .title {
    color: #E5E5DD; /* brighter for active */
}

/* When user is selecting text, keep ghost overlay in place but invisible */
.search-input-ghost.selection-active {
    opacity: 0;
}

/* Brighter selection colors for dark theme */
body.dark-theme .search-input::selection {
    color: #ffffff;
    background-color: #0B5CFF;
}