/* ================================================================
 *  custom.css — your own CSS
 *
 *  Loads after the template and theme.css, so a rule here wins any
 *  tie. Every template update ships this file empty: keep your copy
 *  when you update.
 * ================================================================ */

/* ================================================================
 *  HOMESTAY additions
 * ================================================================ */

/* Light/dark switch in the header (assets/js/scheme.js) */
.scheme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.scheme-toggle:hover { background: var(--color-bg-muted); }
.scheme-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.scheme-toggle .scheme-icon-sun { display: none; }
html[data-homestay-scheme="dark"] .scheme-toggle .scheme-icon-sun { display: inline; }
html[data-homestay-scheme="dark"] .scheme-toggle .scheme-icon-moon { display: none; }

/* The fonts, Alegreya and Be Vietnam Pro (why: themes/demo-aparthotel-1.css,
   which loads them). Named again here because that file cannot carry a
   version in its address, so a cached copy may still name the old fonts.
   Headings: the template's tight sans-serif tracking is loosened, and each
   heading's light second line becomes an italic caption. */
:root {
    --font-sans: 'Be Vietnam Pro', system-ui, sans-serif;
    --font-heading: 'Alegreya', Georgia, serif;
    --heading-weight: 500;   /* Alegreya is fuller than the template's sans: 600 reads heavy */
}
html[data-demo="aparthotel-1"] :is(.custom-hero-title, .custom-title) {
    letter-spacing: -0.01em;
}
html[data-demo="aparthotel-1"] :is(.custom-hero-title, .custom-title) span,
html[data-demo="aparthotel-1"] .custom-menu-units .megamenu-statement em {
    font-style: italic;
    font-weight: 400;
}
/* The second line stays in the heading's own ink, a little softer: one
   colour per heading, not two */
html:root[data-demo="aparthotel-1"] :is(.custom-hero-title, .custom-title) span {
    color: color-mix(in oklab, currentColor 80%, transparent);
}

/* Language switch in the header: EN | VI, the current one filled */
.lang-switch {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 3px;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
}
.lang-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    color: var(--color-text-soft);
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.lang-switch a:hover { color: var(--color-text); background: var(--color-bg-muted); }
.lang-switch a[aria-current="page"] { background: var(--color-primary); color: var(--color-on-primary); }
.lang-switch a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.nav-actions { gap: 0.5rem; }

/* The dong sign comes after the figure: a little space before it */
.pricing-amount + .pricing-currency { margin-left: 0.2rem; }

/* Small phones: logo, language switch, light/dark and the menu button on one line */
@media (max-width: 479px) {
    .site-header .brand-logo, header .brand-logo { width: 128px; height: auto; }
    .nav-actions, .nav-meta { gap: 0.25rem; }
    .lang-switch { padding: 2px; }
    .lang-switch a { min-width: 1.75rem; height: 1.75rem; font-size: 0.7rem; }
    .scheme-toggle { width: 2.25rem; height: 2.25rem; }
}
/* Very small phones (under 360px): only the leaf mark, the left square of the logo */
@media (max-width: 359px) {
    .site-header .brand-logo { width: 32px; height: 32px; object-fit: cover; object-position: left center; }
    .site-header .navbar-inner { column-gap: 0.75rem; }
}

/* The short rule before each section label: the label's own green, faint,
   so the terracotta stays for the few small details that need it */
html:root[data-demo="aparthotel-1"] .custom-kicker::before {
    background: currentColor;
    opacity: 0.35;
}

/* ================================================================
 *  Availability calendar on the booking page (assets/js/booking.js,
 *  full nights rendered into the page from the database, #nd-availability)
 * ================================================================ */
.nd-cal {
    position: relative;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    background: var(--color-bg);
}
.nd-cal-nav {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.375rem;
}
.nd-cal-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}
.nd-cal-arrow:hover:not(:disabled) { background: var(--color-bg-muted); }
.nd-cal-arrow:disabled { opacity: 0.35; cursor: default; }
.nd-cal-arrow:focus-visible,
.nd-cal-day:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.nd-cal-months { display: grid; gap: 2rem; }
@media (min-width: 768px) { .nd-cal-months { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .nd-cal-month--second { display: none; } }

.nd-cal-title {
    margin: 0.375rem 0 0.875rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}
.nd-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 0.25rem; }
.nd-cal-wd {
    padding-bottom: 0.375rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}
.nd-cal-day {
    position: relative;
    height: 2.5rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--color-text);
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
/* Free: a light green fill and firm numbers. Full: pale, crossed out, on a
   hatch. Past: faded further, so it never reads as either. */
