/* ============================================================
   mobile.css — single source of truth for mobile-only styles.

   Loaded AFTER base.css in templates/_base.html so source-order
   specificity wins ties. Add ALL phone/tablet rules here; do not
   add mobile-only rules elsewhere.

   Breakpoints used:
     <=768px  tablet portrait + phones (kanban metaphor restoration)
     <=600px  phones only           (header reflow + button compaction)

   The 600px line keeps iPad portrait (768px) on the desktop layout
   for the board-card header, since iPads have room for the row.
   ============================================================ */


/* ============================================================
   Tablet & phone (<=768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Restore the horizontal kanban scroll on mobile.
       Overrides base.css:1041 which forces flex-direction: column.
       Source-order wins because mobile.css loads after base.css. */
    .columns-container {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 16px;
        -webkit-overflow-scrolling: touch;
    }

    .column-wrapper {
        flex: 0 0 85vw;
        max-width: 85vw;
        scroll-snap-align: start;
    }

    /* The board-detail page already gets explicit column widths
       from base.css:1054. Don't double-constrain it here. */
    .board-detail-page .column-wrapper {
        flex: 0 0 280px;
        max-width: 280px;
    }
}


/* ============================================================
   Phones only (<=600px) — header reflow + button compaction
   ============================================================ */
@media (max-width: 600px) {

    /* Stack the dashboard standalone-board card header.
       Scoped to .board-card so .board-detail-page is unaffected. */
    .board-card .board-header-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .board-card .board-actions-section {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-shrink: 1;
        width: 100%;
    }

    .board-card .secondary-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .board-card .board-title {
        min-width: 0;
    }

    /* Primary "Go to board" — keep label, full-width on its row */
    .board-card .primary-btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }

    /* Voice Column V2 is icon-only; keep touch target consistent on phones. */
    .secondary-actions .voice-column-v2-btn {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        padding: 0.5rem;
        margin-left: 0;
        justify-content: center;
        gap: 0;
    }

    /* Delete button -> icon-only on phones.
       JS sets inline cssText (visual-containers.js:1167) — must use !important. */
    .secondary-actions .board-delete-btn .btn-text {
        display: none !important;
    }
    .secondary-actions .board-delete-btn {
        width: 44px !important;
        min-width: 44px !important;
        padding: 0.5rem !important;
        margin-left: 0 !important;
        justify-content: center !important;
        gap: 0 !important;
    }
}


/* ============================================================
   Phase 4: column swipe-indicator dots (injected by
   static/js/mobile/swipe-indicator.js below .columns-container).
   ============================================================ */
.swipe-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 4px;
}
.swipe-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.25);
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}
.swipe-dots span.is-active {
    background: #6366f1;
    transform: scale(1.4);
}


/* ============================================================
   Phase 5 polish — anti-zoom, safe-area, tap targets, accessibility
   ============================================================ */
@media (max-width: 768px) {
    /* iOS auto-zooms when an input has computed font-size < 16px.
       Bootstrap's `.form-control` sets `font-size: 1rem` and the project's
       ui-scale-80.css drops the root to 12.8px, so without !important
       Bootstrap wins and we get 12.8-15px inputs that trigger iOS zoom. */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Safe-area for iPhone notch / Dynamic Island. _base.html sets
       viewport-fit=cover so the page goes edge-to-edge; offset the
       fixed header so its content clears the notch. */
    .header-fixed {
        padding-top: max(env(safe-area-inset-top), 0px);
        padding-left: max(env(safe-area-inset-left), 0px);
        padding-right: max(env(safe-area-inset-right), 0px);
    }

    /* ui-scale-80.css compresses the fixed-header offset to 72px, but the
       phone header is two rows tall. Keep dashboard controls clear of it. */
    .container.with-fixed-header {
        padding-top: calc(92px + max(env(safe-area-inset-top), 0px)) !important;
        transform-origin: center calc(92px + max(env(safe-area-inset-top), 0px)) !important;
    }

    html {
        scroll-padding-top: calc(92px + max(env(safe-area-inset-top), 0px)) !important;
    }

    .header-fixed .header-content {
        gap: 0.45rem;
        padding: 0.35rem 0.8rem 0.55rem;
    }

    .header-fixed h1 {
        margin: 0;
        line-height: 1.2;
    }

    .header-fixed .header-controls {
        justify-content: center;
        width: 100%;
        min-width: 0;
        gap: 0.35rem;
    }

    .header-fixed .search-container {
        flex: 1 1 150px;
        max-width: none;
        padding: 0.34rem 0.65rem;
    }

    .header-fixed .search-input {
        width: 100%;
        min-width: 0;
    }

    /* Bottom navigation / floating elements clear the home-indicator. */
    .mobile-board-detail {
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
    }
}

