/* More of the platform's buttons, beside app-btn and app-icon-btn in app-ui.css (the design: .claude/mockups/buttons/SPEC.md).
   Each site loads it after app-ui.css. js/app-button.js drives the states (done, failed, progress) and the disabled
   buttons that explain themselves; WebbuilderUI Services/AppButtonService.cs calls it from Blazor.

     app-btn-ai          Bina's button (every "let Bina do it"): a slowly turning brand edge, the star icon
     app-ai-card         the same turning edge round a card that asks Bina (with app-choice)
     app-btn-inverse     a white button with deep purple words on a dark or gradient card (the sidebar's plan card)
     app-icon-btn-sm     the 36px round icon button (app-icon-btn is 42px)
     app-btn-on-bar      a 34px text button on a dark floating bar (beside app-icon-btn-inverse); with app-btn-ai, or
                         app-icon-btn-ai on an inverse icon button, Bina's button on that bar
     app-split          a main action joined to the arrow of its other choices (two app-btn in one group)
     app-btn-expand      a round icon button that opens into a pill with its words when pointed at or focused
     app-option-chip     a chip to turn on or off (or pick one of a row): a tick springs into its round slot
     app-link            words that act (a link or a button in a sentence or under a card): purple, a soft pill on hover
     app-choice-radio    a card to pick one of (with app-choice): words and an icon, the open look when chosen
     app-icon-btn-inverse a round-cornered icon button on a dark floating bar (the Editor's bars, a picture's actions)
   and the states every button can take:
     done        data-app-done="✓ Saved" shows that text over the button for a moment (X10, X12)
     failed      app-btn-fail shakes it once with a red halo (X11)
     progress    data-app-progress with --app-btn-progress 0–1 fills it from the left (X13)
     disabled    aria-disabled="true" looks disabled but still shows its tip (data-tip) saying why, on hover, focus or a
                 tap (X16); buttons, tools, chips, links, choice cards and segmented options alike
     icon moves  each kind of icon has one small move when its button is pointed at (X9)
     ripple      a row that can be pressed as a whole (data-app-ripple, menu items, list options) ripples (X14) */

/* ---------- Bina's button ---------- */

@property --app-ai-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

/* <button class="app-btn app-btn-md app-btn-ai"><img src="_content/…/icon-ai-star.svg" alt="" />Let Bina write</button>.
   The edge is the one border a button keeps (SPEC 0.1): the surface fills the inside, the turning gradient shows in the
   1.5px border around it, four seconds a turn, the same way as the featured plan card. */
.app-btn.app-btn-ai {
    border: 1.5px solid transparent;
    background: linear-gradient(var(--app-surface), var(--app-surface)) padding-box,
        conic-gradient(from var(--app-ai-angle), var(--app-ai-edge)) border-box;
    color: var(--app-text-strong);
    animation: app-ai-turn 4s linear infinite;
}

@keyframes app-ai-turn {
    to {
        --app-ai-angle: 360deg;
    }
}

@media (hover: hover) {
    .app-btn.app-btn-ai:not(:disabled, [aria-disabled="true"]):hover {
        color: var(--app-btn-soft-active-text);
        box-shadow: 0 0 0 4px var(--app-focus-ring);
    }
}

/* Unavailable, the edge stands still; while Bina works (aria-busy) it keeps turning */
.app-btn.app-btn-ai:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"]) {
    animation-play-state: paused;
}

/* ---------- Bina's card ----------
   <button class="app-choice app-ai-card">…</button>: a card that asks Bina for something (/styles "Let Bina put a look
   together") keeps its card shape and wears the turning edge of Bina's button, 1.5px, four seconds a turn. What fills
   the card lies inside the edge (the padding box), so a picture or a tint reaching the card's side never covers it. */
.app-choice.app-ai-card {
    border: 1.5px solid transparent;
    background: linear-gradient(var(--app-surface), var(--app-surface)) padding-box,
        conic-gradient(from var(--app-ai-angle), var(--app-ai-edge)) border-box;
    animation: app-ai-turn 4s linear infinite;
}