.nd-cal {
    --nd-free: color-mix(in oklab, var(--color-primary) 15%, white);
    --nd-free-hover: color-mix(in oklab, var(--color-primary) 28%, white);
    --nd-free-line: color-mix(in oklab, var(--color-primary) 32%, transparent);
    --nd-range: color-mix(in oklab, var(--color-primary) 34%, white);
}
html[data-homestay-scheme="dark"] .nd-cal {
    --nd-free: color-mix(in oklab, var(--color-primary) 30%, var(--color-bg));
    --nd-free-hover: color-mix(in oklab, var(--color-primary) 45%, var(--color-bg));
    --nd-free-line: color-mix(in oklab, var(--color-primary) 55%, transparent);
    --nd-range: color-mix(in oklab, var(--color-primary) 48%, var(--color-bg));
}
.nd-cal-day.is-free {
    background: var(--nd-free);
    color: var(--color-text);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--nd-free-line);
}
.nd-cal-day.is-free:hover { background: var(--nd-free-hover); }
.nd-cal-day.is-past { color: var(--color-text-muted); opacity: 0.3; cursor: default; }
.nd-cal-day.is-full {
    color: color-mix(in oklab, var(--color-text-muted) 70%, transparent);
    font-weight: 400;
    text-decoration: line-through;
    background: repeating-linear-gradient(135deg, transparent 0 4px, var(--color-border) 4px 5px);
    cursor: not-allowed;
}
.nd-cal-grid { column-gap: 0.25rem; }
/* The nights between arrival and departure: one continuous band, no tile
   edges, so the stay reads as one piece between the two solid ends. A band
   cell (or the departure) fills the gap on its left only when the night
   before is part of the stay too, and never on a Monday (a new row);
   the calendar markup marks Mondays and Sundays (is-mon, is-sun). */
.nd-cal-day.is-range {
    border-radius: 0;
    background: var(--nd-range);
    color: var(--color-text);
    font-weight: 600;
}
.nd-cal-day:is(.is-start, .is-range) + .nd-cal-day:is(.is-range, .is-end):not(.is-mon)::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -0.25rem;
    width: 0.25rem;
    background: var(--nd-range);
}
.nd-cal-day.is-range.is-mon { border-radius: 0.5rem 0 0 0.5rem; }
.nd-cal-day.is-range.is-sun { border-radius: 0 0.5rem 0.5rem 0; }
.nd-cal-day.is-range.is-mon.is-sun { border-radius: 0.5rem; }

.nd-cal-day.is-start,
.nd-cal-day.is-end { background: var(--color-primary); color: var(--color-on-primary); font-weight: 600; }
.nd-cal-day.is-today::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0.3rem;
    width: 0.25rem;
    height: 0.25rem;
    margin-left: -0.125rem;
    border-radius: 9999px;
    background: currentColor;
}

.nd-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}
.nd-cal-legend li { display: inline-flex; align-items: center; gap: 0.5rem; }
.nd-cal-key {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--color-border);
}
.nd-cal-key.is-free { background: var(--nd-free); border-color: var(--nd-free-line); }
.nd-cal-key.is-full { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--color-border) 3px 4px); }
.nd-cal-key.is-start {
    width: 2rem;
    border: 0;
    background: linear-gradient(90deg, var(--color-primary) 0 30%, var(--nd-range) 30% 70%, var(--color-primary) 70%);
}