@media (max-width: 360px) {
    .header-fixed .search-container {
        flex-basis: 128px;
        max-width: 142px;
    }

    .header-fixed .search-input {
        width: 100%;
    }
}

@media (max-width: 600px) {
    /* Universal 44x44 tap target floor for buttons that mobile.css doesn't
       already size explicitly above. Excludes the inline kanban .column-action-btn
       which lives inside a horizontally-scrolled column header where 44x44 is
       too tall — those get a separate 36x36 floor. */
    .mobile-dashboard button:not(.kebab-btn),
    .mobile-board-detail button:not(.column-action-btn),
    .mobile-board-titlebar button {
        min-width: 44px;
        min-height: 44px;
    }

    .mobile-board-detail .column-action-btn {
        min-width: 36px;
        min-height: 36px;
    }
}


/* ============================================================
   Kebab menu for mobile board rows
   ============================================================ */
.mobile-board-row {
    position: relative;
}

.mobile-board-kebab-menu {
    position: absolute;
    top: 100%;
    right: 8px;
    z-index: 100;
    min-width: 160px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.mobile-board-kebab-menu[hidden] {
    display: none;
}

.mobile-board-kebab-menu li {
    margin: 0;
}

.mobile-board-kebab-menu a,
.mobile-board-kebab-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 15px;
    color: #14181f;
    text-decoration: none;
    cursor: pointer;
    min-height: 44px;
}

.mobile-board-kebab-menu a:hover,
.mobile-board-kebab-menu button:hover {
    background: #f3f4f6;
}

.mobile-board-kebab-menu button:disabled,
.mobile-board-kebab-menu button.is-current {
    color: #98a2b3;
    cursor: default;
    opacity: 0.72;
}

.mobile-board-kebab-menu button:disabled:hover,
.mobile-board-kebab-menu button.is-current:hover {
    background: transparent;
}

.mobile-board-kebab-menu .danger {
    color: #dc2626;
}


/* ============================================================
   UI mode toggle (desktop <-> mobile) in the header
   ============================================================ */
.ui-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    font-size: 18px;
}

.ui-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}


/* ============================================================
   Touch-drag visuals (companion to static/js/mobile/touch-drag.js)
   ============================================================ */
.mini-card.mobile-drag-source {
    opacity: 0.25;
    transition: opacity 0.15s ease;
}

.mini-card.mobile-drag-ghost {
    /* Inline cssText in JS owns position/size; this just refines look. */
    border-radius: 8px;
    background: white;
}

.column-wrapper.mobile-drop-target {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.mobile-drop-placeholder {
    margin: 0.5rem 0;
    border: 2px dashed #6366f1;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.12);
}

@media (max-width: 768px) {
    /* Stop iOS / Android from selecting text or showing the callout
       menu when the user long-presses to drag. The trade-off: card
       text isn't copyable on touch (use the edit modal instead).
       Pattern matches Trello / Linear / dnd-kit. */
    .mini-card,
    .mini-card * {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    .mini-card {
        -webkit-user-drag: none;
        touch-action: manipulation;
    }
}


/* ============================================================
   Mobile dashboard working-board surface
   ============================================================ */
.mobile-dashboard .mobile-toolbar {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 0.5rem 0 0.75rem;
}

.mobile-board-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.mobile-board-workspace {
    position: relative;
}

.mobile-board-workspace .mobile-board-row {
    display: flex;
    align-items: stretch;
    min-height: 64px;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
}

.mobile-board-workspace.is-active .mobile-board-row {
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.12);
}

.mobile-board-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 0;
    color: inherit;
    text-align: left;
}

