/* Rain type remains distinct from the radar's intensity colors. */
.ctp-speed-item { min-width: 0; }
.ctp-speed-row[data-motion-state]:not(.ctp-motion-single) { display: grid; grid-template-columns: max-content 1px minmax(0, 1fr); gap: 4px !important; padding: 6px !important; }
.ctp-speed-row[data-motion-state] > .ctp-speed-item:first-child { max-width: 54px; }
.ctp-val.ctp-direction-value { font-size: 11px !important; line-height: 1.5; white-space: nowrap; }
.ctp-motion-arrow { display: inline-block; color: #3978fb; margin-right: 2px; }
.ctp-bearing-angle { white-space: nowrap; font-size: .8em; font-weight: 600; }
.rain-cell-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.rain-cell-heading .analysis-card-title {
    color: var(--text-primary, #e2e8f0);
    min-width: 0;
    flex: 1;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.rain-cell-lifecycle { display: flex; flex-wrap: wrap; gap: 4px; max-width: 42%; }
.rain-cell-kind {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    margin: 9px 0;
    border: 1px solid rgba(59, 130, 246, .22);
    border-radius: 12px;
    color: #93c5fd;
    background: rgba(59, 130, 246, .10);
}
.rain-cell-kind--thunderstorm {
    color: #fcd34d;
    background: rgba(245, 158, 11, .10);
    border-color: rgba(245, 158, 11, .25);
}
.rain-cell-kind--sea_clutter, .rain-cell-kind--ground_clutter {
    color: #cbd5e1;
    background: rgba(148, 163, 184, .10);
    border-color: rgba(148, 163, 184, .20);
}
.rain-cell-kind-icon {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(59, 130, 246, .12);
    font-size: 17px;
}
.rain-cell-kind--thunderstorm .rain-cell-kind-icon { background: rgba(245, 158, 11, .14); }
.rain-cell-kind-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.4; text-wrap: balance; }
.analysis-card .rain-cell-kind { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 9px; row-gap: 4px; }
.analysis-card .rain-cell-kind-icon { grid-row: 1 / span 2; }
.analysis-card .rain-cell-intensity { grid-column: 2; justify-self: start; }
.rain-cell-intensity {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #cbd5e1;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(15, 23, 42, .25);
}
.rain-cell-intensity-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; }
.rain-cell-trend { margin: -2px 0 9px; font-size: 10px; color: #94a3b8; }
.ctp-root .ctp-title {
    flex: 1;
    min-width: 0;
    max-width: none;
    white-space: normal;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.ctp-root .ctp-header { margin-bottom: 4px; align-items: flex-start; }
.ctp-root .ctp-badges { flex-wrap: wrap; max-width: 36%; }
.ctp-root .ctp-badges:empty { display: none; }
.rain-cell-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 9px; }
.rain-cell-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 8px;
    background: rgba(59, 130, 246, .10);
    color: #93c5fd;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
}
.rain-cell-legend-item--thunderstorm { background: rgba(245, 158, 11, .10); color: #fcd34d; }
.rain-cell-legend-item strong, .rain-cell-intensity { font-variant-numeric: tabular-nums; }
[data-theme='light'] .rain-cell-heading .analysis-card-title { color: #0f172a; }
[data-theme='light'] .rain-cell-kind { color: #1d4ed8; background: #eff6ff; border-color: #dbeafe; }
[data-theme='light'] .rain-cell-kind--thunderstorm { color: #92400e; background: #fffbeb; border-color: #fde68a; }
[data-theme='light'] .rain-cell-kind--sea_clutter,
[data-theme='light'] .rain-cell-kind--ground_clutter { color: #475569; background: #f8fafc; border-color: #e2e8f0; }
[data-theme='light'] .rain-cell-intensity { color: #334155; background: rgba(255, 255, 255, .85); }
[data-theme='light'] .rain-cell-trend { color: #64748b; }
[data-theme='light'] .rain-cell-legend-item { background: #eff6ff; color: #1d4ed8; }
[data-theme='light'] .rain-cell-legend-item--thunderstorm { background: #fffbeb; color: #92400e; }
@media (max-width: 480px) {
    .cell-tooltip-popup .ctp-root { box-sizing: border-box; width: min(290px, calc(100vw - 64px)); min-width: 0; max-width: calc(100vw - 64px); padding: 12px; }
    .rain-cell-kind { padding: 8px; gap: 7px; }
    .analysis-card .rain-cell-kind { grid-template-columns: 28px minmax(0, 1fr); column-gap: 7px; row-gap: 3px; }
    .rain-cell-kind-icon { flex-basis: 28px; width: 28px; height: 28px; font-size: 16px; }
    .rain-cell-kind-label { font-size: 12px; }
    .rain-cell-intensity { font-size: 9px; padding: 4px 5px; }
}
@media (max-width: 768px) {
    /* Keep the analysis drawer the same width as the station drawer. */
    #sidebar[data-sidebar-view='tracker'] { min-width: 0; }
}
