/* ============================================
   Agenda Mobile UX Enhancements
   All 12 steps: Bottom Sheet, Swipeable Kanban,
   Progressive Form, Compact Stats, Collapsible Filter,
   Swipe-to-Action, FAB, Offline, Table→Cards,
   Mention Fix, Infinite Scroll, Haptic/Visual.
   ============================================ */

/* =============================================
   P0 — MOBILE AGENDA SHELL
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #tasks-tab {
        padding-bottom: calc(104px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }

    html.agenda-mobile-surface .app-footer {
        margin-top: 18px;
        padding-top: 14px;
    }

    .tasks-tab-header {
        align-items: flex-start !important;
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    .tasks-tab-title-block {
        min-width: 0;
        flex: 1;
    }

    .tasks-tab-title-block h3 {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1.32rem;
        line-height: 1.12;
        color: var(--brand-fg, var(--primary-color));
    }

    .tasks-tab-subtitle {
        display: none;
    }

    .tasks-tab-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .agenda-mobile-overflow {
        margin-left: auto;
        position: relative;
    }

    .agenda-mobile-overflow summary {
        list-style: none;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-surface-2);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        color: var(--text-primary);
        cursor: pointer;
    }

    .agenda-mobile-overflow summary::-webkit-details-marker {
        display: none;
    }

    .agenda-mobile-overflow-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        min-width: 190px;
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        background: var(--bg-surface-1);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        box-shadow: var(--shadow-lg);
        z-index: 1100;
    }

    .agenda-mobile-overflow-menu .btn {
        width: 100%;
        justify-content: flex-start;
        min-height: 44px;
    }

    .agenda-mobile-summary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }

    .agenda-scope-context {
        display: block;
        margin-bottom: 10px;
        padding: 9px 12px;
        border: 1px solid color-mix(in srgb, var(--primary-color) 18%, var(--border-color));
        border-radius: 14px;
        background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-2) 94%, white), var(--bg-surface-1));
        color: var(--text-secondary);
        font-size: 0.77rem;
        line-height: 1.4;
    }

    .agenda-scope-toggle {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 6px;
        padding: 0;
        margin-bottom: 6px;
        background: transparent;
        border-radius: 0;
    }

    .agenda-scope-toggle::-webkit-scrollbar {
        display: none;
    }

    .agenda-scope-toggle .view-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        gap: 8px;
        min-height: 36px;
        padding: 8px 13px;
        border: 1px solid var(--border-color);
        border-radius: 999px;
        background: var(--bg-surface-1);
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
        color: var(--text-secondary);
    }

    .agenda-scope-toggle .view-toggle-btn.active {
        border-color: transparent;
        background: color-mix(in srgb, var(--primary-color) 92%, white);
        color: #fff;
        box-shadow: 0 10px 22px color-mix(in srgb, var(--primary-color) 24%, transparent);
    }

    .agenda-scope-count-badge {
        display: none !important;
    }

    .agenda-team-quick-filters {
        margin-bottom: 6px;
    }

    .agenda-team-filter-track {
        gap: 6px;
        padding-bottom: 2px;
    }

    .agenda-team-filter-chip {
        min-height: 36px;
        padding: 0 12px;
        font-size: 0.75rem;
    }

    .agenda-team-combobox {
        position: relative;
        width: 100%;
    }

    .agenda-team-combobox-input-wrap {
        position: relative;
        display: flex;
        align-items: center;
    }

    .agenda-team-combobox-icon {
        position: absolute;
        left: 9px;
        font-size: 0.85rem;
        color: var(--text-secondary);
        pointer-events: none;
        z-index: 1;
    }

    .agenda-team-combobox-input {
        width: 100%;
        height: 36px;
        padding: 0 10px 0 30px;
        font-size: 0.8rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-surface-2);
        color: transparent;
        caret-color: var(--text-primary);
        cursor: pointer;
        box-sizing: border-box;
    }

    .agenda-team-combobox-input::placeholder {
        color: transparent;
    }

    .agenda-team-combobox-input:focus {
        outline: none;
        border-color: var(--primary-color);
        color: var(--text-primary);
    }

    .agenda-team-combobox-input:focus + .agenda-team-combobox-selected-label {
        opacity: 0;
    }

    .agenda-team-combobox-selected-label {
        position: absolute;
        left: 30px;
        right: 10px;
        font-size: 0.8rem;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        pointer-events: none;
        transition: opacity 0.1s;
    }

    .agenda-team-combobox-list {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        background: var(--bg-surface-1, #fff);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.12);
        max-height: 200px;
        overflow-y: auto;
        z-index: 200;
        padding: 4px 0;
        margin: 0;
        list-style: none;
    }

    .agenda-team-combobox-option {
        padding: 9px 14px;
        font-size: 0.82rem;
        cursor: pointer;
        color: var(--text-primary);
    }

    .agenda-team-combobox-option:hover,
    .agenda-team-combobox-option.is-focused {
        background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    }

    .agenda-team-combobox-option.is-selected {
        font-weight: 600;
        color: var(--brand-fg, var(--primary-color));
    }

    .agenda-team-combobox-option[hidden] {
        display: none;
    }

    .agenda-summary-card {
        min-height: 72px;
        padding: 10px 12px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), color-mix(in srgb, var(--bg-surface-2) 96%, white));
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
        text-align: left;
        color: var(--text-primary);
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.035);
    }

    .agenda-summary-card:active {
        transform: scale(0.98);
    }

    .agenda-summary-card.is-active {
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 45%, transparent);
    }

    .agenda-summary-label {
        font-size: 0.72rem;
        line-height: 1.28;
        color: var(--text-secondary);
    }

    .agenda-summary-value {
        font-size: 1.55rem;
        font-weight: 700;
        line-height: 1;
    }

    .agenda-summary-card.is-loading {
        opacity: 0.7;
    }

    .agenda-summary-card.is-loading .agenda-summary-value {
        font-size: 1rem;
        letter-spacing: 0.06em;
        color: var(--text-secondary);
    }

    .agenda-summary-urgent {
        border-color: rgba(249, 115, 22, 0.35);
        background: linear-gradient(180deg, rgba(255, 237, 213, 0.95), rgba(255, 255, 255, 0.96));
    }

    .agenda-summary-today {
        border-color: rgba(96, 165, 250, 0.35);
        background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.96));
    }

    .agenda-summary-done {
        border-color: rgba(110, 231, 183, 0.5);
        background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.96));
    }

    .tasks-stats-bar {
        display: none !important;
    }

    .agenda-view-toggle:not(.agenda-scope-toggle),
    #agenda-kanban-board {
        display: none !important;
    }

    #tasks-card-list {
        display: block !important;
    }

    .agenda-mobile-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        margin-bottom: 10px;
    }

    .agenda-mobile-toolbar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .agenda-mobile-search-shell {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        background: var(--bg-surface-2);
        border: 1px solid var(--border-color);
        border-radius: 14px;
    }

    .agenda-mobile-search-shell i {
        color: var(--text-secondary);
        font-size: 1rem;
        flex-shrink: 0;
    }

    .agenda-mobile-search-shell input {
        width: 100%;
        border: none;
        outline: none;
        background: transparent;
        color: var(--text-primary);
        font-size: 0.96rem;
        min-width: 0;
    }

    .agenda-mobile-refresh-btn {
        min-width: 52px;
        min-height: 52px;
        border-radius: 16px !important;
        padding: 0 14px !important;
    }

    .agenda-mobile-batch-btn {
        min-height: 44px;
        padding: 0 12px !important;
        border-radius: 14px !important;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        font-size: 0.88rem;
    }

    .agenda-mobile-batch-btn.is-active {
        color: var(--brand-fg, var(--primary-color));
        border-color: color-mix(in srgb, var(--primary-color) 45%, var(--border-color));
        background: color-mix(in srgb, var(--primary-color) 8%, var(--bg-surface-2));
    }

    .agenda-active-filters {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 4px;
    }

    .agenda-filter-chip-track {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        min-width: 0;
    }

    .agenda-filter-chip,
    .agenda-filter-clear-all {
        min-height: 34px;
        padding: 0 10px;
        border-radius: 999px;
        border: 1px solid var(--border-color);
        background: var(--bg-surface-2);
        color: var(--text-primary);
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.78rem;
        line-height: 1;
        white-space: nowrap;
    }

    .agenda-filter-chip i {
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

    .agenda-filter-clear-all {
        flex-shrink: 0;
        color: var(--brand-fg, var(--primary-color));
        border-color: color-mix(in srgb, var(--primary-color) 35%, var(--border-color));
    }

    .agenda-desktop-refresh-btn {
        display: none !important;
    }

    #task-list-header {
        display: none !important;
    }

    .agenda-mobile-simple-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .agenda-mobile-list-heading {
        padding: 0 2px;
    }

    .agenda-mobile-list-heading h4 {
        margin: 0;
        font-size: 1.24rem;
        line-height: 1.18;
        color: var(--text-primary);
    }

    .agenda-simple-card-stack {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .agenda-simple-card {
        position: relative;
        display: flex;
        align-items: stretch;
        gap: 8px;
        padding: 0;
        border-radius: 14px;
        border: 1px solid rgba(148, 163, 184, 0.24);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
        box-shadow: 0 7px 16px rgba(15, 23, 42, 0.04);
        overflow: hidden;
    }

    .agenda-simple-card-body {
        flex: 1;
        min-width: 0;
        padding: 13px 14px;
    }

    .agenda-simple-card-title {
        margin: 0;
        font-size: 0.96rem;
        line-height: 1.3;
        font-weight: 600;
        color: var(--text-primary);
    }

    .agenda-simple-card-description {
        margin: 4px 0 0;
        font-size: 0.8rem;
        line-height: 1.4;
        color: var(--text-secondary);
    }

    .agenda-simple-card-meta {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 4px;
        flex-wrap: nowrap;
        font-size: 0.75rem;
        color: var(--text-secondary);
        overflow: hidden;
    }

    .agenda-simple-card-project,
    .agenda-simple-card-pic {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .agenda-simple-card-project span,
    .agenda-simple-card-pic span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .agenda-simple-card .agenda-focus-deadline {
        display: inline-flex;
        flex-shrink: 0;
        margin-left: auto;
        margin-top: 0;
        min-height: 18px;
        font-size: 0.68rem;
        padding: 1px 7px;
        line-height: 1.4;
        border-radius: 10px;
    }

    .agenda-simple-card.tone-attention {
        border-color: rgba(251, 146, 60, 0.55);
        background: linear-gradient(180deg, rgba(255, 237, 213, 0.98), rgba(255, 249, 245, 0.96));
    }

    .agenda-simple-card.tone-progress {
        border-color: rgba(250, 204, 21, 0.58);
        background: linear-gradient(180deg, rgba(254, 249, 195, 0.96), rgba(255, 255, 255, 0.96));
    }

    .agenda-simple-card.tone-done {
        border-color: rgba(163, 230, 53, 0.58);
        background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(248, 255, 244, 0.96));
    }

    .agenda-simple-card.tone-planned {
        border-color: rgba(125, 211, 252, 0.42);
        background: linear-gradient(180deg, rgba(240, 249, 255, 0.95), rgba(255, 255, 255, 0.96));
    }

    .agenda-simple-select {
        display: flex;
        align-items: center;
        padding-left: 14px;
    }

    .tasks-filter-bar.filter-sheet-open .agenda-filter-toggle {
        color: var(--brand-fg, var(--primary-color));
        border-color: color-mix(in srgb, var(--primary-color) 45%, var(--border-color));
        background: color-mix(in srgb, var(--primary-color) 8%, var(--bg-surface-2));
    }
}

@media (min-width: 769px) {
    .agenda-mobile-summary,
    .agenda-mobile-toolbar,
    .agenda-mobile-overflow {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .agenda-mobile-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 8px;
    }

    .agenda-summary-card {
        min-height: 60px;
        padding: 9px;
        border-radius: 14px;
    }

    .agenda-summary-label {
        font-size: 0.66rem;
    }

    .agenda-summary-value {
        font-size: 1.08rem;
    }

    .agenda-active-filters {
        flex-direction: column;
    }

    .agenda-scope-context {
        padding: 8px 10px;
        font-size: 0.72rem;
        max-height: 3.1em;
    }

    .agenda-team-filter-chip {
        min-height: 34px;
        padding: 0 10px;
        font-size: 0.72rem;
    }

    .agenda-filter-clear-all {
        align-self: flex-start;
    }
}

/* =============================================
   P1 — MOBILE FOCUS LIST
   ============================================= */
.agenda-create-intro,
.agenda-detail-intro {
    margin-bottom: 12px;
}