.mobile-board-row-copy {
    min-width: 0;
}

.mobile-board-row-title {
    display: block;
    overflow: hidden;
    color: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-board-row-subtitle {
    display: block;
    margin-top: 0.15rem;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

.mobile-board-row-chevron {
    color: #6b7280;
    font-size: 1.4rem;
    line-height: 1;
}

.mobile-board-row-kebab {
    width: 44px;
    min-width: 44px;
    border: 0;
    border-left: 1px solid var(--border-color, #e5e7eb);
    background: transparent;
    color: #6b7280;
    font-size: 1.25rem;
}

.mobile-inline-board {
    margin: 0.5rem 0 0.75rem;
    padding: 0.65rem 0 0.45rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.mobile-inline-board[hidden] {
    display: none;
}

.mobile-inline-board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0.75rem 0.55rem;
}

.mobile-inline-board-title {
    min-width: 0;
}

.mobile-inline-board-title span,
.mobile-inline-board-title small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-inline-board-title span {
    color: #111827;
    font-size: 0.98rem;
    font-weight: 700;
}

.mobile-inline-board-title small {
    color: #6b7280;
    font-size: 0.78rem;
}

.mobile-open-board-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
    padding: 0 0.7rem;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    background: white;
}

.mobile-dashboard .columns-container {
    gap: 0.75rem;
    padding: 0 0.75rem 0.25rem;
}

.mobile-dashboard .column-wrapper {
    min-height: 260px;
}

.mobile-dashboard .column-header {
    min-height: 42px;
}

.mobile-dashboard .column-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-dashboard .cards-container,
.mobile-dashboard .column-cards {
    min-height: 160px;
}

.mobile-dashboard .mini-card {
    position: relative;
}

.mobile-dashboard .mini-card .card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
    position: static;
    margin-top: 0.5rem;
    opacity: 1;
}

.mobile-dashboard .mini-card .card-action-btn {
    min-width: 32px;
    min-height: 32px;
    margin-left: 0;
}

.mobile-card-move-btn {
    min-width: 44px;
    min-height: 32px;
    padding: 0 0.45rem;
    border: 1px solid #dbe2ea;
    border-radius: 7px;
    background: #f8fafc;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 700;
}

.mobile-move-card-title {
    margin: 0 0 0.75rem;
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 600;
}

.mobile-move-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mobile-move-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 0.9rem;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: white;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
}

.mobile-move-option.is-current::after {
    color: #6366f1;
    content: "Current";
    font-size: 0.75rem;
    font-weight: 700;
}

.mobile-undo-toast {
    position: fixed;
    right: 12px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: #111827;
    color: white;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.32);
}

.mobile-undo-toast[hidden] {
    display: none;
}

.mobile-undo-toast button {
    min-width: 44px;
    min-height: 32px;
    padding: 0 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-weight: 800;
}

@media (max-width: 768px) {
    .mobile-dashboard .column-wrapper {
        flex: 0 0 min(82vw, 320px);
        max-width: min(82vw, 320px);
    }
}


/* ============================================================
   Mobile dashboard aesthetic pass

   Style-only overrides for the working mobile dashboard. Keep the
   existing layout and behavior; make the controls look intentional.
   ============================================================ */
.mobile-dashboard {
    --mobile-ink: #182230;
    --mobile-muted: #667085;
    --mobile-border: #e4e7ec;
    --mobile-border-strong: #d0d5dd;
    --mobile-surface: #ffffff;
    --mobile-surface-soft: #f8fafc;
    --mobile-accent: #2563eb;
    --mobile-accent-soft: #eff6ff;
    --mobile-danger: #dc2626;
    --mobile-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
    --mobile-shadow-soft: 0 4px 12px rgba(16, 24, 40, 0.06);
    color: var(--mobile-ink);
}

