/* === Grove mobile / PWA (max-width: 480px) === */
/* Design tokens: grove-tokens.css. Phone layout: mobile.css. Cross-device lock: app-ui-lock.css. */

:root {
    --bottom-nav-clearance: calc(4.75rem + env(safe-area-inset-bottom));
    --mobile-sheet-radius: 22px 22px 0 0;
    --mobile-backdrop-z: 400;
    --mobile-nav-z: 420;
    --mobile-sheet-z: 450;
    --mobile-fab-z: 460;
}

button,
.check-wrap,
.task-card,
.task-body,
.task-title,
.matrix-quadrant,
.kanban-col,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
.check-wrap:focus-visible {
    outline: 2px solid rgba(74, 222, 128, 0.55);
    outline-offset: 2px;
}

@media (hover: none) {
    .task-card:not(.dismissing):not(.dragging):hover {
        animation: none;
        transform: none;
        background: transparent;
        box-shadow: none;
    }

    .task-card.selected {
        animation: none;
        transform: none;
    }

    .task-card:active:not(.dragging) {
        background: rgba(255, 255, 255, 0.04);
    }
}

/* PWA install hint */
.pwa-install-banner {
    display: none;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--bottom-nav-clearance) + 6px);
    z-index: 470;
    max-width: min(360px, calc(100vw - 2rem));
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(5, 12, 8, 0.94);
    border: 0.5px solid rgba(134, 239, 172, 0.25);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-body);
}

.pwa-install-banner.is-visible {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-install-banner strong {
    color: var(--accent-pale);
    font-weight: 600;
}

.pwa-install-banner-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.pwa-install-dismiss,
.pwa-install-link {
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
}

.pwa-install-dismiss {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.pwa-install-link {
    background: rgba(74, 222, 128, 0.2);
    color: var(--accent-pale);
    text-decoration: none;
}

/* Panel cross-fade */
body.panel-animating .app-panel {
    animation: mobilePanelIn 0.32s var(--ease-spring) both;
}

@keyframes mobilePanelIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile sheet (filters / task actions / add) */
.mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--mobile-backdrop-z);
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

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

.mobile-sheet-backdrop.is-open.is-guarded {
    pointer-events: none;
}

.mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--mobile-sheet-z);
    max-height: min(78dvh, 640px);
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: var(--mobile-sheet-radius);
    background: rgba(8, 16, 11, 0.96);
    backdrop-filter: blur(32px) saturate(160%);
    -webkit-backdrop-filter: blur(32px) saturate(160%);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    transform: translateY(100%);
    transition: transform 0.38s var(--ease-spring);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mobile-sheet.is-open {
    transform: translateY(0);
}

.mobile-add-sheet {
    max-height: min(85dvh, 680px);
}

.mobile-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.mobile-sheet-title {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--accent-pale);
}

.mobile-sheet-close {
    min-width: 44px;
    min-height: 44px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}

.mobile-filters-btn {
    display: none;
}

.mobile-filters-icon {
    flex-shrink: 0;
}

.mobile-action-sheet .action-bar-actions {
    flex-direction: column;
}

.mobile-action-sheet .action-btn {
    min-height: 48px;
    width: 100%;
    justify-content: center;
}

/* FAB — TickTick-style add entry */
.mobile-fab {
    display: none;
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(var(--bottom-nav-clearance) + 12px);
    z-index: var(--mobile-fab-z);
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.95), rgba(34, 197, 94, 0.88));
    color: #052010;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        0 0 0 0.5px rgba(255, 255, 255, 0.12) inset;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.mobile-fab:not([hidden]) {
    display: flex;
}

.mobile-fab-icon {
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    margin-top: -2px;
}

.mobile-fab:active {
    transform: scale(0.94);
}

.mobile-fab.onboarding-nudge {
    animation: mobileFabNudge 2.4s ease-in-out infinite;
}

@keyframes mobileFabNudge {
    0%, 100% {
        box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.35),
            0 0 0 2px rgba(74, 222, 128, 0.35),
            0 0 18px rgba(74, 222, 128, 0.2);
    }

    50% {
        box-shadow:
            0 10px 28px rgba(0, 0, 0, 0.4),
            0 0 0 3px rgba(74, 222, 128, 0.55),
            0 0 28px rgba(74, 222, 128, 0.28);
    }
}

/* Mobile add sheet form */
.mobile-add-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mobile-add-input {
    width: 100%;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    padding: 16px 14px;
    font-family: inherit;
    font-size: 17px;
    color: var(--text-body);
    outline: none;
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.mobile-add-input::placeholder {
    color: rgba(120, 160, 130, 0.45);
}

.mobile-add-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-add-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mobile-add-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.mobile-add-cat-manage {
    border: none;
    background: transparent;
    padding: 4px 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-pale);
    cursor: pointer;
}

