/* ==================== GLOBAL BACKGROUND ==================== */

/* static/css/global.css */

/* ==================== TEXT COLOUR TOKENS (no black text anywhere) ====================
   The site's text colour is the teal-navy #00537d. Bootstrap 5.3 components
   (tables, form controls, list groups, dropdowns, modals, .text-body /
   .text-emphasis, and .text-dark) otherwise default to near-black (#212529 / #000)
   via its design tokens and don't inherit our body colour. Re-point those tokens to
   the navy here — global.css loads after Bootstrap (see base.html), so this wins — so
   every component, including the staff scheduler and curator screens, renders navy
   instead of black. NB: drawing/canvas colours (black pen, shape fills, kaleidoscope
   pre-fill, etc.) are user content, live in JS/Python, and are intentionally untouched;
   muted/secondary grey stays grey. */
:root {
    --bs-body-color: #00537d;
    --bs-body-color-rgb: 0, 83, 125;
    --bs-emphasis-color: #00537d;
    --bs-emphasis-color-rgb: 0, 83, 125;
    --bs-heading-color: #00537d;
    --bs-dark-rgb: 0, 83, 125;
}

/* De-emphasised text: a softer navy (not grey / near-black) so secondary copy —
   subtitles, hints, timestamps, "None." placeholders — stays on-brand while
   still reading a touch lighter than headings and body. */
.text-muted,
.text-body-secondary,
.text-secondary {
    color: rgba(0, 83, 125, 0.78) !important;
}

/* Page-intro line — the quiet one-liner under a page title. Replaces the
   old `opacity-75` fade on text, which measured ≈3.0–3.7:1 on the green
   wash (below WCAG AA); full navy at a slightly smaller size keeps the
   soft voice and passes (docs/style_report_2026-08-14.md §1.4). Don't
   fade text with opacity utilities — de-emphasise by size or the muted
   colour instead. */
.th-page-intro {
    font-size: 0.95rem;
}

/* ==================== GLOBAL BACKGROUND ==================== */

body,
.site-header,
.site-footer {
    background-color: #c2d4a6;
    background-image: linear-gradient(
        180deg,
        #d5e2be 0%,
        #c2d4a6 40%,
        #b5c796 100%
    );
    background-attachment: fixed;
}

h1, h2, h3, h4, p {
    color: #00537d;
}

body, p, li, button, .btn {
    font-family: 'Quicksand', sans-serif;
    color: #00537d;
}

h1, h2, h3, h4, h5 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-style: italic;
    color: #00537d;
    letter-spacing: 0.5px;
}

p {
    font-size: 1rem;
    line-height: 1.5;
}

.container-fluid {
    padding: 0 1rem;
}

button,
.btn {
    margin: 5px;
}

.tohygge-logo {
    width: clamp(210px, 30vw, 340px);
    height: auto;
    margin: 0 auto;
    display: block;
}

/* ==================== NAV WRAPPER ==================== */

.th-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ==================== GLOBAL BUTTON STYLE (pink pills) ==================== */

.th-nav-btn,
.th-auth-btn,
.th-mobile-toggle {
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;

    border: 1px solid #ef589c;
    background: #ef589c;
    color: #ffffff !important;

    box-shadow: 0 2px 5px rgba(233, 91, 155, 0.35);

    transition: background 0.15s ease,
                transform 0.1s ease,
                box-shadow 0.15s ease;
}

.th-nav-btn:hover,
.th-nav-btn:focus,
.th-nav-btn:active,
.th-nav-btn.active,
.show > .th-nav-btn.dropdown-toggle,
.th-auth-btn:hover,
.th-auth-btn:focus,
.th-auth-btn:active,
.th-auth-btn.active,
.show > .th-auth-btn.dropdown-toggle {
    background-color: #ffffff !important;
    color: #e01571 !important;
    border-color: #ef589c !important;
    box-shadow: 0 3px 9px rgba(233, 91, 155, 0.45);
    transform: translateY(-1px);
}

.th-auth-btn {
    min-width: 90px;
}

/* Pill classes ride <a> elements as often as <button>s — an anchor pill
   must never inherit Bootstrap's link underline, in any state. */
