/* PrimeBPM Mobile V2 — ordinary workspace only. Advanced workspace is untouched. */
.ordinary-mobile-v2-home { display: none; }

@media (max-width: 768px) {
    body.ordinary-shell {
        --mobile-v2-page: var(--color-bg, #f4f6fa);
        --mobile-v2-surface: var(--color-surface, #fff);
        --mobile-v2-line: var(--color-border, #e2e6ed);
        --mobile-v2-blue: #4f6fd8;
        --mobile-v2-indigo: #5c5aa7;
        --mobile-v2-cyan: #3b8192;
        --mobile-v2-red: #c84f55;
        --mobile-v2-green: #3f8064;
        --mobile-v2-gray: #697386;
        background: var(--mobile-v2-page);
    }

    body.ordinary-shell .main-area {
        background: var(--mobile-v2-page);
    }

    body.ordinary-shell .main-area > #tab-home.tab-content.active.home-simple-active,
    body.ordinary-shell #tab-home .home-mockup[data-home-view="simple"] {
        padding: 0 !important;
        background: var(--mobile-v2-page);
    }

    /* home-summary.css uses two ID selectors with !important and otherwise
       leaks the advanced mobile summary below the ordinary task list. */
    body.ordinary-shell #tab-home .home-mockup[data-home-view="simple"] > #hcMobileSummary {
        display: none !important;
    }

    body.ordinary-shell .home-simple-wunder-shell {
        min-height: calc(100dvh - 124px);
        border: 0;
        border-radius: 0;
        background: var(--mobile-v2-page);
        box-shadow: none;
    }

    body.ordinary-shell #hcSimpleSidebar { display: none !important; }
    body.ordinary-shell .home-simple-main {
        min-height: calc(100dvh - 124px);
        padding-bottom: calc(94px + env(safe-area-inset-bottom));
        overflow: visible;
        background: var(--mobile-v2-page);
    }

    body.ordinary-shell .home-simple-list-header {
        min-height: 54px;
        padding: 8px 16px 6px;
        border: 0;
        background: transparent;
    }

    body.ordinary-shell[data-ordinary-mobile-screen="home"] .home-simple-list-header {
        display: none;
    }

    body.ordinary-shell .home-simple-mobile-lists,
    body.ordinary-shell .home-simple-command { display: none; }

    body.ordinary-shell .home-simple-list-header h2 {
        font-size: 23px;
        font-weight: 740;
        letter-spacing: -.035em;
    }

    body.ordinary-shell .home-simple-list-header p { font-size: 12px; }

    body.ordinary-shell .ordinary-mobile-v2-home {
        display: block;
        padding: 18px 16px 0;
    }

    body.ordinary-shell[data-ordinary-mobile-screen="tasks"] .ordinary-mobile-v2-home {
        display: none;
    }

    .ordinary-mobile-v2-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
    }

    .ordinary-mobile-v2-heading span {
        color: var(--color-text-secondary, #747c8d);
        font-size: 11px;
        font-weight: 650;
        letter-spacing: .03em;
    }

    .ordinary-mobile-v2-heading h2 {
        margin: 2px 0 0;
        color: var(--color-text, #1f2430);
        font-size: 28px;
        font-weight: 760;
        line-height: 1.05;
        letter-spacing: -.045em;
    }

    .ordinary-mobile-v2-heading > button {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--mobile-v2-surface);
        color: var(--color-text-secondary, #747c8d);
        box-shadow: 0 1px 3px rgba(34, 42, 58, .08);
    }

    .ordinary-mobile-v2-heading svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
    }

    .ordinary-mobile-v2-tiles {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .ordinary-mobile-v2-tile {
        --tile-color: var(--mobile-v2-blue);
        min-width: 0;
        min-height: 98px;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: 1fr auto;
        align-items: start;
        gap: 8px;
        padding: 13px 14px 12px;
        border: 0;
        border-radius: 17px;
        background: var(--mobile-v2-surface);
        color: var(--color-text, #1f2430);
        box-shadow: 0 1px 2px rgba(32, 40, 57, .06), 0 7px 20px rgba(32, 40, 57, .04);
        font: inherit;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
    }

    .ordinary-mobile-v2-tile:active { transform: scale(.985); }
    .ordinary-mobile-v2-tile.is-week { --tile-color: var(--mobile-v2-indigo); }
    .ordinary-mobile-v2-tile.is-all { --tile-color: var(--mobile-v2-gray); }
    .ordinary-mobile-v2-tile.is-assignment { --tile-color: var(--mobile-v2-cyan); }
    .ordinary-mobile-v2-tile.is-overdue { --tile-color: var(--mobile-v2-red); }
    .ordinary-mobile-v2-tile.is-done { --tile-color: var(--mobile-v2-green); }

    .ordinary-mobile-v2-tile-icon {
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: var(--tile-color);
        color: #fff;
    }

    .ordinary-mobile-v2-tile-icon svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.75;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .ordinary-mobile-v2-tile > b {
        justify-self: end;
        color: var(--tile-color);
        font-size: 27px;
        line-height: 32px;
        font-variant-numeric: tabular-nums;
    }

    .ordinary-mobile-v2-tile > strong {
        grid-column: 1 / -1;
        overflow: hidden;
        font-size: 14px;
        font-weight: 680;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ordinary-mobile-v2-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 24px 2px 8px;
    }

    .ordinary-mobile-v2-section-head strong {
        color: var(--color-text, #1f2430);
        font-size: 17px;
    }

    .ordinary-mobile-v2-section-head button {
        padding: 6px 0;
        border: 0;
        background: transparent;
        color: var(--mobile-v2-blue);
        font: inherit;
        font-size: 12px;
        font-weight: 650;
    }

    body.ordinary-shell[data-ordinary-mobile-screen="home"] .home-simple-compose {
        display: none;
    }

    body.ordinary-shell .home-simple-main .home-simple-compose {
        margin: 4px 12px 10px;
    }

    body.ordinary-shell .home-simple-main .home-simple-quick-add {
        border: 0;
        border-radius: 14px;
        box-shadow: 0 1px 4px rgba(30, 38, 54, .08);
    }

    body.ordinary-shell .home-simple-main .home-simple-list {
        min-height: 0;
        padding: 0 12px 20px;
        overflow: visible;
        gap: 10px;
        border: 0;
    }

    body.ordinary-shell .home-simple-date-group {
        overflow: hidden;
        border: 0;
        border-radius: 14px;
        background: var(--mobile-v2-surface);
        box-shadow: 0 1px 3px rgba(32, 40, 57, .055);
    }

    body.ordinary-shell .home-simple-date-group-head {
        min-height: 38px;
        padding: 0 13px;
        border: 0;
        background: transparent;
    }

    body.ordinary-shell .home-simple-date-group-head strong { font-size: 13px; }
    body.ordinary-shell .home-simple-date-group-head span,
    body.ordinary-shell .home-simple-date-group-head b { font-size: 10px; }

    body.ordinary-shell .home-simple-task {
        min-height: 56px;
        margin: 0;
        padding: 5px 8px 5px 12px;
        border: 0;
        border-top: 1px solid var(--mobile-v2-line);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body.ordinary-shell .home-simple-date-group-list .home-simple-task:first-child {
        border-top-color: color-mix(in srgb, var(--mobile-v2-line) 72%, transparent);
    }

    body.ordinary-shell .home-simple-task-check {
        width: 30px;
        height: 42px;
    }

    body.ordinary-shell .home-simple-task-check > span {
        width: 21px;
        height: 21px;
        border-width: 1.5px;
    }

    body.ordinary-shell .home-simple-task-main { min-height: 44px; }
    body.ordinary-shell .home-simple-task-title { font-size: 14px; font-weight: 610; }
    body.ordinary-shell .home-simple-task-meta { gap: 7px; font-size: 10px; }
    body.ordinary-shell .home-simple-task-star { width: 36px; height: 42px; }

    body.ordinary-shell .home-simple-task.is-overdue {
        background: color-mix(in srgb, var(--mobile-v2-red) 5%, transparent);
    }

    body.ordinary-shell .home-simple-task.is-overdue .home-simple-task-title-text,
    body.ordinary-shell .home-simple-deadline.is-overdue { color: var(--mobile-v2-red); }

    /* Projects: To Do List/SplenDO-like hierarchy with calm, compact rows. */
    body.ordinary-shell .project-browser {
        min-height: calc(100dvh - 108px);
        padding: 12px 12px calc(96px + env(safe-area-inset-bottom));
        background: var(--mobile-v2-page);
    }

    body.ordinary-shell .project-browser-head {
        padding: 5px 2px 13px !important;
    }

    body.ordinary-shell .project-browser-eyebrow { display: none; }
    body.ordinary-shell .project-browser-head h2 {
        margin: 0;
        color: var(--color-text, #1f2430);
        font-size: 26px;
        letter-spacing: -.04em;
    }
    body.ordinary-shell .project-browser-head-actions { margin-top: 10px; gap: 8px; }
    body.ordinary-shell .project-browser-head-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }
    body.ordinary-shell .project-browser-search {
        width: auto;
        min-height: 40px;
        border: 0;
        border-radius: 12px;
        background: var(--mobile-v2-surface);
        box-shadow: 0 1px 3px rgba(32, 40, 57, .06);
    }

    body.ordinary-shell .project-browser-search > .sr-only { display: none !important; }

    body.ordinary-shell .project-browser-create {
        min-height: 40px;
        padding-inline: 13px;
        border: 0;
        border-radius: 12px;
        background: var(--mobile-v2-indigo);
    }

    body.ordinary-shell .project-browser-columns {
        min-height: 0;
        flex: 0 0 auto;
        overflow: hidden;
        border: 0;
        border-radius: 14px;
        background: var(--mobile-v2-surface);
        box-shadow: 0 1px 4px rgba(32, 40, 57, .07);
    }

    body.ordinary-shell .project-browser-column,
    body.ordinary-shell .project-browser-preview {
        min-height: 0;
        max-height: calc(100dvh - 248px);
        background: var(--mobile-v2-surface);
    }

    body.ordinary-shell .project-browser-column > header {
        min-height: 43px;
        border-bottom-color: var(--mobile-v2-line);
        background: transparent;
        font-size: 13px;
    }

    body.ordinary-shell .project-browser-list {
        max-height: calc(100dvh - 292px);
        padding: 0 10px;
        overflow-y: auto;
    }
    body.ordinary-shell .project-browser-item {
        min-height: 58px;
        grid-template-columns: 32px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 7px 3px;
        border-bottom: 1px solid var(--mobile-v2-line);
        border-radius: 0;
    }

    body.ordinary-shell .project-browser-item::before {
        content: '';
        width: 30px;
        height: 30px;
        border-radius: 9px;
        background: color-mix(in srgb, var(--mobile-v2-indigo) 14%, var(--mobile-v2-surface));
        box-shadow: inset 4px 0 0 var(--mobile-v2-indigo);
    }

    body.ordinary-shell .project-browser-item:last-child { border-bottom: 0; }
    body.ordinary-shell .project-browser-item.is-selected { background: transparent; color: inherit; }
    body.ordinary-shell .project-browser-item strong { font-size: 14px; }
    body.ordinary-shell .project-browser-item small { font-size: 10px; }
    body.ordinary-shell .project-browser-preview { padding: 16px; }

    /* Calendar: Google Calendar mobile patterns, using PrimeBPM data and tokens. */
    body.ordinary-shell .cal-wrap {
        gap: 10px;
        padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
        background: var(--mobile-v2-page);
    }

    body.ordinary-shell .cal-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    body.ordinary-shell #tab-calendar .cal-toolbar-left {
        display: grid;
        grid-template-columns: minmax(110px, 1fr) 34px 34px auto;
        gap: 5px;
        align-items: center;
    }

    body.ordinary-shell #tab-calendar .cal-title {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
        overflow: hidden;
        font-size: 22px;
        letter-spacing: -.035em;
        text-overflow: ellipsis;
    }

    body.ordinary-shell #tab-calendar .cal-nav-btn {
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 50%;
        background: transparent;
    }

    body.ordinary-shell #tab-calendar .cal-toolbar-left .cal-nav-btn:first-child { grid-column: 2; grid-row: 1; }
    body.ordinary-shell #tab-calendar .cal-toolbar-left .cal-nav-btn:nth-child(3) { grid-column: 3; grid-row: 1; }
    body.ordinary-shell #tab-calendar .cal-today-btn {
        grid-column: 4;
        grid-row: 1;
        min-height: 34px;
        width: auto !important;
        min-width: 82px;
        max-width: 92px;
        padding: 0 10px;
        border-radius: 17px;
        background: var(--mobile-v2-surface);
    }

    body.ordinary-shell .cal-toolbar-right {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px;
        margin: 0;
        overflow: visible;
    }

    body.ordinary-shell .cal-view-toggle {
        min-width: 0;
        border: 0;
        border-radius: 11px;
        background: color-mix(in srgb, var(--mobile-v2-line) 48%, transparent);
    }

    body.ordinary-shell .cal-view-btn { min-width: 0; flex: 1 1 auto; padding: 6px 8px; font-size: 11px; }
    body.ordinary-shell .cal-view-btn.active { box-shadow: 0 1px 2px rgba(32, 40, 57, .08); }
    body.ordinary-shell .cal-mobile-filter-btn { min-height: 34px; border-radius: 11px; }

    body.ordinary-shell #tab-calendar .cal-add-btn {
        display: inline-flex !important;
        position: fixed;
        z-index: 51;
        right: 18px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        width: 50px;
        height: 50px;
        justify-content: center;
        padding: 0;
        border-radius: 16px;
        background: var(--mobile-v2-indigo);
        box-shadow: 0 7px 18px rgba(54, 56, 98, .24);
    }

    body.ordinary-shell .cal-add-btn-label { display: none; }
    body.ordinary-shell .cal-add-btn-icon { font-size: 26px; font-weight: 400; }
    body.ordinary-shell .cal-layout { display: block; }
    body.ordinary-shell .cal-body {
        height: min(64dvh, 570px);
        border: 0;
        border-radius: 15px;
        box-shadow: 0 1px 4px rgba(32, 40, 57, .07);
    }

    body.ordinary-shell .cal-month-head {
        padding: 9px 0;
        border-bottom-color: var(--mobile-v2-line);
        background: var(--mobile-v2-surface);
        font-size: 9px;
        letter-spacing: .03em;
    }

    body.ordinary-shell .cal-month-cell {
        padding: 4px 3px;
        border-color: color-mix(in srgb, var(--mobile-v2-line) 72%, transparent);
        background: var(--mobile-v2-surface);
    }

    body.ordinary-shell .cal-month-cell.other-month,
    body.ordinary-shell .cal-month-cell.weekend-cell { background: var(--mobile-v2-surface); }
    body.ordinary-shell .cal-day-num { width: 24px; height: 24px; margin: 0 auto 2px; font-size: 11px; }
    body.ordinary-shell .cal-event-pill { min-height: 13px; gap: 3px; padding: 1px 3px; border: 0; font-size: 8px; }
    body.ordinary-shell .cal-event-pill::before { width: 4px; height: 4px; }
    body.ordinary-shell .cal-list-item { margin-inline: 4px; border: 0; border-radius: 10px; }

    body.ordinary-shell #tab-calendar .cal-aside { display: none; }
    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day {
        position: static;
        width: 100%;
        max-width: none;
        display: block;
        margin-top: 10px;
        padding: 0;
        overflow: hidden;
        border: 0;
        border-radius: 14px;
        background: var(--mobile-v2-surface);
        box-shadow: 0 1px 4px rgba(32, 40, 57, .07);
    }

    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day .cal-aside-head,
    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day .cal-aside-scroll > :not(.cal-daylist) {
        display: none !important;
    }

    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day .cal-aside-scroll {
        overflow: visible;
    }

    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day .cal-daylist {
        display: block !important;
        padding: 12px 13px;
    }

    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day .cal-daylist-head {
        margin-bottom: 7px;
    }

    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day .cal-daylist-title {
        font-size: 14px;
        font-weight: 700;
    }

    body.ordinary-shell #tab-calendar .cal-aside.has-selected-day .cal-daylist-item {
        min-height: 48px;
        padding: 7px 3px;
        border-top: 1px solid var(--mobile-v2-line);
    }

    body.ordinary-shell .cal-aside {
        width: min(92vw, 360px);
        max-width: none;
        border: 0;
        border-radius: 18px 18px 0 0;
    }

    body.ordinary-shell .home-simple-mob-tabbar {
        background: color-mix(in srgb, var(--mobile-v2-surface) 94%, transparent);
        border-top-color: var(--mobile-v2-line);
        box-shadow: 0 -6px 20px rgba(33, 42, 58, .06);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
}

@media (max-width: 380px) {
    .ordinary-mobile-v2-tile { min-height: 90px; padding: 11px 12px; }
    .ordinary-mobile-v2-tile > strong { font-size: 13px; }
    body.ordinary-shell .cal-title { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .ordinary-mobile-v2-tile { transition: none !important; }
}
