/* Time tracker (/time-tracker): timesheet rows, the running bar, project colours and the period nav.
   Stage, panels, fields, buttons, the table and the colours come from the app kit (css/app-kit, docs/app-kit.md);
   the accent is the time category's violet. Loaded only on this app's page (StylePaths). */
.tt-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.6rem;
}

.tt-period {
    margin: 0;
    flex: 1 1 auto;
    font-weight: 600;
    min-width: 8rem;
}

.tt-run {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 0.9rem;
    border-color: color-mix(in srgb, var(--tt-run, var(--ak-accent)) 45%, var(--ak-border));
    background: color-mix(in srgb, var(--tt-run, var(--ak-accent)) 12%, var(--ak-panel));
}

.tt-run .ak-swatch {
    --ak-swatch: var(--tt-run, var(--ak-accent));
}

.tt-run-name {
    font-weight: 600;
}

.tt-run-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    margin-inline-end: auto;
}

.tt-table .ak-swatch {
    margin-inline-end: 0.4rem;
    vertical-align: middle;
}

.tt-table td,
.tt-table th {
    white-space: nowrap;
}

.tt-table .tt-note {
    white-space: normal;
    min-width: 6rem;
}

.tt-table tr[data-color] td:first-child,
.tt-table tr[data-color] .ak-swatch {
    --ak-swatch: attr(data-color); /* fallback below */
}

.tt-table tr.is-running {
    background: color-mix(in srgb, var(--ak-accent) 8%, transparent);
}

.tt-acts {
    width: 1%;
    text-align: end;
}

.tt-project-list {
    list-style: none;
    margin: 0.4rem 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.3rem;
}

.tt-project {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
}

.tt-project-name {
    flex: 1 1 auto;
}

.tt-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tt-swatch {
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--ak-swatch);
    cursor: pointer;
}

.tt-swatch[aria-pressed="true"] {
    border-color: var(--ak-text);
    box-shadow: 0 0 0 2px var(--ak-bg), 0 0 0 4px var(--ak-swatch);
}

.tt-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .tt-two {
        grid-template-columns: 1fr;
    }

    .tt-period {
        flex-basis: 100%;
        order: -1;
    }
}