a.th-nav-btn, a.th-nav-btn:hover, a.th-nav-btn:focus, a.th-nav-btn:active,
a.th-nav-btn-soft, a.th-nav-btn-soft:hover, a.th-nav-btn-soft:focus, a.th-nav-btn-soft:active,
a.th-auth-btn, a.th-auth-btn:hover, a.th-auth-btn:focus, a.th-auth-btn:active {
    text-decoration: none;
}

/* ==================== AUTH FORM FIELDS (login / sign-up) ==================== */
/* Labels stacked above full-width inputs — the mobile-friendly layout: each
   field spans the full width, so long emails / passwords have the most room and
   the fields line up automatically (no per-field width tuning needed). */
.th-auth-form p {
    margin-bottom: 0.85rem;
}
.th-auth-form label {
    display: block;
    margin-bottom: 0.25rem;
}
.th-auth-form input:not([type=checkbox]):not([type=radio]) {
    display: block;
    width: 100%;
}

/* The sign-up honeypot (signup.html, road step 32): parked far off-screen
   rather than display:none, which the better form-filling bots skip. Sits
   outside .th-auth-form so the full-width input rule above never applies. */
.th-hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==================== INLINE TEXT LINK ==================== */

/* Inline text link (not a button) — on-brand deep blue, underlined so it
   reads unmistakably as a link, with a brief pink accent on hover. Used for
   references such as "Terms & Conditions" in body copy and the footer. */
