/* Existing page styles remain shared; this layer adapts the application shell. */
.mobile-header, .mobile-bottom-nav { display: none; }
.settings-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.settings-links button { min-height: 44px; }
.settings-links button span { margin-left: 16px; }
.settings-logout { color: #c50000; }
.extra-task-card .extra-count { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.extra-task-card .extra-count progress { grid-column: 1 / -1; width: 100%; }
.extra-task-card .extra-count small { display: block; margin-bottom: 4px; }

@media (max-width: 900px) {
    html { scroll-padding-top: 82px; scroll-padding-bottom: 90px; }
    .app-panel { min-height: 100dvh; }
    .app-panel .sidebar { display: none; }
    .mobile-header {
        position: fixed; inset: 0 0 auto; z-index: 40;
        display: flex; align-items: center; justify-content: space-between;
        height: calc(64px + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) 18px 0;
        background: var(--surface); border-bottom: 1px solid var(--line);
    }
    .mobile-brand { color: #c50000; font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
    .mobile-brand span { color: var(--ink); font-size: 18px; font-weight: 650; letter-spacing: 0; }
    .mobile-profile-button { border: 0; background: transparent; padding: 4px; border-radius: 50%; cursor: pointer; }
    .mobile-profile-button .user-avatar { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; min-width: 38px; margin: 0; overflow: hidden; border-radius: 50%; }
    .mobile-profile-button img { width: 100%; height: 100%; object-fit: cover; }
    .app-panel .main-content {
        margin-left: 0; min-width: 0; width: 100%;
        padding: calc(84px + env(safe-area-inset-top, 0px)) 16px calc(96px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-bottom-nav {
        display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
        position: fixed; inset: auto 0 0; z-index: 40;
        background: var(--surface); border-top: 1px solid var(--line);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
        min-height: 56px; border: 0; border-radius: 10px; background: transparent;
        color: var(--muted); font: inherit; font-size: calc(11px * var(--text-scale, 1)); font-weight: 650; cursor: pointer;
    }
    .mobile-nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-nav-item.active { color: #c50000; background: rgba(197, 0, 0, .06); }
    :root[data-theme="dark"] .mobile-nav-item.active { color: #ff8989; background: rgba(255, 137, 137, .08); }
    .mobile-nav-item:focus-visible, .mobile-profile-button:focus-visible { outline: 2px solid #c50000; outline-offset: -2px; }
    .page-header { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
    .page-header h1 { font-size: calc(23px * var(--text-scale, 1)); }
    .page-header-actions { flex-wrap: wrap; gap: 8px; }
    .page-header-actions > * { min-height: 44px; }
    .task-tabs { display: flex; gap: 6px; }
    .task-tab { flex: 1; min-width: 0; min-height: 44px; padding: 9px 7px; }
    .task-card, .member-card, .team-card { min-width: 0; overflow-wrap: anywhere; }
    .task-actions { flex-wrap: wrap; }
    .task-actions button { min-height: 44px; }
    .modal-overlay { padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .modal { max-width: 100%; max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
    .modal input:not([type="checkbox"]):not([type="radio"]), .modal select, .modal textarea,
    .settings-form input:not([type="checkbox"]), .settings-form select, .settings-form textarea { font-size: 16px; max-width: 100%; }
    .modal-footer { flex-wrap: wrap; }
    #calendarGrid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .settings-links { display: grid; grid-template-columns: 1fr auto; }
}

@media (max-width: 600px) {
    .tasks-grid, .idea-list.tasks-grid, .members-grid, .teams-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .page-header { flex-direction: column; }
    .page-header-actions { width: 100%; }
    .page-header-actions > * { flex: 1; }
    .idea-toolbar, .idea-toolbar-actions { flex-wrap: wrap; min-width: 0; }
    .idea-type-tabs { width: 100%; }
    .idea-toolbar-actions { width: 100%; }
    .idea-toolbar-actions select { min-width: 0; flex: 1; }
    .settings-links { grid-template-columns: 1fr; }
}

.idea-trash { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.idea-trash svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.idea-type-tabs:empty { display: none; }

.member-permissions { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 16px 0; }
.member-permissions legend { font-weight: 700; padding: 0 6px; }
.member-permissions p { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.member-permissions label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.member-permissions input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: #c50000; }
