/* © Mahdi Amouzegar — All rights reserved | مهدی آموزگار — همه حقوق محفوظ است */
/* components.css — Header, Buttons, Inputs, Tasks, Plan, List Zone */

@layer components, overrides;

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: components
   ═══════════════════════════════════════════════════════════════════════════ */
@layer components {
    /* ═══ Task Zone ═══ */
    .task-zone {
        width: 100%;
        min-width: 0;
    }

    .task-zone-title {
        margin: 0;
        color: var(--text-title);
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.6;
    }

    /* ═══ Header ═══ */
    .header {
        position: relative;
        text-align: center;
        margin-bottom: 32px;
        perspective: 800px;
    }

    .header h1 {
        font-size: 2.4rem;
        font-weight: 800;
        background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), #ff2d95);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        transform: rotateX(5deg);
        transform-style: preserve-3d;
    }

    .header p {
        margin-top: 8px;
        font-size: 0.95rem;
        color: var(--text-muted);
        font-weight: 300;
    }

    .site-logo {
        width: 72px;
        height: 72px;
        border-radius: var(--radius-xl);
        display: block;
        margin: 0 auto 12px;
        box-shadow:
            0 8px 25px rgba(0, 0, 0, 0.5),
            0 0 25px rgba(0, 212, 255, 0.25);
    }

    .today-line {
        margin-top: 6px;
        font-size: 0.8rem;
        color: var(--text-muted);
        font-weight: 300;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .time-source-icon {
        display: inline-block;
        font-size: 0.85rem;
        line-height: 1;
        opacity: 0.7;
        cursor: help;
        transition: color var(--transition-base), opacity var(--transition-base);
        vertical-align: middle;
    }

    .time-source-icon.online {
        color: var(--accent-green);
        opacity: 1;
    }

    .time-source-icon.offline {
        color: var(--accent-yellow);
        opacity: 1;
    }

    .header-actions {
        display: flex;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 12px;
    }

    .settings-trigger {
        position: absolute;
        inset-block-start: -16px;
        inset-inline-end: -16px;
        z-index: 2;
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border-medium);
        border-radius: 50%;
        background: var(--bg-3);
        color: var(--text-secondary);
        font-size: 2.5rem;
        line-height: 0;
        cursor: pointer;
        box-shadow: var(--shadow-sm);
        transition: color .18s ease, border-color .18s ease, transform .18s ease, background .18s ease;
    }

    .settings-trigger:hover {
        color: var(--accent-cyan);
        border-color: var(--accent-cyan-border);
        background: var(--bg-4);
        transform: rotate(18deg);
    }

    .settings-trigger:focus-visible,
    .settings-close:focus-visible {
        outline: 3px solid var(--accent-cyan);
        outline-offset: 3px;
    }

    .settings-close {
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border-medium);
        border-radius: 50%;
        background: var(--bg-2);
        color: var(--text-secondary);
        font: inherit;
        font-size: 1.35rem;
        line-height: 1;
        cursor: pointer;
    }

    .tagline-toggle {
        margin-top: 8px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--text-muted);
        font: inherit;
        font-size: 0.95rem;
        font-weight: 300;
        cursor: pointer;
    }

    .tagline-toggle:hover,
    .tagline-toggle:focus-visible {
        color: var(--accent-cyan);
        outline: none;
    }

    #installBtn {
        display: block;
    }

    /* ═══ Mobile Tabs ═══ */
    .mobile-tabs {
        display: none;
        gap: 8px;
        margin-bottom: 16px;
        background: var(--bg-2);
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 4px;
    }

    .mobile-tab {
        flex: 1;
        padding: 10px;
        border: none;
        border-radius: var(--radius-sm);
        background: transparent;
        color: var(--text-muted);
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
        transition: all var(--transition-base);
    }

    .mobile-tab.active {
        background: linear-gradient(145deg, var(--accent-purple), #5a1fbd);
        color: var(--text-white);
        box-shadow: 0 4px 15px var(--accent-purple-soft);
    }

    /* ═══ Buttons ═══ */
    .btn-add {
        padding: 16px 28px;
        border: none;
        border-radius: var(--radius-lg);
        background: linear-gradient(145deg, var(--accent-purple), #5a1fbd);
        color: var(--text-white);
        font-family: inherit;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        transition: all var(--transition-slow);
        box-shadow:
            0 6px 20px rgba(123, 47, 247, 0.4),
            0 2px 4px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.15),
            inset 0 -2px 0 rgba(0, 0, 0, 0.2);
        position: relative;
        overflow: hidden;
        white-space: nowrap;
    }

    .btn-add::before {
        content: '';
        position: absolute;
        top: 0;
        inset-inline-end: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(-90deg, transparent, rgba(255,255,255,0.15), transparent);
        transition: inset-inline-end 0.5s;
    }

    .btn-add:hover::before {
        inset-inline-end: 100%;
    }

    .btn-add:hover {
        box-shadow:
            0 10px 30px rgba(123, 47, 247, 0.5),
            0 4px 8px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    }

    .btn-add:active {
        box-shadow:
            0 2px 8px rgba(123, 47, 247, 0.3),
            inset 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-md);
        border: 1.5px solid var(--border-purple);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        transition: all var(--transition-base);
        flex-shrink: 0;
        box-shadow: var(--shadow-sm);
        font-family: inherit;
        background: var(--bg-2);
    }

    .btn-edit {
        background: linear-gradient(145deg, var(--bg-18), var(--bg-19));
        color: var(--accent-cyan);
    }

    .btn-edit:hover {
        border-color: var(--accent-cyan-border);
        box-shadow: 0 4px 15px rgba(8, 145, 178, 0.15);
    }

    .btn-delete {
        background: linear-gradient(145deg, var(--bg-16), var(--bg-17));
        color: var(--accent-pink);
    }

    .btn-delete:hover {
        border-color: var(--accent-pink-border);
        box-shadow: 0 4px 15px rgba(219, 39, 119, 0.15);
    }

    .btn-archive {
        background: linear-gradient(145deg, var(--bg-20), var(--bg-21));
        color: var(--accent-yellow);
    }

    .btn-archive:hover {
        border-color: var(--accent-yellow-border);
        box-shadow: 0 4px 15px rgba(217, 119, 6, 0.15);
    }

    .btn-detail {
        background: linear-gradient(145deg, var(--bg-18), var(--bg-19));
        color: var(--text-secondary);
    }

    .btn-detail:hover {
        border-color: var(--accent-purple-border);
        box-shadow: 0 4px 15px var(--accent-purple-soft);
    }

    .btn-clear {
        display: block;
        margin: 30px auto 0;
        padding: 10px 24px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--transition-base);
        box-shadow: var(--shadow-sm);
    }

    .btn-clear:hover {
        border-color: var(--accent-pink-border);
        color: var(--accent-pink);
        box-shadow: 0 3px 15px var(--accent-pink-soft);
    }

    .btn-ok {
        background: linear-gradient(145deg, var(--bg-27), var(--bg-28));
        color: var(--accent-green);
        width: 40px;
        height: 40px;
    }

    .btn-ok:hover {
        border-color: var(--accent-green-border);
        box-shadow: 0 4px 15px var(--accent-green-soft);
    }

    .btn-cancel {
        background: linear-gradient(145deg, var(--bg-16), var(--bg-17));
        color: var(--accent-pink);
        width: 40px;
        height: 40px;
    }

    .btn-cancel:hover {
        border-color: var(--accent-pink-border);
    }

    .btn-small {
        padding: 8px 16px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--accent-cyan);
        font-family: inherit;
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
        transition: all var(--transition-base);
    }

    .btn-small:hover {
        border-color: var(--accent-cyan-border);
        box-shadow: 0 0 15px var(--accent-cyan-soft);
    }

    /* ═══ Done actions ═══ */
    .done-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .done-actions .btn-clear {
        margin: 0;
    }

    /* ═══ Bottom Action Bar ═══ */
    .bottom-actions {
        display: flex;
        align-items: stretch;
        gap: 0;
        background: var(--bg-2);
        border-block-start: 1px solid var(--border-medium);
        box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.12);
        /* position و z-index در responsive.css تنظیم می‌شوند */
    }

    .bottom-action {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 8px 4px;
        min-height: var(--bottom-bar-height);
        border: 0;
        background: transparent;
        color: var(--text-muted);
        font-family: inherit;
        font-size: 0.7rem;
        font-weight: 700;
        cursor: pointer;
        transition: color .16s ease, background .16s ease;
        position: relative;
    }

    .bottom-action:hover {
        color: var(--accent-cyan);
        background: var(--accent-cyan-soft);
    }

    .bottom-action:active {
        background: var(--accent-cyan-soft);
    }

    .bottom-action:focus-visible {
        outline: 2px solid var(--accent-cyan);
        outline-offset: -3px;
        z-index: 1;
    }

    .bottom-action-icon {
        font-size: 1.35rem;
        line-height: 1;
        display: inline-block;
    }

    .bottom-action-label {
        display: block;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* جداکننده بین دکمه‌ها */
    .bottom-action + .bottom-action::before {
        content: '';
        position: absolute;
        inset-block: 12px;
        inset-inline-start: 0;
        width: 1px;
        background: var(--border-subtle);
        opacity: 0.5;
    }

    /* ═══ Input Section ═══ */
    .text-input-with-mic {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .text-input-with-mic input {
        min-width: 0;
        flex: 1 1 auto;
    }

    .mic-btn {
        flex: 0 0 auto;
    }

    .input-section {
        display: flex;
        gap: 12px;
        margin-bottom: 16px;
        perspective: 600px;
    }

    .input-section input {
        flex: 1;
        min-width: 0;
        padding: 16px 22px;
        border: 2px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        background: var(--bg-2);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 1rem;
        outline: none;
        transition: all var(--transition-slow);
        box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .input-section input:focus {
        border-color: var(--accent-cyan);
        box-shadow:
            0 4px 20px var(--accent-cyan-soft),
            0 0 30px var(--accent-cyan-soft);
    }

    .input-section input::placeholder {
        color: var(--text-faintest);
    }

    .input-section input.input-error {
        border-color: var(--accent-pink);
        animation: shake 0.4s ease;
    }

    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(6px); }
        50% { transform: translateX(-6px); }
        75% { transform: translateX(4px); }
    }

    .priority-select {
        padding: 0 16px;
        border: 2px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        background: var(--bg-2);
        color: var(--text-secondary);
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 600;
        outline: none;
        cursor: pointer;
        transition: border-color var(--transition-base);
    }

    .priority-select:focus {
        border-color: var(--accent-purple);
    }

    /* ═══ Search / Filters ═══ */
    .search-row {
        position: relative;
        margin-bottom: 16px;
    }

    .search-icon {
        position: absolute;
        inset-inline-start: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1rem;
        opacity: 0.55;
        pointer-events: none;
    }

    .search-row input {
        width: 100%;
        padding-block: 12px;
        padding-inline: 40px 20px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.9rem;
        outline: none;
        transition: border-color var(--transition-base), box-shadow var(--transition-base);
    }

    .search-row input:focus {
        border-color: var(--accent-cyan-border);
        box-shadow: 0 0 20px var(--accent-cyan-soft);
    }

    .search-row input::placeholder {
        color: var(--text-faintest);
    }

    .filters {
        display: flex;
        gap: 8px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 8px 18px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--transition-base);
        box-shadow: var(--shadow-sm);
    }

    .filter-btn:hover {
        border-color: var(--accent-cyan-border);
        color: var(--accent-cyan);
    }

    .filter-btn.active {
        background: linear-gradient(145deg, var(--bg-14), var(--bg-15));
        border-color: var(--accent-purple);
        color: var(--text-secondary);
        box-shadow: 0 3px 15px var(--accent-purple-soft);
    }

    /* ═══ Progress / Stats ═══ */
    .progress-wrap {
        margin-bottom: 16px;
    }

    .progress-label {
        display: flex;
        justify-content: space-between;
        font-size: 0.8rem;
        color: var(--text-muted);
        margin-bottom: 6px;
    }

    .progress-label .pct {
        color: var(--accent-cyan);
        font-weight: 700;
    }

    .progress {
        height: 10px;
        border-radius: var(--radius-pill);
        background: var(--bg-6);
        border: 1px solid var(--border-subtle);
        overflow: hidden;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .progress-fill {
        height: 100%;
        width: 0;
        border-radius: var(--radius-pill);
        /* A3: RTL-aware gradient — از سمت start شروع به پر شدن می‌کند */
        background: linear-gradient(270deg, var(--accent-purple), var(--accent-cyan), var(--accent-green));
        box-shadow: 0 0 12px var(--accent-cyan-glow);
        transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* در حالت LTR، جهت gradient معکوس می‌شود */
    html[dir="ltr"] .progress-fill {
        background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan), var(--accent-green));
    }

    .stats {
        display: flex;
        justify-content: center;
        gap: 24px;
        margin-bottom: 24px;
        font-size: 0.8rem;
        color: var(--text-faint);
    }

    .stats span {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .stats .num {
        color: var(--accent-cyan);
        font-weight: 700;
        font-size: 1rem;
    }

    /* ═══ Task List ═══ */
    .task-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* لیست وظایف اسکرول داخلی دارد تا صفحه ارتفاع بی‌نهایت نگیرد */
    .list-zone .task-list {
        max-height: 62vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-inline-end: 4px;
    }

    @media (max-width: 900px) {
        .list-zone .task-list {
            max-height: 52vh;
        }
    }

    /* ═══ Task Item ═══ */
    .task-item {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 14px 18px;
        border-radius: 14px;
        background: var(--surface-raised);
        border: 1.5px solid var(--border-subtle);
        border-inline-end-width: 5px;
        transition: border-color var(--transition-base), box-shadow var(--transition-base), opacity 0.25s ease, background-color 0.3s ease;
        box-shadow: none;
    }

    /* ═══ Task Main Row ═══ */
    .task-main-row {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    /* ═══ Task Info Row — B1: font-size به 0.8rem افزایش یافت ═══ */
    .task-info-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        width: 100%;
        padding-inline-start: 38px;
        font-size: 0.8rem;
        color: var(--text-faint);
    }

    .task-info-row .mini-link {
        min-height: 26px;
        padding: 2px 8px;
        font-size: .76rem;
    }

    .task-item.just-added {
        animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(50px) rotateY(-5deg);
        }
        to {
            opacity: 1;
            transform: translateX(0) rotateY(0);
        }
    }

    .task-item.removing {
        opacity: 0;
        transform: translateX(-40px) scale(0.95);
    }

    .task-item:hover {
        border-color: var(--accent-cyan-border);
        box-shadow:
            0 8px 30px rgba(0, 0, 0, 0.1),
            0 0 20px var(--accent-cyan-soft);
    }

    .task-item.completed {
        border-color: var(--accent-green-border);
        background: var(--bg-22);
    }

    .task-item.completed .task-text {
        text-decoration: line-through;
        color: #6a8a7a;
    }

    .task-item.dragging {
        opacity: 0.4;
    }

    .task-item.drop-target {
        outline: 2px dashed var(--accent-cyan);
        outline-offset: -2px;
    }

    .task-item.prio-high { border-inline-end-color: var(--accent-pink); }
    .task-item.prio-medium { border-inline-end-color: var(--accent-yellow); }
    .task-item.prio-low { border-inline-end-color: var(--accent-cyan); }

    .task-item:has(.operation-trigger[aria-expanded="true"]) {
        z-index: 100;
        position: relative;
    }

    .task-checkbox {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        border: 2.5px solid var(--border-strong);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--transition-base);
        flex-shrink: 0;
        background: var(--bg-2);
        box-shadow: var(--shadow-sm);
        padding: 0;
    }

    .task-checkbox:hover {
        border-color: var(--accent-cyan);
        box-shadow: 0 3px 12px var(--accent-cyan-soft);
    }

    .task-checkbox:focus-visible {
        outline: 3px solid var(--accent-cyan);
        outline-offset: 2px;
    }

    .task-checkbox.checked {
        border-color: var(--accent-green);
        background: linear-gradient(145deg, var(--bg-29), var(--bg-30));
        box-shadow: 0 3px 12px var(--accent-green-soft);
    }

    .task-checkbox.checked::after {
        content: '';
        width: 10px;
        height: 6px;
        border-inline-start: 2.5px solid var(--accent-green);
        border-bottom: 2.5px solid var(--accent-green);
        transform: rotate(-45deg) translateY(-1px);
    }

    .task-content {
        flex: 1;
        min-width: 0;
    }

    .task-text {
        font-size: 0.95rem;
        line-height: 1.6;
        overflow-wrap: anywhere;
        cursor: default;
    }

    /* ═══ Task Type Icon ═══ */
    .task-type-icon {
        display: inline-block;
        font-size: 0.9rem;
        line-height: 1;
        margin-inline-end: 4px;
        vertical-align: middle;
        opacity: 0.9;
    }

    /* ═══ Created Date ═══ */
    .created-date {
        color: var(--text-faintest);
        font-size: 0.76rem;
    }

    .task-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 6px;
        font-size: 0.76rem;
        color: var(--text-faint);
    }

    .priority-badge {
        padding: 2px 10px;
        border-radius: var(--radius-pill);
        font-size: 0.72rem;
        font-weight: 700;
        border: 1px solid;
    }

    .shared-from {
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 700;
    }

    .dest-banner {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        padding: 8px 12px;
        margin-bottom: 8px;
        border: 1px solid var(--border-medium);
        border-radius: 12px;
        background: var(--surface-soft);
        font-size: 0.82rem;
    }

    .dest-banner[hidden] {
        display: none;
    }

    .dest-banner-text {
        flex: 1;
        min-width: 140px;
        color: var(--text-primary);
        font-weight: 600;
    }

    .priority-badge.p-high {
        color: var(--accent-pink);
        border-color: var(--accent-pink-border);
        background: var(--accent-pink-soft);
    }

    .priority-badge.p-medium {
        color: var(--accent-yellow);
        border-color: var(--accent-yellow-border);
        background: var(--accent-yellow-soft);
    }

    .priority-badge.p-low {
        color: var(--accent-cyan);
        border-color: var(--accent-cyan-border);
        background: var(--accent-cyan-soft);
    }

    .task-edit-input {
        width: 100%;
        padding: 8px 12px;
        border: 1.5px solid var(--accent-cyan);
        border-radius: var(--radius-sm);
        background: var(--bg-2);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.95rem;
        outline: none;
        box-shadow: 0 0 15px var(--accent-cyan-soft);
    }

    .task-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }

    .operation-menu {
        position: relative;
        flex-shrink: 0;
    }

    .operation-menu:has(.operation-trigger[aria-expanded="true"]) {
        z-index: 50;
    }

    /* ═══ B5: Operation Trigger — آیکن‌محور در دسکتاپ ═══ */
    .operation-trigger {
        min-width: 78px;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 8px 12px;
        border: 1px solid var(--border-medium);
        border-radius: var(--radius-sm);
        background: var(--surface-soft);
        color: var(--text-primary);
        font: inherit;
        font-size: .78rem;
        font-weight: 700;
        cursor: pointer;
    }

    .operation-trigger:hover,
    .operation-trigger:focus-visible {
        border-color: var(--accent-teal);
        box-shadow: 0 0 0 4px var(--focus-ring);
        outline: none;
    }

    .operation-trigger:first-letter {
        font-size: 1.35rem;
        line-height: 1;
    }

    /* در دسکتاپ: آیکن‌محور با tooltip (از aria-label) */
    @media (min-width: 901px) {
        .operation-trigger {
            min-width: 42px;
            width: 42px;
            padding: 8px 4px;
            position: relative;
        }

        .operation-trigger span {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* tooltip ساده با استفاده از data-tooltip */
        .operation-trigger::after {
            content: attr(aria-label);
            position: absolute;
            inset-block-end: calc(100% + 6px);
            inset-inline-end: 50%;
            transform: translateX(50%) translateY(4px);
            padding: 6px 10px;
            background: var(--bg-3);
            color: var(--text-primary);
            font-size: 0.72rem;
            font-weight: 600;
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-xs);
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity .15s ease, transform .15s ease;
            z-index: 100;
            box-shadow: var(--shadow-md);
        }

        .operation-trigger:hover::after,
        .operation-trigger:focus-visible::after {
            opacity: 1;
            transform: translateX(50%) translateY(0);
        }
    }

    .operation-list {
        position: absolute;
        inset-inline-end: 0;
        top: calc(100% + 8px);
        z-index: 20;
        min-width: 190px;
        display: grid;
        gap: 3px;
        padding: 6px;
        border: 1px solid var(--border-medium);
        border-radius: 12px;
        background: var(--surface-raised);
        box-shadow: var(--shadow-lg);
    }

    .operation-list[hidden] {
        display: none;
    }

    .operation-item {
        display: flex;
        align-items: center;
        gap: 9px;
        width: 100%;
        min-height: 42px;
        padding: 8px 10px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--text-primary);
        font: inherit;
        font-size: .78rem;
        text-align: start;
        cursor: pointer;
    }

    .operation-item:hover,
    .operation-item:focus-visible {
        background: var(--surface-soft);
        outline: none;
    }

    .operation-item.danger {
        color: var(--accent-pink);
    }

    /* ═══ منوی شناور ⋯ (menu-pop) — هم‌سبک operation-list برای یکدستی ═══ */
    .menu-pop {
        min-width: 190px;
        display: grid;
        gap: 3px;
        padding: 6px;
        border: 1px solid var(--border-medium);
        border-radius: 12px;
        background: var(--surface-raised);
        box-shadow: var(--shadow-lg);
    }

    .menu-item {
        display: flex;
        align-items: center;
        gap: 9px;
        width: 100%;
        min-height: 42px;
        padding: 8px 10px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--text-primary);
        font: inherit;
        font-size: .78rem;
        text-align: start;
        cursor: pointer;
    }

    .menu-item:hover,
    .menu-item:focus-visible {
        background: var(--surface-soft);
        outline: none;
    }

    .menu-item--danger {
        color: var(--accent-pink);
    }

    .menu-item-icon {
        display: inline-flex;
        align-items: center;
    }

    .child-actions .operation-trigger {
        min-width: 72px;
        min-height: 36px;
        padding: 6px 9px;
    }

    /* در دسکتاپ: child-actions هم آیکن‌محور */
    @media (min-width: 901px) {
        .child-actions .operation-trigger {
            min-width: 36px;
            width: 36px;
            min-height: 36px;
            padding: 6px;
        }
    }

    .btn-icon.has-loc,
    .btn-detail.has-loc {
        border-color: var(--accent-yellow-border);
        color: var(--accent-yellow);
    }

    .edit-wrap {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .edit-wrap .task-edit-input {
        flex: 1;
        min-width: 0;
    }

    /* ═══ Empty State ═══ */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: var(--text-faint);
    }

    .empty-state .icon {
        font-size: 4rem;
        margin-bottom: 16px;
        opacity: 0.5;
    }

    .empty-state p {
        font-size: 1rem;
        font-weight: 300;
    }

    .empty-hint {
        font-size: 0.78rem;
        color: var(--text-faint);
        margin-top: 10px;
        line-height: 2;
        font-weight: 300;
    }

    /* ═══ Session Empty (shared) ═══ */
    .session-empty {
        font-size: 0.8rem;
        color: var(--text-faintest);
        text-align: center;
        padding: 12px;
    }

    /* ═══ Due Row / Chips ═══ */
    .due-row {
        display: flex;
        gap: 8px;
        align-items: center;
        margin-bottom: 16px;
    }

    .due-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 18px;
        border: 1.5px dashed var(--border-strong);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--transition-base);
    }

    .due-btn:hover {
        border-color: var(--accent-cyan-border);
        color: var(--accent-cyan);
    }

    .due-btn.has-value {
        border-style: solid;
        border-color: var(--accent-cyan-border-strong);
        color: var(--accent-cyan);
    }

    /* Modern Persian Planner visual layer */
    .task-zone {
        background: color-mix(in srgb, var(--surface-raised) 94%, var(--accent-primary));
        border-radius: 20px;
        box-shadow: var(--shadow-sm);
    }

    .task-zone-title {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--text-title);
        letter-spacing: -.01em;
    }

    .task-zone-title::before {
        content: '';
        width: 5px;
        height: 20px;
        border-radius: var(--radius-pill);
        background: var(--accent-teal);
    }

    .kind3 {
        padding: 4px;
        background: var(--surface-soft);
        border: 1px solid var(--border-subtle);
        border-radius: 14px;
    }

    .kind3-btn.active,
    .filter-btn.active {
        background: var(--accent-primary);
        border-color: var(--accent-primary);
        color: var(--text-white);
        box-shadow: 0 5px 14px var(--accent-purple-soft);
    }

    .input-section input,
    .search-row input,
    .priority-select,
    .sort-select,
    .more-row input,
    .more-row textarea {
        background: var(--surface-raised);
        border-color: var(--border-medium);
    }

    .input-section input:focus,
    .search-row input:focus {
        border-color: var(--accent-teal);
        box-shadow: 0 0 0 4px var(--focus-ring);
    }

    .task-item,
    .plan-item {
        border-radius: 14px;
        background: var(--surface-raised);
        box-shadow: none;
    }

    .task-item:hover,
    .plan-item:hover {
        border-color: var(--accent-primary);
        box-shadow: var(--shadow-sm);
    }

    .progress-fill {
        background: var(--accent-teal);
        box-shadow: none;
    }

    /* ⚠️ بازگرداندن gradient برای RTL */
    html[dir="rtl"] .progress-fill {
        background: linear-gradient(270deg, var(--accent-primary), var(--accent-teal));
    }
    html[dir="ltr"] .progress-fill {
        background: linear-gradient(90deg, var(--accent-primary), var(--accent-teal));
    }

    .settings-zone {
        background: transparent;
        border-style: dashed;
    }

    .due-btn.small {
        padding: 8px 14px;
        font-size: 0.8rem;
        align-self: flex-start;
    }

    .due-clear {
        width: 34px;
        height: 34px;
        border-radius: var(--radius-sm);
        border: 1.5px solid var(--border-purple);
        background: linear-gradient(145deg, var(--bg-16), var(--bg-17));
        color: var(--accent-pink);
        cursor: pointer;
        font-family: inherit;
        transition: all 0.25s ease;
    }

    .due-clear:hover {
        border-color: var(--accent-pink-border);
    }

    .due-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
    }

    .due-chip {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 14px 6px 8px;
        background: var(--accent-cyan-soft);
        border: 1px solid var(--accent-cyan-border);
        color: var(--accent-cyan);
        border-radius: var(--radius-pill);
        font-size: 0.78rem;
        font-weight: 600;
    }

    .due-chip button {
        background: none;
        border: none;
        color: var(--accent-pink);
        cursor: pointer;
        font-size: 0.85rem;
        font-family: inherit;
        padding: 0;
        display: flex;
    }

    .loc-chip {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px 8px 8px;
        margin-bottom: 16px;
        background: var(--accent-yellow-soft);
        border: 1px solid var(--accent-yellow-border);
        color: var(--accent-yellow);
        border-radius: var(--radius-md);
        font-size: 0.8rem;
        font-weight: 600;
        width: fit-content;
        max-width: 100%;
    }

    .loc-chip button {
        background: none;
        border: none;
        color: var(--accent-pink);
        cursor: pointer;
        font-size: 0.85rem;
        font-family: inherit;
        padding: 0;
        display: flex;
    }

    /* ═══ Sort Row ═══ */
    .sort-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        font-size: 0.85rem;
        color: var(--text-muted);
    }

    .sort-select {
        padding: 8px 14px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-secondary);
        font-family: inherit;
        font-size: 0.85rem;
        font-weight: 600;
        outline: none;
        cursor: pointer;
    }

    .due-line {
        display: inline-block;
        margin-top: 4px;
        font-size: 0.78rem;
        color: var(--accent-cyan);
    }

    .due-line.overdue {
        color: var(--accent-pink);
        font-weight: 700;
    }

    .due-line.past-all {
        color: var(--text-faint);
    }

    /* ═══ Kind 3 ═══ */
    .kind3 {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
    }

    .kind3-btn {
        flex: 1;
        padding: 10px 4px;
        border-radius: var(--radius-md);
        border: 1.5px solid var(--border-subtle);
        background: var(--bg-2);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 0.82rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.25s ease;
    }

    .kind3-btn.active {
        border-color: var(--accent-purple);
        color: var(--text-secondary);
        background: linear-gradient(145deg, var(--bg-14), var(--bg-15));
        box-shadow: 0 3px 15px var(--accent-purple-soft);
    }

    /* ═══ Recur List ═══ */
    .recur-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }

    .recur-list button {
        padding: 10px 6px;
        border-radius: var(--radius-md);
        border: 1.5px solid var(--border-medium);
        background: var(--bg-2);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
        transition: all var(--transition-fast);
    }

    .recur-list button.on {
        border-color: var(--accent-cyan-border);
        color: var(--accent-cyan);
        box-shadow: 0 0 12px var(--accent-cyan-soft);
    }

    /* ═══ Duration Picker (series > hourlyN) ═══ */
    .dur-picker {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 10px;
        margin-bottom: 10px;
        border-radius: var(--radius-md);
        border: 1.5px solid var(--border-medium);
        background: var(--bg-2);
    }

    .dur-field {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .dur-btn {
        width: 30px;
        height: 30px;
        border-radius: var(--radius-sm);
        border: 1.5px solid var(--border-medium);
        background: var(--bg-3);
        color: var(--accent-cyan);
        font-size: 0.85rem;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        transition: all var(--transition-fast);
    }

    .dur-btn:hover,
    .dur-btn:active {
        border-color: var(--accent-cyan-border);
        box-shadow: 0 0 10px var(--accent-cyan-soft);
    }

    .dur-val {
        min-width: 2.2em;
        text-align: center;
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--text-primary);
        font-variant-numeric: tabular-nums;
    }

    .dur-label {
        font-size: 0.72rem;
        color: var(--text-muted);
        font-weight: 700;
    }

    .dur-sep {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--text-muted);
    }

    /* ═══ Smart Chip ═══ */
    .smart-chip {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        margin-bottom: 12px;
        border-radius: var(--radius-md);
        font-size: 0.8rem;
        background: var(--accent-cyan-soft);
        border: 1px solid var(--accent-cyan-border);
        color: var(--accent-cyan);
        width: fit-content;
        max-width: 100%;
    }

    .smart-chip button {
        border-radius: var(--radius-xs);
        border: 1px solid var(--accent-cyan-border-strong);
        background: var(--accent-cyan-soft);
        color: var(--accent-cyan);
        font-family: inherit;
        font-size: 0.75rem;
        font-weight: 700;
        padding: 4px 12px;
        cursor: pointer;
        white-space: nowrap;
    }

    /* ═══ More Details / Settings ═══ */
    .more-details {
        margin-bottom: 14px;
        border: 1.5px dashed var(--border-medium);
        border-radius: var(--radius-md);
        padding: 8px 14px;
    }

    .more-details summary {
        cursor: pointer;
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--text-secondary);
        list-style: none;
        padding: 4px 0;
    }

    .more-details summary::-webkit-details-marker {
        display: none;
    }

    .more-details summary::after {
        content: '▾';
        margin-inline-start: 6px;
        font-size: 0.7rem;
        color: var(--text-faint);
    }

    .more-details[open] summary::after {
        content: '▴';
    }

    .more-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 0 6px;
    }

    .more-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .more-row > span {
        width: 52px;
        flex-shrink: 0;
        font-size: 0.78rem;
        color: var(--text-muted);
        font-weight: 600;
    }

    .more-row select,
    .more-row input {
        flex: 1;
        min-width: 0;
        padding: 10px 14px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.85rem;
        outline: none;
    }

    .more-row select:focus,
    .more-row input:focus {
        border-color: var(--accent-cyan-border);
    }

    .settings-overlay {
        display: none;
        z-index: 1200;
        padding: 20px;
        background: rgba(6, 8, 24, .68);
        backdrop-filter: blur(8px);
    }

    .settings-overlay[hidden] {
        display: none !important;
    }

    .settings-panel {
        width: min(760px, 100%);
        max-height: min(760px, calc(100vh - 40px));
        margin: 0;
        padding: 18px;
        overflow-y: auto;
        border: 1px solid var(--border-subtle);
        border-radius: 20px;
        background: color-mix(in srgb, var(--surface-raised) 94%, var(--accent-primary));
        box-shadow: var(--shadow-sm);
        scroll-margin-top: 92px;
    }

    .settings-panel[hidden] {
        display: none;
    }

    .settings-panel-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 16px;
    }

    .settings-panel-head h2 {
        margin: 0;
        color: var(--text-title);
        font-size: 1.15rem;
    }

    .settings-panel-head p,
    .settings-note {
        margin: 4px 0 0;
        color: var(--text-muted);
        font-size: .75rem;
    }

    .settings-kicker {
        display: block;
        margin-bottom: 4px;
        color: var(--accent-teal);
        font-size: .68rem;
        font-weight: 800;
    }

    .settings-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .settings-card {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 14px;
        border: 1px solid var(--border-subtle);
        border-radius: 14px;
        background: var(--surface-soft);
    }

    .settings-card-wide {
        grid-column: 1 / -1;
    }

    .settings-card h3 {
        margin: 0;
        color: var(--text-title);
        font-size: .85rem;
    }

    .settings-card .settings-row {
        margin-top: 0;
    }

    .settings-card .settings-row > span:first-child {
        color: var(--text-secondary);
        font-weight: 700;
    }

    .settings {
        margin-bottom: 20px;
        font-size: 0.82rem;
        color: var(--text-muted);
        background: var(--bg-2);
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        padding: 10px 16px;
    }

    .settings summary {
        cursor: pointer;
        font-weight: 700;
        color: var(--text-secondary);
    }

    .settings-row {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        align-items: center;
        margin-top: 10px;
    }

    .settings-row label {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .settings-row .sort-select {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .settings-status {
        margin-top: 8px;
        font-size: 0.75rem;
        color: var(--text-faint);
    }

    .settings-status.ok {
        color: var(--accent-green);
    }

    /* ═══ Plan ═══ */
    .plan-item {
        border-color: var(--accent-purple-border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .plan-head {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .plan-head-main {
        flex: 1;
        min-width: 0;
    }

    .plan-head > .plan-caret,
    .plan-head > .task-actions {
        margin-top: 2px;
        flex-shrink: 0;
    }

    .plan-caret {
        width: 32px;
        height: 32px;
        border-radius: var(--radius-sm);
        border: 1.5px solid var(--border-medium);
        background: linear-gradient(145deg, var(--bg-14), var(--bg-15));
        color: var(--text-secondary);
        cursor: pointer;
        font-family: inherit;
        font-size: 1.9rem;
        line-height: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        transition: all 0.25s ease;
    }

    .plan-caret:hover {
        border-color: var(--accent-purple);
    }

    .plan-meta-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        width: 100%;
        margin-top: 8px;
        padding-inline: 0;
    }

    .plan-meta-row .mini-progress {
        flex: 1;
        min-width: 80px;
        max-width: 200px;
    }

    .plan-session-row {
        display: block;
        width: 100%;
        margin-top: 6px;
    }

    .mini-progress {
        height: 6px;
        border-radius: var(--radius-pill);
        background: var(--bg-6);
        overflow: hidden;
        min-width: 80px;
        flex: 1;
    }

    .mini-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
        border-radius: var(--radius-pill);
        transition: width 0.4s ease;
    }

    .plan-body {
        margin-top: 12px;
        border-top: 1px dashed var(--border-medium);
        padding-top: 12px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    /* ═══ Child Item ═══ */
    .child-item {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 12px 14px;
        border-radius: var(--radius-md);
        background: var(--bg-4);
        border: 1px solid var(--border-subtle);
        transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    }

    .child-item:hover {
        border-color: var(--accent-cyan-border);
    }

    .child-item.completed .child-text {
        text-decoration: line-through;
        color: #6a8a7a;
    }

    .child-item.just-added {
        animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .child-main-row {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .child-main-row .task-checkbox {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }

    .child-text {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.88rem;
        line-height: 1.7;
        overflow-wrap: anywhere;
        cursor: default;
    }

    .child-actions {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
        margin-inline-start: auto;
    }

    /* ═══ B1: child-meta-row با font-size بزرگ‌تر ═══ */
    .child-meta-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        padding-inline-start: 32px;
        font-size: 0.8rem;
        color: var(--text-faint);
        min-height: 1.6em;
    }

    .child-meta-row:empty {
        display: none;
    }

    .child-meta-item {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        font-size: 0.8rem;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .child-meta-badge {
        display: inline-flex;
        align-items: center;
        font-size: 0.86rem;
        line-height: 1;
        color: var(--text-muted);
    }

    .child-meta-row .priority-badge {
        padding: 1px 8px;
        font-size: 0.72rem;
    }

    /* ═══ Child Add Row (فرم افزودن زیرکار) ═══ */
    .child-add {
        display: flex;
        gap: 8px;
        margin-top: 4px;
        flex-wrap: wrap;
        align-items: center;
    }

    .child-input {
        flex: 1 1 180px;
        min-width: 0;
        padding: 10px 14px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 0.85rem;
        outline: none;
        transition: border-color var(--transition-base), box-shadow var(--transition-base);
    }

    .child-input:focus {
        border-color: var(--accent-cyan-border);
        box-shadow: 0 0 0 3px var(--accent-cyan-soft);
    }

    .child-input::placeholder {
        color: var(--text-faintest);
    }

    .child-input.input-error {
        border-color: var(--accent-pink);
        animation: shake 0.4s ease;
    }

    .child-prio {
        flex: 0 0 auto;
        padding: 10px 12px;
        border: 1.5px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        color: var(--text-secondary);
        font-family: inherit;
        font-size: 0.8rem;
        font-weight: 600;
        outline: none;
        cursor: pointer;
        transition: border-color var(--transition-base);
    }

    .child-prio:focus {
        border-color: var(--accent-purple);
    }

    .child-add .btn-child-add {
        flex: 0 0 auto;
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .child-add .btn-icon {
        flex: 0 0 auto;
        width: 38px;
        height: 38px;
    }

    /* ═══ Weather Icon Button ═══ */
    .weather-icon-btn {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: 0;
        background: transparent;
        padding: 1px 4px;
        margin-inline-start: 4px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.9rem;
        line-height: 1;
        vertical-align: middle;
        transition: background 0.15s ease;
    }

    .weather-icon-btn:hover {
        background: var(--accent-cyan-soft);
    }

    .weather-icon-btn:focus-visible {
        outline: 2px solid var(--accent-cyan);
        outline-offset: 2px;
    }

    .weather-icon-btn-sm {
        font-size: 0.82rem;
        padding: 0 3px;
        margin-inline-start: 0;
    }

    .weather-icon-emoji {
        display: inline-block;
        min-width: 1em;
        font-size: 1em;
        line-height: 1;
        text-align: center;
    }

    /* ═══ Photo Actions (detail page) ═══ */
    .photo-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }

    .photo-upload-btn {
        flex: 1 1 auto;
        min-width: min(180px, 100%);
        justify-content: center;
        border-style: solid;
        border-color: var(--accent-cyan-border);
        color: var(--accent-cyan);
    }

    .photo-upload-btn:hover {
        border-color: var(--accent-cyan);
        background: var(--accent-cyan-soft);
    }

    .photo-camera-btn {
        border-color: var(--accent-purple-border);
        color: var(--text-secondary);
    }

    .photo-camera-btn:hover {
        border-color: var(--accent-purple);
        background: var(--accent-purple-soft);
    }

    /* ═══ Plan Dates (فرم افزودن) ═══ */
    #planDatesWrap {
        margin-top: 10px;
    }

    #planDatesWrap .due-btn {
        flex: 1 1 auto;
    }

    #planDatesWrap .due-clear {
        flex: 0 0 auto;
    }

    /* ═══ Task List Status (aria-live for screen readers) ═══ */
    .live-status {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYER: overrides
   ═══════════════════════════════════════════════════════════════════════════ */
@layer overrides {
    /* ═══ Header refinement (Desktop) ═══ */
    @media (min-width: 901px) {
        .header-main {
            min-width: 0;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
        }

        .header-main h1 {
            margin: 0;
        }

        .tagline-toggle {
            display: block;
            margin: 5px 0 0;
            padding: 0;
            border: 0;
            background: transparent;
            color: var(--text-muted);
            font: inherit;
            font-size: 0.92rem;
            font-weight: 500;
            line-height: 1.8;
            text-align: start;
            cursor: pointer;
        }

        .tagline-toggle:hover {
            color: var(--accent-cyan);
        }

        .header-side {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 7px 8px;
            align-items: center;
            min-width: 230px;
            max-width: 300px;
        }

        .header-side .today-line {
            grid-column: 1 / -1;
            width: 100%;
            text-align: end;
        }

        .header-actions {
            display: contents;
        }

        .header-actions .btn-small {
            width: 100%;
            min-width: 0;
            white-space: nowrap;
        }
    }

    @media (min-width: 901px) and (max-width: 1080px) {
        .header {
            gap: 8px 12px;
        }
        .header h1 {
            font-size: 2.15rem;
        }
        .header-main .tagline-toggle {
            font-size: 0.85rem;
        }
        .header-side {
            min-width: 210px;
            max-width: 260px;
        }
    }

    /* ═══ Create Zone ═══ */
    .create-zone {
        padding: 18px;
        border: 1px solid var(--rf-border);
        border-radius: var(--radius-lg);
        background: rgba(255, 255, 255, 0.035);
        box-shadow: var(--rf-glow);
    }

    html.theme-light .create-zone {
        background: linear-gradient(145deg, var(--rf-primary-soft), rgba(255, 255, 255, 0.4));
        border-color: rgba(109, 40, 217, 0.18);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    }

    .create-zone .task-zone-title {
        margin-bottom: 12px;
        color: var(--text-white);
        letter-spacing: -.01em;
    }

    html.theme-light .create-zone .task-zone-title {
        color: var(--text-title);
    }

    .create-zone .kind3 {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }

    .create-zone .kind3-btn {
        min-height: 46px;
        padding: 8px 12px;
        border: 1px solid var(--rf-border);
        border-radius: 11px;
        background: rgba(255, 255, 255, 0.055);
        color: var(--text-muted);
        font-weight: 700;
        line-height: 1.35;
        transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
    }

    html.theme-light .create-zone .kind3-btn {
        background: #ffffff;
        border-color: var(--border-subtle);
        color: var(--text-primary);
    }

    html.theme-light .create-zone .kind3-btn:hover {
        border-color: var(--accent-cyan);
        background: #f8fafc;
    }

    .create-zone .kind3-btn:hover {
        border-color: var(--accent-cyan);
        color: var(--text-white);
    }

    .create-zone .kind3-btn.active {
        border-color: var(--accent-cyan);
        background: linear-gradient(145deg, var(--accent-cyan-soft), var(--accent-purple-soft));
        color: var(--text-white);
        box-shadow: 0 0 0 1px var(--accent-cyan-soft), 0 0 18px var(--accent-cyan-soft);
    }

    html.theme-light .create-zone .kind3-btn.active {
        background: linear-gradient(145deg, var(--accent-cyan-soft), var(--accent-purple-soft));
        border-color: var(--accent-cyan);
        color: var(--text-primary);
        box-shadow: 0 0 0 1px var(--accent-cyan-border), 0 2px 6px var(--accent-cyan-soft);
    }

    .create-zone .kind3-btn:focus-visible {
        outline: 2px solid var(--accent-cyan);
        outline-offset: 2px;
    }

    .create-zone .input-section,
    .create-zone .due-row,
    .create-zone .more-details,
    .create-zone .form-actions {
        width: 100%;
    }

    .create-zone .input-section { margin-top: 10px; }
    .create-zone .due-row { margin-top: 10px; }
    .create-zone .smart-chip,
    .create-zone .due-chips,
    .create-zone .loc-chip,
    .create-zone #seriesRecurWrap,
    .create-zone .more-details,
    .create-zone #planKidsWrap,
    .create-zone #planDatesWrap,
    .create-zone .template-toggle { margin-top: 10px; }

    .create-zone .form-actions { margin-top: 14px; }
    .create-zone .form-actions .btn-add { width: 100%; }

    /* ═══ List Zone ═══ */
    .list-zone {
        margin-top: 28px;
        padding: 18px;
    }

    .list-zone .task-zone-title {
        margin-bottom: 12px;
        color: var(--text-muted);
    }

    html.theme-light .list-zone .task-zone-title {
        color: var(--text-title);
    }

    .list-zone .search-row { margin-top: 0; }

    .list-zone .search-row input {
        background: var(--bg-2);
        border-color: var(--border-subtle);
        box-shadow: none;
    }

    .list-zone .search-row input:focus {
        border-color: var(--accent-cyan-border);
        background: var(--bg-2);
        box-shadow: 0 0 0 3px var(--accent-cyan-soft);
    }

    .list-zone .filters {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin-top: 9px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 1px 1px 4px;
        scrollbar-width: thin;
    }

    .list-zone .filter-btn {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 5px 10px;
        border-radius: var(--radius-pill);
        white-space: nowrap;
        font-size: .82rem;
    }

    .list-zone .filter-btn.active,
    .list-zone .filter-btn[aria-pressed="true"] {
        border-color: var(--accent-purple);
        background: var(--accent-purple-soft);
        box-shadow: 0 0 0 1px var(--accent-purple-border);
    }

    .list-zone .sort-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 7px;
        margin-top: 9px;
    }

    .list-zone .sort-row label {
        flex: 0 0 auto;
        font-size: .82rem;
        opacity: .8;
    }

    .list-zone .sort-row .sort-select {
        flex: 0 1 190px;
        min-width: 140px;
        height: 36px;
    }

    .list-zone .sort-row .btn-small {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 6px 10px;
        white-space: nowrap;
    }

    .list-zone .progress-wrap { margin-top: 17px; }
    .list-zone .stats { margin-top: 7px; }
    .list-zone .task-list { margin-top: 12px; }

    .settings-zone { margin-top: 22px; }
    .settings-zone .settings { margin: 0; }

    .insight-zone {
        margin-top: 26px;
        padding-top: 20px;
        border-top: 1px solid var(--rf-border);
    }

    .insight-zone .task-zone-title { margin-bottom: 12px; }
    .map-head-actions .map-context-toggle { display: inline-flex; }
    #panelTasks > .task-zone + .task-zone { margin-bottom: 0; }

    /* ═══ Task Info Row — Mini Link ═══ */
    .task-info-row .mini-link {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 26px;
        margin-inline-start: 2px;
        padding: 2px 8px;
        border: 1px solid var(--accent-cyan-border);
        border-radius: var(--radius-pill);
        background: var(--accent-cyan-soft);
        color: var(--accent-cyan);
        font: inherit;
        font-size: .76rem;
        font-weight: 700;
        line-height: 1.2;
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
    }

    .task-info-row .mini-link:hover {
        background: var(--accent-cyan-soft);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

    .task-info-row .mini-link:active {
        transform: translateY(1px);
    }

    .task-item .mini-link {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 28px;
        margin-inline-start: 2px;
        padding: 3px 9px;
        border: 1px solid var(--accent-cyan-border);
        border-radius: var(--radius-pill);
        background: var(--accent-cyan-soft);
        color: var(--accent-cyan);
        font: inherit;
        font-size: .76rem;
        font-weight: 700;
        line-height: 1.2;
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
    }

    .task-item .mini-link:hover {
        background: var(--accent-cyan-soft);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

    .task-item .mini-link:active {
        transform: translateY(1px);
    }

    /* ═══ Light theme — Shadow overrides ═══ */
    html.theme-light .btn-add {
        box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25), 0 2px 4px rgba(15, 23, 42, 0.08);
    }

    html.theme-light .btn-add:hover {
        box-shadow: 0 8px 20px rgba(109, 40, 217, 0.3), 0 4px 8px rgba(15, 23, 42, 0.1);
    }

    html.theme-light .task-item:hover {
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--accent-cyan-border);
    }

    /* ═══ Pro Mode — فیلتر و مرتب‌سازی فقط در حالت پیشرفته ═══ */
    body:not(.pro-mode) .list-zone .filters,
    body:not(.pro-mode) .list-zone .sort-row > label,
    body:not(.pro-mode) .list-zone .sort-row > .sort-select {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⚠️ فاز ۵ گام ۱: استایل Export/Import
   ═══════════════════════════════════════════════════════════════════════════ */

@layer overrides {
    /* ═══ Export Options ═══ */
    .export-options {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .export-option {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        cursor: pointer;
        transition: border-color .16s ease, background .16s ease;
    }

    .export-option:hover {
        border-color: var(--accent-cyan-border);
        background: var(--bg-4);
    }

    .export-option input[type="checkbox"],
    .export-option input[type="radio"] {
        flex: 0 0 auto;
        margin-top: 2px;
        accent-color: var(--accent-purple);
    }

    .export-option > span {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .export-option strong {
        color: var(--text-primary);
        font-size: 0.88rem;
        font-weight: 700;
    }

    .export-option small {
        color: var(--text-muted);
        font-size: 0.75rem;
        line-height: 1.6;
    }

    /* ═══ Export/Import Meta ═══ */
    .export-meta,
    .import-meta {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px;
        margin-bottom: 14px;
        border-radius: var(--radius-md);
        background: var(--accent-cyan-soft);
        border: 1px solid var(--accent-cyan-border);
        font-size: 0.8rem;
    }

    .export-meta:empty,
    .import-meta:empty {
        display: none;
    }

    .export-meta-row,
    .import-meta-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        color: var(--text-muted);
    }

    .export-meta-row strong,
    .import-meta-row strong {
        color: var(--accent-cyan);
        font-weight: 700;
    }

    .import-meta-warn {
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid var(--accent-cyan-border);
        color: var(--accent-yellow);
        font-size: 0.75rem;
        font-weight: 700;
    }

    .import-error {
        padding: 8px 0;
        color: var(--accent-pink);
        font-size: 0.82rem;
        font-weight: 700;
        text-align: center;
    }

    /* ═══ Import File Row ═══ */
    .import-file-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .import-file-row .photo-upload-btn {
        align-self: stretch;
        justify-content: center;
        min-height: 44px;
        font-weight: 700;
    }

    .import-file-name {
        font-size: 0.78rem;
        color: var(--text-muted);
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ═══ Import Mode ═══ */
    .import-mode {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 14px;
    }

    .import-mode .field-label {
        color: var(--text-secondary);
        font-weight: 700;
        font-size: 0.82rem;
    }

    /* ═══ Light theme overrides ═══ */
    html.theme-light .export-option {
        background: #ffffff;
        border-color: #d8dde5;
    }

    html.theme-light .export-option:hover {
        background: #f8fafc;
    }

    html.theme-light .export-meta,
    html.theme-light .import-meta {
        background: rgba(8, 145, 178, 0.06);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⚠️ فاز ۵ گام ۳: استایل صدای یادآور سه‌حالته
   ═══════════════════════════════════════════════════════════════════════════ */

@layer overrides {
    /* ═══ Sound Modes Container ═══ */
    .sound-modes {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border-subtle);
    }

    .sound-mode {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--bg-2);
        transition: border-color .16s ease, background .16s ease;
    }

    .sound-mode:hover {
        border-color: var(--accent-cyan-border);
        background: var(--bg-4);
    }

    /* ═══ Toggle (checkbox + label) ═══ */
    .sound-mode-toggle {
        flex: 1;
        display: flex;
        align-items: flex-start;
        gap: 10px;
        cursor: pointer;
        min-width: 0;
    }

    .sound-mode-toggle input[type="checkbox"] {
        flex: 0 0 auto;
        margin-top: 3px;
        accent-color: var(--accent-purple);
        width: 18px;
        height: 18px;
    }

    .sound-mode-label {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .sound-mode-label strong {
        color: var(--text-primary);
        font-size: 0.88rem;
        font-weight: 700;
    }

    .sound-mode-label small {
        color: var(--text-muted);
        font-size: 0.74rem;
        line-height: 1.5;
    }

    /* ═══ Test Button ═══ */
    .sound-test-btn {
        flex: 0 0 auto;
        min-width: 62px;
        padding: 6px 12px;
        font-size: 0.76rem;
        font-weight: 700;
        border-color: var(--accent-cyan-border);
        color: var(--accent-cyan);
        background: var(--accent-cyan-soft);
        transition: background .16s ease, border-color .16s ease, transform .16s ease;
    }

    .sound-test-btn:hover {
        background: var(--accent-cyan-soft);
        border-color: var(--accent-cyan);
        transform: translateY(-1px);
    }

    .sound-test-btn:active {
        transform: translateY(1px);
    }

    .sound-test-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
    }

    /* ═══ Select Row (preset/voice) ═══ */
    .sound-preset-select-row {
        margin-top: 0;
        padding-inline-start: 34px;
        gap: 8px;
    }

    .sound-preset-select-row label {
        flex: 0 0 auto;
        font-size: 0.82rem;
        color: var(--text-secondary);
        font-weight: 600;
    }

    .sound-preset-select-row .sort-select {
        flex: 1 1 auto;
        min-width: 0;
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    /* ═══ حالت غیرفعال (وقتی master خاموش است) ═══ */
    .sound-modes.is-disabled {
        opacity: 0.5;
        pointer-events: none;
    }

    /* ═══ Light theme overrides ═══ */
    html.theme-light .sound-mode {
        background: #ffffff;
        border-color: #d8dde5;
    }

    html.theme-light .sound-mode:hover {
        background: #f8fafc;
        border-color: var(--accent-cyan);
    }

    html.theme-light .sound-test-btn {
        background: var(--accent-cyan-soft);
    }

    /* ═══ تنظیمات settings-trigger در موبایل ═══ */
    @media (max-width: 900px) {
        .settings-trigger {
            inset-block-start: 4px;
            inset-inline-end: 4px;
            width: 40px;
            height: 40px;
        }
    }

    @media (max-width: 600px) {
        .sound-mode {
            flex-wrap: wrap;
        }

        .sound-test-btn {
            width: 100%;
            min-height: 40px;
        }

        .sound-preset-select-row {
            padding-inline-start: 0;
            flex-direction: column;
            align-items: stretch;
        }

        .sound-preset-select-row label {
            margin-bottom: 4px;
        }
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⚠️ فاز ۶ گام ۲: استایل مودال «حساب من» + Telegram Login
   ═══════════════════════════════════════════════════════════════════════════ */

@layer overrides {
    /* ═══ Auth Options (حالت وارد نشده) ═══ */
    .auth-options {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 14px 0;
    }

    .auth-option-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        padding: 12px 18px;
        font-family: inherit;
        font-size: 0.95rem;
        font-weight: 700;
        text-align: center;
    }

    .auth-option-btn--disabled {
        opacity: 0.55;
        cursor: not-allowed;
        position: relative;
    }

    .auth-option-btn--disabled:hover {
        transform: none;
    }

    .auth-option-soon {
        display: inline-block;
        margin-inline-start: 6px;
        padding: 2px 8px;
        border-radius: var(--radius-pill);
        background: var(--accent-yellow-soft);
        border: 1px solid var(--accent-yellow-border);
        color: var(--accent-yellow);
        font-size: 0.68rem;
        font-weight: 800;
    }

    /* ═══ Auth Hint / Note ═══ */
    .auth-hint {
        display: block;
        margin-top: 4px;
        color: var(--text-muted);
        font-size: 0.75rem;
        line-height: 1.7;
    }

    .auth-note {
        margin: 12px 0 0;
        padding: 10px 12px;
        border-inline-start: 3px solid var(--accent-cyan);
        border-radius: var(--radius-sm);
        background: var(--accent-cyan-soft);
        color: var(--text-muted);
        font-size: 0.78rem;
        line-height: 1.8;
    }

    /* ═══ Auth User Info (حالت وارد شده) ═══ */
    .auth-user-info {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 14px 0;
        padding: 12px 14px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--surface-soft);
    }

    .auth-user-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        font-size: 0.86rem;
        color: var(--text-muted);
    }

    .auth-user-row span {
        flex: 0 0 auto;
        font-weight: 600;
    }

    .auth-user-row strong {
        flex: 1 1 auto;
        text-align: end;
        color: var(--text-primary);
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    /* ═══ Auth TTL Block ═══ */
    .auth-ttl-block {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 14px 0;
        padding: 12px 14px;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-md);
        background: var(--surface-soft);
    }

    .auth-ttl-label {
        color: var(--text-secondary);
        font-size: 0.82rem;
        font-weight: 700;
    }

    .auth-ttl-row {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .auth-ttl-row .sort-select {
        flex: 1 1 auto;
        min-width: 0;
    }

    .auth-ttl-row .btn-small {
        flex: 0 0 auto;
        min-height: 36px;
        padding-inline: 16px;
    }

    .auth-remaining {
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px dashed var(--border-subtle);
        font-size: 0.8rem;
        color: var(--text-muted);
    }

    .auth-remaining strong {
        color: var(--accent-cyan);
        font-weight: 700;
    }

    /* ═══ Auth Warning / Error ═══ */
    .auth-warning {
        margin: 12px 0;
        padding: 10px 12px;
        border-inline-start: 3px solid var(--accent-yellow);
        border-radius: var(--radius-sm);
        background: var(--accent-yellow-soft);
        color: var(--text-primary);
        font-size: 0.8rem;
        line-height: 1.8;
    }

    .auth-error {
        margin: 12px 0 0;
        padding: 10px 12px;
        border-inline-start: 3px solid var(--accent-pink);
        border-radius: var(--radius-sm);
        background: var(--accent-pink-soft);
        color: var(--accent-pink);
        font-size: 0.82rem;
        font-weight: 700;
        line-height: 1.8;
    }

    /* ═══ Auth Actions ═══ */
    .auth-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 14px;
    }

    .auth-logout-btn {
        width: 100%;
        margin: 0;
        padding: 12px 18px;
        font-size: 0.9rem;
        font-weight: 700;
    }

    /* ⚠️ D-009: دکمه‌ی «قطع اتصال از تلگرام» */
    .auth-disconnect-btn {
        width: 100%;
        margin: 8px 0 0;
        padding: 10px 16px;
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--text-muted);
        border-color: var(--border-subtle);
        background: var(--bg-2);
        transition: color .18s ease, border-color .18s ease, background .18s ease;
    }

    .auth-disconnect-btn:hover {
        color: var(--accent-yellow);
        border-color: var(--accent-yellow-border);
        background: var(--accent-yellow-soft);
        box-shadow: 0 0 12px var(--accent-yellow-soft);
    }

    .auth-disconnect-btn:focus-visible {
        outline: 2px solid var(--accent-yellow);
        outline-offset: 2px;
    }

    html.theme-light .auth-disconnect-btn {
        background: #ffffff;
        border-color: #d8dde5;
    }

    html.theme-light .auth-disconnect-btn:hover {
        background: rgba(217, 119, 6, 0.08);
        border-color: var(--accent-yellow);
    }

    /* ═══ Account Status (تنظیمات) ═══ */
    .account-status {
        font-size: 0.85rem;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: var(--radius-pill);
        white-space: nowrap;
    }

    .account-status.is-logged-out {
        color: var(--text-muted);
        background: var(--bg-4);
        border: 1px solid var(--border-subtle);
    }

    .account-status.is-logged-in {
        color: var(--accent-green);
        background: var(--accent-green-soft);
        border: 1px solid var(--accent-green-border);
    }

    /* ═══ Light theme overrides ═══ */
    html.theme-light .auth-user-info,
    html.theme-light .auth-ttl-block {
        background: #f8fafc;
        border-color: #e2e8f0;
    }

    html.theme-light .auth-note {
        background: rgba(8, 145, 178, 0.08);
    }

    html.theme-light .auth-warning {
        background: rgba(217, 119, 6, 0.08);
    }

    /* ═══ Mobile ═══ */
    @media (max-width: 600px) {
        .auth-user-row {
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
        }

        .auth-user-row strong {
            text-align: start;
            width: 100%;
        }

        .auth-ttl-row {
            flex-wrap: wrap;
        }

        .auth-ttl-row .btn-small {
            flex: 1 1 100%;
        }
    }
}