.mobile-add-cat-new {
    flex: 1 1 100%;
    min-width: 100%;
}

.mobile-add-cat-new-input {
    width: 100%;
    min-height: 38px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-body);
    outline: none;
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
}

.mobile-add-cat-dot-new {
    background: transparent !important;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    box-sizing: border-box;
}

.mobile-priority-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-priority-pill {
    min-height: 40px;
    padding: 8px 16px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-body);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.mobile-priority-pill.active {
    background: rgba(74, 222, 128, 0.18);
    border-color: rgba(74, 222, 128, 0.35);
    color: var(--accent-pale);
}

.mobile-priority-pill[data-mobile-priority="high"].active {
    background: rgba(255, 112, 112, 0.15);
    border-color: rgba(255, 112, 112, 0.35);
    color: #ffb0b0;
}

.mobile-priority-pill[data-mobile-priority="low"].active,
.mobile-priority-pill[data-mobile-priority="none"].active {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.28);
}

.mobile-add-category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-add-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 12px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-body);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.mobile-add-cat-chip.active {
    background: rgba(74, 222, 128, 0.14);
    border-color: rgba(74, 222, 128, 0.32);
    color: var(--accent-pale);
}

.mobile-add-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mobile-add-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    border: none;
    border-radius: 14px;
    background: rgba(74, 222, 128, 0.22);
    color: var(--accent-pale);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-raised);
}

.mobile-add-submit:active {
    transform: scale(0.98);
}

