/* ===========================================================================
   THE ELITE DESK

   A traveller is walking, in a market, in a taxi, or standing outside at
   night. Everything here is built for that: one thumb, big targets, almost
   no typing, and nothing that can trap the send button behind a keyboard.

   A sheet that unfolds up from the bottom edge on a phone (Unfold-up) and
   unfolds as a centred card on a wide screen (Unfold), white and quiet,
   with a grab handle, a round close button, choices two to a row on sand,
   pill buttons and the gold action with dark words. Loading and listening
   use Beads; nothing lifts, spins or scales.

   Loaded ON DEMAND by static/js/ask_local.js, the first tap on the floating
   button injects this file. The floating button itself is styled in
   elite.css, so it can appear instantly without waiting for a request.
   Also loaded by /ask, /ask/<token> and the Safety page (the emergency
   block). Every colour is an elite.css token.
   =========================================================================== */

.al-root {
    position: fixed;
    inset: 0;
    /* Painted over the fixed header and every bar on the page. */
    z-index: 2147483647;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.al-root[hidden] { display: none; }

.al-scrim {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: rgba(17, 12, 9, 0.48);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 280ms linear;
    cursor: default;
}

.al-root.is-open .al-scrim { opacity: 1; }

.al-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: 92dvh;
    overflow: hidden;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    background: var(--c-bg);
    color: var(--c-ink);
    box-shadow: 0 -20px 60px rgba(17, 12, 9, 0.24);
    /* Leaving is opacity only; arriving is Unfold-up. */
    opacity: 0;
    transition: opacity 180ms linear;
    /* Lifted by JS when the on-screen keyboard shrinks the visual viewport,
       so the composer and its Send button are never behind the keyboard. */
    margin-bottom: var(--al-keyboard, 0px);
}

.al-root.is-open .al-sheet { opacity: 1; animation: et-unfold-up 420ms var(--et-ease-rise) backwards; }
.al-sheet:focus { outline: none; }

/* ---------- head ---------- */

.al-head {
    position: relative;
    flex: 0 0 auto;
    padding: 10px 64px 16px 24px;
    border-bottom: 1px solid var(--c-line);
    background: var(--c-bg);
}

.al-grab {
    display: block;
    width: 36px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: var(--r-pill);
    background: var(--c-line-2);
}

.al-head h2 {
    font-size: 1.3125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.011em;
    color: var(--c-ink);
}

.al-sub {
    margin-top: 4px;
    font-size: var(--t-small);
    line-height: 1.43;
    color: var(--c-muted);
}

/* A 44px target with a 32px sand disc inside it. */
.al-close {
    position: absolute;
    top: 18px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--c-bg-alt-2) 0 16px, transparent 16.5px);
    color: var(--c-muted);
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 200ms var(--ease);
}

.al-close:hover { color: var(--c-ink); }
.al-close:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- scrolling body ---------- */

.al-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 18px 24px 22px;
}

.al-step[hidden] { display: none; }

/* ---------- step 1: the quick choices ---------- */

.al-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.al-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 14px;
    border: 0;
    border-radius: var(--r-md);
    background: var(--c-bg-alt);
    color: var(--c-ink);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px transparent;
    transition: background-color 260ms var(--et-ease-glide), box-shadow 260ms var(--et-ease-glide);
}

/* No lift on hover: a gold hairline instead. */
.al-choice:hover {
    background: var(--c-bg-alt-2);
    color: var(--c-ink);
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.55);
}

.al-choice:active { transform: translateY(1px); }
.al-choice:focus-visible { outline: none; box-shadow: var(--ring); }

/* Each choice's glyph sits in a small arch window. */
.al-choice .et-i {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 10px 9px 9px;
    border-radius: 18px;
    background: var(--c-bg);
    color: var(--c-bronze);
}

/* An odd tile before the wide one takes the whole row, so the grid never
   ends on a hole. */
.al-choices .al-choice:nth-child(odd):nth-last-child(2):not(.al-choice-wide) { grid-column: 1 / -1; }