/* Like any card it rises when pointed at; the edge stays the turning one, with Bina's button's halo round it */
@media (hover: hover) {
    .app-choice.app-ai-card:not(:disabled, [aria-disabled="true"]):hover {
        border-color: transparent;
        box-shadow: 0 0 0 4px var(--app-focus-ring);
    }
}

.app-choice.app-ai-card:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"]) {
    animation-play-state: paused;
}

/* ---------- white button on a dark card ----------
   <a class="app-btn app-btn-sm app-btn-inverse">Upgrade</a> on a card that is dark or a deep gradient in both themes
   (the sidebar's upgrade card, the Client Area's builder card): white, deep purple words. Pointing at it turns the
   words purple and puts a white halo round it (a purple one would vanish on the card); open, a purple line too. */
.app-btn.app-btn-inverse {
    background-color: var(--app-color-white);
    color: var(--app-color-deep);
    box-shadow: 0 1px 3px rgba(18, 4, 40, 0.28);
}

@media (hover: hover) {
    .app-btn.app-btn-inverse:not(:disabled, [aria-disabled="true"]):hover {
        color: var(--app-color-primary);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28), 0 1px 3px rgba(18, 4, 40, 0.28);
    }
}

.app-btn.app-btn-inverse:is([aria-expanded="true"], [aria-pressed="true"]):not(:disabled, [aria-disabled="true"]) {
    color: var(--app-color-primary);
    box-shadow: inset 0 0 0 1px var(--app-color-primary), 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.app-btn.app-btn-inverse:focus-visible {
    outline-color: var(--app-color-white);
}

/* ---------- the small round icon button ----------
   <button class="app-icon-btn app-icon-btn-sm">: 36px with an 18px icon, for a row of 36px controls (a card's small
   buttons, a list row). A touch screen still taps it over 44px (the unseen ::after of app-icon-btn). */
.app-icon-btn.app-icon-btn-sm {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

/* ---------- text button on a dark floating bar ----------
   <button class="app-btn app-btn-on-bar">Done</button>, or with app-btn-primary for the bar's main action: 34px with
   10px corners, as tall as the bar's app-icon-btn-inverse buttons and nested in the bar's own corners the same way
   (a bar of these is 4px + 34px + 4px = 42px). With no colour of its own it is white words on the bar: pointing at it
   lights a white tint, open a brighter tint with a white line. */
.app-btn.app-btn-on-bar {
    --app-btn-h: 34px;
    gap: 6px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

.app-btn.app-btn-on-bar:not(.app-btn-primary, .app-btn-danger, .app-btn-ai) {
    background-color: transparent;
    color: var(--app-color-white);
}

@media (hover: hover) {
    .app-btn.app-btn-on-bar:not(.app-btn-primary, .app-btn-danger, .app-btn-ai, :disabled, [aria-disabled="true"]):hover {
        background-color: rgba(255, 255, 255, 0.14);
        color: var(--app-color-white);
    }
}

.app-btn.app-btn-on-bar:not(.app-btn-primary, .app-btn-danger, .app-btn-ai):is([aria-expanded="true"], [aria-pressed="true"]):not(:disabled, [aria-disabled="true"]) {
    background-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.app-btn.app-btn-on-bar:focus-visible {
    outline-color: var(--app-color-white);
}

/* Bina's button on the dark bar: the bar's ink inside, the same turning edge, the star, white words.
     <button class="app-btn app-btn-ai app-btn-on-bar"><img src="…/icon-ai-star.svg" alt="" />Improve</button>
     <button class="app-icon-btn app-icon-btn-inverse app-icon-btn-ai" aria-label="…"><img src="…/icon-ai-star.svg" alt="" /></button> */
.app-btn.app-btn-ai.app-btn-on-bar,
.app-icon-btn.app-icon-btn-inverse.app-icon-btn-ai {
    border: 1.5px solid transparent;
    background: linear-gradient(var(--app-color-ink), var(--app-color-ink)) padding-box,
        conic-gradient(from var(--app-ai-angle), var(--app-ai-edge)) border-box;
    color: var(--app-color-white);
    animation: app-ai-turn 4s linear infinite;
}

.app-icon-btn.app-icon-btn-ai > img {
    flex: none;
    width: 18px;
    height: 18px;
}

@media (hover: hover) {
    .app-btn.app-btn-ai.app-btn-on-bar:not(:disabled, [aria-disabled="true"]):hover,
    .app-icon-btn.app-icon-btn-inverse.app-icon-btn-ai:not(:disabled, [aria-disabled="true"]):hover {
        background: linear-gradient(color-mix(in srgb, var(--app-color-ink), var(--app-color-white) 14%),
                color-mix(in srgb, var(--app-color-ink), var(--app-color-white) 14%)) padding-box,
            conic-gradient(from var(--app-ai-angle), var(--app-ai-edge)) border-box;
        color: var(--app-color-white);
        box-shadow: none;
    }
}

.app-btn.app-btn-ai.app-btn-on-bar:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"]),
.app-icon-btn.app-icon-btn-ai:is(:disabled, [aria-disabled="true"]) {
    animation-play-state: paused;
}

/* ---------- split button ----------
   <div class="app-split" role="group">
       <button class="app-btn app-btn-primary app-btn-md">Publish</button>
       <button class="app-btn app-btn-primary app-btn-md app-split-more" aria-label="More publish choices" aria-expanded>
           <i class="bx bx-chevron-down app-caret"></i></button>
   </div>
   One pill cut in two by a 1px gap: the main action keeps its words, the arrow opens the other choices. */
.app-split {
    display: inline-flex;
    flex: none;
    gap: 1px;
}

.app-split > .app-btn:first-child {
    border-radius: 999px 0 0 999px;
    padding-right: 14px;
}

.app-split > .app-btn.app-split-more {
    border-radius: 0 999px 999px 0;
    padding-right: 12px;
    padding-left: 10px;
}

/* ---------- a round button that opens into a pill ----------
   <button class="app-btn app-btn-primary app-btn-md app-btn-expand [app-btn-expand-left]">
       <i class="bx bx-plus"></i><span>Add section</span></button>
   At rest only the round end shows (the rest is clipped, so the button keeps its width and nothing beside it moves);
   pointing at it or focusing it unrolls the words. A touch screen shows the round button, and a tap runs it.
   app-btn-expand-left opens to the left (a button at the right edge of the screen). */
.app-btn.app-btn-expand {
    justify-content: flex-start;
    gap: 0;
    padding: 0 20px 0 0;
    clip-path: inset(0 calc(100% - var(--app-btn-h)) 0 0 round 999px);
    transition: clip-path 0.45s var(--app-ease-out), background-position 0.9s var(--app-ease-out), box-shadow 0.3s ease, color 0.25s ease;
}

.app-btn.app-btn-expand > :is(.bx, img) {
    flex: none;
    box-sizing: content-box;
    width: 1.15em;
    padding: 0 calc((var(--app-btn-h) - 1.15em) / 2);
    top: 0;
}

.app-btn.app-btn-expand > span {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.app-btn.app-btn-expand-left {
    flex-direction: row-reverse;
    padding: 0 0 0 20px;
    clip-path: inset(0 0 0 calc(100% - var(--app-btn-h)) round 999px);
}

.app-btn.app-btn-expand:is(:hover, :focus-visible) {
    clip-path: inset(0 0 0 0 round 999px);
}

.app-btn.app-btn-expand:is(:hover, :focus-visible) > span {
    opacity: 1;
    transition-delay: 0.1s;
}

@media (hover: none) {
    .app-btn.app-btn-expand:hover {
        clip-path: inset(0 calc(100% - var(--app-btn-h)) 0 0 round 999px);
    }

    .app-btn.app-btn-expand-left:hover {
        clip-path: inset(0 0 0 calc(100% - var(--app-btn-h)) round 999px);
    }

    .app-btn.app-btn-expand:hover > span {
        opacity: 0;
    }
}

/* ---------- option chip ----------
   <button class="app-option-chip" aria-pressed="false">Starred <span class="app-count">3</span></button>
   (role="radio" with aria-checked for one of a row). 36px, the brand mist, no border; a round slot on the left always
   keeps its room, so the chip never changes width: on, the tick springs into it, the mist deepens and the words turn
   purple. */
.app-option-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 6px;
    height: 36px;
    padding: 0 14px 0 8px;
    border: 0;
    border-radius: 999px;
    background-color: var(--app-surface);
    background-image: var(--app-btn-soft-fill);
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: 200% 100%;
    color: var(--app-text-strong);
    font-family: var(--app-font-family);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    will-change: transform;
    transition: background-position 0.9s var(--app-ease-out), color 0.25s ease, box-shadow 0.25s ease;
}

/* The empty slot is a thin ring of the muted words' colour, so it reads as "can be ticked" on any mist */
.app-option-chip::before {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: transparent;
    background-image: none;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--app-text-muted) 55%, transparent);
    scale: 0.8;
    transition: scale 0.4s var(--app-ease-spring), background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Boxicons and Bootstrap Icons alike (the Editor's chips show the icons of the user's website), as 1em squares */
.app-option-chip :is(.bx, .bi) {
    display: block;
    flex: none;
    width: 1em;
    height: 1em;
    font-size: 16px;
    line-height: 1;
    vertical-align: 0;
    position: relative;
    top: var(--app-icon-nudge);
}

.app-option-chip .bi::before {
    display: block;
    line-height: 1;
}

.app-option-chip:is([aria-pressed="true"], [aria-checked="true"]) {
    background-position: 100% 0;
    color: var(--app-btn-soft-active-text);
}

/* The tick: white on the accent */
.app-option-chip:is([aria-pressed="true"], [aria-checked="true"])::before {
    background-color: var(--app-accent);
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FFFFFF' d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6 11-11-1.4-1.4z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px;
    scale: 1;
}

@media (hover: hover) {
    .app-option-chip:not(:disabled, [aria-disabled="true"]):hover {
        background-position: 100% 0;
        color: var(--app-btn-soft-active-text);
    }
}

.app-option-chip:is(:disabled, [aria-disabled="true"]) {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- link ----------
   <a class="app-link" href="…">Connect a domain</a> or <button class="app-link">. Purple words; pointing at them puts
   a soft accent pill round them, the same answer as AppBack. Its edge is the pill's, so it lines up with the content
   by its edge like every other button (no negative margin). */
.app-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--app-accent);
    font-family: var(--app-font-family);
    font-size: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    will-change: transform;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.app-link .bx {
    flex: none;
    font-size: 1.15em;
    line-height: 1;
    position: relative;
    top: var(--app-icon-nudge);
}

@media (hover: hover) {
    .app-link:not(:disabled, [aria-disabled="true"]):hover {
        background: var(--app-accent-soft);
        color: var(--app-accent);
    }
}

.app-link:is(:disabled, [aria-disabled="true"]) {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------- radio card ----------
   <button class="app-choice app-choice-radio" role="radio" aria-checked="true"><i class="bx …"></i><span>…</span></button>
   in a role="radiogroup": a card of words (and an icon) to pick one of. Chosen, it takes the open look of the platform:
   a purple edge, a soft accent tint and a 4px halo. */
.app-choice.app-choice-radio {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    text-align: left;
    line-height: 1.4;
}

.app-choice.app-choice-radio[aria-checked="true"],
.app-choice.app-choice-radio[aria-checked="true"]:focus-visible {
    border-color: var(--app-accent);
    background: var(--app-accent-soft);
    box-shadow: 0 0 0 4px var(--app-focus-ring);
}

/* ---------- icon button on a dark floating bar ----------
   <button class="app-icon-btn app-icon-btn-inverse" aria-label="…">: white icon, 34px with rounded corners that nest
   in the bar's own; pointing at it lights a white tint; open, a brighter tint with a white line. */
.app-icon-btn.app-icon-btn-inverse {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background-color: transparent;
    background-image: none;
    color: var(--app-color-white);
    font-size: 18px;
}

@media (hover: hover) {
    .app-icon-btn.app-icon-btn-inverse:not(:disabled, [aria-disabled="true"]):hover {
        background-color: rgba(255, 255, 255, 0.14);
        background-image: none;
        color: var(--app-color-white);
    }
}

.app-icon-btn.app-icon-btn-inverse:is([aria-expanded="true"], [aria-pressed="true"]):not(:disabled, [aria-disabled="true"]) {
    background-color: rgba(255, 255, 255, 0.22);
    background-image: none;
    color: var(--app-color-white);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.app-icon-btn.app-icon-btn-inverse:focus-visible {
    outline-color: var(--app-color-white);
}

/* A destructive one keeps its red when pointed at or open */
.app-icon-btn.app-icon-btn-inverse.app-icon-btn-danger,
.app-icon-btn.app-icon-btn-inverse.app-icon-btn-danger:is(:hover, [aria-expanded="true"], [aria-pressed="true"]) {
    color: var(--app-inverse-danger);
}

/* ---------- done: "✓ Saved" over the button for a moment (js/app-button.js) ----------
   The button keeps its size: its own words and icon are hidden in place and the result shows over them. A solid button
   turns deep green with white words, a soft one the soft success tint with green words. */
/* Shown in full even when the button turns disabled at once (a Save with nothing left to save) */
:is(.app-btn, .app-icon-btn, .app-tool, .app-link)[data-app-done] {
    color: transparent;
    opacity: 1;
}

:is(.app-btn, .app-icon-btn, .app-tool, .app-link)[data-app-done] > * {
    visibility: hidden;
}

:is(.app-btn, .app-icon-btn, .app-tool, .app-link)[data-app-done]::before {
    content: attr(data-app-done);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border: 0;
    border-radius: inherit;
    overflow: hidden;
    color: var(--app-btn-done-text);
    white-space: nowrap;
    text-overflow: ellipsis;
    animation: app-btn-done-in 0.3s var(--app-ease-out);
}

:is(.app-btn, .app-icon-btn, .app-tool)[data-app-done] {
    background-image: none;
    background-color: var(--app-success-soft);
}

.app-btn:is(.app-btn-primary, .app-btn-danger)[data-app-done] {
    background-color: var(--app-btn-done-bg);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-btn-done-bg) 18%, transparent);
}

.app-btn:is(.app-btn-primary, .app-btn-danger)[data-app-done]::before {
    color: var(--app-color-white);
}

@keyframes app-btn-done-in {
    from {
        opacity: 0;
        translate: 0 6px;
    }
}

/* ---------- failed: one short shake and a red halo (js/app-button.js) ---------- */
:is(.app-btn, .app-icon-btn, .app-tool, .app-option-chip).app-btn-fail {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-danger) 25%, transparent);
    animation: app-btn-shake 0.42s var(--app-ease-out);
}

@keyframes app-btn-shake {
    20% {
        translate: -5px 0;
    }

    40% {
        translate: 4px 0;
    }

    60% {
        translate: -3px 0;
    }

    80% {
        translate: 2px 0;
    }
}

/* ---------- progress: the button fills from the left (js/app-button.js) ----------
   The fill takes the busy spinner's place; the page's words say what is happening ("Uploading 40%"). */
.app-btn[data-app-progress]::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    width: auto;
    height: auto;
    border: 0;
    border-radius: inherit;
    background: color-mix(in srgb, var(--app-accent) 18%, transparent);
    /* The whole button-shaped layer is cut back from the right, so its left end always follows the button's round end */
    clip-path: inset(0 calc(100% - var(--app-btn-progress, 0) * 100%) 0 0);
    transition: clip-path 0.2s linear;
    animation: none;
}

