/* ============================================================================
   61-task-work.css - the explicit "В работе" mark ("I am working on this now").

   One calm accent (--work-accent) and three surfaces: the pill in a card's head, the play / pause
   tool in the card foot, and the segmented status in the task window. Plus the friend row's
   indicator and the "Петя в работе" chip of a shared task.

   Owner rule 2026-11-08: NOTHING hangs past a card's border. Every piece here is in flow inside
   the card; the accent rim is an INSET outline, not a shadow or a sticker. Motion is opacity and
   transform only (compositor), and off under prefers-reduced-motion. Logical properties only, so
   the right-to-left layer needs no line for this file.
   ============================================================================ */

:root {
    --work-accent: #0F9D8A;
}

/* ---- the pill: "В работе · 25 мин" ---- */
.work-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.5;
    color: var(--work-accent);
    background: color-mix(in srgb, var(--work-accent) 12%, transparent);
    white-space: nowrap;
}
.work-pill-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.work-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--work-accent);
}
@media (prefers-reduced-motion: no-preference) {
    .work-pill .work-dot,
    .work-other .work-dot {
        animation: work-breathe 2.6s ease-in-out infinite;
    }
}
@keyframes work-breathe {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.8); }
}

/* The pill's own line above a card's title. */
.task-work-line { margin-bottom: 3px; min-width: 0; }

/* ---- a card the viewer is working on: an inset accent rim ----
   outline-offset is negative, so the rim is drawn INSIDE the card's border box and follows its
   radius. The task row's dashed foreign border and the Main card's violet halo keep their own. */
.task-row.is-working,
.main-task.is-working {
    outline: 1.5px solid color-mix(in srgb, var(--work-accent) 60%, transparent);
    outline-offset: -4px;
}

/* ---- another participant of a shared task is working on it ---- */
.work-other {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    min-width: 0;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: var(--text-xs);
    line-height: 1.5;
    font-weight: 600;
    color: var(--work-accent);
    background: color-mix(in srgb, var(--work-accent) 10%, transparent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- play / pause: same size and family as the quiet row tools beside it ---- */
.task-work-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--chronos-fg-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 120ms ease, color 120ms ease;
}
.task-work-btn .material-icons { font-size: 18px; }
.task-work-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--work-accent) 14%, transparent);
    color: var(--work-accent);
}
.task-work-btn.is-on {
    color: var(--work-accent);
    background: color-mix(in srgb, var(--work-accent) 14%, transparent);
}
.task-work-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.main-task-head > .task-work-btn { margin-block-start: 1px; }

/* ---- the task window: Не начата / В работе / Готово ----
   Three equal segments in one row and one meta line under it, reserved at a fixed height whether
   or not the pill is drawn, so the window never changes height when the state does. */
.tw-seg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--chronos-outline);
    border-radius: 10px;
    overflow: hidden;
    background: var(--chronos-chip-bg);
}
.tw-seg-btn {
    min-width: 0;
    padding: 6px 4px;
    border: 0;
    border-inline-start: 1px solid var(--chronos-outline);
    border-radius: 0;
    background: transparent;
    color: var(--chronos-fg-muted);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.tw-seg-btn:first-child { border-inline-start: 0; }
.tw-seg-btn:hover:not(:disabled):not(.is-on) {
    background: color-mix(in srgb, var(--hover-ink, currentColor) 6%, transparent);
}
.tw-seg-btn.is-on {
    color: var(--work-accent);
    background: color-mix(in srgb, var(--work-accent) 14%, var(--chronos-card-bg, transparent));
}
.tw-seg-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.tw-seg-btn.is-on:disabled { opacity: 1; }

/* v0.30.3.3: .tw-status-meta is gone. The progress and the work pill were a line of their own under
   the segments; they are the field's READING, so they moved onto the caption's line, where the rest
   of the row was empty anyway (TaskField's Meta slot, .tw-cap-row in 59-task-window.css). That row
   reserves the pill's height, so starting a task still moves nothing. */
.tw-cap-meta .muted { min-width: 0; }

/* ---- the friend's row ---- */
.fr-work {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    margin-inline-start: auto;
    overflow: hidden;
}
.fr-work-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-xs);
    color: var(--chronos-fg-muted);
}
@media (max-width: 480px) {
    .fr-work-title { display: none; }
}
