html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

@media (min-width: 1400px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 1385px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Keep Bootstrap defaults for base cards. Don't make every card look identical. */
.card {
    border-radius: 8px;
}

    /* Outer container card (the page wrapper) should be quieter than inner cards */
    .card.mb-2 {
        border: 1px solid #e5e7eb;
        box-shadow: none;
    }

/* Layout for the group of field cards */
.card-group {
    gap: 16px; /* spacing between cards */
    align-items: stretch;
}

.field-img {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.field-img__img {
    height: 100%;
    width: 100%;
    object-fit: contain !important;
    object-position: center;
}

/* Your field cards: give them the real "card" treatment */
.card-field {
    flex: 0 0 320px;
    max-width: 415px;
    border: 1px solid rgb(199 197 197);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden; /* ensures footer/header backgrounds clip to radius */
    background: #ffffff;
}

    /* Add a subtle hover to improve separation while scanning */
    .card-field:hover {
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
        border-color: #d1d5db;
    }

    /* Title + subtitle hierarchy */
    .card-field .card-header {
        background: rgb(199 197 197);
    }

    /* Title + subtitle hierarchy */
    .card-field .card-title {
        font-size: 1.05rem;
        font-weight: 700;
        margin: 12px 12px 2px 12px;
    }

    .card-field .card-subtitle {
        font-size: .85rem;
        color: #6b7280;
        letter-spacing: .02em;
        margin: 0 12px 10px 12px;
        padding-top: 10px;
        text-align: left !important; /* override your text-center for better hierarchy */
    }

    /* Image block: make it read like a section */
    .card-field .card-img {
        padding: 10px 12px 12px 12px;
        border-top: 1px solid #f1f5f9;
        border-bottom: 1px solid #f1f5f9;
        background: #fbfdff;
        text-align: center;
    }

        .card-field .card-img img {
            max-height: 150px;
            width: 100%;
            object-fit: cover;
            border-radius: 8px;
        }

    /* Info block: make labels and values distinct */
    .card-field .card-body {
        padding: 12px;
    }

    .card-field dl.row {
        margin: 0;
    }

    .card-field dt {
        color: #6b7280; /* muted label */
        font-weight: 600;
        font-size: .85rem;
    }

    .card-field dd {
        color: #111827; /* strong value */
        font-weight: 600;
        font-size: .9rem;
        margin-bottom: .5rem;
    }

        /* Optional: if you keep the "x " prefix, make it quieter without changing markup */
        .card-field dd::first-letter {
            color: #9ca3af;
            font-weight: 500;
        }

    /* Footer separation and action density */
    .card-field .card-footer {
        background: #f8fafc;
        border-top: 1px solid #e5e7eb;
        padding: 10px 12px;
    }

    /* Make the icon buttons less heavy */
    .card-field .btn.btn-outline-secondary {
        background: #f8fafc; /* keep Bootstrap default-ish */
        opacity: .92;
        border: 1px solid black;
    }

        .card-field .btn.btn-outline-secondary:hover {
            background: #747272;
            opacity: 1;
        }

    /* Slightly reduce the button footprint and unify */
    .card-field .btn.btn-sm {
        padding: .25rem .45rem;
        line-height: 1.1;
    }

/* container for the cards */
.field-cards {
    display: grid;
    gap: 12px; /* spacing between cards */
    /* Each card is at least 320px, otherwise share remaining space evenly */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    /* Optional: keep the whole grid centered when there’s leftover space */
    justify-content: center;
}

/* the cards */
.field-card {
    width: 100%; /* important: let the grid define width */
    height: 100%; /* optional: helps equal-height “feel” when content differs */
}

/* Detail-page section cards */
.field-section-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    background: #fff;
}

    .field-section-card .card-header {
        border-bottom: 1px solid #f1f5f9;
        font-weight: 600;
    }

    .field-section-card .card-body {
        padding: 12px;
    }

.field-single-wrap {
    display: flex;
    justify-content: center;
}

.card-field.card-field-single {
    width: 100%;
    max-width: 980px;
    flex: 0 1 980px;
}

.field-single-layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.field-single-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.field-img-single {
    height: 320px;
    min-height: 320px;
}

    .field-img-single .field-img__img {
        width: 100%;
        height: 100%;
        object-fit: contain !important;
    }

.field-mini-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    min-width: 0;
}