@media (max-width: 768px) {
    .header-fixed {
        background: rgba(255, 255, 255, 0.96);
        border-bottom-color: #e6e9f0;
        box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
    }

    .header-fixed h1 {
        color: #111827;
        font-size: 1.08rem;
        font-weight: 800;
        letter-spacing: 0;
    }

    .header-fixed .header-controls {
        padding: 0.22rem;
        border: 1px solid #edf0f5;
        border-radius: 10px;
        background: #f8fafc;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .header-fixed .search-container {
        min-height: 36px;
        border-color: #dde3ec;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .header-fixed .search-icon {
        position: relative;
        display: inline-flex;
        width: 16px;
        height: 16px;
        margin-right: 0.42rem;
        font-size: 0;
        opacity: 1;
    }

    .header-fixed .search-icon::before {
        content: "";
        position: absolute;
        top: 1px;
        left: 1px;
        width: 10px;
        height: 10px;
        border: 2px solid #667085;
        border-radius: 50%;
    }

    .header-fixed .search-icon::after {
        content: "";
        position: absolute;
        right: 1px;
        bottom: 2px;
        width: 7px;
        height: 2px;
        border-radius: 999px;
        background: #667085;
        transform: rotate(45deg);
        transform-origin: center;
    }

    .header-fixed .search-input {
        color: #1d2939;
        font-weight: 650;
    }

    .header-fixed .search-input::placeholder {
        color: #667085;
    }

    .header-fixed .profile-link,
    .header-fixed .theme-toggle,
    .header-fixed .ui-mode-toggle {
        min-width: 56px;
        min-height: 36px;
        padding: 0 0.72rem;
        border-color: #dde3ec;
        border-radius: 8px;
        background: #ffffff;
        color: #344054;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0;
        box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
    }

    .header-fixed .profile-link span {
        display: none;
    }

    .header-fixed .profile-link::before {
        content: "Me";
    }

    .header-fixed .theme-toggle,
    .header-fixed .ui-mode-toggle {
        position: relative;
        overflow: hidden;
        font-size: 0;
        color: transparent;
    }

    .header-fixed .theme-toggle::before,
    .header-fixed .ui-mode-toggle::before {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #344054;
        font-size: 0.72rem;
        line-height: 1;
        text-indent: 0;
    }

    .header-fixed .theme-toggle::before {
        content: "Theme";
    }

    .header-fixed .ui-mode-toggle[href*="ui=desktop"]::before {
        content: "Desktop";
    }

    .header-fixed .ui-mode-toggle[href*="ui=mobile"]::before {
        content: "Mobile";
    }

    .header-fixed .profile-link:hover,
    .header-fixed .theme-toggle:hover,
    .header-fixed .ui-mode-toggle:hover {
        border-color: rgba(37, 99, 235, 0.26);
        background: #f5f8ff;
        color: #1d4ed8;
    }

    .header-fixed .theme-toggle:hover::before,
    .header-fixed .ui-mode-toggle:hover::before {
        color: #1d4ed8;
    }
}

.mobile-dashboard .mobile-toolbar {
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid #edf0f5;
}

.mobile-dashboard .new-board-btn {
    min-height: 38px;
    padding: 0 1.05rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, #1f72f2 0%, #155fd8 100%);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
}

.mobile-dashboard .new-board-btn:hover {
    background: #1557ca;
}

.mobile-dashboard .new-group-btn {
    min-height: 38px;
    padding: 0 1.05rem;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2939;
    font-size: 0.9rem;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(16, 24, 40, 0.06);
}

.mobile-dashboard .new-group-btn:hover {
    background: #f2f4f7;
}

.mobile-dashboard .mobile-nested-kanban {
    border: 1px solid rgba(99, 102, 241, 0.20) !important;
    border-left: 3px solid rgba(99, 102, 241, 0.78) !important;
    border-radius: 8px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%) !important;
    box-shadow: var(--mobile-shadow-soft);
}

.mobile-dashboard .nested-kanban-header {
    margin-bottom: 0.65rem !important;
}