.agenda-create-kicker,
.agenda-detail-intro-title,
.agenda-detail-overview-kicker,
.agenda-detail-sheet-kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.agenda-create-intro h4,
.agenda-detail-sheet h4 {
    margin: 4px 0 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.agenda-create-copy,
.agenda-detail-intro-copy {
    margin: 6px 0 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

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

.agenda-detail-grid-context {
    margin-top: 12px;
}

.agenda-create-feedback {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.agenda-detail-overview,
.agenda-detail-tabs,
.agenda-detail-sheet,
.agenda-detail-sheet-backdrop {
    display: none;
}

.agenda-detail-pane {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.agenda-detail-pane[hidden] {
    display: none;
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .agenda-focus-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .agenda-focus-section {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .agenda-focus-section-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .agenda-focus-section-kicker {
        margin: 0;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-secondary);
    }

    .agenda-focus-section-header h4 {
        margin: 4px 0 0;
        font-size: 1rem;
        color: var(--text-primary);
    }

    .agenda-focus-section-caption {
        margin: 4px 0 0;
        font-size: 0.82rem;
        line-height: 1.45;
        color: var(--text-secondary);
    }

    .agenda-focus-section-count {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: var(--bg-surface-2);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        font-size: 0.82rem;
        font-weight: 700;
    }

    .agenda-focus-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .agenda-focus-card {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
        border: 1px solid var(--border-color);
        border-radius: 20px;
        background: var(--bg-surface-1);
        box-shadow: var(--shadow-sm);
        cursor: pointer;
    }

    .agenda-focus-card.status-done {
        opacity: 0.78;
    }

    .agenda-focus-card-head,
    .agenda-focus-title-row,
    .agenda-focus-footer {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
    }

    .agenda-focus-card-badges,
    .agenda-focus-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        min-width: 0;
    }

    .agenda-focus-status,
    .agenda-focus-deadline,
    .agenda-focus-priority,
    .agenda-focus-meta-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 34px;
        padding: 0 10px;
        border-radius: 999px;
        font-size: 0.76rem;
        line-height: 1.2;
        border: 1px solid var(--border-color);
        background: var(--bg-surface-2);
        color: var(--text-secondary);
    }

    .agenda-focus-status.status-todo {
        color: #475569;
        background: rgba(148, 163, 184, 0.12);
        border-color: rgba(148, 163, 184, 0.24);
    }

    .agenda-focus-status.status-in_progress {
        color: #1d4ed8;
        background: rgba(59, 130, 246, 0.12);
        border-color: rgba(59, 130, 246, 0.24);
    }

    .agenda-focus-status.status-review {
        color: #b45309;
        background: rgba(245, 158, 11, 0.14);
        border-color: rgba(245, 158, 11, 0.26);
    }

    .agenda-focus-status.status-done {
        color: #047857;
        background: rgba(16, 185, 129, 0.14);
        border-color: rgba(16, 185, 129, 0.26);
    }

    .agenda-focus-deadline.tone-overdue {
        color: #b91c1c;
        background: rgba(239, 68, 68, 0.12);
        border-color: rgba(239, 68, 68, 0.24);
    }

    .agenda-focus-deadline.tone-today {
        color: #c2410c;
        background: rgba(249, 115, 22, 0.12);
        border-color: rgba(249, 115, 22, 0.24);
    }

    .agenda-focus-deadline.tone-soon,
    .agenda-focus-deadline.tone-week {
        color: #92400e;
        background: rgba(245, 158, 11, 0.12);
        border-color: rgba(245, 158, 11, 0.22);
    }

    .agenda-focus-priority.tone-critical {
        color: #b91c1c;
    }

    .agenda-focus-priority.tone-high {
        color: #c2410c;
    }

    .agenda-focus-priority.tone-medium {
        color: #a16207;
    }

    .agenda-focus-priority.tone-low {
        color: #475569;
    }

    .agenda-focus-select {
        width: 40px;
        height: 40px;
        display: none;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        background: var(--bg-surface-2);
        flex-shrink: 0;
    }

    .agenda-batch-mode .agenda-focus-select {
        display: inline-flex;
    }

    .agenda-focus-select input {
        width: 18px;
        height: 18px;
    }

    .agenda-focus-title {
        margin: 0;
        font-size: 1rem;
        line-height: 1.45;
        color: var(--text-primary);
        flex: 1;
    }

    .agenda-focus-card.status-done .agenda-focus-title {
        text-decoration: line-through;
    }

    .agenda-focus-description {
        margin: -2px 0 0;
        font-size: 0.88rem;
        line-height: 1.45;
        color: var(--text-secondary);
    }

    .agenda-focus-meta-item {
        max-width: 100%;
    }

    .agenda-focus-meta-item span:last-child {
        max-width: 24ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .agenda-focus-avatar {
        width: 24px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--primary-color);
        color: #fff;
        font-size: 0.68rem;
        font-weight: 700;
    }

    .agenda-focus-progress {
        padding: 10px 12px;
        border-radius: 16px;
        background: var(--bg-surface-2);
        border: 1px solid rgba(148, 163, 184, 0.18);
    }

    .agenda-focus-progress-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
        font-size: 0.76rem;
        color: var(--text-secondary);
    }

    .agenda-focus-progress-bar {
        height: 7px;
        border-radius: 999px;
        overflow: hidden;
        background: rgba(148, 163, 184, 0.22);
    }

    .agenda-focus-progress-fill {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 62%, white));
    }

    .agenda-focus-footer {
        align-items: center;
    }

    .agenda-focus-updated {
        font-size: 0.74rem;
        line-height: 1.4;
        color: var(--text-secondary);
    }

    .agenda-focus-primary-action {
        min-height: 44px;
        padding: 0 14px;
        border: none;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 0.82rem;
        font-weight: 600;
        color: #fff;
        background: var(--primary-color);
        box-shadow: var(--shadow-sm);
    }

    .agenda-focus-state {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .agenda-focus-state-empty,
    .agenda-focus-state-error,
    .agenda-focus-state-compact {
        align-items: center;
        min-height: 0;
        padding: 12px 14px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: var(--bg-surface-1);
        box-shadow: var(--shadow-sm);
    }

    .agenda-focus-state-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-surface-2);
        color: var(--brand-fg, var(--primary-color));
        font-size: 1.1rem;
    }

    .agenda-focus-state-copy h4 {
        margin: 0;
        font-size: 1rem;
        color: var(--text-primary);
    }

    .agenda-focus-state-copy p {
        margin: 6px 0 0;
        font-size: 0.88rem;
        line-height: 1.5;
        color: var(--text-secondary);
    }

    .agenda-focus-state-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .agenda-focus-skeleton-card {
        padding: 14px;
        border-radius: 20px;
        border: 1px solid rgba(148, 163, 184, 0.16);
        background: var(--bg-surface-1);
        box-shadow: var(--shadow-sm);
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .agenda-focus-skeleton-line,
    .agenda-focus-skeleton-pill,
    .agenda-focus-skeleton-button {
        display: block;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.26), rgba(148, 163, 184, 0.14));
        background-size: 200% 100%;
        animation: agenda-skeleton-shimmer 1.3s linear infinite;
    }

    .agenda-focus-skeleton-line {
        height: 12px;
    }

    .agenda-focus-skeleton-line.short { width: 34%; }
    .agenda-focus-skeleton-line.medium { width: 58%; }
    .agenda-focus-skeleton-line.long { width: 100%; }

    .agenda-focus-skeleton-pills,
    .agenda-focus-skeleton-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .agenda-focus-skeleton-pill {
        width: 96px;
        height: 30px;
    }

    .agenda-focus-skeleton-pill.wide {
        width: 132px;
    }

    .agenda-focus-skeleton-button {
        width: 92px;
        height: 42px;
    }

    .batch-action-bar.batch-mode-active {
        bottom: calc(88px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
        padding: 12px 14px;
        gap: 10px;
        border-color: color-mix(in srgb, var(--primary-color) 20%, var(--border-color));
    }

    .batch-action-bar.batch-mode-active .batch-count {
        width: 100%;
    }

    .batch-action-bar.batch-mode-active .form-select,
    .batch-action-bar.batch-mode-active .btn {
        min-height: 44px;
    }

    .batch-action-bar.batch-mode-active .form-select {
        flex: 1 1 180px;
    }

    .agenda-quick-grid,
    .agenda-detail-grid,
    .agenda-detail-summary-grid {
        grid-template-columns: 1fr;
    }

    .floating-panel-body {
        padding-bottom: 20px;
    }

    .floating-panel-footer {
        position: sticky;
        bottom: 0;
        z-index: 4;
        padding: 12px 16px calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
        background: linear-gradient(180deg, rgba(255,255,255,0.08), var(--bg-surface-2) 28%);
        box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
    }

    .floating-panel-footer .btn {
        min-height: 48px;
        justify-content: center;
    }

    .agenda-keyboard-active .floating-panel-footer,
    .agenda-modal.agenda-keyboard-active .modal-footer {
        box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.16);
    }

    .agenda-detail-overview {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 14px;
        margin-bottom: 12px;
        border: 1px solid var(--border-color);
        border-radius: 20px;
        background: linear-gradient(180deg, color-mix(in srgb, var(--primary-color) 6%, var(--bg-surface-2)), var(--bg-surface-1));
    }

    .agenda-detail-overview-copy,
    .agenda-detail-overview-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .agenda-detail-overview-content .detail-card {
        margin: 0;
        border-radius: 18px;
        background: var(--bg-surface-2);
    }

    .agenda-detail-overview-content textarea {
        min-height: 160px;
    }

    .agenda-detail-overview-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 0;
    }

    .agenda-detail-overview-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px;
        border-radius: 16px;
        background: var(--bg-surface-1);
        border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
    }

    .agenda-detail-overview-item span {
        font-size: 0.75rem;
        color: var(--text-secondary);
    }

    .agenda-detail-overview-item strong {
        font-size: 0.9rem;
        color: var(--text-primary);
        line-height: 1.35;
    }

    .agenda-detail-overview-item-wide {
        grid-column: 1 / -1;
    }

    .agenda-detail-overview-item-deadline strong {
        font-size: 1rem;
    }

    .agenda-detail-overview-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        gap: 10px;
    }

    .agenda-detail-overview-btn,
    .agenda-detail-overview-icon {
        min-height: 48px;
        border-radius: 16px !important;
        justify-content: center;
    }

    .agenda-detail-overview-icon {
        width: 48px;
        padding: 0 !important;
    }

    .agenda-detail-tabs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        margin-bottom: 12px;
        scrollbar-width: none;
    }

    .agenda-detail-tabs::-webkit-scrollbar {
        display: none;
    }

    .agenda-detail-tab {
        min-height: 42px;
        padding: 0 14px;
        border-radius: 999px;
        border: 1px solid var(--border-color);
        background: var(--bg-surface-2);
        color: var(--text-primary);
        font-size: 0.84rem;
        font-weight: 600;
        white-space: nowrap;
    }

    .agenda-detail-tab.is-active {
        color: var(--brand-fg, var(--primary-color));
        border-color: color-mix(in srgb, var(--primary-color) 38%, var(--border-color));
        background: color-mix(in srgb, var(--primary-color) 8%, var(--bg-surface-2));
    }

    .agenda-detail-pane {
        display: none;
    }

    .agenda-detail-pane.is-active {
        display: flex;
    }

    .agenda-modal-content {
        position: relative;
    }

    .agenda-modal .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding: 12px 16px calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        background: linear-gradient(180deg, rgba(255,255,255,0.06), var(--bg-surface-1) 24%);
        box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.1);
        flex-wrap: wrap !important;
    }

    .agenda-modal .modal-footer-spacer {
        display: none !important;
    }

    /* delete/done buttons: shown only when JS grants permission */
    #tasks-tab-delete-btn,
    #tasks-tab-mark-done-btn {
        display: none;
    }

    .agenda-modal .modal-footer .btn {
        min-height: 48px !important;
        justify-content: center;
    }

    .agenda-modal .modal-footer .btn-secondary {
        flex: 1 1 120px;
    }

    #tasks-tab-save-btn {
        flex: 1 1 100%;
        order: 2;
    }

    .agenda-detail-sheet-backdrop {
        position: absolute;
        inset: 0;
        z-index: 8;
        border: none;
        background: rgba(15, 23, 42, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }

    .agenda-detail-sheet-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .agenda-detail-sheet {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px 16px calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
        border-radius: 22px 22px 0 0;
        background: var(--bg-surface-1);
        box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.22);
        transform: translateY(calc(100% + 24px));
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    .agenda-detail-sheet.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .agenda-detail-sheet-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .agenda-detail-sheet-close {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border-color);
        border-radius: 14px;
        background: var(--bg-surface-2);
        color: var(--text-primary);
    }

    .agenda-detail-sheet-body {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .agenda-detail-sheet-body-stack {
        gap: 12px;
    }

    .agenda-detail-status-option,
    .agenda-detail-sheet-action {
        min-height: 52px;
        padding: 0 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        border-radius: 16px;
        border: 1px solid var(--border-color);
        background: var(--bg-surface-2);
        color: var(--text-primary);
        text-align: left;
        font-size: 0.88rem;
        font-weight: 600;
    }

    .agenda-detail-status-option.is-current {
        color: var(--brand-fg, var(--primary-color));
        border-color: color-mix(in srgb, var(--primary-color) 38%, var(--border-color));
    }

    .agenda-detail-status-option:disabled {
        opacity: 0.68;
    }

    .agenda-detail-sheet-action.danger {
        color: #b91c1c;
        border-color: rgba(239, 68, 68, 0.25);
        background: rgba(239, 68, 68, 0.08);
    }

    .agenda-detail-sheet-empty {
        margin: 0;
        padding: 12px 14px;
        border-radius: 16px;
        background: var(--bg-surface-2);
        color: var(--text-secondary);
        font-size: 0.88rem;
        line-height: 1.45;
    }

    @keyframes agenda-skeleton-shimmer {
        from { background-position: 200% 0; }
        to { background-position: -200% 0; }
    }
}

