/* UX-003: mobile-first PocketClean shell around the existing Cleaner views. */
body.hp-cleaner-shell-page {
    --hp-cleaner-header-height: 68px;
    --hp-cleaner-nav-height: 72px;
    background: var(--hp-bg);
    color: var(--hp-text);
    min-height: 100dvh;
    padding-bottom: 0;
}

.hp-cleaner-shell {
    min-height: 100dvh;
}

.hp-cleaner-shell [data-cleaner-shell-panel].hidden {
    display: none;
}

.hp-cleaner-header {
    background: var(--hp-green-900);
    color: var(--hp-white);
    height: var(--hp-cleaner-header-height);
    position: sticky;
    top: 0;
    z-index: var(--hp-z-sticky);
}

.hp-cleaner-header__inner {
    align-items: center;
    display: flex;
    gap: var(--hp-space-3);
    height: 100%;
    margin: 0 auto;
    max-width: 960px;
    padding: 0 var(--hp-space-4);
}

.hp-cleaner-header__mark {
    align-items: center;
    background: var(--hp-sand-100);
    border-radius: var(--hp-radius-s);
    color: var(--hp-green-900);
    display: inline-flex;
    flex: 0 0 38px;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    letter-spacing: 0.02em;
}

.hp-cleaner-header__copy {
    display: grid;
    min-width: 0;
}