.th-link {
    color: #00537d;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.th-link:hover,
.th-link:focus {
    color: #e01571;
}

/* Soft / secondary variant of the pink pill: white fill, pink outline +
   text, inverts to a solid pink fill on hover. Same geometry as
   .th-nav-btn so the two read as a primary/secondary pair (e.g. the
   gallery announcement modal's "Enter now" vs "Remind me later"). */
.th-nav-btn-soft {
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;

    border: 1px solid #ef589c;
    background: #ffffff;
    color: #e01571 !important;

    box-shadow: 0 2px 5px rgba(233, 91, 155, 0.18);

    transition: background 0.15s ease,
                transform 0.1s ease,
                box-shadow 0.15s ease;
}

.th-nav-btn-soft:hover,
.th-nav-btn-soft:focus,
.th-nav-btn-soft:active {
    background-color: #ef589c !important;
    color: #ffffff !important;
    border-color: #ef589c !important;
    box-shadow: 0 3px 9px rgba(233, 91, 155, 0.35);
    transform: translateY(-1px);
}

/* ==================== APP PICKER ("Or pick another ToHygge") ==================== */

/* The completed-daily screen's app pills (daily_status.html). One width for
   every pill — the longest name, "Flower Arranging", plus a little air — so
   the rows line up, and a name never wraps: the pill classes set no display,
   so a pill on an <a> is an inline box, and a wrapped name split it into two
   half-pills on tablets. Rows wrap centred — 2+2+2+1 on phones, 4+3 on
   tablets and desktop — capped at four pills wide. The group may run a
   little wider than the page's text column, centred on it, so four fit on
   every tablet; never wider than the screen less the usual gutter.
   min-width (not a fixed width) lets a pill grow rather than spill its name
   while the wider fallback font shows before Quicksand has loaded. */
.th-app-picker {
    --th-app-picker-w: min(42rem, 100vw - 1.5rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: var(--th-app-picker-w);
    margin-inline: calc((100% - var(--th-app-picker-w)) / 2);
}

.th-app-picker > a {
    flex: 0 0 auto;
    min-width: 10rem;
    white-space: nowrap;
    text-align: center;
}

/* ==================== DAILY TOHYGGE GALLERY ICONS ==================== */

/* Floating curator-icon cluster on the Daily ToHygge (Phase 5). Pinned
   to the bottom-right corner — clear of the top-edge Recents / Selection
   bars — and only present on days the curator enables an icon. Honours
   iOS safe-area insets and keeps touch-sized targets on every screen. */
.th-daily-gallery-icons {
    position: fixed;
    right: max(0.9rem, env(safe-area-inset-right));
    bottom: max(0.9rem, env(safe-area-inset-bottom));
    z-index: 1030;

    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.th-daily-gallery-btn {
    width: 52px;
    height: 52px;
    border-radius: 999px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #ef589c;
    background: #ef589c;
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1;

    box-shadow: 0 3px 9px rgba(233, 91, 155, 0.4);
    transition: background 0.15s ease,
                transform 0.1s ease,
                box-shadow 0.15s ease;
}

.th-daily-gallery-btn:hover,
.th-daily-gallery-btn:focus,
.th-daily-gallery-btn:active {
    background-color: #ffffff;
    color: #ef589c;
    box-shadow: 0 4px 12px rgba(233, 91, 155, 0.5);
    transform: translateY(-1px);
}

/* Short / landscape viewports (e.g. phones turned sideways): tuck in
   tighter and shrink slightly while staying above the 44px tap target. */
@media (max-height: 480px) {
    .th-daily-gallery-icons {
        gap: 0.45rem;
        right: max(0.6rem, env(safe-area-inset-right));
        bottom: max(0.6rem, env(safe-area-inset-bottom));
    }
    .th-daily-gallery-btn {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
}

/* ==================== ERROR FLASH MESSAGES ==================== */

/* messages.error flashes (MESSAGE_TAGS maps Django's "error" tag to
   Bootstrap's "danger" — see settings.py). Restyled from Bootstrap's
   red to brand pink on white so an error stands out on any page
   without shouting. Errors persist until dismissed (base.html's
   auto-fade exempts .alert-danger). */
.alert-danger {
    --bs-alert-bg: #fff;
    --bs-alert-color: #e01571;
    --bs-alert-border-color: #ef589c;
    font-weight: 600;
}

/* ==================== GALLERY NOTIFICATION BANNER ==================== */

/* In-app banner (base.html) showing the member's latest unread gallery
   notification. Calm, on-brand restyle of the Bootstrap alert: centred,
   soft pink tint, site-blue text, pink accents. */
.gallery-banner.alert {
    margin: 0.75rem auto 1.25rem;
    max-width: 720px;
    padding: 0.7rem 1rem;

    background: #fff4fa;
    border: 1px solid rgba(239, 88, 156, 0.35);
    border-radius: 14px;
    color: #00537d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gallery-banner__icon {
    color: #ef589c;
    font-size: 1.2rem;
    line-height: 1;
}

.gallery-banner .alert-link {
    color: #ef589c;
    font-weight: 600;
    text-decoration: none;
}

.gallery-banner .alert-link:hover {
    text-decoration: underline;
}

.gallery-banner__badge {
    background: #ef589c;
    color: #ffffff;
}

/* ==================== TO HYGGE: CARDS + ACTION LISTS ==================== */

.th-card {
    background: #fdf9f4;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 18px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.th-card-header {
    padding: 1rem 1.1rem 0.75rem 1.1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.th-card-header .th-card-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    color: #00537d;
    margin: 0;
}

.th-card-header .th-card-subtitle {
    margin: 0.25rem 0 0 0;
    color: rgba(0, 83, 125, 0.78);
    font-size: 0.95rem;
}

/* Action list container */
.th-action-list {
    padding: 0.85rem;
}

/* Each row behaves like a pill button but calmer */
.th-action-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: 999px;
    padding: 0.7rem 0.9rem;

    background: #ffffff;
    border: 1px solid rgba(239, 88, 156, 0.55);

    box-shadow: 0 2px 6px rgba(0,0,0,0.06);

    text-decoration: none;
    cursor: pointer;

    transition: background 0.15s ease,
                transform 0.1s ease,
                box-shadow 0.15s ease;
}

.th-action-item + .th-action-item {
    margin-top: 0.65rem;
}

.th-action-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.th-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(239, 88, 156, 0.14);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.th-action-icon i {
    color: #ef589c;
    font-size: 1.05rem;
    line-height: 1;
}

.th-action-text {
    min-width: 0;
}

.th-action-text .th-action-title {
    font-weight: 700;
    color: #00537d;
    margin: 0;
    line-height: 1.1;
}

.th-action-text .th-action-subtitle {
    margin: 0.2rem 0 0 0;
    color: rgba(0, 83, 125, 0.78);
    font-size: 0.9rem;
    line-height: 1.2;
}

.th-action-chevron {
    color: rgba(0, 83, 125, 0.55);
    flex: 0 0 auto;
}

/* Hover/focus = same “pink pill” vibe as th-nav-btn but calmer */
.th-action-item:hover,
.th-action-item:focus,
.th-action-item:active {
    background-color: #fff4fa;
    box-shadow: 0 3px 9px rgba(233, 91, 155, 0.25);
    transform: translateY(-1px);
}

.th-action-item:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(239, 88, 156, 0.18), 0 3px 9px rgba(233, 91, 155, 0.25);
}



/* ==================== INTRO + DAILY HEADING TEXT ==================== */

/* Guest-mode welcome modal (includes/guest_welcome_modal.html). Replaces
   the old inline .th-intro-text header paragraph, which cost every guest
   ~150px of phone canvas via the header-height workspace measurement. */
/* Stack the welcome card above the floating edge discs (Recents right,
   Delete bar left — z-index 1205 in creative_toolbar.css): Bootstrap's
   default modal layer is 1055, so on narrow phones the Recents disc
   poked over the card. Scoped to this modal only — the discs and every
   other modal keep their normal stacking. (The backdrop stays at 1050:
   it's appended to <body>, out of this selector's reach — harmless, the
   card itself now covers the disc.) */
.th-guest-modal {
    --bs-modal-zindex: 1220;
}

.th-guest-modal .modal-content {
    border: none;
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    line-height: 1.45;
}

.th-guest-modal__title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.th-guest-modal .modal-footer {
    border-top: none;
    justify-content: center;
    padding-top: 0;
}

/* Logged-out landing: the static intro excerpt (the opening two paragraphs only).
   No scroll, no height cap — it's short and fits on every screen; the full text
   lives on the Read more page. */
.th-intro-static {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    color: #00537d;
    line-height: 1.45;
}

.th-intro-static p {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

/* Lead/tagline line — a touch larger than the body, slightly heavier and italic.
   Shared by the landing excerpt and the Read more page. */
.th-intro-static .th-intro-lead,
.th-readmore-scroll .th-intro-lead {
    font-size: 1rem;
    font-weight: 500;
    font-style: italic;
}

/* "Read more" pill below the landing excerpt — the standard pink pill, compact,
   always on its own centred line (inline it only wrapped by chance on phones and
   sat at the end of the text line on wider screens). */
.th-readmore {
    display: block;
    width: fit-content;
    margin: 0.5rem auto 0;
    text-decoration: none;
    padding: 0.1rem 0.7rem;
    font-size: 0.8rem;
}

/* Welcome heading on the landing — compact so the blurb, carousel and buttons fit. */
.th-welcome {
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 0.15rem;
}

/* Pink heart sharing the Welcome line (emoji renders in its own colour) */
.th-welcome-heart {
    font-size: 0.8em;
}

/* Thin, semi-transparent scrollbar so the desktop bar matches the calm overlay
   scrollbars on iPhone/iPad. Used on the landing page's scroll areas (the intro
   blurb and the carousel) — deliberately not global. */
.th-subtle-scroll {
    scrollbar-width: thin;                                 /* Firefox */
    scrollbar-color: rgba(0, 83, 125, 0.35) transparent;   /* Firefox: thumb track */
}

.th-subtle-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.th-subtle-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.th-subtle-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(0, 83, 125, 0.35);
    border-radius: 999px;
}

.th-subtle-scroll::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 83, 125, 0.5);
}

