﻿/*
    AethonAI mobile experience
    Loaded after styles-desktop.css.
*/

.mobile-app-header,
.mobile-sidebar-backdrop {
    display: none;
}

@media (max-width: 760px) {
    :root {
        --mobile-header-height: 58px;
    }

    html,
    body,
    form {
        width: 100%;
        height: 100%;
        min-height: 100%;
        margin: 0;
        overflow: hidden;
    }

    body {
        overscroll-behavior: none;
        background: var(--page-background);
    }

    button {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .app-shell {
        position: relative;
        display: block;
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
    }

    /* Mobile application bar */
    .mobile-app-header {
        position: fixed;
        z-index: 1002;
        top: 0;
        right: 0;
        left: 0;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 10px;
        height: var(--mobile-header-height);
        padding: 7px 10px;
        border-bottom: 1px solid var(--border-color);
        background: rgba(18, 18, 18, 0.96);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }

    .mobile-header-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: #191919;
        color: var(--primary-text);
        font-size: 21px;
        line-height: 1;
    }

    .mobile-header-button[aria-expanded="true"] {
        border-color: #5d9cff;
        background: rgba(46, 116, 187, 0.23);
    }

    .mobile-assistant-toggle-icon {
        display: block;
        font-size: 25px;
        line-height: 1;
        transform: rotate(180deg);
        transition: transform 0.22s ease;
    }

    .mobile-header-button[aria-expanded="true"] .mobile-assistant-toggle-icon {
        transform: rotate(0deg);
    }

    .mobile-header-brand {
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 10px;
    }

    .mobile-header-logo {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        border-radius: 10px;
        object-fit: cover;
    }

    .mobile-header-copy {
        display: flex;
        min-width: 0;
        flex-direction: column;
    }

    .mobile-header-title {
        overflow: hidden;
        font-size: 14px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-header-status {
        margin-top: 2px;
        color: var(--success);
        font-size: 11px;
    }

    /* Navigation becomes a real drawer instead of disappearing. */
    .sidebar,
    .sidebar.is-collapsed {
        position: fixed;
        z-index: 1010;
        top: 0;
        bottom: 0;
        left: 0;
        display: flex;
        width: min(86vw, 330px);
        height: 100dvh;
        padding: 12px;
        border-right: 1px solid #3a3a3a;
        box-shadow: 18px 0 50px rgba(0, 0, 0, 0.52);
        transform: translateX(-105%);
        transition: transform 0.22s ease;
    }

    .sidebar.is-mobile-open,
    .sidebar.is-collapsed.is-mobile-open {
        transform: translateX(0);
    }

    .sidebar.is-collapsed .brand-icon,
    .sidebar.is-collapsed .brand-text,
    .sidebar.is-collapsed .assistant-selector,
    .sidebar.is-collapsed .new-chat-button,
    .sidebar.is-collapsed .sidebar-section,
    .sidebar.is-collapsed .sidebar-assets-entry,
    .sidebar.is-collapsed .youtube-sidebar-controls:not(.is-hidden),
    .sidebar.is-collapsed .sidebar-notification:not(.is-hidden),
    .sidebar.is-collapsed .sidebar-footer {
        display: initial;
    }

    .sidebar.is-collapsed .brand-text,
    .sidebar.is-collapsed .assistant-selector,
    .sidebar.is-collapsed .sidebar-section,
    .sidebar.is-collapsed .sidebar-footer {
        display: flex;
    }

    .sidebar.is-collapsed .new-chat-button,
    .sidebar.is-collapsed .sidebar-assets-entry,
    .sidebar.is-collapsed .youtube-sidebar-controls:not(.is-hidden),
    .sidebar.is-collapsed .sidebar-notification:not(.is-hidden) {
        display: block;
    }

    .sidebar-header,
    .sidebar.is-collapsed .sidebar-header {
        justify-content: flex-start;
        padding: 5px 5px 13px;
    }

    .sidebar-collapse-button,
    .sidebar.is-collapsed .sidebar-collapse-button {
        margin-left: auto;
    }

    .sidebar-collapse-icon {
        transform: rotate(0deg) !important;
    }

    /* Mobile navigation has only two states: fully open or fully closed. */
    .sidebar,
    .sidebar.is-collapsed {
        flex-basis: auto;
        max-width: min(86vw, 330px);
        overflow: hidden;
    }

    .sidebar .sidebar-section {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
    }

    .sidebar .conversation-list {
        min-height: 0;
        overflow-y: auto;
    }

    .sidebar .sidebar-assets-entry,
    .sidebar .youtube-sidebar-controls:not(.is-hidden),
    .sidebar .sidebar-notification:not(.is-hidden),
    .sidebar .sidebar-footer {
        display: block;
        flex: 0 0 auto;
        width: 100%;
    }

    .sidebar .sidebar-footer-button {
        display: block;
        width: 100%;
        text-align: left;
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        z-index: 1005;
        inset: 0;
        display: block;
        padding: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.58);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .mobile-navigation-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* Main workspace owns all remaining screen space. */
    .main-content {
        display: flex;
        width: 100%;
        height: 100dvh;
        min-height: 0;
        padding-top: var(--mobile-header-height);
        flex-direction: column;
        overflow: hidden;
    }

    .workspace-panel {
        order: 2;
        display: flex;
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        height: auto;
        padding: 8px;
        overflow: hidden;
    }

    .welcome-panel {
        width: 100%;
        height: 100%;
        padding: 28px 20px;
        border-radius: 14px;
    }

    .welcome-brand-icon {
        width: 76px;
        height: 76px;
        margin-bottom: 18px;
        border-radius: 20px;
    }

    .welcome-panel h1 {
        font-size: 25px;
    }

    .welcome-panel p {
        font-size: 14px;
    }

    /* Assistant visualization is a compact, optional tray. */
    .assistant-stage,
    .assistant-stage.is-collapsed {
        order: 1;
        flex: 0 0 auto;
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
        border-left: 0;
        transition: height 0.22s ease, min-height 0.22s ease;
    }

    .assistant-stage {
        height: min(32dvh, 270px);
        min-height: 210px;
    }

    .assistant-stage.is-collapsed {
        height: 0;
        min-height: 0;
        overflow: hidden;
        border-bottom: 0;
    }

    .assistant-stage-header {
        min-height: 52px;
        padding: 9px 14px;
    }

    /* The mobile header owns the assistant panel toggle. */
    .assistant-stage .assistant-collapse-button {
        display: none;
    }

    .assistant-placeholder {
        width: 105px;
        height: 175px;
    }

    .assistant-placeholder-head {
        top: 5px;
        width: 60px;
        height: 70px;
        border-width: 1px;
    }

    .assistant-placeholder-head::before,
    .assistant-placeholder-head::after {
        top: 31px;
        width: 5px;
        height: 2px;
    }

    .assistant-placeholder-head::before { left: 17px; }
    .assistant-placeholder-head::after { right: 17px; }

    .assistant-placeholder-body {
        width: 105px;
        height: 115px;
        border-width: 1px;
        border-radius: 46px 46px 15px 15px;
    }

    .assistant-placeholder-body::before {
        top: 25px;
        width: 40px;
    }

    .assistant-visual-message {
        right: 10px;
        bottom: 8px;
        left: 10px;
    }

    /* Chat fills the viewport and keeps the composer reachable. */
    .chat-panel {
        align-self: stretch;
        width: 100%;
        height: 100%;
        min-height: 0;
        margin: 0;
        border-radius: 14px;
    }

    .chat-header {
        min-height: 54px;
        padding: 10px 14px;
    }

    .chat-messages {
        min-height: 0;
        padding: 16px 11px 12px;
        overscroll-behavior: contain;
    }

    .chat-message {
        margin-bottom: 13px;
    }

    .chat-messages {
        scroll-padding-bottom: 18px;
    }

    .chat-message:last-child {
        margin-bottom: 18px;
    }

    .chat-message-bubble,
    .chat-bubble,
    .chat-message-timestamp {
        width: 94%;
        max-width: 94%;
        padding: 11px 12px;
        border-radius: 13px;
        overflow-wrap: anywhere;
    }

    .chat-scroll-bottom-button {
        width: 40px;
        height: 34px;
    }

    .chat-action-strip {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 7px;
        min-height: 0;
        padding: 8px 9px;
    }

    .chat-tool-bar {
        display: flex;
        width: 100%;
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .chat-tool-row {
        display: flex;
        width: 100%;
        min-width: 0;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .chat-tool-row::-webkit-scrollbar,
    .chat-emoji-bar::-webkit-scrollbar {
        display: none;
    }

    .chat-tool-button {
        min-width: 38px;
        min-height: 36px;
        padding: 6px 9px;
        gap: 0;
        scroll-snap-align: start;
        font-size: 17px;
    }

    .chat-tool-button span {
        display: none;
    }

    .chat-emoji-region,
    .chat-emoji-region.is-expanded {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        align-items: stretch;
    }

    .chat-emoji-bar {
        display: flex;
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .chat-emoji-favorites {
        display: flex;
        flex: 0 0 auto;
        gap: 6px;
    }

    .chat-emoji-button,
    .chat-emoji-expand-button,
    .chat-emoji-collapse-button {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 10px;
    }

    .chat-emoji-more {
        grid-template-columns: repeat(6, 36px);
        width: 100%;
        max-width: 100%;
        max-height: 132px;
        margin-top: 7px;
        padding: 7px;
        overflow-y: auto;
    }

    .chat-composer {
        grid-template-columns: 46px minmax(0, 1fr) 118px;
        gap: 7px;
        padding: 8px 9px calc(9px + env(safe-area-inset-bottom));
    }

    .chat-image-upload-control,
    .chat-image-upload-button {
        width: 46px;
        height: 46px;
    }

    .chat-input-shell {
        min-width: 0;
        min-height: 46px;
    }

    .chat-composer textarea {
        min-height: 46px;
        height: 46px;
        padding: 11px;
        font-size: 16px;
    }

    .chat-submit-control {
        width: 118px;
        height: 46px;
        flex-basis: 118px;
    }

    .chat-send-button,
    .chat-mic-region {
        height: 44px;
    }

    .chat-send-button {
        min-height: 44px;
        padding: 0 9px;
    }

    .chat-send-spinner {
        flex: 0 0 17px;
        width: 17px;
        min-width: 17px;
        height: 17px;
        min-height: 17px;
        aspect-ratio: 1 / 1;
        box-sizing: border-box;
        line-height: 0;
    }

    /* Wizards and overlays remain usable rather than overflowing the viewport. */
    .profile-wizard {
        width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        border-radius: 14px;
    }

    .wizard-header {
        gap: 12px;
        padding: 16px 14px;
    }

    .wizard-logo {
        width: 48px;
        height: 48px;
        border-radius: 13px;
    }

    .wizard-header h1 {
        font-size: 20px;
    }

    .wizard-header p {
        font-size: 13px;
    }

    .wizard-progress {
        padding: 11px 14px;
    }

    .wizard-progress-label {
        display: none;
    }

    .wizard-progress-line {
        margin: 0 6px;
    }

    .wizard-content {
        padding: 18px 14px 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .speaking-style-field {
        padding-top: 0;
    }

    .assistant-settings-overlay.is-open {
        padding: 0;
    }

    .assistant-settings-overlay.is-open .profile-wizard {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .form-field-full {
        grid-column: auto;
    }

    .trait-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wizard-footer {
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    }

    .assistant-memory-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .assistant-memory-select-all {
        margin-left: 0;
    }

    .assistant-memory-selection-summary {
        flex: 1 1 auto;
        padding-top: 3px;
        text-align: right;
    }

    .assistant-memory-delete-button {
        width: 100%;
        margin-left: 0;
    }

    .assistant-memory-row {
        padding: 13px 12px;
    }

    .assistant-memory-row-header {
        align-items: center;
    }

    .assets-overlay,
    .account-overlay,
    .image-viewer-overlay {
        padding: 0;
    }

    .assets-panel,
    .account-panel,
    .image-viewer-panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }


    .account-header {
        flex: 0 0 auto;
        padding: 12px 12px 12px 16px;
    }

    .account-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 14px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .account-tabs {
        flex: 0 0 auto;
        padding: 8px 12px 0;
        overflow: visible;
    }

    .account-tab-button {
        flex: 1 1 0;
        min-width: 0;
        padding-right: 10px;
        padding-left: 10px;
    }

    .account-playlist-toolbar,
    .account-playlist-card-heading,
    .account-playlist-add-song {
        grid-template-columns: 1fr;
    }

    .account-playlist-toolbar {
        display: grid;
    }

    .account-playlist-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .account-playlist-new-button,
    .account-playlist-clear-most-button {
        width: 100%;
    }

    .account-playlist-card-actions {
        justify-content: flex-end;
    }

    .account-playlist-song-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .account-playlist-add-song .account-secondary-action {
        width: 100%;
    }

    .account-section {
        padding: 14px;
    }

    .account-form-grid,
    .account-name-grid,
    .account-time-zone-row {
        grid-template-columns: 1fr;
    }

    .account-avatar-editor {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
    }

    .account-avatar-preview {
        width: 72px;
        height: 72px;
        font-size: 21px;
    }

    .account-secondary-action {
        width: 100%;
    }

    .account-footer {
        flex: 0 0 auto;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    }

    .account-button {
        flex: 1 1 0;
    }

    .assets-layout {
        grid-template-columns: 1fr;
    }

    .assets-filter-panel {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0 7px;
        padding: 10px;
        overflow-x: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .assets-filter-panel h3,
    .assets-image-subfilters,
    .assets-filter-divider,
    .assets-danger-action {
        grid-column: 1 / -1;
    }

    .assets-image-subfilters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-left: 18px;
    }

    .assets-filter-panel h3 {
        margin-top: 8px;
    }

    .assets-toolbar {
        display: flex;
    }

    .asset-row {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .asset-thumbnail-button {
        width: 58px;
        height: 52px;
    }

    .asset-row-actions {
        grid-column: 1 / -1;
    }

    /* Conversation/archive selector and floating row menus. */
    .conversation-view-toggle {
        min-height: 30px;
        padding-right: 4px;
    }

    .conversation-view-menu-icon {
        width: 22px;
        height: 22px;
        font-size: 19px;
        transform: translateY(-1px);
    }

    .conversation-view-menu {
        z-index: 6010;
        min-width: 144px;
    }

    .conversation-menu {
        z-index: 6020;
        min-width: 142px;
        max-width: calc(100vw - 24px);
    }

    .conversation-menu-button {
        width: 36px;
        height: 36px;
        opacity: 1;
    }

    .conversation-menu-action {
        min-height: 42px;
        padding: 10px 12px;
    }

}

@media (max-width: 390px) {
    .workspace-panel {
        padding: 5px;
    }

    .chat-panel {
        border-radius: 11px;
    }

    .chat-action-strip {
        padding-right: 7px;
        padding-left: 7px;
    }

    .chat-tool-button,
    .chat-emoji-button,
    .chat-emoji-expand-button,
    .chat-emoji-collapse-button {
        min-width: 34px;
        width: 34px;
        height: 34px;
        min-height: 34px;
    }

    .chat-composer {
        grid-template-columns: minmax(0, 1fr) 108px;
        padding-right: 7px;
        padding-left: 7px;
    }

    .chat-submit-control {
        width: 108px;
        flex-basis: 108px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .mobile-sidebar-backdrop,
    .assistant-stage {
        transition: none !important;
    }

}

@media (max-width: 760px) {
    .chat-context-evidence-panel {
        max-height: 42vh;
        overflow-y: auto;
        font-size: 0.8rem;
        -webkit-overflow-scrolling: touch;
    }
}


@media (max-width: 760px) {
    .chat-action-tooltip {
        max-width: calc(100vw - 24px);
        max-height: 38vh;
        font-size: 0.76rem;
        -webkit-overflow-scrolling: touch;
    }
}

.chat-context-evidence-text {
    white-space: pre-wrap;
}

@media (max-width: 760px) {
    .chat-wardrobe-change-row {
        gap: 0 4px;
        padding-bottom: 4px;
    }
}

.chat-memory-forget,
.chat-memory-forget-choice {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #5d9cff;
    font: inherit;
    cursor: pointer;
}

.chat-memory-forget:hover,
.chat-memory-forget-choice:hover {
    color: #a7c9ff;
    text-decoration: underline;
}

.chat-memory-forget-confirmation {
    white-space: nowrap;
}

.chat-memory-forget-choice:disabled {
    cursor: wait;
    opacity: 0.6;
}

.chat-bubble { position: relative; }
.chat-message-delete {
    flex: 0 0 auto;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
}
.chat-message-delete-confirmation {
    display: inline-flex;
    flex: 1 1 360px;
    align-items: center;
    align-self: center;
    min-height: 32px;
    margin-left: 4px;
    font-size: 12px;
    color: var(--muted-text);
}
.chat-message-delete-confirmation button {
    border: 0;
    background: transparent;
    color: #4da3ff;
    cursor: pointer;
    padding: 0 2px;
    font: inherit;
}
.chat-message.user .chat-message-delete-confirmation {
    color: rgba(255, 255, 255, 0.78);
}
.chat-message.user .chat-message-delete-confirmation button {
    color: #ffffff;
}

/* Webcam / Auto Vision */
@media (max-width: 760px) {
    .chat-submit-control {
        width: 154px;
        flex-basis: 154px;
    }

    .chat-camera-region {
        height: 44px;
        min-width: 34px;
    }
}


/* 2026-08-09 mobile cleanup */
.conversation-view-menu-divider {
    height: 1px;
    margin: 5px 8px;
    background: var(--border-color);
}

.conversation-refresh-button span {
    margin-left: 6px;
}

.chat-mobile-tool-launchers {
    display: none;
}

@media (max-width: 760px) {
    /* Range controls only move from a thumb drag on touch layouts. Vertical
       gestures remain available to scroll the panel even when they begin over
       a slider track. */
    input[type="range"] {
        touch-action: pan-y;
    }

    /* The primary mobile header owns assistant status. The avatar tray no longer burns a second bar. */
    .assistant-stage-header {
        display: none;
    }

    .assistant-stage {
        height: min(30dvh, 245px);
        min-height: 180px;
    }

    .assistant-stage.is-collapsed {
        height: 0;
        min-height: 0;
    }


    .assistant-visual-container {
        min-height: 0;
    }

    /* Desktop dock/full-view control is also available on touch layouts. */
    .avatar-display-mode-button {
        display: inline-flex !important;
        top: 10px;
        left: 10px;
        width: 38px;
        height: 38px;
        touch-action: manipulation;
    }

    .chat-panel.is-avatar-display-mode .avatar-display-overlay {
        display: flex;
        position: absolute;
        z-index: 8;
        inset: 0;
    }

    .chat-panel.is-avatar-display-mode .chat-messages {
        visibility: hidden;
    }

    .chat-panel.is-avatar-display-mode .chat-transcript-copy-button {
        display: none !important;
    }

    /* Three compact launchers replace the desktop wall of toolbar buttons. */
    .chat-action-strip {
        position: relative;
        display: block;
        padding: 7px 9px;
        overflow: visible;
    }

    .chat-mobile-tool-launchers {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .chat-mobile-tool-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: #191919;
        color: var(--primary-text);
        font-size: 18px;
    }

    .chat-mobile-tool-button {
        position: relative;
    }

    .chat-mobile-tool-button[aria-expanded="true"] {
        border-color: #5d9cff;
        background: rgba(46, 116, 187, 0.28);
    }

    .chat-mobile-auto-listen-indicator {
        position: absolute;
        left: 9px;
        bottom: 20px;
        display: block;
        width: 8px;
        height: 8px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 50%;
        background: #050505;
        box-shadow: 0 0 7px rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }

    .chat-mobile-auto-listen-indicator[data-state="listening"] {
        background: #2f7ac2;
        box-shadow: 0 0 8px rgba(47, 122, 194, 0.58);
    }

    .chat-mobile-auto-listen-indicator[data-state="voice"] {
        background: #42b866;
        box-shadow: 0 0 8px rgba(66, 184, 102, 0.58);
    }

    .chat-mobile-auto-listen-indicator[data-state="music"] {
        background: #a66cff;
        box-shadow: 0 0 8px rgba(166, 108, 255, 0.62);
    }

    .chat-tool-bar {
        display: contents;
    }

    .chat-tool-row,
    .chat-emoji-region {
        position: absolute;
        z-index: 10060;
        right: 9px;
        bottom: calc(100% + 7px);
        left: 9px;
        display: none;
        width: auto;
        max-width: none;
        padding: 9px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: #202020;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
    }

    .chat-action-strip[data-mobile-popout="settings"] .chat-tool-row-display,
    .chat-action-strip[data-mobile-popout="tags"] .chat-tool-row-prompts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        overflow: visible;
    }

    .chat-action-strip[data-mobile-popout="emoji"] .chat-emoji-region {
        display: block;
    }

    .chat-tool-button {
        display: inline-flex;
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 7px 10px;
        gap: 8px;
        font-size: 16px;
    }

    .chat-tool-button span {
        display: inline;
        overflow: hidden;
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .chat-emoji-bar {
        overflow-x: auto;
    }

    .chat-emoji-more {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        max-height: min(38dvh, 240px);
    }

    /* Attach + text on row one. Camera / Send / Voice spans row two. */
    .chat-composer {
        grid-template-columns: 46px minmax(0, 1fr);
        grid-template-rows: auto 46px;
        gap: 7px;
        align-items: stretch;
        padding: 8px 9px calc(9px + env(safe-area-inset-bottom));
    }

    .chat-image-upload-control {
        grid-column: 1;
        grid-row: 1;
        width: 46px;
        height: 46px;
    }

    .chat-image-upload-button {
        width: 46px;
        height: 46px;
    }

    .chat-input-shell {
        grid-column: 2;
        grid-row: 1;
    }

    .chat-composer textarea {
        min-height: 46px;
        height: 46px;
        font-size: 16px;
    }

    .chat-submit-control {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: 46px;
        flex-basis: auto;
    }

    .chat-camera-region,
    .chat-mic-region {
        flex: 0 0 56px;
        min-width: 56px;
        height: 44px;
    }

    .chat-send-button {
        flex: 1 1 auto;
        height: 44px;
        min-height: 44px;
    }

    .chat-mic-device-menu,
    .chat-camera-device-menu {
        width: min(calc(100vw - 18px), 420px);
        max-height: min(72dvh, 620px);
    }
}

/* 2026-08-09 polish pass */
@media (max-width: 760px) {
    /* When the normal mobile avatar tray is open, it owns all flexible space
       between the app header and the chat controls. */
    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .assistant-stage {
        flex: 1 1 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel {
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        padding-top: 0;
    }

    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel .chat-content-region {
        display: none;
    }

    .assistant-stage.is-display-expanded,
    .assistant-stage.is-display-expanded.is-collapsed {
        flex: 0 0 0;
        width: 0;
        height: 0;
        min-height: 0;
        border: 0;
    }

    /* Audio controls keep their desktop grouping but stack into readable
       sections on narrow screens. */
    .chat-mic-device-menu:not(.chat-camera-device-menu):not(.is-hidden) {
        display: block;
    }

    .chat-mic-device-menu:not(.chat-camera-device-menu) {
        width: min(calc(100vw - 18px), 420px) !important;
        padding: 0;
    }

    .chat-mic-settings-column {
        padding: 12px;
    }

    .chat-mic-settings-column + .chat-mic-settings-column {
        border-top: 1px solid var(--border-color);
        border-left: 0;
    }

    .chat-music-control-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chat-mic-spectrum-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chat-mic-spectrum-grid .chat-mic-range-label {
        white-space: normal;
    }

    .chat-mic-output-column #micVoiceDetectButton,
    .chat-mic-output-column #micMusicDetectButton,
    .chat-mic-diagnostics-column #micSettingsResetButton {
        margin-top: 12px;
    }

    .chat-misc-music-control-row {
        margin-bottom: 18px;
    }
}

/* 2026-08-09 final mobile parity pass */
@media (max-width: 760px) {
    /* Docked means docked: avatar at the top, conversation remains visible
       below it, and the composer stays pinned at the bottom. Undocked/full
       view continues to use the chat-region overlay defined above. */
    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .assistant-stage {
        flex: 0 0 min(30dvh, 245px);
        width: 100%;
        height: min(30dvh, 245px);
        min-height: 180px;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        padding-top: 8px;
    }

    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel .chat-content-region {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
    }

    /* Assistant Assets is a full-height mobile sheet with independently
       scrollable filters and asset results. */
    .assets-panel {
        display: flex;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    .assets-header {
        flex: 0 0 auto;
        gap: 10px;
        padding: 12px 12px 12px 16px;
    }

    .assets-layout {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    .assets-filter-panel {
        flex: 0 1 auto;
        max-height: 34dvh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .assets-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .assets-toolbar,
    .assets-status {
        flex: 0 0 auto;
    }

    .assets-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    /* Manage Assistant uses the wizard content as the scrolling viewport.
       Explicit touch scrolling prevents the fixed page shell from swallowing
       vertical gestures on iOS/Android. */
    .assistant-settings-overlay.is-open {
        overflow: hidden;
    }

    .assistant-settings-overlay.is-open .profile-wizard {
        display: flex;
        min-height: 0;
        overflow: hidden;
    }

    .assistant-settings-overlay.is-open .wizard-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .assistant-settings-overlay.is-open .wizard-footer,
    .assistant-settings-overlay.is-open .wizard-header,
    .assistant-settings-overlay.is-open .wizard-progress {
        flex: 0 0 auto;
    }
}

/* 2026-08-09 mobile finishing pass */
@media (max-width: 760px) {
    /* Keep the mobile assistant identity in the one remaining top bar. */
    .mobile-header-brand {
        min-width: 0;
    }

    .mobile-header-copy {
        min-width: 0;
    }

    .mobile-header-title,
    .mobile-header-status {
        display: block;
        max-width: min(52vw, 260px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-header-title {
        font-size: 13px;
        line-height: 1.15;
    }

    .mobile-header-status {
        margin-top: 2px;
        font-size: 11px;
        line-height: 1.15;
    }

    /* The collapse/show-avatar control only applies to the top-docked tray.
       Full/undocked mode owns the chat region and has its own dock control. */
    body.avatar-display-mode-open #mobileAssistantButton {
        display: none !important;
    }

    /* Assistant Assets: turn the full-screen sheet into a deliberate mobile
       browser rather than a compressed desktop sidebar + table. */
    .assets-panel {
        background: #101010;
    }

    .assets-header {
        min-height: 66px;
        border-bottom: 1px solid var(--border-color);
        background: #151515;
    }

    .assets-header > div {
        min-width: 0;
    }

    .assets-header h2 {
        font-size: 18px;
        line-height: 1.2;
    }

    .assets-header p {
        margin-top: 3px;
    }

    .assets-close-button {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .assets-filter-panel {
        display: grid;
        flex: 0 0 auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        max-height: min(38dvh, 300px);
        padding: 12px;
        background: #151515;
    }

    .assets-filter-panel h3 {
        grid-column: 1 / -1;
        margin: 0 0 2px;
        font-size: 12px;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--muted-text);
    }

    .assets-filter-option {
        min-width: 0;
        min-height: 40px;
        justify-content: center;
        gap: 7px;
        padding: 8px 7px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: #1b1b1b;
        color: var(--primary-text);
        font-size: 12px;
    }

    .assets-filter-option input {
        flex: 0 0 auto;
        width: 16px;
        height: 16px;
        margin: 0;
    }

    .assets-filter-option span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .assets-image-subfilters {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 0;
    }

    .assets-filter-suboption {
        min-height: 36px;
        background: #181818;
    }

    .assets-filter-divider {
        grid-column: 1 / -1;
        margin: 4px 0 0;
    }

    .assets-danger-action {
        grid-column: auto;
        min-height: 38px;
        margin: 0;
        padding: 7px 8px;
        font-size: 11px;
        line-height: 1.2;
    }

    #assetsDeleteSelectedButton,
    #deleteEverythingButton {
        grid-column: 1 / -1;
    }

    .assets-content {
        background: #101010;
    }

    .assets-toolbar {
        min-height: 48px;
        padding: 10px 12px;
        background: #151515;
    }

    .assets-select-all {
        min-height: 30px;
        margin-left: 0;
        font-size: 13px;
    }

    .assets-status {
        min-height: 0;
        padding: 9px 12px 3px;
        font-size: 12px;
    }

    .assets-list {
        display: grid;
        align-content: start;
        gap: 10px;
        padding: 8px 10px calc(16px + env(safe-area-inset-bottom));
    }

    .asset-row {
        grid-template-columns: auto 72px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: #171717;
    }

    .asset-thumbnail-button {
        width: 72px;
        height: 62px;
        border-radius: 9px;
    }

    .asset-info {
        gap: 4px;
    }

    .asset-info strong {
        font-size: 13px;
    }

    .asset-info span {
        font-size: 11px;
    }

    .asset-row-actions {
        grid-column: 2 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .asset-action-button {
        min-height: 36px;
        padding: 7px 8px;
        text-align: center;
    }

    /* Memories use the same outer Manage Assistant scroller as every other
       mobile section. The list itself expands instead of becoming a nested
       viewport that can only expose part of one card. */
    .assistant-settings-overlay.is-open .wizard-content.is-memory-step {
        overflow-y: auto;
    }

    .wizard-content.is-memory-step .wizard-step[data-step="5"].is-active {
        display: block;
        height: auto;
        min-height: 0;
    }

    .wizard-content.is-memory-step .assistant-memory-manager {
        display: grid;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .wizard-content.is-memory-step .assistant-memory-list {
        display: grid;
        flex: none;
        height: auto;
        min-height: 0;
        overflow: visible;
        overscroll-behavior: auto;
    }

    .wizard-content.is-memory-step .assistant-memory-save-note {
        padding-bottom: 4px;
    }
}


/* 2026-08-09 mobile final alignment + docked chat scrolling */
@media (max-width: 760px) {
    /* Images, Generated and Uploaded are one filter family. Flatten the
       subfilter wrapper so all three controls share the same grid row. */
    .assets-image-subfilters {
        display: contents;
    }

    .assets-filter-suboption {
        min-height: 40px;
        background: #1b1b1b;
    }

    /* A visible top-docked avatar reduces the workspace height. Keep every
       link in the chat flex chain shrinkable, then make the transcript the
       explicit touch-scrolling viewport. */
    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel {
        min-height: 0;
        overflow: hidden;
    }

    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel .chat-panel {
        display: flex;
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel .chat-content-region {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .main-content:has(> .assistant-stage:not(.is-collapsed):not(.is-hidden):not(.is-display-expanded))
        > .workspace-panel .chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
}


/* Undocked avatar subtitles stay inside the avatar viewport. The toggle itself
   remains inside the existing cog/settings popout on mobile. */
@media (max-width: 760px) {
    .avatar-subtitles-tool-button {
        display: none !important;
    }

    .chat-panel.is-avatar-display-mode
        .chat-action-strip[data-mobile-popout="settings"]
        .avatar-subtitles-tool-button {
        display: inline-flex !important;
    }

    .avatar-subtitle-overlay {
        --avatar-subtitle-font-size: clamp(11px, 3.2vw, 15px);
        width: calc(100% - 24px);
        max-width: 680px;
        bottom: 42px;
    }

    .avatar-processing-status {
        font-size: clamp(11px, 3.2vw, 15px);
        left: 0;
        right: 0;
        bottom: 12px;
    }

}

@media (max-width: 420px) {
    .avatar-subtitle-overlay {
        --avatar-subtitle-font-size: clamp(10.5px, 3.05vw, 13.5px);
        width: calc(100% - 16px);
        bottom: 36px;
    }

    .avatar-processing-status {
        font-size: clamp(10.5px, 3.05vw, 13.5px);
        left: 0;
        right: 0;
        bottom: 8px;
    }
}

/* 2026-08-09 mobile undocked avatar toolbar layering */
@media (max-width: 760px) {
    /* Keep the mobile chat toolbar and its popouts above the undocked avatar
       overlay. The avatar remains above the transcript, while the controls
       stay usable in front of it. */
    .chat-panel.is-avatar-display-mode .chat-action-strip {
        position: relative;
        z-index: 10070;
    }

    .chat-panel.is-avatar-display-mode .chat-tool-row,
    .chat-panel.is-avatar-display-mode .chat-emoji-region {
        z-index: 10080;
    }
}

/* Smart Hub */
.smart-hub-overlay{position:fixed;inset:0;z-index:7000;display:flex;align-items:center;justify-content:center;padding:22px;background:rgba(5,8,13,.58);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.smart-hub-overlay.is-hidden{display:none}.smart-hub-panel{width:min(1120px,96vw);height:min(820px,92vh);display:flex;flex-direction:column;background:#171717;border:1px solid #343434;border-radius:18px;box-shadow:0 28px 80px rgba(0,0,0,.55);overflow:hidden}.smart-hub-header{display:flex;justify-content:space-between;gap:18px;padding:22px 24px 14px}.smart-hub-header h2{margin:0;font-size:24px}.smart-hub-header p{margin:4px 0 0;color:#929292}.smart-hub-close{border:0;background:transparent;color:#ddd;font-size:31px;cursor:pointer}.smart-hub-tabs{display:flex;gap:6px;padding:10px 18px 0;border-top:1px solid rgba(255,255,255,.025);background:#141414;overflow-x:auto}.smart-hub-tab-button{min-height:38px;padding:0 15px;border:1px solid transparent;border-bottom:0;border-radius:9px 9px 0 0;background:transparent;color:#929292;font:inherit;font-size:13px;font-weight:700;cursor:pointer}.smart-hub-tab-button:hover,.smart-hub-tab-button:focus-visible{color:#fff;background:rgba(255,255,255,.035)}.smart-hub-tab-button.is-active{border-color:#343434;background:#1a1a1a;color:#fff}.smart-hub-toolbar button,.smart-hub-card button{border:1px solid #343434;background:#202020;color:#ddd;border-radius:9px;padding:9px 13px;cursor:pointer}.smart-hub-toolbar{display:flex;align-items:center;justify-content:space-between;padding:11px 20px;border-top:1px solid #292929;border-bottom:1px solid #292929}.smart-hub-toolbar-actions{display:flex;gap:8px}.smart-hub-toggle{display:flex;align-items:center;gap:8px;color:#bbb}.smart-hub-status{min-height:0;padding:8px 20px;color:#9fcdf5}.smart-hub-content{flex:1;overflow:auto;padding:12px 20px 24px}.smart-hub-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}.smart-hub-card{background:#1d1d1d;border:1px solid #303030;border-radius:13px;padding:15px}.smart-hub-card h3{margin:0 0 6px;font-size:16px}.smart-hub-meta{font-size:12px;color:#909090;margin-bottom:12px}.smart-hub-card-actions{display:flex;flex-wrap:wrap;gap:7px}.smart-hub-card .danger{color:#ff8f8f}.smart-hub-power.on{color:#81e6a4}.smart-hub-power.off{color:#aaa}.smart-hub-light-controls{display:grid;grid-template-columns:1fr 52px;gap:9px;align-items:center;margin:11px 0}.smart-hub-light-controls input[type=range]{width:100%}.smart-hub-light-controls input[type=color]{width:52px;height:32px;padding:2px;border:1px solid #444;background:#151515;border-radius:7px}.smart-hub-empty{padding:38px;text-align:center;color:#888}.smart-hub-modal-form{display:grid;gap:10px}.smart-hub-modal-form input,.smart-hub-modal-form select{width:100%;box-sizing:border-box;background:#111;border:1px solid #3b3b3b;color:#eee;border-radius:8px;padding:9px}.smart-hub-member-list{display:grid;gap:5px;margin-top:9px}.smart-hub-member-list label{display:flex;gap:8px;align-items:center;color:#bbb}
@media(max-width:700px){.smart-hub-overlay{padding:0;align-items:stretch;height:100dvh;min-height:0}.smart-hub-panel{width:100vw;height:100dvh;max-height:100dvh;min-height:0;border-radius:0;border:0}.smart-hub-header{padding:16px 16px 10px}.smart-hub-tabs{padding:8px 12px 0}.smart-hub-tab-button{flex:1 0 auto;min-width:100px}.smart-hub-toolbar{padding:10px 12px;gap:10px}.smart-hub-content{padding:10px 12px calc(20px + env(safe-area-inset-bottom))}.smart-hub-grid{grid-template-columns:1fr}.smart-hub-toolbar{align-items:flex-start}.smart-hub-toolbar-actions{margin-left:auto}}


/* Smart Hub polish */
.smart-hub-light-row{margin:11px 0}.smart-hub-light-row.is-compact{display:grid;grid-template-columns:minmax(90px,1fr) minmax(140px,1.35fr);gap:10px;align-items:center;margin:8px 0}.smart-hub-light-name{font-size:12px;color:#b9b9b9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.smart-hub-light-controls{display:grid;grid-template-columns:minmax(100px,1fr) 34px;gap:10px;align-items:center;margin:0}.smart-hub-color-swatch{width:34px!important;height:34px!important;min-width:34px;padding:0!important;border-radius:7px!important;background:var(--sh-color,#fff)!important;border:1px solid #555!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);cursor:pointer}.smart-hub-member-lights{margin:12px 0 2px;padding-top:8px;border-top:1px solid #2e2e2e}.smart-hub-editor-overlay{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;padding:22px;background:rgba(5,8,13,.68);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.smart-hub-editor-panel{width:min(560px,94%);max-height:min(720px,88vh);display:flex;flex-direction:column;background:#181818;border:1px solid #383838;border-radius:15px;box-shadow:0 24px 70px rgba(0,0,0,.58);overflow:hidden}.smart-hub-editor-header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 12px;border-bottom:1px solid #292929}.smart-hub-editor-header h3{margin:0;font-size:18px}.smart-hub-editor-header button{border:0;background:transparent;color:#ddd;font-size:28px;cursor:pointer}.smart-hub-editor-body{overflow:auto;padding:16px 20px;display:grid;gap:14px}.smart-hub-editor-field{display:grid;gap:6px;color:#bbb;font-size:13px}.smart-hub-editor-field input,.smart-hub-editor-field select{width:100%;box-sizing:border-box;background:#111;border:1px solid #3b3b3b;color:#eee;border-radius:8px;padding:10px}.smart-hub-editor-section{margin:0;padding:12px;border:1px solid #303030;border-radius:10px}.smart-hub-editor-section legend{padding:0 6px;color:#d6d6d6;font-size:13px}.smart-hub-editor-section .smart-hub-member-list{max-height:190px;overflow:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px}.smart-hub-editor-empty{color:#777;font-size:12px}.smart-hub-editor-actions{display:flex;justify-content:flex-end;gap:8px;padding:13px 20px 18px;border-top:1px solid #292929}.smart-hub-editor-actions button,.smart-hub-color-footer button{border:1px solid #3a3a3a;background:#222;color:#ddd;border-radius:8px;padding:9px 14px;cursor:pointer}.smart-hub-editor-actions button.primary,.smart-hub-color-footer button.primary{border-color:#347ebd;background:#173653;color:#fff}.smart-hub-color-popover{position:fixed;z-index:7300;width:220px;padding:12px;background:#171717;border:1px solid #3a3a3a;border-radius:12px;box-shadow:0 20px 55px rgba(0,0,0,.62)}.smart-hub-color-title{font-size:13px;font-weight:600;color:#e6e6e6;margin:0 0 10px}.smart-hub-sv-picker{--sh-hue:hsl(0 100% 50%);position:relative;width:220px;height:220px;border-radius:7px;cursor:crosshair;background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,var(--sh-hue));box-shadow:inset 0 0 0 1px rgba(255,255,255,.15);touch-action:none}.smart-hub-sv-picker span{position:absolute;width:12px;height:12px;border:2px solid #fff;border-radius:50%;box-shadow:0 1px 4px #000;transform:translate(-50%,-50%);pointer-events:none}.smart-hub-hue-slider{width:100%;height:18px;margin:11px 0 8px;appearance:none;-webkit-appearance:none;background:linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);border-radius:10px;outline:none}.smart-hub-hue-slider::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:22px;border-radius:5px;border:2px solid #fff;background:#222;box-shadow:0 1px 4px #000}.smart-hub-hue-slider::-moz-range-thumb{width:14px;height:20px;border-radius:5px;border:2px solid #fff;background:#222;box-shadow:0 1px 4px #000}.smart-hub-color-footer{display:flex;align-items:center;justify-content:flex-end;gap:7px}.smart-hub-color-preview{width:30px;height:30px;border-radius:6px;border:1px solid #555;margin-right:auto}.smart-hub-panel{position:relative}
@media(max-width:700px){.smart-hub-light-row.is-compact{grid-template-columns:1fr}.smart-hub-editor-overlay{padding:10px}.smart-hub-editor-panel{width:100%;max-height:92vh}.smart-hub-editor-section .smart-hub-member-list{grid-template-columns:1fr}.smart-hub-color-popover{width:204px}.smart-hub-sv-picker{width:204px;height:204px}}


/* Smart Hub polish: filtering, master lights, color picker sizing */
.smart-hub-filter-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 20px;border-bottom:1px solid #292929;background:rgba(0,0,0,.08);color:#929292;font-size:12px}.smart-hub-filter-actions{display:flex;gap:7px;flex-wrap:wrap}.smart-hub-filter-actions button{min-width:48px;border:1px solid #343434;background:#202020;color:#bbb;border-radius:8px;padding:7px 11px;cursor:pointer}.smart-hub-filter-actions button.is-active{border-color:#3d90d8;background:#173653;color:#fff}.smart-hub-master-light{display:grid;grid-template-columns:minmax(90px,1fr) minmax(140px,1.35fr);gap:10px;align-items:center;margin:12px 0;padding:10px 0;border-top:1px solid #303030}.smart-hub-master-light .smart-hub-light-name{color:#e3e3e3;font-weight:700}.smart-hub-color-popover{width:244px!important;box-sizing:border-box!important;background:#171717!important}.smart-hub-sv-picker{width:100%!important;height:auto!important;aspect-ratio:1/1;box-sizing:border-box}.smart-hub-hue-slider{box-sizing:border-box;display:block}.smart-hub-editor-field select{min-height:40px;color-scheme:dark}.smart-hub-editor-field select option{background:#151515;color:#eee}
@media(max-width:700px){.smart-hub-filter-toolbar{padding:8px 12px}.smart-hub-master-light{grid-template-columns:1fr}.smart-hub-color-popover{width:min(244px,calc(100vw - 24px))!important}}

/* Smart Hub indexed filters + color preset polish */
.smart-hub-filter-toolbar{align-items:stretch;flex-direction:column;gap:7px}.smart-hub-filter-actions{display:grid;grid-template-columns:repeat(7,minmax(32px,1fr));gap:6px;width:100%}.smart-hub-filter-actions button{min-width:32px;padding:7px 6px}.smart-hub-color-popover{width:min(272px,calc(100vw - 24px))!important;padding:14px!important;display:grid;gap:10px;overflow:hidden}.smart-hub-color-title{margin:0}.smart-hub-color-preset-label{display:grid;gap:5px;font-size:12px;color:#a9a9a9}.smart-hub-color-preset{width:100%;box-sizing:border-box;background:#111;border:1px solid #3b3b3b;color:#eee;border-radius:8px;padding:8px 10px;color-scheme:dark}.smart-hub-color-preset option{background:#151515;color:#eee}.smart-hub-sv-picker{width:100%!important;aspect-ratio:1/1;height:auto!important}.smart-hub-hue-slider{margin:0!important}.smart-hub-color-footer{margin-top:0}


/* Smart Hub compact alphabetical index */
.smart-hub-filter-toolbar{display:block!important;padding:6px 20px!important;border-bottom:1px solid #292929;background:rgba(0,0,0,.08);overflow:hidden}
.smart-hub-filter-actions{display:flex!important;flex-wrap:nowrap!important;align-items:center;gap:1px!important;width:100%;overflow-x:auto;scrollbar-width:thin}
.smart-hub-filter-actions button{flex:1 0 22px!important;min-width:22px!important;height:28px;padding:0 3px!important;border:0!important;background:transparent!important;color:#999!important;border-radius:5px!important;font-size:11px;line-height:28px;cursor:pointer}
.smart-hub-filter-actions button:hover{background:#242424!important;color:#eee!important}
.smart-hub-filter-actions button.is-active{background:#173653!important;color:#fff!important;box-shadow:inset 0 0 0 1px #3d90d8}
.smart-hub-filter-actions button[data-sh-list-filter="all"]{flex-basis:30px!important;min-width:30px!important;font-weight:600}
@media(max-width:700px){.smart-hub-filter-toolbar{padding:5px 12px!important}.smart-hub-filter-actions button{flex:0 0 24px!important}.smart-hub-filter-actions button[data-sh-list-filter="all"]{flex-basis:32px!important}}

/* Smart Hub status navigation + single light-section divider */
.smart-hub-card .smart-hub-card-title-link{appearance:none;-webkit-appearance:none;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;padding:0;margin:0;cursor:pointer;text-align:left;box-shadow:none}
.smart-hub-card .smart-hub-card-title-link:hover{border:0;background:transparent;color:inherit;text-decoration:none;box-shadow:none}
.smart-hub-master-light + .smart-hub-member-lights{border-top:0!important;padding-top:0!important}

.smart-hub-white-preset{max-width:132px;box-sizing:border-box;background:#151515;border:1px solid #3a3a3a;color:#e8e8e8;border-radius:7px;padding:6px 8px;color-scheme:dark}.smart-hub-white-preset option{background:#151515;color:#e8e8e8}.smart-hub-light-controls .smart-hub-white-preset{flex:0 1 132px}

/* Smart Hub final cleanup */
.smart-hub-white-preset{transition:background-color .16s ease,border-color .16s ease,color .16s ease}
.smart-hub-white-preset.tone-soft{background:#4a3422!important;border-color:#72543a!important;color:#ffe2bd!important}
.smart-hub-white-preset.tone-white{background:#353535!important;border-color:#555!important;color:#f5f5f5!important}
.smart-hub-white-preset.tone-daylight{background:#24384b!important;border-color:#41627f!important;color:#e3f2ff!important}
.smart-hub-card{position:relative}
.smart-hub-device-help{position:absolute;right:11px;bottom:10px;z-index:2;display:inline-flex;align-items:center;justify-content:center}
.smart-hub-help-icon{display:inline-flex;width:18px;height:18px;align-items:center;justify-content:center;border:1px solid #454545;border-radius:50%;background:#191919;color:#9c9c9c;font-size:11px;font-weight:700;line-height:1;cursor:help;transition:border-color .15s ease,color .15s ease,background .15s ease}
.smart-hub-device-help:hover .smart-hub-help-icon,.smart-hub-device-help:focus .smart-hub-help-icon{border-color:#4b87b8;background:#1c2b38;color:#cfe9ff}
.smart-hub-help-tooltip{position:absolute;z-index:40;right:0;bottom:27px;width:max-content;min-width:220px;max-width:min(320px,calc(100vw - 36px));display:grid;gap:7px;padding:10px 12px;border:1px solid #3a3a3a;border-radius:9px;background:#171717;box-shadow:0 14px 38px rgba(0,0,0,.55);opacity:0;visibility:hidden;transform:translateY(4px);pointer-events:none;transition:opacity .24s ease,transform .24s ease,visibility 0s linear .24s;color:#ddd;font-size:12px}
.smart-hub-device-help:hover .smart-hub-help-tooltip,.smart-hub-device-help:focus .smart-hub-help-tooltip,.smart-hub-device-help:focus-within .smart-hub-help-tooltip{opacity:1;visibility:visible;transform:translateY(0);transition-delay:0s}.smart-hub-device-help.is-tooltip-expired .smart-hub-help-tooltip{opacity:0!important;visibility:hidden!important;transform:translateY(4px)!important}
.smart-hub-help-tooltip span{display:grid;grid-template-columns:66px minmax(0,1fr);gap:8px;align-items:start}
.smart-hub-help-tooltip strong{color:#8f8f8f;font-weight:600}
.smart-hub-schedule-panel{width:min(620px,94%)}
.smart-hub-schedule-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.smart-hub-schedule-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.smart-hub-schedule-days label{display:flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:0 5px;border:1px solid #303030;border-radius:7px;background:#151515;color:#bbb;font-size:12px;cursor:pointer}
.smart-hub-schedule-days input{accent-color:#3d90d8}
.smart-hub-schedule-panel input[type=time]{color-scheme:dark}
.assets-close-button{width:auto!important;height:auto!important;min-width:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;color:var(--primary-text)!important;font-size:31px!important;line-height:1!important;box-shadow:none!important}
.assets-close-button:hover,.assets-close-button:focus{background:transparent!important;border:0!important;box-shadow:none!important;color:#fff!important}
@media(max-width:700px){.smart-hub-schedule-row{grid-template-columns:1fr}.smart-hub-schedule-days{grid-template-columns:repeat(4,minmax(0,1fr))}.smart-hub-help-tooltip{right:-4px;min-width:210px}.assets-close-button{flex:0 0 auto!important;width:auto!important;height:auto!important}}


/* 2026-08-10 mobile polish */
.chat-mobile-settings-close { display: none; }
@media (max-width: 760px) {
    .chat-mobile-settings-close {
        display: block;
        width: 100%;
        margin-top: 12px;
        padding: 8px 10px;
        border: 1px solid var(--border-color);
        border-radius: 7px;
        background: #2a2a2a;
        color: var(--primary-text);
        font: inherit;
    }

    .chat-message-delete-confirmation {
        flex: 1 0 100%;
        flex-wrap: wrap;
        margin-left: 0;
    }

    .chat-message-delete-choices {
        display: block;
        flex: 0 0 100%;
        width: 100%;
        margin-top: 3px;
    }

    .sidebar {
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .sidebar-header,
    .sidebar.is-collapsed .sidebar-header {
        padding-bottom: 8px;
    }

    .new-chat-button {
        min-height: 40px;
    }

    .sidebar .sidebar-section {
        margin-top: 14px;
    }

    .sidebar-section-title {
        padding-bottom: 6px;
    }

    .conversation-row {
        min-height: 34px;
        margin-bottom: 2px;
    }

    .conversation-item {
        min-height: 34px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .conversation-menu-button {
        width: 28px;
        height: 28px;
    }

    .sidebar-assets-entry {
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .sidebar-footer {
        padding-top: 6px;
    }

    .sidebar-notification {
        margin-top: 6px;
        padding: 7px 9px;
    }

    .sidebar-account-display-name,
    .sidebar-footer-button {
        min-height: 36px;
        height: 36px;
    }

    .sidebar-account-display-name {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 7px;
    }

    .sidebar-account-avatar {
        width: 27px;
        height: 27px;
        font-size: 10px;
    }

    .sidebar-footer-button-danger {
        margin-top: 2px;
    }
}
.smart-hub-status-toolbar{display:flex;align-items:center;justify-content:center;min-height:38px;padding:0 20px;border-bottom:1px solid #292929;background:rgba(0,0,0,.08)}
.smart-hub-status-toolbar.is-hidden{display:none}
.smart-hub-status-toolbar .smart-hub-status{width:100%;min-height:0;padding:8px 0;text-align:center;color:#9fcdf5}
.smart-hub-card button.is-working,.smart-hub-toolbar button.is-working,.smart-hub-editor-actions button.is-working,.smart-hub-color-popover button.is-working{display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:wait;opacity:.82}
.smart-hub-button-spinner{display:inline-block;width:13px;height:13px;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:smartHubButtonSpin .7s linear infinite;flex:0 0 13px}
@keyframes smartHubButtonSpin{to{transform:rotate(360deg)}}
@media(max-width:700px){.smart-hub-status-toolbar{padding:0 12px;min-height:36px}}

.smart-hub-member-devices{margin:12px 0 2px;padding-top:4px;border-top:1px solid #2e2e2e}.smart-hub-member-device{padding:8px 0;border-bottom:1px solid #282828}.smart-hub-member-device:last-child{border-bottom:0}.smart-hub-member-device-summary{display:flex;align-items:center;justify-content:space-between;gap:10px}.smart-hub-member-device-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#d0d0d0}.smart-hub-member-device-meta{font-size:11px;color:#888;white-space:nowrap}.smart-hub-member-device-controls .smart-hub-light-row{margin:6px 0 0}.smart-hub-member-device-controls .smart-hub-light-controls{margin:0}
@media(max-width:700px){.smart-hub-member-device-summary{align-items:flex-start;flex-direction:column;gap:3px}.smart-hub-member-device-meta{white-space:normal}}

/* Smart Hub mixed-light aggregate controls: keep RGB and white-tone selectors square and inline. */
.smart-hub-master-light .smart-hub-light-controls{display:flex!important;grid-template-columns:none!important;align-items:center;gap:10px}
.smart-hub-master-light .smart-hub-light-controls input[type=range]{flex:1 1 auto;min-width:0;width:auto!important}
.smart-hub-master-light .smart-hub-light-controls .smart-hub-color-swatch,.smart-hub-master-light .smart-hub-light-controls .smart-hub-white-preset-square{flex:0 0 34px}
.smart-hub-white-preset.smart-hub-white-preset-square{width:34px!important;min-width:34px!important;max-width:34px!important;height:34px!important;padding:0 2px!important;border-radius:7px!important;overflow:hidden;cursor:pointer;color-scheme:dark;font-size:0}
.smart-hub-white-preset.smart-hub-white-preset-square option{font-size:13px;color:#e8e8e8;background:#151515}


/* Smart Hub aggregate layout: give the master slider the remaining card width. */
.smart-hub-master-light{grid-template-columns:max-content minmax(0,1fr)!important;column-gap:14px}

/* Smart Hub custom prompts */
.smart-hub-prompt-grid{grid-template-columns:1fr!important}.smart-hub-prompt-grid .smart-hub-card{width:100%;box-sizing:border-box}.smart-hub-prompt-summary{display:grid;gap:6px;margin:10px 0 13px}.smart-hub-prompt-summary-row{padding:8px 10px;border:1px solid #2c2c2c;border-radius:8px;background:#181818;color:#bdbdbd;font-size:12px;line-height:1.4}.smart-hub-prompt-panel{width:min(860px,94%);max-height:min(780px,90vh)}.smart-hub-prompt-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#d6d6d6;font-size:13px;font-weight:700}.smart-hub-prompt-editor-heading button,.smart-hub-prompt-action-header button{border:1px solid #3a3a3a;background:#222;color:#ddd;border-radius:8px;padding:7px 11px;cursor:pointer}.smart-hub-prompt-actions{display:grid;gap:10px}.smart-hub-prompt-action{padding:13px;border:1px solid #303030;border-radius:11px;background:#151515}.smart-hub-prompt-action-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:11px;color:#e1e1e1}.smart-hub-prompt-action-header .danger{color:#ff8f8f}.smart-hub-prompt-action-grid{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(180px,1.4fr) minmax(100px,.65fr) minmax(120px,.8fr);gap:10px}.smart-hub-prompt-light-options{display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(210px,1fr);gap:12px;margin-top:12px;padding-top:12px;border-top:1px solid #2d2d2d}.smart-hub-prompt-brightness{display:grid;gap:7px;color:#bbb;font-size:13px}.smart-hub-prompt-brightness>label{display:flex;align-items:center;gap:7px}.smart-hub-prompt-range{display:grid;grid-template-columns:minmax(120px,1fr) 46px;gap:8px;align-items:center}.smart-hub-prompt-range input[type=range]{width:100%}.smart-hub-prompt-range span{color:#9fcdf5;font-size:12px;text-align:right}.smart-hub-prompt-color-field{align-content:start}.smart-hub-prompt-color-controls{display:grid;grid-template-columns:minmax(150px,1fr) 34px;gap:8px;align-items:center}.smart-hub-prompt-color-controls select{min-height:40px}.smart-hub-prompt-color-controls .smart-hub-color-swatch:disabled{opacity:.32;cursor:default}.smart-hub-prompt-action input[type=checkbox]{accent-color:#3d90d8}
@media(max-width:760px){.smart-hub-prompt-panel{width:100%;max-height:94vh}.smart-hub-prompt-action-grid{grid-template-columns:1fr 1fr}.smart-hub-prompt-light-options{grid-template-columns:1fr}.smart-hub-prompt-summary-row{font-size:11px}}
@media(max-width:480px){.smart-hub-prompt-action-grid{grid-template-columns:1fr}.smart-hub-prompt-editor-heading{align-items:flex-start}.smart-hub-prompt-color-controls{grid-template-columns:minmax(0,1fr) 34px}}

@media (max-width: 760px) {
    .administration-overlay {
        padding: 0;
    }

    .administration-panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .administration-header {
        flex: 0 0 auto;
        padding: 12px 12px 12px 16px;
    }

    .administration-tabs {
        flex: 0 0 auto;
        padding: 8px 12px 0;
        overflow: visible;
    }

    .administration-tab-button {
        flex: 1 1 0;
        min-width: 0;
        padding-right: 10px;
        padding-left: 10px;
    }

    .administration-users-toolbar {
        align-items: stretch;
        padding: 12px;
    }

    .administration-search-field {
        width: 100%;
    }

    .administration-users-layout {
        height: auto;
        grid-template-columns: 1fr;
    }

    .administration-user-list-shell {
        max-height: 260px;
        border-right: 0;
        border-bottom: 1px solid #303030;
    }

    .administration-user-list {
        max-height: 220px;
    }

    .administration-user-detail {
        overflow: visible;
        padding: 13px;
    }

    .administration-detail-header,
    .administration-avatar-intro {
        flex-direction: column;
    }

    .administration-badge-row {
        justify-content: flex-start;
    }

    .administration-summary-grid,
    .administration-detail-grid,
    .administration-permission-grid,
    .administration-slider-grid,
    .administration-slider-grid-layers,
    .administration-mask-grid {
        grid-template-columns: 1fr;
    }

    .administration-card.is-wide {
        grid-column: auto;
    }

    .administration-avatar-intro {
        padding: 15px 14px 5px;
    }

    .administration-avatar-section {
        margin: 10px 14px 14px;
        padding: 13px;
    }

    .administration-section-heading-with-action {
        align-items: center;
    }

    .administration-tuning-group-heading {
        align-items: flex-start;
    }

    .administration-tuning-group-heading span {
        max-width: 68%;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .administration-slider-control input[type="range"] {
        width: 100%;
    }

    .administration-slider-value-input {
        width: 68px;
        min-width: 68px;
    }


    .administration-footer {
        flex: 0 0 auto;
        flex-wrap: wrap;
        padding: 11px 12px;
    }

    .administration-footer-spacer {
        display: none;
    }

    .administration-footer .administration-button {
        flex: 1 1 calc(50% - 6px);
    }

    .administration-avatar-dock {
        position: fixed;
        z-index: 1450;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(92vw, 420px);
        min-width: 0;
        height: 100dvh;
        box-shadow: -18px 0 54px rgba(0, 0, 0, 0.5);
    }

    .administration-avatar-dock-header {
        min-height: 60px;
        padding: 10px 12px 10px 15px;
    }

    .administration-avatar-dock-footer {
        padding-bottom: max(11px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 500px) {
    .administration-users-toolbar,
    .administration-action-row,
    .administration-suspension-actions,
    .administration-activity-filter,
    .administration-activity-pager {
        display: grid;
        grid-template-columns: 1fr;
    }

    .administration-users-toolbar .administration-secondary-button,
    .administration-action-row button,
    .administration-suspension-actions button,
    .administration-activity-filter button,
    .administration-activity-pager button {
        width: 100%;
    }

    .administration-activity-filter input {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .benchmark-progress-toolbar {
        align-items: stretch;
        padding: 9px 12px;
        gap: 10px;
    }

    .benchmark-progress-copy {
        flex: 1 1 auto;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
    }

    .benchmark-progress-copy span {
        white-space: normal;
    }

    .benchmark-progress-cancel-button {
        align-self: center;
    }

    .administration-benchmark-intro {
        flex-direction: column;
        padding: 15px 14px 5px;
    }

    .administration-benchmark-card {
        margin: 10px 14px 14px;
        padding: 13px;
    }

    .administration-benchmark-card .administration-button {
        width: 100%;
    }

    .administration-benchmark-form,
    .administration-benchmark-results-layout,
    .administration-benchmark-compare-controls,
    .administration-benchmark-compare-layout {
        grid-template-columns: 1fr;
    }

    .administration-benchmark-form label,
    .administration-benchmark-form input {
        width: 100%;
        min-width: 0;
    }

    .administration-benchmark-form input:read-only:not(:disabled) {
        border-color: #343434;
        background: #181818;
        color: #cfcfcf;
        -webkit-text-fill-color: #cfcfcf;
        opacity: 1;
        cursor: default;
    }

    .administration-benchmark-compare-controls .administration-button {
        width: 100%;
    }

    .administration-benchmark-actions,
    .administration-benchmark-results-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .administration-benchmark-results-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .administration-benchmark-results-actions .administration-button,
    .administration-benchmark-results-actions .administration-danger-button {
        width: 100%;
    }

    .administration-benchmark-session-list {
        max-height: 230px;
    }

    .administration-benchmark-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .benchmark-progress-toolbar {
        flex-direction: column;
    }

    .benchmark-progress-cancel-button {
        width: 100%;
    }

    .administration-benchmark-summary-grid,
    .administration-benchmark-compare-meta {
        grid-template-columns: 1fr;
    }
}


/* Manage Assistant mobile parity: keep upload on its own line, then fit Description + Share + NSFW + Equip inline. */
.assistant-clothing-upload-row {
    grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
    column-gap: 8px;
    row-gap: 8px;
}

.assistant-clothing-upload-column {
    grid-column: 1 / -1;
}

.assistant-clothing-description-column {
    grid-column: 1;
}

.assistant-clothing-share-column {
    grid-column: 2;
}

.assistant-clothing-nsfw-column {
    grid-column: 3;
}

.assistant-clothing-equip-column {
    grid-column: 4;
}

.assistant-clothing-share-column,
.assistant-clothing-nsfw-column,
.assistant-clothing-equip-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.assistant-clothing-share-column > .assistant-clothing-input-label,
.assistant-clothing-nsfw-column > .assistant-clothing-input-label,
.assistant-clothing-equip-column > .assistant-clothing-input-label {
    width: auto;
    text-align: center;
    font-size: 0.72rem;
}

.assistant-clothing-description-column input[type="text"] {
    min-width: 0;
    width: 100%;
}

.assistant-avatar-upload-control,
.assistant-clothing-file-control {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px;
}

.assistant-shared-select-button {
    min-width: 64px;
    padding-inline: 6px;
    font-size: 11px;
}

.assistant-backdrop-upload-control {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
}

.assistant-backdrop-paste-button {
    min-width: 72px;
    padding-inline: 10px;
}

@media (max-width: 800px) {
    .youtube-sidebar-controls {
        margin-top: 8px;
    }

    .account-playlist-add-included {
        grid-template-columns: 1fr;
    }

    .account-playlist-add-included .account-secondary-action {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .assistant-memory-filters {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .administration-avatar-test-toolbar {
        grid-template-columns: 1fr;
    }

    .administration-avatar-test-toolbar > .administration-avatar-test-field:only-child {
        grid-column: auto;
    }

    .administration-tuning-group-heading-actions {
        max-width: 72%;
        flex-wrap: wrap;
    }

    .assistant-asset-dialog-panel,
    .assistant-delete-panel {
        width: min(430px, calc(100vw - 24px));
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .administration-benchmark-test-grid {
        grid-template-columns: 1fr;
    }

    .administration-benchmark-test-grid label {
        height: auto;
        min-height: 58px;
    }

    .assistant-asset-dialog-actions,
    .assistant-delete-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .assistant-asset-dialog-actions .wizard-button,
    .assistant-delete-actions .wizard-button {
        width: 100%;
        margin-right: 0;
    }
}

/* 2026-08-27: parental controls, Administration invitations */
@media (max-width: 760px) {
    .account-tabs,
    .administration-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
    }

    .account-tab-button,
    .administration-tab-button {
        flex: 0 0 auto;
        min-width: max-content;
        font-size: 12px;
    }

    .account-parental-master-heading,
    .administration-invitations-intro {
        align-items: flex-start;
    }

    .administration-invitations-intro {
        flex-direction: column;
        padding: 15px 14px 5px;
    }

    .administration-invitation-card {
        margin: 10px 14px 14px;
        padding: 13px;
    }

    .administration-invitation-setting-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .administration-invitation-setting-title-row {
        justify-content: flex-start;
    }

    .administration-invitation-number-field,
    .administration-invitation-number-field.chat-mic-settings-grid {
        grid-column: auto;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .administration-invitation-number-field .chat-mic-number-control {
        width: min(170px, 100%);
    }

    .administration-invitation-generate-row {
        grid-template-columns: 1fr;
    }

    .administration-invitation-actions .administration-button,
    .administration-invitation-generate-row .administration-button {
        width: 100%;
    }

    .administration-invitation-list-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .administration-invitation-days {
        grid-column: 1;
    }

    .administration-invitation-state {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .account-parent-actions {
        flex-wrap: wrap;
    }

    .account-parental-subtabs {
        width: 100%;
        box-sizing: border-box;
    }

    .account-parental-subtab {
        flex: 1 1 0;
    }

    .account-parental-schedule {
        grid-template-columns: 1fr;
    }

    .account-managed-child-panel {
        padding: 12px;
    }
}

@media (max-width: 520px) {
    .account-parental-master-heading {
        align-items: center;
    }

    .account-parental-content-subsettings {
        padding-left: 12px;
    }

    .account-parental-usage-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .account-parental-usage-controls {
        justify-content: space-between;
    }

    .account-parental-schedule-row {
        grid-template-columns: 48px minmax(78px, 1fr) auto minmax(78px, 1fr);
        gap: 6px;
        padding-inline: 7px;
    }

    .account-parental-day-pill {
        width: 44px;
        padding-inline: 5px;
    }

    .account-managed-child-heading,
    .account-managed-child-schedule-heading {
        align-items: flex-start;
    }
}


@media (max-width: 760px) {
    .document-viewer-panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
    }

    .document-viewer-text {
        padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
        font-size: 12px;
    }

    .preview-download-button {
        min-height: 36px;
        padding-inline: 11px;
    }

    .asset-thumbnail-button.asset-document-thumbnail-button .asset-document-thumbnail {
        width: min(54px, 100%);
        height: min(54px, 100%);
    }

    .asset-thumbnail-button.asset-document-thumbnail-button .asset-document-thumbnail svg {
        width: 30px;
        height: 30px;
    }

    .chat-document-attachment-row {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 7px;
    }
}

@media (max-width: 720px) {
    .account-m365-connection {
        align-items: stretch;
        flex-direction: column;
    }

    .account-m365-actions {
        width: 100%;
    }

    .account-m365-actions .account-button {
        width: 100%;
    }

    .account-m365-monitor-form {
        grid-template-columns: 1fr;
    }

    .account-m365-monitor-row {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .account-m365-signature-tabs {
        display: inline-flex;
        width: fit-content;
        max-width: 100%;
    }

    .account-m365-signature-tab {
        flex: 0 0 auto;
    }

    .account-m365-signature-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .account-m365-signature-actions .account-secondary-action {
        width: 100%;
    }

    .rich-text-toolbar {
        gap: 5px;
    }

    .rich-text-toolbar-button {
        flex: 1 0 auto;
    }
}

/* Mobile login: swipe between password and platform-authenticator phone unlock. */
@media (max-width: 900px) and (pointer: coarse) {
    .login-auth-switcher.is-phone-unlock-supported .login-auth-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        margin-bottom: 10px;
        padding: 4px;
        border: 1px solid #303641;
        border-radius: 11px;
        background: #11141a;
    }

    .login-auth-tab {
        min-height: 34px;
        padding: 0 9px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: var(--muted-text);
        cursor: pointer;
        font-size: 12px;
        font-weight: 700;
        transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

    .login-auth-tab.is-active {
        border-color: rgba(93, 156, 255, 0.38);
        background: rgba(46, 116, 187, 0.17);
        color: #9bceff;
    }

    .login-auth-switcher.is-phone-unlock-supported .login-auth-viewport {
        overflow: hidden;
        border-radius: 11px;
        touch-action: pan-y;
    }

    .login-auth-switcher.is-phone-unlock-supported .login-auth-track {
        display: flex;
        width: 200%;
        align-items: stretch;
        transition: transform 0.22s ease;
        will-change: transform;
    }

    .login-auth-switcher.is-phone-unlock-supported .login-auth-panel {
        flex: 0 0 50%;
        width: 50%;
    }

    .login-auth-switcher.is-phone-unlock-supported[data-mode="phone"] .login-auth-track {
        transform: translateX(-50%);
    }

    .login-auth-switcher.is-phone-unlock-supported .login-phone-unlock-panel {
        display: flex;
        align-items: center;
        gap: 13px;
        min-height: 77px;
        padding: 12px 13px;
        border: 1px solid #323a48;
        border-radius: 11px;
        background: linear-gradient(145deg, rgba(93, 156, 255, 0.07), rgba(255, 255, 255, 0.01)), #12151b;
    }

    .login-phone-unlock-icon {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 1px solid rgba(93, 156, 255, 0.4);
        border-radius: 12px;
        background: rgba(46, 116, 187, 0.15);
        color: #8cc5ff;
    }

    .login-phone-unlock-icon svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.65;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .login-phone-unlock-copy {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 3px;
    }

    .login-phone-unlock-copy strong {
        color: var(--primary-text);
        font-size: 13px;
    }

    .login-phone-unlock-copy span {
        color: var(--secondary-text);
        font-size: 12px;
        line-height: 1.35;
    }

    .login-phone-unlock-copy small {
        color: var(--muted-text);
        font-size: 10px;
        line-height: 1.35;
    }

    .login-auth-switcher.is-phone-unlock-supported .login-auth-swipe-hint {
        display: block;
        margin-top: 8px;
        color: #666f7d;
        font-size: 10px;
        text-align: center;
    }

    .login-auth-switcher.is-enrolling-phone-unlock {
        display: none;
    }

    .phone-unlock-enrollment-actions {
        align-items: stretch;
    }
}

@media (max-width: 520px) and (pointer: coarse) {
    .phone-unlock-enrollment-actions {
        flex-direction: column-reverse;
    }

    .phone-unlock-secondary-button,
    .phone-unlock-primary-button {
        width: 100%;
    }
}