.nd-cal-msg { margin: 0.875rem 0 0; font-size: 0.9375rem; color: var(--color-text); }
.nd-cal-msg.is-problem { color: var(--color-danger, #b3261e); font-weight: 500; }
.nd-cal-updated { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--color-text-muted); }

/* ---------------------------------------------------------------
   Confirmation page (confirmation.html): the request a guest just sent
   --------------------------------------------------------------- */
.nd-example {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md, 0.5rem);
    background: color-mix(in oklab, var(--color-accent) 12%, transparent);
    font-size: 0.9375rem;
}
.nd-confirm-card .custom-calc-lines .nd-confirm-total :is(dt, dd) { font-weight: 600; color: var(--color-text); }
.nd-confirm-note { align-items: start; }
.nd-confirm-note dd { text-align: right; max-width: 65%; }
.nd-break { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------
   Print slip (confirmation.html): on paper the page is replaced by a
   one-page booking slip, .nd-print-doc, which the screen never shows.
   --------------------------------------------------------------- */
.nd-print-doc { display: none; }
@media print {
    @page { size: A4; margin: 14mm 16mm 14mm; }
    html, body { background: #fff !important; }
    /* only a page that holds a slip prints the slip alone (Manage Booking has one only once a booking is found) */
    body:has(> main > .nd-print-doc) > :not(main),
    main:has(> .nd-print-doc) > :not(.nd-print-doc) { display: none !important; }
    .nd-print-doc {
        display: block !important;
        color: #1f1b18;
        font-size: 10pt;
        line-height: 1.45;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .nd-print-doc [x-cloak] { display: none !important; }
    .nd-print-doc h2 {
        margin: 6mm 0 2mm;
        font-family: var(--font-heading, Georgia, serif);
        font-size: 12.5pt;
        font-weight: 600;
        color: #2f5b47;
        break-after: avoid;
    }
    .nd-print-doc p { margin: 0; }
    .nd-pd-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10mm;
        padding-bottom: 4mm;
        border-bottom: 1.5pt solid #2f5b47;
    }
    .nd-pd-head img { width: 46mm; height: auto; }
    .nd-pd-head p { text-align: right; font-size: 8.5pt; color: #5f5850; line-height: 1.5; }
    .nd-pd-title {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 10mm;
        margin-top: 7mm;
    }
    .nd-pd-kicker { font-size: 8pt; letter-spacing: .12em; text-transform: uppercase; color: #5f5850; }
    .nd-pd-ref {
        margin-top: 1.5mm !important;
        font-family: var(--font-sans, system-ui, sans-serif);   /* lining figures: easy to read out */
        font-size: 20pt;
        font-weight: 700;
        line-height: 1.1;
    }
    .nd-pd-meta { margin: 0; display: grid; gap: 1.5mm; text-align: right; font-size: 9pt; }
    .nd-pd-meta dt { display: inline; color: #5f5850; }
    .nd-pd-meta dt::after { content: ": "; }
    .nd-pd-meta dd { display: inline; margin: 0; font-weight: 600; }
    .nd-pd-cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 9mm; }
    .nd-pd-list { margin: 0; }
    .nd-pd-list > div {
        display: grid;
        grid-template-columns: 19mm 1fr;
        gap: 3mm;
        padding: 1.6mm 0;
        border-bottom: .5pt solid #d9d2c6;
    }
    .nd-pd-list dt { color: #5f5850; }
    .nd-pd-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
    .nd-pd-money { width: 100%; border-collapse: collapse; }
    .nd-pd-money th, .nd-pd-money td { padding: 1.8mm 0; border-bottom: .5pt solid #d9d2c6; vertical-align: top; }
    .nd-pd-money th { text-align: left; font-weight: 400; color: #5f5850; }
    .nd-pd-money td { text-align: right; font-variant-numeric: tabular-nums; padding-left: 8mm; }
    .nd-pd-money tr.is-strong th, .nd-pd-money tr.is-strong td { color: #1f1b18; font-weight: 700; }
    .nd-pd-money tr.is-strong:last-of-type th, .nd-pd-money tr.is-strong:last-of-type td { border-bottom: 1pt solid #1f1b18; }
    .nd-pd-soft { font-weight: 400; color: #5f5850; }
    .nd-pd-line { display: block; white-space: nowrap; }
    .nd-pd-money th { width: 55%; }
    .nd-pd-note p { padding: 2.5mm 3.5mm; border-left: 2pt solid #b45c36; background: #f6f1ea; font-style: italic; }
    .nd-pd-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.6mm; }
    .nd-pd-steps li { display: grid; grid-template-columns: 34mm 1fr; gap: 3mm; }
    .nd-pd-steps strong { font-weight: 600; }
    .nd-pd-policy {
        margin-top: 6mm !important;
        padding: 3mm 3.5mm;
        border: .5pt solid #d9d2c6;
        border-radius: 2mm;
        font-size: 8.5pt;
        color: #5f5850;
    }
    .nd-pd-foot {
        display: flex;
        justify-content: space-between;
        gap: 8mm;
        margin-top: 8mm;
        padding-top: 3mm;
        border-top: .5pt solid #d9d2c6;
        font-size: 9pt;
        color: #5f5850;
    }
    .nd-pd-foot strong { color: #1f1b18; }
    .nd-print-doc section, .nd-pd-cols, .nd-pd-money, .nd-pd-steps, .nd-pd-policy, .nd-pd-foot { break-inside: avoid; }
}
/* on a phone the request card's labels sit above their values */
@media (max-width: 520px) {
    .nd-confirm-card .custom-calc-lines > div:not(.nd-confirm-total) { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .nd-confirm-card .custom-calc-lines > div:not(.nd-confirm-total) dd { text-align: left; max-width: none; }
}

/* ---------------------------------------------------------------
   Deposit page (payment.html)
   --------------------------------------------------------------- */
.nd-hold {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: color-mix(in oklab, var(--color-primary) 12%, transparent);
    color: var(--color-primary-ink, var(--color-primary));
    font-size: 0.9375rem;
}
.nd-hold strong { font-size: 1.0625rem; min-width: 3.2em; }
.nd-hold-over {
    max-width: 44rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid color-mix(in oklab, var(--color-danger, #b3261e) 40%, transparent);
    background: color-mix(in oklab, var(--color-danger, #b3261e) 8%, transparent);
}

/* the two ways to pay, as large radio buttons */
.nd-pay-choices { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .nd-pay-choices { grid-template-columns: 1fr 1fr; } }
.nd-pay-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 0.75rem);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.nd-pay-choice > i { font-size: 1.5rem; color: var(--color-primary); margin-top: 0.125rem; }
.nd-pay-choice strong { display: block; font-weight: 600; }
.nd-pay-choice small { display: block; margin-top: 0.25rem; color: var(--color-text-muted); font-size: 0.875rem; line-height: 1.45; }
.nd-pay-choice:hover { border-color: color-mix(in oklab, var(--color-primary) 50%, var(--color-border)); }
.nd-pay-choice.is-on {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);
    background: color-mix(in oklab, var(--color-primary) 7%, transparent);
}
.nd-pay-choice:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* the QR code beside the details to type by hand */
.nd-pay-transfer { display: grid; gap: 1.5rem; align-items: start; }
/* side by side only when the card itself is wide enough (a container query) */
.nd-pay-card { container-type: inline-size; }
@container (min-width: 620px) { .nd-pay-transfer { grid-template-columns: 220px minmax(0, 1fr); } }
.nd-qr { justify-self: center; text-align: center; }
.nd-qr img {
    display: block;
    width: 220px;
    height: 220px;
    padding: 10px;
    border-radius: var(--radius-lg, 0.75rem);
    background: #fff;   /* a QR code needs a light ground, in dark mode too */
    border: 1px solid var(--color-border);
}
.nd-qr figcaption { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--color-text-muted); }
.nd-copy-lines dd { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.nd-copy-value { overflow-wrap: break-word; }
.nd-pay-content .nd-copy-value {
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background: color-mix(in oklab, var(--color-accent) 14%, transparent);
    font-weight: 700;
}
.nd-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
}
.nd-copy:hover { color: var(--color-primary); border-color: var(--color-primary); }
.nd-pay-steps { list-style: decimal; padding-left: 1.25rem; color: var(--color-text-muted); }
.nd-pay-steps li { display: list-item; padding-left: 0.25rem; }
.nd-copy-lines dt { white-space: nowrap; }
.nd-example { display: flex; width: fit-content; }
.nd-pay-steps li + li { margin-top: 0.375rem; }
.nd-policy {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-bg-muted, color-mix(in oklab, var(--color-text) 5%, transparent));
    font-size: 0.9375rem;
    line-height: 1.55;
}
.nd-policy > i { font-size: 1.25rem; color: var(--color-primary); flex-shrink: 0; margin-top: 0.125rem; }
@media (max-width: 520px) {
    .nd-copy-lines > div { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .nd-copy-lines dd { justify-content: flex-start; }
}

/* A booking reference (ND7K4Q2) is read out and typed: never spaced out or
   recased, even inside a spaced, upper-case kicker */
.nd-code { letter-spacing: 0 !important; text-transform: none !important; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   Manage Booking (manage.html): the lookup form and the booking found
   --------------------------------------------------------------- */
.nd-code-input { text-transform: uppercase; font-variant-numeric: tabular-nums; }
.nd-code-input::placeholder { text-transform: none; }
.nd-scroll-offset { scroll-margin-top: 6rem; }
.nd-mb-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1.5rem; }
.nd-mb-label { margin: 0; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.nd-mb-ref { margin: .15rem 0 0; font-size: clamp(1.625rem, 1.3rem + 1.1vw, 2rem); font-weight: 600; line-height: 1.15; font-variant-numeric: lining-nums tabular-nums; }
.nd-status {
    margin: 0; padding: .35rem .8rem; border-radius: 999px;
    font-size: .875rem; font-weight: 600; line-height: 1.3;
    background: #e3eee6; color: #2f5b47;
}
.nd-status.is-house, .nd-status.is-sent { background: #f6ecd9; color: #7a5410; }
.nd-status.is-cancelled { background: #f3e1dd; color: #8a2f22; }
html[data-homestay-scheme="dark"] .nd-status { background: rgba(120, 180, 145, .18); color: #b9dcc6; }
html[data-homestay-scheme="dark"] .nd-status.is-house, html[data-homestay-scheme="dark"] .nd-status.is-sent { background: rgba(214, 170, 90, .18); color: #ecd3a2; }
html[data-homestay-scheme="dark"] .nd-status.is-cancelled { background: rgba(210, 110, 95, .18); color: #f0b9ae; }
@media (min-width: 1024px) { .nd-mb-actions { position: sticky; top: 6rem; } }
.nd-textlink {
    padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer;
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.nd-textlink:hover { color: var(--color-primary, #2f5b47); }
.nd-manage-link { margin: 1rem 0 0; }

/* ---------------------------------------------------------------
   Header: the Manage Booking button beside the dark-mode button, and
   the hamburger below 1280px. With the button the bar has no room for
   the six links at 1024-1279px ("Check Availability" already ran past
   the bar's end at 1024-1199px), so they move into the menu panel there,
   as the template does for its own crowded menus.
   --------------------------------------------------------------- */
.nd-manage-btn { display: grid; place-items: center; text-decoration: none; }
.nd-manage-btn[aria-current="page"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
@media (width < 640px) { .nd-manage-btn { display: none; } } /* the phone menu has it as a button */
@media (width <= 1279px) {
    .site-header .navbar-inner { grid-template-columns: 1fr auto; }
    .site-header .brand { grid-area: auto; justify-self: start; }
    .site-header .nav-actions { grid-area: auto; justify-self: end; }
    .site-header .nav-links { display: none; }
    .site-header .hamburger { display: grid; }
}
/* 1280-1535px: the links a little closer (the template's own spacing for a full menu), so the bar holds the button too */
@media (1280px <= width < 1536px) {
    .site-header .nav-links { gap: 0; }
    .site-header .nav-links .nav-link { padding-inline: 0.625rem; }
}

/* ---------------------------------------------------------------
   Hosts' sign-in (login.html)
   --------------------------------------------------------------- */
.nd-login-icon { margin-right: .5rem; font-size: .9em; color: var(--color-primary); vertical-align: -.05em; }
.nd-login-caps { display: flex; align-items: center; gap: .375rem; color: var(--color-text); }
.nd-login-indent { padding-left: calc(1.125rem + .625rem); }
.nd-login-notice {
    padding: .75rem 1rem; border-radius: var(--radius-md, .5rem);
    background: var(--color-bg-muted); color: var(--color-text); font-size: var(--text-base);
}

/* ---------------------------------------------------------------
   Hosts' desk: reservations calendar (admin/calendar.html)
   --------------------------------------------------------------- */
.nd-desk-page { background: var(--color-bg); }
.nd-admin-bar { position: sticky; top: 0; z-index: 30; background: var(--color-bg); border-bottom: 1px solid var(--color-border); }
.nd-admin-inner { display: flex; align-items: center; gap: 1rem 1.5rem; min-height: 4.25rem; flex-wrap: wrap; padding-block: .5rem; }
.nd-admin-brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--color-primary); text-decoration: none; }
.nd-admin-brand .brand-logo { height: 1.75rem; width: auto; }
.nd-admin-tag { font-family: var(--font-sans); padding: .2rem .6rem; border-radius: 999px; background: var(--color-bg-muted); color: var(--color-text); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.nd-admin-nav { display: flex; gap: .25rem; margin-right: auto; }
.nd-admin-nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 999px; color: var(--color-text); font-size: .9375rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nd-admin-nav a:hover { background: var(--color-bg-muted); }
.nd-admin-nav a[aria-current="page"] { background: var(--color-primary); color: var(--color-on-primary); }
.nd-admin-tools { display: flex; align-items: center; gap: .5rem; }
@media (width < 760px) {
    /* three rows tall on a phone: it scrolls away instead of covering a quarter of the screen */
    .nd-admin-bar { position: static; }
    .nd-admin-nav { order: 3; width: 100%; margin: 0; }
    .nd-admin-tools { margin-left: auto; }
    .nd-admin-signout { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.nd-admin-foot { padding: 2rem 0 2.5rem; color: var(--color-text-muted); font-size: .875rem; }

.nd-desk { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.nd-desk-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; }
.nd-desk-title { margin: 0; font-family: var(--font-heading, Georgia, serif); font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); font-weight: 500; line-height: 1.1; }
.nd-desk-range { margin-top: .35rem; color: var(--color-text-muted); }
.nd-desk-head .nd-example { max-width: 34rem; }

/* today */
.nd-today { display: grid; gap: 1rem; align-items: start; margin-top: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.nd-today-card { padding: 1.1rem 1.25rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg, 1rem); background: var(--color-surface, #fff); }
.nd-today-card h2 { display: flex; align-items: center; gap: .45rem; margin: 0 0 .6rem; font-family: var(--font-sans); font-size: .9375rem; font-weight: 600; letter-spacing: 0; }
.nd-today-card h2 i { color: var(--color-primary); font-size: 1.1rem; }
.nd-count { font-family: var(--font-sans); margin-left: auto; min-width: 1.6rem; padding: .05rem .45rem; border-radius: 999px; background: var(--color-bg-muted); font-size: .8125rem; text-align: center; font-variant-numeric: tabular-nums; }
.nd-today-card.is-needs .nd-count { background: #f6ecd9; color: #7a5410; }
.nd-today-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; }
.nd-today-card li, .nd-today-card p { margin: 0; font-size: .875rem; line-height: 1.45; color: var(--color-text-muted); }
.nd-today-card li button { padding: 0; border: 0; background: none; font: inherit; color: var(--color-text); text-align: left; cursor: pointer; }
.nd-today-card li button:hover { text-decoration: underline; text-underline-offset: .2em; }
.nd-why { color: var(--color-text-muted); }

/* the grid */
.nd-tc-box { margin-top: 1.5rem; padding: 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg, 1rem); background: var(--color-surface, #fff); }
.nd-tc-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.nd-tc-move, .nd-tc-span { display: flex; gap: .35rem; }
.nd-tool { display: inline-grid; place-items: center; min-width: 2.25rem; height: 2.25rem; padding: 0 .6rem; border: 1px solid var(--color-border); border-radius: 999px; background: transparent; color: var(--color-text); font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer; }
.nd-tool:hover { background: var(--color-bg-muted); }
.nd-tool[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.nd-tool:focus-visible, .nd-bar:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.nd-scroll-hint { display: none; margin: 0 0 .5rem; font-size: .8125rem; color: var(--color-text-muted); }
@media (width < 900px) { .nd-scroll-hint { display: block; } }
.nd-tc-scroll { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--color-border); border-radius: .75rem; }
.nd-tc-grid { --nd-label: 8.5rem; width: max(100%, var(--nd-min, 100%)); font-size: .8125rem; }
.nd-row { display: grid; grid-template-columns: var(--nd-label) var(--nd-cols); align-items: stretch; border-bottom: 1px solid var(--color-border); }
.nd-group:last-child .nd-row:last-child { border-bottom: 0; }
.nd-row > * { grid-row: 1; }
.nd-label { grid-column: 1; position: sticky; left: 0; z-index: 3; display: flex; flex-direction: column; justify-content: center; padding: 0 .75rem; background: var(--color-surface, #fff); border-right: 1px solid var(--color-border); font-weight: 500; }
.nd-label small { color: var(--color-text-muted); font-weight: 400; }
.nd-row-days { position: sticky; top: 0; z-index: 4; background: var(--color-surface, #fff); }
.nd-row-days .nd-label { color: var(--color-text-muted); font-weight: 500; }
.nd-day { display: grid; justify-items: center; align-content: center; gap: 0; padding: .4rem 0; border-left: 1px solid var(--color-border); line-height: 1.15; }
.nd-day-wd { font-size: .6875rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.nd-day-n { font-size: .9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.nd-day-m { font-size: .6875rem; color: var(--color-primary); font-weight: 600; }
.nd-day.is-weekend, .nd-bg.is-weekend { background: color-mix(in oklab, var(--color-bg-muted) 55%, transparent); }
.nd-day.is-today .nd-day-n { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--color-primary); color: var(--color-on-primary); }
.nd-row-type { background: var(--color-bg-muted); }
.nd-row-type .nd-label { background: var(--color-bg-muted); font-weight: 600; min-height: 2rem; }
.nd-free { display: grid; place-items: center; border-left: 1px solid var(--color-border); color: var(--color-text-muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.nd-free.is-full { color: #8a2f22; font-weight: 600; }
.nd-row-room { min-height: 2.75rem; }
.nd-row-room .nd-label { min-height: 2.75rem; }
.nd-bg { border-left: 1px solid var(--color-border); }
.nd-bg.is-today { background: color-mix(in oklab, var(--color-primary) 9%, transparent); }
.nd-row-loose .nd-label { background: #fbf6ec; }

/* a stay */
.nd-bar {
    z-index: 2; align-self: center; display: flex; align-items: center; gap: .3rem; min-width: 0; height: 2rem; margin: 0 1px;
    padding: 0 .5rem; border: 1.5px solid transparent; border-radius: .5rem; font: inherit; font-size: .8125rem; font-weight: 600;
    text-align: left; cursor: pointer; overflow: hidden;
}
.nd-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.nd-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.nd-bar-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-src { flex: none; display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 .2rem; border-radius: .3rem; background: rgba(255,255,255,.85); color: #1f1b18; font-size: .625rem; font-weight: 700; }
.nd-note { flex: none; margin-left: auto; font-size: .95rem; opacity: .85; }
.nd-bar.is-confirmed, .nd-key.is-confirmed { background: #3f7a5e; color: #fff; }
.nd-bar.is-in, .nd-key.is-in { background: #234a39; color: #fff; }
.nd-bar.is-out, .nd-key.is-out { background: #d9d4cd; color: #4a443e; }
.nd-bar.is-house, .nd-key.is-house { background: #f1d9a6; color: #5c3f08; }
.nd-bar.is-request, .nd-key.is-request { background: #fbf0d8; color: #6b4a0c; border: 1.5px dashed #c99532; }
.nd-bar.is-lapsed { background: transparent; color: var(--color-text-muted); border: 1.5px dashed var(--color-border); text-decoration: line-through; }
.nd-bar.is-closed, .nd-key.is-closed { cursor: default; color: var(--color-text); background: repeating-linear-gradient(-45deg, var(--color-bg-muted) 0 6px, transparent 6px 12px); border: 1px solid var(--color-border); font-weight: 500; }

.nd-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-top: .9rem; font-size: .8125rem; color: var(--color-text-muted); }
.nd-legend ul { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin: 0; padding: 0; list-style: none; }
.nd-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.nd-key { display: inline-block; width: 1.5rem; height: .9rem; border-radius: .25rem; }
.nd-legend .nd-src { border: 1px solid var(--color-border); }

/* housekeeping (plans/backend/manage.md §3b) */
.nd-alert-line { display: flex; align-items: flex-start; gap: .6rem; margin: 1.5rem 0 0; padding: .7rem 1rem; border: 1px solid #e6b8ae; border-radius: .75rem; background: #fbeeea; color: #8a2f22; font-size: .9375rem; font-weight: 600; }
.nd-alert-line i { flex: none; font-size: 1.15rem; margin-top: .15rem; }
.nd-alert-body { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.nd-alert-line button { padding: .1rem .6rem; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: .8125rem; font-weight: 500; cursor: pointer; }
.nd-alert-line button:hover { background: rgba(138, 47, 34, .08); }
.nd-alert-line:not([style*="none"]) + .nd-today { margin-top: 1rem; }
.nd-dirty { display: inline-flex; align-items: center; gap: .25rem; align-self: flex-start; margin-top: .15rem; padding: .05rem .45rem; border: 0; border-radius: 999px; background: #f7e1dc; color: #8a2f22; font: inherit; font-size: .6875rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.nd-dirty i { font-size: .8rem; }
.nd-dirty:hover { background: #f0cfc7; }
/* where one stay's bar meets the next: the room must be cleaned in between */
.nd-turn { z-index: 3; align-self: center; justify-self: center; display: inline-flex; align-items: center; gap: .2rem; height: 1.3rem; padding: 0 .4rem; border: 1.5px solid #b3412e; border-radius: 999px; background: #fff; color: #8a2f22; font: inherit; font-size: .6875rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.nd-turn i { font-size: .8rem; }
.nd-turn.is-done { border-color: #3f7a5e; color: #2f6a4e; }
.nd-turn:focus-visible, .nd-dirty:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.nd-legend .is-key { align-self: center; cursor: default; box-shadow: none; margin: 0; }
.nd-bar.has-turn { padding-left: 2.2rem; }
.nd-bar.has-turn-small { padding-left: 1.1rem; }
.nd-status.is-room-dirty { background: #f7e1dc; color: #8a2f22; }
.nd-status.is-room-clean { background: #e3efe8; color: #2f6a4e; }
.nd-status.is-room-closed { background: #ebe7e2; color: #4a443e; }
.nd-room-day { margin: .75rem 0 0; color: var(--color-text-muted); font-size: .9375rem; }
.nd-clean-list { margin: .5rem 0 0; padding: 0; list-style: none; }
.nd-clean-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .55rem 0; border-bottom: 1px solid var(--color-border); font-size: .9375rem; }
.nd-clean-list li i { color: #8a2f22; }
.nd-clean-list li.is-done { color: var(--color-text-muted); }
.nd-clean-list li.is-done i { color: #3f7a5e; }
.nd-clean-list .nd-textlink { margin-left: auto; font-size: .875rem; }

/* the booking window */
.nd-dialog { position: fixed; inset: 0; margin: auto; height: fit-content; width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0; border-radius: var(--radius-xl, 1.25rem); background: var(--color-surface, #fff); color: var(--color-text); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.nd-dialog::backdrop { background: rgba(20, 18, 16, .45); }
.nd-dialog-body { padding: clamp(1.25rem, 1rem + 1vw, 1.75rem); }
.nd-dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.nd-dialog .nd-status { display: inline-block; }
.nd-status.is-st-request, .nd-status.is-st-house { background: #f6ecd9; color: #7a5410; }
.nd-status.is-st-in { background: #234a39; color: #fff; }
.nd-status.is-st-out, .nd-status.is-st-lapsed { background: #ebe7e2; color: #4a443e; }
.nd-dlg-list { margin: 1.1rem 0 0; display: grid; }
.nd-dlg-list > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--color-border); font-size: .9375rem; }
.nd-dlg-list dt { color: var(--color-text-muted); }
.nd-dlg-list dd { margin: 0; }
.nd-dlg-list .is-strong { font-weight: 600; }
.nd-dlg-note { font-style: italic; }
.nd-dlg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.25rem; }
.nd-dlg-actions .btn i { margin-right: .3rem; }
.nd-dlg-cancel { margin-left: auto; font-size: .875rem; color: #8a2f22; }
@media (width < 480px) { .nd-dlg-list > div { grid-template-columns: 1fr; gap: .1rem; } }

html[data-homestay-scheme="dark"] .nd-today-card.is-needs .nd-count,
html[data-homestay-scheme="dark"] .nd-status.is-st-request,
html[data-homestay-scheme="dark"] .nd-status.is-st-house { background: rgba(214, 170, 90, .18); color: #ecd3a2; }
html[data-homestay-scheme="dark"] .nd-row-loose .nd-label { background: #2c2618; }
html[data-homestay-scheme="dark"] .nd-free.is-full { color: #f0b9ae; }
html[data-homestay-scheme="dark"] .nd-bar.is-out { background: #4a443e; color: #e8e2da; }
html[data-homestay-scheme="dark"] .nd-bar.is-request { background: #3a2f17; color: #f2dcab; }
html[data-homestay-scheme="dark"] .nd-bar.is-house { background: #6b5320; color: #fbecc8; }
html[data-homestay-scheme="dark"] .nd-status.is-st-out, html[data-homestay-scheme="dark"] .nd-status.is-st-lapsed { background: #3a3632; color: #e8e2da; }
html[data-homestay-scheme="dark"] .nd-alert-line { background: rgba(179, 65, 46, .18); border-color: rgba(240, 185, 174, .35); color: #f4c4ba; }
html[data-homestay-scheme="dark"] .nd-alert-line button:hover { background: rgba(240, 185, 174, .12); }
html[data-homestay-scheme="dark"] .nd-dirty,
html[data-homestay-scheme="dark"] .nd-status.is-room-dirty { background: rgba(179, 65, 46, .28); color: #f4c4ba; }
html[data-homestay-scheme="dark"] .nd-turn { background: var(--color-surface, #1f1b18); border-color: #d0735f; color: #f4c4ba; }
html[data-homestay-scheme="dark"] .nd-turn.is-done { border-color: #5f9e80; color: #a9d8bf; }
html[data-homestay-scheme="dark"] .nd-status.is-room-clean { background: rgba(63, 122, 94, .3); color: #cde8da; }
html[data-homestay-scheme="dark"] .nd-status.is-room-closed { background: #3a3632; color: #e8e2da; }
html[data-homestay-scheme="dark"] .nd-clean-list li i { color: #f4c4ba; }
html[data-homestay-scheme="dark"] .nd-clean-list li.is-done i { color: #a9d8bf; }
@media (width < 640px) {
    .nd-tc-grid { --nd-label: 6rem; }
    .nd-row-room .nd-dirty span { display: none; }
    .nd-label { padding: 0 .5rem; font-size: .75rem; }
    .nd-tc-box { padding: .75rem; }
}

/* ---------------------------------------------------------------
   404 page (404.html): the buttons and the Vietnamese half
   --------------------------------------------------------------- */
.nd-404-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.nd-404-vi { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--color-border); max-width: 46rem; }

/* ---------------------------------------------------------------
   Messages without a server (ask.js): the panel a checked form shows,
   the footer's one line, and the confirmation page's send card
   --------------------------------------------------------------- */
.nd-ask { margin-top: 1.75rem; padding: 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg-muted); }
.nd-ask-title { margin: 0; font-family: var(--font-heading); font-size: 1.25rem; color: var(--color-text); }
.nd-ask-lead { margin: .5rem 0 0; color: var(--color-text-muted); }
.nd-ask-ways { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.nd-ask-ways .btn { justify-content: center; }
.nd-ask-note { margin: 1rem 0 0; font-size: .9375rem; color: var(--color-text-muted); }
.nd-ask-copy { display: inline-flex; align-items: center; gap: .35rem; padding: 0; border: 0; background: none; font: inherit; color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nd-ask-copied { margin: .5rem 0 0; font-size: .9375rem; color: var(--color-primary); }
.nd-ask-preview { margin-top: 1rem; font-size: .9375rem; }
.nd-ask-preview summary { cursor: pointer; color: var(--color-text-muted); }
.nd-ask-preview pre { margin: .75rem 0 0; padding: 1rem; max-height: 18rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-sans); font-size: .9375rem; line-height: 1.55; color: var(--color-text); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md, .5rem); }
.nd-ask-inline { display: block; }
.nd-ask-inline a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.nd-send-card { padding: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem); border: 1px solid var(--color-primary); border-radius: var(--radius-xl); background: var(--color-bg-muted); max-width: 52rem; }
@media (width < 520px) {
    .nd-ask-ways .btn { flex: 1 1 100%; }
}

/* Tabs on a phone: Alegreya is wider than the template's font, and the
   Vietnamese room names ("Phòng Gác Gia Đình") overflowed the row on a
   390 px phone. A little less gap and size makes the three fit; on a smaller
   phone the row still scrolls sideways, as the template does. */
@media (width < 520px) {
    html[data-demo="aparthotel-1"] .tabs-nav { column-gap: .75rem; }
    html[data-demo="aparthotel-1"] .tabs-nav > :is(button, a) { font-size: 1rem; }
}

/* Articles from the database (plans/articles-from-database.md). The admin's
   editor keeps no classes, so the text takes its shape from two rules:
   - the opening paragraph is the lead (it was <p class="text-xl text-dark">);
   - a quotation whose first word is bold ("**Tickets.** The Imperial City…")
     is a note, in the box the static pages drew with
     alert alert-lg alert-primary. Any other quotation stays a pull quote. */
.article-body > p:first-child {
    font-size: var(--text-xl);
    line-height: var(--text-xl--line-height);
    color: var(--color-dark);
}
.article-body > blockquote:has(> p:first-child > strong:first-child) {
    border: 1px solid var(--color-primary-100);
    border-radius: var(--radius-lg);
    background: var(--color-primary-50);
    color: var(--color-text);
    padding: 1.25rem 1.5rem;
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-relaxed);
    letter-spacing: 0;
}
.article-body > blockquote:has(> p:first-child > strong:first-child) > p {
    margin: 0;
}
