/* ArcticAI customer chat widget. Mobile first; everything is scoped under .acw so the site's
   Bootstrap 3 and Site.css rules cannot leak in or out. Markup is built by js/arctic-chat.js. */

.acw {
    --acw-navy: #18324a;
    --acw-blue: #2f5d96;
    --acw-blue-strong: #24497a;
    --acw-surface: #ffffff;
    --acw-canvas: #f6f8fb;
    --acw-soft: #eaf1f9;
    --acw-border: #e1e8ef;
    --acw-border-strong: #cdd8e3;
    --acw-text: #18324a;
    --acw-text-2: #44576a;
    --acw-text-3: #627384;
    --acw-danger: #b42318;
    --acw-danger-soft: #fdecea;
    --acw-warn-soft: #fff6e5;
    --acw-warn-border: #f3d79c;
    --acw-success: #18794e;
    --acw-radius: 16px;
    --acw-radius-sm: 10px;
    --acw-focus: 0 0 0 3px rgba(47, 93, 150, .28);
    --acw-shadow: 0 24px 60px rgba(24, 50, 74, .22), 0 8px 20px rgba(24, 50, 74, .12);
    --acw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --acw-vh: 100vh;
    --acw-top: 0px;
    font-family: var(--acw-font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--acw-text);
    -webkit-font-smoothing: antialiased;
}

.acw *,
.acw *::before,
.acw *::after {
    box-sizing: border-box;
}

.acw button,
.acw input,
.acw textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
}

.acw button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.acw button:focus-visible,
.acw a:focus-visible,
.acw textarea:focus-visible,
.acw input:focus-visible {
    outline: none;
    box-shadow: var(--acw-focus);
}

.acw [hidden] {
    display: none !important;
}

.acw-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Brand mark (launcher, header, avatar, empty state) ---------- */
.acw-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--acw-blue) 0%, var(--acw-navy) 100%);
}

.acw-mark svg {
    width: 58%;
    height: 58%;
}

.acw-mark--lg {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    box-shadow: 0 10px 24px rgba(47, 93, 150, .28);
}

/* ---------- Launcher ---------- */
.acw .acw-launcher {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 2147482000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    min-width: 56px;
    padding: 0 18px 0 16px;
    border-radius: 999px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--acw-blue) 0%, var(--acw-navy) 100%) !important;
    box-shadow: 0 12px 28px rgba(24, 50, 74, .32);
    font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease;
}

.acw-launcher:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(24, 50, 74, .38);
}

.acw-launcher svg {
    width: 24px;
    height: 24px;
}

.acw-launcher.acw-pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid rgba(47, 93, 150, .55);
    animation: acw-pulse 1.8s ease-out infinite;
}

.acw.is-open .acw-launcher {
    display: none;
}

@media (max-width: 640px) {
    .acw .acw-launcher {
        padding: 0;
        width: 56px;
        justify-content: center;
    }

    .acw-launcher-label {
        display: none;
    }
}

/* The site's scroll-to-top button (Content/Site.css) sits in the launcher's corner; stack it above the launcher,
   right-aligned with the pill on desktop and centred over the round launcher on phones. */
body .scrollToTop {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 640px) {
    body .scrollToTop {
        right: calc(24px + env(safe-area-inset-right, 0px));
    }
}

/* ---------- Nudge ---------- */
.acw-nudge {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 2147482000;
    width: min(290px, calc(100vw - 32px));
    padding: 14px 40px 14px 14px;
    border: 1px solid var(--acw-border);
    border-radius: 14px;
    background: var(--acw-surface);
    box-shadow: 0 16px 40px rgba(24, 50, 74, .18);
    animation: acw-rise .25s ease-out;
}

.acw-nudge p {
    margin: 0 0 10px;
    color: var(--acw-text-2);
    font-size: 14px;
}

.acw .acw-nudge-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--acw-text-3);
    font-size: 20px;
}

.acw-nudge-close:hover {
    background: var(--acw-canvas);
}

