/* ---------------------------------------------------------------- bell --- */

.notif {
    position: relative;
    display: inline-flex;
}

.notif__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--navy);
    cursor: pointer;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.notif__trigger:hover,
.notif__trigger:focus-visible {
    background: var(--mist);
}

.notif__trigger--attention > svg {
    transform-origin: 50% 20%;
    animation: notif-bell-jump 2.8s ease-in-out infinite;
}

.notif.is-open .notif__trigger--attention > svg {
    animation: none;
}

@keyframes notif-bell-jump {
    0%, 58%, 100% { transform: translateY(0) rotate(0); }
    68% { transform: translateY(-5px) rotate(-12deg); }
    76% { transform: translateY(0) rotate(9deg); }
    85% { transform: translateY(-2px) rotate(-5deg); }
    93% { transform: translateY(0) rotate(2deg); }
}

.notif__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid var(--white);
    border-radius: var(--radius-pill);
    background: #c2402f;
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.notif__panel {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: 260;
    width: min(23rem, calc(100vw - 2rem));
    max-height: min(32rem, calc(100vh - 7rem));
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-md);
    overscroll-behavior: contain;
}

.notif__panel[hidden] {
    display: none;
}

.notif__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.65rem 0.35rem;
}

.notif__title {
    margin: 0;
    color: var(--navy);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.notif__close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.notif__close:hover,
.notif__close:focus-visible {
    background: var(--mist);
    color: var(--navy);
}

.notif__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.notif__link {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1rem 0.7rem;
    padding: 0.7rem;
    border-radius: 12px;
    color: var(--body);
    text-decoration: none;
    transition: background-color 0.2s var(--ease);
}

.notif__link:hover,
.notif__link:focus-visible {
    background: var(--mist);
}

.notif__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: var(--mist);
    color: var(--navy);
}

.notif__item--action .notif__icon {
    background: var(--sand-soft);
    color: var(--sand-deep);
}

.notif__item--clinic-help .notif__icon {
    background: #e6f5f5;
    color: #075f69;
}

.notif__item--clinic-help .notif__due {
    color: #075f69;
}

