/* Patient portal — landing, medications, wellness pages.
 *
 * Brand palette:
 *   --forest  #173404
 *   --cream   #faf7f0
 *   --border  #e0ddd4
 *   --muted   #5e6760
 *   --warn    #b86a4f
 *   --good    #4a7a5e
 */

/* =============================================================================
   Shared: page header, empty states, buttons
   ============================================================================= */

.landing-page,
.meds-page,
.wellness-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.landing-page { max-width: 920px; }
.wellness-page { max-width: 920px; }

.meds-page .page-header,
.wellness-page .page-header {
    margin-bottom: 1.5rem;
}

.meds-page .page-header h1,
.wellness-page .page-header h1 {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.875rem;
    color: #173404;
    font-weight: 500;
    margin: 0 0 0.25rem;
}

.meds-page .page-lede,
.wellness-page .page-lede {
    color: #5e6760;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.meds-page .empty-state,
.wellness-page .empty-state {
    background: #faf7f0;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    color: #5e6760;
}

.meds-page .empty-state.warn,
.wellness-page .empty-state.warn {
    background: #fdf6e8;
    border-color: #e8dab5;
}

.meds-page .empty-state p,
.wellness-page .empty-state p { margin: 0.25rem 0; }

.btn-primary {
    background: #173404;
    color: #faf7f0;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
}
.btn-primary:hover { background: #0f2503; }

.btn-link {
    background: none;
    border: none;
    color: #173404;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-size: 0.875rem;
}

.inline-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.muted { color: #8a8276; }

/* =============================================================================
   Landing page
   ============================================================================= */

.landing-page { padding-top: 2rem; }
.landing-header { margin-bottom: 1.5rem; }
.landing-greeting {
    font-family: "Fraunces", Georgia, serif;
    font-size: 2.25rem;
    color: #173404;
    font-weight: 500;
    margin: 0;
}
.landing-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    background: #f0f6e8;
    border: 1px solid #c4ddca;
    border-radius: 8px;
    text-decoration: none;
    color: #2d5942;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
}
.landing-banner:hover { background: #e6efd9; }
.landing-banner-icon { color: #4a7a5e; font-size: 0.75rem; }
.landing-banner-body { flex: 1; }
.landing-banner-body strong { color: #173404; font-weight: 600; }
.landing-banner-arrow { font-size: 1rem; color: #4a7a5e; }
.landing-info-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
    margin-bottom: 2rem;
}
@media (min-width: 640px) {
    .landing-info-row { grid-template-columns: 1fr 1fr; }
}
.landing-card {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 1.125rem 1.25rem;
}
.landing-card-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8a8276;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.landing-card-main {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.25rem;
    color: #173404;
    margin-bottom: 0.25rem;
}
.landing-card-main.muted { color: #8a8276; }
.landing-card-sub { font-size: 0.8125rem; color: #5e6760; }
.landing-card-action {
    display: inline-block;
    margin-top: 0.5rem;
    color: #173404;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: underline;
}
.landing-card-action:hover { color: #0f2503; }

/* Clinic locations on the provider tile. Quiet block under the
   booking link so the patient can see address + phone without
   leaving the dashboard. Multiple locations stack; only the name
   is bold. */
.provider-clinics {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 0.5px solid #e8e3d5;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.provider-clinic-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #5e6760;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.provider-clinic-line {
    font-size: 0.8125rem;
    color: #5e6760;
    line-height: 1.35;
}
.provider-clinic-line a {
    color: #173404;
    text-decoration: none;
}
.provider-clinic-line a:hover { text-decoration: underline; }

/* Provider booking picker. When a provider has more than one
   labeled link, the landing tile renders a <details> element. The
   toggle is styled as a soft outlined pill (not a plain text link)
   so it clearly reads as a tappable control that opens a list of
   appointment types — patients were missing that it was interactive. */
.booking-picker { position: relative; }
.booking-picker > summary {
    list-style: none;
    cursor: pointer;
    text-decoration: none;          /* override the underline that
                                       landing-card-action adds */
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid #b6cf91;
    border-radius: 999px;
    background: #f1f6ea;
    color: #173404;
    font-weight: 600;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.booking-picker > summary:hover,
.booking-picker[open] > summary {
    background: #e7f0da;
    border-color: #94b56a;
}
.booking-picker > summary:focus-visible {
    outline: 2px solid #2f5218;
    outline-offset: 2px;
}
.booking-picker > summary::-webkit-details-marker { display: none; }
.booking-picker-caret {
    display: inline-block;
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}
.booking-picker[open] .booking-picker-caret { transform: rotate(180deg); }
.booking-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 220px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(20, 24, 22, 0.08);
    padding: 4px;
    display: flex;
    flex-direction: column;
}
.booking-picker-item {
    display: block;
    padding: 8px 10px;
    color: #173404;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.booking-picker-item:hover { background: #f4f0e6; color: #0f2503; }
.landing-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}
@media (min-width: 640px) {
    /* auto-fit so 1 or 2 remaining tiles fill the row evenly when an
       admin removes a tile entirely. minmax keeps tiles a sensible
       minimum width on narrow desktops. */
    .landing-tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
.landing-tile {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 1.5rem 1.25rem;
    text-decoration: none;
    color: #173404;
    transition: border-color 0.1s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.landing-tile:hover { border-color: #173404; transform: translateY(-1px); }
.landing-tile-icon { color: #173404; margin-bottom: 0.25rem; }
.landing-tile-name {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.25rem;
    color: #173404;
}
.landing-tile-sub { font-size: 0.8125rem; color: #5e6760; line-height: 1.4; }

/* Grayed-out tile shown when an admin has hidden the underlying tab.
   Keeps the tile in the grid so the patient knows the section exists,
   but pushes the whole tile into a desaturated, low-contrast state so
   it reads as "not available" at a glance. No hover lift, no pointer
   cursor — every visual affordance for clickability is stripped.
   The "Coming soon!" sub-line is supplied by the template. */
.landing-tile.is-disabled {
    background: #ebe7dc;
    border-color: #cfcabd;
    border-style: dashed;
    color: #9a958a;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.7;
    filter: grayscale(1);
    box-shadow: none;
}
.landing-tile.is-disabled:hover {
    border-color: #cfcabd;
    transform: none;
}
.landing-tile.is-disabled .landing-tile-icon { color: #b8b3a6; }
.landing-tile.is-disabled .landing-tile-name {
    color: #9a958a;
    text-decoration: none;
}
.landing-tile.is-disabled .landing-tile-sub {
    color: #9a958a;
    font-style: italic;
    font-weight: 500;
}

/* =============================================================================
   Medications — two-column layout
   ============================================================================= */

.meds-active-strip {
    background: #f4f8f5;
    border: 1px solid #c4ddca;
    border-radius: 8px;
    padding: 0.875rem 1.125rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.meds-strip-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2d5942;
    font-weight: 600;
}
.meds-strip-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #173404;
}
.strip-status-pill,
.med-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.strip-status-pill.status-arrived { background: #c4ddca; color: #2d5942; }
.strip-status-pill.status-ordered { background: #e6e8ef; color: #3d4a6e; }
.strip-status-pill.status-upcoming { background: #ece8db; color: #5e6760; }
.strip-status-pill.status-requested { background: #ece8db; color: #5e6760; }
.strip-name { font-weight: 500; }
.strip-dose, .strip-note { color: #5e6760; font-size: 0.8125rem; }
.strip-cancel-form {
    margin: 0 0 0 auto;
    padding: 0;
    display: inline-flex;
}

/* Two-column layout */
.meds-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 960px) {
    .meds-two-col {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        gap: 2rem;
    }
}

.meds-col-heading {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.125rem;
    color: #173404;
    font-weight: 500;
    margin: 0 0 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0ddd4;
}

.btn-toggle {
    background: #faf7f0;
    border: 1px solid #d0ccc0;
    color: #5e6760;
    padding: 0.3125rem 0.75rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}
.btn-toggle:hover { border-color: #173404; color: #173404; }
.btn-toggle.is-on {
    background: #173404;
    border-color: #173404;
    color: #faf7f0;
}
.btn-toggle.is-on:hover { background: #0f2503; }

.autorefill-form { margin: 0; }

/* ---- Left column: pickup history ---- */

.meds-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.btn-link.is-disabled {
    color: #b4b0a4;
    cursor: default;
    text-decoration: none;
}

.med-row {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 1rem 1.125rem;
}
.med-row.is-chronic { border-left: 3px solid #173404; }
.med-row-top {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
@media (min-width: 480px) {
    .med-row-top {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}
.med-row-main { flex: 1; min-width: 0; }
.med-name-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.med-name {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.0625rem;
    color: #173404;
}
.med-badge.compound-badge { background: #efebde; color: #5e6760; }
.med-badge.chronic-badge { background: #d8e8db; color: #2d5942; }
.med-meta {
    font-size: 0.875rem;
    color: #5e6760;
    line-height: 1.4;
}
.med-meta strong { color: #173404; font-weight: 600; }
.med-runout {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #5e6760;
}
.med-runout.is-low { color: #b88534; font-weight: 500; }
.med-runout.is-out { color: #b86a4f; font-weight: 600; }
.med-row-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    flex-shrink: 0;
}
@media (min-width: 480px) {
    .med-row-actions { align-items: flex-end; }
}
.action-status {
    font-size: 0.8125rem;
    color: #5e6760;
    font-style: italic;
}
.med-history-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0ede4;
}
.med-history-toggle {
    cursor: pointer;
    font-size: 0.8125rem;
    color: #5e6760;
    user-select: none;
    list-style: none;
}
.med-history-toggle::before { content: "▸ "; display: inline-block; }
.med-history-details[open] .med-history-toggle::before { content: "▾ "; }
.med-history-toggle::-webkit-details-marker { display: none; }
.med-history-list {
    list-style: none;
    padding: 0;
    margin: 0.625rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.med-history-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: #5e6760;
}
.hist-date { color: #173404; font-weight: 500; min-width: 6.5rem; }

/* ---- Right column: compound store ---- */

.store-tile-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.store-tile:target {
    animation: tile-flash 1.2s ease-out;
}
@keyframes tile-flash {
    0%   { box-shadow: 0 0 0 3px #173404; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.store-tile {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    scroll-margin-top: 1rem;  /* nice landing when anchor-scrolled */
}

.store-tile.is-blocked {
    background: #f5f3ec;
    color: #8a8276;
    border-color: #d8d4ca;
}

.store-tile-name {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.0625rem;
    color: #173404;
}

.store-tile.is-blocked .store-tile-name { color: #8a8276; }

/* Inline action rows under the gray reason text: autorefill toggle and
   cancel-request link. Compact so the tile stays the same height. */
.store-tile-ar-form,
.store-tile-cancel-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}
.store-tile.is-blocked .btn-toggle {
    /* Re-enable color on the buttons even though parent is gray. */
    color: #2c2c2a;
    background: #fff;
}
.store-tile.is-blocked .btn-toggle.is-on {
    color: #fff;
    background: #173404;
}
.btn-link-danger {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.8125rem;
    color: #b8615a;
    text-decoration: underline;
    cursor: pointer;
}
.btn-link-danger:hover { color: #8a3e3e; }

.store-tile-reason {
    font-size: 0.875rem;
    line-height: 1.4;
    color: #5e6760;
}
.store-tile-reason p { margin: 0 0 0.5rem; }
.store-tile-reason p:last-child { margin: 0; }
.store-tile-reason a { color: #173404; }
.store-tile-reason ul, .store-tile-reason ol {
    margin: 0.25rem 0 0.5rem;
    padding-left: 1.25rem;
}

.store-dose-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4375rem;
}

.dose-order-details { flex: 0 0 auto; }
.dose-order-details[open] { flex: 1 0 100%; }

.dose-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.4375rem 0.75rem;
    background: #faf7f0;
    border: 1px solid #d0ccc0;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    list-style: none;
    color: #173404;
}
.dose-chip::-webkit-details-marker { display: none; }
.dose-chip:hover { background: #f0ebd8; border-color: #173404; }
.dose-value { font-weight: 600; font-size: 0.9375rem; }
.dose-unit { font-size: 0.75rem; color: #5e6760; }

.dose-order-details[open] .dose-chip {
    background: #173404;
    color: #faf7f0;
    border-color: #173404;
}
.dose-order-details[open] .dose-unit { color: #cfe1d5; }

.dose-chip.is-disabled {
    cursor: not-allowed;
    background: #ece8db;
    border-color: #d8d4ca;
    color: #8a8276;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    flex: 1 0 100%;
    padding: 0.5rem 0.75rem;
}
.dose-chip.is-disabled .dose-chip-label {
    display: flex;
    align-items: baseline;
    gap: 0.3125rem;
}
.dose-chip.is-disabled .dose-value { color: #8a8276; }
.dose-chip.is-disabled:hover { background: #ece8db; border-color: #d8d4ca; }
.dose-disabled-reason {
    font-size: 0.75rem;
    color: #6e6a5e;
    line-height: 1.4;
    width: 100%;
}
.dose-disabled-reason p { margin: 0; }
.dose-disabled-reason a { color: #173404; }

.dose-order-form {
    width: 100%;
    margin-top: 0.625rem;
    padding: 0.875rem;
    background: #faf7f0;
    border: 1px solid #e0ddd4;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.dose-order-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.dose-order-form label {
    font-size: 0.8125rem;
    color: #5e6760;
}
.dose-order-form select {
    /* width:100% + border-box so the full option label
       ("Ship to home (+$30 shipping)") shows without clipping the
       selected value on narrow tiles. */
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    border: 1px solid #d0ccc0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
    background: #fff;
    color: #173404;
}
.field-inline {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.8125rem;
}
.field-inline label { margin: 0; cursor: pointer; }
.field-inline input[type="checkbox"] {
    accent-color: #173404;
    width: 0.9375rem;
    height: 0.9375rem;
}

.btn-toggle.is-locked {
    cursor: default;
    opacity: 0.85;
}

.autorefill-admin-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0ede4;
}
.autorefill-admin-row:last-child { border-bottom: none; }
.ar-admin-name { flex: 1; font-weight: 500; }
.ar-admin-check {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* =============================================================================
   Wellness
   ============================================================================= */

.wellness-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}
@media (min-width: 640px) {
    .wellness-grid { grid-template-columns: repeat(2, 1fr); }
}
.wellness-card {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.wellness-name {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.125rem;
    color: #173404;
    margin: 0;
    font-weight: 500;
}
.wellness-desc {
    font-size: 0.875rem;
    color: #5e6760;
    line-height: 1.5;
    margin: 0;
    /* No flex:1 here: with the description ordered above the tiers,
       stretching it would push tier prices + Book button to the
       bottom with a large whitespace gap. The Book button below
       carries the bottom-pin instead. */
}
/* Pin Book to the bottom of the card so cards in the same grid row
   keep aligned action buttons even when their content has different
   heights. */
.wellness-book { align-self: flex-start; margin-top: auto; }
.wellness-no-link {
    font-size: 0.8125rem;
    color: #8a8276;
    font-style: italic;
}
/* Plan-specific tier prices. A service can have multiple matching
   tiers (e.g. 30 min / 50 min / 75 min massage all pinned to the
   same plan), so prices stack vertically as independent lines.
   When all items in a group share the same tier set, the prices
   render once on the group header (single tile or category-picker
   summary). Otherwise each item carries its own prices inline. */
.wellness-tier-prices {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 4px 0 0;
}
.wellness-card .wellness-tier-price {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #173404;
    line-height: 1.4;
}
.wellness-picker .wellness-tier-price {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #173404;
    line-height: 1.35;
}
.wellness-picker-item .wellness-tier-prices {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 8px;
}
.wellness-picker-item .wellness-tier-price {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #173404;
    white-space: nowrap;
}

/* Plan-gated wellness tiles. Goal is for an ineligible service
   to read as visibly "off" at a glance — patient should not need
   to read the message text to know it's not available to them.
   These rules must live in this stylesheet, not in a
   {% block extra_head %} on wellness.html: base.html doesn't
   declare that block, so Jinja would silently drop them and the
   gated tiles would render identical to eligible ones. */
.wellness-card.is-gated,
.wellness-picker.is-gated,
.wellness-picker-item.is-gated {
    background: #e5dcc4;
    border: 2px dashed #b4a577;
}
.wellness-card.is-gated .wellness-name,
.wellness-picker.is-gated .wellness-name,
.wellness-picker-item.is-gated .wellness-picker-item-name {
    color: #7a6f54;
}
.wellness-card.is-gated .wellness-desc,
.wellness-card.is-gated .wellness-picker-note,
.wellness-picker.is-gated .wellness-picker-note,
.wellness-picker-item.is-gated .wellness-picker-item-desc {
    color: #8a8170;
}
/* Pinned ABOVE the description (template orders it that way) so
   it's the first body text after the title. Same font-size as
   .wellness-desc keeps the visual register consistent. Quiet
   muted-brown color reads as plain factual info rather than a
   warning — the tile's tan background + dashed border do all the
   "this is unavailable" signaling already, no need for the text
   to shout. Medium weight (500) keeps it scannable without
   reading as bolded alarm copy. */
.wellness-gated-message {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #5e5040;
    font-weight: 500;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-style: italic;
}
button.btn-primary[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =============================================================================
   Partnerships — patient-facing partner perk tiles
   =============================================================================
   Same flat white-card grid as wellness (consistent column width, no
   tinted per-section boxes). Each tile is a partner: an optional image
   banner, name, subtitle, a rich-text body holding all the offer detail,
   and an optional call-to-action pinned to the bottom so cards in a row
   keep aligned actions. */
.partner-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}
@media (min-width: 640px) {
    .partner-grid { grid-template-columns: repeat(2, 1fr); }
}
.partner-card {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.partner-card-media {
    /* Logo band. Partner logos come in every shape, so contain (never
       crop, never distort) and center the image inside a fixed-height
       band — every card's image area is the same height regardless of
       the source dimensions, so the grid stays even. */
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #ece8de;
}
.partner-card-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.partner-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    flex: 1;
}
.partner-name {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.125rem;
    color: #173404;
    margin: 0;
    font-weight: 500;
}
.partner-subtitle {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #5a8a72;
    margin: -0.25rem 0 0;
}
.partner-desc {
    font-size: 0.875rem;
    color: #3c3c38;
    line-height: 1.5;
}
.partner-desc :first-child { margin-top: 0; }
.partner-desc :last-child { margin-bottom: 0; }
.partner-cta { align-self: flex-start; margin-top: auto; }

/* Tier price chip toggle. The native checkbox stays visible inside
   the chip (browser-agnostic source of truth) and the chip
   background flips to forest-green on :has-checked so staff also
   get the color cue. Deliberately do not hide the checkbox via
   opacity/pointer-events:none — doing so correlated with
   form-submit hangs in some browsers. */
.tier-plan-chips .chip {
    user-select: none;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.tier-plan-chips .chip:has(input[type="checkbox"]:checked) {
    background: #5a8a72;
    border-color: #5a8a72;
    color: #fff;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.btn-secondary {
    background: transparent;
    color: #173404;
    padding: 0.4375rem 1rem;
    border: 1px solid #173404;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    font-size: 0.875rem;
    display: inline-block;
}
.btn-secondary:hover { background: #173404; color: #faf7f0; }

/* =============================================================================
   Patient Care log (on the Care page, below medications)
   ============================================================================= */
.care-log-section { margin-top: 1.5rem; }
.care-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.care-log-item {
    display: flex;
    gap: 0.875rem;
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 0.875rem 1rem;
}
.care-log-date {
    flex-shrink: 0;
    width: 48px;
    text-align: center;
    padding: 0.25rem 0;
    border-right: 1px solid #ede9df;
    padding-right: 0.875rem;
}
.care-log-month {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #173404;
}
.care-log-day {
    display: block;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.375rem;
    font-weight: 500;
    color: #173404;
    line-height: 1.1;
}
.care-log-body { flex: 1; min-width: 0; }
.care-log-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #2c2c2a;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}
.care-log-title .muted { color: #8a8276; font-weight: 400; }
.care-log-details {
    font-size: 0.8125rem;
    color: #5e6760;
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Patient-facing med label card on /care. Renders inline beneath
   each med's pickup-history line. Visual shorthand: thin tag like a
   pharmacy bottle label, never a CTA. */
.med-label-card {
    margin: 0.625rem 0 0.5rem;
    padding: 0.625rem 0.875rem;
    background: #fbf7ee;
    border: 0.5px solid #d9d2c2;
    border-left: 3px solid #b89a59;
    border-radius: 6px;
}
.med-label-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.med-label-print {
    margin-left: auto;
    font-size: 0.75rem;
    color: #6d4612;
    text-decoration: none;
    padding: 0.1875rem 0.5rem;
    border: 0.5px solid #d9d2c2;
    border-radius: 999px;
    background: #fff8e6;
    white-space: nowrap;
}
.med-label-print:hover {
    background: #f1e6cd;
    border-color: #b89a59;
}
.med-label-icon {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.125rem;
    color: #8a6a1f;
    font-weight: 600;
    line-height: 1;
}
.med-label-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #2c2c2a;
}
.med-label-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 0.125rem 0 0.375rem 1.625rem;
}
.med-label-chip {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    background: #efe4cf;
    color: #6d4612;
    border-radius: 999px;
}
.med-label-dose {
    font-size: 0.8125rem;
    color: #4a3f25;
    font-weight: 500;
}
.med-label-instructions {
    font-size: 0.8125rem;
    color: #2c2c2a;
    line-height: 1.45;
    margin: 0.25rem 0 0 1.625rem;
    white-space: pre-wrap;
}
.med-label-footnote {
    font-size: 0.6875rem;
    color: #8a8276;
    margin: 0.375rem 0 0 1.625rem;
    font-style: italic;
}

/* "Your [service] was on us!" — credit-applied wellness action.
   Warmer cream-yellow card with a star, signals membership value. */
.care-log-item.is-on-us {
    background: linear-gradient(135deg, #fff8e6 0%, #fef3d3 100%);
    border-color: #e8c97a;
    box-shadow: 0 1px 0 rgba(180, 140, 30, 0.05);
}
.care-log-item.is-on-us .care-log-month,
.care-log-item.is-on-us .care-log-day {
    color: #8a5a1f;
}
.care-log-item.is-on-us .care-log-date {
    border-right-color: #e8c97a;
}
.care-log-item.is-on-us .care-log-title {
    color: #6d4612;
}
.care-log-item.is-on-us .care-log-title strong {
    color: #4a2f08;
    font-weight: 600;
}
.care-log-onus-note {
    font-size: 0.75rem;
    color: #8a5a1f;
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
    font-style: italic;
}
.on-us-badge {
    display: inline-block;
    color: #c69b00;
    margin-right: 0.25rem;
    font-size: 0.875rem;
}

/* =============================================================================
   Wellness — credits + multi-item category picker
   ============================================================================= */
/* ============================================================
   Upcoming labs — recheck tiles
   ============================================================ */

.upcoming-labs-section {
    margin: 28px 0 36px;
}

.upcoming-labs-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 18px;
    font-weight: 500;
    color: #173404;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}

/* The tile */
.recheck-tile {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e0ddd4;
    border-left: 4px solid #173404;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.recheck-tile:hover {
    box-shadow: 0 4px 16px rgba(23, 52, 4, 0.06);
    transform: translateY(-1px);
}

/* Calendar block on the left */
.cal-tile {
    flex-shrink: 0;
    width: 80px;
    background: #faf7f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    text-align: center;
    border-right: 1px solid #e0ddd4;
}
.cal-tile-month {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #173404;
    margin-bottom: 4px;
}
.cal-tile-day {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 32px;
    font-weight: 500;
    line-height: 1;
    color: #173404;
}

/* Body */
.recheck-body {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.recheck-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 17px;
    font-weight: 500;
    color: #173404;
    margin: 0;
    line-height: 1.3;
}
.recheck-meta {
    font-size: 13px;
    color: #5e6760;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.recheck-when { color: #173404; font-weight: 500; }
.recheck-dot { color: #b4b0a4; }
.recheck-countdown { color: #5e6760; font-style: italic; }

/* Action buttons — first is primary, rest are outline */
.recheck-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.recheck-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #173404;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}
.recheck-btn:first-child {
    background: #173404;
    color: #faf7f0;
}
.recheck-btn:first-child:hover {
    background: #0f2503;
    text-decoration: none;
}
.recheck-btn + .recheck-btn {
    background: transparent;
    color: #173404;
}
.recheck-btn + .recheck-btn:hover {
    background: #173404;
    color: #faf7f0;
    text-decoration: none;
}

/* Urgency accents — left border + cal-tile tint */
.recheck-tile.is-overdue,
.recheck-tile.is-urgent {
    border-left-color: #b86a4f;
}
.recheck-tile.is-overdue .cal-tile,
.recheck-tile.is-urgent .cal-tile {
    background: #f8ebe5;
}
.recheck-tile.is-overdue .cal-tile-month,
.recheck-tile.is-overdue .cal-tile-day,
.recheck-tile.is-urgent .cal-tile-month,
.recheck-tile.is-urgent .cal-tile-day {
    color: #8a3f23;
}

.recheck-tile.is-soon {
    border-left-color: #c79454;
}
.recheck-tile.is-soon .cal-tile {
    background: #faf2e5;
}
.recheck-tile.is-soon .cal-tile-month,
.recheck-tile.is-soon .cal-tile-day {
    color: #7a5618;
}

/* "Drawn — waiting for review" state. Calm green sage so the
   patient knows the action is on the clinic, not on them. Lighter
   than the optimal-green so this reads as informational rather
   than as a success cue. */
.recheck-tile.is-waiting {
    border-left-color: #6c8f6d;
    background: #f3f7f1;
}
.recheck-tile.is-waiting .cal-tile {
    background: #dceadb;
    border-right-color: #c1d6c0;
}
.recheck-tile.is-waiting .cal-tile-month,
.recheck-tile.is-waiting .cal-tile-day {
    color: #3a5616;
}
.recheck-tile.is-waiting .recheck-title {
    color: #3a5616;
}

/* Annual physical — distinctive forest-filled calendar tile + gold star */
.recheck-tile.is-annual .cal-tile {
    background: #173404;
    border-right-color: #0f2503;
}
.recheck-tile.is-annual .cal-tile-month {
    color: #d9b075;
}
.recheck-tile.is-annual .cal-tile-day {
    color: #faf7f0;
}
.recheck-tile.is-annual .recheck-title::before {
    content: "★ ";
    color: #c79454;
    font-size: 14px;
    margin-right: 2px;
}

/* Mobile */
@media (max-width: 520px) {
    .cal-tile {
        width: 62px;
        padding: 12px 6px;
    }
    .cal-tile-day { font-size: 26px; }
    .recheck-body { padding: 14px 16px; }
    .recheck-title { font-size: 15px; }
    .recheck-btn { padding: 6px 12px; font-size: 12px; }
}
@media (max-width: 540px) {
    .recheck-tile { padding: 14px; gap: 12px; }
    .cal-tile { flex: 0 0 54px; width: 54px; }
    .cal-tile-day { font-size: 22px; padding: 6px 0 8px; }
    .recheck-title { font-size: 16px; }
}

.wellness-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0.25rem 0 0.125rem 0;
}
.wellness-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    letter-spacing: 0.01em;
}
/* Plan-included credit, still available */
.wellness-badge.is-available {
    color: #173404;
    background: #e8f1de;
    border: 1px solid #c4d7a8;
}
/* Plan-included credit, already used this period */
.wellness-badge.is-used {
    color: #5e6760;
    background: #f0ece3;
    border: 1px solid #d6cfba;
}
/* One-off bonus credit granted by the clinic */
.wellness-badge.is-bonus {
    color: #8a6a00;
    background: #fff4d6;
    border: 1px solid #e8d59e;
}
.wellness-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.wellness-picker {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}
.wellness-picker > summary {
    list-style: none;
    cursor: pointer;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.wellness-picker > summary::-webkit-details-marker { display: none; }
/* Chunky downward chevron with a circular tint so the toggle
   affordance reads as a button, not just decoration, against a
   content-heavy card. */
.wellness-picker > summary::after {
    content: "▾";
    font-size: 1.1rem;
    color: #173404;
    background: #e7e1cf;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
    flex-shrink: 0;
}
.wellness-picker > summary:hover::after { background: #d8cfb5; }
.wellness-picker[open] > summary::after { transform: rotate(180deg); }

/* Category note + shared booking button — render inside the collapsed summary */
.wellness-picker-note {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: #5e6760;
    font-weight: 400;
    line-height: 1.45;
}
.wellness-picker-book {
    display: inline-flex;
    align-items: center;
    margin-top: 0.625rem;
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
}
.wellness-picker-list {
    border-top: 1px solid #e0ddd4;
    padding: 0.25rem 0;
}
.wellness-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #f0ece3;
}
.wellness-picker-item:first-child { border-top: none; }
.wellness-picker-item-info { flex: 1; min-width: 0; }
.wellness-picker-item-name {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1rem;
    color: #173404;
    margin: 0;
}
.wellness-picker-item-desc {
    font-size: 0.8125rem;
    color: #5e6760;
    margin: 0.125rem 0 0 0;
}
.wellness-picker-item .btn-primary,
.wellness-picker-item .wellness-no-link {
    flex-shrink: 0;
}
/* Flattened Compounds section. Each compound item sits in the grid
   as its own white tile (matching .wellness-card), instead of
   inheriting the connected-row look of .wellness-picker-list. Gated
   compounds keep the .is-gated grey treatment from the shared rule
   above. */
.wellness-compounds-flat .wellness-picker-list {
    display: contents;
    border-top: none;
    padding: 0;
}
.wellness-compounds-flat .wellness-picker-item {
    background: #fff;
    border: 1px solid #e0ddd4;
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
}
.wellness-compounds-flat .wellness-picker-item:first-child { border-top: 1px solid #e0ddd4; }

/* Admin-authored patient announcement banners. Rendered at the top of
   the main content area on targeted pages; variant sets the palette. */
.patient-banner {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    border: 0.5px solid transparent;
}
.patient-banner-title { font-weight: 600; margin-right: 6px; }
.patient-banner--info  { background: #eef3fb; border-color: #b9cdea; color: #24405e; }
.patient-banner--deal  { background: #eaf5ec; border-color: #b6d8bd; color: #22563a; }
.patient-banner--alert { background: #fdf0ec; border-color: #e2b7a9; color: #8a3e2f; }

/* Expandable banner: short message sits in the summary (always
   visible, click to reveal the longer details). */
.patient-banner-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.patient-banner-details summary::-webkit-details-marker { display: none; }
.patient-banner-caret {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.15s ease;
}
.patient-banner-details[open] .patient-banner-caret { transform: rotate(180deg); }
.patient-banner-body {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 0.5px solid currentColor;
    font-size: 13px;
    line-height: 1.55;
    opacity: 0.92;
}

/* Per-tier booking link — a clear green button so it reads as an
   action next to the price instead of getting lost as plain text. */
.wellness-tier-book {
    display: inline-block;
    background: #173404;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.2;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 4px;
    vertical-align: middle;
}
.wellness-tier-book:hover,
.wellness-tier-book:focus {
    background: #0f2503;
    color: #fff !important;
    text-decoration: none;
}
