html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

:root {
    --bd-primary: #0f5ea8;
    --bd-accent: #11a37f;
    --bd-border: rgba(15, 94, 168, 0.16);
    --bd-soft: rgba(15, 94, 168, 0.07);
}

body {
    min-height: 100vh;
}

.brand-image {
    width: 36px;
    height: 36px;
    color: #fff;
}

.dark-blue {
    background:#0b5cab;
    color:white;

}

.bg-primary-60 {
    background: #0B5DD7;
    font-weight:bold;
}

.bg-danger-soft {
    background-color: #b14655 !important;
}

.bg-danger-soft-dark {
    background-color: #873743 !important;
}

.bg-warning-soft {
    background-color: #c99700 !important;
}

.bg-warning-soft-dark {
    background-color: #a17800 !important;
}

.selector-card.selected {
    border: 2px solid navy;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef; /* light grey */
    color: #000; /* black initials */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}
.x-small {
    font-size: 0.7em !important;
}

.app-content-header h3 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.card {
    border: 0;
    border-radius: 1rem;
}

.card-outline.card-primary {
    border-top: 4px solid var(--bd-primary);
}

.card-outline.card-success {
    border-top: 4px solid var(--bd-accent);
}

.card-outline.card-info {
    border-top: 4px solid #0dcaf0;
}

.card-outline.card-secondary {
    border-top: 4px solid #6c757d;
}

.card-title {
    font-weight: 800;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #0f5ea8, #12395d);
    color: #fff;
    box-shadow: 0 1rem 2rem rgba(15, 94, 168, 0.22);
}

    .hero-panel h1 {
        margin: 0.15rem 0;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

.eyebrow {
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.hero-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

/* minmax(0, 1fr): a plain 1fr track grows to the longest word, pushing cards out of a narrow column */
.product-type-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

/* Products / Product Types columns: cards size to the column, and shrink (below) when it's narrow */
.product-grid,
.product-type-grid {
    container-type: inline-size;
}

/* product type card + its download buttons (Views/Catalogue/_ProductTypes).
   The buttons can't nest inside the card's <button>, so they're overlaid in its bottom-right corner. */
.product-type-item {
    position: relative;
    min-width: 0;
}

.product-type-card.has-downloads {
    padding-bottom: 2.6rem;
}

.product-type-downloads {
    position: absolute;
    right: 0.75rem;
    bottom: 0.6rem;
    z-index: 1;
}

/* borderless icon-only download buttons (product type cards, series cards) */
.product-type-downloads > .btn,
.dl-icons > .btn {
    border: 0;
}

/* 7z downloads: the format icon (CSV / JSON) with a small archive badge, so icon-only buttons stay distinct */
.dl-7z { position: relative; display: inline-block; }
.dl-7z-badge {
    position: absolute;
    right: -0.45em;
    bottom: -0.3em;
    font-size: 0.6em;
    padding: 0.1em;
    border-radius: 0.2em;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}
.btn .dl-7z { margin-right: 0.35em; }
.btn-group .btn .dl-7z { margin-right: 0.2em; }

.product-type-card{
    width: 100%;
    border: 1px solid var(--bd-border);
    background: var(--bs-body-bg);
    border-radius: 1rem;
    padding: 1rem;
    text-align: left;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

    .product-type-card:hover,
    .product-type-card.active{
        border-color: var(--bd-primary);
        box-shadow: 0 0.75rem 1.5rem rgba(15, 94, 168, 0.12);
        transform: translateY(-1px);
    }

.product-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.8rem;
    background: var(--bd-soft);
    color: var(--bd-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.product-name {
    font-weight: 700;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.product-action {
    color: var(--bd-primary);
}

.product-type-card {
    min-width: 0;
}

.product-icon,
.product-action {
    flex: 0 0 auto;
}

/* narrow column (e.g. Products / Product Types side by side): smaller padding, icon and text */
@container (max-width: 240px) {
    .product-type-card {
        padding: 0.6rem;
        gap: 0.5rem;
        border-radius: 0.8rem;
    }

    .product-type-card.has-downloads {
        padding-bottom: 2.3rem;
    }

    .product-icon {
        width: 2rem;
        height: 2rem;
        border-radius: 0.6rem;
        font-size: 1rem;
    }

    .product-name {
        font-size: 0.875rem;
    }

    .product-type-downloads {
        right: 0.35rem;
        bottom: 0.35rem;
    }
}

/* very narrow: drop the chip icon and tighten so the name keeps whole words */
@container (max-width: 170px) {
    .product-icon {
        display: none;
    }

    .product-type-card {
        padding: 0.5rem 0.5rem 0.5rem 0.6rem;
        gap: 0.35rem;
    }

    .product-type-card.has-downloads {
        padding-bottom: 2.2rem;
    }

    .product-name {
        font-size: 0.8rem;
    }
}

.selection-summary {
    border: 1px solid var(--bd-border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--bd-soft);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
}

.range-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bd-border);
}

.range-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.75rem;
}

.range-card {
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    padding: 16px;
    background: #fff;
    cursor: pointer;
    transition: all .15s ease;
    margin-bottom: 12px;
}

    .range-card:hover {
        background: #f8fafc;
        border-color: #c5d2df;
    }

.range-main {
    display: block;
    margin-bottom: 10px;
}

    .range-main i {
        color: #0d6efd;
        margin-right: 6px;
    }

    .range-main strong {
        color: #0b5cab;
        font-size: 1.1rem;
        font-weight: 600;
    }

.range-meta {
    display: block;
    color: #6c757d;
    font-size: .95rem;
    margin-bottom: 14px;
}

.range-series {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

    .range-series .form-select {
        width: 100%;
    }


.upload-zone {
    border: 1px dashed rgba(15, 94, 168, 0.35);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    background: linear-gradient( 180deg, rgba(15, 94, 168, 0.055), rgba(17, 163, 127, 0.045) );
}

.upload-zone-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--bd-primary);
    font-size: 2.3rem;
    box-shadow: 0 0.75rem 1.5rem rgba(15, 94, 168, 0.12);
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}

.empty-state {
    border: 1px dashed var(--bd-border);
    border-radius: 1rem;
    padding: 3rem 1rem;
    text-align: center;
    background: var(--bs-tertiary-bg);
}

    .empty-state > i {
        display: block;
        font-size: 3rem;
        color: var(--bd-primary);
        margin-bottom: 1rem;
    }

@media (max-width: 768px) {
    .hero-panel {
        display: block;
    }

    .hero-badge {
        margin-top: 1rem;
        display: inline-flex;
    }

    .range-toolbar {
        display: block;
    }

    .product-type-card {
        padding: 0.85rem;
    }
}

/* Doc tiles and code panels: API page and Getting Started */
.doc-tile {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 92px;
    padding: 1rem 2.5rem 1rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.65rem;
    box-shadow: 0 0.0625rem 0.2rem rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .doc-tile:hover,
    .doc-tile:focus {
        color: var(--bs-body-color);
        text-decoration: none;
        border-color: var(--bs-primary);
        box-shadow: 0 0.35rem 0.9rem rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

.doc-icon {
    display: inline-flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-right: 0.9rem;
    border-radius: 0.65rem;
    font-size: 1.1rem;
}

.doc-content {
    display: block;
    min-width: 0;
}

.doc-title {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--bs-body-color);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
}

.doc-description {
    display: block;
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    line-height: 1.35;
}

.doc-arrow {
    position: absolute;
    top: 50%;
    right: 1rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    transform: translateY(-50%);
}

.doc-tile:hover .doc-arrow {
    color: var(--bs-primary);
}

.code-panel {
    display: block;
    width: 100%;
    padding: 1rem;
    overflow-x: auto;
    color: #e9ecef;
    background-color: #212529;
    border: 1px solid #343a40;
    border-radius: 0.5rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

    .code-panel code {
        color: inherit;
    }