/* ---------- Panel ---------- */
.acw-panel {
    position: fixed;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--acw-surface);
    /* Phones: a full-screen sheet sized to the visual viewport, so the iOS keyboard never covers the composer. */
    left: 0;
    right: 0;
    top: var(--acw-top);
    height: var(--acw-vh);
    animation: acw-sheet-in .22s cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 641px) {
    .acw-panel {
        left: auto;
        top: auto;
        right: 20px;
        bottom: 20px;
        width: min(410px, calc(100vw - 40px));
        height: min(680px, calc(100vh - 40px));
        border: 1px solid var(--acw-border);
        border-radius: 18px;
        box-shadow: var(--acw-shadow);
        animation: acw-panel-in .2s cubic-bezier(.2, .8, .2, 1);
    }
}

/* ---------- Header ---------- */
.acw-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 10px 14px;
    border-bottom: 1px solid var(--acw-border);
    background: var(--acw-surface);
}

@media (min-width: 641px) {
    .acw-header {
        padding-top: 12px;
    }
}

.acw-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.acw-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--acw-navy);
}

.acw-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--acw-text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acw-online {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #22a06b;
    box-shadow: 0 0 0 3px rgba(34, 160, 107, .15);
}

.acw-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--acw-soft);
    color: var(--acw-blue-strong);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.acw-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.acw .acw-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--acw-text-2);
}

.acw-icon-btn:hover {
    background: var(--acw-canvas);
    color: var(--acw-navy);
}

.acw-icon-btn svg {
    width: 20px;
    height: 20px;
}

.acw .acw-text-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--acw-border-strong) !important;
    color: var(--acw-text-2);
    font-size: 13px;
    font-weight: 600;
}

.acw-text-btn:hover {
    border-color: var(--acw-blue) !important;
    color: var(--acw-navy);
}

/* ---------- Conversation ---------- */
.acw-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 8px;
    background: var(--acw-surface);
    scroll-behavior: smooth;
}

.acw-notice {
    margin: 0 auto 14px;
    max-width: 92%;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--acw-canvas);
    color: var(--acw-text-3);
    font-size: 12.5px;
    text-align: center;
}

.acw-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.acw-row--user {
    justify-content: flex-end;
}

.acw-bubble {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 16px 16px 4px 16px;
    background: var(--acw-navy);
    color: #fff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.acw-answer {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 3px;
}

.acw-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--acw-text-3);
}

.acw .acw-meta-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0 6px;
    margin-left: -6px;
    border-radius: 6px;
    color: var(--acw-text-3);
    font-size: 12px;
}

.acw-meta-btn:hover {
    background: var(--acw-canvas);
    color: var(--acw-navy);
}

.acw-meta-btn svg {
    width: 14px;
    height: 14px;
}

/* Rendered Markdown (server-sanitized HTML) */
.acw-md {
    overflow-wrap: anywhere;
    color: var(--acw-text);
}

.acw-md > :first-child {
    margin-top: 0;
}

.acw-md > :last-child {
    margin-bottom: 0;
}

.acw-md p {
    margin: 0 0 10px;
}

.acw-md ul,
.acw-md ol {
    margin: 0 0 10px;
    padding-left: 20px;
}

.acw-md li {
    margin: 2px 0;
}

.acw-md li > p {
    margin: 0;
}

.acw-md strong {
    font-weight: 650;
    color: var(--acw-navy);
}

.acw-md a {
    color: var(--acw-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.acw-md code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--acw-canvas);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.acw-md pre {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--acw-canvas);
    white-space: pre-wrap;
}

.acw-md pre code {
    padding: 0;
    background: none;
}

.acw-md blockquote {
    margin: 0 0 10px;
    padding: 2px 0 2px 12px;
    border-left: 3px solid var(--acw-border-strong);
    color: var(--acw-text-2);
}

.acw-md hr {
    border: 0;
    border-top: 1px solid var(--acw-border);
    margin: 12px 0;
}

