:root {
    --bg: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-message: #0f3460;
    --bg-user: #533483;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #e94560;
    --border: #2a2a4a;
    --input-bg: #222244;
    --sidebar-width: 280px;
    --analysis-panel-width: 620px;
    --media-transcript-width: 320px;
    --resize-handle-size: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    background: var(--bg);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

body.is-resizing,
body.is-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.hidden { display: none !important; }

.screen {
    height: 100%;
    width: 100%;
}

/* Auth */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}

.auth-container h1 {
    font-size: 2.5rem;
    color: var(--accent);
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-form {
    width: min(28rem, 90vw);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-form input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Layout */
.layout {
    display: flex;
    height: 100%;
    min-height: 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    min-width: 14rem;
    max-width: 30rem;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.pane-resizer {
    position: relative;
    flex: 0 0 var(--resize-handle-size);
    align-self: stretch;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
}

.pane-resizer::before {
    content: "";
    position: absolute;
    top: 0.75rem;
    bottom: 0.75rem;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(141, 220, 255, 0.08);
    transition: background 120ms ease, box-shadow 120ms ease;
}

.pane-resizer:hover::before,
.pane-resizer.is-active::before {
    background: rgba(141, 220, 255, 0.42);
    box-shadow: 0 0 0 1px rgba(141, 220, 255, 0.16);
}

.pane-resizer-inline {
    flex-basis: calc(var(--resize-handle-size) + 2px);
    margin: 0 0.15rem;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 0;
    color: var(--accent);
}

.mobile-sidebar-close,
.mobile-sidebar-scrim,
.mobile-chat-header {
    display: none;
}

.sidebar-meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary:hover { opacity: 0.9; }

.new-item-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.7rem;
    border: 1px solid rgba(79, 195, 247, 0.22);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(79, 195, 247, 0.08), rgba(79, 195, 247, 0.02)),
        rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.new-item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.new-item-label {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.new-item-btn {
    width: auto;
    flex: 1 1 4.5rem;
}

.sidebar-action-btn {
    width: 100%;
    margin-top: 0.75rem;
}

.sidebar-section {
    margin-top: 0.75rem;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sidebar-section-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
}

.sidebar-section-copy {
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.sidebar-section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: 0.14rem 0.42rem;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.16);
    color: #8ddcff;
    font-size: 0.68rem;
    font-weight: 700;
}

.sidebar-section-badge.locked {
    background: rgba(233, 69, 96, 0.18);
    color: #ffc6d1;
}

.sidebar-section-badge.pending {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.media-hub {
    border-color: rgba(233, 69, 96, 0.22);
    background:
        linear-gradient(180deg, rgba(233, 69, 96, 0.08), rgba(233, 69, 96, 0.03)),
        rgba(255, 255, 255, 0.02);
}

.media-hub-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.media-hub-btn {
    flex: 1;
}

.media-hub-btn.active {
    border-color: rgba(79, 195, 247, 0.45);
    background: rgba(79, 195, 247, 0.12);
    color: white;
}

.conversation-item.media-drop-active {
    outline: 2px solid rgba(79, 195, 247, 0.65);
    outline-offset: 2px;
    background: rgba(79, 195, 247, 0.14);
}

.btn-secondary {
    padding: 0.55rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.84rem;
}

.btn-secondary:hover {
    border-color: rgba(79, 195, 247, 0.4);
    color: white;
}

.btn-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-list-status {
    margin: 0.75rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.admin-conversation-loader {
    display: grid;
    gap: 0.55rem;
    margin: 0.15rem 0 0.65rem;
    padding: 0.7rem;
    border: 1px solid rgba(79, 195, 247, 0.16);
    border-radius: 10px;
    background: rgba(79, 195, 247, 0.06);
}

.admin-conversation-loader p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.admin-conversation-loader .btn-secondary {
    justify-self: start;
    padding: 0.42rem 0.6rem;
    font-size: 0.74rem;
}

.conversation-group {
    margin-bottom: 0.5rem;
}

.conversation-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.5rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: 0.84rem;
}

.conversation-group-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.conversation-group-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
}

.conversation-group-email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-group-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.16);
    color: #8ddcff;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.conversation-group-list {
    margin-top: 0.2rem;
    padding-left: 0.8rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.conversation-item {
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    margin-bottom: 2px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.conversation-item:hover { background: var(--bg); }
.conversation-item.active { background: var(--bg-message); }
.conversation-item.private {
    box-shadow: inset 0 0 0 1px rgba(255, 140, 160, 0.18);
}

.conversation-item.executable {
    border-left: 2px solid rgba(79, 195, 247, 0.4);
}

.conversation-title {
    flex: 1;
    min-width: 0;
    padding: 0.15rem 0.25rem;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-title.private {
    color: #ffb3c1;
}

.conversation-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.conversation-label {
    flex-shrink: 0;
    padding: 0.1rem 0.38rem;
    border-radius: 999px;
    font-size: 0.64rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.conversation-item-user-info {
    border-left: 2px solid rgba(233, 69, 96, 0.45);
}

.conversation-title-user-info {
    font-style: italic;
    color: #ffd5dc;
}

.conversation-label.executable {
    background: rgba(79, 195, 247, 0.16);
    color: #8ddcff;
}

.conversation-menu-trigger {
    width: 1.8rem;
    height: 1.8rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.conversation-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.conversation-menu {
    position: absolute;
    top: calc(100% + 0.15rem);
    right: 0.25rem;
    z-index: 20;
    min-width: 10rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.conversation-menu-action {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-size: 0.84rem;
}

.conversation-menu-action:hover {
    background: rgba(255, 255, 255, 0.06);
}

.conversation-menu-action.danger {
    color: #ff8ca0;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.sidebar-footer-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.user-setting-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border: 1px solid rgba(79, 195, 247, 0.24);
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.08);
    color: #bfeaff;
    font-size: 0.68rem;
    line-height: 1.2;
}

.user-info { color: var(--text-muted); }

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    text-align: left;
}

.btn-text:hover { color: var(--accent); }

/* Chat main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem 0.5rem;
}

.conversation-header h2 {
    font-size: 1.15rem;
}

.conversation-subtitle {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.conversation-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.conversation-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.conversation-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.context-usage,
.token-rate {
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(79, 195, 247, 0.24);
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.08);
    color: #cbeefe;
    font-size: 0.78rem;
    white-space: nowrap;
}

.context-usage.warn {
    border-color: rgba(255, 190, 92, 0.35);
    background: rgba(255, 190, 92, 0.1);
    color: #ffd89a;
}

.context-usage.danger {
    border-color: rgba(255, 140, 160, 0.35);
    background: rgba(255, 140, 160, 0.11);
    color: #ffd3db;
}

.token-rate {
    border-color: rgba(166, 227, 161, 0.25);
    background: rgba(166, 227, 161, 0.08);
    color: #d8f8d2;
}

.chat-status {
    margin: 0 2rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(255, 140, 160, 0.28);
    border-radius: 8px;
    background: rgba(255, 140, 160, 0.08);
    color: #ffd3db;
    font-size: 0.88rem;
}

.chat-attached-media {
    flex: 0 0 auto;
    margin: 0.75rem 2rem 0;
}

.chat-status-message {
    line-height: 1.45;
}

.chat-status-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.55rem;
    font-size: 0.76rem;
    color: #ffc9d3;
}

.chat-status-progress {
    margin-top: 0.35rem;
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.chat-status-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8ca0, #ffd3db);
    transition: width 160ms ease;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 2rem;
    min-width: 0;
}

.content-workspace {
    flex: 1;
    display: flex;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.journal-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    padding: 1rem 1.25rem 1.25rem 2rem;
    gap: 0.9rem;
}

.media-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    padding: 1rem 1.25rem 1.25rem 2rem;
    gap: 0.9rem;
}

.journal-toolbar,
.media-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.media-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 0.85rem;
}

.media-pagination {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(7rem, 1fr) auto minmax(7rem, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.1rem;
}

.media-pagination .btn-secondary:first-child {
    justify-self: start;
}

.media-pagination .btn-secondary:last-child {
    justify-self: end;
}

.media-pagination-status {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
}

/* LTX generation studio */
.generation-pane {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 1.1rem 2rem 2rem;
    background:
        radial-gradient(circle at 12% 6%, rgba(79, 195, 247, 0.12), transparent 28rem),
        radial-gradient(circle at 90% 0%, rgba(233, 69, 96, 0.11), transparent 30rem);
}

.generation-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 auto 1.25rem;
    max-width: 78rem;
}

.generation-hero h2 {
    margin: 0.18rem 0 0.45rem;
    font-size: clamp(1.65rem, 3vw, 2.5rem);
    font-weight: 650;
    letter-spacing: -0.035em;
}

.generation-hero p:not(.generation-eyebrow) {
    max-width: 49rem;
    color: #b9bed2;
    line-height: 1.6;
}

.generation-eyebrow {
    color: #8ddcff;
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.generation-capability {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(166, 227, 161, 0.3);
    border-radius: 999px;
    background: rgba(166, 227, 161, 0.08);
    color: #d8f8d2;
    font-size: 0.76rem;
}

.generation-capability::before {
    content: "";
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #a6e3a1;
    box-shadow: 0 0 0 3px rgba(166, 227, 161, 0.12);
}

.generation-capability.checking,
.generation-capability.unavailable {
    border-color: rgba(255, 190, 92, 0.3);
    background: rgba(255, 190, 92, 0.08);
    color: #ffd89a;
}

.generation-capability.checking::before,
.generation-capability.unavailable::before {
    background: #ffbe5c;
    box-shadow: 0 0 0 3px rgba(255, 190, 92, 0.12);
}

.generation-layout {
    display: grid;
    grid-template-columns: minmax(20rem, 1.05fr) minmax(20rem, 0.95fr);
    gap: 1rem;
    max-width: 78rem;
    margin: 0 auto;
}

.generation-tabs {
    display: flex;
    gap: 0.35rem;
    max-width: 78rem;
    margin: 0 auto 1rem;
    padding: 0.3rem;
    border: 1px solid rgba(141, 220, 255, 0.12);
    border-radius: 12px;
    background: rgba(8, 13, 31, 0.52);
}

.generation-tab {
    padding: 0.62rem 0.9rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #aeb8ce;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;
}

.generation-tab.active {
    background: rgba(79, 195, 247, 0.12);
    color: #e1f6ff;
    box-shadow: inset 0 0 0 1px rgba(141, 220, 255, 0.18);
}

.generation-form,
.generation-history {
    border: 1px solid rgba(141, 220, 255, 0.14);
    border-radius: 18px;
    background: rgba(16, 23, 48, 0.78);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
}

.generation-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.2rem;
}

.generation-label {
    display: block;
    margin-bottom: 0.42rem;
    color: #dce5f5;
    font-size: 0.8rem;
    font-weight: 650;
}

#generation-prompt,
#generation-negative-prompt,
#generation-identity-description {
    width: 100%;
    resize: vertical;
    padding: 1rem;
    border: 1px solid rgba(141, 220, 255, 0.22);
    border-radius: 12px;
    outline: none;
    background: rgba(8, 13, 31, 0.72);
    color: var(--text);
    font: inherit;
    line-height: 1.55;
}

#generation-prompt {
    min-height: 10.5rem;
}

.generation-prompt-shell {
    position: relative;
}

.generation-identity-autocomplete {
    position: absolute;
    z-index: 20;
    right: 0.55rem;
    bottom: 0.55rem;
    left: 0.55rem;
    max-height: 14rem;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid rgba(141, 220, 255, 0.34);
    border-radius: 12px;
    background: rgba(8, 13, 31, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.generation-identity-autocomplete button {
    display: grid;
    width: 100%;
    padding: 0.62rem 0.7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.generation-identity-autocomplete button:hover,
.generation-identity-autocomplete button.active {
    background: rgba(79, 195, 247, 0.13);
}

.generation-identity-autocomplete strong {
    color: #d9f3ff;
    font-size: 0.84rem;
}

.generation-identity-autocomplete span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#generation-negative-prompt {
    min-height: 5.5rem;
}

#generation-prompt:focus,
#generation-negative-prompt:focus,
#generation-identity-description:focus {
    border-color: rgba(141, 220, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.08);
}

.generation-prompt-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.generation-rewrite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.generation-rewrite-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.generation-rewrite-status,
.generation-rewrite-note {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.generation-identity-use {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.8fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(166, 227, 161, 0.2);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(166, 227, 161, 0.06), rgba(79, 195, 247, 0.035));
}

.generation-identity-use h3 {
    margin: 0.15rem 0 0.35rem;
    font-size: 1rem;
}

.generation-identity-use p:not(.generation-eyebrow) {
    color: #9faac3;
    font-size: 0.72rem;
    line-height: 1.5;
}

.generation-identity-use-controls {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.generation-identity-use-controls > label:first-child {
    color: #aeb8ce;
    font-size: 0.72rem;
}

.generation-identity-use-controls select {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
}

.generation-identity-view,
.generation-identity-layout {
    max-width: 78rem;
    margin: 0 auto;
}

.generation-identity-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
}

.generation-identity-intro h2 {
    margin: 0.18rem 0 0.45rem;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.generation-identity-intro p:not(.generation-eyebrow) {
    max-width: 52rem;
    color: #b9bed2;
    font-size: 0.82rem;
    line-height: 1.6;
}

.generation-identity-layout {
    display: grid;
    grid-template-columns: minmax(16rem, 0.72fr) minmax(24rem, 1.28fr);
    gap: 1rem;
}

.generation-identity-form .settings-input,
#generation-identity-description,
#generation-identity-edit-name,
#generation-identity-edit-description {
    width: 100%;
}

.generation-identity-workspace {
    min-width: 0;
}

.generation-identity-editor-heading,
.generation-identity-asset-heading,
.generation-identity-voice-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.generation-identity-editor-heading h3,
.generation-identity-assets h4 {
    margin: 0.15rem 0 0;
}

.generation-identity-editor-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.generation-identity-edit-fields {
    display: grid;
    gap: 0.55rem;
    margin-top: 1.25rem;
}

.generation-identity-edit-fields button {
    justify-self: start;
}

.generation-identity-drop {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px dashed rgba(141, 220, 255, 0.3);
    border-radius: 12px;
    background: rgba(79, 195, 247, 0.04);
    color: #dce5f5;
    cursor: pointer;
}

.generation-identity-drop span {
    color: #9faac3;
    font-size: 0.7rem;
}

.generation-identity-drop input {
    margin-top: 0.55rem;
}

.generation-identity-reference-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(141, 220, 255, 0.2);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.08), rgba(139, 92, 246, 0.05));
}

