.pme-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 1.5em 0;
    padding: 0;
}

.pme-category-filter .pme-category-filter-label {
    align-self: center;
    margin-right: 4px;
    font-weight: 600;
    color: #555;
}

.pme-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 0.9em;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.pme-category-pill-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex: 0 0 auto;
}

.pme-category-pill.is-active .pme-category-pill-swatch {
    border-color: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.pme-category-pill:hover {
    border-color: #888;
    background: #f3f3f3;
}

.pme-category-pill:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.pme-category-pill.is-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.pme-category-pill.is-active:hover {
    background: #135e96;
    border-color: #135e96;
}

/* ---------------------------------------------------------------------------
   Phase 50 — day + time-window filter rows.

   These rows share the brand look of `.pme-category-pill` (rectangular,
   mono uppercase label, schwarzer Border, magenta pressed-on state).
   Defined here once, the calendar's own scoped override drops the
   border-radius to 0 for sharp-corner consistency inside the grid.
   Variables (--pme-ink, --pme-magenta, --pme-card, --pme-radius,
   --pme-line, --pme-ink-soft) come from whichever view stylesheet
   shipped the :root block (event-list.css, event-calendar.css,
   event-combined.css) — all three declare them.
   ------------------------------------------------------------------------ */

.pme-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0 2.25rem 0;
}

.pme-filter-bar .pme-category-filter {
    margin: 0; /* the bar manages outer rhythm */
}

.pme-day-filter,
.pme-window-filter,
.pme-range-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
}

.pme-day-filter .pme-filter-label,
.pme-window-filter .pme-filter-label,
.pme-range-filter .pme-filter-label {
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--pme-ink-soft, rgba(26, 15, 31, 0.62));
    margin-right: 0.5rem;
    padding-right: 0.75rem;
    border-right: 1px solid var(--pme-line, rgba(26, 15, 31, 0.18));
    align-self: center;
}

.pme-filter-pill {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    color: var(--pme-ink, #1A0F1F);
    border: 1.5px solid var(--pme-ink, #1A0F1F);
    border-radius: var(--pme-radius, 0);
    padding: 0.42rem 0.95rem;
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 140ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
    box-shadow: 0 0 0 0 var(--pme-ink, #1A0F1F);
}

.pme-filter-pill:hover {
    background: var(--pme-ink, #1A0F1F);
    color: var(--pme-card, #FFFEFA);
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 0 var(--pme-ink, #1A0F1F);
}

.pme-filter-pill:focus-visible {
    outline: 2px solid var(--pme-magenta, #FF2D7E);
    outline-offset: 2px;
}

.pme-filter-pill.is-active {
    background: var(--pme-magenta, #FF2D7E);
    color: #fff;
    border-color: var(--pme-ink, #1A0F1F);
    box-shadow: 2px 2px 0 0 var(--pme-ink, #1A0F1F);
    transform: translate(-1px, -1px);
}

/* Sharp-corner variant for the calendar: the rest of the calendar uses
   border-radius: 0 throughout, so override the brand radius locally. */
.pme-calendar .pme-filter-pill {
    border-radius: 0;
}

/* Custom date range inputs — Phase 51. Native <input type="date"> styled
   to match the pill vocabulary so the row reads as a coherent unit. */
.pme-range-input {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    color: var(--pme-ink, #1A0F1F);
    border: 1.5px solid var(--pme-ink, #1A0F1F);
    border-radius: var(--pme-radius, 0);
    padding: 0.32rem 0.7rem;
    font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0 0 0 var(--pme-ink, #1A0F1F);
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.pme-range-input:hover {
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 0 var(--pme-ink, #1A0F1F);
}

.pme-range-input:focus-visible {
    outline: 2px solid var(--pme-magenta, #FF2D7E);
    outline-offset: 2px;
}

.pme-range-separator {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    color: var(--pme-ink-soft, rgba(26, 15, 31, 0.62));
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pme-calendar .pme-range-input {
    border-radius: 0;
}

@media (max-width: 639px) {
    .pme-day-filter .pme-filter-label,
    .pme-window-filter .pme-filter-label,
    .pme-range-filter .pme-filter-label {
        flex-basis: 100%;
        border-right: 0;
        padding-right: 0;
        margin-right: 0;
        margin-bottom: 0.15rem;
    }

    .pme-range-input {
        flex: 1 1 8rem;
        min-width: 0;
    }
}
