/* Draw numbers — the finder box and its result cards (slots.js).
   Shared by the home page and timetable.html; everything else on those pages
   stays in their own stylesheet. --slot-color is the category colour set in
   Settings, passed through safeColor(); the fallback is the brand accent. */

.finder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.finder-head h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.finder-head h3 i {
    color: var(--accent-color);
}

.finder-head p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.finder-input {
    position: relative;
}

.finder-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
    pointer-events: none;
}

.finder-input input {
    width: 100%;
    font: inherit;
    font-size: 1.1rem;
    padding: 0.85rem 1rem 0.85rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.finder-input input::placeholder {
    color: var(--text-muted);
}

.finder-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(77 139 208 / 0.25);
}

.finder-status {
    min-height: 1.25rem;
    margin: 0.6rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.finder-status.is-muted {
    color: var(--text-muted);
}

.finder-status.is-error {
    color: var(--error-color);
    font-weight: 600;
}

.finder-results {
    display: grid;
    gap: 0.75rem;
}

.finder-results:not(:empty) {
    margin-top: 0.75rem;
}

/* --- one result --------------------------------------------------------- */
.slot-card {
    --slot-color: var(--accent-color);
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--slot-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    overflow: hidden;
    animation: slotIn 0.2s ease-out;
}

.slot-card-number {
    flex-shrink: 0;
    width: 7.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 1rem 0.5rem;
    background: var(--bg-secondary);
    text-align: center;
}

.slot-card-caption {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.slot-card-number strong {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.slot-card.is-pending .slot-card-number strong {
    color: var(--text-muted);
}

.slot-card-body {
    flex: 1;
    min-width: 0;
    padding: 0.9rem 1.1rem;
}

.slot-card-who strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.slot-card-who span {
    color: var(--text-secondary);
}

.slot-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.9rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.slot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--slot-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
}

.slot-chip i {
    color: var(--slot-color);
}

.slot-card-times {
    list-style: none;
    margin-top: 0.75rem;
    display: grid;
    gap: 0.35rem;
}

.slot-card-times li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.slot-phase {
    font-weight: 600;
    color: var(--text-primary);
}

.slot-phase abbr {
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 0.3rem;
    margin-left: 0.25rem;
    vertical-align: 0.1em;
}

.slot-when {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.slot-time {
    color: var(--text-primary);
    margin-left: 0.35rem;
}

.slot-card-note {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.slot-card-note i {
    color: var(--accent-color);
}

.slot-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.6rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.slot-card-link:hover {
    text-decoration: underline;
}

@keyframes slotIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .slot-card {
        animation: none;
    }
}

@media (max-width: 480px) {
    .finder-card {
        padding: 1.1rem;
    }

    .slot-card {
        flex-direction: column;
        border-left-width: 1px;
        border-top: 6px solid var(--slot-color);
    }

    .slot-card-number {
        width: auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.6rem;
        padding: 0.6rem 1rem;
    }

    .slot-card-number strong {
        font-size: 1.5rem;
    }
}