.acw-md h1,
.acw-md h2,
.acw-md h3,
.acw-md h4 {
    margin: 4px 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--acw-navy);
}

/* Tables scroll sideways on narrow phones instead of squeezing or overflowing the panel. */
.acw-md table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    margin: 2px 0 12px;
    border-collapse: collapse;
    font-size: 13.5px;
    -webkit-overflow-scrolling: touch;
}

.acw-md th,
.acw-md td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--acw-border);
    text-align: left;
    vertical-align: top;
    /* Wrap rather than push columns (often the price) off-screen; sideways scroll is the fallback. */
    white-space: normal;
    overflow-wrap: normal;
    min-width: 2.2em;
}

.acw-md th {
    white-space: nowrap;
}

.acw-md th {
    background: var(--acw-canvas);
    color: var(--acw-text-2);
    font-weight: 600;
    font-size: 12.5px;
}

/* ---------- Actions inside the conversation ---------- */
.acw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.acw .acw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px !important;
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none !important;
    transition: background-color .15s ease, border-color .15s ease;
}

.acw-btn svg {
    width: 18px;
    height: 18px;
}

.acw-btn--primary {
    background: var(--acw-blue) !important;
    color: #fff !important;
}

.acw-btn--primary:hover {
    background: var(--acw-blue-strong) !important;
}

.acw-btn--secondary {
    border: 1px solid var(--acw-border-strong) !important;
    background: var(--acw-surface) !important;
    color: var(--acw-navy) !important;
}

.acw-btn--secondary:hover {
    border-color: var(--acw-blue) !important;
}

.acw-btn--danger {
    background: var(--acw-danger) !important;
    color: #fff !important;
}

.acw-btn[disabled] {
    opacity: .55;
    cursor: default;
}

/* Links from the booking tools (pay, sign, key box): full-width, stacked, so long labels stay readable on phones. */
.acw-actions--links {
    flex-direction: column;
    align-items: stretch;
}

.acw .acw-actions--links .acw-btn {
    justify-content: flex-start;
    padding: 10px 16px;
    line-height: 1.3;
    text-align: left;
}

.acw-actions--links .acw-btn svg {
    flex: 0 0 auto;
}

.acw-card {
    margin: 0 0 16px 40px;
    padding: 12px 14px;
    border: 1px solid var(--acw-border);
    border-radius: 12px;
    background: var(--acw-canvas);
}

.acw-card p {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--acw-text-2);
}

.acw-card--error {
    border-color: var(--acw-warn-border);
    background: var(--acw-warn-soft);
}

/* ---------- Working indicator (thinking dots + live tool steps) ---------- */
.acw-working {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.acw-working-body {
    padding-top: 5px;
    font-size: 14px;
    color: var(--acw-text-2);
}

.acw-dots {
    display: inline-flex;
    gap: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.acw-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--acw-blue);
    animation: acw-dot 1s infinite ease-in-out;
}

.acw-dots i:nth-child(2) {
    animation-delay: .15s;
}

.acw-dots i:nth-child(3) {
    animation-delay: .3s;
}

.acw-steps {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.acw-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    color: var(--acw-text-3);
    font-size: 13.5px;
}

.acw-steps li.is-current {
    color: var(--acw-navy);
    font-weight: 600;
}

.acw-steps svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.acw-steps li.is-done svg {
    color: var(--acw-success);
}

.acw-spinner {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border: 2px solid var(--acw-soft);
    border-top-color: var(--acw-blue);
    border-radius: 50%;
    animation: acw-spin .8s linear infinite;
}

/* ---------- Welcome / empty state ---------- */
.acw-welcome {
    padding: 18px 4px 6px;
    text-align: center;
}

.acw-welcome h2 {
    margin: 14px 0 6px;
    font-size: 19px;
    font-weight: 700;
    color: var(--acw-navy);
}