/* ==================== LANDING CAROUSEL ==================== */

/* Horizontal showcase of sample creations on the logged-out landing page,
   between the intro blurb and the buttons — always visible (it sits outside the
   scrollable blurb). Pure CSS scroll-snap: the centred slot is a bit over half the
   carousel width (so each neighbour peeks), with matching leading/trailing spacers
   so the first and last image centre too. The slot width is the size dial — a
   bigger slot means bigger images and, via the flex-fill column, less blurb
   showing above it. Slots are transparent, so the fixed site-green background
   shows through wherever a contain-fitted image doesn't fill its square — "the
   background green fills the rest". */
.th-carousel {
    display: flex;
    gap: 0.5rem;
    width: 100%;        /* fill the landing flex column (else the slots collapse) */
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;       /* Firefox: hide the bar to match the clean mobile look */
}

/* Hide the carousel scrollbar on WebKit / Blink too — it still scrolls by swipe /
   trackpad, and the peeking neighbour images signal there's more. Desktop now
   matches the auto-hiding overlay scrollbar mobile already uses. */
.th-carousel::-webkit-scrollbar {
    display: none;
}

.th-carousel__slot {
    flex: 0 0 48%;
    aspect-ratio: 1;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gallery mount: a small white mat + thin coloured hairline + soft shadow on
   each image, so the mixed artworks read as one curated "mounted exhibition"
   while the artwork itself is untouched. The mat hugs the artwork at any
   aspect because the img element wraps its content (max-width/height, not
   width/height) — non-square mug saves get a snug mount. Poetry's snug
   variable-height crop is squared up at load by landing_carousel.js: the
   element is forced square and the letterbox bars painted with the poem's
   own paper colour, corner-sampled from the image (THSquareArt). */
.th-carousel__slot img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #fff;
    padding: 7px;                          /* the mat */
    border: 1.5px solid #00537d;           /* teal hairline (odd slots) */
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 40, 60, 0.18);
}

