/* ═══════════════════════════════════════════════════════════════════════════
   My Tasks — personal assignee view (MyTasksPage).
   Prefix: mw-myt-*
   Design source: docs/mockups/my-tasks.html.
   The page root carries BOTH `mw-tk-page` and `mw-myt-page`: mw-tasks.css owns the
   shared dark "ops board" theme tokens (--mw-tk-*) and MudBlazor palette overrides;
   this file only adds the My-Tasks-specific layout on top of those tokens.
   Desktop: grouped task rail + sticky detail panel. Mobile (≤960px): rail only,
   with a full-screen slide-in single-task focus view.
   ═══════════════════════════════════════════════════════════════════════════ */

.mw-myt-page {
    overflow-y: auto;
    padding-bottom: 40px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.mw-myt-header {
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 24px 6px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.mw-myt-kicker {
    font-family: var(--mw-tk-font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mw-tk-accent);
    margin-bottom: 6px;
}

.mw-myt-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--mw-tk-text-primary);
}

.mw-myt-ring-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mw-myt-ring {
    position: relative;
    width: 64px;
    height: 64px;
}

.mw-myt-ring svg {
    transform: rotate(-90deg);
}

.mw-myt-ring-track {
    stroke: var(--mw-tk-bg-elevated);
}

.mw-myt-ring-fill {
    stroke: var(--mw-tk-success);
    stroke-linecap: round;
    transition: stroke-dashoffset 600ms ease;
    filter: drop-shadow(0 0 6px rgba(0, 230, 118, 0.4));
}

.mw-myt-ring-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mw-tk-font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--mw-tk-success);
}

.mw-myt-ring-label {
    font-size: 0.78rem;
    color: var(--mw-tk-text-muted);
    max-width: 110px;
    line-height: 1.4;
}

/* ─── Main grid ──────────────────────────────────────────────────────────── */

.mw-myt-main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 24px 40px;
    display: grid;
    grid-template-columns: minmax(340px, 430px) 1fr;
    gap: 22px;
    align-items: start;
}

/* ─── Task rail ──────────────────────────────────────────────────────────── */

.mw-myt-group-title {
    font-family: var(--mw-tk-font-mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mw-tk-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 10px;
}

.mw-myt-group:first-child .mw-myt-group-title {
    margin-top: 0;
}

.mw-myt-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--mw-tk-border-subtle);
}

.mw-myt-group-count {
    color: var(--mw-tk-text-secondary);
}

.mw-myt-card {
    position: relative;
    background: var(--mw-tk-bg-surface);
    border: 1px solid var(--mw-tk-border-subtle);
    border-radius: var(--mw-tk-radius-lg);
    padding: 13px 16px 13px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 180ms ease;
    overflow: hidden;
}

.mw-myt-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--mw-myt-prio, var(--mw-tk-low));
    opacity: 0.9;
}

.mw-myt-card:hover {
    background: var(--mw-tk-bg-elevated);
    border-color: var(--mw-tk-border);
    transform: translateX(2px);
}

.mw-myt-card-selected {
    border-color: var(--mw-tk-accent);
    background: var(--mw-tk-bg-elevated);
    box-shadow: 0 0 0 1px var(--mw-tk-accent), 0 4px 24px rgba(124, 77, 255, 0.15);
}

.mw-myt-card-done {
    opacity: 0.55;
}

.mw-myt-card-done .mw-myt-card-title {
    text-decoration: line-through;
    text-decoration-color: var(--mw-tk-text-muted);
}

.mw-myt-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--mw-tk-text-primary);
    margin-bottom: 6px;
    padding-right: 16px;
}

.mw-myt-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-family: var(--mw-tk-font-mono);
    font-size: 0.68rem;
    color: var(--mw-tk-text-muted);
}

.mw-myt-card-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mw-myt-card-live {
    position: absolute;
    top: 13px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mw-tk-accent);
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.3);
    animation: mw-myt-pulse 1.6s infinite;
}

@keyframes mw-myt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.mw-myt-overdue {
    color: var(--mw-tk-error);
    font-weight: 700;
}

.mw-myt-chip-sm {
    font-size: 0.58rem;
    padding: 2px 7px;
}

.mw-myt-scope-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--mw-tk-text-muted);
    padding: 10px 14px;
    border: 1px dashed var(--mw-tk-border);
    border-radius: var(--mw-tk-radius-md);
    margin-top: 16px;
    line-height: 1.5;
}

