/* Feature layer (15.11.2026): profiles · media in the thread · live stream · message menu ·
   send settings · voice input. Uses the tokens from ux.css. Phone first.               */
:root { --ux-safe-top: env(safe-area-inset-top, 0px); --ux-safe-bottom: env(safe-area-inset-bottom, 0px); --ux-rec: #d63a4a; }

.ux-safe-probe { position: fixed; top: 0; left: 0; width: 0; height: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); visibility: hidden; pointer-events: none; }

/* ============================ 1. thread ================================ */
.ux-thread-head { margin: 0 0 var(--s-2); }
.ux-thread-head .ux-history { margin: 0; }
.ux-bubble-wrap { display: flex; align-items: flex-end; gap: 2px; min-width: 0; }
.ux-msg.out .ux-bubble-wrap { flex-direction: row-reverse; }
.ux-bubble-wrap > .bubble { min-width: 0; position: relative; }
.ux-msg .ux-msg-foot { justify-content: flex-end; gap: 4px 6px; min-height: 18px; margin-top: 2px; }
.ux-msg .ux-msg-foot time { margin-left: auto; }
.ux-edited { margin-right: 3px; font-style: italic; opacity: .85; }
.ux-warn-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #e0a326; box-shadow: 0 0 0 2px #e0a32633; }
.ux-sent { display: inline-flex; align-items: center; }
.ux-sent svg + svg { margin-left: -8px; }
.ux-sent.is-read { color: var(--c-brand); }
.ux-msg.is-deleted .bubble { opacity: .62; }
.ux-msg.is-deleted .ux-msg-text { text-decoration: line-through; text-decoration-color: #62748870; }
.ux-deleted-note { margin-top: 2px; color: var(--c-danger); font-size: var(--t-xs); font-weight: 600; }
.ux-anchor { display: block; height: 0; }
.ux-thread-empty { padding: var(--s-4) 0; }

/* the small arrow: shown on hover / focus on a computer, kept for screen readers on touch */
.ux-msg-more { flex: 0 0 28px; width: 28px; min-width: 28px; height: 28px; min-height: 28px; margin-bottom: 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--c-muted); opacity: 0; transition: opacity var(--ease), background var(--ease); position: relative; }
.ux-msg-more svg { width: 16px; height: 16px; }
.ux-msg-more::after { content: ""; position: absolute; inset: -8px; }
.ux-msg:hover .ux-msg-more, .ux-msg-more:focus-visible, .ux-msg.is-lifted .ux-msg-more { opacity: 1; }
.ux-msg-more:hover { background: #1122380f; color: var(--c-ink); }
@media (pointer: coarse) {
  .ux-msg-more { position: absolute; width: 1px; min-width: 1px; height: 1px; min-height: 1px; flex: 0 0 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
  .ux-msg-more::after { content: none; }
  .ux-msg-more svg { display: none; }
  /* holding a bubble opens our menu, not the system text selection / magnifier */
  #messages .ux-msg .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  #messages .ux-msg .bubble img { -webkit-touch-callout: none; -webkit-user-drag: none; }
}
.ux-msg.is-lifted .bubble { visibility: hidden; }

/* media */
.ux-tile { position: relative; display: block; max-width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #dfe7ee linear-gradient(110deg, #dfe7ee 30%, #edf2f6 50%, #dfe7ee 70%); background-size: 220% 100%; cursor: zoom-in; }
.ux-tile:hover { background-color: #dfe7ee; }
.ux-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ux-tile.k-round { border-radius: 50%; }
.ux-tile.k-sticker { background: transparent; border-radius: 6px; }
.ux-tile.k-sticker img { object-fit: contain; }
.ux-tile-play { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: #0c1b2a99; color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ux-tile-play svg { width: 24px; height: 24px; margin-left: 2px; }
.ux-tile-tag { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 8px; background: #0c1b2a99; color: #fff; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.ux-msg .bubble > .ux-tile, .ux-msg .bubble > .ux-album { margin: 0 0 4px; }
.ux-msg .bubble > .ux-quote + .ux-tile { margin-top: 2px; }
.ux-msg.is-media .bubble { padding: 4px 4px 3px; }
.ux-msg.is-media .ux-msg-foot { padding: 0 6px; }
.ux-msg.is-sticker .bubble { border-color: transparent; background: transparent; box-shadow: none; }
.ux-album { display: grid; gap: 2px; width: 272px; max-width: 100%; border-radius: 12px; overflow: hidden; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ux-album .ux-tile { width: 100%; border-radius: 0; }
.ux-album.n-3 .ux-tile:first-child { grid-column: 1 / -1; aspect-ratio: 2 / 1 !important; }
.ux-album.n-5, .ux-album.n-6, .ux-album.n-7, .ux-album.n-8, .ux-album.n-9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ux-album.n-5 .ux-tile:nth-child(-n+2) { grid-column: span 3; aspect-ratio: 3 / 1 !important; }
.ux-album.n-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ux-album.n-5 .ux-tile:nth-child(n+3) { grid-column: span 2; }
.ux-album.n-7 .ux-tile:first-child { grid-column: 1 / -1; aspect-ratio: 3 / 1 !important; }
.ux-album .ux-doc { grid-column: 1 / -1; }
.ux-doc { display: flex; align-items: center; gap: 10px; width: 250px; max-width: 100%; min-height: 52px; margin: 0 0 4px; padding: 6px 8px 6px 6px; border-radius: 12px; background: #1122380a; color: inherit; text-decoration: none; }
a.ux-doc:hover { background: #11223814; }
.ux-doc-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: var(--c-brand); color: #fff; }
.ux-doc-icon svg { width: 20px; height: 20px; }
.ux-doc-text { display: grid; flex: 1 1 auto; min-width: 0; }
.ux-doc-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-base); font-weight: 650; }
.ux-doc-text small { color: var(--c-muted); font-size: var(--t-xs); }
.ux-doc-get { flex: 0 0 auto; color: var(--c-brand-strong); }
.ux-doc-get svg { display: block; width: 18px; height: 18px; }
.ux-audio { width: 250px; max-width: 100%; margin: 0 0 4px; }
.ux-audio audio { display: block; width: 100%; height: 40px; }
.ux-audio small { display: block; margin-top: 2px; color: var(--c-muted); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* a message that just arrived */
@keyframes ux-msg-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.ux-msg.is-new { animation: ux-msg-in .2s ease-out both; }

/* sends made on this device */
.ux-msg.is-pending.is-sending .bubble { opacity: .82; }
.ux-msg.is-pending.is-failed .bubble, .ux-msg.is-pending.is-unknown .bubble { border-color: #edc4ca; background: var(--c-danger-soft); color: #5a2028; }
.ux-outbox-state { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; }
.ux-outbox-state.sent { color: var(--c-ok); }
.ux-dots { display: inline-flex; gap: 2px; }
.ux-dots b { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: ux-dot 1s infinite ease-in-out; }
.ux-dots b:nth-child(2) { animation-delay: .15s; } .ux-dots b:nth-child(3) { animation-delay: .3s; }
@keyframes ux-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ux-sent-as { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #2c6a6340; color: #3c6f69; font-size: var(--t-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.ux-voice-tag { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 2px; color: #3c6f69; font-size: var(--t-xs); font-weight: 650; }
.ux-voice-tag svg { width: 12px; height: 12px; }
.ux-pending-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.ux-pending-actions button { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 6px 12px; border-color: #edc4ca; border-radius: var(--r-md); background: #fff; color: var(--c-danger); font-size: var(--t-sm); font-weight: 650; }
.ux-pending-actions button:hover { background: #fff5f6; }
.ux-pending-note { margin: 0 0 4px; color: #7a3a43; font-size: var(--t-xs); }
.ux-pending-actions button svg { width: 15px; height: 15px; }

/* "↓ new message" */
.ux-latest.has-new { width: auto; max-width: calc(100vw - 24px); padding: 0 14px 0 10px; gap: 6px; border-radius: var(--r-pill); border-color: var(--c-brand); background: var(--c-brand); color: #fff; font-size: var(--t-sm); font-weight: 650; white-space: nowrap; animation: ux-msg-in .18s ease-out; }
.ux-latest.has-new:hover { background: var(--c-brand-strong); }
.ux-latest.has-new svg { width: 18px; height: 18px; }

/* ====================== 2. connection indicator ======================== */
.network-banner.ux-net { position: fixed; z-index: 60; top: calc(var(--ux-safe-top) + 8px); left: 50%; display: inline-flex; align-items: center; gap: 7px; width: auto; max-width: calc(100vw - 24px); padding: 6px 12px 6px 10px; border: 1px solid var(--c-warn-line); border-radius: var(--r-pill); background: #fff7e8f5; color: var(--c-warn); box-shadow: var(--sh-2); font-size: var(--t-sm); font-weight: 650; line-height: 1.3; transform: translateX(-50%); pointer-events: none; }
.network-banner.ux-net[hidden] { display: none; }
.ux-net-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0a326; animation: ux-pulse 1.1s infinite ease-in-out; }
@keyframes ux-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* ========================= 3. message menu ============================= */
.ux-ctx { position: fixed; inset: 0; z-index: 1500; overflow: hidden; touch-action: none; overscroll-behavior: contain; }
#toast { z-index: 2100; }
.ux-ctx-dim { position: absolute; inset: 0; background: #0b1b2a66; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .16s ease; }
.ux-ctx.is-open .ux-ctx-dim { opacity: 1; }
.ux-ctx-ghost { position: absolute; margin: 0 !important; max-width: none !important; overflow: hidden; border-radius: 16px; transform: translateY(0) scale(1); transform-origin: center; transition: transform .2s cubic-bezier(.2, .8, .3, 1.15), box-shadow .2s ease; pointer-events: none; }
.ux-ctx-ghost > .bubble { width: 100%; min-height: 100%; margin: 0; }
.ux-ctx.is-open .ux-ctx-ghost { transform: translateY(var(--ux-dy, 0px)) scale(1.025); box-shadow: 0 18px 50px #0b1b2a52; }
.ux-ctx-ghost.is-cut::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: linear-gradient(#ffffff00, #ffffffe6); }
.ux-ctx-ghost.out.is-cut::after { background: linear-gradient(#e2f2ed00, #e2f2ede6); }
.ux-ctx-menu { position: absolute; display: grid; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 16px; background: #fffffff5; box-shadow: 0 20px 60px #0b1b2a47, 0 0 0 1px #11223812; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); opacity: 0; transform: scale(.86); transform-origin: top left; transition: opacity .14s ease, transform .2s cubic-bezier(.2, .8, .3, 1.15); }
.ux-ctx-menu.from-right { transform-origin: top right; }
.ux-ctx.is-open .ux-ctx-menu { opacity: 1; transform: none; }
.ux-ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--c-ink); font-size: var(--t-md); font-weight: 500; text-align: left; }
.ux-ctx-menu button > span { flex: 1 1 auto; min-width: 0; }
.ux-ctx-menu button svg { flex: 0 0 auto; width: 19px; height: 19px; color: var(--c-ink-2); }
.ux-ctx-menu button:hover, .ux-ctx-menu button:focus-visible { background: #11223810; outline: 0; }
.ux-ctx-menu button:active { background: #1122381c; }
.ux-ctx-menu button + button { box-shadow: 0 -1px 0 #1122380d; }

/* reading sheets opened from the menu */
.ux-read { margin: 0 0 var(--s-4); }
.ux-read h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; color: var(--c-muted); font-size: var(--t-sm); font-weight: 650; letter-spacing: .2px; text-transform: uppercase; }
.ux-read h3 svg { width: 14px; height: 14px; }
.ux-read-text { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--c-sunk); color: var(--c-ink); font-size: var(--t-md); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.ux-read.is-second .ux-read-text { background: var(--c-brand-soft); }
.ux-read-quote { margin: 0 0 var(--s-4); padding: 6px 12px; border-left: 3px solid var(--c-line-strong); color: var(--c-muted); font-size: var(--t-base); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ux-inline-btn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); margin-top: 6px; padding: 6px 12px; border-radius: var(--r-md); color: var(--c-brand-strong); font-size: var(--t-sm); font-weight: 650; }
.ux-inline-btn svg { width: 16px; height: 16px; }
.ux-warn-list { display: grid; gap: 8px; margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.ux-warn-list li { padding: 10px 12px; border: 1px solid var(--c-warn-line); border-radius: var(--r-md); background: var(--c-warn-soft); color: #6b4708; font-size: var(--t-base); line-height: 1.5; }
mark.ux-unsure { padding: 0 2px; border-radius: 4px; background: #ffe2a8; color: #5a3a00; box-shadow: 0 0 0 1px #f0c36a; }
.ux-unsure-note { margin: 8px 0 0; color: var(--c-warn); font-size: var(--t-sm); font-weight: 600; line-height: 1.45; }
.ux-ok-line { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--s-4); padding: 10px 12px; border-radius: var(--r-md); background: var(--c-ok-soft); color: var(--c-ok); font-size: var(--t-base); font-weight: 600; }
.ux-ok-line svg { flex: 0 0 auto; width: 18px; height: 18px; }
.ux-note { margin: 6px 0 0; color: var(--c-muted); font-size: var(--t-sm); line-height: 1.5; }

/* a dialog that is a bottom sheet on a phone */
@media (max-width: 700px) {
  dialog.ux-sheet-dlg { inset: auto 0 0; width: 100%; max-width: none; max-height: calc(var(--app-height) - 24px - env(safe-area-inset-top)); margin: auto 0 0; border-radius: 24px 24px 0 0; border-bottom: 0; --dlg-t: 30px; --dlg-b: calc(20px + env(safe-area-inset-bottom)); animation: ux-sheet-up .24s cubic-bezier(.2, .8, .3, 1); }
  dialog.ux-sheet-dlg::before { content: ""; position: absolute; z-index: 7; top: 9px; left: calc(50% - 17px); width: 34px; height: 4px; border-radius: 4px; background: #d7e1e8; }
}
@keyframes ux-sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ============================ 4. lightbox ============================== */
.ux-lb::before { content: ""; position: absolute; inset: 0; background: #070c11; opacity: var(--ux-lb-fade, 1); }
.ux-lb { position: fixed; inset: 0; z-index: 2000; color: #fff; opacity: 0; transition: opacity .18s ease; touch-action: none; -webkit-user-select: none; user-select: none; }
.ux-lb.is-open { opacity: 1; }
.ux-lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.ux-lb-slide { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; will-change: transform; }
.ux-lb-media { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; will-change: transform; -webkit-touch-callout: none; -webkit-user-drag: none; }
video.ux-lb-media { width: 100%; height: 100%; background: #000; }
.ux-lb.is-zoomed .ux-lb-media { cursor: grab; }
.ux-lb-bar, .ux-lb-foot { position: absolute; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 10px; transition: opacity .18s ease, transform .18s ease; }
.ux-lb-bar { top: 0; padding: calc(var(--ux-safe-top) + 8px) calc(10px + env(safe-area-inset-right)) 18px calc(10px + env(safe-area-inset-left)); background: linear-gradient(#000000a6, #0000); }
.ux-lb-foot { bottom: 0; align-items: flex-end; padding: 26px calc(16px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); background: linear-gradient(#0000, #000000b3); pointer-events: none; }
.ux-lb.is-bare .ux-lb-bar, .ux-lb.is-bare .ux-lb-foot, .ux-lb.is-bare .ux-lb-nav { opacity: 0; pointer-events: none; }
.ux-lb-btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: #ffffff1f; color: #fff; }
.ux-lb-btn:hover, .ux-lb-btn:focus-visible { background: #ffffff38; }
.ux-lb-btn svg { width: 21px; height: 21px; }
.ux-lb-meta { display: grid; flex: 1 1 auto; min-width: 0; }
.ux-lb-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-md); font-weight: 650; }
.ux-lb-meta small { color: #ffffffb3; font-size: var(--t-sm); }
.ux-lb-caption { flex: 1 1 auto; min-width: 0; max-height: 30vh; margin: 0; overflow: hidden; font-size: var(--t-base); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; text-shadow: 0 1px 3px #000a; }
.ux-lb-count { flex: 0 0 auto; padding: 2px 9px; border-radius: var(--r-pill); background: #ffffff24; font-size: var(--t-sm); font-weight: 650; font-variant-numeric: tabular-nums; }
.ux-lb-count:empty { display: none; }
.ux-lb-nav { position: absolute; z-index: 2; top: 50%; display: none; align-items: center; justify-content: center; width: 48px; height: 48px; min-height: 48px; margin-top: -24px; padding: 0; border: 0; border-radius: 50%; background: #ffffff1f; color: #fff; transition: opacity .18s ease; }
.ux-lb-nav svg { width: 24px; height: 24px; }
.ux-lb-nav.prev { left: 16px; } .ux-lb-nav.next { right: 16px; }
.ux-lb-nav:hover, .ux-lb-nav:focus-visible { background: #ffffff38; }
@media (hover: hover) and (pointer: fine) { .ux-lb-nav:not([hidden]) { display: inline-flex; } }
.ux-lb.is-video .ux-lb-nav:not([hidden]) { display: inline-flex; top: 34%; }
.ux-lb.is-loading .ux-lb-stage::after { content: ""; position: absolute; top: calc(50% - 15px); left: calc(50% - 15px); width: 30px; height: 30px; border: 3px solid #ffffff40; border-top-color: #fff; border-radius: 50%; animation: ux-spin .8s linear infinite; pointer-events: none; }
.ux-lb-error { position: absolute; left: 20px; right: 20px; bottom: 30%; margin: 0; text-align: center; font-size: var(--t-base); }
@keyframes ux-spin { to { transform: rotate(360deg); } }
.ux-spin { display: inline-block; flex: 0 0 auto; width: 16px; height: 16px; border: 2px solid #0f7f8733; border-top-color: var(--c-brand); border-radius: 50%; animation: ux-spin .8s linear infinite; }

/* ====================== 5. send button and settings ==================== */
.inbox .ux-composer .ux-send.ux-round, .keyboard-open .inbox .ux-composer .ux-send.ux-round { flex: 0 0 var(--tap); width: var(--tap); min-width: var(--tap); height: var(--tap); min-height: var(--tap); padding: 0; border: 0; border-radius: 50%; background: var(--c-brand); color: #fff; box-shadow: 0 2px 8px #087f8740; transition: background var(--ease), transform .12s ease, box-shadow var(--ease); }
.inbox .ux-composer .ux-send.ux-round:hover { background: var(--c-brand-strong); }
.inbox .ux-composer .ux-send.ux-round:active { transform: scale(.93); }
.inbox .ux-composer .ux-send.ux-round .ux-round-icon { display: inline-flex; align-items: center; justify-content: center; animation: ux-icon-in .16s ease-out; }
.inbox .ux-composer .ux-send.ux-round svg { width: 21px; height: 21px; stroke-width: 2; }
.inbox .ux-composer .ux-send.ux-round.is-idle, .inbox .ux-composer .ux-send.ux-round.is-idle:hover { background: #c9d6de; box-shadow: none; }
.inbox .ux-composer .ux-send.ux-round.is-stop:hover { background: #bf2f3e; }
.inbox .ux-composer .ux-send.ux-round:disabled { background: #c9d6de; box-shadow: none; opacity: 1; cursor: not-allowed; }
.inbox .ux-composer .ux-send.ux-round.is-stop { background: var(--ux-rec); box-shadow: 0 2px 10px #d63a4a59; }
@keyframes ux-icon-in { from { opacity: 0; transform: scale(.5) rotate(-35deg); } to { opacity: 1; transform: none; } }

.ux-send-settings { display: grid; gap: 2px; margin: var(--s-2) 0; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-surface); overflow: hidden; }
.ux-send-settings .ux-note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--c-line); background: var(--c-warn-soft); color: #6b4708; }
.ux-switch { position: relative; display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: 10px 14px; cursor: pointer; }
.ux-switch + .ux-switch { border-top: 1px solid var(--c-line); }
.ux-switch-text { display: grid; flex: 1 1 auto; min-width: 0; gap: 2px; }
.ux-switch-text strong { font-size: var(--t-md); font-weight: 600; line-height: 1.3; color: var(--c-ink); }
.ux-switch-text small { color: var(--c-muted); font-size: var(--t-sm); line-height: 1.4; font-weight: 400; }
.ux-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ux-switch-ui { position: relative; flex: 0 0 50px; width: 50px; height: 30px; border-radius: 15px; background: #cfd9e0; transition: background .18s ease; }
.ux-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #11223840; transition: transform .2s cubic-bezier(.3, .8, .3, 1.2); }
.ux-switch input:checked + .ux-switch-ui { background: var(--c-brand); }
.ux-switch input:checked + .ux-switch-ui::after { transform: translateX(20px); }
.ux-switch input:focus-visible + .ux-switch-ui { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.ux-switch input:disabled + .ux-switch-ui { opacity: .5; }
.ux-menu-list { display: grid; margin: var(--s-3) 0; border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.ux-menu-list button { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 52px; padding: 8px 12px 8px 14px; border: 0; border-radius: 0; background: var(--c-surface); color: var(--c-ink); font-size: var(--t-md); font-weight: 500; text-align: left; }
.ux-menu-list button + button { border-top: 1px solid var(--c-line); }
.ux-menu-list button:hover { background: var(--c-sunk); }
.ux-menu-list button > span { flex: 1 1 auto; min-width: 0; }
.ux-menu-list button svg { flex: 0 0 auto; width: 19px; height: 19px; color: var(--c-brand-strong); }
.ux-menu-list button svg:last-child { width: 16px; height: 16px; color: var(--c-faint); }
.ux-menu-list.in-menu { margin: var(--s-3) 0 var(--s-4); }

/* ============================== 6. voice =============================== */
.ux-composer.is-voice .ux-composer-row { display: none; }
.ux-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; min-height: var(--tap); }
.ux-voice-cancel { flex: 0 0 auto; min-height: var(--tap); padding: 0 12px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--c-danger); font-size: var(--t-base); font-weight: 650; }
.ux-voice-cancel:hover { background: var(--c-danger-soft); }
.ux-voice-mid { display: flex; align-items: center; gap: 9px; flex: 1 1 0; min-width: 0; height: var(--tap); padding: 0 14px; border-radius: 22px; background: var(--c-sunk); color: var(--c-ink-2); font-size: var(--t-base); }
.ux-voice-mid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ux-voice-mid small { margin-left: auto; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.ux-voice-mid.is-rec { background: #fdeef0; color: var(--ux-rec); }
.ux-rec-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--ux-rec); animation: ux-rec 1.1s infinite ease-in-out; }
@keyframes ux-rec { 0%, 100% { box-shadow: 0 0 0 0 #d63a4a66; opacity: 1; } 50% { box-shadow: 0 0 0 7px #d63a4a00; opacity: .55; } }
.ux-voice-time { flex: 0 0 auto; min-width: 34px; color: #7a1f2a; font-size: var(--t-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.ux-voice-wave { flex: 1 1 0; min-width: 0; width: 0; height: 30px; color: var(--ux-rec); }
.ux-voice-pad { flex: 0 0 var(--tap); }
.ux-voice-hint { flex: 1 1 100%; margin: 0; color: var(--c-warn); font-size: var(--t-sm); font-weight: 600; }
.ux-voice-card { flex: 1 1 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--c-brand-line); border-radius: var(--r-lg); background: var(--c-brand-soft); }
.ux-voice-card.is-error { border-color: #edc4ca; background: var(--c-danger-soft); }
.ux-voice-said { max-height: 96px; margin: 0; overflow-y: auto; color: var(--c-ink); font-size: var(--t-md); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ux-voice-tr { max-height: 60px; margin: 4px 0 0; overflow-y: auto; color: var(--c-ink-2); font-size: var(--t-sm); line-height: 1.45; overflow-wrap: anywhere; }
.ux-voice-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; min-width: 0; }
.ux-voice-note { margin: 6px 0 0; color: var(--c-muted); font-size: var(--t-xs); line-height: 1.4; }
.ux-voice-undo, .ux-voice-now { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; min-height: var(--tap); padding: 0 14px; border-radius: 22px; font-size: var(--t-base); font-weight: 650; white-space: nowrap; }
.ux-voice-undo { border-color: var(--c-line-strong); background: #fff; color: var(--c-ink); }
.ux-voice-now { border-color: var(--c-brand); background: var(--c-brand); color: #fff; }
.ux-voice-now:hover { background: var(--c-brand-strong); }
.ux-voice-undo:hover { background: var(--c-sunk); }
.ux-voice-now svg { width: 16px; height: 16px; }
.ux-ring { display: inline-flex; width: 20px; height: 20px; }
.ux-ring svg { width: 20px; height: 20px; transform: rotate(-90deg); }
.ux-ring circle { fill: none; stroke: var(--c-brand); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 56.6; stroke-dashoffset: 0; }
@keyframes ux-ring { to { stroke-dashoffset: 56.6; } }

/* ============================= 7. profiles ============================= */
.ux-hue-0 { --ux-hue: 186; } .ux-hue-1 { --ux-hue: 262; } .ux-hue-2 { --ux-hue: 24; } .ux-hue-3 { --ux-hue: 142; } .ux-hue-4 { --ux-hue: 330; } .ux-hue-5 { --ux-hue: 210; } .ux-hue-6 { --ux-hue: 48; } .ux-hue-7 { --ux-hue: 290; } .ux-hue-8 { --ux-hue: 100; } .ux-hue-9 { --ux-hue: 0; }
.ux-pface { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: hsl(var(--ux-hue, 186) 46% 90%); color: hsl(var(--ux-hue, 186) 52% 28%); font-size: 12px; font-weight: 700; letter-spacing: .2px; }
.ux-pface.is-lg { width: 46px; height: 46px; font-size: 15px; }
.ux-pface img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; }
.ux-pface img.loaded { opacity: 1; }
.ux-pface.is-all { background: var(--c-brand-soft); color: var(--c-brand-strong); }
.ux-pface.is-add { background: transparent; border: 1.5px dashed var(--c-brand-line); color: var(--c-brand-strong); }
.ux-pface svg { width: 54%; height: 54%; }
.profile-button.ux-profile-top { position: relative; }
.profile-button.ux-profile-top .ux-pface { width: 36px; height: 36px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--c-brand-line); }
.ux-pdot { position: absolute; top: 4px; right: 3px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: var(--c-brand); }
.ux-pwrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.ux-pmark { position: absolute; right: -3px; bottom: -3px; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border: 2px solid #fff; border-radius: 50%; background: hsl(var(--ux-hue, 186) 52% 40%); color: #fff; font-size: 8.5px; font-weight: 800; font-style: normal; line-height: 1; }
.ux-pmark.is-inline { position: static; width: 13px; height: 13px; margin-right: 4px; border: 0; font-size: 7.5px; vertical-align: -2px; }
.ux-from { color: var(--c-ink-2); font-weight: 600; }
#main.ux-switching { opacity: .55; transition: opacity .12s ease; }

.sidebar .ux-profile-switch { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; margin: 0 0 18px; padding: 8px 10px; border: 1px solid #ffffff1a; border-radius: 14px; background: #ffffff0d; color: #e6f0f5; text-align: left; }
.sidebar .ux-profile-switch:hover { background: #ffffff1a; }
.sidebar .ux-profile-switch .grow { display: grid; min-width: 0; }
.sidebar .ux-profile-switch small { color: #8fb0c2; font-size: 9px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; }
.sidebar .ux-profile-switch strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.sidebar .ux-profile-switch > svg { flex: 0 0 auto; width: 15px; height: 15px; color: #8fb0c2; }
@media (max-width: 1100px) { .sidebar .ux-profile-switch { justify-content: center; padding: 8px 4px; } .sidebar .ux-profile-switch .grow, .sidebar .ux-profile-switch > svg, .sidebar .ux-profile-switch .count { display: none; } }

.ux-plist { display: grid; margin: 0 0 var(--s-3); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.ux-prow { display: flex; align-items: center; min-width: 0; background: var(--c-surface); }
.ux-prow + .ux-prow { border-top: 1px solid var(--c-line); }
.ux-prow.is-active { background: var(--c-brand-soft); }
.ux-prow-main, .ux-padd { display: flex; align-items: center; gap: var(--s-3); flex: 1 1 auto; min-width: 0; min-height: 64px; padding: 8px 10px 8px 12px; border: 0; border-radius: 0; background: transparent; color: var(--c-ink); text-align: left; }
.ux-prow-main:hover, .ux-padd:hover { background: #11223808; }
.ux-prow-main .grow, .ux-padd .grow { display: grid; min-width: 0; gap: 1px; }
.ux-prow-main strong, .ux-padd strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-md); font-weight: 650; }
.ux-prow-main small, .ux-padd small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-muted); font-size: var(--t-sm); font-weight: 400; }
.ux-pcheck { display: inline-flex; flex: 0 0 22px; width: 22px; height: 22px; color: var(--c-brand); }
.ux-pcheck svg { width: 22px; height: 22px; stroke-width: 2.4; }
.ux-prow .ux-icon-btn { flex: 0 0 var(--tap); margin-right: 6px; border: 0; background: transparent; color: var(--c-muted); }
.ux-padd { width: 100%; border: 1px dashed var(--c-brand-line); border-radius: var(--r-lg); color: var(--c-brand-strong); }
.ux-padd:disabled { opacity: .55; }
.ux-pmanage .form, .ux-wizard .form { margin-top: var(--s-3); }
.ux-choices { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ux-choices legend { margin-bottom: 8px; padding: 0; color: var(--c-ink); font-size: var(--t-base); font-weight: 650; }
.ux-choice { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 56px; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); cursor: pointer; }
.ux-choice:has(input:checked) { border-color: var(--c-brand); background: var(--c-brand-soft); box-shadow: 0 0 0 1px var(--c-brand); }
.ux-choice input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--c-brand); }
.ux-choice-body { display: grid; flex: 1 1 auto; min-width: 0; gap: 2px; }
.ux-choice-body strong { display: flex; align-items: center; gap: 6px; font-size: var(--t-md); font-weight: 600; color: var(--c-ink); }
.ux-choice-body strong svg { width: 17px; height: 17px; color: var(--c-brand-strong); }
.ux-choice-body small { color: var(--c-muted); font-size: var(--t-sm); line-height: 1.4; font-weight: 400; }
.ux-choice-body select { width: 100%; min-width: 0; margin-top: 6px; }
.ux-steps { display: flex; gap: 4px; margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.ux-steps li { display: flex; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; padding-bottom: 8px; border-bottom: 3px solid var(--c-line); color: var(--c-faint); font-size: var(--t-xs); font-weight: 650; }
.ux-steps li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-steps li i { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-line); color: var(--c-muted); font-size: 10px; font-style: normal; }
.ux-steps li i svg { width: 11px; height: 11px; stroke-width: 3; }
.ux-steps li.is-now { border-color: var(--c-brand); color: var(--c-brand-strong); }
.ux-steps li.is-now i { background: var(--c-brand); color: #fff; }
.ux-steps li.is-done { border-color: var(--c-brand-line); color: var(--c-ink-2); }
.ux-steps li.is-done i { background: var(--c-brand-soft); color: var(--c-brand-strong); }
.ux-qr { display: grid; justify-items: center; gap: var(--s-3); }
.ux-qr-box { display: flex; align-items: center; justify-content: center; width: 248px; max-width: 100%; aspect-ratio: 1; padding: 8px; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1); }
.ux-qr-box img { display: block; width: 100%; height: 100%; }
.ux-qr-status { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--c-ink-2); font-size: var(--t-base); font-weight: 600; }
.ux-howto { justify-self: stretch; display: grid; gap: 6px; margin: 0; padding: 0 0 0 20px; color: var(--c-ink-2); font-size: var(--t-base); line-height: 1.5; }
.ux-qr .ux-dialog-foot, .ux-qr .ux-note { justify-self: stretch; }
.ux-code { font-size: 22px !important; font-weight: 700; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.ux-done { display: grid; justify-items: center; gap: 6px; text-align: center; }
.ux-done > * { max-width: 100%; }
.ux-done h3 { margin: 6px 0 0; font-size: var(--t-lg); overflow-wrap: anywhere; }
.ux-done p { margin: 0; color: var(--c-ink-2); font-size: var(--t-base); line-height: 1.5; }
.ux-done-mark { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--c-ok-soft); color: var(--c-ok); animation: ux-icon-in .3s ease-out; }
.ux-done-mark svg { width: 30px; height: 30px; stroke-width: 2.4; }
.ux-done .ux-dialog-foot { justify-self: stretch; }
button.is-busy { position: relative; color: transparent !important; }
button.is-busy::after { content: ""; position: absolute; top: calc(50% - 8px); left: calc(50% - 8px); width: 16px; height: 16px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: ux-spin .8s linear infinite; }

@media (max-width: 400px) {
  .ux-steps li { flex: 0 0 auto; }
  .ux-steps li.is-now { flex: 1 1 auto; }
  .ux-steps li:not(.is-now) span { display: none; }
}
@media (min-width: 701px) {
  dialog.ux-profiles-dlg { width: min(480px, calc(100vw - 32px)); }
  .ux-ctx-dim { background: #0b1b2a47; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .ux-msg.is-new, .ux-latest.has-new, dialog.ux-sheet-dlg, .ux-round-icon, .ux-done-mark { animation: none !important; }
  .ux-ctx-dim, .ux-ctx-ghost, .ux-ctx-menu, .ux-lb, .ux-switch-ui, .ux-switch-ui::after { transition: none !important; }
  .ux-ctx.is-open .ux-ctx-ghost { transform: translateY(var(--ux-dy, 0px)); }
  .ux-rec-dot, .ux-net-dot, .ux-dots b { animation-duration: 2.4s; }
}