/* Arrival: Sunrise-soft with a 40ms stagger once the sheet unfolds.
   Scoped to the open sheet, so the /ask page renders with nothing to wait
   through. */
.al-root.is-open .al-choice {
    animation: et-sunrise-soft 560ms var(--et-ease-rise) backwards;
    animation-delay: calc(var(--n, 0) * 40ms + 120ms);
}
.al-root.is-open .al-choice:nth-child(2) { --n: 1; }
.al-root.is-open .al-choice:nth-child(3) { --n: 2; }
.al-root.is-open .al-choice:nth-child(4) { --n: 3; }
.al-root.is-open .al-choice:nth-child(5) { --n: 4; }
.al-root.is-open .al-choice:nth-child(6) { --n: 5; }
.al-root.is-open .al-choice:nth-child(7) { --n: 6; }
.al-root.is-open .al-choice:nth-child(8) { --n: 7; }

/* "I need a Local Host with me" is a different kind of answer: the booking
   door. Full width, last, espresso with the gold mark, as the site's own. */
.al-choice.al-choice-wide {
    grid-column: 1 / -1;
    background: var(--c-espresso);
    color: var(--c-on-dark);
}

.al-choice.al-choice-wide:hover { background: var(--c-espresso-3); color: #fff; }
.al-choice.al-choice-wide .et-i { background: var(--c-gold); color: #fff; }

.al-note,
.al-footnote {
    margin-top: 14px;
    font-size: var(--t-micro);
    line-height: 1.5;
    color: var(--c-muted);
}

.al-note a,
.al-footnote a { color: var(--c-link); text-decoration: underline; text-underline-offset: 2px; }

/* A note action that opens the composer in place. It navigates nowhere, so
   it is a button, dressed exactly like the link text around it. */
.al-notelink {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--c-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.al-notelink:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 3px; }

/* ---------- step 2: compose ---------- */

.al-picked {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    margin-bottom: 14px;
    padding: 6px 14px 6px 10px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--c-bg-alt);
    color: var(--c-ink);
    font: inherit;
    font-size: var(--t-small);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 200ms var(--ease);
}

.al-picked:hover { background: var(--c-bg-alt-2); color: var(--c-ink); text-decoration: none; }
.al-picked:focus-visible { outline: none; box-shadow: var(--ring); }
.al-picked .et-i { font-size: 0.8rem; color: var(--c-muted); }

.al-field { margin-bottom: 14px; }

.al-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--t-small);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--c-ink);
}

.al-optional { font-weight: 400; color: var(--c-muted); }

.al-input,
.al-textarea,
.al-select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 13px 15px;
    border: 1px solid var(--c-line-2);
    border-radius: var(--r-sm);
    background-color: var(--c-bg);
    color: var(--c-ink);
    font: inherit;
    /* 16px minimum: anything smaller makes iOS Safari zoom the page on
       focus, which throws the sheet off the screen. */
    font-size: 1rem;
    line-height: 1.4;
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.al-input::placeholder,
.al-textarea::placeholder { color: var(--c-faint); }

.al-textarea { min-height: 108px; resize: vertical; }

.al-select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%231d1a17' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px 8px;
}

.al-input:hover,
.al-textarea:hover,
.al-select:hover { border-color: var(--c-faint); }

.al-input:focus,
.al-textarea:focus,
.al-select:focus {
    outline: none;
    border-color: var(--c-bronze);
    box-shadow: var(--ring);
}

.al-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 10px;
}

.al-row + .al-input { margin-top: 10px; }

/* The honeypot. Off-screen rather than display:none, so a bot that skips
   hidden fields still finds it. Parked to the left, which never widens a
   page. */
.al-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ---------- attachment controls ---------- */

.al-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.al-tool {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--c-bg-alt);
    color: var(--c-ink);
    font: inherit;
    font-size: var(--t-small);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 200ms var(--ease);
}

.al-tool:hover { background: var(--c-bg-alt-2); }
.al-tool:focus-visible { outline: none; box-shadow: var(--ring); }
.al-tool[disabled] { opacity: 0.5; cursor: not-allowed; }
.al-tool .et-i { font-size: 1.05rem; color: var(--c-bronze); }

