    :root {
        --header-bg: #1e664f;
        --header-fg: #fff;
        --max-content: 64rem;
        /* ~1024px */
        --gap: 12px;
        --tap: 44px;
        /* min tap size */
    }

    /* Base resets */
    * {
        box-sizing: border-box
    }

    html, body {
        height: 100%
    }

    body {
        margin: 0;
        font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
        line-height: 1.5;
        color: #111;
        background: #fff;
    }

    /* Header */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: var(--header-bg);
        color: var(--header-fg);
        padding: 10px 16px;
    }

    .nav-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: var(--gap);
        max-width: var(--max-content);
        margin: 0 auto;
    }

    .brand {
        justify-self: start;
        font-weight: 700;
        letter-spacing: .2px;
        font-family: "Playfair Display", serif;
        font-optical-sizing: auto;
        font-style: normal;
        font-size: x-large;
    }

    .brand a {
        color: inherit;
        text-decoration: none;
    }

    .primary-nav {
        justify-self: center;
    }

    .nav-list {
        display: flex;
        gap: 20px;
        list-style: none;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    .nav-list a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: var(--tap);
        padding: 0 12px;
        color: var(--header-fg);
        text-decoration: none;
        border-radius: 8px;
    }

    .nav-list a:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .actions {
        justify-self: end;
    }

    /* Hamburger (hidden on desktop) */
    .menu-toggle {
        display: none;
        background: transparent;
        border: 0;
        color: var(--header-fg);
        width: var(--tap);
        height: var(--tap);
        border-radius: 10px;
        cursor: pointer;
    }

    .menu-toggle:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .menu-icon {
        display: block;
        width: 24px;
        height: 2px;
        background: currentColor;
        position: relative;
    }

    .menu-icon::before, .menu-icon::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        height: 2px;
        background: currentColor;
    }

    .menu-icon::before {
        top: -7px;
    }

    .menu-icon::after {
        top: 7px;
    }

    .content {
        max-width: 80%;
        margin: 0 auto;
        padding: 16px;
    }

    img {
        max-width: 600px;
        height: auto;
        margin-top: 1em;
    }

    .form-group {
        margin-bottom: 1em;
    }

    label {
        display: block;
        margin-bottom: .5em;
    }

    input[type='text'], input[type='number'] {
        width: 100%;
        padding: .6em .8em;
        border: 1px solid #ccc;
        border-radius: 8px;
        overflow: hidden;
    }

    #content {
        margin-bottom: 10px;
    }

    .form-group label {
        display: block;
        margin-bottom: .5rem;
        font-weight: 600;
    }

    .kv-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .kv-list li {
        padding: 6px 8px;
        border-bottom: 1px solid #eee;
    }

    .kv-list label.row {
        display: grid;
        grid-template-areas:
            "radio name track pct";
        grid-template-columns: 5% 43% 43% 5%; /* Smaller than 100% due to gap */
        /* radio | name | bar | % */
        gap: 10px;
        align-items: center;
        cursor: pointer;
    }

    .kv-list .name {
        grid-area: name;
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .kv-list .track {
        grid-area: track;
        height: 6px;
        background: #eee;
        border-radius: 999px;
        overflow: hidden;
        min-width: 100px;
    }

    .kv-list .fill {
        height: 100%;
        width: 0%;
        background: currentColor;
    }

    .kv-list input[type="radio"] {
        grid-area: radio;
        transform: translateY(1px);
    }

    .kv-list .pct {
        grid-area: pct;
        color: #ccc;
    }

    button {
        display: inline-block;
        outline: 0;
        cursor: pointer;
        text-align: center;
        border: 0;
        padding: 7px 16px;
        min-height: 36px;
        min-width: 36px;
        color: #ffffff;
        background: #1e664f;
        border-radius: 4px;
        font-weight: 500;
        font-size: 14px;
        box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 0px 0px, rgba(0, 0, 0, 0.2) 0px -1px 0px 0px inset;
        margin-right: 5px;
    }

    button:hover {
        background: #006e52;
    }

    button:disabled {
        background: #5F7D73;
    }

    input[type="file"]::file-selector-button {
        display: none;
    }

    #catalogText_p {
        padding: 15px;
        border: 2px solid #eee;
        display: flow-root;
        max-width: 600px;
    }

    span.valuation {
        float: right;
    }

    span.disclaimer {
        float: left;
    }

    #upload-section {
        align-items: center;
    }

    span#file-chosen {
        min-width: 450px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .showlist-controls button {
        margin-top: 5px;
        outline: 0;
        cursor: pointer;
        text-align: center;
        border: 0;
        padding: 5px 8px;
        min-width: 20px;
        min-height: 20px;
        color: #ffffff;
        background: #1e664f;
        border-radius: 4px;
        font-weight: 500;
        font-size: 12px;
        box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 0px 0px, rgba(0, 0, 0, 0.2) 0px -1px 0px 0px inset;
    }

    /* Skeleton shimmer */
    .skeleton {
        display: inline-block;
        height: 1em;
        border-radius: 4px;
        background: linear-gradient(90deg, #d5d5d5, #e4e4e4, #bebebe);
        background-size: 200% 100%;
        animation: ct-shimmer 1.2s infinite;
    }

    @keyframes ct-shimmer {
        0% {
            background-position: 200% 0
        }

        100% {
            background-position: -200% 0
        }
    }

    .w-20 {
        width: 20%
    }

    .w-30 {
        width: 30%
    }

    .w-50 {
        width: 50%
    }

    .w-70 {
        width: 70%
    }

    .w-90 {
        width: 90%
    }

    /* Typewriter caret */
    .typing {
        position: relative
    }

    .typing::after {
        content: "▍";
        display: inline-block;
        margin-left: 2px;
        animation: ct-blink 1s steps(1, end) infinite
    }

    @keyframes ct-blink {
        50% {
            opacity: 0
        }
    }

    .accordion {
        max-width: 800px;
        border: 1px solid #ccc;
        border-radius: 5px;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .accordion-item {
        border-bottom: 1px solid #ccc;
    }

    .accordion-header {
        display: flex;
        justify-content: space-between;
        font-size: medium;
        padding: 10px;
        background: #fafafa;
        border-bottom: 1px solid #ccc;
        cursor: pointer;
        font-weight: 500;
    }
    
    .accordion-title {
        flex: 1; /* Push title to the left */
    }
    
    .accordion-content {
        display: none;
        padding: 10px;
        border: 1px solid #ccc;
        border-top: none;
    }
    
    .accordion-content.show {
        display: block;
    }

    .accordion-right {
        display: flex;
        align-items: center;
        gap: 10px; /* Space between score and flipper */
    }

    .valuation_disclamer {
        font-style: italic;
        font-size: small;
        font-weight: 500;
    }

    .score {
        color: #aaa;
    }
    
    .flipper-icon {
        transition: transform 0.3s ease;
    }

    .accordion-header.active .flipper-icon {
        transform: rotate(180deg); /* Flip the icon when active */
    }

    #edit-section {
        margin-bottom: 20px;
    }

    .title {
        font-weight: 500;
    }

    .autocomplete {
        position: relative;
        width: 100%;
        max-width: 800px;
        font-family: Arial, sans-serif;
    }

    /* Input */
    .autocomplete input {
        width: 100%;
        padding: 8px 32px 8px 8px;
        border: 1px solid #ccc;
        border-radius: 6px;
        box-sizing: border-box;
    }

    /* Clear button */
    .autocomplete .clear-btn {
        position: absolute;
        right: 6px;
        top: 0px;
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 16px;
        opacity: 0.5;
        box-shadow: none;
        font-weight: bold;
        color: #1e664f;
        padding: 0;
    }
    .autocomplete .clear-btn:hover {
        opacity: 1;
    }

    /* Dropdown container */
    .autocomplete .dropdown {
        position: absolute;
        width: 100%;
        background: #fff;
        border: 1px solid #ccc;
        border-radius: 6px;
        margin-top: 4px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);

        max-height: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;

        transition:
            max-height 0.25s ease,
            opacity 0.25s ease,
            transform 0.25s ease;
        transform: translateY(-4px);
        z-index: 50;
    }

    /* dropdown shown */
    .autocomplete .dropdown.show {
        max-height: 200px;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        overflow-y: auto;
    }

    /* dropdown items */
    .dropdown .item {
        display: flex;
        justify-content: space-between;
        padding: 8px;
        cursor: pointer;
        font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    }

    .dropdown .item:hover {
        background: #f2f5fa;
    }

    .dropdown .item .name {
        flex: 1;
    }

    .dropdown .item .count {
        color: #666;
        margin-left: 12px;
        white-space: nowrap;
    }


    /* --- Mobile styles --- */
    @media (max-width: 720px) {
        .content {
            max-width: 90%;
            padding: 0px;
        }

        .nav-grid {
            display: grid;
            grid-template-columns: 1fr auto;
            /* brand + button */
            grid-template-areas:
                "brand toggle"
                "menu  menu";
            row-gap: 8px;
        }

        .brand {
            grid-area: brand;
        }

        .actions {
            display: none;
        }

        /* hide empty actions area */
        .primary-nav {
            grid-area: menu;
            justify-self: stretch;
        }

        /* show hamburger */
        .menu-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            grid-area: toggle;
            justify-self: end;
            align-self: start;
        }

        /* turn menu into a collapsible panel */
        .nav-list {
            display: none;
            /* hidden by default */
            flex-direction: column;
            gap: 4px;
            padding: 8px;
            background: rgba(0, 0, 0, .08);
            border-radius: 10px;
        }

        .nav-list a {
            padding: 10px 12px;
            border-radius: 8px;
        }

        .nav-open .nav-list {
            display: flex;
        }

        /* nicer touch spacing in header */
        .site-header {
            padding: 8px 12px;
        }

        .kv-list label.row {
            display: grid;
            grid-template-areas:
                "radio name name"
                "radio track pct";
            grid-template-columns: 1fr 3fr 1fr;
            /* radio | name  
                     | bar | % */
            gap: 12px;
            align-items: center;
            cursor: pointer;
        }

        span#file-chosen {
            min-width: 250px;
            margin-left: 10px;
            margin-right: 10px;
            overflow: auto;
        }

        img {
            max-width: 100%;
            height: auto;
            margin-top: 0em;
        }
        
        .accordion {
            max-width: 600px;
            border: 1px solid #ccc;
            border-radius: 5px;
            margin-top: 10px;
            margin-bottom: 10px;
        }

        .accordion-item {
            border-bottom: 1px solid #ccc;
        }

        .accordion-header {
            display: flex;
            justify-content: space-between;
            padding: 10px;
            background: #f3f3f3;
            border-bottom: 1px solid #ccc;
            cursor: pointer;
        }

        .accordion-content {
            display: none;
            padding: 10px;
            background: #fff;
        }

    }

    /* Reduce motion support */
    @media (prefers-reduced-motion: reduce) {
        * {
            scroll-behavior: auto
        }
    }