.tfac-app {
    --tfac-ink: #1c2c3a;
    --tfac-muted: #5e6b75;
    --tfac-line: #d7e0e6;
    --tfac-soft: #f4f7f9;
    --tfac-accent: #145f82;
    --tfac-accent-dark: #0f4761;
    --tfac-green: #277648;
    --tfac-green-soft: #e7f5ec;
    --tfac-orange: #9a5a11;
    --tfac-orange-soft: #fff1da;
    color: var(--tfac-ink);
    font-size: 16px;
    line-height: 1.7;
}

.tfac-app *,
.tfac-app *::before,
.tfac-app *::after {
    box-sizing: border-box;
}

.tfac-summary {
    margin: 0 0 12px;
}

.tfac-summary p {
    margin: 0;
}

.tfac-summary__next {
    display: none;
}

.tfac-summary__status {
    font-weight: 700;
}

.tfac-result-count {
    display: inline-block;
    min-width: 2ch;
    color: var(--tfac-accent-dark);
    font-size: 1.35em;
}

.tfac-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid var(--tfac-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(23, 50, 68, 0.05);
}

.tfac-filter {
    min-width: 0;
}

.tfac-filter--wide {
    grid-column: span 2;
}

.tfac-filter label {
    display: block;
    margin: 0 0 4px;
    color: var(--tfac-ink);
    font-size: 0.86rem;
    font-weight: 700;
}

.tfac-filter input,
.tfac-filter select,
.tfac-reset {
    width: 100%;
    min-height: 40px;
    margin: 0;
    border: 1px solid #b9c8d1;
    border-radius: 8px;
    background: #fff;
    color: var(--tfac-ink);
    font: inherit;
}

.tfac-filter input,
.tfac-filter select {
    padding: 7px 10px;
}

.tfac-filter input:focus,
.tfac-filter select:focus,
.tfac-reset:focus,
.tfac-card__toggle:focus {
    outline: 3px solid rgba(20, 95, 130, 0.18);
    outline-offset: 1px;
    border-color: var(--tfac-accent);
}

.tfac-filter--button {
    display: flex;
    align-items: end;
}

.tfac-reset {
    padding: 7px 10px;
    border-color: var(--tfac-accent);
    color: var(--tfac-accent-dark);
    font-weight: 700;
    cursor: pointer;
}

.tfac-reset:hover,
.tfac-card__toggle:hover,
.tfac-card__links a:hover {
    background: #edf6fa;
    text-decoration: none;
}

.tfac-data-note {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #000;
    font-size: 0.92rem;
    font-weight: 700;
}

.tfac-date-group {
    margin: 0 0 20px;
    scroll-margin-top: 80px;
}

.tfac-date-heading {
    margin: 0 0 8px;
    padding: 8px 11px;
    border-left: 5px solid var(--tfac-accent);
    border-radius: 0 8px 8px 0;
    background: var(--tfac-soft);
    color: var(--tfac-ink);
    font-size: clamp(1.05rem, 2.4vw, 1.25rem);
    line-height: 1.4;
}

.tfac-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.tfac-card {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--tfac-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(23, 50, 68, 0.04);
}

.tfac-card__main {
    display: grid;
    grid-template-columns: auto minmax(10em, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
}

.tfac-card__label {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.tfac-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.tfac-badge--type {
    background: #e8f1f6;
    color: var(--tfac-accent-dark);
}

.tfac-badge--all {
    background: var(--tfac-green-soft);
    color: var(--tfac-green);
}

.tfac-badge--conditional {
    background: var(--tfac-orange-soft);
    color: var(--tfac-orange);
}

.tfac-card__title {
    min-width: 0;
    margin: 0;
    color: var(--tfac-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.tfac-card__place-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.tfac-card__place {
    margin: 0;
    color: var(--tfac-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.tfac-card__toggle {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid var(--tfac-accent);
    border-radius: 7px;
    background: #fff;
    color: var(--tfac-accent-dark);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.tfac-card__toggle[aria-expanded="true"] {
    background: #edf6fa;
}

.tfac-card__body {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--tfac-line);
}

.tfac-card__details {
    margin: 0;
}

.tfac-card__details > div {
    display: grid;
    grid-template-columns: 8.3em minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #e8edf0;
}

.tfac-card__details dt,
.tfac-card__details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.tfac-card__details dt {
    color: var(--tfac-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.tfac-card__details dd {
    color: var(--tfac-ink);
    font-size: 0.9rem;
}

.tfac-card__notice {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff8e5;
    color: #57491f;
    font-size: 0.86rem;
}

.tfac-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 11px 0 0;
}

.tfac-card__links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid var(--tfac-accent);
    border-radius: 7px;
    color: var(--tfac-accent-dark);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.tfac-empty,
.tfac-noscript {
    padding: 14px;
    border: 1px solid var(--tfac-line);
    border-radius: 10px;
    background: var(--tfac-soft);
}

@media (max-width: 820px) {
    .tfac-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tfac-filter--wide {
        grid-column: span 2;
    }

    .tfac-card__main {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .tfac-card__place-action {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .tfac-app {
        font-size: 15px;
    }

    .tfac-filters {
        display: block;
        padding: 12px;
    }

    .tfac-filter {
        margin: 0 0 10px;
    }

    .tfac-filter:last-child {
        margin-bottom: 0;
    }

    .tfac-filter input,
    .tfac-filter select,
    .tfac-reset {
        min-height: 44px;
        font-size: 16px;
    }

    .tfac-card {
        padding: 9px 10px;
    }

    .tfac-card__label {
        margin-bottom: 1px;
    }

    .tfac-card__title {
        font-size: 1.02rem;
    }

    .tfac-card__place-action {
        gap: 7px;
    }

    .tfac-card__place {
        white-space: normal;
    }

    .tfac-card__details > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .tfac-card__details dt {
        color: var(--tfac-accent-dark);
    }

    .tfac-card__links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tfac-card__links a {
        width: 100%;
    }
}