.acw-welcome p {
    margin: 0 auto 18px;
    max-width: 320px;
    color: var(--acw-text-2);
    font-size: 14.5px;
}

.acw-suggestions {
    display: grid;
    gap: 8px;
    text-align: left;
}

.acw .acw-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--acw-border) !important;
    border-radius: 12px;
    background: var(--acw-surface) !important;
    color: var(--acw-navy);
    font-weight: 550;
    text-align: left;
    transition: border-color .15s ease, background-color .15s ease;
}

.acw-suggestion:hover {
    border-color: var(--acw-blue) !important;
    background: var(--acw-soft) !important;
}

.acw-suggestion svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--acw-blue);
}

/* ---------- Composer ---------- */
.acw-composer {
    flex: 0 0 auto;
    padding: 10px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--acw-border);
    background: var(--acw-surface);
}

.acw-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.acw-input {
    flex: 1 1 auto;
    min-height: 46px;
    max-height: 140px;
    padding: 11px 14px;
    border: 1px solid var(--acw-border-strong) !important;
    border-radius: 14px;
    background: var(--acw-surface);
    resize: none;
    overflow-y: auto;
    /* 16px keeps iOS Safari from zooming the page when the field gets focus. */
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.acw-input:focus {
    border-color: var(--acw-blue) !important;
}

.acw-input::placeholder {
    color: var(--acw-text-3);
}

.acw .acw-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px !important;
    background: var(--acw-blue) !important;
    color: #fff !important;
    transition: background-color .15s ease, opacity .15s ease;
}

.acw-send:hover {
    background: var(--acw-blue-strong) !important;
}

.acw-send[disabled] {
    opacity: .45;
    cursor: default;
}

.acw-send svg {
    width: 20px;
    height: 20px;
}

.acw-send.is-stop {
    background: var(--acw-navy) !important;
}

.acw-fineprint {
    margin: 6px 2px 0;
    font-size: 11.5px;
    color: var(--acw-text-3);
    text-align: center;
}

.acw-fineprint a {
    color: inherit;
    text-decoration: underline;
}

/* ---------- AI glow (chat window as it opens, launcher once per visit) ----------
   A crisp multicolour line fades in and keeps flowing around the edge for about ten seconds. First a soft haze
   grows in from the edge and recedes, then once more, quicker and half as deep; the line flows on for a few
   seconds after that and slowly fades out.
   js/arctic-chat.js puts <span class="acw-ai"><span class="acw-ai-glow"></span></span> in the launcher and the
   panel, adds .acw-ai-on to play it and removes it when acw-ai-fade ends. It also sets --acw-ai-width to a whole
   number of device pixels so both edges of the line stay crisp. */
.acw-ai {
    --acw-ai-haze-max: 16px;
    --acw-ai-blur: 8px;
    display: none;
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
}

.acw-ai-on > .acw-ai {
    display: block;
    animation: acw-ai-fade 10.8s linear, acw-ai-flow 10.8s linear;
}

/* The line (and the haze's band): the gradient fills the outer edge and the mask cuts the rest out, so it follows
   the host's own corners. */
.acw-ai::before,
.acw-ai-glow::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: var(--acw-ai-width, 2.5px);
    border-radius: inherit;
    background: conic-gradient(from var(--acw-ai-angle), #2f6bff, #8b5cf6, #e8479a, #f97316, #0ea5e9, #2f6bff);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Blurred on its own element: a mask is applied after the filter, so blurring the band itself would cut it off.
   The band widens with --acw-ai-zoom, which is what makes the haze grow in from the edge. */
.acw-ai-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    filter: blur(var(--acw-ai-blur));
}

.acw-ai-glow::before {
    padding: calc(var(--acw-ai-haze-max) * var(--acw-ai-zoom));
}

.acw-ai-on .acw-ai-glow {
    animation: acw-ai-haze 10.8s linear;
}