.mw-myt-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--mw-tk-text-muted);
    font-size: 0.85rem;
    border: 1px dashed var(--mw-tk-border);
    border-radius: var(--mw-tk-radius-lg);
}

/* ─── Detail panel (desktop) ─────────────────────────────────────────────── */

.mw-myt-detail {
    position: sticky;
    top: 12px;
    background: var(--mw-tk-bg-surface);
    border: 1px solid var(--mw-tk-border-subtle);
    border-radius: var(--mw-tk-radius-lg);
    overflow: hidden;
}

.mw-myt-detail-inner {
    padding: 20px 24px 24px;
}

.mw-myt-detail-head {
    position: relative;
    margin: -20px -24px 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--mw-tk-border-subtle);
    background: radial-gradient(600px 120px at 20% 0%, color-mix(in srgb, var(--mw-myt-prio, var(--mw-tk-low)) 8%, transparent), transparent);
}

.mw-myt-detail-head::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--mw-myt-prio, var(--mw-tk-low));
}

.mw-myt-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.mw-myt-detail-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--mw-tk-text-primary);
}

.mw-myt-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 12px;
    font-family: var(--mw-tk-font-mono);
    font-size: 0.72rem;
    color: var(--mw-tk-text-secondary);
}

.mw-myt-detail-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Priority accent variable per priority modifier (cards + detail head). */
.mw-myt-prio-none     { --mw-myt-prio: var(--mw-tk-low); }
.mw-myt-prio-low      { --mw-myt-prio: var(--mw-tk-low); }
.mw-myt-prio-medium   { --mw-myt-prio: var(--mw-tk-medium); }
.mw-myt-prio-high     { --mw-myt-prio: var(--mw-tk-high); }
.mw-myt-prio-critical { --mw-myt-prio: var(--mw-tk-critical); }

/* ─── Detail sections ────────────────────────────────────────────────────── */

.mw-myt-section-title {
    font-family: var(--mw-tk-font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mw-tk-text-muted);
    margin: 18px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mw-myt-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--mw-tk-border-subtle);
}

.mw-myt-briefing {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--mw-tk-text-secondary);
    white-space: pre-wrap;
}

.mw-myt-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: var(--mw-tk-radius-md);
    padding: 10px 14px;
    font-size: 0.78rem;
    color: var(--mw-tk-text-secondary);
    margin-bottom: 4px;
    line-height: 1.5;
}

.mw-myt-banner-blocked {
    background: var(--mw-tk-error-dim);
    border: 1px solid rgba(255, 82, 82, 0.35);
}

.mw-myt-banner-blocked strong {
    color: var(--mw-tk-error);
}

.mw-myt-banner-done {
    background: var(--mw-tk-success-dim);
    border: 1px solid rgba(0, 230, 118, 0.35);
}

.mw-myt-banner-done strong {
    color: var(--mw-tk-success);
}

.mw-myt-dep-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--mw-tk-bg-base);
    border: 1px solid var(--mw-tk-border-subtle);
    border-radius: var(--mw-tk-radius-md);
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.mw-myt-dep-name {
    flex: 1;
    color: var(--mw-tk-text-secondary);
}

/* ─── Comments ───────────────────────────────────────────────────────────── */

.mw-myt-comments {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}

.mw-myt-comment {
    display: flex;
    gap: 10px;
}

.mw-myt-comment-body {
    flex: 1;
    min-width: 0;
}

.mw-myt-comment-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}

.mw-myt-comment-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--mw-tk-text-primary);
}

.mw-myt-comment-time {
    font-family: var(--mw-tk-font-mono);
    font-size: 0.6rem;
    color: var(--mw-tk-text-muted);
}

.mw-myt-comment-text {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--mw-tk-text-secondary);
    background: var(--mw-tk-bg-base);
    border: 1px solid var(--mw-tk-border-subtle);
    border-radius: 4px 12px 12px 12px;
    padding: 8px 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mw-myt-comment-mine .mw-myt-comment-text {
    background: var(--mw-tk-accent-dim);
    border-color: rgba(124, 77, 255, 0.3);
    border-radius: 12px 4px 12px 12px;
}

/* ─── Action bar ─────────────────────────────────────────────────────────── */