.mobile-dashboard .nested-kanban-header button {
    min-width: 36px !important;
    min-height: 36px !important;
    border: 1px solid #dfe4ee !important;
    border-radius: 8px;
    background: #ffffff !important;
    color: #111827;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.mobile-board-list {
    gap: 0.6rem;
}

.mobile-board-workspace .mobile-board-row {
    min-height: 58px;
    border-color: #e1e6ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
}

.mobile-board-workspace.is-active .mobile-board-row {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.mobile-board-toggle {
    padding: 0.7rem 0.85rem;
}

.mobile-board-row-title {
    color: #1d2939;
    font-size: 1rem;
    font-weight: 800;
}

.mobile-board-row-subtitle {
    color: #667085;
    font-size: 0.82rem;
}

.mobile-board-row-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #f2f4f7;
    color: #475467;
    font-size: 1.1rem;
}

.mobile-board-row-kebab {
    width: 42px;
    min-width: 42px;
    border-left-color: #edf0f5;
    color: #667085;
}

.mobile-board-kebab-menu {
    border-color: #e1e6ef;
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(16, 24, 40, 0.16);
}

.mobile-inline-board {
    margin-top: 0.55rem;
    padding: 0.65rem 0 0.5rem;
    border-color: #e1e6ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--mobile-shadow);
}

.mobile-inline-board-header {
    padding: 0 0.75rem 0.6rem;
}

.mobile-inline-board-title span {
    color: #1d2939;
    font-size: 0.96rem;
    font-weight: 800;
}

.mobile-inline-board-title small {
    color: #667085;
}