.generation-identity-reference-choice strong,
.generation-identity-reference-choice span {
    display: block;
}

.generation-identity-reference-choice span {
    margin-top: 0.25rem;
    color: #9faac3;
    font-size: 0.7rem;
    line-height: 1.45;
}

.generation-identity-preview {
    width: 100%;
    max-height: 26rem;
    object-fit: contain;
    border-radius: 10px;
    background: #03050a;
}

.generation-identity-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.generation-identity-card {
    display: grid;
    grid-template-columns: 5.25rem minmax(0, 1fr);
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.generation-identity-card:hover,
.generation-identity-card.active {
    border-color: rgba(141, 220, 255, 0.45);
    background: rgba(79, 195, 247, 0.08);
}

.generation-identity-card img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 5.25rem;
    object-fit: cover;
    background: #03050a;
}

.generation-identity-card-body {
    display: grid;
    align-content: center;
    gap: 0.3rem;
    padding: 0.8rem;
}

.generation-identity-card-body strong {
    color: #e3e9f5;
    font-size: 0.9rem;
}

.generation-identity-card-body small {
    color: #9faac3;
    font-size: 0.7rem;
}

.generation-identity-empty {
    min-height: 12rem;
}

.generation-identity-assets {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.generation-identity-asset-heading p {
    margin: 0.35rem 0 0;
    color: #9faac3;
    font-size: 0.7rem;
}

.generation-identity-upload {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    cursor: pointer;
}

.generation-identity-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.generation-identity-upload.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.generation-identity-sheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.generation-identity-sheet,
.generation-identity-voice {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.generation-identity-sheet img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #03050a;
}

.generation-identity-sheet.disabled img {
    opacity: 0.32;
    filter: grayscale(0.8);
}

.generation-identity-sheet > div,
.generation-identity-sheet > button {
    margin: 0.6rem;
}

.generation-identity-sheet-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.6rem;
    color: #cbd5e8;
    font-size: 0.7rem;
    cursor: pointer;
}