.mw-myt-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--mw-tk-border-subtle);
}

.mw-myt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--mw-tk-font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--mw-tk-radius-md);
    padding: 12px 22px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 180ms ease;
    flex: 1;
}

.mw-myt-btn-primary {
    background: var(--mw-tk-accent);
    color: #fff;
}

.mw-myt-btn-primary:hover {
    box-shadow: 0 0 18px rgba(124, 77, 255, 0.3);
    transform: translateY(-1px);
}

.mw-myt-btn-ghost {
    background: none;
    border-color: var(--mw-tk-border);
    color: var(--mw-tk-text-secondary);
    flex: 0 1 auto;
}

.mw-myt-btn-ghost:hover {
    border-color: var(--mw-tk-error);
    color: var(--mw-tk-error);
    background: var(--mw-tk-error-dim);
}

.mw-myt-btn-danger {
    border-color: rgba(255, 82, 82, 0.4);
    color: var(--mw-tk-error);
}

.mw-myt-problem-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mw-myt-problem-form .mw-tk-comment-input {
    flex: 1;
}

/* ─── Hold-to-complete ───────────────────────────────────────────────────── */

.mw-myt-hold-btn {
    position: relative;
    overflow: hidden;
    background: var(--mw-tk-bg-elevated);
    border: 1px solid rgba(0, 230, 118, 0.4);
    color: var(--mw-tk-success);
    font-weight: 700;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.mw-myt-hold-fill {
    position: absolute;
    inset: 0;
    background: var(--mw-tk-success);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 120ms ease;
}

.mw-myt-holding .mw-myt-hold-fill {
    /* Duration mirrors HoldToCompleteDurationMilliseconds in MyTasksPage.razor.cs. */
    transition: transform 1.1s linear;
    transform: scaleX(1);
}

.mw-myt-hold-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 150ms;
}

.mw-myt-holding .mw-myt-hold-label {
    color: #0a2416;
}

/* ─── Mobile focus view ──────────────────────────────────────────────────── */

.mw-myt-focus {
    position: fixed;
    inset: 0;
    z-index: 1250;
    background: var(--mw-tk-bg-deep);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    visibility: hidden;
}

.mw-myt-focus-open {
    transform: translateX(0);
    visibility: visible;
}

.mw-myt-focus-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--mw-tk-border-subtle);
    background: var(--mw-tk-bg-base);
}

.mw-myt-focus-back,
.mw-myt-focus-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mw-tk-bg-surface);
    border: 1px solid var(--mw-tk-border);
    color: var(--mw-tk-text-secondary);
    border-radius: var(--mw-tk-radius-md);
    width: 38px;
    height: 38px;
    cursor: pointer;
    transition: all 180ms ease;
}

.mw-myt-focus-back {
    border-radius: 99px;
}

.mw-myt-focus-back:hover,
.mw-myt-focus-nav button:hover {
    color: var(--mw-tk-text-primary);
    border-color: var(--mw-tk-accent);
}

.mw-myt-focus-pager {
    flex: 1;
    text-align: center;
    font-family: var(--mw-tk-font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    color: var(--mw-tk-text-muted);
}

.mw-myt-focus-nav {
    display: flex;
    gap: 6px;
}

.mw-myt-focus-scroll {
    flex: 1;
    overflow-y: auto;
}

.mw-myt-focus-scroll .mw-myt-detail-inner {
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

.mw-myt-focus-scroll .mw-myt-detail-head {
    margin: -16px -20px 16px;
    padding: 18px 20px 14px;
}

.mw-myt-focus-scroll .mw-myt-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent, var(--mw-tk-bg-deep) 30%);
    padding-bottom: 4px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (min-width: 961px) {
    .mw-myt-focus {
        display: none;
    }
}

@media (max-width: 960px) {
    .mw-myt-main {
        grid-template-columns: 1fr;
        padding: 10px 14px 30px;
    }

    .mw-myt-detail {
        display: none;
    }

    .mw-myt-header {
        padding: 18px 16px 4px;
    }

    .mw-myt-title {
        font-size: 1.45rem;
    }

    .mw-myt-ring {
        width: 54px;
        height: 54px;
    }

    .mw-myt-ring svg {
        width: 54px;
        height: 54px;
    }

    .mw-myt-ring-label {
        display: none;
    }
}
