.utp-platform-uma {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 8px 3px 5px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,.78);
    font: inherit;
    line-height: 1;
    cursor: default;
    white-space: nowrap;
}

.utp-platform-uma::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 0 0 1px rgba(245,121,59,.14), 0 0 13px rgba(245,121,59,.12);
    animation: utp-uma-breathe 4.8s ease-in-out infinite;
}

.utp-platform-uma__mark {
    display: grid;
    grid-template-columns: repeat(2, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 2px;
    align-items: center;
    justify-items: center;
    width: 20px;
    height: 20px;
}

.utp-platform-uma__mark span {
    display: grid;
    place-items: center;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(245,121,59,.84);
    border-radius: 2px;
    color: #f5793b;
    font-size: 5px;
    line-height: 1;
    font-weight: 800;
    box-sizing: border-box;
    box-shadow: inset 0 0 5px rgba(245,121,59,.07), 0 0 4px rgba(245,121,59,.05);
}

.utp-platform-uma__name {
    color: rgba(255,255,255,.76);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
}

@keyframes utp-uma-breathe {
    0%,64%,100% { opacity: 0; }
    76% { opacity: .18; }
    84% { opacity: .06; }
    90% { opacity: .14; }
}

@media (prefers-reduced-motion: reduce) {
    .utp-platform-uma::after {
        animation: none;
        opacity: .08;
    }
}

/* ========================================================================== 
   UMA INTERACTION FOUNDATION V1 — 2026-09-21
   Persistent, provider-neutral interaction surface opened from the central
   UMA control. This layer owns interaction geometry only; intelligence and
   business capabilities connect through the `utp:uma:prompt` browser event.
   ========================================================================== */
.utp-platform-status__uma-wrap { position: relative; }

.utp-uma-interaction {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 14px);
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 48px));
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(28,35,48,.98), rgba(45,37,42,.98));
    box-shadow: 0 22px 60px rgba(0,0,0,.42), 0 0 24px rgba(245,121,59,.08);
    backdrop-filter: blur(18px);
    color: #fff;
    z-index: 40;
}
.utp-uma-interaction[hidden] { display: none !important; }
.utp-uma-interaction::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 13px;
    height: 13px;
    transform: translateX(-50%) rotate(45deg);
    border-right: 1px solid rgba(255,255,255,.18);
    border-bottom: 1px solid rgba(255,255,255,.18);
    background: rgba(42,38,44,.98);
}
.utp-uma-interaction__head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 28px;
    margin-bottom: 11px;
}
.utp-uma-interaction__head strong {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}
.utp-uma-interaction__identity {
    display: grid;
    grid-template-columns: repeat(2, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 2px;
}
.utp-uma-interaction__identity span {
    display: grid;
    place-items: center;
    width: 8px;
    height: 8px;
    box-sizing: border-box;
    border: 1px solid rgba(245,121,59,.9);
    border-radius: 2px;
    color: #f5793b;
    font-size: 5px;
    font-weight: 800;
    line-height: 1;
}
.utp-uma-interaction__close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,.54);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.utp-uma-interaction__close:hover { background: rgba(255,255,255,.06); color: #fff; }
.utp-uma-interaction__form {
    display: grid;
    grid-template-columns: minmax(0,1fr) 38px;
    gap: 9px;
    align-items: end;
    padding: 7px 7px 7px 13px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    background: rgba(7,13,24,.42);
}
.utp-uma-interaction__form:focus-within {
    border-color: rgba(245,121,59,.52);
    box-shadow: 0 0 0 2px rgba(245,121,59,.07);
}
.utp-uma-interaction__input {
    width: 100%;
    min-height: 38px;
    max-height: 126px;
    padding: 9px 0 7px;
    resize: none;
    overflow-y: auto;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #fff !important;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
}
.utp-uma-interaction__input::placeholder { color: rgba(255,255,255,.42); }
.utp-uma-interaction__send {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(245,121,59,.52);
    border-radius: 11px;
    background: rgba(245,121,59,.12);
    color: #f5793b;
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}
.utp-uma-interaction__send:hover:not(:disabled) { background: rgba(245,121,59,.2); border-color: #f5793b; }
.utp-uma-interaction__send:disabled { opacity: .32; cursor: default; }

/* UMA CAPABILITY V1 — grounded response surface. */
.utp-uma-interaction__response {
    margin-top: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 12px;
    background: rgba(7,13,24,.28);
    color: rgba(255,255,255,.88);
    font-size: 12px;
    line-height: 1.5;
}
.utp-uma-interaction__response.is-error {
    border-color: rgba(245,121,59,.28);
    color: rgba(255,255,255,.72);
}
.utp-uma-interaction__answer { white-space: pre-wrap; }
.utp-uma-interaction__thinking {
    color: rgba(255,255,255,.52);
    letter-spacing: .06em;
}
.utp-uma-interaction__links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}
.utp-uma-interaction__links a {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border: 1px solid rgba(245,121,59,.30);
    border-radius: 9px;
    color: #ff8a52;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
}
.utp-uma-interaction__links a:hover {
    border-color: rgba(245,121,59,.62);
    background: rgba(245,121,59,.07);
}
.utp-uma-interaction__form.is-busy { opacity: .72; }

/* UMA CONVERSATION FOUNDATION V1 — compact live thread above the composer. */
.utp-uma-interaction__conversation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    margin: 0 0 10px;
    padding-right: 2px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.utp-uma-interaction__conversation[hidden] { display: none !important; }
.utp-uma-interaction__turn {
    max-width: 92%;
    padding: 9px 11px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    background: rgba(7,13,24,.28);
    color: rgba(255,255,255,.88);
    font-size: 12px;
    line-height: 1.48;
}
.utp-uma-interaction__turn.is-user {
    align-self: flex-end;
    border-color: rgba(245,121,59,.30);
    background: rgba(245,121,59,.08);
}
.utp-uma-interaction__turn.is-assistant { align-self: flex-start; }
.utp-uma-interaction__turn.is-error { border-color: rgba(245,121,59,.28); color: rgba(255,255,255,.72); }
.utp-uma-interaction__turn.is-thinking { color: rgba(255,255,255,.52); letter-spacing: .06em; }
.utp-uma-interaction__turn-copy { white-space: pre-wrap; }

/* UMA Conversation Foundation V2 — explicit thread reset, close remains non-destructive. */
.utp-uma-interaction__new {
    margin-left: auto;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,.58);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.utp-uma-interaction__new:hover { border-color: rgba(245,121,59,.35); color: #f5793b; background: rgba(245,121,59,.06); }
.utp-uma-interaction__new + .utp-uma-interaction__close { margin-left: 0; }

/* Platform UMA attention state: reuses the existing UMA orange and status geometry. */
.utp-platform-uma.has-uma-attention .utp-platform-uma__mark::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f5793b;
    box-shadow: 0 0 0 2px #0b1622;
}

/* UMA expanded mode: only surface-specific geometry; visual controls reuse UMA foundation. */
.utp-uma-interaction__expand {
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,.58);
    font: inherit;
    cursor: pointer;
}
.utp-uma-interaction__expand:hover { border-color: rgba(245,121,59,.35); color: #f5793b; }
.utp-uma-interaction__expand + .utp-uma-interaction__new { margin-left: auto; }
.utp-uma-interaction.is-expanded {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(1100px, 88vw);
    height: min(820px, 86vh);
    display: flex;
    flex-direction: column;
    z-index: 10010;
}
.utp-uma-interaction.is-expanded::after { display: none; }
.utp-uma-interaction.is-expanded .utp-uma-interaction__conversation {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}
.utp-uma-interaction.is-expanded .utp-uma-interaction__form { flex: 0 0 auto; }
.utp-uma-interaction.is-expanded .utp-uma-interaction__turn { max-width: 84%; }
@media (max-width: 767px) {
    .utp-uma-interaction.is-expanded { width: calc(100vw - 24px); height: 80vh; }
}

/* UMA answer content: reuse the established UMA surface typography and palette. */
.utp-uma-interaction__turn-copy:has(> p) { white-space: normal; min-width: 0; }
.utp-uma-interaction__turn-copy p { margin: 0 0 7px; }
.utp-uma-interaction__turn-copy p:last-child { margin-bottom: 0; }
.utp-uma-interaction__turn-copy ul, .utp-uma-interaction__turn-copy ol { margin: 5px 0 9px; padding-left: 20px; }
.utp-uma-interaction__turn-copy li { margin-bottom: 3px; }
.utp-uma-interaction__subheading { font-weight: 700; margin: 10px 0 5px; }
.utp-uma-interaction__table-scroll { overflow-x: auto; max-width: 100%; margin: 9px 0; scrollbar-width: thin; }
.utp-uma-interaction__table-scroll table { width: 100%; border-collapse: collapse; white-space: normal; }
.utp-uma-interaction__table-scroll th, .utp-uma-interaction__table-scroll td { padding: 7px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(255,255,255,.11); min-width: 90px; }
.utp-uma-interaction__table-scroll th { color: rgba(255,255,255,.78); font-weight: 700; background: rgba(255,255,255,.045); }
.utp-uma-interaction__turn-copy a { color: #ff8a52; overflow-wrap: anywhere; }
.utp-uma-interaction__turn-copy a.utp-uma-interaction__reservation-link { display: inline-block; padding: 2px 6px; margin: 1px 0; border: 1px solid rgba(245,121,59,.35); border-radius: 8px; text-decoration: none; background: rgba(245,121,59,.08); white-space: nowrap; }
.utp-uma-interaction__turn-copy a.utp-uma-interaction__reservation-link:hover { background: rgba(245,121,59,.16); }
.utp-uma-interaction__turn-copy code { font: inherit; opacity: .85; }