@media (min-width: 769px) {
    .agenda-detail-overview,
    .agenda-detail-sheet,
    .agenda-detail-sheet-backdrop,
    .agenda-detail-tabs {
        display: none !important;
    }

    .agenda-detail-pane,
    .agenda-detail-pane[hidden] {
        display: flex !important;
        flex-direction: column;
        gap: 14px;
    }
}

/* =============================================
   #1 — FULLSCREEN DETAIL MODAL (< 768px)
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .agenda-modal.active {
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    .agenda-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        animation: agenda-sheet-up 0.22s ease-out !important;
        transform: translateY(0) !important;
    }
    @keyframes agenda-sheet-up {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
    /* Remove drag handle */
    .agenda-modal-content::before {
        display: none !important;
    }
    .agenda-modal .modal-header {
        padding: 8px 16px 10px !important;
    }
    .agenda-modal .modal-title-input {
        font-size: 1.1rem !important;
    }
    .agenda-modal .modal-body {
        padding: 12px 16px !important;
        -webkit-overflow-scrolling: touch;
    }
    .agenda-modal .modal-footer {
        padding: 10px 16px !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }
    .agenda-modal .modal-footer .modal-footer-spacer {
        display: none !important;
    }
    .agenda-modal .modal-footer #tasks-tab-save-btn {
        flex: 1 1 100% !important;
        order: 3 !important;
    }
    .agenda-modal .modal-footer .btn-secondary {
        flex: 1 1 auto !important;
        order: 2 !important;
    }
    .agenda-modal .modal-footer #tasks-tab-delete-btn,
    .agenda-modal .modal-footer #tasks-tab-mark-done-btn {
        order: 1 !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    .agenda-modal .modal-footer .btn {
        padding: 10px 12px !important;
        min-height: 44px !important;
        font-size: 0.85rem !important;
    }
    /* Hide mobile bottom nav when agenda detail is open */
    body.agenda-detail-open .bottom-nav {
        display: none !important;
    }
}

/* =============================================
   #2 — HORIZONTAL SWIPEABLE KANBAN (< 768px)
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .agenda-kanban-board[style*="display: none"] {
        display: none !important;
        min-height: 0 !important;
        padding-bottom: 0 !important;
    }

    .agenda-kanban-board:not([style*="display: none"]) {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-snap-stop: always;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-x: contain;
        gap: 16px !important;
        padding-bottom: 8px !important;
        min-height: 0 !important;
        scrollbar-width: none;
    }
    .agenda-kanban-board:not([style*="display: none"])::-webkit-scrollbar {
        display: none;
    }
    .agenda-kanban-board .kanban-column {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
        overflow: hidden !important;
        scroll-snap-align: center !important;
        flex-shrink: 0 !important;
        border-radius: 24px !important;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
        border: 1px solid color-mix(in srgb, var(--border-color) 90%, transparent) !important;
        background: linear-gradient(180deg, var(--bg-surface-2), var(--bg-surface-1)) !important;
    }
    .agenda-kanban-board .kanban-column.is-active {
        border-color: color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
    }
    .agenda-kanban-board .kanban-column-header {
        position: sticky;
        top: 0;
        z-index: 2;
        gap: 10px;
        margin-bottom: 0 !important;
        padding: 14px 16px 12px !important;
        background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-2) 94%, white), var(--bg-surface-1));
        backdrop-filter: blur(10px);
    }
    .agenda-kanban-board .kanban-column.is-active .kanban-column-header {
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }
    .agenda-kanban-board .kanban-cards {
        flex: 0 1 auto;
        min-height: 0;
        max-height: clamp(180px, 32vh, 260px);
        overflow-y: auto;
        padding: 12px 14px 16px;
        -webkit-overflow-scrolling: touch;
    }
    .agenda-kanban-board .kanban-card {
        cursor: pointer;
        border-radius: 18px;
    }
    .agenda-kanban-board .kanban-card[draggable="false"] {
        cursor: pointer;
    }
    .agenda-kanban-board .kanban-card:hover {
        transform: none;
    }
    .agenda-kanban-board .kanban-collapse-btn {
        display: none !important;
    }

    .tasks-list-view .tasks-empty,
    .tasks-list-view .tasks-loading,
    .tasks-loading,
    .tasks-empty,
    .kanban-empty {
        min-height: 96px;
        padding: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .kanban-page-position {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        height: 26px;
        padding: 0 8px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-surface-1));
        color: var(--brand-fg, var(--primary-color));
        font-size: 0.72rem;
        font-weight: 700;
    }
    /* Dot indicator */
    .kanban-dot-indicator[style*="display: none"] {
        display: none !important;
    }
    .kanban-dot-indicator:not([style*="display: none"]) {
        display: flex !important;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0 0;
    }
    .kanban-dot {
        appearance: none;
        border: none;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--border-color);
        transition: all 0.25s;
        cursor: pointer;
    }
    .kanban-dot.active {
        width: 22px;
        border-radius: 4px;
        background: var(--primary-color);
    }
    .kanban-card-quick-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
    }
    .kanban-card-quick-actions .btn-quick {
        min-height: 36px;
        padding: 0 12px;
        border-radius: 999px;
    }
    .kanban-card-quick-status {
        background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-surface-1));
        color: var(--brand-fg, var(--primary-color));
        border-color: color-mix(in srgb, var(--primary-color) 28%, var(--border-color));
    }
    .kanban-card-quick-detail {
        color: var(--text-secondary);
    }
    .kanban-column.touch-drop-target,
    .kanban-card.touch-selected {
        outline: none !important;
        box-shadow: none !important;
        transform: none !important;
    }
    .kanban-column.touch-drop-target .kanban-column-header::after {
        content: none !important;
    }
}
@media (min-width: 769px) {
    .kanban-dot-indicator { display: none !important; }
}

/* =============================================
   #3 — FLAT CREATE FORM (All fields visible)
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Header: full primary color background */
    #tasks-create-card .floating-panel-header {
        background: var(--primary-color);
        border-bottom: none;
        cursor: default;
        padding: 14px 16px;
    }
    #tasks-create-card .floating-panel-title {
        color: #fff;
        font-size: 1rem;
        font-weight: 700;
    }
    #tasks-create-card .floating-panel-title i {
        color: rgba(255, 255, 255, 0.85);
    }
    #tasks-create-card .floating-panel-btn {
        color: rgba(255, 255, 255, 0.85);
        border-color: rgba(255, 255, 255, 0.25);
    }
    #tasks-create-card .floating-panel-btn:hover,
    #tasks-create-card .floating-panel-btn:active {
        color: #fff;
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.5);
    }

    /* Flat layout: all form children stack with consistent gap */
    #tasks-create-form > .form-group {
        margin-bottom: 12px;
    }
    #tasks-create-form > .agenda-quick-grid,
    #tasks-create-form > .agenda-detail-grid {
        margin-bottom: 12px;
    }

    /* 2-col grids */
    #tasks-create-form .agenda-quick-grid,
    #tasks-create-form .agenda-detail-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Make textarea shorter on mobile */
    .tasks-create-card #tasks-create-description {
        min-height: 60px !important;
    }

    /* Opsi Lanjutan — styled collapsible row */
    #tasks-create-form .advanced-section > summary {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        background: var(--bg-surface-2);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-secondary);
        cursor: pointer;
        list-style: none;
        transition: background 0.2s, color 0.2s;
    }
    #tasks-create-form .advanced-section > summary::-webkit-details-marker {
        display: none;
    }
    #tasks-create-form .advanced-section[open] > summary {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        background: color-mix(in srgb, var(--primary-color) 8%, var(--bg-surface-2));
        color: var(--brand-fg, var(--primary-color));
    }
    #tasks-create-form .advanced-section .advanced-content {
        padding: 12px;
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        background: var(--bg-surface-1);
    }
}
@media (min-width: 769px) {
    .agenda-expand-btn { display: none !important; }
}

/* =============================================
   #4 — COMPACT STATS BAR (< 480px)
   ============================================= */
@media (max-width: 600px) and (hover: none) and (pointer: coarse) {
    .tasks-stats-bar {
        display: none !important;
    }
    .tasks-stat-item {
        min-width: 0 !important;
        padding: 8px 6px !important;
        border-left-width: 3px !important;
    }
    .tasks-stat-item .stat-value {
        font-size: 1.15rem !important;
    }
    .tasks-stat-item .stat-label {
        font-size: 0.65rem !important;
        letter-spacing: 0.3px !important;
    }
}
@media (max-width: 380px) {
    .tasks-stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* =============================================
   #5 — COLLAPSIBLE FILTER BAR (< 768px)
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .agenda-scope-bar {
        flex-wrap: wrap;
    }
    .agenda-scope-bar-filters {
        display: none !important;
    }
    .tasks-filters-row {
        display: none !important;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1115;
        max-height: min(72vh, 620px);
        overflow-y: auto;
        padding: 18px 16px calc(18px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        margin: 0 !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 22px 22px 0 0 !important;
        background: var(--bg-surface-1);
        box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.16);
        opacity: 0;
        transform: translateY(calc(100% + 24px));
        pointer-events: none;
        transition: transform 0.28s ease, opacity 0.22s ease;
    }
    .tasks-filters-row.filters-visible {
        display: flex !important;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    .tasks-filters-row .filter-group {
        width: 100%;
    }
    .tasks-filters-row .search-group {
        min-width: 0 !important;
        width: 100%;
    }
    .agenda-filter-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1110;
        border: none;
        background: rgba(15, 23, 42, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }
    .agenda-filter-sheet-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .agenda-filter-sheet-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
    }
    .agenda-filter-sheet-header-actions {
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }
    .agenda-filter-sheet-kicker {
        margin: 0;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-secondary);
    }
    .agenda-filter-sheet-title h4 {
        margin: 4px 0 0;
        font-size: 1rem;
        color: var(--text-primary);
    }
    .agenda-filter-sheet-close {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border-color);
        border-radius: 14px;
        background: var(--bg-surface-2);
        color: var(--text-primary);
    }
    .agenda-filter-sheet-refresh {
        min-height: 42px;
        padding: 0 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border: 1px solid var(--border-color);
        border-radius: 14px;
        background: var(--bg-surface-2);
        color: var(--text-primary);
    }
    .agenda-filter-sheet-section {
        margin-bottom: 16px;
        padding: 14px;
        border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
        border-radius: 18px;
        background: color-mix(in srgb, var(--bg-surface-2) 72%, white);
    }
    .agenda-filter-sheet-section-head h5 {
        margin: 0;
        font-size: 0.92rem;
        color: var(--text-primary);
    }
    .agenda-filter-sheet-section-head p {
        margin: 4px 0 0;
        font-size: 0.8rem;
        line-height: 1.45;
        color: var(--text-secondary);
    }
    .agenda-filter-sheet-section-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 12px;
    }
    .agenda-filter-sheet-section-body .filter-group {
        margin: 0;
    }
    .agenda-filter-sheet-section-body .filter-group label {
        margin-bottom: 6px;
    }
    .agenda-filter-quick-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .agenda-filter-quick-btn {
        min-height: 42px;
        padding: 0 14px;
        border-radius: 999px;
        border: 1px solid var(--border-color);
        background: var(--bg-surface-1);
        color: var(--text-primary);
        font-size: 0.84rem;
        font-weight: 600;
    }
    .agenda-filter-quick-btn.is-active {
        color: var(--brand-fg, var(--primary-color));
        border-color: color-mix(in srgb, var(--primary-color) 42%, var(--border-color));
        background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-surface-1));
    }
    .agenda-filter-sheet-actions {
        position: sticky;
        bottom: calc(-18px - var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 16px;
        padding-top: 12px;
        padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--bg-surface-1) 30%);
    }
    .agenda-filter-sheet-actions .btn-secondary,
    .agenda-filter-sheet-actions .btn-primary {
        min-height: 48px;
        justify-content: center;
    }
    .agenda-filter-toggle {
        display: none !important;
    }
    .agenda-filter-toggle:active {
        background: var(--bg-surface-1);
    }
    .agenda-filter-toggle .filter-badge {
        background: var(--primary-color);
        color: white;
        font-size: 0.7rem;
        font-weight: 700;
        border-radius: 10px;
        padding: 2px 7px;
        min-width: 18px;
        text-align: center;
    }
    body.agenda-filter-sheet-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .agenda-scope-bar-filters {
        display: none !important;
    }
}
@media (min-width: 769px) {
    .agenda-filter-sheet-backdrop { display: none !important; }
    .agenda-filter-sheet-header,
    .agenda-filter-sheet-actions { display: none !important; }
    .agenda-filter-toggle { display: none !important; }
    .agenda-filter-sheet-quick,
    .agenda-filter-sheet-category { display: none !important; }
    .tasks-filters-row {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }
}

/* =============================================
   #6 — SWIPE-TO-ACTION TASK CARDS
   ============================================= */