@media (max-width: 480px) {
    html {
        overflow-x: hidden;
    }

    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-top: env(safe-area-inset-top);
        padding-bottom: var(--bottom-nav-clearance);
        background: #0a1410;
        overflow-x: hidden;
    }

    body.grove-app-tier {
        padding-top: max(env(safe-area-inset-top), 6px);
    }

    body.is-native-app {
        padding-top: max(env(safe-area-inset-top), 6px);
    }

    .app-panel {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .app-panel.active {
        min-height: calc(100dvh - var(--bottom-nav-clearance));
    }

    body.mode-backlog {
        background: #0c1008;
    }

    .bg {
        background: #0a1410;
        filter: none;
    }

    body.mode-backlog .bg {
        background: #0c1008;
    }

    .bg::after {
        opacity: 0.18;
    }

    .blob {
        display: none !important;
        animation: none !important;
    }

    .task-shell,
    .focus-shell,
    .notes-shell {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        min-height: calc(100dvh - var(--bottom-nav-clearance));
        box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.06);
        background: rgba(5, 12, 8, 0.92);
    }

    body.mode-backlog .task-shell,
    body.mode-backlog .focus-shell,
    body.mode-backlog .notes-shell {
        background: rgba(12, 14, 6, 0.94);
        box-shadow: inset 0 0 0 0.5px rgba(217, 249, 157, 0.08);
    }

    .task-shell::before,
    .focus-shell::before,
    .notes-shell::before {
        border-radius: 0;
    }

    body.mode-backlog .task-shell::after {
        border-radius: 0;
    }

    .app-nav {
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        width: auto;
        max-width: none;
        transform: none;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: var(--mobile-nav-z);
        gap: 4px;
        padding: 4px;
    }

    .app-nav-btn {
        flex: 1;
        min-width: 0;
        min-height: 44px;
        padding: 10px 8px;
        font-size: 13px;
    }

    #tasksPanel.active,
    #focusPanel.active,
    #notesPanel.active {
        min-height: calc(100dvh - var(--bottom-nav-clearance));
        padding-left: 0;
        padding-right: 0;
    }

    .task-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        padding: 16px 14px 12px;
        gap: 0;
        min-height: calc(100dvh - var(--bottom-nav-clearance));
    }

    .task-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 12px;
        padding-bottom: 14px;
    }

    .task-topbar .header {
        min-width: 0;
    }

    .task-topbar .view-tabs {
        min-width: 0;
        width: 100%;
    }

    .view-tab {
        min-width: 0;
        flex: 1;
        padding: 10px 12px;
    }

    .title {
        font-size: 1.65rem;
    }

    .greeting {
        font-size: 12px;
    }

    .mobile-filters-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: auto;
        align-self: flex-start;
        min-height: 44px;
        padding: 0 16px;
        border: none;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: var(--shadow-raised);
    }

    /* Desktop sidebar hidden on phone — filters live in body-level sheet */
    .task-sidebar {
        display: none !important;
    }

    #sidebarFiltersHost {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .task-main {
        min-height: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .layout-toolbar {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }

    .layout-toolbar-label {
        width: 100%;
        flex: 0 0 auto;
    }

    .layout-toolbar-end {
        width: 100%;
        min-width: 0;
        justify-content: space-between;
        gap: 8px;
    }

    .layout-tabs {
        flex: 1 1 auto;
        min-width: 0;
    }

    .layout-toolbar-matrix-slot.is-active {
        flex-shrink: 0;
    }

    .matrix-quadrant-edit-toggle {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .task-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .layout-tabs {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .layout-tab {
        min-height: 44px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .task-card .check-wrap {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        flex-shrink: 0;
    }

    .task-card .check-wrap .check-icon {
        width: 14px;
        height: 14px;
    }

    .kanban-board .task-card,
    .matrix-grid .task-card,
    .task-list.layout-eisenhower .task-card {
        padding: 10px 12px;
        gap: 10px;
    }

    body.kanban-drag-active .kanban-board,
    body.kanban-drag-active .kanban-col-body {
        touch-action: none;
        overflow: hidden;
    }

    body.matrix-drag-active .matrix-grid,
    body.matrix-drag-active .task-list.layout-eisenhower {
        touch-action: none;
        overflow: hidden;
    }

    .filter-btn {
        min-height: 40px;
        padding: 8px 14px;
    }

    /* Kanban (mobile): one stage at a time — tabs + full-width list, tap to move */
    .task-list.layout-kanban.layout-kanban-mobile {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .kanban-board--mobile {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: 12px;
    }

    .kanban-stage-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 4px;
        border-radius: 14px;
        background: rgba(0, 0, 0, 0.22);
        border: 0.5px solid rgba(255, 255, 255, 0.06);
        flex-shrink: 0;
    }

    .kanban-stage-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 52px;
        padding: 8px 6px;
        border: none;
        border-radius: 10px;
        background: transparent;
        color: var(--text-muted);
        font-family: inherit;
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    }

    .kanban-stage-tab-label {
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        line-height: 1.2;
        text-align: center;
    }

    .kanban-stage-tab-count {
        font-size: 15px;
        font-weight: 700;
        line-height: 1;
        color: var(--text-body);
    }

    .kanban-stage-tab.stage-todo.active {
        background: rgba(160, 200, 170, 0.12);
        color: rgba(180, 220, 190, 0.95);
        box-shadow: inset 0 0 0 0.5px rgba(160, 200, 170, 0.25);
    }

    .kanban-stage-tab.stage-in_progress.active {
        background: rgba(255, 176, 96, 0.14);
        color: rgba(255, 200, 130, 0.95);
        box-shadow: inset 0 0 0 0.5px rgba(255, 176, 96, 0.3);
    }

    .kanban-stage-tab.stage-done.active {
        background: rgba(74, 222, 128, 0.14);
        color: rgba(134, 239, 172, 0.95);
        box-shadow: inset 0 0 0 0.5px rgba(74, 222, 128, 0.28);
    }

    .kanban-mobile-panel {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .kanban-mobile-cards {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-bottom: 8px;
    }

    .kanban-board--mobile .task-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .kanban-board--mobile .task-card .check-wrap {
        align-self: flex-start;
    }

    .kanban-board--mobile .task-body {
        width: 100%;
    }

    .kanban-mobile-stage-rail {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 0.5px solid rgba(255, 255, 255, 0.06);
    }

    .kanban-mobile-move {
        min-height: 36px;
        padding: 6px 4px;
        border: 0.5px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.03);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.02em;
        line-height: 1.15;
        text-align: center;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    .kanban-mobile-move-label {
        display: block;
    }

    .kanban-mobile-move.is-current {
        cursor: default;
        pointer-events: none;
    }

    .kanban-mobile-move.stage-todo.is-current {
        background: rgba(160, 200, 170, 0.14);
        border-color: rgba(160, 200, 170, 0.28);
        color: rgba(180, 220, 190, 0.95);
    }

    .kanban-mobile-move.stage-in_progress.is-current {
        background: rgba(255, 176, 96, 0.14);
        border-color: rgba(255, 176, 96, 0.32);
        color: rgba(255, 200, 130, 0.95);
    }

    .kanban-mobile-move.stage-done.is-current {
        background: rgba(74, 222, 128, 0.14);
        border-color: rgba(74, 222, 128, 0.3);
        color: rgba(134, 239, 172, 0.95);
    }

    .kanban-board--mobile .kanban-empty {
        margin-top: 24px;
    }

    /* Matrix: 2×2 overview fills the task area; drill into one quadrant on tap */
    .task-list.layout-eisenhower.matrix-phone-overview,
    .task-list.layout-eisenhower.matrix-phone-focused {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .matrix-focus-shell {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .matrix-back-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        align-self: flex-start;
        min-height: 40px;
        padding: 0 12px;
        border: none;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-muted);
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }

    .matrix-grid-overview {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 8px;
        height: 100%;
        max-height: none;
    }

    .matrix-grid-focused {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        height: 100%;
        max-height: none;
    }

    .matrix-quadrant-overview {
        min-height: 0;
        cursor: pointer;
    }

    .matrix-quadrant-overview .matrix-quadrant-head {
        padding: 8px 10px;
    }

    .matrix-quadrant-overview .matrix-quadrant-title {
        font-size: 9px;
        letter-spacing: 0.05em;
    }

    .matrix-quadrant-overview .matrix-quadrant-sub {
        display: none;
    }

    .matrix-quadrant-overview .matrix-quadrant-count {
        font-size: 10px;
        min-width: 22px;
        height: 22px;
    }

    .matrix-quadrant-overview .matrix-quadrant-body {
        overflow: hidden;
        padding: 6px;
        gap: 4px;
    }

    .matrix-quadrant-overview .task-card {
        padding: 6px 8px 6px 10px;
        max-height: none;
        border-radius: 10px;
    }

    .matrix-quadrant-overview .matrix-overview-card .task-tag {
        margin-bottom: 2px;
    }

    .matrix-quadrant-overview .matrix-overview-card .task-cat-dot {
        width: 6px;
        height: 6px;
    }

    .matrix-quadrant-overview .matrix-overview-card .task-title {
        font-size: 11px;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .matrix-quadrant-overview .matrix-overview-card .check-wrap,
    .matrix-quadrant-overview .matrix-overview-card .card-slot {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    .matrix-quadrant-overview .matrix-empty {
        padding: 8px 6px;
        font-size: 10px;
    }

    .matrix-more-btn {
        width: 100%;
        margin-top: 2px;
        padding: 4px 6px;
        border: none;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        color: rgba(160, 200, 170, 0.75);
        font-family: inherit;
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
    }

    .matrix-grid-focused .matrix-quadrant {
        min-height: 0;
    }

    .matrix-grid-focused .matrix-quadrant-body {
        overflow-y: auto;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    .task-list.layout-compact .task-card {
        padding: 12px 14px;
    }

    .task-card {
        padding: 14px 14px 14px 16px;
    }

    .task-card .task-title {
        font-size: 15px;
        line-height: 1.35;
    }

    .pwa-install-banner {
        bottom: calc(var(--bottom-nav-clearance) + 72px);
        max-width: min(360px, calc(100vw - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
    }

    .focus-shell,
    .notes-shell {
        padding: 16px 14px 12px;
        min-height: calc(100dvh - var(--bottom-nav-clearance));
        border-radius: 0;
        justify-content: flex-start;
    }

    .focus-mode-tabs.focus-durations {
        width: 100%;
        max-width: 100%;
    }

    .focus-daily-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
        min-height: auto;
        width: 100%;
    }

    .focus-daily-col {
        min-width: 0;
        width: 100%;
    }

    #focusPanel .focus-add-area {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #focusPanel .focus-add-area .add-input {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    #focusPanel .focus-time-fields {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .focus-queue-list {
        max-height: min(36dvh, 320px);
        flex: none;
    }

    .focus-queue-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    .focus-queue-main {
        min-width: 0;
    }

    .focus-duration-inputs {
        align-self: flex-start;
    }

    .focus-queue-delete {
        align-self: flex-end;
        min-height: 40px;
    }

    .focus-session-col .focus-cta-btn,
    .focus-session-col .focus-pause-btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .focus-timer-stage,
    .focus-session-stage {
        min-height: 200px;
    }

    .focus-pomodoro-panel {
        width: 100%;
        max-width: 100%;
    }

    .focus-pomodoro-panel .focus-time {
        font-size: clamp(3rem, 14vw, 4.5rem);
    }

    .focus-controls {
        width: 100%;
        justify-content: center;
        gap: 16px;
    }

    .notes-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 12px;
    }

    .notes-title {
        font-size: 1.65rem;
    }

    .notes-sub {
        font-size: 13px;
        line-height: 1.45;
    }

    .notes-input-hint {
        display: none;
    }

    .notes-wall {
        padding-bottom: 8px;
    }

    .notes-input-wrap {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding-bottom: env(safe-area-inset-bottom);
        background: linear-gradient(180deg, transparent, rgba(5, 12, 8, 0.85) 24%);
    }

    .note-card {
        min-height: 72px;
    }

    body.mobile-actions-open .action-bar {
        display: none;
    }
}

@media (max-width: 480px) and (prefers-reduced-motion: reduce) {
    body.panel-animating .app-panel {
        animation: none;
    }

    .mobile-sheet {
        transition: opacity 0.2s ease;
        transform: none;
        opacity: 0;
    }

    .mobile-sheet.is-open {
        opacity: 1;
    }

    .mobile-fab.onboarding-nudge {
        animation: none !important;
        box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35) !important;
    }
}
