:root {
    color-scheme: dark;
    --bg: #060817;
    --panel: rgba(13, 17, 35, 0.78);
    --panel-strong: rgba(16, 21, 43, 0.96);
    --soft: rgba(255,255,255,0.045);
    --border: rgba(255,255,255,0.10);
    --border-strong: rgba(255,255,255,0.18);
    --text: #f6f8ff;
    --muted: #9ba5be;
    --faint: #6f7890;
    --accent: #9c8cff;
    --accent2: #69e0ef;
    --good: #6ee7b7;
    --warn: #f7c96a;
    --danger: #ff8299;
    --shadow: 0 26px 90px rgba(0,0,0,0.34);
}

body[data-mode="assistant"] { --accent: #9c8cff; --accent2: #69e0ef; }
body[data-mode="study"] { --accent: #67e8f9; --accent2: #60a5fa; }
body[data-mode="coding"] { --accent: #6ee7b7; --accent2: #5eead4; }
body[data-mode="research"] { --accent: #f7c96a; --accent2: #fb7185; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #040611; }
body {
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%),
        linear-gradient(180deg, #090b1b 0%, var(--bg) 48%, #050611 100%);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, textarea, select { color: var(--text); }

.ambient { position: fixed; pointer-events: none; z-index: 0; filter: blur(100px); opacity: .15; border-radius: 999px; }
.ambient-a { width: 390px; height: 390px; background: var(--accent); left: -170px; top: 10%; }
.ambient-b { width: 440px; height: 440px; background: var(--accent2); right: -220px; top: 24%; }
.glass { background: var(--panel); border: 1px solid var(--border); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }

/* Desktop */
.desktop-app { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr) 278px; gap: 12px; padding: 12px; }
.desktop-sidebar, .desktop-context { min-height: calc(100vh - 24px); border-radius: 24px; padding: 18px; }
.desktop-sidebar { display: flex; flex-direction: column; gap: 15px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.ved-logo, .mobile-logo, .startup-logo { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #070916; font-weight: 900; box-shadow: 0 10px 34px color-mix(in srgb, var(--accent) 25%, transparent); }
.ved-logo { width: 44px; height: 44px; border-radius: 15px; }
.primary-soft, .full-primary, .compact-action, .icon-action, .profile-button, .mobile-tool, .mobile-setting-card, .danger-outline, .close-button, .send-button, .mic-button { border: 1px solid var(--border); color: var(--text); }
.primary-soft { padding: 11px 13px; border-radius: 13px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--accent2) 7%, transparent)); text-align: left; }
.desktop-nav { display: grid; gap: 5px; }
.desktop-nav button { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 9px; width: 100%; padding: 9px; border: 1px solid transparent; border-radius: 12px; color: var(--text); background: transparent; text-align: left; }
.desktop-nav button:hover { background: var(--soft); border-color: var(--border); }
.desktop-nav strong, .desktop-nav small { display: block; }
.desktop-nav small { color: var(--muted); font-size: .68rem; margin-top: 2px; }
.section-title { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; }
.section-title button { width: 27px; height: 27px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.chat-list { min-height: 0; max-height: 44vh; overflow-y: auto; display: grid; gap: 4px; }
.chat-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px; }
.chat-button { min-width: 0; padding: 8px 9px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-button.active, .chat-button:hover { color: var(--text); background: var(--soft); border-color: var(--border); }
.chat-delete { width: 29px; border: 0; border-radius: 9px; color: var(--faint); background: transparent; }
.chat-delete:hover { color: var(--danger); }
.runtime-mini { margin-top: auto; padding: 11px; border-radius: 13px; background: rgba(255,255,255,.03); display: grid; gap: 7px; }
.runtime-mini > div { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: .68rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.desktop-main { min-width: 0; min-height: calc(100vh - 24px); border-radius: 24px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; background: rgba(7,9,22,.42); border: 1px solid rgba(255,255,255,.05); }
.desktop-topbar { min-height: 68px; padding: 12px 17px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,.055); }
.desktop-topbar h1, .desktop-topbar p { margin: 0; }
.desktop-topbar h1 { font-size: 1rem; }
.desktop-topbar p { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.mode-select-wrap { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); }
.mode-select-wrap > span { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.mode-select, .mobile-mode-select { border: 0; outline: 0; background: transparent; color: var(--text); font-weight: 700; }
.mode-select option, .mobile-mode-select option { color: #111827; background: #fff; }
.compact-action, .icon-action { min-height: 38px; border-radius: 12px; background: var(--soft); }
.compact-action { padding: 0 11px; }
.compact-action.active, .context-chip.active, .mobile-tool.active { border-color: color-mix(in srgb, var(--accent2) 45%, transparent); background: color-mix(in srgb, var(--accent2) 10%, transparent); color: #c5f7ff; }
.icon-action { width: 39px; }
.profile-button { width: 39px; height: 39px; border-radius: 50%; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, #14172f), #12162c); font-weight: 800; }
.messages { width: min(920px,100%); margin: 0 auto; }
.desktop-messages { padding: 28px 22px 178px; }
.message { display: flex; gap: 10px; margin-bottom: 18px; }
.user-message { justify-content: flex-end; }
.message-avatar { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg,var(--accent),var(--accent2)); color:#070916; font-weight:900; }
.bubble { max-width: min(720px,88%); padding: 12px 14px; border: 1px solid rgba(255,255,255,.075); border-radius: 16px; background: rgba(255,255,255,.045); line-height: 1.55; overflow-wrap: anywhere; }
.user-message .bubble { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 72%, #1f2f70), color-mix(in srgb, var(--accent2) 38%, #26386f)); }
.bubble p { margin: 4px 0 0; white-space: pre-wrap; }
.message-label { color: #aaa7d8; font-size: .68rem; letter-spacing: .04em; }
.inline-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.source-chip { max-width: 100%; padding: 5px 8px; border: 1px solid rgba(105,224,239,.18); border-radius: 999px; color: #bff3fa; background: rgba(105,224,239,.055); text-decoration: none; font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-welcome { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; }
.welcome-orb { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 25px; background: linear-gradient(135deg,var(--accent),var(--accent2)); color:#070916; font-weight:900; font-size:1.5rem; box-shadow:0 18px 60px color-mix(in srgb,var(--accent) 28%,transparent); }
.empty-welcome h2 { margin: 18px 0 7px; font-size: clamp(1.8rem,3vw,2.7rem); letter-spacing: -.035em; }
.empty-welcome p { margin: 0; color: var(--muted); max-width: 610px; line-height: 1.55; }
.desktop-composer-wrap { position: sticky; bottom: 0; padding: 9px 20px 17px; background: linear-gradient(to top,rgba(5,6,17,.98) 72%,rgba(5,6,17,0)); }
.context-row { width: min(920px,100%); margin: 0 auto 7px; display: flex; gap: 7px; flex-wrap: wrap; }
.context-chip { min-height: 35px; display: flex; align-items:center; gap:7px; padding:4px 8px; border:1px solid var(--border); border-radius:11px; background:var(--soft); color:var(--text); }
.context-chip strong { max-width: 280px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:.7rem; }
.context-chip button { width:22px; height:22px; border:0; border-radius:7px; color:var(--muted); background:rgba(255,255,255,.05); }
.context-chip.clickable { cursor:pointer; }
.composer { width: min(920px,100%); margin:0 auto; display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:end; gap:8px; padding:8px; border-radius:20px; box-shadow:var(--shadow); }
.composer textarea { width:100%; min-height:44px; max-height:170px; resize:none; border:0; outline:0; padding:10px 4px 7px; color:var(--text); background:transparent; }
.composer textarea::placeholder, input::placeholder, textarea::placeholder { color:#6e7790; }
.mic-button, .send-button { width:44px; height:44px; border-radius:14px; }
.mic-button { background:var(--soft); }
.mic-button span { color:var(--accent); font-size:.72rem; }
.mic-button.recording { background:rgba(255,89,126,.12); border-color:rgba(255,105,139,.55); }
.send-button { border-color:transparent; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#070916; font-weight:900; font-size:1.1rem; }
.composer-caption { width:min(920px,100%); margin:6px auto 0; display:flex; justify-content:space-between; color:var(--faint); font-size:.62rem; }
.desktop-context { display:flex; flex-direction:column; gap:10px; }
.context-heading small { color:#aaa7d8; font-size:.62rem; letter-spacing:.12em; }
.context-heading h2 { margin:5px 0 2px; font-size:1.08rem; }
.lens-card { display:grid; grid-template-columns:33px 1fr; gap:9px; align-items:center; padding:10px; border:1px solid rgba(255,255,255,.07); border-radius:13px; background:rgba(255,255,255,.028); }
.lens-card > span { width:31px; height:31px; display:grid; place-items:center; border-radius:10px; background:var(--soft); color:var(--accent2); }
.lens-card small, .lens-card strong { display:block; }
.lens-card small { color:var(--muted); font-size:.61rem; }
.lens-card strong { margin-top:2px; font-size:.72rem; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.source-panel { min-height:0; display:flex; flex-direction:column; gap:7px; }
.count { min-width:22px; height:22px; display:grid; place-items:center; border-radius:999px; background:rgba(105,224,239,.08); color:#bdf3fb; }
.source-list { max-height:40vh; overflow:auto; display:grid; gap:6px; }
.source-card { display:block; padding:9px; border:1px solid rgba(255,255,255,.07); border-radius:12px; color:var(--text); background:rgba(255,255,255,.026); text-decoration:none; }
.source-card strong, .source-card span { display:block; }
.source-card strong { font-size:.7rem; line-height:1.35; }
.source-card span { margin-top:3px; color:var(--muted); font-size:.61rem; line-height:1.35; }
.user-card { margin-top:auto; display:grid; grid-template-columns:34px 1fr; gap:9px; align-items:center; padding:10px; border-radius:13px; background:var(--soft); }
.mini-avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#070916; font-weight:900; }
.user-card strong, .user-card small { display:block; }
.user-card strong { font-size:.72rem; }
.user-card small { color:var(--muted); font-size:.61rem; margin-top:2px; }

/* Mobile: dedicated interface */
.mobile-app { display:none; }

/* dialogs */
.ved-dialog { width:min(520px,calc(100vw - 24px)); max-height:min(88vh,820px); padding:0; border:1px solid var(--border-strong); border-radius:21px; color:var(--text); background:rgba(10,13,29,.97); box-shadow:0 30px 100px rgba(0,0,0,.5); }
.ved-dialog::backdrop { background:rgba(2,3,9,.78); backdrop-filter:blur(7px); }
.wide-dialog { width:min(700px,calc(100vw - 24px)); }
.dialog-inner { padding:20px; overflow:auto; }
.dialog-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.dialog-top small { color:#aaa7d8; font-size:.62rem; letter-spacing:.12em; }
.dialog-top h2 { margin:4px 0 0; }
.close-button { width:36px; height:36px; border-radius:11px; background:var(--soft); }
.full-primary { width:100%; min-height:43px; border:0; border-radius:12px; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#070916; font-weight:850; }
.danger-outline { width:100%; min-height:42px; border-radius:12px; background:rgba(255,80,116,.05); border-color:rgba(255,110,140,.22); color:#ff9eb1; }
.profile-summary { margin:16px 0; padding:12px; border:1px solid var(--border); border-radius:13px; background:var(--soft); }
.auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:14px 0 10px; }
.auth-tabs button { min-height:39px; border:1px solid var(--border); border-radius:10px; color:var(--muted); background:transparent; }
.auth-tabs button.active { color:var(--text); background:var(--soft); border-color:color-mix(in srgb,var(--accent) 34%,transparent); }
.auth-form { display:grid; gap:9px; }
.auth-form input, .dialog-inner > input, .dialog-inner > textarea, .mobile-field { width:100%; border:1px solid var(--border); border-radius:12px; padding:11px 12px; color:var(--text); background:var(--soft); outline:0; }
.auth-form small { color:var(--muted); line-height:1.4; }
.toggle-row { display:grid; grid-template-columns:auto 1fr; gap:10px; align-items:center; padding:11px; margin-top:9px; border:1px solid var(--border); border-radius:13px; background:var(--soft); }
.toggle-row strong, .toggle-row small { display:block; }
.toggle-row small { color:var(--muted); font-size:.66rem; margin-top:2px; }
.status-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin:14px 0; }
.status-grid > div { padding:9px; border:1px solid var(--border); border-radius:11px; background:var(--soft); }
.status-grid small, .status-grid strong { display:block; }
.status-grid small { color:var(--muted); font-size:.6rem; }
.status-grid strong { margin-top:2px; font-size:.68rem; overflow-wrap:anywhere; }
.shared-library { display:grid; gap:8px; max-height:52vh; overflow:auto; margin:14px 0; }
.library-item { padding:11px; border:1px solid var(--border); border-radius:13px; background:var(--soft); }
.library-item h3, .library-item p { margin:0; }
.library-item h3 { font-size:.8rem; }
.library-item p { margin-top:4px; color:var(--muted); font-size:.7rem; line-height:1.45; white-space:pre-wrap; }
.library-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.library-actions button { border:1px solid var(--border); border-radius:9px; padding:6px 8px; color:var(--muted); background:rgba(255,255,255,.035); }
.library-actions button.danger { color:#ff9daf; }
.inline-status { min-height:1.2em; color:var(--muted); font-size:.7rem; line-height:1.4; }
.startup-gate { position:fixed; inset:0; z-index:100; display:grid; place-items:center; background:#060817; transition:opacity .25s ease, visibility .25s ease; }
.startup-gate.hidden { opacity:0; visibility:hidden; pointer-events:none; }
.startup-card { text-align:center; }
.startup-logo { width:70px; height:70px; margin:0 auto; border-radius:23px; font-size:1.4rem; }
.startup-card h1 { margin:14px 0 5px; }
.startup-card p { margin:0; color:var(--muted); }

@media (max-width: 1180px) and (min-width: 821px) {
    .desktop-app { grid-template-columns:240px minmax(0,1fr); }
    .desktop-context { display:none; }
}

@media (max-width: 820px) {
    html, body { min-height:100%; height:100%; overflow:hidden; }
    body { background:#060817; }
    .ambient { opacity:.10; }
    .desktop-app { display:none !important; }
    .mobile-app { position:relative; z-index:1; height:100dvh; display:grid; grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; }
    .mobile-header { min-height:62px; padding:9px 12px; padding-top:calc(9px + env(safe-area-inset-top)); display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid rgba(255,255,255,.06); background:rgba(7,9,22,.91); backdrop-filter:blur(20px); }
    .mobile-brand { display:flex; align-items:center; gap:9px; min-width:0; }
    .mobile-logo { width:38px; height:38px; border-radius:13px; flex:0 0 auto; }
    .mobile-brand strong, .mobile-brand small { display:block; }
    .mobile-brand strong { font-size:.88rem; }
    .mobile-brand small { margin-top:1px; color:var(--muted); font-size:.61rem; }
    .mobile-header-actions { display:flex; align-items:center; gap:6px; }
    .mobile-mode-select { max-width:94px; min-height:36px; padding:0 7px; border:1px solid var(--border); border-radius:11px; background:var(--soft); font-size:.69rem; }
    .mobile-avatar-button { width:36px; height:36px; border:1px solid var(--border); border-radius:50%; color:var(--text); background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 25%,#11162a),#11152b); font-weight:800; }
    .mobile-content { min-height:0; overflow:hidden; }
    .mobile-page { height:100%; display:none; overflow-y:auto; padding:12px 12px 22px; overscroll-behavior:contain; }
    .mobile-page.active { display:block; }
    .mobile-page-heading { padding:7px 2px 15px; }
    .mobile-page-heading small { color:#aaa7d8; font-size:.61rem; letter-spacing:.12em; }
    .mobile-page-heading h2 { margin:5px 0 5px; font-size:1.45rem; letter-spacing:-.025em; }
    .mobile-page-heading p { margin:0; color:var(--muted); font-size:.76rem; line-height:1.45; }
    .mobile-chat-tools { display:flex; gap:6px; overflow-x:auto; padding-bottom:7px; }
    .mobile-tool { flex:0 0 auto; min-height:34px; padding:0 10px; border-radius:10px; background:var(--soft); font-size:.68rem; }
    .mobile-doc-bar { min-height:37px; display:flex; align-items:center; gap:7px; margin-bottom:6px; padding:5px 8px; border:1px solid color-mix(in srgb,var(--accent) 25%,transparent); border-radius:11px; background:color-mix(in srgb,var(--accent) 7%,transparent); }
    .mobile-doc-bar strong { min-width:0; flex:1; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:.68rem; }
    .mobile-doc-bar button { width:23px; height:23px; border:0; border-radius:7px; color:var(--muted); background:var(--soft); }
    #mobileChatPage { padding-bottom:94px; }
    .mobile-messages { width:100%; padding:8px 1px 108px; }
    .mobile-messages .message { margin-bottom:14px; }
    .mobile-messages .message-avatar { width:29px; height:29px; border-radius:10px; font-size:.75rem; }
    .mobile-messages .bubble { max-width:88%; padding:10px 12px; border-radius:15px; font-size:.86rem; }
    .mobile-messages .user-message .bubble { max-width:88%; }
    .mobile-messages .message-label { font-size:.62rem; }
    .mobile-composer-wrap { position:fixed; left:0; right:0; bottom:64px; z-index:7; padding:7px 8px 6px; background:linear-gradient(to top,rgba(6,8,23,.99) 78%,rgba(6,8,23,0)); }
    .mobile-composer { width:100%; border-radius:18px; padding:7px; box-shadow:0 14px 45px rgba(0,0,0,.33); }
    .mobile-composer textarea { min-height:42px; max-height:120px; font-size:.9rem; }
    .mobile-composer .mic-button, .mobile-composer .send-button { width:42px; height:42px; border-radius:13px; }
    .mobile-status-text { display:block; margin-top:5px; text-align:center; color:var(--faint); font-size:.58rem; }
    .mobile-bottom-nav { min-height:64px; padding:5px 7px calc(5px + env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(5,1fr); gap:3px; border-top:1px solid rgba(255,255,255,.07); background:rgba(8,10,24,.97); backdrop-filter:blur(20px); }
    .mobile-nav-item { min-width:0; border:0; border-radius:12px; color:var(--faint); background:transparent; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; }
    .mobile-nav-item span { font-size:.96rem; }
    .mobile-nav-item small { font-size:.57rem; }
    .mobile-nav-item.active { color:var(--text); background:color-mix(in srgb,var(--accent) 9%,transparent); }
    .voice-stage { min-height:330px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
    .voice-orb { position:relative; width:128px; height:128px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; }
    .voice-ring { position:absolute; inset:4px; border:1px solid color-mix(in srgb,var(--accent) 40%,transparent); border-radius:50%; box-shadow:0 0 0 16px color-mix(in srgb,var(--accent) 4%,transparent), 0 0 70px color-mix(in srgb,var(--accent) 18%,transparent); }
    .voice-core { position:relative; z-index:2; width:82px; height:82px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#070916; font-size:1.1rem; box-shadow:0 18px 55px color-mix(in srgb,var(--accent) 26%,transparent); }
    .voice-orb.recording .voice-ring { animation:voicePulse 1s ease-in-out infinite; border-color:rgba(255,111,145,.7); }
    .voice-orb.recording .voice-core { background:linear-gradient(135deg,#ff7895,#ffb37d); }
    @keyframes voicePulse { 0%,100%{transform:scale(.96);opacity:.55} 50%{transform:scale(1.08);opacity:1} }
    .voice-stage strong { margin-top:14px; }
    .voice-stage p { max-width:300px; margin:5px auto 0; color:var(--muted); font-size:.72rem; line-height:1.45; }
    .voice-card, .mobile-info-card { margin-top:9px; padding:12px; border:1px solid var(--border); border-radius:14px; background:var(--soft); }
    .voice-card small { color:var(--muted); font-size:.61rem; }
    .voice-card p, .mobile-info-card p { margin:5px 0 0; color:var(--muted); font-size:.73rem; line-height:1.45; white-space:pre-wrap; }
    .mobile-upload-card { display:grid; grid-template-columns:42px 1fr; align-items:center; gap:10px; padding:12px; border:1px dashed color-mix(in srgb,var(--accent) 36%,transparent); border-radius:15px; background:color-mix(in srgb,var(--accent) 5%,transparent); cursor:pointer; }
    .mobile-upload-card > span { width:40px; height:40px; display:grid; place-items:center; border-radius:12px; background:var(--soft); }
    .mobile-upload-card strong, .mobile-upload-card small { display:block; }
    .mobile-upload-card small { margin-top:2px; color:var(--muted); font-size:.65rem; }
    .hidden-input { position:absolute; opacity:0; pointer-events:none; width:1px; height:1px; }
    .mobile-library { display:grid; gap:8px; margin-top:12px; }
    .mobile-library .library-item { padding:12px; }
    .mobile-field { margin-bottom:8px; }
    .mobile-settings-grid { display:grid; gap:8px; }
    .mobile-setting-card { width:100%; display:grid; grid-template-columns:38px 1fr; align-items:center; gap:10px; padding:11px; border-radius:14px; background:var(--soft); text-align:left; }
    .mobile-setting-card > span { width:36px; height:36px; display:grid; place-items:center; border-radius:11px; background:rgba(255,255,255,.045); color:var(--accent2); }
    .mobile-setting-card strong, .mobile-setting-card small { display:block; }
    .mobile-setting-card small { margin-top:2px; color:var(--muted); font-size:.65rem; }
    .mobile-info-card { margin-top:12px; }
    .mobile-info-card strong { font-size:.78rem; }
    .empty-welcome { min-height:52vh; padding:15px 10px; }
    .welcome-orb { width:62px; height:62px; border-radius:20px; font-size:1.2rem; }
    .empty-welcome h2 { font-size:1.65rem; margin-top:14px; }
    .empty-welcome p { font-size:.76rem; }
    .ved-dialog { width:calc(100vw - 18px); max-height:86dvh; border-radius:19px; }
    .dialog-inner { padding:17px; }
    .status-grid { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}


.language-select-wrap .language-select {
    min-width: 104px;
}

.voice-settings-card {
    margin: 10px 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
}

.voice-setting-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.voice-setting-heading strong,
.voice-setting-heading small {
    display: block;
}

.voice-setting-heading small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.72rem;
}

.voice-badge {
    padding: 4px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent-2);
    font-size: 0.66rem;
    font-weight: 800;
}

.field-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 0.74rem;
}

.field-row select {
    width: 100%;
    min-height: 39px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.field-row select option {
    color: #101525;
    background: white;
}

.secondary-action {
    width: 100%;
    min-height: 40px;
    margin-top: 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
}

.secondary-action:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

@media (max-width: 820px) {
    .mobile-header-actions {
        gap: 5px;
    }

    .mobile-mode-select {
        max-width: 96px;
    }

    .mobile-language-select {
        max-width: 82px;
        min-width: 70px;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}


.smart-performance-badge {
    margin-top: 18px;
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 2px 7px;
    padding: 9px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--accent) 8%, transparent),
            color-mix(in srgb, var(--accent-2) 5%, transparent)
        );
    box-shadow: 0 10px 38px rgba(0, 0, 0, 0.08);
}

.smart-performance-badge > span {
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--accent-2);
}

.smart-performance-badge strong {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.smart-performance-badge small {
    color: var(--muted);
    font-size: 0.64rem;
}

.mobile-page[data-page="voice"] .voice-orb.recording {
    box-shadow:
        0 0 0 10px color-mix(in srgb, var(--accent) 7%, transparent),
        0 0 55px color-mix(in srgb, var(--accent) 24%, transparent);
}

@media (max-width: 820px) {
    .smart-performance-badge {
        max-width: 92%;
        text-align: left;
    }
}


.security-badge {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.68rem;
    font-weight: 750;
    white-space: nowrap;
}

.security-badge.secure {
    border-color: rgba(110, 231, 183, 0.28);
    background: rgba(110, 231, 183, 0.07);
    color: #a7f3d0;
}

.security-badge.insecure {
    border-color: rgba(245, 201, 106, 0.32);
    background: rgba(245, 201, 106, 0.07);
    color: #f9dfa0;
}

.mobile-security-badge {
    min-width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
}

.mobile-security-badge.secure {
    border-color: rgba(110, 231, 183, 0.28);
    color: #a7f3d0;
    background: rgba(110, 231, 183, 0.07);
}

.mobile-security-badge.insecure {
    border-color: rgba(245, 201, 106, 0.32);
    color: #f9dfa0;
    background: rgba(245, 201, 106, 0.07);
}

@media (max-width: 820px) {
    .mobile-security-badge {
        display: grid;
    }
}
