/* ==========================================================================
   mh_mobile.css — Mobile-Native Component Engine for ICON Marketing Hub
   Tailored touch-first UI components for iPhone, Android, Fold, and iPad.

   Strategy: .mh-mobile-only / .mh-desktop-only gate whole component trees so
   the mobile surface is NOT a shrunken desktop — it is a purpose-built touch UI
   rendering the same PHP data. At ≤1024px every desktop table, arc gauge grid,
   and multi-column layout is hidden and replaced by compact card stacks, swipe
   rails, and bottom sheets.
   ========================================================================== */

/* ── Viewport visibility toggles ──────────────────────────────────────────── */
.mh-mobile-only      { display: none !important; }
.mh-desktop-only     { display: block !important; }
.mh-desktop-only-flex{ display: flex  !important; }

@media (max-width: 1024px) {
    .mh-mobile-only       { display: block !important; }
    .mh-mobile-only-flex  { display: flex  !important; }
    .mh-mobile-only-grid  { display: grid  !important; }
    .mh-desktop-only      { display: none  !important; }
    .mh-desktop-only-flex { display: none  !important; }

    /* ── html / body base ─────────────────────────────────────────────────── */
    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    body {
        padding-bottom: 72px; /* fixed mobile bottom dock */
    }

    /* ── Page container ───────────────────────────────────────────────────── */
    .mh-page {
        padding: 0.75rem 0.65rem 5.5rem;
    }

    /* ── Page header — stack vertically, tighten spacing ──────────────────── */
    .mh-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    .mh-page-header h1 {
        font-size: 1.25rem;
    }
    .mh-page-header .mh-subtitle {
        font-size: 0.78rem;
        line-height: 1.4;
    }

    /* ── Tabs — horizontal scroll rail ────────────────────────────────────── */
    .mh-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding-bottom: 2px;
    }
    .mh-tabs::-webkit-scrollbar { display: none; }
    .mh-tab {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    /* ── Cards — reduce padding, softer shadows ──────────────────────────── */
    .mh-card {
        padding: 0.85rem 0.75rem;
        border-radius: var(--radius-lg);
    }
    .mh-card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .mh-card-title {
        font-size: 1rem;
    }

    /* ── Tables — card-ify on mobile ─────────────────────────────────────── */
    .mh-table-wrap {
        overflow-x: visible;
    }
    .mh-table {
        display: block;
        width: 100%;
    }
    .mh-table thead {
        display: none; /* hide column headers */
    }
    .mh-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
    }
    .mh-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 0.75rem 0.85rem;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        gap: 0.25rem;
    }
    .mh-table tbody tr td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.15rem 0;
        border: none;
        font-size: 0.82rem;
        min-height: 0;
    }
    /* First cell in each card row is the primary — bolder */
    .mh-table tbody tr td:first-child {
        font-weight: 700;
        font-size: 0.9rem;
        color: var(--gray-900);
        padding-bottom: 0.25rem;
        border-bottom: 1px solid var(--surface-2);
        margin-bottom: 0.15rem;
    }
    /* Data-label for card-ified rows: show th text via data attribute */
    .mh-table tbody tr td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--gray-400);
        flex-shrink: 0;
        margin-right: 0.5rem;
    }
    /* Action cells — full width, stacked buttons */
    .mh-table tbody tr td:last-child {
        justify-content: flex-end;
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    /* Lifecycle action rows need special treatment — they follow their parent card */
    .mh-life-actions-row {
        border: none !important;
        box-shadow: none !important;
        padding: 0 0.85rem 0.5rem !important;
        margin-top: -0.65rem;
        background: transparent !important;
    }
    .mh-life-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    .mh-life-form {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .mh-life-form .mh-select,
    .mh-life-form .mh-input {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* ── Buttons — touch-friendly 44px minimum ───────────────────────────── */
    .mh-btn {
        min-height: 44px;
        padding-left: 1rem;
        padding-right: 1rem;
        font-size: 0.82rem;
    }
    .mh-btn-sm {
        min-height: 38px;
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
    }

    /* ── Form inputs — 16px floor for iOS anti-zoom ──────────────────────── */
    .mh-input,
    .mh-select,
    .mh-textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    .mh-field,
    .mh-control {
        margin-bottom: 0.6rem;
    }
    .mh-label {
        font-size: 0.75rem;
    }

    /* ── Badges — slightly larger touch target ───────────────────────────── */
    .mh-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    /* ── Modals — slide-up sheets instead of centered popups ─────────────── */
    .mh-modal-overlay {
        align-items: flex-end;
    }
    .mh-modal {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Gauge panel — simplified on mobile ───────────────────────────────── */
    .mh-gauge-panel {
        padding: 0.75rem;
    }
    .mh-gauge-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .mh-gauge-week {
        width: 100%;
    }
    .mh-gauge-week .mh-select {
        width: 100%;
    }

    /* Gauge grid — horizontal swipe rail on mobile (dots track the active arc).
       The same .mh-gauge-grid markup the desktop uses, re-flowed into one row that
       scrolls sideways so each arc stays legible on a narrow screen. */
    .mh-gauge-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 1rem !important;
        padding: 0.25rem 0 0.5rem;
        scroll-snap-type: x mandatory;
    }
    .mh-gauge-grid::-webkit-scrollbar { display: none; }
    .mh-gauge-grid .mh-gauge {
        flex: 0 0 100%;
        scroll-snap-align: center;
    }
    .mh-gauge-plot {
        max-width: none;
    }

    /* Swipe-rail pagination dots, injected by gauges.js, shown only while the rail
       actually overflows. The active dot tracks the nearest snapped arc. */
    .mh-gauge-panel {
        padding-bottom: 0;
    }
    .mh-gauge-dots {
        display: flex;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.6rem 0 0.4rem;
    }
    .mh-gauge-dots .mh-gauge-dot {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        border: none;
        padding: 0;
        background: var(--gray-200);
        transition: background 0.2s ease, width 0.2s ease;
        cursor: pointer;
    }
    .mh-gauge-dots .mh-gauge-dot.is-active {
        width: 18px;
        border-radius: 999px;
        background: var(--brand-accent);
    }
    .mh-gauge-value {
        font-size: 1.25rem;
    }
    .mh-gauge-label {
        font-size: 0.62rem;
        min-height: 1.8em;
    }
    .mh-gauge-scale {
        font-size: 0.6rem;
    }
    .mh-gauge-band {
        font-size: 0.68rem;
    }
    .mh-gauge-meta {
        font-size: 0.62rem;
    }

    /* ── Normalization curve ──────────────────────────────────────────────── */
    .mh-curve-panel {
        margin: 0 0 1rem;
    }
    .mh-curve-plot {
        min-height: 180px;
    }

    /* ── Controls section (sales.php) ────────────────────────────────────── */
    .mh-controls {
        padding: 0.75rem;
    }
    .mh-controls .mh-control {
        width: 100%;
    }
    .mh-controls-note {
        font-size: 0.72rem;
    }

    /* ── Chart containers ────────────────────────────────────────────────── */
    .mh-u-h-300px {
        height: 200px !important;
    }

    /* ── Health cards (dashboard cadence) ─────────────────────────────────── */
    .mh-health-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    /* ── Utility layout overrides ─────────────────────────────────────────── */
    .mh-u-d-flex.mh-u-fw-wrap {
        gap: 0.4rem;
    }
    .mh-u-w-180px {
        width: 100% !important;
    }
    .mh-u-minw-220px {
        min-width: 0 !important;
        width: 100% !important;
    }

    /* ── Filter forms (CRM, Accounts) ────────────────────────────────────── */
    .mh-filter-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
    .mh-filter-bar .mh-control,
    .mh-filter-bar .mh-field {
        width: 100%;
    }
    .mh-filter-bar .mh-select,
    .mh-filter-bar .mh-input {
        width: 100%;
    }

    /* ── Pagination — centered, larger touch targets ─────────────────────── */
    .mh-pagination {
        justify-content: center;
        gap: 0.25rem;
    }
    .mh-pagination a,
    .mh-pagination span {
        min-width: 38px;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* ── Scorecard (sales.php reps) ───────────────────────────────────────── */
    .mh-scorecard {
        grid-template-columns: 1fr 1fr !important;
    }

    /* ── Accounts list ────────────────────────────────────────────────────── */
    .mh-acct-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── Insights row (sales.php accounts tab) ───────────────────────────── */
    .mh-insights-row {
        grid-template-columns: 1fr !important;
    }
    .mh-insight-card {
        padding: 0.75rem;
    }

    /* ── Flex utility: force column on mobile ─────────────────────────────── */
    .mh-u-d-flex.mh-u-ai-center.mh-u-gap-1rem {
        flex-direction: column;
        align-items: stretch;
    }

    /* ── Section headers spacing ──────────────────────────────────────────── */
    .mh-section {
        margin-bottom: 1rem;
    }

    /* ── Team page grid ──────────────────────────────────────────────────── */
    .mh-team-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── Calendar page ────────────────────────────────────────────────────── */
    .mh-cal-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── Settings cards ───────────────────────────────────────────────────── */
    .mh-settings-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── Automation page ──────────────────────────────────────────────────── */
    .mh-auto-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── Invoice detail columns ───────────────────────────────────────────── */
    .mh-inv-detail-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* ── Leads page — stack filters vertically ────────────────────────────── */
    .mh-leads-filters {
        flex-direction: column;
    }

    /* ── Empty state ──────────────────────────────────────────────────────── */
    .mh-empty {
        padding: 2rem 1rem;
    }
    .mh-empty h2 {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   MOBILE KPI CARDS — 2×2 Compact Grid
   Used on dashboard.php and sales.php to replace arc gauges on mobile.
   ========================================================================== */
.mh-mobile-kpi-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.65rem;
    padding: 0.25rem 0 0.5rem;
    margin-bottom: 1rem;
    scroll-snap-type: x mandatory;
}
.mh-mobile-kpi-grid::-webkit-scrollbar { display: none; }

.mh-mobile-kpi-card {
    flex: 0 0 72vw;
    max-width: 280px;
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius-lg);
    padding: 0.85rem 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mh-mobile-kpi-card:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mh-mobile-kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.mh-mobile-kpi-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
    margin: 0.25rem 0;
}

.mh-mobile-kpi-val {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}

.mh-mobile-kpi-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    white-space: nowrap;
}

.mh-mobile-kpi-badge.is-green  { background: #dcfce7; color: #166534; }
.mh-mobile-kpi-badge.is-yellow { background: #fef3c7; color: #854d0e; }
.mh-mobile-kpi-badge.is-red    { background: #fee2e2; color: #991b1b; }
.mh-mobile-kpi-badge.is-none   { background: var(--surface-2); color: var(--gray-600); }

.mh-mobile-kpi-sub {
    font-size: 0.68rem;
    color: var(--gray-500);
    margin-top: 0.2rem;
}

.mh-mobile-kpi-progress {
    height: 3px;
    width: 100%;
    background: var(--gray-100);
    border-radius: 999px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.mh-mobile-kpi-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ==========================================================================
   BOTTOM ACTION SHEETS
   Smooth iOS-style slide-up drawers. Replace modals on mobile.
   ========================================================================== */
.mh-bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mh-bottom-sheet-backdrop.is-open {
    display: block;
    opacity: 1;
}

.mh-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 1rem 1.25rem 2rem;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.mh-bottom-sheet-handle {
    width: 36px;
    height: 5px;
    background: #d1d5db;
    border-radius: 999px;
    margin: 0 auto 1rem;
}

.mh-bottom-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.mh-bottom-sheet-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.mh-bottom-sheet-close {
    background: var(--surface-2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 1.1rem;
}

/* ==========================================================================
   TOUCH CARDS — Tasks, Reminders, Accounts, Invoices, Leads
   Full-width stacked cards replacing data tables on mobile.
   ========================================================================== */
.mh-touch-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.mh-touch-card {
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mh-touch-card:active {
    transform: scale(0.985);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.mh-touch-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mh-touch-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--gray-900);
    text-decoration: none;
    line-height: 1.3;
}
.mh-touch-card-title a {
    color: inherit;
    text-decoration: none;
}

.mh-touch-card-sub {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.mh-touch-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.mh-touch-card-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--surface-2);
    flex-wrap: wrap;
}

.mh-touch-card-actions .mh-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    justify-content: center;
    min-height: 38px;
    font-size: 0.75rem;
}

/* Status indicator dot */
.mh-touch-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.mh-touch-dot.is-green  { background: var(--success); }
.mh-touch-dot.is-yellow { background: var(--warning); }
.mh-touch-dot.is-red    { background: var(--danger); }
.mh-touch-dot.is-muted  { background: var(--gray-400); }

/* ==========================================================================
   HORIZONTAL SWIPE CHIP RAILS
   Single-row scrollable filter chips (prevent vertical wrap on 390px screens).
   ========================================================================== */
.mh-chip-rail {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem;
    padding: 0.2rem 0;
    width: 100%;
    scrollbar-width: none;
}
.mh-chip-rail::-webkit-scrollbar {
    display: none;
}
.mh-chip-rail .mh-btn,
.mh-chip-rail .mh-chip {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   MOBILE BOTTOM DOCK NAVIGATION
   Fixed bottom tab bar for single-thumb one-hand navigation.
   ========================================================================== */
.mh-mobile-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    background: #ffffff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    padding: 0.35rem 0.5rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}

@media (max-width: 1024px) {
    .mh-mobile-dock {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.mh-mobile-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.2rem 0.35rem;
    border-radius: var(--radius);
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    min-width: 48px;
}
.mh-mobile-dock-item.is-active,
.mh-mobile-dock-item:hover {
    color: var(--brand-accent);
}
.mh-mobile-dock-item svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   MOBILE FLOATING ACTION BUTTON
   For key actions (e.g. "Add Reminder", "Update Metrics") on mobile.
   ========================================================================== */
.mh-mobile-fab {
    position: fixed;
    bottom: 80px; /* above the dock */
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: var(--brand-accent);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 16px rgba(4, 83, 205, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    /* It is an <a> on the CRM feed — a link the server acts on, so the action works with JS off. */
    text-decoration: none;
}

.mh-mobile-fab:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(4, 83, 205, 0.25);
}

.mh-mobile-fab svg {
    width: 22px;
    height: 22px;
}

@media (max-width: 1024px) {
    .mh-mobile-fab {
        display: flex;
    }
}

/* ==========================================================================
   MOBILE SUMMARY STRIP
   Horizontal scrolling stat pills at the top of a page.
   ========================================================================== */
.mh-mobile-stats {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0 0.75rem;
}
.mh-mobile-stats::-webkit-scrollbar { display: none; }

.mh-mobile-stat {
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}
.mh-mobile-stat-val {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}
.mh-mobile-stat-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

/* ==========================================================================
   SWIPE-DISMISS HINT (visual feedback for swipeable items)
   ========================================================================== */
.mh-swipe-hint {
    position: relative;
    overflow: hidden;
}
.mh-swipe-hint::after {
    content: '';
    position: absolute;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 4px;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    background: var(--brand-accent-glow);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mh-swipe-hint:active::after {
    opacity: 1;
}

/* ==========================================================================
   CRM NOTIFICATION FEED
   The feed is already card-shaped, so unlike the tables elsewhere in this file it needs no
   mobile replacement — only the adjustments that come from a phone: room under the dock,
   a sticky heading that clears the navbar, and touch targets that meet the 44px minimum.
   ========================================================================== */
@media (max-width: 1024px) {
    .mh-page:has(.mh-nc-feed) {
        /* Clear of the dock AND the FAB above it, so the last card is never trapped behind either. */
        padding-bottom: 8.5rem;
    }

    /* The navbar is not fixed at this width, so the heading pins to the viewport rather than to
       a bar that is no longer there. */
    .mh-nc-section {
        top: 0;
    }

    /* 44px minimum for anything a thumb has to hit. The visual circle stays the size it was — the
       target grows around it, which is the part that was too small, not the mark. */
    .mh-nc-check,
    .mh-nc-more {
        width: 2.75rem;
        height: 2.75rem;
    }
    .mh-nc-main {
        padding: 0.9rem 3.25rem 0.9rem 0.6rem;
    }
    .mh-nc-more {
        top: 0.25rem;
        right: 0.25rem;
    }

    /* One list per thumb-width so the rail is scrolled rather than squinted at. */
    .mh-nc-list {
        min-width: 6.25rem;
    }

    /* Full width on a phone: the indent that shows a stack is nested costs more than it explains
       when there are only 320-odd pixels to spend. */
    .mh-nc-stack-rest {
        padding-left: 0;
    }

    /* Bubbles get the width back — 85% of a phone column is not enough for a real action name. */
    .mh-nc-bubble {
        max-width: 92%;
    }
}