/* Alternate hairline colour, teal / pink. `nth-child(... of )` counts only the
   slots — the pad spacers are also flex children, so a plain nth-child would
   miscount (the reason this isn't nth-child(even)). */
.th-carousel__slot:nth-child(even of .th-carousel__slot) img {
    border-color: #ef589c;
}

/* Leading/trailing spacers (each = (100% − slot) / 2) so the first/last centre. */
.th-carousel__pad {
    flex: 0 0 26%;
}

/* While the strip is self-turning (landing_carousel.js), snap is suspended —
   mandatory snap would fight the per-frame drift. The class is removed (and
   snap returns) the moment the user touches / clicks / scrolls the strip. */
.th-carousel--drifting {
    scroll-snap-type: none;
}

/* ==================== LANDING LAYOUT ==================== */

/* Guest landing: the header is at least viewport-tall, laid out as a flex column.
   The top group (logo, Welcome, the static intro text) sits at the top; the lower
   section (.th-landing-lower) takes the remaining height and shares it evenly, so
   the leftover divides across the three gaps — text→carousel, carousel→buttons,
   and below the buttons. On a short screen there's nothing to share (snug) and the
   page simply scrolls. Scoped via :has() to the only page whose header holds the
   static intro — the guest landing — so logged-in / play / creative-app pages are
   untouched. svh keeps it correct when a mobile browser's address bar is showing. */
.site-header:has(.th-intro-static) {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

.site-header:has(.th-intro-static) > .container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Lower section: carousel + buttons sharing the leftover height as three even gaps
   (above the carousel, between carousel and buttons, below the buttons). */
.th-landing-lower {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

/* ==================== READ MORE PAGE ==================== */

/* The body is min-vh-100 — it GROWS with content — so on its own the long text just
   makes the page tall and pushes the buttons below the fold. Cap the body to the
   viewport on this page so the flex column below can actually do its job (the text
   box shrinks; the buttons stay put). The min-height override beats Bootstrap's
   `min-vh-100` !important; scoped via :has() to this page only. */
body:has(.th-readmore-page) {
    height: 100svh;
    min-height: 0 !important;
}

/* Pin the three buttons in view and give the rest of the height to the scrollable
   text — the same flex-fill idea as the landing, scoped via :has() to this page so
   `main` on every other page is untouched. The page fills `main` (the area between
   header and footer); the heading and buttons keep their size while the text box
   flexes to fill / shrinks to fit, so the buttons stay visible on any screen. */
main:has(.th-readmore-page) {
    display: flex;
    flex-direction: column;
    /* main is itself a flex item of the body; without min-height:0 its default
       min-height:auto refuses to shrink below the tall text, so the body
       overflows 100svh and the buttons drop below the fold. This completes the
       shrink-chain (body / .th-readmore-page / .th-readmore-scroll all set it). */
    min-height: 0;
}

.th-readmore-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.th-readmore-page .th-welcome,
.th-readmore-page .th-readmore-actions {
    flex: 0 0 auto;
}

.th-readmore-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    overflow-y: auto;
    padding: 0 1rem;
    color: #00537d;
    line-height: 1.5;
}

.th-readmore-scroll p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.th-daily-heading h2 {
    color: #00537d;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ==================== USER PROFILE BUTTON (TOP RIGHT, LOGGED-IN) ==================== */

.th-user-btn {
    border-color: rgba(15, 76, 92, 0.25);
    background: #ffffff;
    color: #00537d;
    font-weight: 500;

    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding-inline: 0.55rem 0.6rem;
    padding-block: 0.25rem;
    border-radius: 999px;

    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.th-user-btn:hover,
.th-user-btn:focus {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(42, 84, 56, 0.16);
}

.th-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;

    background: #ef589c !important;
    color: #ffffff !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.th-user-avatar i {
    color: inherit;
    font-size: 1.05rem;
    line-height: 1;
}

/* ==================== HEADER 3-COLUMN LAYOUT ==================== */

.th-header-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    position: relative;
    padding-top: 0.5rem;
    padding-bottom: 0.2rem;
}

.th-header-col-center img.tohygge-logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.th-header-col-left,
.th-header-col-right {
    display: flex;
    align-items: center;
}

.th-mobile-toggle {
    margin-top: 0 !important;
}

.th-user-btn {
    margin-top: 0 !important;
}

/* ==================== LOGGED-OUT MOBILE NAV STRUCTURE (UNCHANGED) ==================== */

.th-mobile-nav {
    text-align: center;
}

.th-mobile-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;

    width: fit-content;  /* size to content, not full-width — pink-pill convention */
    margin: 0.35rem auto;

    padding-left: 1.1rem;
    padding-right: 1.1rem;

    border-radius: 18px;
}