/* On the launcher the haze is narrower, stays inside the pill and sits under the icon and label. */
.acw-launcher > .acw-ai {
    --acw-ai-haze-max: 8px;
    --acw-ai-blur: 4px;
    z-index: -1;
    clip-path: inset(0 round 999px);
}

@media (min-width: 641px) {
    /* The floating panel clips to the inside of its 1px border, so the glow runs there with 1px tighter corners. */
    .acw-panel > .acw-ai {
        border-radius: 17px;
    }
}

/* ---------- Sheets (support form, end chat) ---------- */
.acw-sheet {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    background: rgba(24, 50, 74, .32);
    animation: acw-fade .15s ease-out;
}

.acw-sheet-body {
    margin-top: auto;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    background: var(--acw-surface);
    box-shadow: 0 -12px 32px rgba(24, 50, 74, .18);
    animation: acw-sheet-up .22s cubic-bezier(.2, .8, .2, 1);
}

.acw-sheet h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: var(--acw-navy);
}

.acw-sheet p {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--acw-text-2);
}

.acw-field {
    display: block;
    margin-bottom: 10px;
}

.acw-field span {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--acw-text-2);
}

.acw-field input,
.acw-field textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--acw-border-strong) !important;
    border-radius: 10px;
    background: var(--acw-surface);
    font-size: 16px !important;
}

.acw-field textarea {
    min-height: 110px;
    resize: vertical;
}

.acw-field input:focus,
.acw-field textarea:focus {
    border-color: var(--acw-blue) !important;
}

.acw-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.acw-sheet-actions .acw-btn {
    flex: 1 1 140px;
}

.acw-status {
    min-height: 20px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--acw-text-2);
}

.acw-status.is-error {
    color: var(--acw-danger);
}

/* ---------- Page scroll lock while the full-screen sheet is open on phones ---------- */
@media (max-width: 640px) {
    html.acw-lock,
    html.acw-lock body {
        overflow: hidden !important;
    }
}

/* ---------- Motion ---------- */
/* Registered so the AI glow's colours and haze can animate. Without @property the colours stand still and the
   haze stays out (an unregistered var() leaves its padding invalid), so only the line fades in and out. */
@property --acw-ai-angle {
    syntax: "<angle>";
    inherits: true;
    initial-value: 0deg;
}

@property --acw-ai-zoom {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

/* The line (10.8s): in over half a second, keeps flowing about 4.5s after the haze is done (to 8.4s), then takes
   2.4s to fade out. */
@keyframes acw-ai-fade {
    0% { opacity: 0; animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
    4.5% { opacity: 1; }
    78% { opacity: 1; animation-timing-function: cubic-bezier(.4, 0, .5, 1); }
    100% { opacity: 0; }
}

@keyframes acw-ai-flow {
    from { --acw-ai-angle: 0deg; }
    to { --acw-ai-angle: 600deg; }
}

/* The haze, once the line is in: grows in (0.6–1.7s) and recedes (to 2.8s), then a quicker second pulse half as
   deep (to 3.9s). */
@keyframes acw-ai-haze {
    0%, 5.5% { --acw-ai-zoom: 0; opacity: 0; animation-timing-function: cubic-bezier(.22, .61, .36, 1); }
    16% { --acw-ai-zoom: 1; opacity: .75; animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
    26% { --acw-ai-zoom: 0; opacity: 0; animation-timing-function: cubic-bezier(.22, .61, .36, 1); }
    31% { --acw-ai-zoom: .5; opacity: .55; animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
    36%, 100% { --acw-ai-zoom: 0; opacity: 0; }
}

@keyframes acw-dot {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

@keyframes acw-spin {
    to { transform: rotate(360deg); }
}

@keyframes acw-pulse {
    0% { opacity: .9; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.25); }
}

@keyframes acw-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes acw-panel-in {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes acw-sheet-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes acw-sheet-up {
    from { transform: translateY(40px); }
    to { transform: translateY(0); }
}

@keyframes acw-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .acw *,
    .acw *::before,
    .acw *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .acw {
        display: none !important;
    }
}
