/* Live time-tracker widget (global pill + idle launcher).
   Kept as a global stylesheet because this app does not bundle component-scoped
   (.razor.css) styles — it references global css files (app.css, crm.css, …). */

.tt-pill {
    width: 320px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tt-pill--topbar {
    margin-top: 8px;
    border: 1px solid var(--mud-palette-lines-default);
}

.tt-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tt-elapsed {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}

.tt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef5350;
    box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.6);
    animation: tt-pulse 1.6s infinite;
    flex: 0 0 auto;
}

.tt-project {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.tt-topbar {
    display: inline-flex;
    align-items: center;
}

.tt-topbar__launch.mud-button-root {
    height: 40px;
    min-width: auto;
    padding-inline: 14px;
    border: 1px solid var(--bar-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--mud-palette-surface) 70%, transparent);
    color: var(--mud-palette-appbar-text);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.tt-topbar__launch.mud-button-root:hover {
    border-color: var(--mud-palette-primary);
    background: color-mix(in srgb, var(--mud-palette-surface) 70%, transparent);
}

.tt-topbar__active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-error) 38%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--mud-palette-error) 8%, transparent);
    color: var(--mud-palette-appbar-text);
    font: inherit;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.tt-topbar__divider {
    width: 1px;
    height: 24px;
    flex: 0 0 auto;
    background: color-mix(in srgb, var(--mud-palette-appbar-text) 20%, transparent);
}

.tt-topbar__context {
    display: flex;
    min-width: 0;
    max-width: 180px;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}

.tt-topbar__context strong,
.tt-topbar__context small {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-topbar__context strong {
    font-size: 0.75rem;
    font-weight: 750;
}

.tt-topbar__context small {
    margin-top: 2px;
    color: color-mix(in srgb, var(--mud-palette-appbar-text) 72%, transparent);
    font-size: 0.625rem;
}

.tt-topbar__active:hover {
    border-color: color-mix(in srgb, var(--mud-palette-error) 62%, transparent);
    background: color-mix(in srgb, var(--mud-palette-error) 14%, transparent);
}

.tt-topbar__active:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.tt-topbar__elapsed {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tt-topbar .tt-dot {
    width: 8px;
    height: 8px;
}

@media (max-width: 1200px) {
    .tt-topbar__context {
        max-width: 120px;
    }
}

@media (max-width: 900px) {
    .tt-topbar__divider,
    .tt-topbar__context {
        display: none;
    }
}

@media (max-width: 780px) {
    .tt-topbar__active {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .tt-topbar__active > .mud-icon-root,
    .tt-topbar__elapsed {
        display: none;
    }
}

@keyframes tt-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(239, 83, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 83, 80, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .tt-dot { animation: none; }
}