.hp-cleaner-header__product {
    color: color-mix(in srgb, var(--hp-white) 68%, transparent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
}

.hp-cleaner-header__title {
    color: var(--hp-white);
    font-family: var(--hp-font-ui);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-cleaner-header__context {
    color: color-mix(in srgb, var(--hp-white) 74%, transparent);
    font-size: 0.7rem;
    line-height: 1.2;
    margin: 1px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-cleaner-main {
    margin: 0 auto;
    min-width: 0;
    padding-bottom: calc(var(--hp-cleaner-nav-height) + env(safe-area-inset-bottom, 0px));
    width: 100%;
}

.hp-cleaner-main > [data-cleaner-shell-panel]:not(#planning-view) {
    margin: 0 auto;
    max-width: 760px;
    padding: var(--hp-space-5) var(--hp-space-4);
}

.hp-cleaner-shell-panel__card {
    display: grid;
    gap: var(--hp-space-4);
}

.hp-cleaner-shell-panel__card h2,
.hp-cleaner-shell-panel__card p {
    margin: 0;
}

.hp-cleaner-shell-panel__icon {
    align-items: center;
    background: var(--hp-sand-100);
    border-radius: 50%;
    color: var(--hp-green-900);
    display: inline-flex;
    font-size: 1.1rem;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.hp-cleaner-profile__identity {
    border-bottom: 1px solid var(--hp-border);
    display: grid;
    gap: var(--hp-space-1);
    padding-bottom: var(--hp-space-4);
}

.hp-cleaner-profile__identity strong,
.hp-cleaner-profile__identity span {
    overflow-wrap: anywhere;
}

.hp-cleaner-profile__role {
    color: var(--hp-green-900);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hp-cleaner-profile__controls {
    display: grid;
    gap: var(--hp-space-4);
}

.hp-cleaner-bottom-nav {
    align-items: stretch;
    background: var(--hp-surface);
    border-top: 1px solid var(--hp-border);
    bottom: 0;
    box-shadow: 0 -2px 8px rgb(31 58 52 / 6%);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    left: 0;
    min-height: calc(var(--hp-cleaner-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: var(--hp-space-1) max(var(--hp-space-1), env(safe-area-inset-left, 0px)) env(safe-area-inset-bottom, 0px) max(var(--hp-space-1), env(safe-area-inset-right, 0px));
    position: fixed;
    right: 0;
    z-index: var(--hp-z-sticky);
}

.hp-cleaner-bottom-nav--manager {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hp-cleaner-bottom-nav__item {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: var(--hp-radius-s);
    color: var(--hp-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    gap: var(--hp-space-1);
    justify-content: center;
    line-height: 1.1;
    min-height: var(--hp-touch-target);
    min-width: 0;
    padding: var(--hp-space-2) var(--hp-space-1);
    transition: background-color var(--hp-transition-fast), color var(--hp-transition-fast);
}

.hp-cleaner-bottom-nav__item i {
    font-size: 1.05rem;
}

.hp-cleaner-bottom-nav__item span {
    max-width: 100%;
    white-space: nowrap;
}

.hp-cleaner-bottom-nav__item:hover {
    background: var(--hp-bg);
    color: var(--hp-green-900);
}

.hp-cleaner-bottom-nav__item.active,
.hp-cleaner-bottom-nav__item[aria-current="page"] {
    background: var(--hp-sand-100);
    color: var(--hp-green-900);
}

.hp-cleaner-bottom-nav__item:focus-visible {
    outline: 3px solid var(--hp-blue-400);
    outline-offset: -3px;
}

.hp-cleaner-shell.is-task-context .hp-cleaner-bottom-nav {
    display: none;
}

.hp-cleaner-shell.is-task-context .hp-cleaner-main {
    padding-bottom: 0;
}

body.hp-cleaner-shell-page #task-view {
    bottom: 0;
    inset-block-start: var(--hp-cleaner-header-height);
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    z-index: var(--hp-z-sticky);
}

body.hp-cleaner-shell-page #task-view .bottom-action-bar {
    padding-bottom: calc(var(--hp-space-4) + env(safe-area-inset-bottom, 0px));
}

.hp-cleaner-work-note {
    background: var(--hp-surface);
    border-bottom: 1px solid var(--hp-border);
    margin-bottom: var(--hp-space-4);
    padding: var(--hp-space-4);
}

#cleaner-name-display {
    min-width: 0;
    overflow-wrap: anywhere;
}

.hp-cleaner-work-note__heading {
    align-items: baseline;
    display: flex;
    gap: var(--hp-space-2);
    justify-content: space-between;
}

.hp-cleaner-work-note__heading label {
    color: var(--hp-text);
    font-weight: 700;
}

.hp-cleaner-work-note__heading span,
.hp-cleaner-work-note p,
.hp-cleaner-work-note__counter {
    color: var(--hp-muted);
    font-size: 0.82rem;
}

.hp-cleaner-work-note p {
    margin: var(--hp-space-1) 0 var(--hp-space-3);
}

.hp-cleaner-work-note__input {
    min-height: 104px;
    resize: vertical;
    width: 100%;
}

.hp-cleaner-work-note__input[readonly] {
    background: var(--hp-surface-subtle);
    color: var(--hp-text-secondary);
}

.hp-cleaner-work-note__readonly {
    background: var(--hp-surface-subtle);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-s);
    color: var(--hp-text);
    overflow-wrap: anywhere;
    padding: var(--hp-space-3) var(--hp-space-4);
    white-space: pre-wrap;
}

.hp-checklist-room-summary {
    align-items: center;
    background: var(--hp-surface-subtle);
    border-radius: var(--hp-radius-s);
    display: flex;
    gap: var(--hp-space-3);
    justify-content: space-between;
    margin-top: var(--hp-space-3);
    padding: var(--hp-space-3);
}

.hp-checklist-room-summary > span {
    color: var(--hp-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.hp-checklist-room-complete {
    flex: 0 0 auto;
    min-height: var(--hp-touch-target);
    width: auto;
}

.hp-special-extras-card {
    border-left: 4px solid var(--hp-warning);
}

.hp-special-extras-card .room-header {
    color: var(--hp-text);
}

.hp-special-extras-card .room-header span {
    align-items: center;
    display: inline-flex;
    gap: var(--hp-space-2);
}

.hp-special-extras-help {
    color: var(--hp-muted);
    font-size: 0.82rem;
    margin: 0;
    padding: 0 0 var(--hp-space-2);
}

.check-item--special-extra {
    background: color-mix(in srgb, var(--hp-sand-100) 45%, transparent);
    margin-inline: calc(var(--hp-space-2) * -1);
    padding-inline: var(--hp-space-2);
}

@media (max-width: 520px) {
    .hp-checklist-room-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .hp-checklist-room-complete {
        justify-content: center;
        width: 100%;
    }
}

.hp-cleaner-work-note__counter {
    display: block;
    margin-top: var(--hp-space-1);
    text-align: right;
}

@media (min-width: 768px) {
    body.hp-cleaner-shell-page {
        --hp-cleaner-header-height: 72px;
        --hp-cleaner-nav-height: 76px;
    }

    .hp-cleaner-main #planning-view > .container,
    body.hp-cleaner-shell-page #task-content {
        margin-inline: auto;
        max-width: 820px;
        width: 100%;
    }

    .hp-cleaner-main #planning-view > .container {
        padding: var(--hp-space-6);
    }

    .hp-cleaner-bottom-nav {
        border: 1px solid var(--hp-border);
        border-bottom: 0;
        border-radius: var(--hp-radius-l) var(--hp-radius-l) 0 0;
        left: 50%;
        max-width: 720px;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - (2 * var(--hp-space-6)));
    }

    body.hp-cleaner-shell-page #task-view {
        left: 0;
        margin-inline: auto;
        max-width: 880px;
        right: 0;
        width: 100%;
    }

    body.hp-cleaner-shell-page #task-view .bottom-action-bar {
        left: 0;
        margin-inline: auto;
        max-width: 880px;
        right: 0;
    }
}

@media (max-width: 389px) {
    .hp-cleaner-bottom-nav__item {
        font-size: 0.62rem;
    }

    .hp-cleaner-bottom-nav--manager .hp-cleaner-bottom-nav__item {
        font-size: 0.58rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-cleaner-bottom-nav__item {
        transition: none;
    }
}