.mobile-open-board-link {
    min-height: 34px;
    padding: 0 0.75rem;
    border-color: #d8dee8;
    border-radius: 7px;
    background: #ffffff;
    color: #344054;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}

.mobile-dashboard .columns-container {
    gap: 0.65rem;
    padding: 0 0.65rem 0.35rem;
}

.mobile-dashboard .column-wrapper {
    overflow: hidden;
    min-height: 250px;
    border-color: #e1e6ef;
    border-radius: 8px;
    background: #f7f8fb;
    box-shadow: none;
}

.mobile-dashboard .column-wrapper[data-done="true"] {
    opacity: 0.9;
    filter: none;
}

.mobile-dashboard .column-header {
    min-height: 40px;
    padding: 0.75rem 0.85rem;
    border-bottom-color: #e6eaf0;
    background: #ffffff;
    color: #1d2939;
}

.mobile-dashboard .column-title {
    color: #1d2939;
    font-size: 0.96rem;
    font-weight: 800;
}

.mobile-dashboard .cards-container,
.mobile-dashboard .column-cards {
    min-height: 160px;
    padding: 0.7rem;
    padding-bottom: 3.1rem;
}

.mobile-dashboard .mini-card {
    padding: 0.78rem;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(16, 24, 40, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.mobile-dashboard .mini-card:hover {
    border-color: rgba(37, 99, 235, 0.36);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.mobile-dashboard .mini-card-title {
    color: #1d2939;
    font-size: 0.96rem;
    font-weight: 650;
}

.mobile-dashboard .mini-card-description {
    color: #667085;
}

.mobile-dashboard .mini-card .card-actions {
    gap: 0.35rem;
    width: max-content;
    margin-left: auto;
    margin-top: 0.65rem;
    padding: 0.22rem;
    border: 1px solid #edf0f5;
    border-radius: 8px;
    background: #f8fafc;
}

.mobile-dashboard .mini-card .card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: transparent;
    font-size: 0;
}

.mobile-dashboard .mini-card .card-action-btn::before {
    content: "×";
    color: #98a2b3;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1;
}

.mobile-dashboard .mini-card .card-action-btn:hover {
    border-color: #fecaca;
    background: #fff5f5;
}

.mobile-dashboard .mini-card .card-action-btn:hover::before {
    color: var(--mobile-danger);
}

.mobile-card-move-btn {
    min-width: 58px;
    min-height: 34px;
    padding: 0 0.65rem;
    border-color: #dfe4ec;
    border-radius: 7px;
    background: #ffffff;
    color: #344054;
    font-size: 0.76rem;
    font-weight: 800;
    box-shadow: none;
}

.mobile-card-move-btn:hover {
    border-color: rgba(37, 99, 235, 0.32);
    background: #f5f8ff;
    color: #1d4ed8;
}

.mobile-dashboard .add-card-drop-zone {
    height: 52px;
    border-radius: 0 0 8px 8px;
}

.mobile-dashboard .column-wrapper:hover .add-card-drop-zone,
.mobile-dashboard .add-card-drop-zone:hover {
    border-color: #d8dee8;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(37, 99, 235, 0.04));
}

.mobile-dashboard .add-card-drop-zone-text {
    border-radius: 7px;
    color: #475467;
    font-weight: 700;
}

.mobile-move-card-modal .modal-content,
#newBoardModal .modal-content,
#newCardModal .modal-content,
#editCardModal .modal-content {
    border-color: #e1e6ef;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 56px rgba(16, 24, 40, 0.22);
}

.mobile-move-option {
    min-height: 44px;
    border-color: #dfe4ec;
    border-radius: 8px;
    background: #ffffff;
}

.mobile-move-option:hover {
    border-color: rgba(37, 99, 235, 0.32);
    background: #f5f8ff;
}

.mobile-undo-toast {
    border-radius: 8px;
    background: #101828;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.28);
}

[data-theme="dark"] .mobile-dashboard {
    --mobile-ink: #eef2f7;
    --mobile-muted: #98a2b3;
    --mobile-border: #303846;
    --mobile-border-strong: #465164;
    --mobile-surface: #141821;
    --mobile-surface-soft: #10131a;
    --mobile-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    --mobile-shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .mobile-dashboard .mobile-nested-kanban,
[data-theme="dark"] .mobile-inline-board,
[data-theme="dark"] .mobile-board-workspace .mobile-board-row,
[data-theme="dark"] .mobile-dashboard .mini-card,
[data-theme="dark"] .mobile-dashboard .column-header,
[data-theme="dark"] .mobile-open-board-link,
[data-theme="dark"] .mobile-card-move-btn {
    background: #171b24 !important;
    border-color: #303846;
}

[data-theme="dark"] .mobile-dashboard .column-wrapper {
    background: #10131a;
    border-color: #303846;
}

/* ============================================================
   Monochrome light/shadow style layer
   Style-only; keeps mobile drag/drop and navigation behavior intact.
   ============================================================ */
.mobile-dashboard {
    --mobile-ink: var(--text-primary);
    --mobile-muted: var(--text-muted);
    --mobile-border: var(--border-color);
    --mobile-border-strong: var(--text-primary);
    --mobile-surface: var(--bg-card);
    --mobile-surface-soft: var(--bg-secondary);
    --mobile-accent: var(--text-primary);
    --mobile-accent-soft: var(--bg-secondary);
    --mobile-danger: var(--text-primary);
    --mobile-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
    --mobile-shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.swipe-dots span {
    background: rgba(0, 0, 0, 0.22) !important;
}

.swipe-dots span.is-active {
    background: var(--text-primary) !important;
}

@media (max-width: 768px) {
    .header-fixed {
        background: rgba(255, 255, 255, 0.94) !important;
        border-bottom-color: rgba(0, 0, 0, 0.08) !important;
        box-shadow: 0 16px 42px rgba(0, 0, 0, 0.10) !important;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .header-fixed h1 {
        color: var(--text-primary) !important;
        font-weight: 840;
        letter-spacing: 0;
    }

    .header-fixed .header-controls {
        border-color: var(--border-light) !important;
        background: var(--bg-card) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(0, 0, 0, 0.06) !important;
    }

    .header-fixed .search-container,
    .header-fixed .profile-link,
    .header-fixed .theme-toggle,
    .header-fixed .ui-mode-toggle {
        border-color: var(--border-color) !important;
        background: var(--bg-card) !important;
        color: var(--text-primary) !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07) !important;
    }

    .header-fixed .search-icon::before {
        border-color: var(--text-secondary) !important;
    }

    .header-fixed .search-icon::after {
        background: var(--text-secondary) !important;
    }

    .header-fixed .search-input,
    .header-fixed .search-input::placeholder,
    .header-fixed .theme-toggle::before,
    .header-fixed .ui-mode-toggle::before {
        color: var(--text-primary) !important;
    }

    .header-fixed .profile-link:hover,
    .header-fixed .theme-toggle:hover,
    .header-fixed .ui-mode-toggle:hover {
        border-color: var(--text-primary) !important;
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    .header-fixed .theme-toggle:hover::before,
    .header-fixed .ui-mode-toggle:hover::before {
        color: var(--text-primary) !important;
    }
}

/* Keep header controls icon-based and consistently proportioned in narrow
   desktop/forced-desktop views. This only changes presentation. */
@media (max-width: 768px) {
    .header-fixed .profile-link[title="My Profile"],
    .header-fixed .theme-toggle,
    .header-fixed .ui-mode-toggle {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border-radius: 10px !important;
        color: var(--text-primary) !important;
        font-size: 0 !important;
    }

    .header-fixed .profile-link[title="My Profile"] span {
        display: inline-flex !important;
    }

    .header-fixed .profile-link[title="My Profile"]::before,
    .header-fixed .theme-toggle::before,
    .header-fixed .ui-mode-toggle::before {
        content: none !important;
        display: none !important;
    }
}

.mobile-dashboard .mobile-toolbar {
    border-bottom-color: var(--border-light) !important;
}

.mobile-dashboard .new-board-btn {
    background: var(--text-primary) !important;
    border-color: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18) !important;
}

.mobile-dashboard .new-board-btn:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.mobile-dashboard .new-group-btn {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08) !important;
}

.mobile-dashboard .new-group-btn:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--text-primary) !important;
}

.mobile-dashboard .mobile-nested-kanban {
    border: 1px solid var(--border-color) !important;
    border-left: 2px solid var(--text-primary) !important;
    background:
        radial-gradient(circle at 50% -8rem, rgba(0, 0, 0, 0.055), transparent 18rem),
        var(--bg-card) !important;
    box-shadow: var(--mobile-shadow-soft) !important;
}

.mobile-dashboard .nested-kanban-header button,
.mobile-board-workspace .mobile-board-row,
.mobile-inline-board,
.mobile-open-board-link,
.mobile-card-move-btn,
.mobile-move-option,
.mobile-board-kebab-menu,
.mobile-move-card-modal .modal-content,
#newGroupModal .modal-content,
#newBoardModal .modal-content,
#newCardModal .modal-content,
#editCardModal .modal-content {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--mobile-shadow-soft) !important;
}