.generation-identity-sheet-toggle input:disabled {
    cursor: not-allowed;
}

.generation-identity-sheet-toggle:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.65;
}

.generation-identity-sheet strong,
.generation-identity-sheet span,
.generation-identity-voice strong,
.generation-identity-voice span {
    display: block;
}

.generation-identity-sheet strong,
.generation-identity-voice strong {
    color: #e3e9f5;
    font-size: 0.76rem;
}

.generation-identity-sheet span,
.generation-identity-voice span {
    margin-top: 0.2rem;
    color: #9faac3;
    font-size: 0.66rem;
}

.generation-identity-voice-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.85rem;
}

.generation-identity-voice {
    padding: 0.75rem;
}

.generation-identity-voice audio {
    width: 100%;
    height: 2.25rem;
    margin-top: 0.6rem;
}

.generation-identity-voice p {
    margin: 0.55rem 0 0;
    color: #aeb8ce;
    font-size: 0.68rem;
    line-height: 1.45;
}

#generation-reference-sheet-builder-modal {
    z-index: 40;
}

.generation-reference-sheet-builder-card {
    max-height: calc(100vh - 3rem);
    overflow: auto;
}

.generation-reference-sheet-builder-card .modal-header h3 {
    margin: 0.15rem 0 0;
}

.generation-reference-sheet-builder-layout {
    display: grid;
    grid-template-columns: minmax(18rem, 0.8fr) minmax(20rem, 1.2fr);
    gap: 1rem;
}

.generation-reference-sheet-sources-panel,
.generation-reference-sheet-preview-panel {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.generation-reference-sheet-toolbar,
.generation-reference-sheet-actions,
.generation-reference-sheet-actions > div,
.generation-reference-sheet-source-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.generation-reference-sheet-toolbar {
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.generation-reference-sheet-sources {
    display: grid;
    gap: 0.55rem;
    max-height: 32rem;
    overflow: auto;
}

.generation-reference-sheet-source {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.14);
}

.generation-reference-sheet-source img {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: contain;
    border-radius: 7px;
    background: #03050a;
}

.generation-reference-sheet-source strong,
.generation-reference-sheet-source span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.generation-reference-sheet-source strong {
    color: #e3e9f5;
    font-size: 0.72rem;
}

.generation-reference-sheet-source span,
.generation-reference-sheet-status,
.generation-reference-sheet-actions p {
    color: #9faac3;
    font-size: 0.66rem;
}

.generation-reference-sheet-source span {
    margin-top: 0.2rem;
}

.generation-reference-sheet-source-actions {
    justify-content: flex-end;
}

.generation-reference-sheet-source-actions .btn-text {
    padding: 0.35rem;
}

#generation-reference-sheet-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 9px;
    background: #03050a;
}

.generation-reference-sheet-status {
    margin: 0.65rem 0 0;
    line-height: 1.4;
}

.generation-reference-sheet-actions {
    justify-content: space-between;
    margin-top: 1rem;
}

.generation-reference-sheet-actions p {
    max-width: 38rem;
    margin: 0;
    line-height: 1.45;
}

.btn-text.danger {
    color: #ff9cab;
}

.generation-rewrite-status.working {
    color: #cbeefe;
}

.generation-rewrite-status.error {
    color: #ffd3db;
}

.generation-rewrite-note {
    margin-top: -0.25rem;
}

.generation-conditioning {
    padding: 1rem;
    border: 1px solid rgba(141, 220, 255, 0.13);
    border-radius: 14px;
    background: rgba(8, 13, 31, 0.44);
}

.generation-conditioning-header,
.generation-keyframes {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.generation-conditioning-header h3 {
    margin-top: 0.12rem;
    font-size: 1rem;
}

.generation-conditioning-header > span,
.generation-conditioning-copy,
.generation-conditioning-note,
.generation-specialized-status,
.generation-keyframes span {
    color: #9faac3;
    font-size: 0.72rem;
    line-height: 1.5;
}

.generation-conditioning-copy {
    margin: 0.45rem 0 0.9rem;
}

.generation-conditioning-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.generation-input-slot {
    min-width: 0;
    padding: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.018);
}

.generation-video-slot {
    grid-column: 1 / -1;
}

.generation-input-slot > label:first-child,
.generation-keyframes strong {
    display: block;
    color: #dce5f5;
    font-size: 0.78rem;
    font-weight: 680;
}

.generation-input-slot > p {
    min-height: 2.2rem;
    margin: 0.2rem 0 0.65rem;
    color: #9faac3;
    font-size: 0.68rem;
    line-height: 1.4;
}

.generation-input-slot input[type="file"] {
    width: 100%;
    color: transparent;
    font-size: 0.72rem;
}

.generation-input-slot input[type="file"]::file-selector-button {
    margin-right: 0.6rem;
    padding: 0.48rem 0.7rem;
    border: 1px solid rgba(141, 220, 255, 0.22);
    border-radius: 8px;
    background: rgba(79, 195, 247, 0.08);
    color: #dceaf5;
    cursor: pointer;
}