.field-mini-panel__title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #111827;
}

@media (max-width: 991.98px) {
    .field-single-layout {
        grid-template-columns: 1fr;
    }

    .card-field.card-field-single {
        max-width: 720px;
        flex-basis: 720px;
    }

    .field-img-single {
        height: 220px;
        min-height: 220px;
    }
}

/* Improve tabs readability (small hierarchy boost) */
.nav-tabs .nav-link {
    color: #374151;
}

    .nav-tabs .nav-link.active {
        font-weight: 700;
    }

.forecast-icons {
    flex-wrap: nowrap; /* one row only */
    overflow-x: auto; /* horizontal scroll */
    overflow-y: hidden;
    white-space: nowrap; /* protects inline content */
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    scrollbar-gutter: stable both-edges;
    padding-bottom: .25rem; /* room for scrollbar */
    scroll-snap-type: x mandatory;
}

    .forecast-icons > * {
        flex: 0 0 auto; /* items do not shrink/wrap */
        scroll-snap-align: start;
    }

/* site.css or your area css */
.forecast-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.forecast-canvas-wrap {
    height: 280px; /* keep your current height */
    position: relative;
}

/* optional: nicer scrollbar spacing */
.forecast-scroll {
    padding-bottom: 6px;
}

/* Neutral page background */
.page-surface {
    background: #f6f7f9;
}

/* Modern card styling */
.card-modern {
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

    .card-modern .card-header {
        background: #fff;
        border-bottom: 1px solid rgba(0,0,0,.06);
        font-weight: 600;
    }

    .card-modern .card-footer {
        background: #fff;
        border-top: 1px solid rgba(0,0,0,.06);
    }

/* Smaller icon buttons */
.btn-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Compact key/value list */
.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
}

    .kv .k {
        color: #6c757d;
    }

    .kv .v {
        font-weight: 600;
    }

/*badges for risk levels*/
.badge-high {
    letter-spacing: .1em;
    position: relative;
    background-color: #ff0005;
}

    /* pulse ring */
    .badge-high::after {
        content: "";
        position: absolute;
        inset: -6px;
        border-radius: inherit;
        border: 8px solid #ff0005;
        opacity: .0;
        animation: badgeActionPulse 1.4s ease-out infinite;
    }

.badge-action {
    letter-spacing: .1em;
    position: relative;
    background-color: #a82ec7;
}

    /* pulse ring */
    .badge-action::after {
        content: "";
        position: absolute;
        inset: -6px;
        border-radius: inherit;
        border: 8px solid #a82ec7;
        opacity: .0;
        animation: badgeActionPulse 1.0s ease-out infinite;
    }

@keyframes badgeActionPulse {
    0% {
        transform: scale(.92);
        opacity: .75;
    }

    70% {
        transform: scale(1.18);
        opacity: 0;
    }

    100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .badge-action::after {
        animation: none;
    }
}

/* Tight numeric inputs: keep them readable but not full-width */
.input-w-4 {
    max-width: 4rem;
}

.input-w-6 {
    max-width: 6rem;
}

.input-w-8 {
    max-width: 8rem;
}

.input-w-10 {
    max-width: 10rem;
}

.input-w-12 {
    max-width: 12rem;
}

/*table head sticky to the top*/
.table-responsive-sticky {
    overflow-y: visible; /* critical */
    overflow: unset;
}

    .table-responsive-sticky thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--bs-body-bg);
    }

/*Images and thumbs*/
.thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: .5rem;
    overflow: hidden;
    background: #f3f5f7;
}

    .thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.thumb-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: .9rem;
}

.kv-table {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.kv-k {
    color: #6c757d;
}

.kv-v {
    font-weight: 600;
    white-space: nowrap;
}