.al-tool.is-on { background: var(--c-espresso); color: var(--c-on-dark); }
.al-tool.is-on .et-i { color: var(--c-gold); }
/* Listening: the Beads light up along their arch while the voice records. */
.al-tool .et-beads { color: var(--c-gold); }

/* ---------- attachment previews ---------- */

.al-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.al-files:empty { display: none; }

.al-file {
    position: relative;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--c-bg-alt);
    color: var(--c-ink);
}

.al-file img { display: block; width: 100%; height: 100%; object-fit: cover; }

.al-file-audio {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 150px;
    padding: 0 14px;
    font-size: var(--t-small);
    font-weight: 600;
}

.al-file-x {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 12, 9, 0.72);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}

.al-file-x:focus-visible { outline: none; box-shadow: var(--ring); }

.al-file-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(17, 12, 9, 0.14);
}

.al-file-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--c-gold);
    transition: width 250ms var(--ease);
}

/* ---------- footer actions ---------- */

.al-foot {
    display: grid;
    flex: 0 0 auto;
    gap: 8px;
    padding: 14px 24px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--c-line);
    background: var(--c-bg);
}

.al-foot:empty { display: none; }

.al-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    padding: 13px 22px;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    font: inherit;
    font-size: var(--t-body);
    font-weight: 400;
    letter-spacing: -0.022em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.al-btn:hover { text-decoration: none; }
.al-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* The send: gold with dark words, the brand action. */
.al-btn-primary { background: var(--c-gold); color: #fff; }
.al-btn-primary:hover { background: var(--c-gold-hover); color: #fff; }
.al-btn-primary[disabled] { opacity: 0.55; cursor: not-allowed; }

.al-btn-ghost { background: var(--c-bg-alt); color: var(--c-ink); }
.al-btn-ghost:hover { background: var(--c-bg-alt-2); color: var(--c-ink); }

/* ---------- feedback ---------- */

.al-msg {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: var(--t-small);
    line-height: 1.45;
}

.al-msg[hidden] { display: none; }
.al-msg.err { background: var(--c-danger-bg); color: var(--c-danger); }
.al-msg.ok { background: var(--c-success-bg); color: var(--c-success); }
.al-msg.info { background: var(--c-bg-alt); color: var(--c-ink); }
.al-msg a { color: inherit; text-decoration: underline; }

/* Waiting: Beads (motion.css), in the colour of the words around them. */
.al-btn .et-beads, .al-tool .et-beads, .al-note .et-beads, .al-desk-status .et-beads { margin-right: 6px; color: currentColor; }
.al-btn-primary .et-beads { color: var(--c-ink); }

/* ---------- step 3: sent ---------- */

.al-done { padding: 12px 4px 4px; text-align: center; }

.al-done .et-seal { margin: 0 auto 16px; }

.al-done h3 { margin-bottom: 8px; font-size: 1.3125rem; color: var(--c-ink); }
.al-done p { font-size: var(--t-small); line-height: 1.5; color: var(--c-muted); }

.al-ref {
    display: inline-block;
    margin-top: 12px;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    background: var(--c-bg-alt);
    font-size: var(--t-micro);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--c-ink);
}

/* ===========================================================================
   THE THREAD, used by /ask/<token> and by the sheet after a question is sent
   =========================================================================== */

.al-thread { display: grid; gap: 10px; }

.al-bubble {
    max-width: 86%;
    padding: 11px 15px;
    border-radius: 20px;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.al-bubble-you {
    justify-self: end;
    border-bottom-right-radius: 6px;
    background: var(--c-ink);
    color: #fff;
}

.al-bubble-staff {
    justify-self: start;
    border-bottom-left-radius: 6px;
    background: var(--c-bg-alt);
    color: var(--c-ink);
}

.al-who {
    display: block;
    margin-bottom: 3px;
    font-size: var(--t-micro);
    font-weight: 600;
    letter-spacing: 0;
    opacity: 0.7;
}

.al-att {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.al-att img {
    display: block;
    width: 104px;
    height: 104px;
    object-fit: cover;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.25);
}

.al-att audio { width: 100%; min-width: 220px; }

.al-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    background: var(--c-bg-alt);
    color: var(--c-ink);
    font-size: var(--t-micro);
    font-weight: 600;
}

.al-state .et-i { color: var(--c-bronze); }
.al-state.is-answered { background: var(--c-success-bg); color: var(--c-success); }
.al-state.is-answered .et-i { color: var(--c-success); }

/* The one Local Host prompt, shown only after a real reply: the espresso
   card with the gold button, the site's booking door. */
.al-convert {
    margin-top: 18px;
    padding: 20px;
    border-radius: var(--r-md);
    background: var(--c-espresso);
    color: var(--c-on-dark);
}

.al-convert p {
    margin-bottom: 14px;
    font-size: var(--t-body);
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
}

.al-convert a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--r-pill);
    background: var(--c-gold);
    color: #fff;
    font-size: var(--t-small);
    text-decoration: none;
    transition: background-color 200ms var(--ease);
}