.notif__body {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.notif__item-title {
    color: var(--navy);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
}

.notif__item--action .notif__item-title {
    font-weight: 700;
}

.notif__item-flag {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    background: #fff1f4;
    color: #933451;
    font-size: 0.6875rem;
    font-weight: 700;
    vertical-align: middle;
}

.account-consents--attention {
    color: var(--navy) !important;
    font-weight: 700 !important;
}

.account-consents__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    margin-left: 0.35rem;
    padding: 0 0.25rem;
    border-radius: 4px;
    background: #fff1f4;
    color: #933451;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.notif__item-text {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.notif__due {
    color: var(--sand-deep);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.notif__cta {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    color: var(--navy);
    font-size: 0.8125rem;
    font-weight: 600;
}

.notif__empty {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    padding: 1.75rem 1rem 1.5rem;
    color: var(--muted);
    text-align: center;
}

.notif__empty p {
    margin: 0;
    font-size: var(--text-sm);
}

/* ------------------------------------------------------------- tab bar --- */

.tabbar {
    display: none;
}

.tabbar__item {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 0.45rem 0.25rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    min-height: 56px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.tabbar__item.is-current {
    color: var(--navy);
}

.tabbar__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 30px;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s var(--ease);
}

.tabbar__item.is-current .tabbar__icon {
    background: var(--mist);
}

.tabbar__count {
    position: absolute;
    top: -2px;
    right: 0;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border: 2px solid var(--white);
    border-radius: var(--radius-pill);
    background: #c2402f;
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tabbar__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------- phone shell --- */

@media (max-width: 860px) {
    .app-shell--client .tabbar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 240;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
    }

    .app-shell--client {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }

    /* The marketing footer is noise inside the account area, and on a phone it
       sits under the tab bar. The staff sign-in link it carries is for staff,
       who are never in this shell. */
    .app-shell--client .footer {
        display: none;
    }

    .app-shell .header__cart,
    .app-shell .header__actions .btn--primary {
        display: none;
    }

    .app-shell .header__inner {
        gap: 0.5rem;
    }

    .app-shell .notif__panel {
        position: fixed;
        top: auto;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-height: calc(100vh - 6rem);
    }

    body.has-notif-open {
        overflow: hidden;
    }

    .app-shell .section {
        padding-block: var(--gap-md);
    }

    .app-shell .shell {
        padding-inline: 1rem;
    }

    .app-shell input,
    .app-shell select,
    .app-shell textarea {
        min-height: 44px;
        font-size: 16px;
    }

    .app-shell .btn {
        min-height: 46px;
    }

    .app-shell .contact-form__actions .btn,
    .app-shell .shop-pay__actions .btn {
        width: 100%;
    }

    .app-shell table:not(.keeps-table) {
        display: block;
    }

    .app-shell table:not(.keeps-table) thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .app-shell table:not(.keeps-table) tr {
        display: grid;
        gap: 0.2rem;
        margin-bottom: 0.75rem;
        padding: 0.85rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: var(--white);
    }

    .app-shell table:not(.keeps-table) td {
        display: grid;
        grid-template-columns: minmax(6.5rem, auto) 1fr;
        gap: 0.75rem;
        padding: 0.2rem 0;
        border: 0;
    }

    .app-shell table:not(.keeps-table) td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.8125rem;
    }

    .app-shell table:not(.keeps-table) td:not([data-label]) {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 720px) {
    .client-signed-in .header__actions {
        width: auto;
        min-width: 0;
        height: auto;
        padding-right: 3.4rem;
        gap: 0.5rem;
    }

    .client-signed-in .notif {
        position: static;
        z-index: 7;
    }

    .client-signed-in .notif__trigger {
        width: 42px;
        height: 42px;
    }

    .client-signed-in .notif__panel {
        position: fixed;
        top: 4.6rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notif__trigger,
    .notif__link,
    .tabbar__item,
    .tabbar__icon {
        transition: none;
    }

    .notif__trigger--attention > svg {
        animation: none;
    }
}

/* ------------------------------------------- account block in the drawer --- */


.nav__account,
.nav__section-label {
    display: none;
}

@media (max-width: 1180px) {
    .nav__account {
        display: grid;
        gap: 0.1rem;
        margin-bottom: 0.9rem;
        padding-bottom: 0.9rem;
        border-bottom: 1px solid var(--line);
    }

    .nav__account-name {
        margin: 0 0 0.35rem;
        color: var(--muted);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .nav__account a,
    .nav__account button {
        display: block;
        width: 100%;
        min-height: 44px;
        padding: 0.6rem 0;
        border: 0;
        background: none;
        color: var(--navy);
        font-family: inherit;
        font-size: 1rem;
        font-weight: 600;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    /* Sign out sits apart from the navigation it is not part of. */
    .nav__account-out {
        margin-top: 0.35rem;
        color: #a3342b !important;
    }

    .nav__section-label {
        display: block;
        margin: 0 0 0.4rem;
        color: var(--muted);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
}

/* --------------------------------------------- staff link in the footer --- */

/* Present for staff who need it, quiet enough that a client scrolling past
   does not read it as something meant for them. */
.footer__staff a {
    opacity: 0.7;
}

.footer__staff a:hover,
.footer__staff a:focus-visible {
    opacity: 1;
}

/* ------------------------------------------------------ client portal --- */

.client-profile__notice {
    max-width: 44rem;
    margin: 0.85rem 0 0;
    color: var(--body);
    line-height: 1.55;
}

.client-activation-dialog {
    width: min(32rem, calc(100vw - 2rem));
    max-height: min(80vh, 42rem);
    overflow-y: auto;
    margin: auto;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 1.5rem 4rem rgb(15 30 35 / 18%);
    color: var(--ink);
}

.client-activation-dialog::backdrop {
    background: rgb(12 27 32 / 64%);
}

.client-activation-dialog__eyebrow {
    margin: 0 0 0.6rem;
    color: var(--navy);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.client-activation-dialog h2 {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1.2;
}

.client-activation-dialog p:not(.client-activation-dialog__eyebrow) {
    margin: 0.9rem 0 0;
    line-height: 1.55;
}

.client-activation-dialog .client-activation-dialog__missing-title {
    margin-top: 1.35rem;
    font-weight: 700;
}

.client-activation-dialog__missing {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1.25rem;
    margin: 0.55rem 0 1.5rem;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.client-activation-dialog__missing li {
    overflow-wrap: anywhere;
}

.client-activation-dialog__action {
    width: 100%;
    text-align: center;
}

.client-dashboard__intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.client-dashboard__intro .about-pill {
    margin-bottom: 0.55rem;
}

.client-dashboard__intro h1 {
    margin: 0;
    color: var(--ink);
    font-size: 2.5rem;
    letter-spacing: 0;
    line-height: 1.12;
}

.client-dashboard__welcome {
    margin: 0.65rem 0 0;
    color: var(--body);
    font-size: 1rem;
}

.client-dashboard__book {
    flex: 0 0 auto;
    white-space: nowrap;
}

.client-dashboard__intro-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.client-dashboard__next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--mist);
}

.client-dashboard__next-main {
    min-width: 0;
}

.client-dashboard__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--navy);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.client-dashboard__next h2 {
    margin: 0;
    color: var(--ink);
    font-size: 1.35rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.client-dashboard__next-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.85rem;
    margin: 0.5rem 0 0;
    color: var(--body);
    font-size: 0.875rem;
}

.client-dashboard__next-meta strong {
    color: var(--ink);
    font-weight: 700;
}

.client-dashboard__next-actions {
    display: grid;
    justify-items: end;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.client-dashboard__status {
    color: var(--navy);
    font-size: 0.8125rem;
    font-weight: 700;
}

.client-dashboard__details-link {
    color: var(--navy);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.client-dashboard__policy {
    max-width: 68rem;
    margin: 1rem 0 1.5rem;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.55;
}

.client-dashboard__section-title {
    margin: 2rem 0 0;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 1.4rem;
    letter-spacing: 0;
    scroll-margin-top: 6rem;
}

.client-dashboard__enquiries {
    margin-bottom: 1.5rem;
    scroll-margin-top: 6rem;
}

.client-dashboard__enquiry-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.client-dashboard__enquiry {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.client-dashboard__enquiry strong {
    color: var(--ink);
    font-size: 1rem;
}

.client-dashboard__enquiry p {
    margin: 0.35rem 0 0;
    color: var(--body);
    font-size: 0.875rem;
    line-height: 1.55;
}

.app-shell--client .shop-orders__table {
    margin-top: 0.7rem;
    line-height: 1.45;
}

.app-shell--client .shop-orders__table td {
    overflow-wrap: anywhere;
}

.app-shell--client .shop-orders__table tbody tr:hover {
    background: var(--mist);
}

.client-dashboard__row-actions {
    white-space: nowrap;
}

.client-dashboard__row-actions form {
    display: inline;
}

.client-dashboard__row-actions .btn {
    margin: 0.1rem 0.2rem 0.1rem 0;
}

@media (min-width: 861px) {
    .app-shell--client main > .section {
        padding-block: 3rem 4rem;
    }
}

@media (max-width: 860px) {
    .client-dashboard__intro h1 {
        font-size: 2.1rem;
    }

    .client-dashboard__next {
        align-items: flex-start;
    }

    .app-shell--client .shop-orders__table tbody tr:hover {
        background: var(--white);
    }

    .app-shell--client .shop-orders__table td {
        grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr);
        gap: 0.5rem;
    }

    .app-shell--client .shop-orders__table td:not([data-label]) {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-dashboard__row-actions form,
    .client-dashboard__row-actions .btn {
        display: block;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .client-activation-dialog__missing {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-dashboard__intro,
    .client-dashboard__next {
        align-items: stretch;
        flex-direction: column;
    }

    .client-dashboard__intro h1 {
        font-size: 1.9rem;
    }

    .client-dashboard__book {
        width: 100%;
    }

    .client-dashboard__intro-actions,
    .client-dashboard__intro-actions .btn {
        width: 100%;
    }

    .client-dashboard__next {
        padding: 1rem;
        gap: 0.85rem;
    }

    .client-dashboard__next-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .client-dashboard__next-actions .btn {
        width: 100%;
    }

    .client-dashboard__section-title {
        font-size: 1.2rem;
    }
}

/* A balance still owed on a missed appointment, in the client's own list. */
.client-dashboard__note {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    line-height: 1.4;
}