.task-card-swipe-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}
.task-card-swipe-wrapper .swipe-action-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.task-card-swipe-wrapper .swipe-action-left {
    right: 0;
    justify-content: flex-end;
    background: linear-gradient(90deg, transparent, #ef4444 60%);
}
.task-card-swipe-wrapper .swipe-action-right {
    left: 0;
    justify-content: flex-start;
    background: linear-gradient(-90deg, transparent, #10b981 60%);
}
.task-card-swipe-wrapper.swiping .swipe-action-bg {
    opacity: 1;
}
.task-card-swipe-wrapper .task-card {
    position: relative;
    z-index: 1;
    transition: transform 0.15s ease-out;
}
/* Kanban cards — also swipeable */
.kanban-card-swipe-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 8px;
}
.kanban-card-swipe-wrapper .swipe-action-bg {
    position: absolute;
    top: 0; bottom: 0; width: 100%;
    display: flex; align-items: center;
    padding: 0 16px;
    font-size: 1.1rem; font-weight: 600; color: white;
    opacity: 0; transition: opacity 0.15s;
    pointer-events: none;
}
.kanban-card-swipe-wrapper .swipe-action-right {
    left: 0; justify-content: flex-start;
    background: linear-gradient(-90deg, transparent, #10b981 60%);
}
.kanban-card-swipe-wrapper .swipe-action-left {
    right: 0; justify-content: flex-end;
    background: linear-gradient(90deg, transparent, #3b82f6 60%);
}
.kanban-card-swipe-wrapper.swiping .swipe-action-bg { opacity: 1; }
.kanban-card-swipe-wrapper .kanban-card {
    position: relative; z-index: 1;
    transition: transform 0.15s ease-out;
    margin-bottom: 0;
}

/* =============================================
   #7 — FAB CREATE BUTTON (< 768px)
   ============================================= */
.agenda-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 1120;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.25s;
    align-items: center;
    justify-content: center;
}
.agenda-fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.agenda-fab.fab-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}
.agenda-fab.fab-footer-clear {
    opacity: 0;
    pointer-events: none;
    transform: translateY(28px);
}
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .agenda-fab {
        display: flex;
        bottom: calc(80px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }
    /* Hide desktop "Tambah Agenda" button on mobile — FAB is injected by agenda-mobile-ux.js */
    .tasks-tab-header .btn-primary[data-call="toggleTasksCreateForm"] {
        display: none !important;
    }
}
/* Fallback: hide header button on any narrow viewport (incl. DevTools simulation) */
@media (max-width: 768px) {
    .tasks-tab-header .btn-primary[data-call="toggleTasksCreateForm"] {
        display: none !important;
    }
}

/* =============================================
   #8 — OFFLINE QUEUE INDICATOR
   ============================================= */
.agenda-offline-banner {
    display: none;
    padding: 8px 14px;
    background: #fef3c7;
    color: #92400e;
    border-radius: var(--border-radius);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.agenda-offline-banner.visible {
    display: flex;
}
[data-theme="dark"] .agenda-offline-banner {
    background: rgba(254, 243, 199, 0.12);
    color: #fbbf24;
}

/* =============================================
   #9 — COMPANY TABLE → CARD LAYOUT (< 768px)
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #company-tasks-section .table-wrapper { overflow-x: visible; }
    #company-tasks-table { display: none !important; }
    .company-tasks-card-list {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }
    .company-task-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px;
        background: var(--bg-surface-1);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        border-left: 4px solid var(--text-secondary);
        cursor: pointer;
        transition: box-shadow 0.2s;
    }
    .company-task-card:active {
        box-shadow: 0 0 0 2px var(--primary-color);
    }
    .company-task-card.priority-critical { border-left-color: var(--error-solid, #b91c1c); }
    .company-task-card.priority-high     { border-left-color: var(--safety-bg, #e85d04); }
    .company-task-card.priority-medium   { border-left-color: var(--warning-solid, #a16207); }
    .company-task-card.priority-low      { border-left-color: #6b7280; }
    .company-task-card-content {
        flex: 1;
        min-width: 0;
    }
    .company-task-card-title {
        font-size: 0.92rem;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .company-task-card-meta {
        font-size: 0.78rem;
        color: var(--text-secondary);
        margin-top: 2px;
    }
    .company-task-card-status {
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 0.72rem;
        font-weight: 700;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .company-task-card-status.done       { background: var(--success-bg, rgba(34,197,94,0.12)); color: var(--success-text, #166534); }
    .company-task-card-status.pending     { background: var(--warning-bg, rgba(234,179,8,0.12)); color: var(--warning-text, #854d0e); }
    .company-task-card-status.inprogress  { background: var(--info-bg, rgba(59,130,246,0.12)); color: var(--info-text, #1d4ed8); }
    .company-task-card-status.overdue     { background: var(--error-bg, rgba(239,68,68,0.12)); color: var(--error-text, #991b1b); }
}
@media (min-width: 769px) {
    .company-tasks-card-list { display: none !important; }
}

/* =============================================
   #10 — MENTION KEYBOARD-AWARE (< 768px)
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .mention-dropdown,
    .mention-suggestions {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        max-height: 45vh !important;
        border-radius: 12px 12px 0 0 !important;
        box-shadow: 0 -6px 20px rgba(0,0,0,0.2) !important;
        z-index: 2000 !important;
        margin: 0 !important;
    }
    .mention-dropdown-item {
        min-height: 48px !important;
        padding: 12px 16px !important;
    }
}

/* =============================================
   #11 — INFINITE SCROLL SENTINEL
   ============================================= */
.agenda-scroll-sentinel {
    grid-column: 1 / -1;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agenda-scroll-sentinel .loading-dots {
    display: flex;
    gap: 4px;
}
.agenda-scroll-sentinel .loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: dotPulse 1.2s infinite;
}
.agenda-scroll-sentinel .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.agenda-scroll-sentinel .loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}
/* Hide desktop pagination on mobile */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .tasks-tab-pagination { display: none !important; }
}

/* =============================================
   #12 — HAPTIC & VISUAL FEEDBACK
   ============================================= */
/* Skeleton loading cards */
.agenda-skeleton-card {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    border-left: 4px solid var(--border-color);
}
.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-surface-1) 50%, var(--bg-surface-2) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w30 { width: 30%; }
.skeleton-line:last-child { margin-bottom: 0; }
@keyframes skeletonShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Smooth state change transitions on cards */
.task-card, .kanban-card {
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s, background 0.3s;
}
.task-card.completing {
    opacity: 0.5;
    transform: scale(0.97);
}
.kanban-card.completing {
    opacity: 0.5;
    transform: scale(0.97);
}

/* Pull-to-refresh hint (mobile) */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .agenda-pull-refresh {
        text-align: center;
        padding: 10px;
        color: var(--text-secondary);
        font-size: 0.8rem;
        opacity: 0;
        transition: opacity 0.2s;
    }
    .agenda-pull-refresh.visible {
        opacity: 1;
    }
}

/* =============================================
   GENERAL MOBILE POLISH for Agenda Tab
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Tighter header */
    .tasks-tab-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .tasks-tab-header h3 {
        font-size: 1.1rem;
    }
    /* View toggle smaller */
    .agenda-view-toggle .view-toggle-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 4px;
    }
    .agenda-view-toggle .view-toggle-btn i {
        font-size: 0.9rem;
    }
    /* Batch action bar full width */
    .batch-action-bar {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }
    .batch-action-bar select { width: 100%; }
    /* Pagination touch-friendly */
    .tasks-tab-pagination .btn-secondary {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
    }
}

/* =============================================
   Agenda Mobile Preview Mode
   Dev validation path without viewport forcing
   ============================================= */
html.agenda-mobile-preview body::before {
    content: 'Agenda Mobile Preview';
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1200;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
}

html.agenda-mobile-preview #tasks-tab {
    max-width: min(100%, var(--agenda-mobile-preview-width, 390px));
    margin-left: auto;
    margin-right: auto;
    padding-bottom: calc(104px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
}

html.agenda-mobile-preview .app-footer {
    margin-top: 18px;
    padding-top: 14px;
}

html.agenda-mobile-preview #main-app.dashboard-container {
    grid-template-columns: 1fr !important;
    padding-bottom: calc(76px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
}

html.agenda-mobile-preview .app-sidebar {
    display: none !important;
}

html.agenda-mobile-preview .app-header {
    grid-column: 1;
    padding: 0 16px;
}

html.agenda-mobile-preview .tasks-tab-title-block {
    min-width: 0;
    flex: 1;
}

html.agenda-mobile-preview .tasks-tab-title-block h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    color: var(--brand-fg, var(--primary-color));
}

html.agenda-mobile-preview .tasks-tab-subtitle {
    display: none;
}

html.agenda-mobile-preview .tasks-tab-header {
    flex-wrap: wrap;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
}

html.agenda-mobile-preview .tasks-tab-actions,
html.agenda-mobile-preview .agenda-mobile-toolbar,
html.agenda-mobile-preview .agenda-mobile-toolbar-actions,
html.agenda-mobile-preview .agenda-focus-list,
html.agenda-mobile-preview .agenda-focus-section,
html.agenda-mobile-preview .agenda-focus-cards,
html.agenda-mobile-preview .agenda-detail-pane,
html.agenda-mobile-preview .agenda-filter-sheet-section-body,
html.agenda-mobile-preview .agenda-filter-quick-list,
html.agenda-mobile-preview .kanban-card-quick-actions,
html.agenda-mobile-preview .tasks-create-card .agenda-quick-fields {
    display: flex;
}

html.agenda-mobile-preview .agenda-mobile-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 6px;
}

html.agenda-mobile-preview .tasks-tab-actions {
    width: 100%;
}

html.agenda-mobile-preview .tasks-stats-bar,
html.agenda-mobile-preview .tasks-tab-header .btn-primary[data-call="toggleTasksCreateForm"],
html.agenda-mobile-preview #task-list-header {
    display: none !important;
}

html.agenda-mobile-preview .agenda-view-toggle:not(.agenda-scope-toggle),
html.agenda-mobile-preview #agenda-kanban-board {
    display: none !important;
}

html.agenda-mobile-preview .agenda-mobile-summary {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

html.agenda-mobile-preview .agenda-scope-context {
    display: block !important;
    margin-bottom: 12px;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--primary-color) 18%, var(--border-color));
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-2) 94%, white), var(--bg-surface-1));
    color: var(--text-secondary);
    font-size: 0.83rem;
    line-height: 1.45;
}

html.agenda-mobile-preview #tasks-card-list {
    display: block !important;
}

html.agenda-mobile-preview .agenda-scope-toggle {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
    padding: 0;
    margin-bottom: 8px;
    background: transparent;
    border-radius: 0;
}

html.agenda-mobile-preview .agenda-scope-toggle::-webkit-scrollbar {
    display: none;
}

html.agenda-mobile-preview .agenda-scope-toggle .view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 10px;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-surface-1);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    color: var(--text-secondary);
}

html.agenda-mobile-preview .agenda-scope-toggle .view-toggle-btn.active {
    border-color: transparent;
    background: color-mix(in srgb, var(--primary-color) 92%, white);
    color: #fff;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--primary-color) 24%, transparent);
}

html.agenda-mobile-preview .agenda-scope-count-badge {
    display: none !important;
}

html.agenda-mobile-preview .agenda-summary-card {
    min-height: 82px;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), color-mix(in srgb, var(--bg-surface-2) 96%, white));
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

html.agenda-mobile-preview .agenda-summary-label {
    font-size: 0.78rem;
}

html.agenda-mobile-preview .agenda-summary-value {
    font-size: 2rem;
}

html.agenda-mobile-preview .agenda-summary-urgent {
    border-color: rgba(249, 115, 22, 0.35);
    background: linear-gradient(180deg, rgba(255, 237, 213, 0.95), rgba(255, 255, 255, 0.96));
}

html.agenda-mobile-preview .agenda-summary-today {
    border-color: rgba(96, 165, 250, 0.35);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.96));
}

html.agenda-mobile-preview .agenda-summary-done {
    border-color: rgba(110, 231, 183, 0.5);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.96));
}

html.agenda-mobile-preview .agenda-mobile-list-heading {
    padding: 2px 2px 0;
}

html.agenda-mobile-preview .agenda-mobile-list-heading h4 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.15;
    color: var(--text-primary);
}

html.agenda-mobile-preview .agenda-mobile-simple-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

html.agenda-mobile-preview .agenda-simple-card-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html.agenda-mobile-preview .agenda-simple-card {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 0;
    border-radius: 16px;
    border: 2px solid rgba(148, 163, 184, 0.26);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

html.agenda-mobile-preview .agenda-simple-card-body {
    flex: 1;
    min-width: 0;
    padding: 16px 18px;
}

html.agenda-mobile-preview .agenda-simple-card-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--text-primary);
}

html.agenda-mobile-preview .agenda-simple-card-description {
    margin: 6px 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

html.agenda-mobile-preview .agenda-simple-card.tone-attention {
    border-color: rgba(251, 146, 60, 0.55);
    background: linear-gradient(180deg, rgba(255, 237, 213, 0.98), rgba(255, 249, 245, 0.96));
}

html.agenda-mobile-preview .agenda-simple-card.tone-progress {
    border-color: rgba(250, 204, 21, 0.58);
    background: linear-gradient(180deg, rgba(254, 249, 195, 0.96), rgba(255, 255, 255, 0.96));
}

html.agenda-mobile-preview .agenda-simple-card.tone-done {
    border-color: rgba(163, 230, 53, 0.58);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(248, 255, 244, 0.96));
}

html.agenda-mobile-preview .agenda-simple-card.tone-planned {
    border-color: rgba(125, 211, 252, 0.42);
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.95), rgba(255, 255, 255, 0.96));
}