.generation-image-picker-trigger {
    width: 100%;
    min-height: 4.2rem;
    display: grid;
    grid-template-columns: 3.3rem minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem;
    border: 1px solid rgba(141, 220, 255, 0.2);
    border-radius: 10px;
    background: rgba(79, 195, 247, 0.045);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.generation-image-picker-trigger:hover,
.generation-image-picker-trigger:focus-visible {
    border-color: rgba(79, 195, 247, 0.58);
    background: rgba(79, 195, 247, 0.1);
}

.generation-image-picker-trigger:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.generation-image-picker-trigger > span:last-child {
    min-width: 0;
}

.generation-image-picker-trigger strong,
.generation-image-picker-trigger small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.generation-image-picker-trigger strong {
    font-size: 0.74rem;
}

.generation-image-picker-trigger small {
    margin-top: 0.18rem;
    color: var(--text-muted);
    font-size: 0.64rem;
}

.generation-image-picker-thumb {
    width: 3.3rem;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(5, 9, 20, 0.72);
    color: #7f8ba4;
    font-size: 0.58rem;
    text-transform: uppercase;
}

.generation-image-picker-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.generation-file-selection {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.42rem;
}

.generation-file-name {
    display: block;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: #aeb8ce;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.generation-file-remove {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 1.35rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: #bac4d8;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

.generation-file-remove:hover,
.generation-file-remove:focus-visible {
    border-color: rgba(255, 145, 165, 0.55);
    background: rgba(255, 92, 125, 0.12);
    color: #ffd5dd;
}

.generation-image-picker-card {
    max-height: min(48rem, 90vh);
    max-height: min(48rem, 90dvh);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.generation-image-picker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.generation-image-picker-filters {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.generation-image-picker-filters .active {
    border-color: rgba(79, 195, 247, 0.65);
    background: rgba(79, 195, 247, 0.18);
    color: #dff6ff;
}

.generation-image-picker-grid {
    flex: 1;
    min-height: 17rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 0.75rem;
    overflow-y: auto;
    padding-top: 0.8rem;
}

.generation-image-picker-item {
    position: relative;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.generation-image-picker-item:hover,
.generation-image-picker-item:focus-visible {
    border-color: rgba(79, 195, 247, 0.58);
    transform: translateY(-1px);
}

.generation-image-picker-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.28);
}

.generation-image-picker-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.generation-image-picker-item-copy {
    display: grid;
    gap: 0.2rem;
    padding: 0.62rem 0.68rem 0.7rem;
}

.generation-image-picker-item-copy strong,
.generation-image-picker-item-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.generation-image-picker-item-copy strong {
    font-size: 0.76rem;
}

.generation-image-picker-item-copy span {
    color: var(--text-muted);
    font-size: 0.66rem;
}

.generation-image-picker-badge {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    z-index: 1;
    padding: 0.22rem 0.44rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(8, 15, 30, 0.86);
    color: #eef8ff;
    font-size: 0.62rem;
    font-weight: 700;
}

.generation-slot-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
}

.generation-slot-control {
    display: grid;
    grid-template-columns: auto minmax(4rem, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.65rem;
    color: #aeb8ce;
    font-size: 0.68rem;
}

.generation-slot-controls .generation-slot-control {
    flex: 1;
    margin-top: 0;
}

.generation-slot-control input[type="range"] {
    min-width: 0;
    accent-color: var(--accent);
}

.generation-slot-control output {
    min-width: 2.1rem;
    color: #cbeefe;
    text-align: right;
}

.generation-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #c2cada;
    font-size: 0.7rem;
}

.generation-inline-check input {
    accent-color: var(--accent);
}

.generation-video-frame {
    color: #aeb8ce;
    font-size: 0.68rem;
}

.generation-video-frame input {
    display: block;
    width: 5.5rem;
    margin-top: 0.3rem;
    padding: 0.42rem;
    border: 1px solid rgba(141, 220, 255, 0.18);
    border-radius: 7px;
    background: rgba(8, 13, 31, 0.72);
    color: var(--text);
}

.generation-keyframes {
    align-items: center;
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.generation-keyframes span {
    display: block;
    margin-top: 0.18rem;
}

.generation-keyframe-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.generation-keyframe-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6rem auto;
    align-items: end;
    gap: 0.55rem;
    padding: 0.65rem;
    border-left: 2px solid rgba(79, 195, 247, 0.38);
    background: rgba(79, 195, 247, 0.035);
}

.generation-keyframe-row label {
    color: #aeb8ce;
    font-size: 0.68rem;
}

.generation-keyframe-row input[type="file"],
.generation-keyframe-row input[type="number"] {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
}

.generation-keyframe-row input[type="number"] {
    padding: 0.45rem;
    border: 1px solid rgba(141, 220, 255, 0.18);
    border-radius: 7px;
    background: rgba(8, 13, 31, 0.72);
    color: var(--text);
}

.generation-conditioning-note {
    margin-top: 0.75rem;
}

.generation-specialized-status {
    margin-top: 0.35rem;
    color: #c6a9ae;
}

.generation-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.generation-range-row {
    display: flex;
    align-items: center;
    min-height: 2.6rem;
    gap: 0.75rem;
}

.generation-range-row input {
    flex: 1;
    accent-color: var(--accent);
}

.generation-range-row output {
    min-width: 3.5rem;
    color: #cbeefe;
    font-size: 0.82rem;
    text-align: right;
}

.generation-advanced {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
}

.generation-advanced summary {
    color: #bfc6da;
    cursor: pointer;
    font-size: 0.8rem;
}

.generation-advanced[open] summary {
    margin-bottom: 0.8rem;
}

.generation-submit {
    width: 100%;
    min-height: 2.85rem;
    font-weight: 700;
}

.generation-submit:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.generation-footnote,
.generation-form-status {
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.5;
}

.generation-form-status {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: rgba(79, 195, 247, 0.08);
    color: #cbeefe;
}

.generation-form-status.error {
    background: rgba(233, 69, 96, 0.1);
    color: #ffd3db;
}

.generation-history {
    min-height: 35rem;
    padding: 1.1rem;
}

.generation-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.generation-history-header h3 {
    margin-top: 0.16rem;
    font-size: 1.05rem;
}

.generation-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.generation-empty {
    display: grid;
    min-height: 16rem;
    place-items: center;
    padding: 2rem;
    border: 1px dashed rgba(141, 220, 255, 0.18);
    border-radius: 12px;
    color: var(--text-muted);
    text-align: center;
}

.generation-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.generation-card video,
.generation-card img {
    display: block;
    width: 100%;
    max-height: 20rem;
    background: #050711;
    object-fit: contain;
}

.generation-card audio {
    display: block;
    width: calc(100% - 1.5rem);
    margin: 0.75rem;
}

.generation-card-body {
    padding: 0.85rem;
}

.generation-card-topline,
.generation-card-meta,
.generation-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.generation-card-status {
    color: #ffd89a;
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.generation-card-status.succeeded { color: #a6e3a1; }
.generation-card-status.failed { color: #ff8ca0; }

.generation-card-prompt {
    margin: 0.55rem 0;
    color: #dce1ef;
    font-size: 0.84rem;
    line-height: 1.45;
}

.generation-card-meta {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.generation-progress {
    height: 0.32rem;
    margin-top: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.generation-progress-copy {
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.generation-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4fc3f7, #e94560);
    transition: width 220ms ease;
}

.generation-progress.indeterminate .generation-progress-bar {
    width: 38%;
    animation: generation-progress-indeterminate 1.35s ease-in-out infinite;
}

@keyframes generation-progress-indeterminate {
    0% { transform: translateX(-115%); }
    50% { transform: translateX(82%); }
    100% { transform: translateX(265%); }
}

@media (prefers-reduced-motion: reduce) {
    .generation-progress.indeterminate .generation-progress-bar {
        width: 100%;
        animation: none;
        opacity: 0.55;
    }
}

.generation-card-detail,
.generation-card-error {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.generation-card-error { color: #ffb8c5; }

.generation-card-actions {
    justify-content: flex-start;
    margin-top: 0.7rem;
}

.media-card {
    position: relative;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    overflow: hidden;
    text-align: left;
}

.media-card:hover,
.media-card.active,
.media-card.selected {
    border-color: rgba(79, 195, 247, 0.45);
}

.media-card.selected {
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.32);
}

.media-card.dragging {
    opacity: 0.68;
}

.media-card-open {
    width: 100%;
    display: block;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.media-card-select {
    position: absolute;
    z-index: 2;
    top: 0.45rem;
    left: 0.45rem;
}

.media-select-toggle {
    padding: 0.28rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(8, 15, 30, 0.78);
    color: white;
    cursor: pointer;
    font-size: 0.72rem;
}

.media-card.selected .media-select-toggle {
    border-color: rgba(79, 195, 247, 0.65);
    background: rgba(79, 195, 247, 0.22);
}

.media-card-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-card-preview img,
.media-card-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-document-preview {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.media-document-preview.detail {
    min-height: 14rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.media-document-preview strong {
    font-size: 1.1rem;
    color: #8ddcff;
    letter-spacing: 0.08em;
}

.media-document-preview span {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.media-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.65rem 0.75rem 0.75rem;
}

.media-card-body strong,
.media-card-body span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-body strong {
    font-size: 0.86rem;
}

.media-card-body span {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: capitalize;
}

.media-runtime-meta {
    color: #cbeefe;
    font-size: 0.74rem;
    line-height: 1.35;
    text-transform: none;
}

.media-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.media-status-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.16rem 0.42rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.media-status-pill.ready {
    color: #b8f7d2;
    background: rgba(72, 187, 120, 0.16);
    border-color: rgba(72, 187, 120, 0.28);
}

.media-status-pill.pending {
    color: #ffe3a3;
    background: rgba(255, 193, 7, 0.14);
    border-color: rgba(255, 193, 7, 0.28);
}

.media-status-pill.error {
    color: #ffd2db;
    background: rgba(233, 69, 96, 0.16);
    border-color: rgba(233, 69, 96, 0.3);
}

.media-status-pill.muted {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.media-placeholder {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.media-empty-state {
    min-height: 20rem;
    grid-column: 1 / -1;
}

.media-locked-state p {
    max-width: 32rem;
}

.media-empty-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.media-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.media-selection-status {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.media-danger-btn {
    border-color: rgba(233, 69, 96, 0.45);
    color: #ffd3db;
}

.media-danger-btn:hover {
    border-color: rgba(233, 69, 96, 0.72);
    background: rgba(233, 69, 96, 0.13);
}

.attached-media-strip {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.attached-media-strip.compact {
    padding: 0.65rem;
}

.chat-attached-media .attached-media-strip {
    background: rgba(79, 195, 247, 0.06);
    border-color: rgba(79, 195, 247, 0.2);
}

.attached-media-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.attached-media-heading::-webkit-details-marker {
    display: none;
}

.attached-media-heading:focus-visible {
    border-radius: 5px;
    outline: 2px solid rgba(79, 195, 247, 0.75);
    outline-offset: 4px;
}

.attached-media-heading-copy {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    min-width: 0;
}

.attached-media-count {
    flex: 0 0 auto;
    color: var(--text);
    font-weight: 700;
}

.attached-media-context {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attached-media-toggle {
    flex: 0 0 auto;
    min-width: 3.25rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(79, 195, 247, 0.24);
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.08);
    color: #bfeeff;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.attached-media-toggle-collapse {
    display: none;
}

.attached-media-strip[open] .attached-media-toggle-expand {
    display: none;
}

.attached-media-strip[open] .attached-media-toggle-collapse {
    display: inline;
}

.attached-media-list {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.attached-media-chip {
    width: 11rem;
    flex: 0 0 11rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.attached-media-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.attached-media-preview img,
.attached-media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attached-media-meta {
    display: grid;
    gap: 0.2rem;
    padding: 0.55rem 0.6rem 0.25rem;
}

.attached-media-meta strong,
.attached-media-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attached-media-meta strong {
    font-size: 0.78rem;
}

.attached-media-meta span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.attached-media-order {
    margin-right: 0.35rem;
    color: #8ddcff;
}

.attached-media-remove {
    width: calc(100% - 1.2rem);
    margin: 0.3rem 0.6rem 0.6rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
}

.attached-media-remove:hover {
    color: white;
    border-color: rgba(233, 69, 96, 0.48);
}

.media-attach-card {
    max-height: min(48rem, 90vh);
    max-height: min(48rem, 90dvh);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.media-attach-source-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.media-attach-source-option {
    min-width: 0;
    min-height: 4.75rem;
    display: grid;
    align-content: center;
    gap: 0.25rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(79, 195, 247, 0.28);
    border-radius: 10px;
    background: rgba(79, 195, 247, 0.06);
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.media-attach-source-option:hover,
.media-attach-source-option:focus-visible {
    border-color: rgba(79, 195, 247, 0.62);
    background: rgba(79, 195, 247, 0.12);
}

.media-attach-source-option:focus-visible {
    outline: 2px solid rgba(79, 195, 247, 0.72);
    outline-offset: 2px;
}

.media-attach-source-option strong {
    font-size: 0.9rem;
}

.media-attach-source-option span {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.media-attach-source-option-device {
    border-color: rgba(233, 69, 96, 0.3);
    background: rgba(233, 69, 96, 0.07);
}

.media-attach-source-option-device:hover,
.media-attach-source-option-device:focus-visible {
    border-color: rgba(233, 69, 96, 0.62);
    background: rgba(233, 69, 96, 0.13);
}

.media-attach-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.media-attach-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.media-attach-grid {
    flex: 1;
    min-width: 0;
    min-height: 16rem;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    gap: 0.8rem;
    padding-top: 1rem;
}

.media-attach-item {
    position: relative;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    overflow: hidden;
    text-align: left;
}

.media-attach-item:hover,
.media-attach-item.selected {
    border-color: rgba(79, 195, 247, 0.5);
}

.media-attach-item.selected {
    box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.32);
}

.media-attach-item.attached {
    cursor: default;
    opacity: 0.72;
}

.media-attach-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.media-attach-preview img,
.media-attach-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-attach-body {
    display: grid;
    gap: 0.22rem;
    padding: 0.62rem 0.68rem 0.7rem;
}

.media-attach-body strong,
.media-attach-body span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-attach-body strong {
    font-size: 0.8rem;
}

.media-attach-body span {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: capitalize;
}

.media-attach-badge {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    padding: 0.24rem 0.46rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(8, 15, 30, 0.82);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
}

.media-attach-item.selected .media-attach-badge {
    border-color: rgba(79, 195, 247, 0.65);
    background: rgba(79, 195, 247, 0.26);
}

.media-attach-item.attached .media-attach-badge {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.media-analysis-panel {
    width: min(var(--analysis-panel-width), 72vw);
    flex: 0 0 min(var(--analysis-panel-width), 72vw);
    overflow: hidden;
}

.media-analysis-detail-row {
    display: flex;
    gap: 0;
    align-items: stretch;
    padding: 1rem 1.25rem 0;
    min-height: clamp(18rem, 34vh, 26rem);
}

.media-preview {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0.75rem;
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    max-height: clamp(18rem, 34vh, 26rem);
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.28);
}

.media-preview audio {
    width: 100%;
}

.media-transcript {
    flex: 0 0 var(--media-transcript-width);
    width: var(--media-transcript-width);
    min-width: 18rem;
    max-width: min(36rem, 48vw);
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.media-analysis-detail-row .media-transcript.hidden {
    display: none !important;
}

.media-transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.media-transcript-status {
    margin-left: auto;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: none;
}

.media-transcript-text {
    flex: 1;
    min-height: 0;
    margin-top: 0.7rem;
    padding-right: 0.35rem;
    color: #f6f0ea;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    overflow-x: hidden;
    user-select: text;
}

.media-transcript-empty {
    margin-top: 0.7rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .pane-resizer {
        display: none !important;
    }

    .media-analysis-detail-row {
        flex-direction: column;
        min-height: 0;
    }

    .media-preview,
    .media-transcript {
        flex-basis: auto;
        width: auto;
        max-width: none;
    }
}

.journal-toolbar-title {
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffd3db;
}

.journal-selection-status {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.journal-dictation-status {
    margin-top: 0.25rem;
    color: #c8f1ff;
    font-size: 0.8rem;
    line-height: 1.45;
    word-break: break-word;
}

.journal-dictation-status.error {
    color: #ffc9d3;
}

.journal-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.voice-capture-btn {
    min-width: 5.25rem;
}

.voice-capture-btn.recording {
    border-color: rgba(255, 140, 160, 0.72);
    background: rgba(233, 69, 96, 0.18);
    color: #ffe8ed;
}

.journal-selection-preview {
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 211, 219, 0.18);
    border-radius: 14px;
    background: rgba(255, 211, 219, 0.05);
}

.journal-selection-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffd3db;
}

.journal-selection-preview-text {
    margin-top: 0.6rem;
    color: #f6f0ea;
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.journal-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
    font-size: 0.84rem;
}

.journal-editor {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(11, 18, 35, 0.75);
    color: #f6f0ea;
    font: inherit;
    font-size: 1rem;
    line-height: 1.75;
    resize: none;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.journal-editor:focus {
    border-color: rgba(255, 211, 219, 0.35);
}

.journal-analysis-panel {
    width: min(var(--analysis-panel-width), 72vw);
    flex: 0 0 min(var(--analysis-panel-width), 72vw);
    min-width: 24rem;
    border-left: 1px solid var(--border);
    background:
        radial-gradient(circle at top, rgba(79, 195, 247, 0.08), transparent 34%),
        rgba(8, 15, 30, 0.78);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.journal-analysis-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.journal-analysis-header h3 {
    font-size: 1rem;
}

.journal-analysis-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.journal-analysis-messages {
    padding: 1rem 1.25rem;
    min-height: 0;
}

.journal-analysis-form {
    padding: 1rem 1.25rem 1.1rem;
    flex: 0 0 auto;
}

.media-analysis-panel .journal-analysis-messages {
    flex: 1 1 10rem;
    min-height: 8rem;
}

#journal-analysis-input,
#media-analysis-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    outline: none;
}

#journal-analysis-input:focus,
#media-analysis-input:focus {
    border-color: var(--accent);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
}

.message-role {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 70px;
    padding-top: 0.25rem;
}

.message-role.user { color: var(--accent); }
.message-role.assistant { color: #4fc3f7; }

.message-content {
    flex: 1;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-body {
    flex: 1;
    min-width: 0;
}

.message-thinking {
    margin-bottom: 0.45rem;
    padding-left: 0.85rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    color: #a8adb7;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-thinking.hidden {
    display: none;
}

.encrypted-chat-shell {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.encrypted-chat-card {
    width: min(38rem, 100%);
    padding: 2.25rem;
    border: 1px solid rgba(255, 140, 160, 0.28);
    border-radius: 20px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 45%),
        linear-gradient(160deg, rgba(83, 52, 131, 0.8), rgba(15, 52, 96, 0.92));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.encrypted-chat-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffd8df;
}

.encrypted-chat-card h2 {
    margin-top: 1rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.encrypted-chat-card p {
    margin-top: 0.85rem;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.6;
}

.encrypted-chat-meta {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.86rem;
}

.encrypted-chat-actions {
    margin-top: 1.4rem;
    display: flex;
    justify-content: center;
}

.admin-user-info-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-user-info-heading p {
    margin-top: 0.35rem;
    color: var(--text-muted);
}

.admin-user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.admin-user-info-card,
.admin-user-info-section {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-user-info-card h4,
.admin-user-info-section h4 {
    margin-bottom: 0.65rem;
}

.admin-user-info-card p {
    margin-bottom: 0.4rem;
    line-height: 1.45;
}

.admin-user-info-section pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
    line-height: 1.45;
}

.admin-user-event {
    margin-top: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
}

.admin-user-event summary {
    display: flex;
    gap: 0.8rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.82rem;
    flex-wrap: wrap;
}

/* Chat input */
.chat-input {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex: 0 0 auto;
    gap: 0.75rem;
    align-items: flex-end;
    background: var(--bg);
}

#message-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    outline: none;
}

#message-input:focus {
    border-color: var(--accent);
}

.reasoning-mode-control {
    display: inline-flex;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
}

.reasoning-mode-control label {
    position: relative;
    cursor: pointer;
}

.reasoning-mode-control input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.reasoning-mode-control span {
    display: block;
    padding: 0.75rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.15;
    transition:
        background 120ms ease,
        color 120ms ease;
}

.reasoning-mode-control label + label span {
    border-left: 1px solid var(--border);
}

.reasoning-mode-control input:checked + span {
    background: var(--accent);
    color: white;
}

.reasoning-mode-control input:focus-visible + span {
    box-shadow: inset 0 0 0 2px var(--text);
}

.reasoning-mode-control input:disabled + span {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-send {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-send:hover { opacity: 0.9; }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 18, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-card {
    width: min(38rem, 100%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.modal-card-wide {
    width: min(72rem, 100%);
}

#user-settings-modal .modal-card {
    max-height: calc(100dvh - 3rem);
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal-copy {
    color: var(--text-muted);
    margin: 0.75rem 0 1rem;
}

.model-picker-options {
    display: grid;
    gap: 0.75rem;
}

.auth-telemetry-list {
    max-height: 65vh;
    overflow: auto;
    display: grid;
    gap: 0.75rem;
}

.auth-telemetry-item {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}

.auth-telemetry-title {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.auth-telemetry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    margin-bottom: 0.55rem;
    color: var(--text-muted);
    font-size: 0.77rem;
}

.auth-telemetry-pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.74rem;
    line-height: 1.45;
    color: #d7def8;
}

.model-option {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.model-option:hover {
    border-color: var(--accent);
}

.model-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.model-option-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.model-option-description {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.model-option-error {
    margin-top: 0.5rem;
    color: #f4a3a3;
    font-size: 0.8rem;
}

.status-pill {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-pill.healthy {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
}

.status-pill.unhealthy {
    background: rgba(233, 69, 96, 0.18);
    color: #ff8ca0;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.settings-label {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.settings-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.settings-current {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.settings-secondary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding-top: 0.2rem;
}

.settings-input,
.settings-textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
}

.settings-textarea {
    resize: vertical;
}

.settings-input:focus,
.settings-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-size: 0.9rem;
}

.settings-toggle input {
    width: 1rem;
    height: 1rem;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

.settings-help {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.settings-error {
    color: #ffb8c5;
    font-size: 0.82rem;
    line-height: 1.4;
}

.private-badge {
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255, 140, 160, 0.45);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.22), rgba(255, 140, 160, 0.18));
    color: #ffd3db;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.executable-badge {
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(79, 195, 247, 0.38);
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.14);
    color: #8ddcff;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#chat-screen.private-chat .chat-main {
    background:
        radial-gradient(circle at top right, rgba(255, 140, 160, 0.15), transparent 32%),
        radial-gradient(circle at bottom left, rgba(233, 69, 96, 0.14), transparent 28%);
}

#chat-screen.private-chat .conversation-header {
    border-bottom: 1px solid rgba(255, 140, 160, 0.18);
}

#chat-screen.private-chat #message-input {
    border-color: rgba(255, 140, 160, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 140, 160, 0.08);
}

#chat-screen.private-chat .journal-editor {
    border-color: rgba(255, 140, 160, 0.24);
}

.creative-search-open {
    border-color: rgba(168, 129, 255, 0.42);
    background: rgba(118, 78, 190, 0.16);
    color: #ded0ff;
}

.creative-search-eyebrow {
    margin-bottom: 0.25rem;
    color: #bda5ff;
    font-size: 0.68rem;
    font-weight: 760;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.creative-search-panel {
    flex: 0 0 auto;
    max-height: min(46rem, 72vh);
    margin: 0.7rem 1rem 0;
    padding: 0.9rem;
    overflow: auto;
    border: 1px solid rgba(168, 129, 255, 0.3);
    border-radius: 14px;
    background:
        radial-gradient(circle at top left, rgba(118, 78, 190, 0.18), transparent 34%),
        rgba(12, 18, 39, 0.94);
    box-shadow: 0 14px 40px rgba(5, 6, 18, 0.28);
}

.creative-search-panel-header,
.creative-search-panel-actions,
.creative-search-section-heading,
.creative-search-run-meta,
.creative-search-steer,
.creative-search-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.creative-search-panel-header h3 {
    font-size: 1rem;
}

.creative-search-status {
    padding: 0.28rem 0.62rem;
    border: 1px solid rgba(255, 216, 154, 0.3);
    border-radius: 999px;
    color: #ffd89a;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.creative-search-status.succeeded { color: #a6e3a1; border-color: rgba(166, 227, 161, 0.3); }
.creative-search-status.failed,
.creative-search-status.cancelled { color: #ff9cad; border-color: rgba(255, 156, 173, 0.3); }

.creative-search-workspace {
    display: grid;
    grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 0.85rem;
}

.creative-search-rankings,
.creative-search-selected {
    min-width: 0;
}

.creative-search-rankings {
    align-self: start;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    background: rgba(5, 8, 20, 0.42);
}

.creative-search-rankings-heading,
.creative-search-ranking-pagination,
.creative-search-reproduction-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.creative-search-rankings-heading {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.creative-search-rankings-heading strong,
.creative-search-rankings-heading span {
    display: block;
}

.creative-search-rankings-heading strong {
    color: var(--text);
    font-size: 0.82rem;
}

.creative-search-rankings-heading div > span {
    margin-top: 0.14rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    line-height: 1.3;
}

.creative-search-refresh {
    display: grid;
    flex: 0 0 auto;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(168, 129, 255, 0.36);
    border-radius: 999px;
    background: rgba(118, 78, 190, 0.14);
    color: #d8c8ff;
    cursor: pointer;
}

.creative-search-refresh:hover { background: rgba(118, 78, 190, 0.28); }
.creative-search-refresh:disabled { cursor: wait; opacity: 0.8; }
.creative-search-refresh.is-refreshing span { animation: creative-search-spin 700ms linear infinite; }

.creative-search-ranking-list {
    display: flex;
    flex-direction: column;
}

.creative-search-ranking-row {
    display: grid;
    grid-template-columns: 1.5rem 3.25rem minmax(0, 1fr);
    gap: 0.55rem;
    width: 100%;
    padding: 0.52rem 0.65rem;
    align-items: center;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
}

.creative-search-ranking-row:hover { background: rgba(255, 255, 255, 0.035); }
.creative-search-ranking-row.active {
    background: linear-gradient(90deg, rgba(118, 78, 190, 0.28), rgba(118, 78, 190, 0.08));
    box-shadow: inset 3px 0 #a881ff;
}

.creative-search-rank-number {
    color: #cbb9f5;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.creative-search-ranking-thumb {
    display: block;
    width: 3.25rem;
    height: 3.25rem;
    overflow: hidden;
    border-radius: 7px;
    background: #060813;
}

.creative-search-ranking-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creative-search-ranking-thumb-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(168, 129, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.creative-search-ranking-copy,
.creative-search-ranking-copy strong,
.creative-search-ranking-copy span,
.creative-search-ranking-copy small {
    display: block;
    min-width: 0;
}

.creative-search-ranking-copy strong {
    overflow: hidden;
    color: #ece8f7;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creative-search-ranking-copy span {
    margin-top: 0.12rem;
    color: #cbb9f5;
    font-size: 0.68rem;
    font-weight: 700;
}

.creative-search-ranking-copy small {
    margin-top: 0.14rem;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.59rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creative-search-ranking-empty {
    padding: 1.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: center;
}

.creative-search-ranking-pagination {
    padding: 0.48rem 0.65rem;
    color: var(--text-muted);
    font-size: 0.64rem;
}

.creative-search-ranking-pagination .btn-text { padding: 0.25rem; }
.creative-search-ranking-pagination .btn-text:disabled { opacity: 0.35; }

.creative-search-selected {
    display: grid;
    grid-template-columns: minmax(11rem, 16rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.creative-search-preview {
    min-height: 10rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    background: #060813;
}

.creative-search-preview img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 16rem;
    object-fit: contain;
}

.creative-search-preview-placeholder {
    display: grid;
    min-height: 10rem;
    padding: 1rem;
    place-items: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: center;
}

.creative-search-run-copy {
    min-width: 0;
}

.creative-search-run-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.creative-search-run-summary {
    margin: 0.6rem 0;
    color: #dce1ef;
    font-size: 0.84rem;
    line-height: 1.45;
}

.creative-search-evaluations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.4rem;
}

.creative-search-evaluation {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 0.7rem;
}

.creative-search-evaluation strong { display: block; margin-bottom: 0.18rem; color: var(--text); }
.creative-search-evaluation.passed strong { color: #a6e3a1; }
.creative-search-evaluation.failed strong { color: #ff9cad; }
.creative-search-evaluation.uncertain strong { color: #ffd89a; }

.creative-search-reproduction {
    margin-top: 0.7rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(3, 5, 13, 0.5);
}

.creative-search-reproduction summary {
    padding: 0.6rem 0.7rem;
    color: #d8c8ff;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 750;
}

.creative-search-reproduction-heading {
    padding: 0 0.7rem 0.55rem;
    align-items: flex-start;
}

.creative-search-reproduction-heading p {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.64rem;
    line-height: 1.4;
}

.creative-search-reproduction-heading .btn-text { flex: 0 0 auto; padding: 0.2rem; }
#creative-search-copy-status { color: #a6e3a1; font-size: 0.62rem; }

.creative-search-reproduction pre {
    max-height: 18rem;
    margin: 0;
    padding: 0.75rem;
    overflow: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.28);
    color: #d7dbe7;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.62rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.creative-search-provenance {
    padding: 0.5rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.58rem;
    line-height: 1.35;
}

.creative-search-steer {
    justify-content: flex-start;
    margin-top: 0.7rem;
}

.creative-search-steer .settings-input { flex: 1; padding: 0.55rem 0.7rem; }

.creative-search-modal-card {
    max-height: 92vh;
    overflow: auto;
}

.creative-search-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 10rem;
    padding: 1.25rem;
    border: 1px solid rgba(168, 129, 255, 0.22);
    border-radius: 12px;
    background: rgba(118, 78, 190, 0.08);
}

.creative-search-loading p {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.creative-search-orbit {
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(189, 165, 255, 0.22);
    border-top-color: #bda5ff;
    border-radius: 50%;
    animation: creative-search-spin 900ms linear infinite;
}

@keyframes creative-search-spin { to { transform: rotate(360deg); } }

.creative-search-form {
    display: grid;
    gap: 1rem;
}

.creative-search-questions {
    padding: 0.7rem 0.85rem;
    border-left: 3px solid #ffd89a;
    border-radius: 4px 9px 9px 4px;
    background: rgba(255, 216, 154, 0.08);
    color: #ffe6bd;
    font-size: 0.8rem;
    line-height: 1.5;
}

.creative-search-brief-grid,
.creative-search-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.creative-search-brief-grid label,
.creative-search-controls-grid > label,
.creative-search-control-group {
    display: grid;
    gap: 0.35rem;
}

.creative-search-time-only {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.creative-search-brief-prompt { grid-column: 1 / -1; }

.creative-search-identity-note {
    margin: -0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.creative-search-criteria-section,
.creative-search-advanced {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
}

.creative-search-section-heading { align-items: flex-end; }
.creative-search-section-heading h4 { margin-top: 0.2rem; font-size: 0.95rem; }
.creative-search-section-note { max-width: 22rem; color: var(--text-muted); font-size: 0.72rem; text-align: right; }

.creative-search-criteria {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.creative-search-criterion {
    display: grid;
    grid-template-columns: minmax(8rem, 0.7fr) minmax(12rem, 1.6fr) auto auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.55rem;
    border-radius: 9px;
    background: rgba(10, 12, 28, 0.48);
}

.creative-search-criterion .settings-input { padding: 0.55rem 0.65rem; font-size: 0.78rem; }
.creative-search-criterion textarea { min-height: 3.2rem; resize: vertical; }
.creative-search-criterion-toggle { display: flex; align-items: center; gap: 0.3rem; color: var(--text-muted); font-size: 0.72rem; }
.creative-search-confidence { width: 5rem; }

.creative-search-advanced summary {
    color: #d9d0f3;
    cursor: pointer;
    font-size: 0.82rem;
}

.creative-search-mutable-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    margin-top: 0.7rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.creative-search-mutable-controls label { display: flex; align-items: center; gap: 0.3rem; }
.creative-search-submit-row { align-items: center; }
.creative-search-submit-row span { max-width: 34rem; color: var(--text-muted); font-size: 0.74rem; line-height: 1.4; }

@media (max-width: 1100px) {
    .content-workspace {
        flex-direction: column;
    }

    .journal-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .journal-toolbar-actions {
        justify-content: flex-start;
    }

    .journal-pane {
        padding-right: 2rem;
    }

    .journal-analysis-panel {
        width: 100%;
        flex-basis: auto;
        min-width: 0;
        min-height: 20rem;
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .media-analysis-panel .media-transcript {
        flex-basis: auto;
        max-height: none;
    }

    .generation-layout,
    .generation-identity-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .attached-media-heading-copy {
        display: grid;
        gap: 0.1rem;
    }

    .generation-identity-reference-choice,
    .generation-reference-sheet-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .generation-reference-sheet-builder-layout {
        grid-template-columns: 1fr;
    }

    .generation-reference-sheet-source {
        grid-template-columns: 3rem minmax(0, 1fr);
    }

    .generation-reference-sheet-source img {
        width: 3rem;
        height: 3rem;
    }

    .generation-reference-sheet-source-actions {
        grid-column: 1 / -1;
    }

    #chat-form {
        flex-wrap: wrap;
    }

    #chat-form #message-input {
        order: -1;
        flex-basis: 100%;
        font-size: 1rem;
    }

    #chat-form {
        padding: 0.75rem 0.75rem max(0.75rem, env(safe-area-inset-bottom));
        gap: 0.55rem;
    }

    #chat-form > button,
    #chat-form .reasoning-mode-control {
        min-height: 2.75rem;
    }

    .generation-pane {
        padding: 1rem;
    }

    .generation-hero,
    .generation-prompt-meta,
    .generation-rewrite-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .generation-control-grid {
        grid-template-columns: 1fr;
    }

    .generation-conditioning-grid,
    .generation-identity-use {
        grid-template-columns: 1fr;
    }

    .generation-video-slot {
        grid-column: auto;
    }

    .generation-slot-controls,
    .generation-keyframes {
        align-items: stretch;
        flex-direction: column;
    }

    .generation-keyframe-row {
        grid-template-columns: 1fr;
    }

    .creative-search-panel { margin-inline: 0.6rem; max-height: 65vh; }
    .creative-search-workspace,
    .creative-search-selected,
    .creative-search-brief-grid,
    .creative-search-controls-grid { grid-template-columns: 1fr; }
    .creative-search-brief-prompt { grid-column: auto; }
    .creative-search-criterion { grid-template-columns: 1fr; }
    .creative-search-panel-header,
    .creative-search-section-heading,
    .creative-search-submit-row { align-items: flex-start; flex-direction: column; }
    .creative-search-section-note { text-align: left; }

    .media-pagination {
        grid-template-columns: 1fr auto 1fr;
        gap: 0.45rem;
    }

    .media-pagination .btn-secondary {
        min-height: 2.75rem;
        padding-inline: 0.75rem;
    }

    .media-pagination-status {
        white-space: normal;
    }

    .media-attach-modal,
    .generation-image-picker-modal {
        align-items: stretch;
        padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem max(0.5rem, env(safe-area-inset-bottom));
    }

    .media-attach-card,
    .generation-image-picker-card {
        width: 100%;
        max-height: 100%;
        padding: 1rem;
    }

    .media-attach-modal.source-only {
        align-items: center;
    }

    .media-attach-modal.source-only .media-attach-card {
        max-height: none;
    }

    .generation-image-picker-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .generation-image-picker-filters,
    .generation-image-picker-filters .btn-secondary,
    #generation-image-picker-file {
        width: 100%;
    }

    .media-attach-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 0.65rem;
    }

    .media-attach-actions {
        justify-content: flex-start;
    }

    .media-attach-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-height: 0;
    }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(86vw, 22rem);
        min-width: 0;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        padding-bottom: env(safe-area-inset-bottom);
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 18px 0 48px rgba(0, 0, 0, 0.45);
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    .mobile-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        flex: 0 0 auto;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 50;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border: 0;
        background: rgba(6, 6, 14, 0.72);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.mobile-sidebar-open .mobile-sidebar-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-chat-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-height: 3.5rem;
        flex: 0 0 auto;
        padding: max(0.5rem, env(safe-area-inset-top)) 0.85rem 0.5rem;
        border-bottom: 1px solid var(--border);
        background: var(--bg);
    }

    .mobile-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        flex: 0 0 auto;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--input-bg);
        color: var(--text);
        font-size: 1.25rem;
        cursor: pointer;
    }

    .mobile-chat-title {
        color: var(--text);
        font-size: 1rem;
        font-weight: 650;
    }

    .chat-main {
        width: 100%;
    }

    .conversation-header {
        padding: 0.75rem 0.85rem 0.4rem;
    }

    .messages {
        min-height: 0;
        padding: 0.85rem;
        overscroll-behavior: contain;
    }

    .chat-status {
        margin-inline: 0.85rem;
    }

    .chat-attached-media {
        margin-inline: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .mobile-sidebar-scrim {
        transition: none;
    }
}

.model-option-runtime {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}