.app-btn:is(.app-btn-primary, .app-btn-danger)[data-app-progress]::before {
    background: rgba(255, 255, 255, 0.26);
}

/* ---------- disabled, still explaining why (X16) ----------
   aria-disabled="true" with data-tip: it looks and acts disabled (js/app-button.js stops its clicks), yet the pointer
   or a long press still shows the tip with the reason, which a real disabled button never does. */
:is(.app-btn, .app-icon-btn, .app-tool, .app-choice, .app-segmented-option)[aria-disabled="true"]:not([data-app-done]) {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- one small move per icon (X9) ----------
   Pointing at a button moves its icon in a way that says what it does, the same on every page: save drops in, undo
   turns back, copy pops, the trash shakes, the rocket lifts off, download dips, upload rises, add turns a quarter,
   refresh turns round. Only the icon moves (its own transform); pages add none of their own. */
@media (hover: hover) {
    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > .bx {
        animation: 0.6s var(--app-ease-out) both;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-save, .bxs-save) {
        animation-name: app-icon-drop;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-undo, .bx-redo) {
        animation-name: app-icon-back;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-copy, .bxs-copy) {
        animation-name: app-icon-pop;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-trash, .bxs-trash, .bxs-trash-alt, .bx-trash-alt) {
        animation-name: app-icon-shake;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-rocket, .bxs-rocket) {
        animation-name: app-icon-lift;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-download, .bxs-download) {
        animation-name: app-icon-down;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-upload, .bx-cloud-upload, .bxs-cloud-upload) {
        animation-name: app-icon-up;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-plus, .bx-list-plus) {
        animation-name: app-icon-turn;
    }

    :is(.app-btn, .app-icon-btn, .app-tool):not(:disabled, [aria-disabled="true"], [aria-busy="true"]):hover > :is(.bx-refresh, .bx-revision, .bx-rotate-right) {
        animation-name: app-icon-spin;
    }
}

@keyframes app-icon-drop {
    30% {
        transform: translateY(-3px);
    }

    60% {
        transform: translateY(2px);
    }
}

@keyframes app-icon-back {
    40% {
        transform: rotate(-40deg);
    }
}

@keyframes app-icon-pop {
    40% {
        transform: scale(0.8);
    }

    70% {
        transform: scale(1.12);
    }
}

@keyframes app-icon-shake {
    20% {
        transform: rotate(-10deg);
    }

    40% {
        transform: rotate(9deg);
    }

    60% {
        transform: rotate(-6deg);
    }

    80% {
        transform: rotate(3deg);
    }
}

@keyframes app-icon-lift {
    45% {
        transform: translate(3px, -3px);
    }

    46% {
        opacity: 0;
        transform: translate(6px, -6px);
    }

    47% {
        transform: translate(-4px, 4px);
    }

    100% {
        opacity: 1;
    }
}

@keyframes app-icon-down {
    40% {
        transform: translateY(3px);
    }

    70% {
        transform: translateY(-1px);
    }
}

@keyframes app-icon-up {
    40% {
        transform: translateY(-3px);
    }

    70% {
        transform: translateY(1px);
    }
}

@keyframes app-icon-turn {
    to {
        transform: rotate(90deg);
    }
}

@keyframes app-icon-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- ripple on a row pressed as a whole (X14, js/app-motion.js) ----------
   Menu items, list options and rows marked data-app-ripple answer a press with a soft wave from where they were
   pressed, instead of shrinking (a whole row shrinking makes its words shimmer). */
:where(.app-menu-item, .app-sel-option, [data-app-ripple]) {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.app-ripple {
    position: absolute;
    z-index: -1;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    background: var(--app-accent);
    opacity: 0.18;
    transform: scale(0);
    pointer-events: none;
    animation: app-ripple 0.55s var(--app-ease-out) forwards;
}

@keyframes app-ripple {
    to {
        opacity: 0;
        transform: scale(var(--app-ripple-scale, 22));
    }
}

/* ---------- touch screens ---------- */
@media (pointer: coarse) {
    :where(.app-link) {
        position: relative;
    }

    .app-option-chip::after,
    .app-link::after {
        content: "";
        position: absolute;
        inset: min(0px, calc((100% - 44px) / 2));
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-btn.app-btn-ai,
    .app-choice.app-ai-card,
    .app-icon-btn.app-icon-btn-ai {
        animation: none;
    }

    .app-btn.app-btn-expand,
    .app-btn.app-btn-expand > span,
    .app-option-chip,
    .app-option-chip::before,
    .app-link {
        transition: none;
    }

    :is(.app-btn, .app-icon-btn, .app-tool) > .bx,
    :is(.app-btn, .app-icon-btn, .app-tool, .app-option-chip).app-btn-fail,
    :is(.app-btn, .app-icon-btn, .app-tool, .app-link)[data-app-done]::before,
    .app-ripple {
        animation: none !important;
    }
}