html.agenda-mobile-preview .agenda-simple-select {
    display: flex;
    align-items: center;
    padding-left: 14px;
}

html.agenda-mobile-preview .agenda-summary-card.is-loading {
    opacity: 0.7;
}

html.agenda-mobile-preview .agenda-summary-card.is-loading .agenda-summary-value {
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

html.agenda-mobile-preview .agenda-mobile-overflow {
    display: block !important;
    margin-left: auto;
    position: relative;
}

html.agenda-mobile-preview .agenda-mobile-overflow summary {
    list-style: none;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

html.agenda-mobile-preview .agenda-mobile-overflow summary::-webkit-details-marker {
    display: none;
}

html.agenda-mobile-preview .bottom-nav {
    display: block !important;
}

html.agenda-mobile-preview .bottom-nav-item[data-tab="user-tab"],
html.agenda-mobile-preview .bottom-nav-item[data-tab="tasks-tab"] {
    display: flex !important;
}

html.agenda-mobile-preview .bottom-nav-item[data-tab="mobile-notifikasi"],
html.agenda-mobile-preview .bottom-nav-item[data-tab="company-tab"] {
    display: none !important;
}

html.agenda-mobile-preview .agenda-mobile-overflow-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
}

html.agenda-mobile-preview .agenda-mobile-overflow-menu .btn {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
}

html.agenda-mobile-preview .agenda-mobile-search-shell,
html.agenda-mobile-preview .agenda-filter-toggle,
html.agenda-mobile-preview .agenda-mobile-batch-btn,
html.agenda-mobile-preview .agenda-mobile-refresh-btn {
    min-height: 44px;
    border-radius: 16px !important;
}

html.agenda-mobile-preview .agenda-mobile-search-shell input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px !important;
    line-height: 1.35;
    min-width: 0;
}

html.agenda-mobile-preview .agenda-filter-toggle {
    display: none !important;
}

html.agenda-mobile-preview .agenda-active-filters {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

html.agenda-mobile-preview .agenda-focus-list,
html.agenda-mobile-preview .agenda-focus-section,
html.agenda-mobile-preview .agenda-focus-cards,
html.agenda-mobile-preview .agenda-detail-pane,
html.agenda-mobile-preview .agenda-filter-sheet-section-body,
html.agenda-mobile-preview .tasks-create-card .agenda-quick-fields {
    flex-direction: column;
}

html.agenda-mobile-preview .agenda-focus-list {
    gap: 16px;
}

html.agenda-mobile-preview .agenda-focus-section {
    gap: 10px;
}

html.agenda-mobile-preview .agenda-focus-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-surface-1);
    box-shadow: var(--shadow-sm);
}

html.agenda-mobile-preview .agenda-focus-card-head,
html.agenda-mobile-preview .agenda-focus-title-row,
html.agenda-mobile-preview .agenda-focus-footer,
html.agenda-mobile-preview .agenda-focus-card-badges,
html.agenda-mobile-preview .agenda-focus-meta,
html.agenda-mobile-preview .agenda-detail-overview-actions,
html.agenda-mobile-preview .agenda-filter-sheet-header,
html.agenda-mobile-preview .agenda-filter-sheet-header-actions,
html.agenda-mobile-preview .agenda-detail-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

html.agenda-mobile-preview .agenda-focus-card-badges,
html.agenda-mobile-preview .agenda-focus-meta {
    flex-wrap: wrap;
}

html.agenda-mobile-preview .agenda-simple-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: nowrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
}

html.agenda-mobile-preview .agenda-simple-card-project,
html.agenda-mobile-preview .agenda-simple-card-pic {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.agenda-mobile-preview .agenda-simple-card .agenda-focus-deadline {
    display: inline-flex;
    flex-shrink: 0;
    margin-left: auto;
    margin-top: 0;
    min-height: 18px;
    font-size: 0.68rem;
    padding: 1px 7px;
    line-height: 1.4;
    border-radius: 10px;
}

html.agenda-mobile-preview .agenda-focus-status,
html.agenda-mobile-preview .agenda-focus-deadline,
html.agenda-mobile-preview .agenda-focus-priority,
html.agenda-mobile-preview .agenda-focus-meta-item,
html.agenda-mobile-preview .agenda-filter-chip,
html.agenda-mobile-preview .agenda-filter-clear-all,
html.agenda-mobile-preview .agenda-filter-quick-btn,
html.agenda-mobile-preview .kanban-page-position {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-2);
}

html.agenda-mobile-preview .agenda-batch-mode .agenda-focus-select {
    display: inline-flex;
}

html.agenda-mobile-preview .agenda-detail-overview,
html.agenda-mobile-preview .agenda-detail-tabs {
    display: block;
}

html.agenda-mobile-preview .agenda-detail-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary-color) 6%, var(--bg-surface-2)), var(--bg-surface-1));
}

html.agenda-mobile-preview .agenda-detail-overview-copy,
html.agenda-mobile-preview .agenda-detail-overview-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html.agenda-mobile-preview .agenda-detail-overview-content .detail-card {
    margin: 0;
    border-radius: 18px;
    background: var(--bg-surface-2);
}

html.agenda-mobile-preview .agenda-detail-overview-content textarea {
    min-height: 160px;
}

html.agenda-mobile-preview .agenda-detail-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
}

html.agenda-mobile-preview .agenda-detail-overview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--bg-surface-1);
    border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
}

html.agenda-mobile-preview .agenda-detail-overview-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

html.agenda-mobile-preview .agenda-detail-overview-item strong {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.35;
}

html.agenda-mobile-preview .agenda-detail-overview-item-wide {
    grid-column: 1 / -1;
}

html.agenda-mobile-preview .agenda-detail-overview-item-deadline strong {
    font-size: 1rem;
}

html.agenda-mobile-preview .agenda-detail-overview-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

html.agenda-mobile-preview .agenda-detail-overview-btn,
html.agenda-mobile-preview .agenda-detail-overview-icon {
    min-height: 48px;
    border-radius: 16px !important;
    justify-content: center;
}

html.agenda-mobile-preview .agenda-detail-overview-icon {
    width: 48px;
    padding: 0 !important;
}

html.agenda-mobile-preview .agenda-detail-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 12px;
    scrollbar-width: none;
}

html.agenda-mobile-preview .agenda-detail-pane {
    display: none;
}

html.agenda-mobile-preview .agenda-detail-pane.is-active {
    display: flex;
}

html.agenda-mobile-preview .agenda-detail-sheet-backdrop {
    position: absolute;
    inset: 0;
    z-index: 8;
    border: none;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    pointer-events: none;
}

html.agenda-mobile-preview .agenda-detail-sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

html.agenda-mobile-preview .agenda-detail-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    border-radius: 22px 22px 0 0;
    background: var(--bg-surface-1);
    box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.22);
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
}

html.agenda-mobile-preview .agenda-detail-sheet.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

html.agenda-mobile-preview .agenda-kanban-board[style*="display: none"] {
    display: none !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
}

html.agenda-mobile-preview .agenda-kanban-board:not([style*="display: none"]) {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain;
    gap: 16px !important;
    padding-bottom: 8px !important;
    min-height: 0 !important;
    scrollbar-width: none;
}

html.agenda-mobile-preview .agenda-kanban-board .kanban-column {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    scroll-snap-align: center !important;
    flex-shrink: 0 !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    border: 1px solid color-mix(in srgb, var(--border-color) 90%, transparent) !important;
    background: linear-gradient(180deg, var(--bg-surface-2), var(--bg-surface-1)) !important;
}

html.agenda-mobile-preview .agenda-kanban-board .kanban-column-header {
    position: sticky;
    top: 0;
    z-index: 2;
    gap: 10px;
    margin-bottom: 0 !important;
    padding: 14px 16px 12px !important;
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface-2) 94%, white), var(--bg-surface-1));
}

html.agenda-mobile-preview .agenda-kanban-board .kanban-cards {
    flex: 0 1 auto;
    min-height: 0;
    max-height: clamp(180px, 32vh, 260px);
    overflow-y: auto;
    padding: 12px 14px 16px;
    -webkit-overflow-scrolling: touch;
}

html.agenda-mobile-surface #tasks-stats-bar,
html.agenda-mobile-preview #tasks-stats-bar {
    display: none !important;
}

html.agenda-mobile-surface .tasks-filter-bar {
    margin-bottom: 12px !important;
}

html.agenda-mobile-surface .agenda-view-toggle.agenda-scope-toggle,
html.agenda-mobile-preview .agenda-view-toggle.agenda-scope-toggle {
    margin-bottom: 12px !important;
}

html.agenda-mobile-surface .agenda-focus-list > .agenda-focus-section:only-child,
html.agenda-mobile-preview .agenda-focus-list > .agenda-focus-section:only-child {
    gap: 0 !important;
}

html.agenda-mobile-surface .agenda-focus-list > .agenda-focus-section:only-child .agenda-focus-section-header,
html.agenda-mobile-preview .agenda-focus-list > .agenda-focus-section:only-child .agenda-focus-section-header {
    display: none !important;
}

html.agenda-mobile-preview .agenda-kanban-board .kanban-collapse-btn {
    display: none !important;
}

html.agenda-mobile-preview .kanban-dot-indicator[style*="display: none"] {
    display: none !important;
}

html.agenda-mobile-preview .kanban-dot-indicator:not([style*="display: none"]) {
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 0;
}

html.agenda-mobile-preview .kanban-dot.active {
    width: 22px;
    border-radius: 4px;
    background: var(--primary-color);
}

html.agenda-mobile-preview .tasks-create-card .agenda-detail-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s;
    opacity: 0;
}

html.agenda-mobile-preview .tasks-create-card .agenda-detail-fields.expanded {
    max-height: 2000px;
    opacity: 1;
}

html.agenda-mobile-preview .agenda-expand-btn,
html.agenda-mobile-preview .agenda-fab {
    display: flex !important;
}

