:root {
    --card: rgba(14, 15, 18, 0.88);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f5f5f6;
    --muted: #a1a1aa;
    --faint: #6b6b74;
    --chip: rgba(255, 255, 255, 0.06);
    --leo: #3b82f6;
    --ems: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    background: transparent;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--text);
    user-select: none;
}

#alerts {
    position: absolute;
    top: 8vh;
    right: 20px;
    width: 340px;
    display: flex;
    flex-direction: column;
}

.slot {
    display: grid;
    grid-template-rows: 1fr;
    margin-bottom: 8px;
    transition: grid-template-rows 0.35s ease, margin-bottom 0.35s ease;
}
.slot.collapsed {
    grid-template-rows: 0fr;
    margin-bottom: 0;
}
.slot > .alert {
    min-height: 0;
}

.alert {
    --accent: var(--leo);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    transform: translateX(calc(100% + 40px));
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.alert.ems {
    --accent: var(--ems);
}
.alert.shown {
    transform: none;
}
.alert.leaving {
    transform: translateX(calc(100% + 40px));
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.84, 0);
}

.alert.important {
    --accent: var(--ems);
    border-color: rgba(239, 68, 68, 0.6);
    animation: pulse 1s ease-in-out infinite alternate;
}
@keyframes pulse {
    from {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(239, 68, 68, 0);
    }
    to {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(239, 68, 68, 0.45);
    }
}

.body {
    display: flex;
    gap: 12px;
    padding: 12px 12px 11px;
}

.badge {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 3px;
    background: var(--tone-bg);
    color: var(--tone);
}
.badge svg {
    width: 20px;
    height: 20px;
}

.main {
    min-width: 0;
    flex: 1;
}
.head {
    display: flex;
    align-items: center;
    gap: 7px;
}
.code {
    flex-shrink: 0;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--chip);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted);
}
.title {
    min-width: 0;
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.time {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--faint);
}

.where {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}
.where svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}
.where .street {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.where .distance {
    flex-shrink: 0;
    margin-left: auto;
    font-weight: 700;
    color: var(--text);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--chip);
    font-size: 11px;
    font-weight: 600;
    color: #d4d4d8;
}
.chip svg {
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    opacity: 0.8;
}
.chip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chip.wide {
    white-space: normal;
}
.chip.wide span {
    white-space: normal;
}
/* Plate: small white licence plate */
.plate {
    padding: 0 5px;
    border: 1px solid #c7c7cc;
    border-radius: 2px;
    background: #f4f4f5;
    color: #1e3a8a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.swatch {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}
.foot .channel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--faint);
}
.foot .channel::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.respond {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.key {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom-width: 2px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text);
}
.alert.responding .respond {
    color: #4ade80;
}
.alert.responding .key {
    border-color: rgba(74, 222, 128, 0.5);
    color: #4ade80;
}

.timer {
    height: 3px;
    background: var(--accent);
    opacity: 0.85;
    transform-origin: left center;
}