.al-convert a:hover { background: var(--c-gold-hover); color: #fff; text-decoration: none; }

/* ===========================================================================
   DESKTOP: a centred card rather than a sheet
   =========================================================================== */

@media (min-width: 700px) {
    .al-root { align-items: center; padding: 24px; }

    .al-sheet {
        max-height: min(86dvh, 780px);
        margin-bottom: 0;
        border-radius: var(--r-xl);
        box-shadow: var(--sh-4);
    }

    .al-root.is-open .al-sheet { animation-name: et-unfold; animation-duration: 380ms; }

    .al-grab { display: none; }
    .al-head { padding-top: 22px; }
    .al-close { top: 14px; }
    .al-foot { padding-bottom: 18px; }
}

/* On a phone the choices stay two to a row: the glyph above, the words
   beneath, every tile a full thumb target. The Local Host door stays wide. */
@media (max-width: 480px) {
    .al-choices { gap: 8px; }
    .al-choice {
        flex-direction: column; align-items: flex-start; gap: 8px;
        min-height: 92px; padding: 12px; font-size: var(--t-small);
    }
    .al-choice.al-choice-wide { flex-direction: row; align-items: center; min-height: 60px; }
    .al-choice .et-i { width: 32px; height: 36px; padding: 9px 8px 8px; }
}

@media (max-width: 380px) {
    .al-body { padding: 14px 16px 18px; }
    .al-head { padding-left: 16px; }
    .al-foot { padding-left: 16px; padding-right: 16px; }
    .al-row { grid-template-columns: minmax(0, 1fr); }
}

/* ===========================================================================
   THE VIETNAM DESK: search the gathered data, or ask a person.

   The search sits above the quick choices; results read as notes from the
   Desk: rounded sand cards with a small source line under each.
   =========================================================================== */

.al-desk { margin-bottom: 16px; }

/* The hidden attribute is a UA rule with the lowest precedence there is,
   so any explicit display beats it silently. While Desk results are on
   screen the tiles and footnotes yield; these lines are what make that true. */
.al-choices[hidden] { display: none; }
.al-footnote[hidden] { display: none; }

.al-desk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 4px 4px 4px 18px;
    border-radius: var(--r-pill);
    background: var(--c-bg-alt);
    box-shadow: inset 0 0 0 1px transparent;
    transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.al-desk-bar:focus-within { background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-bronze), var(--ring); }

.al-desk-bar > .et-i {
    flex: 0 0 auto;
    color: var(--c-muted);
    font-size: 1.05rem;
}

.al-desk-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    border: 0;
    background: transparent;
    color: var(--c-ink);
    font: inherit;
    /* 16px floor: anything smaller makes iOS zoom the sheet on focus. */
    font-size: 1rem;
    outline: none;
}

.al-desk-input::placeholder { color: var(--c-muted); }
.al-desk-input::-webkit-search-cancel-button { display: none; }