html.agenda-mobile-preview .agenda-fab {
    bottom: calc(80px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
}

html.agenda-mobile-preview .tasks-filters-row {
    display: none !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1115;
    max-height: min(72vh, 620px);
    overflow-y: auto;
    padding: 18px 16px calc(18px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    margin: 0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 22px 22px 0 0 !important;
    background: var(--bg-surface-1);
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.16);
    opacity: 0;
    transform: translateY(calc(100% + 24px));
    pointer-events: none;
}

html.agenda-mobile-preview .tasks-filters-row.filters-visible {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

html.agenda-mobile-preview .agenda-filter-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1110;
    border: none;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    pointer-events: none;
}

html.agenda-mobile-preview .agenda-filter-sheet-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

html.agenda-mobile-preview body.agenda-filter-sheet-open {
    overflow: hidden;
}

/* =============================================
   MOBILE SURFACE = PREVIEW-APPROVED AGENDA UI
   Keep preview shell optional, but make real mobile
   use the same agenda workspace visuals.
   ============================================= */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 6px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-actions {
    width: 100%;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-stats-bar,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-header .btn-primary[data-call="toggleTasksCreateForm"],
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #task-list-header,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-view-toggle:not(.agenda-scope-toggle),
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-kanban-board,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .kanban-dot-indicator {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-card-list {
    display: block !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
    padding: 0;
    margin-bottom: 8px;
    background: transparent;
    border-radius: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle::-webkit-scrollbar {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle .view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 10px;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-surface-1);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    color: var(--text-secondary);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle .view-toggle-btn.active {
    border-color: transparent;
    background: color-mix(in srgb, var(--primary-color) 92%, white);
    color: #fff;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--primary-color) 24%, transparent);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-list-heading {
    padding: 2px 2px 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-list-heading h4 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.15;
    color: var(--text-primary);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-simple-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 0;
    border-radius: 16px;
    border: 2px solid rgba(148, 163, 184, 0.26);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card-body {
    flex: 1;
    min-width: 0;
    padding: 16px 18px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--text-primary);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card-description {
    margin: 6px 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card.tone-attention {
    border-color: rgba(251, 146, 60, 0.55);
    background: linear-gradient(180deg, rgba(255, 237, 213, 0.98), rgba(255, 249, 245, 0.96));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card.tone-progress {
    border-color: rgba(250, 204, 21, 0.58);
    background: linear-gradient(180deg, rgba(254, 249, 195, 0.96), rgba(255, 255, 255, 0.96));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card.tone-done {
    border-color: rgba(163, 230, 53, 0.58);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(248, 255, 244, 0.96));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card.tone-planned {
    border-color: rgba(125, 211, 252, 0.42);
    background: linear-gradient(180deg, rgba(240, 249, 255, 0.95), rgba(255, 255, 255, 0.96));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-select {
    display: flex;
    align-items: center;
    padding-left: 14px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: nowrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card-project,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card-pic {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-simple-card .agenda-focus-deadline {
    display: inline-flex;
    flex-shrink: 0;
    margin-left: auto;
    margin-top: 0;
    min-height: 18px;
    font-size: 0.68rem;
    padding: 1px 7px;
    line-height: 1.4;
    border-radius: 10px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-filter-toggle,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-batch-btn,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-refresh-btn {
    min-height: 44px;
    border-radius: 16px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px !important;
    line-height: 1.35;
    min-width: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-active-filters {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-focus-list,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-focus-section,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-focus-cards,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-pane,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-filter-sheet-section-body,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-create-card .agenda-quick-fields {
    flex-direction: column;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-tabs {
    display: block;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary-color) 6%, var(--bg-surface-2)), var(--bg-surface-1));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-copy,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-content .detail-card {
    margin: 0;
    border-radius: 18px;
    background: var(--bg-surface-2);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-content textarea {
    min-height: 160px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--bg-surface-1);
    border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-item strong {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.35;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-item-wide {
    grid-column: 1 / -1;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-item-deadline strong {
    font-size: 1rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-btn,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-icon {
    min-height: 48px;
    border-radius: 16px !important;
    justify-content: center;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-overview-icon {
    width: 48px;
    padding: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 12px;
    scrollbar-width: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-pane {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-pane.is-active {
    display: flex;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-sheet-backdrop {
    position: absolute;
    inset: 0;
    z-index: 8;
    border: none;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    pointer-events: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    border-radius: 22px 22px 0 0;
    background: var(--bg-surface-1);
    box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.22);
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-sheet.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-create-card .agenda-detail-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s;
    opacity: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-create-card .agenda-detail-fields.expanded {
    max-height: 2000px;
    opacity: 1;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-expand-btn,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-fab {
    display: flex !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-fab {
    bottom: calc(80px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-filters-row {
    display: none !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1115;
    max-height: min(72vh, 620px);
    overflow-y: auto;
    padding: 18px 16px calc(18px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    margin: 0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 22px 22px 0 0 !important;
    background: var(--bg-surface-1);
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.16);
    opacity: 0;
    transform: translateY(calc(100% + 24px));
    pointer-events: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-filters-row.filters-visible {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-filter-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1110;
    border: none;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    pointer-events: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-filter-sheet-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) body.agenda-filter-sheet-open {
    overflow: hidden;
}

/* =============================================
   MOBILE SIMPLIFIED VIEW — HIDDEN ELEMENTS
   Remove: summary cards, scope context text,
   batch-select button, and filter toggle button.
   ============================================= */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #agenda-mobile-summary,
    #agenda-scope-context,
    #agenda-mobile-select-btn,
    .agenda-filter-toggle,
    .agenda-mobile-overflow {
        display: none !important;
    }
}

html.agenda-mobile-preview #agenda-mobile-summary,
html.agenda-mobile-preview #agenda-scope-context,
html.agenda-mobile-preview #agenda-mobile-select-btn,
html.agenda-mobile-preview .agenda-filter-toggle,
html.agenda-mobile-preview .agenda-mobile-overflow {
    display: none !important;
}


/* =============================================
   HYBRID COMPACT DETAIL LAYOUT (mobile & preview)
   Design reference: task_detail_hybrid.html
   ============================================= */

/* Shared definitions for both @media and class-based selectors */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* === HEADER: blue gradient === */
    #agenda-detail-modal .modal-header {
        background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
        color: white;
        border-bottom: none;
    }
    #agenda-detail-modal .modal-header .modal-title-input {
        color: white;
        background: transparent;
        border-color: transparent;
        font-weight: 700;
        font-size: 15px;
        caret-color: white;
    }
    #agenda-detail-modal .modal-header .modal-title-input::placeholder {
        color: rgba(255, 255, 255, 0.65);
    }
    #agenda-detail-modal .modal-header .btn-close,
    #agenda-detail-modal .modal-header .btn-icon-sm {
        color: white;
        opacity: 0.9;
    }
    #agenda-detail-modal .modal-header .btn-close:hover,
    #agenda-detail-modal .modal-header .btn-icon-sm:hover {
        background: rgba(255, 255, 255, 0.2);
        opacity: 1;
    }

    /* === MODAL BODY: light gray bg, no padding (sections handle it) === */
    #tasks-tab-detail-body {
        background: #f8fafc !important;
        padding: 0 !important;
    }

    /* === FLAT CONTAINER === */
    .agenda-detail-flat {
        display: flex;
        flex-direction: column;
        padding: 0 16px;
    }

    /* === SECTIONS: padding + border-bottom divider === */
    .adf-section {
        padding: 14px 0;
        border-bottom: 1px solid #e2e8f0;
    }
    .adf-section:last-of-type {
        border-bottom: none;
    }

    /* === SECTION TITLE: uppercase small caps === */
    .adf-section-title {
        font-size: 10px;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        margin-bottom: 8px;
    }

    /* === SECTION 1: DESKRIPSI — bare textarea === */
    .adf-section textarea#tasks-tab-detail-description-input {
        width: 100%;
        border: none !important;
        outline: none;
        background: transparent !important;
        padding: 0 !important;
        resize: none;
        font-size: 13.5px !important;
        line-height: 1.55 !important;
        color: #334155 !important;
        min-height: 0 !important;
        height: auto;
        box-shadow: none !important;
        overflow: hidden;
    }
    .adf-section textarea#tasks-tab-detail-description-input::placeholder {
        color: #94a3b8;
    }

    /* === SECTION 2: INFORMASI AGENDA — meta card grid === */
    .adf-section .detail-fields-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    /* Each field: white card with border — compact */
    .adf-section .detail-fields-grid .detail-field-item {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 5px 9px;
    }
    .adf-section .detail-fields-grid .detail-field-label {
        display: flex;
        align-items: center;
        gap: 3px;
        font-size: 9px;
        color: #64748b;
        font-weight: 600;
        margin-bottom: 1px;
        letter-spacing: 0.2px;
    }
    .adf-section .detail-fields-grid .detail-field-label i {
        font-size: 10px;
    }
    .adf-section .detail-fields-grid .detail-field-select,
    .adf-section .detail-fields-grid .detail-field-input {
        border: none !important;
        outline: none;
        background: transparent !important;
        padding: 0 !important;
        font-size: 12px !important;
        font-weight: 700;
        color: #1e293b;
        width: 100%;
        box-shadow: none !important;
        min-height: 0 !important;
        height: auto !important;
        line-height: 1.3;
    }
    /* Proyek row: full-width inside the grid (grid-column: 1/-1 set via JS) */
    .adf-proyek-row {
        grid-column: 1 / -1;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 9px 11px;
        font-size: 12.5px;
        font-weight: 600;
        color: #334155;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .adf-proyek-row i {
        color: #64748b;
    }

    /* === SECTION 3: CHECKLIST — strip card chrome === */
    .adf-section #checklist-section {
        border: none !important;
        background: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .adf-section #checklist-section .detail-card-header {
        padding: 0;
        margin-bottom: 8px;
        font-size: 13px;
        font-weight: 600;
        border: none;
        background: none;
    }
    .adf-section #checklist-section .detail-card-body {
        padding: 0;
    }

    /* === SECTION 4: HISTORY & COMMENTS === */
    /* Activity log: always open, no summary toggle */
    .adf-section details#activity-log-section {
        border: none;
        background: none;
        padding: 0;
        margin: 0;
    }
    .adf-section details#activity-log-section > summary {
        display: none;
    }
    .adf-section details#activity-log-section .advanced-content {
        display: block !important;
        max-height: none !important;
    }
    .adf-section details#activity-log-section #tasks-tab-detail-activity-log {
        max-height: none;
        overflow: visible;
        font-size: 12px;
        color: #64748b;
        line-height: 1.5;
    }
    /* Comment box: separate from activity log with dashed divider */
    .adf-section .detail-card {
        border: none !important;
        background: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin-top: 12px;
        padding-top: 12px !important;
        border-top: 1px dashed #e2e8f0 !important;
    }
    .adf-section .detail-card .detail-card-header {
        display: none;
    }
    .adf-section .detail-card .detail-card-body {
        padding: 0 !important;
    }
    /* Comment textarea: pill-shaped like reference */
    .adf-section .detail-card textarea {
        border-radius: 20px !important;
        border: 1px solid #e2e8f0 !important;
        padding: 9px 14px !important;
        font-size: 12.5px !important;
        min-height: 0 !important;
        height: auto !important;
        background: white !important;
    }

    /* === SECTION 5: AGENDA TIM — compact horizontal chip list === */
    .adf-section .task-participants-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        margin: 0;
    }
    .adf-section .task-participants-list .participant-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        width: auto !important;
        padding: 3px 8px !important;
        border-radius: 10px !important;
        background: #f1f5f9 !important;
        border: none !important;
        font-size: 0 !important; /* hide initials text node */
        color: transparent !important;
        white-space: nowrap;
        overflow: hidden;
        min-width: 0;
        flex-shrink: 0;
    }
    /* Avatar for image badges */
    .adf-section .task-participants-list .participant-badge img {
        width: 20px !important;
        height: 20px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        flex-shrink: 0;
        display: block;
    }
    /* Full name from title attribute */
    .adf-section .task-participants-list .participant-badge::after {
        content: attr(title);
        font-size: 12px;
        color: #475569;
        font-weight: 500;
        white-space: nowrap;
    }

    /* === FOOTER: 2-row layout (Hapus+Selesai+Batal | Simpan full-width) === */
    .agenda-modal .modal-footer {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 12px 14px !important;
        background: white !important;
        border-top: 1px solid #e2e8f0 !important;
        gap: 8px !important;
        grid-template-columns: unset !important;
    }
    /* Spacer hidden — wrap layout handles grouping */
    .agenda-modal .modal-footer .modal-footer-spacer {
        display: none !important;
    }
    /* Full-width Simpan on its own row */
    .agenda-modal .modal-footer #tasks-tab-save-btn {
        flex: 1 1 100% !important;
        order: 3 !important;
    }
    /* Batal fills remaining space in top row */
    .agenda-modal .modal-footer .btn-secondary {
        flex: 1 1 auto !important;
        order: 2 !important;
    }
    /* Hapus button style */
    .agenda-modal .modal-footer #tasks-tab-delete-btn {
        background: #fee2e2 !important;
        color: #b91c1c !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 8px 11px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        order: 1 !important;
    }
    /* Selesai button style */
    .agenda-modal .modal-footer #tasks-tab-mark-done-btn {
        background: #dcfce7 !important;
        color: #166534 !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        order: 1 !important;
    }
    /* Batal button style */
    .agenda-modal .modal-footer .btn-secondary {
        background: #f1f5f9 !important;
        color: #475569 !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        flex: 1 1 auto !important;
        order: 2 !important;
    }
    /* Simpan button style — full-width bottom row */
    .agenda-modal .modal-footer #tasks-tab-save-btn {
        background: linear-gradient(to right, var(--primary-color), var(--primary-hover)) !important;
        color: white !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 10px 13px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        box-shadow: 0 3px 8px rgba(var(--brand-color-rgb, 13, 59, 102), 0.35) !important;
        flex: 1 1 100% !important;
        order: 3 !important;
        justify-content: center !important;
    }
    /* Show Hapus/Selesai when JS grants visibility */
    #tasks-tab-delete-btn[style*="inline-flex"],
    #tasks-tab-mark-done-btn[style*="inline-flex"] {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 40px;
    }
}

/* ---- Same styles for agenda-mobile-surface / agenda-mobile-preview class ---- */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-bottom: none;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header .modal-title-input {
    color: white;
    background: transparent;
    border-color: transparent;
    font-weight: 700;
    font-size: 15px;
    caret-color: white;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header .modal-title-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header .btn-close,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header .btn-icon-sm {
    color: white;
    opacity: 0.9;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-detail-body {
    background: #f8fafc !important;
    padding: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-flat {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section {
    padding: 14px 0;
    border-bottom: 1px solid #e2e8f0;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section:last-of-type {
    border-bottom: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section textarea#tasks-tab-detail-description-input {
    width: 100%;
    border: none !important;
    outline: none;
    background: transparent !important;
    padding: 0 !important;
    resize: none;
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    color: #334155 !important;
    min-height: 0 !important;
    height: auto;
    box-shadow: none !important;
    overflow: hidden;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-fields-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-fields-grid .detail-field-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 9px;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-fields-grid .detail-field-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 1px;
    letter-spacing: 0.2px;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-fields-grid .detail-field-select,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-fields-grid .detail-field-input {
    border: none !important;
    outline: none;
    background: transparent !important;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 700;
    color: #1e293b;
    width: 100%;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.3;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-proyek-row {
    grid-column: 1 / -1;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section #checklist-section {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section #checklist-section .detail-card-header {
    padding: 0;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: none;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section #checklist-section .detail-card-body {
    padding: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section details#activity-log-section {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section details#activity-log-section > summary {
    display: none;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section details#activity-log-section .advanced-content {
    display: block !important;
    max-height: none !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section details#activity-log-section #tasks-tab-detail-activity-log {
    max-height: none;
    overflow: visible;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-card {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin-top: 12px;
    padding-top: 12px !important;
    border-top: 1px dashed #e2e8f0 !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-card .detail-card-header {
    display: none;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-card .detail-card-body {
    padding: 0 !important;
}
/* Comment textarea: pill-shaped */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .detail-card textarea {
    border-radius: 20px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 9px 14px !important;
    font-size: 12.5px !important;
    min-height: 0 !important;
    height: auto !important;
    background: white !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .task-participants-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    margin: 0;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .task-participants-list .participant-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    width: auto !important;
    padding: 3px 8px !important;
    border-radius: 10px !important;
    background: #f1f5f9 !important;
    border: none !important;
    font-size: 0 !important;
    color: transparent !important;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
    flex-shrink: 0;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .task-participants-list .participant-badge img {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0;
    display: block;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .adf-section .task-participants-list .participant-badge::after {
    content: attr(title);
    font-size: 12px;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-modal .modal-footer,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 12px 14px !important;
    background: white !important;
    border-top: 1px solid #e2e8f0 !important;
    gap: 8px !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-modal .modal-footer .modal-footer-spacer {
    display: none !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-delete-btn {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 11px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-mark-done-btn {
    background: #dcfce7 !important;
    color: #166534 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-modal .modal-footer .btn-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-save-btn {
    background: linear-gradient(to right, var(--primary-color), var(--primary-hover)) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 13px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 8px rgba(var(--brand-color-rgb, 13, 59, 102), 0.35) !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-save-btn {
    flex: 1 1 100% !important;
    order: 3 !important;
    justify-content: center !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-modal .modal-footer .btn-secondary {
    flex: 1 1 auto !important;
    order: 2 !important;
}
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-delete-btn[style*="inline-flex"],
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-mark-done-btn[style*="inline-flex"] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 40px;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    order: 1 !important;
}

/* =============================================
    MOBILE AGENDA INBOX + CHAT DETAIL (PWA + preview)
    ============================================= */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab {
    background: #f3f6f4;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-header {
    align-items: center !important;
    gap: 8px !important;
    margin: 0 0 10px !important;
    padding: 14px 4px 4px;
    background: #ffffff;
    border-radius: 0 0 20px 20px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-title-block {
    align-self: flex-start;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-title-block h3 {
    margin: 0;
    color: var(--brand-fg, var(--primary-color));
    font-size: 1.1rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.3px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-title-block h3 i {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-actions {
    width: auto;
    margin-left: auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-overflow summary {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: #18231d;
    border-radius: 12px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-header .btn-primary[data-call="toggleTasksCreateForm"] {
    display: none !important;
    position: fixed;
    right: 18px;
    bottom: calc(80px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    z-index: 880;
    width: 58px;
    min-width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 18px 32px rgba(var(--brand-color-rgb, 23, 99, 198), 0.35);
    font-size: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-header .btn-primary[data-call="toggleTasksCreateForm"] i {
    margin: 0;
    font-size: 1.65rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-filter-bar {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-summary {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0 0 12px;
    order: 1;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell {
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px !important;
    background: #eef0ed;
    color: #75847b;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell i {
    color: #2d6ea3;
    font-size: 1.05rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell input::placeholder {
    color: #75847b;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-batch-btn {
    min-width: 48px;
    width: 48px;
    min-height: 48px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: #eef0ed;
    color: #18231d;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-batch-btn span {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle {
    gap: 10px;
    margin-bottom: 12px;
    order: 2;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle .view-toggle-btn {
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #ebeeeb;
    color: #5d6f66;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle .view-toggle-btn.active {
    background: color-mix(in srgb, var(--primary-color) 15%, #ffffff);
    color: var(--brand-fg, var(--primary-color));
    box-shadow: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-context,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-team-quick-filters {
    order: 3;
    margin-bottom: 10px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-active-filters {
    order: 4;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-filters-row {
    order: 5;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-focus-state,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-focus-state-empty,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-focus-state-compact {
    flex-direction: row;
    align-items: center;
    min-height: 0;
    padding: 12px 14px;
    gap: 12px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox-summary strong {
    font-size: 0.96rem;
    color: #18231d;
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox-summary span {
    color: #15764a;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-list {
    overflow: hidden;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(24, 35, 29, 0.06);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid #dde5df;
    background: #ffffff;
    cursor: pointer;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row:last-child {
    border-bottom: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-select {
    grid-row: 1;
    align-self: center;
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-batch-mode .agenda-inbox-select {
    display: inline-flex;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-batch-mode .agenda-inbox-row {
    grid-template-columns: auto 52px minmax(0, 1fr);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-batch-mode .agenda-inbox-row.has-action {
    grid-template-columns: auto 38px minmax(0, 1fr) auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 800;
    flex: 0 0 auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar.tone-amber {
    background: linear-gradient(135deg, #c18338 0%, #7b4b1f 100%);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar.tone-green {
    background: linear-gradient(135deg, #2d9d6a 0%, #1d6e4a 100%);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar.tone-brown {
    background: linear-gradient(135deg, #b48c55 0%, #705631 100%);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar.tone-rose {
    background: linear-gradient(135deg, #9d5664 0%, #65303c 100%);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar.tone-blue {
    background: linear-gradient(135deg, #3c7ba6 0%, #244d68 100%);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-main {
    min-width: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-topline,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-message-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-title {
    min-width: 0;
    margin: 0;
    color: #18231d;
    font-size: 1.1rem;
    line-height: 1.18;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-deadline {
    flex: 0 0 auto;
    padding-top: 2px;
    color: #6f7f76;
    font-size: 0.8rem;
    line-height: 1.2;
    font-weight: 800;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-deadline.is-fresh {
    color: var(--brand-fg, var(--primary-color));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-deadline.is-alert {
    color: #c15445;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-snippet {
    min-width: 0;
    margin: 6px 0 0;
    color: #5f6c65;
    font-size: 0.92rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-snippet strong {
    color: var(--brand-fg, var(--primary-color));
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-unread {
    flex: 0 0 auto;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    margin-top: 4px;
    display: grid;
    place-items: center;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-chip {
    min-height: 24px;
    max-width: 100%;
    padding: 0 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: #eef2ef;
    color: #5f6c65;
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-chip.is-alert {
    background: #fdeae5;
    color: #c15445;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-chip.is-ok {
    background: #ddf6e8;
    color: #15764a;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-chip.is-info {
    background: #e8f0f7;
    color: #2d6ea3;
}

@media (max-width: 360px) {
    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 10px;
        padding: 13px 12px;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar {
        width: 46px;
        height: 46px;
        font-size: 0.84rem;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-title {
        font-size: 1rem;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-snippet {
        font-size: 0.86rem;
    }
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header {
    flex-shrink: 0;
    padding: 11px 13px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header .modal-title-input {
    min-width: 0;
    font-size: 15px !important;
    line-height: 1.25;
    padding: 5px 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal #tasks-tab-detail-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: #eef2f1 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-compact-bar {
    padding: 9px 10px;
    gap: 7px;
    background: white;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-compact-main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-compact-item {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 7px;
    row-gap: 1px;
    padding: 8px 9px;
    border-radius: 9px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-compact-item i {
    grid-row: 1 / 3;
    font-size: 0.95rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-compact-item span {
    font-size: 0.62rem;
    line-height: 1;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-compact-item strong {
    font-size: 0.78rem;
    line-height: 1.15;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-expand-btn {
    min-width: 42px;
    width: 42px;
    padding: 0;
    border-radius: 9px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-expand-btn span {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-full-panel {
    max-height: 46dvh;
    background: #f8fafc;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-full-panel-inner {
    padding: 12px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-detail-fields-layout,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .detail-two-col {
    grid-template-columns: 1fr !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .detail-sidebar-col {
    order: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-chat-panel {
    flex: 1 1 auto;
    min-height: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-chat-header {
    padding: 8px 12px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-chat-heading {
    font-size: 0.84rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .task-comments-list {
    padding: 12px;
    gap: 8px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-item {
    max-width: 84%;
    padding: 9px 11px;
    border-radius: 15px 15px 15px 5px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-item.is-own {
    border-radius: 15px 15px 5px 15px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-author,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-time,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-edited-label {
    font-size: 0.68rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-content {
    font-size: 0.88rem;
    line-height: 1.45;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-input-section {
    padding: 8px 10px;
    gap: 7px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-input-section textarea {
    min-width: 0;
    min-height: 42px;
    padding: 10px 13px !important;
    font-size: 16px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .btn-send {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .btn-send span {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer {
    flex-shrink: 0;
}

/* =============================================
   PIC SEARCHABLE DROPDOWN WIDGET
   ============================================= */
.pic-searchable-wrap {
    position: relative;
}

.pic-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-surface-1);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.pic-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.pic-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-surface-1);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-height: calc(7 * 44px);
    overflow-y: auto;
}

.pic-search-item {
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pic-search-item:last-child {
    border-bottom: none;
}

.pic-search-item:hover,
.pic-search-item:focus {
    background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-surface-2));
}

.pic-search-no-result {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* =============================================
   DEADLINE-BASED ROW ANIMATIONS
   ============================================= */

@keyframes agenda-row-overdue-pulse {
    0%, 100% { background: #fff8f7; }
    50%       { background: #fdeae5; }
}

@keyframes agenda-row-today-glow {
    0%, 100% { box-shadow: inset 3px 0 0 var(--primary-color); }
    50%       { box-shadow: inset 5px 0 0 var(--primary-color), 0 0 10px rgba(var(--brand-color-rgb, 23, 99, 198), 0.12); }
}

@keyframes agenda-row-soon-shimmer {
    0%, 100% { background: #ffffff; }
    50%       { background: #fffbf2; }
}

/* Overdue: pulsing red background + solid red left border */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.deadline-overdue {
    border-left: 4px solid #c15445;
    animation: agenda-row-overdue-pulse 2s ease-in-out infinite;
}

/* Today: primary color glow on left border */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.deadline-today {
    animation: agenda-row-today-glow 2.5s ease-in-out infinite;
}

/* Soon (tomorrow): amber left border + gentle shimmer */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.deadline-soon {
    border-left: 4px solid #e8a020;
    animation: agenda-row-soon-shimmer 3s ease-in-out infinite;
}

/* Within a week: subtle amber left accent, no animation (less urgent) */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.deadline-week {
    border-left: 3px solid #e8d4a0;
}

/* Done tasks: no deadline animation regardless of class */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.status-done {
    animation: none !important;
    border-left: none !important;
    opacity: 0.7;
}

/* =============================================
   MOBILE AGENDA COMPACT POLISH
   ============================================= */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab {
    background: #f4f6f3;
    padding-bottom: calc(72px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-header {
    min-height: 0;
    margin: 0 0 8px !important;
    padding: 0 2px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-title-block {
    align-self: center;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-title-block h3 {
    color: #248fa3;
    font-size: 1.03rem;
    line-height: 1.15;
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-actions {
    width: auto !important;
    min-width: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-tab-header .btn-primary[data-call="toggleTasksCreateForm"] {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .tasks-filter-bar {
    gap: 8px;
    margin-bottom: 8px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle {
    gap: 8px;
    margin-bottom: 4px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-toggle .view-toggle-btn {
    min-height: 32px;
    padding: 0 13px;
    font-size: 0.82rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-toolbar {
    margin: 0 0 4px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 18px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-batch-btn {
    min-width: 40px;
    width: 40px;
    min-height: 40px;
    border-radius: 14px !important;
}

/* Agenda mobile requested cleanup: no right-side filter/select button, cleaner full-width search. */
@media (max-width: 768px) {
    #agenda-scope-context,
    .agenda-scope-context,
    #agenda-mobile-select-btn,
    .agenda-mobile-toolbar-actions,
    .agenda-filter-toggle {
        display: none !important;
    }

    .agenda-mobile-toolbar {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        margin: 0 0 8px !important;
    }

    .agenda-mobile-search-shell {
        width: 100%;
        min-height: 46px;
        box-sizing: border-box;
        gap: 10px;
        padding: 0 14px !important;
        border-radius: 18px !important;
    }

    .agenda-mobile-search-shell input,
    .agenda-mobile-search-shell input::placeholder {
        font-size: 15px !important;
    }
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-scope-context,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-scope-context,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-mobile-select-btn,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-toolbar-actions,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-filter-toggle {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    margin: 0 0 8px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    gap: 10px;
    padding: 0 14px !important;
    border-radius: 18px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell input,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-search-shell input::placeholder {
    font-size: 15px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox {
    gap: 6px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox-summary {
    padding: 0 2px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox-summary strong {
    font-size: 0.9rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-mobile-inbox-summary span {
    font-size: 0.76rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-list {
    border: 1px solid #dce4df;
    border-radius: 12px;
    box-shadow: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    min-height: 72px;
    padding: 10px 12px;
    animation: none !important;
    background: #ffffff;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.has-action {
    grid-template-columns: 38px minmax(0, 1fr) auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-action-wrap {
    align-self: center;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: var(--primary-color, #1763c6);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-action i {
    font-size: 0.85rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.deadline-overdue {
    background: #fff8f8;
    border-left: 3px solid #d65045;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.deadline-soon,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row.deadline-week {
    border-left-width: 3px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar {
    width: 38px;
    height: 38px;
    align-self: center;
    font-size: 0.72rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-topline,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-message-line {
    gap: 8px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-title {
    font-size: 0.96rem;
    line-height: 1.15;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-deadline {
    padding-top: 1px;
    font-size: 0.72rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-snippet {
    margin-top: 3px;
    font-size: 0.82rem;
    line-height: 1.25;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-meta {
    flex-wrap: nowrap;
    gap: 5px;
    margin-top: 5px;
    overflow: hidden;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-chip {
    min-height: 19px;
    padding: 0 7px;
    font-size: 0.64rem;
    font-weight: 800;
    flex: 0 1 auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-chip:last-child {
    flex: 1 1 auto;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-fab {
    display: flex !important;
    right: 16px;
    bottom: calc(80px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    width: 50px;
    height: 50px;
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(var(--brand-color-rgb, 23, 99, 198), 0.28);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-fab i {
    font-size: 1.35rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) .app-footer {
    margin-top: 12px;
    padding-top: 12px;
}

@media (max-width: 360px) {
    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-row {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px;
        padding: 9px 10px;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) .agenda-inbox-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.66rem;
    }
}

/* =============================================
   MOBILE AGENDA DETAIL - CHAT FIRST
   ============================================= */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) body:has(#agenda-detail-modal.active) .agenda-fab {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal {
    z-index: 1300;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--bg-surface-1);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header {
    min-height: 56px;
    padding: 0 16px !important;
    flex-shrink: 0;
    border: 0 !important;
    background: var(--primary-color, var(--brand-color)) !important;
    color: #ffffff;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-title-input {
    min-width: 0;
    padding: 0 !important;
    margin: 0 8px 0 0 !important;
    border: 0 !important;
    color: #ffffff !important;
    font-size: 1.08rem !important;
    line-height: 1.2;
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-title-input::placeholder {
    color: rgba(255, 255, 255, 0.72);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header .btn-icon-sm {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .btn-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff !important;
    font-size: 1.7rem !important;
    font-weight: 700;
    line-height: 1;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal #tasks-tab-detail-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: var(--bg-surface-1) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-bar {
    min-height: 44px;
    padding: 0 14px !important;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    border: 0 !important;
    background: #ffffff !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-main {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-item {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #0f172a;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-item i {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-item span {
    color: #111827;
    font-size: 0.76rem;
    line-height: 1;
    font-weight: 800;
    text-transform: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-item strong {
    min-width: 0;
    color: #0b56c5;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 500;
    max-width: 116px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-deadline strong {
    color: #e11d48;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-expand-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin-left: auto;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #111827;
    box-shadow: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-expand-btn span {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-expand-btn i {
    font-size: 1.2rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-full-panel {
    flex: 0 0 auto;
    max-height: min(48dvh, 430px);
    overflow-y: auto;
    border: 0 !important;
    border-bottom: 1px solid #d7ded9 !important;
    background: #f8fafc !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-full-panel-inner {
    padding: 12px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-chat-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-surface-1) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-chat-header {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .task-comments-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
    margin: 0 !important;
    padding: 16px 16px 12px !important;
    gap: 10px;
    background: var(--bg-surface-1);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-item {
    width: fit-content;
    max-width: 78%;
    padding: 10px 13px !important;
    border: 0 !important;
    border-radius: 16px 16px 16px 4px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-item.is-own {
    margin-left: auto;
    border-radius: 16px 16px 4px 16px !important;
    background: color-mix(in srgb, var(--brand-color) 18%, var(--bg-surface-2)) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-header {
    margin-bottom: 4px;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-author,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-time,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-edited-label {
    color: #64748b;
    font-size: 0.68rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-content {
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.45;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-actions {
    display: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .no-comments,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .text-error {
    margin: auto;
    color: #64748b;
    font-size: 0.9rem;
    text-align: center;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-input-section {
    flex: 0 0 auto;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: end;
    gap: 8px !important;
    padding: 10px 16px calc(10px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-input-section textarea {
    min-width: 0;
    width: 100%;
    min-height: 44px !important;
    max-height: 112px;
    padding: 12px 16px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #f3f4f6 !important;
    color: #0f172a !important;
    font-size: 16px !important;
    line-height: 1.3;
    resize: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .btn-send {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--brand-color) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .btn-send span {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel #tasks-tab-comment-error {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.76rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer {
    flex: 0 0 auto;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    border-top: 1px solid #e5e7eb !important;
    background: #ffffff !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .modal-footer-spacer,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-delete-btn {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 44px !important;
    justify-content: center !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-mark-done-btn {
    order: 1 !important;
    background: var(--brand-color) !important;
    color: #ffffff !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-save-btn {
    order: 2 !important;
    flex: 1 1 0 !important;
    background: var(--brand-color) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .btn-secondary {
    order: 3 !important;
    background: #6b7280 !important;
    color: #ffffff !important;
}

/* =============================================
   MOBILE AGENDA DETAIL - DEFAULT THEME REFINEMENT
   Keeps the chat-first flow, but removes WhatsApp-green styling and
   tightens the expanded detail panel for small screens.
   ============================================= */
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-modal-content {
    background: var(--bg-surface-1) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-header {
    background: var(--primary-color, var(--brand-color)) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal #tasks-tab-detail-body,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-chat-panel,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .task-comments-list {
    background: var(--bg-surface-1) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-bar {
    min-height: 48px;
    padding: 7px 14px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 36px;
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--bg-surface-2) !important;
    box-shadow: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-item {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 5px;
    min-height: 32px;
    padding: 0 !important;
    overflow: hidden;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-item span {
    color: var(--text-primary);
    font-size: 0.76rem;
    line-height: 1;
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-item strong {
    max-width: none;
    overflow: hidden;
    color: var(--brand-fg, var(--brand-color));
    font-size: 0.76rem;
    line-height: 1.05;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-deadline strong {
    color: var(--error-text, var(--error-color, #ef4444));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-expand-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    align-self: center;
    color: var(--text-primary);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-full-panel {
    max-height: min(45dvh, 390px);
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--bg-surface-1) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-full-panel-inner {
    padding: 10px 12px 12px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-description-card {
    margin: 0 0 10px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-description-card .detail-card-header {
    min-height: 0;
    padding: 0 0 5px !important;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.15;
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-description-card .detail-card-header i,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-description-card .detail-card-footer {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-description-card .detail-card-body {
    padding: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-description-card #tasks-tab-detail-description-input {
    width: 100%;
    min-height: 66px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 0.92rem !important;
    line-height: 1.35;
    overflow: hidden !important;
    resize: none;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-description-card #tasks-tab-detail-description-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-fields-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 10px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-field-item {
    min-width: 0;
    gap: 5px;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-surface-2);
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-field-label {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.68rem;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-field-select,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-field-input {
    min-width: 0;
    min-height: 36px;
    padding: 7px 8px !important;
    border-radius: 8px;
    background-color: var(--bg-surface-1);
    font-size: 0.82rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal #tasks-tab-detail-participants {
    display: none !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-fields-layout,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-two-col {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-main-col,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-sidebar-col {
    display: flex !important;
    flex-direction: column;
    gap: 10px !important;
    min-width: 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-sidebar-col {
    order: -1 !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-card,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .advanced-section {
    margin: 0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    background: var(--bg-surface-2) !important;
    box-shadow: none !important;
    overflow: hidden;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-card-header,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .advanced-section summary {
    min-height: 38px;
    padding: 10px 12px !important;
    color: var(--text-primary);
    font-size: 0.84rem;
    line-height: 1.1;
    font-weight: 800;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-card-header i,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .advanced-section summary i {
    color: var(--brand-fg, var(--brand-color));
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-card-body {
    padding: 8px 12px 12px !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-info-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
    align-items: center;
    gap: 10px;
    padding: 9px 0;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-info-label,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-info-value {
    min-width: 0;
    font-size: 0.8rem;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .form-control-sm {
    width: 100%;
    max-width: none;
    min-height: 36px;
    text-align: left;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-item {
    background: var(--bg-surface-2) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-item.is-own {
    background: color-mix(in srgb, var(--brand-color) 18%, var(--bg-surface-2)) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-input-section {
    border-top-color: var(--border-color) !important;
    background: var(--bg-surface-2) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .comment-input-section textarea {
    background: var(--bg-surface-1) !important;
    color: var(--text-primary) !important;
}

:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-chat-panel .btn-send,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-mark-done-btn,
:is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-save-btn {
    background: var(--brand-color) !important;
    color: var(--text-on-brand, #ffffff) !important;
}

@keyframes agenda-row-overdue-pulse-dark {
    0%, 100% { background: color-mix(in srgb, var(--error-bg) 28%, var(--bg-surface-2)); }
    50% { background: color-mix(in srgb, var(--error-bg) 42%, var(--bg-surface-2)); }
}

@keyframes agenda-row-soon-shimmer-dark {
    0%, 100% { background: var(--bg-surface-2); }
    50% { background: color-mix(in srgb, var(--warning-bg) 32%, var(--bg-surface-2)); }
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #tasks-tab {
    background: var(--bg-surface-1) !important;
    color: var(--text-primary);
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-scope-context {
    background: var(--bg-surface-2) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-overflow summary,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-search-shell,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-batch-btn,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-scope-toggle .view-toggle-btn {
    background: var(--bg-surface-2) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-search-shell i,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-search-shell input,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-batch-btn i,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-overflow summary i {
    color: var(--text-primary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-search-shell input::placeholder {
    color: var(--text-muted) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-scope-toggle .view-toggle-btn.active {
    background: color-mix(in srgb, var(--brand-color) 36%, var(--bg-surface-3)) !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-status.status-todo,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-priority.tone-low {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-status.status-in_progress {
    color: var(--info-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-status.status-done {
    color: var(--success-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-deadline.tone-overdue,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-priority.tone-critical {
    color: var(--error-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-deadline.tone-today,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-priority.tone-high {
    color: var(--safety-fg) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-deadline.tone-soon,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-deadline.tone-week,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-focus-priority.tone-medium {
    color: var(--warning-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-inbox-summary strong,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-title {
    color: var(--text-primary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-mobile-inbox-summary span {
    color: var(--success-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-list,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-row {
    background: var(--bg-surface-2) !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-deadline,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-snippet,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-snippet strong,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-deadline.is-fresh,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip.is-info {
    color: var(--info-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-deadline.is-alert,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip.is-alert {
    color: var(--error-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip.is-ok {
    color: var(--success-text) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip {
    background: var(--bg-surface-3) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip.is-alert {
    background: var(--error-bg) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip.is-ok {
    background: var(--success-bg) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-chip.is-info {
    background: var(--info-bg) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-row.deadline-overdue {
    animation-name: agenda-row-overdue-pulse-dark;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) .agenda-inbox-row.deadline-soon {
    animation-name: agenda-row-soon-shimmer-dark;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-chat-panel .comment-author,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-chat-panel .comment-time,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-chat-panel .comment-edited-label,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-chat-panel .no-comments,
html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-chat-panel .text-error {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-chat-panel .comment-content {
    color: var(--text-primary) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-detail-modal .modal-footer {
    background: var(--bg-surface-2) !important;
    border-top-color: var(--border-color) !important;
}

html[data-theme="dark"]:is(.agenda-mobile-surface, .agenda-mobile-preview) #agenda-detail-modal .modal-footer .btn-secondary {
    background: var(--bg-surface-3) !important;
    color: var(--text-primary) !important;
}

@media (max-width: 380px) {
    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-main,
    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .detail-fields-grid {
        grid-template-columns: 1fr;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .agenda-detail-compact-bar {
        grid-template-columns: minmax(0, 1fr) 36px;
        min-height: 78px;
        align-items: start;
    }
}

@media (max-width: 768px) {
    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer,
    #agenda-detail-modal .modal-footer {
        flex: 0 0 auto;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px 14px calc(10px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        background: var(--bg-surface-1, #ffffff) !important;
        border-top: 1px solid var(--border-color, #e5e7eb) !important;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .modal-footer-spacer,
    #agenda-detail-modal .modal-footer .modal-footer-spacer {
        display: none !important;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .btn,
    #agenda-detail-modal .modal-footer .btn {
        min-width: 0 !important;
        min-height: 44px !important;
        padding: 0 10px !important;
        border-radius: 12px !important;
        border: 1px solid transparent !important;
        justify-content: center !important;
        gap: 6px !important;
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        box-shadow: none !important;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .btn i,
    #agenda-detail-modal .modal-footer .btn i {
        flex: 0 0 auto;
        font-size: 1rem;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-delete-btn[style*="inline-flex"],
    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-mark-done-btn[style*="inline-flex"],
    #tasks-tab-delete-btn[style*="inline-flex"],
    #tasks-tab-mark-done-btn[style*="inline-flex"],
    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .btn-secondary,
    #agenda-detail-modal .modal-footer .btn-secondary {
        flex: 1 1 0 !important;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-delete-btn[style*="inline-flex"],
    #tasks-tab-delete-btn[style*="inline-flex"] {
        order: 1 !important;
        display: inline-flex !important;
        background: var(--error-bg, #fee2e2) !important;
        color: var(--error-text, #991b1b) !important;
        border-color: color-mix(in srgb, var(--error-text, #991b1b) 12%, transparent) !important;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-mark-done-btn[style*="inline-flex"],
    #tasks-tab-mark-done-btn[style*="inline-flex"] {
        order: 2 !important;
        display: inline-flex !important;
        background: var(--success-bg, #dcfce7) !important;
        color: var(--success-text, #166534) !important;
        border-color: color-mix(in srgb, var(--success-text, #166534) 12%, transparent) !important;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #agenda-detail-modal .modal-footer .btn-secondary,
    #agenda-detail-modal .modal-footer .btn-secondary {
        order: 3 !important;
        background: var(--bg-surface-3, #f1f5f9) !important;
        color: var(--text-primary, #334155) !important;
        border-color: var(--border-color, #e2e8f0) !important;
    }

    :is(html.agenda-mobile-surface, html.agenda-mobile-preview) #tasks-tab-save-btn,
    #tasks-tab-save-btn {
        order: 4 !important;
        flex: 1 0 100% !important;
        min-height: 46px !important;
        background: var(--brand-color, var(--primary-color, #0d9488)) !important;
        color: #ffffff !important;
        border-color: transparent !important;
    }
}