.mobile-board-workspace.is-active .mobile-board-row,
.mobile-board-workspace .mobile-board-row:hover,
.mobile-open-board-link:hover,
.mobile-card-move-btn:hover,
.mobile-move-option:hover {
    border-color: var(--text-primary) !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--mobile-shadow) !important;
}

.mobile-board-row-title,
.mobile-inline-board-title span,
.mobile-dashboard .column-title,
.mobile-dashboard .mini-card-title {
    color: var(--text-primary) !important;
}

.mobile-board-row-subtitle,
.mobile-inline-board-title small,
.mobile-dashboard .mini-card-description,
.mobile-dashboard .add-card-drop-zone-text,
.mobile-move-card-title {
    color: var(--text-muted) !important;
}

.mobile-board-row-chevron,
.mobile-dashboard .mini-card .card-actions {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-light) !important;
}

.mobile-board-row-kebab {
    border-left-color: var(--border-light) !important;
    color: var(--text-secondary) !important;
}

.mobile-board-kebab-menu .danger,
.mobile-board-kebab-menu .danger:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card) !important;
}

.mobile-dashboard .columns-container {
    gap: 0.72rem;
    isolation: isolate;
}

.mobile-dashboard .column-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary) !important;
    border-color: var(--border-light) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

.mobile-dashboard .column-wrapper + .column-wrapper::before {
    content: "";
    position: absolute;
    top: 0.75rem;
    bottom: 0.75rem;
    left: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--column-divider) 16%, var(--column-divider) 84%, transparent);
    pointer-events: none;
    z-index: 5;
}