.al-desk-clear {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--c-bg);
    color: var(--c-ink);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 200ms var(--ease);
}

.al-desk-clear:hover { background: var(--c-bg-alt-2); }
.al-desk-clear:focus-visible { outline: none; box-shadow: var(--ring); }

.al-desk-hint {
    margin: 8px 4px 0;
    font-size: var(--t-micro);
    line-height: 1.5;
    color: var(--c-muted);
}

.al-desk-results { display: grid; gap: 10px; margin-top: 14px; }
.al-desk-results[hidden] { display: none; }

.al-desk-status,
.al-desk-empty {
    padding: 4px 2px;
    font-size: var(--t-small);
    line-height: 1.5;
    color: var(--c-muted);
}

/* ---- one note from the Desk: rises once (Sunrise-soft) ---- */

.al-deskcard {
    position: relative;
    padding: 16px 18px 14px;
    border-radius: var(--r-md);
    background: var(--c-bg-alt);
    animation: et-sunrise-soft 560ms var(--et-ease-rise) backwards;
}

.al-deskcard-kicker {
    display: block;
    margin-bottom: 4px;
    font-size: var(--t-micro);
    font-weight: 600;
    letter-spacing: 0;
    color: var(--c-bronze);
}

/* h2 on the /ask page (its cards sit directly under the page h1); the widget
   still builds an h4 inside its own overlay. text-wrap: wrap keeps the h2 off
   the balanced wrapping the design system gives every h2. */
.al-deskcard h2,
.al-deskcard h4 {
    margin-bottom: 6px;
    font-size: var(--t-body);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--c-ink);
    text-wrap: wrap;
}

.al-deskcard p {
    font-size: var(--t-small);
    line-height: 1.5;
    color: var(--c-ink-2);
}

/* A price is only ever a real range with its basis (the engine refuses to
   emit anything else), so it may look confident. */
.al-deskcard-price {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    background: var(--c-warn-bg);
    font-size: var(--t-small) !important;
    font-weight: 600;
    color: var(--c-link) !important;
}

.al-deskcard-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--c-line);
}

.al-deskcard-src {
    font-size: var(--t-micro);
    color: var(--c-muted);
}

.al-deskcard-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    font-size: var(--t-small);
    color: var(--c-link);
    text-decoration: none;
}

.al-deskcard-link:hover { text-decoration: underline; }
.al-deskcard-link:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
.al-deskcard-link .et-i { font-size: 0.9em; }

.al-desk-ask { width: 100%; margin-top: 4px; }

/* ---- the composed Desk answer (grounded in the notes) ---- */
.al-aicard {
    background: var(--c-bg);
    box-shadow: inset 0 0 0 1px var(--c-line-2);
}

.al-aianswer {
    font-size: var(--t-body) !important;
    font-weight: 400;
    line-height: 1.5 !important;
    color: var(--c-ink) !important;
}

/* ---- instant answers inside the composer ----
   A whisper above the send button: at most two cards, never a wall, and
   sending stays one motion away. */
.al-instant { margin-bottom: 14px; }

.al-instant-head {
    margin-bottom: 2px;
    font-size: var(--t-micro);
    font-weight: 600;
    color: var(--c-bronze);
}

.al-instant-head .et-i { margin-right: 4px; }

.al-instant-foot {
    font-size: var(--t-micro);
    color: var(--c-muted);
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .al-scrim,
    .al-sheet,
    .al-btn,
    .al-choice,
    .al-emergency-row a { transition: none; }
    .al-root.is-open .al-sheet,
    .al-root.is-open .al-choice,
    .al-deskcard { animation: none; }
    .al-choice:active { transform: none; }
}

/* ===========================================================================
   THE STANDALONE PAGES (/ask and /ask/<token>): The Elite Desk as a page

   The same components, laid out as a page for the no-JavaScript path and
   for anybody who opened the link in a new tab: a centred title, then the
   sheet's contents in a column of rounded cards.
   =========================================================================== */