/* ==================== OFFCANVAS (LOGGED-IN ONLY) ==================== */

.th-offcanvas {
    background: #fdf9f4;
    color: #00537d;
    border-right: 1px solid rgba(0,0,0,0.06);
}

.th-offcanvas .offcanvas-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    color: #00537d;
}

.th-offcanvas-section-title {
    font-weight: 700;
    color: #00537d;
    margin-bottom: 0.5rem;
}

.th-offcanvas-account-meta {
    font-size: 0.9rem;
    color: rgba(0, 83, 125, 0.78);
    margin-bottom: 0.6rem;
}

.th-offcanvas-divider {
    border-color: rgba(0,0,0,0.08);
    margin: 1rem 0;
}

.th-offcanvas-list .list-group-item,
.th-offcanvas-sublist .list-group-item {
    background: #ffffff;
    border-color: rgba(0,0,0,0.06);
    color: #ef589c;
    font-weight: 600;
    padding: 0.75rem 0.85rem;
}

.th-offcanvas-list .list-group-item:hover,
.th-offcanvas-sublist .list-group-item:hover {
    background: #fff4fa;
    color: #ef589c;
}

.th-offcanvas .list-group-item:focus {
    box-shadow: 0 0 0 0.2rem rgba(239, 88, 156, 0.18);
    outline: none;
}

.th-offcanvas-accordion .accordion-item {
    border: 0;
    background: transparent;
}

.th-offcanvas-acc-btn {
    background: #ffffff;
    color: #ef589c;
    font-weight: 700;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    box-shadow: none;

    width: 100%;
    text-align: left;
}


.th-offcanvas-acc-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(239, 88, 156, 0.18);
}

.th-offcanvas-accordion .accordion-button::after {
    filter: grayscale(1);
    opacity: 0.65;
}

/* ==================== OFFCANVAS LAYOUT: scrollable nav + anchored account ==================== */

.th-offcanvas-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden; /* important: prevents the whole body scrolling */
}

/* This region scrolls when nav gets long */
.th-offcanvas-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 0.25rem; /* tiny breathing room for scrollbar */
}

/* Anchored footer */
.th-offcanvas-footer {
    flex: 0 0 auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    background: #fdf9f4; /* match panel background */
}

/* "ToHygge Administration" row (staff only): sits between the "Signed in
   as" line and the Account fold, always visible, with a gap so it reads
   as its own entry when the fold is open beneath it. */
.th-offcanvas-admin-row {
    margin-bottom: 0.5rem;
}

/* Account fold (hamburger view): the "Account" section title doubles as
   the fold's toggle — styled as the title (navy, no card), with the
   accordion chevron as the affordance. Deliberately NOT the white
   .th-offcanvas-acc-btn card: an "Account" card above an "Account" list
   item would read as two identical actions. Collapsed by default so
   Navigation keeps the vertical space on phones; the "Signed in as"
   meta line stays visible either way. */
.th-offcanvas-acct-toggle,
.th-offcanvas-acct-toggle:not(.collapsed) {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0 0 0.35rem 0;
    /* No side margin: the site-wide button margin (5px) on a full-width
       button pushed the title out of line with the list and its chevron
       5px past the panel's edge. */
    margin: 5px 0;
    font-weight: 700;
    color: #00537d;
    box-shadow: none;
    width: 100%;
    text-align: left;
}

.th-offcanvas-acct-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(239, 88, 156, 0.18);
}

