.ba {
    --now: #e8412a;
    --ba-gap: 16px; /* the same space between all cards */
    display: flex; flex-direction: column; gap: var(--ba-gap);
    color: var(--fg);
}

/* Ad slots: reserved space, collapsed when empty */
.ba-ad { display: flex; justify-content: center; }
.ba-ad-inner { width: 100%; max-width: 336px; min-height: 100px; display: flex; align-items: center; justify-content: center; }
.ba-ad-inner:empty { display: none; }
.ba-ad-inline .ba-ad-inner { min-height: 250px; }
.ba-ad-top .ba-ad-inner { min-height: 50px; max-width: 320px; }

.ba-map-wrap { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.ba-map { height: 30vh; min-height: 0; background: #cfd8e3; }
.ba-radar-note {
    position: absolute; right: 8px; bottom: 8px; z-index: 500; max-width: calc(100% - 16px); width: fit-content; text-align: right;
    padding: 6px 10px; border-radius: 8px; font-size: .8rem;
    background: rgba(20, 32, 46, .85); color: #fff; pointer-events: none;
}

.ba-panel { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.ba-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ba-place { margin: 0; font-size: .8rem; color: var(--muted); }
.ba-summary { margin: 2px 0 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; }

.ba-btn {
    font: inherit; font-size: .85rem; min-height: 44px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer;
}
.ba-btn-play { background: var(--accent); border-color: var(--accent); color: #fff; }

.ba-readout { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 2px; }
.ba-time { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ba-mm { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.ba-label { color: var(--muted); font-size: .9rem; }

.ba-chart { position: relative; height: 150px; touch-action: none; user-select: none; cursor: ew-resize; outline-offset: 2px; }
.ba-chart svg { display: block; width: 100%; height: 100%; }
.ba-chart text { fill: var(--muted); font-size: 10px; }
.ba-grid { stroke: var(--line); stroke-width: 1; }
.ba-cursor { stroke: var(--now); stroke-width: 2; }
.ba-handle { fill: var(--now); stroke: #fff; stroke-width: 2; }
.ba-nowtick { stroke: var(--muted); stroke-dasharray: 3 3; }

.ba-controls { display: flex; gap: 8px; margin-top: 10px; }
.ba-search { flex: 1; }
.ba-search input {
    width: 100%; min-height: 44px; padding: 0 12px; font: inherit; font-size: 16px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg);
}
.ba-credit { margin: 0; padding: 0 12px 8px; font-size: .7rem; color: var(--muted); text-align: center; }

/* desktop: map on top, chart panel underneath, everything inside the 1088 px column */
@media (min-width: 768px) {
    .ba-panel { padding: 16px 20px; }
    .ba-chart { height: 200px; }
}

.ba-city { margin: -8px 0 0 6px; font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none; }

.ba-updated { margin: 8px 0 0; font-size: .75rem; color: var(--muted); }
.ba-consent { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-size: .85rem; }
.ba-consent p { margin: 0; flex: 1 1 200px; }
.ba-consent[hidden], .ba-btn[hidden] { display: none; }
.ba-controls { flex-wrap: wrap; }
.ba-search { flex: 1 1 140px; }
.ba-stale { margin: 0 0 8px; padding: 9px 12px; border-radius: 10px; background: rgba(240, 138, 36, .18); border: 1px solid rgba(240, 138, 36, .45); font-size: .85rem; line-height: 1.4; }
.ba-stale[hidden] { display: none; }
.ba-wx { margin: 0 0 4px; font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.ba-chart text.ba-temp { fill: #f08a24; font-weight: 600; }
.ba-dry { display: flex; align-items: center; gap: 6px; flex-basis: 100%; font-size: .8rem; color: var(--muted); }
.ba-dry[hidden] { display: none; }

.ba-accuracy { padding: 14px; border-radius: 14px; background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.12); scroll-margin-top: calc(var(--header-height, 56px) + 8px); }
.ba-accuracy h2 { margin: 0 0 4px; font-size: 1.1rem; }
.ba-accuracy p { margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.ba-acc-table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.ba-acc-table th, .ba-acc-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.ba-acc-table th:first-child, .ba-acc-table td:first-child { text-align: left; }
.ba-acc-table th { color: var(--muted); font-weight: 600; }
.ba-acc-scroll { overflow-x: auto; }
@media (min-width: 768px) { .ba-accuracy { padding: 18px 20px; } }

/* ---------- notification promo card ---------- */
.ba-notify-card {
    display: flex; gap: 14px; align-items: flex-start; padding: 18px;
    border-radius: 14px; color: #fff;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    box-shadow: 0 2px 8px rgba(26, 115, 232, .35);
}
.ba-notify-card[hidden] { display: none; }
.ba-notify-card__icon {
    flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
    background: rgba(255, 255, 255, .18); color: #fff;
}
.ba-notify-card__title { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.2; }
.ba-notify-card__text, .ba-notify-card__hint { margin: 0 0 12px; font-size: .9rem; line-height: 1.45; color: rgba(255, 255, 255, .92); }
.ba-plus-promo { margin: 16px 0; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, #1a73e8, #0d47a1); color: #fff; }
.ba-plus-promo__label { margin: 0 0 6px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.ba-plus-promo__title { margin: 0 0 8px; font-size: 1.2rem; line-height: 1.25; color: #fff; }
.ba-plus-promo__text { margin: 0 0 10px; font-size: .92rem; line-height: 1.45; color: rgba(255, 255, 255, .92); }
.ba-plus-promo__price { margin: 0 0 14px; font-weight: 700; }
.ba-plus-promo__button { display: inline-block; padding: 11px 20px; border-radius: 10px; background: #fff; color: #0d47a1; font-weight: 700; text-decoration: none; }
.ba-plus-promo__button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ba-notify-card__hint { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .15); margin-bottom: 0; }
.ba-notify-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ba-notify-card__actions[hidden] { display: none; }
.ba-notify-card__button {
    min-height: 44px; padding: 0 20px; border: 0; border-radius: 10px; cursor: pointer;
    background: #fff; color: #1557b0; font: inherit; font-weight: 700;
}
.ba-notify-card__button.is-on { background: rgba(255, 255, 255, .22); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.ba-notify-card .ba-dry { color: rgba(255, 255, 255, .92); flex-basis: auto; }
@media (min-width: 768px) {
    .ba-notify-card { padding: 22px 24px; gap: 18px; align-items: center; }
    .ba-notify-card__icon { width: 64px; height: 64px; }
    .ba-notify-card__body { flex: 1; }
    .ba-notify-card__text { max-width: 62ch; }
}

/* ---------- toolbar (search, share, my location) + icon buttons ---------- */
.ba-ico { width: 16px; height: 16px; flex: none; }
.ba-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ba-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); color: var(--fg); cursor: pointer;
}
.ba-icon-btn[hidden] { display: none; }
.ba-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; }
.ba-head__text { order: 2; flex: 1 1 220px; min-width: 0; }
.ba-toolbar { order: 1; display: flex; align-items: center; gap: 8px; width: 100%; }
.ba-search { position: relative; flex: 1 1 auto; min-width: 0; }
.ba-search .ba-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ba-search input { padding-left: 38px; }
.ba-btn-locate { flex: none; padding: 0 14px; }
.ba-btn-locate .ba-btn__label { display: none; }
.ba-readout .ba-btn-play { margin-left: auto; min-height: 40px; padding: 0 14px; }
.ba-readout .ba-btn-play .ba-btn__label { display: none; } /* icon only on mobile */
.ba-notify-card__button { display: inline-flex; align-items: center; gap: 8px; }
@media (min-width: 768px) {
    .ba-head { flex-wrap: nowrap; }
    .ba-head__text { order: 1; }
    .ba-toolbar { order: 2; width: auto; flex: none; }
    .ba-search { flex: none; width: 240px; }
    .ba-btn-locate .ba-btn__label, .ba-readout .ba-btn-play .ba-btn__label { display: inline; }
}
.ba-measured { margin: 0 0 6px; font-size: .8rem; color: var(--muted); min-height: 1.1em; }
.ba-accuracy .ba-acc-note { margin: 0; padding-top: 14px; }

/* readout: everything on one line; on mobile the label shortens (no data source) and truncates if needed */
.ba-readout { flex-wrap: nowrap; row-gap: 0; }
.ba-readout .ba-label { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.ba-readout .ba-label__src { display: none; }
@media (min-width: 768px) {
    .ba-readout .ba-label { flex: 0 1 auto; font-size: .9rem; }
    .ba-readout .ba-label__src { display: inline; }
}

/* ---------- dashboard in the accuracy section ---------- */
.ba-dash { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0 16px; }
.ba-tile { padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.ba-tile__value { font-size: 1.55rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent); }
.ba-tile__label { margin-top: 4px; font-size: .85rem; font-weight: 600; }
.ba-tile__sub { margin-top: 2px; font-size: .72rem; color: var(--muted); }
.ba-sub { margin: 18px 0 8px; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ba-learn { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ba-learn li { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2fr 52px; gap: 10px; align-items: center; font-size: .85rem; }
.ba-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ba-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #1a73e8, #6aa8ff); border-radius: 99px; }
.ba-bar__n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .ba-dash { grid-template-columns: repeat(3, 1fr); } }

/* ---------- "?" help buttons + tooltip ---------- */
.ba-accuracy { position: relative; }
.ba-help {
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
    width: 18px; height: 18px; margin: -2px 0 0 6px; padding: 0; border: 1px solid var(--muted); border-radius: 50%;
    background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
}
.ba-help:hover, .ba-help:focus-visible, .ba-help[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.ba-sub .ba-help { text-transform: none; letter-spacing: 0; }
.ba-pop {
    position: absolute; z-index: 20; padding: 10px 12px; border-radius: 10px;
    background: #14202e; color: #fff; font-size: .8rem; font-weight: 400; line-height: 1.45; text-align: left;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.ba-pop[hidden] { display: none; }

/* mobile: the "Metingen" column would run off the card; it stays visible on larger screens */
@media (max-width: 599px) { .ba-acc-table th:nth-child(5), .ba-acc-table td:nth-child(5) { display: none; } }

/* tiles: the help button sits in the top-right corner */
.ba-tile { position: relative; }
.ba-tile .ba-help { position: absolute; top: 10px; right: 10px; margin: 0; }

/* weather scene behind the header, fading out towards the bottom */
.ba-scene {
    position: absolute; top: var(--header-height, 56px); left: 0; width: 100%; height: 20vh; z-index: -1; pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 30%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 30%, transparent 100%);
}

.ba-scene-label { position: fixed; left: 10px; bottom: 10px; z-index: 3000; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font: 12px/1.2 monospace; pointer-events: none; }

.ba-spark { color: var(--accent); }
.ba-spark__plot { position: relative; margin-left: 34px; }
.ba-spark__y span { position: absolute; left: -34px; width: 28px; transform: translateY(-50%); text-align: right; font-size: .68rem; color: var(--muted); }
.ba-spark svg { display: block; width: 100%; height: 56px; }
.ba-spark__axis { margin-left: 34px; }
.ba-spark__legend { margin: 6px 0 0; font-size: .75rem; color: var(--muted); }
.ba-spark__axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }

.ba-weights { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .82rem; }
.ba-w { display: grid; gap: 2px; }
.ba-w__v { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .ba-w { grid-template-columns: 1.3fr 3fr; gap: 12px; } }

/* mobile: extra room above the map so more of the weather scene shows */
@media (max-width: 767px) { .ba-map-wrap { margin-top: 30px; } }

.ba-pos { color: #1a9d57; font-weight: 700; }
.ba-neg { color: #d33a2c; font-weight: 700; }
.ba-btn-locate.is-hint { border-color: var(--accent); color: var(--accent); }
.ba-btn-locate.is-hint .ba-btn__label { display: inline; }

/* place page of the radar */
.city-head { padding-bottom: 0; }
.city-head .page__title { margin: 4px 0 12px; }
.ba > .city-card { margin: 12px 0; }
.city-card { display: grid; gap: 6px; padding: 16px 18px; border-radius: 14px; background: var(--card, rgba(128, 128, 128, .08)); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); color: inherit; text-decoration: none; border: 1px solid transparent; }
.city-card:hover { border-color: var(--accent, #1a73e8); }
.city-card:focus-visible { outline: 3px solid #8ab4f8; outline-offset: 2px; }
.city-card__label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.city-card__title { font-size: 1.15rem; }
.city-card__text { opacity: .85; font-size: .92rem; line-height: 1.45; }
.city-card__go { margin-top: 4px; color: var(--accent, #1a73e8); font-weight: 600; }

/* a place page is about that place: no search and no "my location" */
.ba--place .ba-search, .ba--place .ba-btn-locate { display: none; }
.ba--place .ba-toolbar { display: none; }
.ba--place .ba-readout .ba-icon-btn { flex: none; width: 40px; height: 40px; min-height: 40px; }