.mobile-dashboard .column-header {
    background: var(--bg-card) !important;
    border-bottom-color: var(--border-light) !important;
    color: var(--text-primary) !important;
}

.mobile-dashboard .mini-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08) !important;
}

.mobile-dashboard .mini-card:hover {
    border-color: var(--text-primary) !important;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.14) !important;
}

.mini-card.mobile-drag-ghost {
    background: var(--bg-card) !important;
    border: 1px solid var(--text-primary) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22) !important;
}

.column-wrapper.mobile-drop-target,
.mobile-dashboard .column-wrapper.mobile-drop-target {
    background: rgba(0, 0, 0, 0.04) !important;
    box-shadow: inset 0 0 0 2px var(--text-primary) !important;
}

.mobile-drop-placeholder {
    border-color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.04) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12) !important;
}

.mobile-dashboard .mini-card .card-action-btn:hover {
    border-color: var(--text-primary) !important;
    background: var(--bg-tertiary) !important;
}

.mobile-dashboard .mini-card .card-action-btn::before,
.mobile-dashboard .mini-card .card-action-btn:hover::before {
    color: var(--text-primary) !important;
}

.mobile-dashboard .column-wrapper:hover .add-card-drop-zone,
.mobile-dashboard .add-card-drop-zone:hover {
    border-color: rgba(0, 0, 0, 0.14) !important;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.035)) !important;
}

.mobile-move-option.is-current::after {
    color: var(--text-primary) !important;
}

.mobile-undo-toast {
    background: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28) !important;
}

[data-theme="dark"] .mobile-dashboard {
    --mobile-ink: var(--text-primary);
    --mobile-muted: var(--text-muted);
    --mobile-border: var(--border-color);
    --mobile-border-strong: var(--text-primary);
    --mobile-surface: var(--bg-card);
    --mobile-surface-soft: var(--bg-secondary);
    --mobile-shadow: 0 18px 42px rgba(0, 0, 0, 0.62);
    --mobile-shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.48);
}

[data-theme="dark"] .swipe-dots span {
    background: rgba(255, 255, 255, 0.24) !important;
}

[data-theme="dark"] .swipe-dots span.is-active {
    background: var(--text-primary) !important;
}

@media (max-width: 768px) {
    [data-theme="dark"] .header-fixed {
        background: rgba(0, 0, 0, 0.9) !important;
        border-bottom-color: rgba(255, 255, 255, 0.14) !important;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.74) !important;
    }

    [data-theme="dark"] .header-fixed .header-controls {
        background: var(--bg-secondary) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 28px rgba(0, 0, 0, 0.5) !important;
    }
}

[data-theme="dark"] .mobile-dashboard .mobile-nested-kanban,
[data-theme="dark"] .mobile-inline-board,
[data-theme="dark"] .mobile-board-workspace .mobile-board-row,
[data-theme="dark"] .mobile-dashboard .mini-card,
[data-theme="dark"] .mobile-dashboard .column-header,
[data-theme="dark"] .mobile-open-board-link,
[data-theme="dark"] .mobile-card-move-btn,
[data-theme="dark"] .mobile-move-option,
[data-theme="dark"] .mobile-board-kebab-menu {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .mobile-dashboard .column-wrapper {
    background: var(--bg-secondary) !important;
    border-color: var(--border-light) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .mobile-dashboard .column-wrapper:hover .add-card-drop-zone,
[data-theme="dark"] .mobile-dashboard .add-card-drop-zone:hover {
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.06)) !important;
}

[data-theme="dark"] .column-wrapper.mobile-drop-target,
[data-theme="dark"] .mobile-dashboard .column-wrapper.mobile-drop-target {
    background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .mobile-drop-placeholder {
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.58) !important;
}