/* Account-only mode: the profile (bust) button opens just the Account
   section; the hamburger opens the full menu. Toggled by the header JS
   (.th-offcanvas--account-only on the panel root). Hide the whole nav
   scroll area and flatten the footer so the account block reads as the
   top — and only — section rather than a stranded footer. */
.th-offcanvas--account-only .th-offcanvas-scroll {
    display: none;
}
.th-offcanvas--account-only .th-offcanvas-footer {
    padding-top: 0;
    border-top: 0;
}

/* In account-only mode the fold must stand open — that view IS the
   account menu. Force the collapse visible (stateless — no Bootstrap
   collapse state to leak back into the hamburger view) and retire the
   toggle affordance: title only, no chevron, not tappable. */
.th-offcanvas--account-only #thAccountCollapse {
    display: block !important;
}
.th-offcanvas--account-only .th-offcanvas-acct-toggle {
    pointer-events: none;
}
.th-offcanvas--account-only .th-offcanvas-acct-toggle::after {
    display: none;
}

/* Prevent any horizontal scrollbar UI in the offcanvas */
.th-offcanvas-scroll {
  overflow-x: hidden;
}

/* Ensure children can't force width wider than container */
.th-offcanvas-scroll * {
  max-width: 100%;
}

.th-offcanvas-list,
.th-offcanvas-sublist,
.th-offcanvas-accordion {
  min-width: 0;
}


/* Ensure accordion sits flush with list-group */
.th-offcanvas-accordion {
    margin: 0;
}

.th-offcanvas .th-offcanvas-accordion .accordion-button.th-offcanvas-acc-btn {
  padding: 0.75rem 0.85rem !important;   /* this is the real alignment fix */
  margin: 0 !important;                  /* keep for now if you need it */
}

.th-offcanvas-accordion .accordion-item {
  margin-bottom: 0.5rem;
}


/* ==================== RESPONSIVE TWEAKS ==================== */

@media (max-width: 380px) {
    .th-mobile-toggle,
    .th-mobile-menu-item {
        font-size: 0.85rem;
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .th-daily-heading h2 {
        font-size: 1.4rem;
    }
}

@media (max-height: 900px) {
    .site-header {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .tohygge-logo {
        width: clamp(190px, 26vw, 280px);
    }

    main h2:first-of-type {
        margin-top: 0.5rem;
    }
}

@media (max-height: 700px) {
    .site-header {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .tohygge-logo {
        width: clamp(160px, 24vw, 240px);
    }

    main h2:first-of-type {
        margin-top: 0.35rem;
        font-size: 1.2rem;
    }
}

@media (min-width: 900px) and (orientation: landscape) {
    .tohygge-logo {
        width: clamp(320px, 26vw, 360px);
    }
}

/* ==================== PORTRAIT ROTATE NOTICE ==================== */

/*
 * Creative surfaces (the eight apps, the album, the Workshop) are portrait-
 * only on small screens — in landscape the workspace goes unusably short.
 * Pages mount includes/portrait_rotate_notice.html; these rules keep it
 * hidden everywhere except landscape on a rotatable touch device shorter
 * than an iPad mini (744px landscape viewport height — the smallest screen
 * whose landscape workspace stays practical, hence the 700px cut). The
 * hover/pointer guards exclude desktop browser windows, which can be short
 * but can't be rotated. The width guard excludes wide fixed-landscape touch
 * screens (smart displays — e.g. Nest Hub, 1024×600): they can't rotate
 * either, so a suboptimal workspace beats impossible advice. Every
 * rotatable handheld is ≤ ~960px wide in landscape, so the 1010px cut
 * splits the two classes cleanly.
 */
.th-rotate-notice {
    display: none;
}

@media (orientation: landscape) and (max-height: 700px)
       and (max-width: 1010px)
       and (hover: none) and (pointer: coarse) {
    .th-rotate-notice {
        /* Covers the full viewport, above the offcanvas toolbar panels
           (~1045) and the floating edge buttons (1205). */
        position: fixed;
        inset: 0;
        z-index: 3000;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 1rem;
        text-align: center;
        color: #00537d;
        background-color: #c2d4a6;
        background-image: linear-gradient(
            180deg,
            #d5e2be 0%,
            #c2d4a6 40%,
            #b5c796 100%
        );
    }

    .th-rotate-notice .bi {
        font-size: 3rem;
    }

    .th-rotate-notice p {
        margin: 0;
        font-size: 1.1rem;
    }
}