.al-page {
    max-width: calc(680px + var(--pad) * 2);
    margin: 0 auto;
    padding: clamp(40px, 7vw, 88px) var(--pad) clamp(56px, 8vw, 104px);
}

.al-page-head { margin-bottom: clamp(28px, 4vw, 40px); text-align: center; }

.al-page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--t-lead);
    font-weight: 600;
    line-height: 1.2;
    color: var(--c-bronze);
}

.al-page h1 {
    margin: 12px 0 0;
    font-size: var(--t-display);
    line-height: 1.07;
    letter-spacing: -0.005em;
    color: var(--c-ink);
}

.al-page-lede {
    max-width: 600px;
    margin: 16px auto 0;
    font-size: var(--t-lead);
    line-height: 1.42;
    color: var(--c-muted);
}

.al-card {
    padding: clamp(20px, 4vw, 32px);
    border-radius: var(--r-xl);
    background: var(--c-bg);
    box-shadow: 0 0 0 1px var(--c-line), var(--sh-2);
}

.al-card + .al-card { margin-top: 16px; }
.al-card--quiet { background: var(--c-bg-alt); box-shadow: none; }

.al-card-title {
    margin-bottom: 14px;
    font-size: 1.3125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.011em;
    color: var(--c-ink);
}

.al-card p.al-card-text {
    font-size: var(--t-body);
    line-height: 1.5;
    color: var(--c-muted);
}

.al-card-text a { color: var(--c-link); }

.al-page .al-desk { margin-bottom: 0; }
.al-page .al-desk-hint { text-align: center; }
.al-send { width: 100%; margin-top: 6px; }
.al-page .al-note { text-align: center; }
.al-page-foot { margin-top: 20px; text-align: center; }
.al-card > .al-msg:first-child,
.al-card noscript > .al-msg,
.al-page-thread .al-msg { margin-top: 0; }
.al-page-error { margin: 0 0 14px; }
.al-page .al-note.al-page-ready { margin: 0 0 14px; font-size: var(--t-body); color: var(--c-ink); }

/* ---------- the emergency block (Safety and /ask) ---------- */

.al-emergency {
    margin-top: 16px;
    padding: clamp(22px, 3vw, 32px);
    border-radius: var(--r-lg);
    background: var(--c-danger-bg);
    color: var(--c-danger);
}

.al-emergency h2 {
    margin-bottom: 16px;
    font-size: 1.3125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.011em;
    color: var(--c-danger);
}

.al-emergency-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.al-emergency-row a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    background: var(--c-bg);
    color: var(--c-danger);
    font-size: var(--t-small);
    font-weight: 600;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow 260ms var(--et-ease-glide);
}

/* No lift: a hairline in the alarm colour on hover. */
.al-emergency-row a:hover { box-shadow: inset 0 0 0 1px var(--c-danger); color: var(--c-danger); text-decoration: none; }
.al-emergency-row a:focus-visible { outline: none; box-shadow: var(--ring); }

.al-emergency-row a > .et-i {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 10px 9px 9px;
    border-radius: 18px;
    background: var(--c-danger);
    color: #fff;
}

.al-emergency-row strong {
    display: block;
    font-size: 1.5rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.al-emergency p {
    font-size: var(--t-small);
    line-height: 1.5;
    color: var(--c-danger);
}

@media (max-width: 734px) {
    .al-page { padding-top: 28px; }
    .al-page-head { text-align: left; }
    .al-page h1 { font-size: 1.875rem; }
    .al-page-lede { margin-left: 0; font-size: var(--t-body); }
    .al-page-kicker { font-size: var(--t-body); }
    /* The three numbers stay side by side: number large, the service small. */
    .al-emergency-row { gap: 8px; }
    .al-emergency-row a { flex-direction: column; align-items: flex-start; gap: 6px; min-height: 0; padding: 10px; font-size: var(--t-micro); }
    .al-emergency-row a > .et-i { width: 30px; height: 34px; padding: 8px 7px 7px; }
    .al-emergency-row strong { font-size: 1.25rem; }
}
