/* Davo interface refinement: consistent surfaces, readable type and larger touch targets. */

/* Digital character stage. The image remains explicitly identified as a static preview until a rigged model is supplied. */
.welcome { width:min(100% - 54px,1060px); padding:clamp(28px,5vh,54px) 0 32px; display:grid; grid-template-columns:minmax(220px,.42fr) minmax(0,1fr); column-gap:clamp(24px,4vw,54px); align-content:start; }
.welcome-kicker { grid-column:1/-1; grid-row:1; }
.home-avatar { grid-column:1; grid-row:2 / span 5; position:relative; align-self:stretch; min-height:400px; margin:20px 0 0; overflow:hidden; border:1px solid color-mix(in srgb,var(--accent) 24%,var(--line)); border-radius:24px; background:linear-gradient(180deg,rgba(8,14,29,.28),rgba(6,10,19,.84)),url('/assets/avatar/davo-environment.webp') center/cover; box-shadow:0 22px 72px rgba(4,8,20,.36),inset 0 0 40px rgba(80,103,255,.12); }
.avatar-stage,.live-avatar { position:relative; overflow:hidden; }
.avatar-stage { position:absolute; inset:0; }
.avatar-fallback { position:absolute; inset:0; z-index:1; width:100%; height:100%; object-fit:contain; object-position:center bottom; filter:drop-shadow(0 14px 28px rgba(0,0,0,.38)); }
.avatar-stage .avatar-fallback { left:-20%; width:140%; height:80%; }
.home-avatar::after { content:""; position:absolute; z-index:2; inset:auto 0 0; height:116px; pointer-events:none; background:linear-gradient(180deg,transparent,rgba(5,10,20,.86)); }
.avatar-canvas { position:absolute; inset:0; width:100%; height:100%; z-index:2; }
.avatar-ring { position:absolute; z-index:0; left:12%; right:12%; bottom:5%; height:25px; border:1px solid rgba(88,150,255,.9); border-radius:50%; box-shadow:0 0 15px rgba(91,111,255,.84),inset 0 0 10px rgba(91,111,255,.45); }
.avatar-preview-label { position:absolute; z-index:3; left:18px; right:18px; bottom:17px; display:grid; gap:4px; color:#fff; text-shadow:0 2px 12px #07111f; }
.avatar-preview-label span { color:#89b9ff; font-size:8px; font-weight:700; letter-spacing:.16em; }
.avatar-preview-label strong { font-size:19px; font-weight:560; letter-spacing:-.03em; }
.avatar-preview-label small { color:rgba(235,241,255,.75); font-size:9px; }
.avatar-toggle,.avatar-motion,.avatar-minimize { position:absolute; z-index:4; top:12px; min-height:34px; padding:0 11px; border:1px solid rgba(196,208,244,.2); border-radius:999px; background:rgba(8,14,29,.72); color:#eef2ff; backdrop-filter:blur(10px); font-size:9px; }
.avatar-toggle { left:12px; }.avatar-motion { right:12px; }.avatar-minimize { right:12px; top:54px; }
.home-avatar.avatar-hidden .avatar-stage,.home-avatar.avatar-hidden .avatar-preview-label { opacity:0; visibility:hidden; }
.home-avatar.avatar-hidden { min-height:60px; background:rgba(10,15,28,.4); }
.home-avatar.avatar-hidden .avatar-toggle { top:12px; }
.home-avatar.avatar-minimized { grid-row:2; min-height:180px; }
.home-avatar.avatar-minimized .avatar-stage .avatar-fallback { height:75%; }
.home-avatar.motion-off .avatar-ring { animation:none; }
.live-avatar { width:min(100%,320px); height:clamp(250px,36vh,340px); margin:0 auto 3px; }
.live-avatar-label { position:relative; inset:auto; margin:0 auto 4px; text-align:center; }
.live-avatar-label strong { display:none; }
.voice-view.with-avatar .voice-stage .voice-halo { display:none; }
.voice-stage:has(.live-avatar) { min-height:0; padding:10px 0; }
.voice-stage .avatar-ring { left:22%; right:22%; height:18px; }
.welcome .hero-mark { grid-column:2; grid-row:2; margin-top:34px; }
.welcome h1 { grid-column:2; grid-row:3; align-self:end; margin-top:0; font-size:clamp(32px,2.4vw,36px); }
.welcome .hero-copy { grid-column:2; grid-row:4; }
.welcome .composer-wrap { grid-column:2; grid-row:5; width:100%; }
.welcome .suggestions { grid-column:2; grid-row:6; }
.welcome .home-footer,.welcome .voice-shortcut { grid-column:1/-1; }
.welcome .home-footer { margin-top:25px; }
@media(max-width:760px) {
  .welcome { display:flex; flex-direction:column; width:min(100% - 30px,520px); padding:20px 0 calc(82px + var(--safe-b)); gap:0; }
  .home-avatar { order:1; width:100%; min-height:clamp(185px,31vh,270px); margin:14px 0 18px; border-radius:19px; }
  .home-avatar.avatar-minimized { min-height:150px; }
  .welcome-kicker { order:0; }
  .welcome .hero-mark { display:none; }
  .welcome h1 { order:2; margin:0; font-size:clamp(27px,7vw,34px); }
  .welcome .hero-copy { order:3; margin:7px 0 17px; }
  .welcome .composer-wrap { order:4; }
  .welcome .suggestions { order:5; }
  .welcome .home-footer { order:6; }
  .welcome .voice-shortcut { order:7; }
  .avatar-toggle,.avatar-motion { min-height:32px; }
  .avatar-minimize { min-height:32px; top:auto; bottom:10px; right:12px; }
  .avatar-preview-label { left:13px; right:13px; bottom:12px; }
  .avatar-preview-label strong { font-size:15px; }
  .avatar-stage .avatar-fallback { left:-8%; width:116%; }
  .avatar-stage .avatar-fallback { height:83%; }
  .live-avatar { width:min(100%,270px); height:clamp(160px,25vh,220px); }
}
@media(max-width:380px) {
  .welcome { width:calc(100% - 24px); padding-top:16px; }
  .home-avatar { min-height:178px; }
  .avatar-preview-label small { font-size:8px; }
}
@media(prefers-reduced-motion:reduce) { .avatar-ring { animation:none!important; } }

.knowledge-view { width: min(100%, 860px); margin: 0 auto; padding: 34px clamp(16px, 4vw, 42px) 48px; animation: view-enter 260ms ease-out both; }
.voice-shortcut { display:flex; align-items:center; gap:13px; width:min(100%,350px); min-height:58px; margin:16px auto 0; padding:10px 14px; border:1px solid color-mix(in srgb,var(--accent) 28%,var(--line)); border-radius:16px; background:linear-gradient(120deg,color-mix(in srgb,var(--surface) 92%,var(--accent) 8%),var(--surface)); box-shadow:0 10px 32px rgba(9,10,20,.12); color:var(--text); text-align:left; }
.voice-shortcut-icon { display:grid; place-items:center; width:34px; height:34px; border-radius:12px; background:var(--accent-wash); color:var(--accent); font-size:19px; }
.voice-shortcut > span:nth-child(2) { display:grid; gap:2px; flex:1; }
.voice-shortcut strong { font-size:12px; font-weight:650; }
.voice-shortcut small { color:var(--muted); font-size:10px; }
.voice-shortcut > span:last-child { color:var(--accent); }
.voice-view { display:flex; flex-direction:column; width:min(100%,800px); min-height:100%; margin:0 auto; padding:clamp(14px,3vh,30px) clamp(16px,4vw,40px) 28px; }
.voice-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.live-avatar-toggle { min-height:34px; padding:0 11px; border:1px solid var(--line-strong); border-radius:999px; background:var(--surface); color:var(--text); font-size:9px; }
.voice-heading .eyebrow { color:var(--muted); font-size:9px; letter-spacing:.15em; }
.voice-stage { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; min-height:290px; text-align:center; }
.voice-halo { display:grid; place-items:center; width:clamp(170px,32vw,230px); aspect-ratio:1; margin:8px auto 22px; border-radius:50%; background:radial-gradient(circle,color-mix(in srgb,var(--accent) calc(7% + var(--voice-energy,0)*12%),transparent) 0 37%,color-mix(in srgb,var(--accent) 9%,transparent) 38% 58%,transparent 72%); transition:background 100ms linear; }
.voice-orb { display:grid; place-items:center; width:clamp(112px,22vw,152px); aspect-ratio:1; border:1px solid color-mix(in srgb,var(--accent) 42%,var(--line)); border-radius:50%; background:radial-gradient(circle at 35% 28%,color-mix(in srgb,var(--accent) 30%,var(--surface)),var(--surface) 66%); box-shadow:0 0 calc(16px + var(--voice-energy,0)*34px) color-mix(in srgb,var(--accent) calc(12% + var(--voice-energy,0)*24%),transparent),inset 0 0 34px color-mix(in srgb,var(--accent) 10%,transparent); transform:scale(calc(1 + var(--voice-energy,0)*.055)); transition:transform 70ms linear,box-shadow 100ms linear,border-color var(--motion); }
.voice-orb-mark { color:var(--text); font-size:48px; font-weight:420; letter-spacing:-.09em; }
.voice-orb[data-state="listening"] { border-color:color-mix(in srgb,#67c9b1 55%,var(--line)); }
.voice-orb[data-state="speaking"] { border-color:color-mix(in srgb,var(--accent) 78%,var(--line)); }
.voice-orb[data-state="reconnecting"],.voice-orb[data-state="unavailable"] { opacity:.62; }
.voice-stage h1 { margin:0; font-size:clamp(25px,5vw,38px); font-weight:560; letter-spacing:-.05em; }
.voice-status { min-height:22px; margin:7px 0 0; color:var(--muted); font-size:12px; }
.voice-timer { margin:8px 0 0; color:var(--subtle); font-variant-numeric:tabular-nums; font-size:11px; letter-spacing:.08em; }
.voice-transcript-wrap { max-height:180px; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:color-mix(in srgb,var(--surface) 83%,transparent); }
.voice-transcript-head { display:flex; justify-content:space-between; gap:8px; padding:10px 13px; border-bottom:1px solid var(--line); color:var(--subtle); font-size:8px; letter-spacing:.09em; }
.voice-transcript-head span:last-child { text-transform:none; letter-spacing:0; }
.voice-transcript { max-height:140px; overflow:auto; padding:8px 13px; }
.voice-transcript p { margin:7px 0; color:var(--muted); font-size:11px; line-height:1.55; }
.voice-transcript p strong { margin-right:5px; color:var(--text); font-weight:650; }
.voice-transcript .voice-transcript-empty { color:var(--subtle); text-align:center; }
.voice-notice { min-height:20px; margin:8px 0 0; color:var(--danger); font-size:10px; text-align:center; }
.voice-controls { display:flex; flex-wrap:wrap; justify-content:center; gap:9px; margin:8px 0 0; }
.voice-start,.voice-control { min-height:46px; border-radius:999px; font:inherit; font-size:11px; font-weight:630; }
.voice-start { min-width:170px; padding:0 22px; border:0; background:var(--accent-strong); color:#fff; }
.voice-start:disabled,.voice-control:disabled { opacity:.58; cursor:wait; }
.voice-control { min-width:122px; padding:0 17px; border:1px solid var(--line-strong); background:var(--surface); color:var(--text); }
.voice-end { color:var(--danger); }
.voice-consent { max-width:470px; margin:12px auto 0; color:var(--subtle); font-size:9px; line-height:1.55; text-align:center; }
@media(max-width:760px) {
  .voice-view { min-height:calc(100% + 12px); padding:12px 15px max(22px,var(--safe-b)); }
  .voice-heading .eyebrow { font-size:8px; }
  .voice-stage { min-height:270px; }
  .voice-halo { width:min(45vw,190px); margin-bottom:16px; }
  .voice-orb { width:min(30vw,132px); }
  .voice-transcript-wrap { max-height:150px; }
  .voice-transcript { max-height:110px; }
  .voice-controls { padding-bottom:4px; }
}
@media(prefers-reduced-motion:reduce) {
  .voice-halo,.voice-orb { transition:none; }
}
.knowledge-form { display: grid; gap: 12px; margin: 24px 0; padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--accent) 4%), var(--surface)); box-shadow: var(--shadow); }
.knowledge-form > label { color: var(--text); font-size: 14px; font-weight: 650; }
.knowledge-form textarea { width: 100%; min-height: 74px; resize: vertical; padding: 13px 14px; border: 1px solid var(--line-strong); border-radius: 13px; outline: none; background: var(--surface-2); color: var(--text); font: inherit; line-height: 1.6; }
.knowledge-form textarea:focus, .document-upload-row input:focus-visible, .document-scope select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.knowledge-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.knowledge-form-foot > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.knowledge-form-foot button { flex: 0 0 auto; min-height: 42px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--accent-strong); color: white; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.knowledge-form-foot button:disabled { opacity: .55; cursor: wait; }
.knowledge-library-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.knowledge-library-head h2 { margin: 5px 0 0; color: var(--text); font-size: 18px; letter-spacing: -.02em; }
.knowledge-library-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.knowledge-list { display: grid; gap: 10px; }
.knowledge-card { position: relative; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.knowledge-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.knowledge-card h3 { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; line-height: 1.5; font-weight: 630; }
.knowledge-status { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 650; text-transform: capitalize; }
.knowledge-status.completed, .knowledge-status.ready { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.knowledge-status.failed { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.knowledge-status.researching, .knowledge-status.processing, .knowledge-status.queued { color: var(--accent); }
.knowledge-activity { margin: 10px 0; color: var(--muted); font-size: 12px; }
.knowledge-report { margin-top: 14px; color: var(--text); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.knowledge-report > :first-child { margin-top: 0; }
.knowledge-report > :last-child { margin-bottom: 0; }
.knowledge-report h1, .knowledge-report h2, .knowledge-report h3 { color: var(--text); font-size: 15px; }
.knowledge-report a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.knowledge-report blockquote { margin-inline: 0; padding-left: 13px; border-left: 2px solid var(--accent); color: var(--muted); }
.knowledge-sources { display: grid; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.knowledge-sources > strong { color: var(--muted); font-size: 11px; }
.knowledge-source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.knowledge-source-list a { min-width: 0; overflow: hidden; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); color: var(--accent); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-actions { display: flex; gap: 8px; margin-top: 12px; }
.knowledge-actions button, .knowledge-cancel, .knowledge-delete { min-height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.knowledge-cancel { margin-top: 6px; color: var(--danger); }
.knowledge-delete { justify-self: end; margin-top: 9px; color: var(--danger); }
.knowledge-error { color: var(--danger); font-size: 12px; }
.knowledge-empty { padding: 20px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: 12px; text-align: center; }
.document-upload-row { display: flex; align-items: center; gap: 14px; }
.document-upload-row input { min-width: 0; flex: 1; color: var(--muted); font: inherit; font-size: 11px; }
.document-upload-row input::file-selector-button { min-height: 38px; margin-right: 10px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.document-scope { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.document-scope select { min-height: 38px; max-width: 190px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 11px; }
.document-card { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.document-card-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.document-select { display: grid; place-items: center; width: 24px; height: 28px; }
.document-select input { width: 17px; height: 17px; accent-color: var(--accent-strong); }
.document-info { min-width: 0; }
.document-info h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-info p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.document-question { margin-top: 24px; }
.document-answer { padding: 4px 2px; }
.document-citations { color: var(--muted); font-size: 11px; }
.knowledge-form > input, .knowledge-form select { min-height: 42px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; }
.task-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.task-field-row label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.task-field-row input, .task-field-row select { min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 11px; }
.task-filters { display: flex; gap: 7px; margin: 20px 0 12px; }
.task-filters button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; }
.task-filters button.active { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); background: var(--accent-wash); color: var(--accent); }
.task-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-title { min-width: 0; overflow-wrap: anywhere; }
.task-description { margin: 7px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.task-priority { color: var(--muted); text-transform: capitalize; }
.priority-high, .priority-urgent { color: var(--danger); }
.priority-low { color: var(--subtle); }
.task-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.task-actions button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; }
.task-actions .task-complete { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, var(--line)); }
.task-actions .task-cancel { color: var(--danger); }
.task-completed .task-title { color: var(--muted); text-decoration: line-through; }
.knowledge-dialog { width: min(500px, calc(100% - 28px)); max-height: min(85dvh, 760px); padding: 22px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.knowledge-dialog::backdrop { background: rgba(4, 6, 10, .6); backdrop-filter: blur(7px); }
.knowledge-dialog form { display: grid; gap: 12px; }
.knowledge-dialog h2 { margin: 0; font-size: 19px; font-weight: 600; }
.knowledge-dialog form > label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.knowledge-dialog input, .knowledge-dialog textarea, .knowledge-dialog select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; }
.knowledge-dialog textarea { resize: vertical; }
.knowledge-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.knowledge-dialog-actions button { min-height: 37px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 11px; }
.knowledge-dialog-actions button[type="submit"] { border-color: transparent; background: var(--accent-strong); color: white; }
.task-history-list { display: grid; gap: 9px; margin: 16px 0; }
.task-history-row { display: grid; gap: 4px; padding: 11px; border-radius: 10px; background: var(--surface-2); }
.task-history-row strong { font-size: 11px; font-weight: 600; }
.task-history-row span { color: var(--muted); font-size: 10px; }
.agent-approval-card { margin: 12px 0; padding: 18px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 17px; background: linear-gradient(145deg, var(--accent-wash), var(--surface)); }
.approval-section-title { margin: 24px 0 10px; font-size: 15px; }
.agent-approval-card h3 { margin: 6px 0; font-size: 15px; }
.agent-approval-card > p { color: var(--muted); font-size: 11px; }
.agent-approval-card pre { max-height: 180px; overflow: auto; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--muted); font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-approval-actions { display: flex; justify-content: flex-end; gap: 8px; }
.agent-approval-actions button { min-height: 37px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; }
.agent-approval-actions .approve-action { border-color: transparent; background: var(--accent-strong); color: white; }
.agent-step-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.agent-step-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.agent-step-list li > strong { color: var(--muted); font-size: 11px; font-weight: 550; }
.agent-run-card .knowledge-report { padding-top: 10px; border-top: 1px solid var(--line); }
.automation-form > label:not(:first-child) { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.automation-form > label span { color: var(--subtle); font-weight: 400; }
.automation-field-row { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.automation-field-row select, .automation-field-row input { min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 11px; }
.automation-field-row > div { display: flex; align-items: center; gap: 8px; }
.automation-field-row input[type="number"] { width: 96px; }
.field-suffix, .automation-timezone { color: var(--muted); font-size: 11px; }
.automation-timezone { margin: 0; }
.automation-timezone strong { color: var(--text); font-weight: 550; }
.automation-copy { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.automation-next { margin: 11px 0 0; color: var(--subtle); font-size: 10px; }
.automation-delete { color: var(--danger) !important; }
.notification-card { padding-left: 19px; }
.notification-card.unread { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); background: linear-gradient(135deg, var(--accent-wash), var(--surface) 70%); }
.notification-read { margin-top: 12px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--accent); font: inherit; font-size: 10px; }
.notification-link { display: inline-block; margin-top: 11px; color: var(--accent); font-size: 11px; text-decoration: none; }
.notification-link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 400px) {
  .automation-field-row { grid-template-columns: 1fr; gap: 7px; }
}

:root {
  --bg: #0d1018;
  --surface: #141923;
  --surface-2: #1b2230;
  --surface-3: #242c3b;
  --text: #f2f3f8;
  --muted: #a1aabc;
  --subtle: #7b879b;
  --line: rgba(184, 194, 216, .12);
  --line-strong: rgba(184, 194, 216, .2);
  --accent: #b4a6ff;
  --accent-strong: #7863d3;
  --accent-wash: rgba(180, 166, 255, .11);
  --shadow: 0 24px 72px rgba(0, 0, 0, .32);
  --sidebar: 264px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --motion: 180ms cubic-bezier(.2, .7, .25, 1);
  --app-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="light"] {
  --bg: #f4f5f9;
  --surface: #fff;
  --surface-2: #f0f1f7;
  --surface-3: #e8eaf2;
  --text: #202538;
  --muted: #58647a;
  --subtle: #667188;
  --line: rgba(37, 48, 72, .1);
  --line-strong: rgba(37, 48, 72, .18);
  --accent: #5949c9;
  --accent-strong: #5949c9;
  --accent-wash: rgba(89, 73, 201, .09);
  --shadow: 0 24px 72px rgba(31, 42, 67, .12);
}

html, body { min-height: 0; }
body { font-size: 14px; line-height: 1.55; }
.app-shell { height: var(--app-height); min-height: 0; }
.ambient {
  background: radial-gradient(ellipse at 70% 16%, rgba(108, 88, 193, .12), transparent 36%),
    radial-gradient(ellipse at 6% 98%, rgba(66, 123, 143, .06), transparent 30%);
}

.sidebar {
  padding: 25px 15px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-right-color: var(--line);
}
.brand { min-height: 36px; gap: 10px; font-size: 13px; letter-spacing: .2em; }
.brand-mark { width: 33px; height: 33px; }
.brand-mark svg { width: 32px; }
.new-chat {
  min-height: 46px;
  margin: 27px 1px 29px;
  border-radius: 13px;
  padding-inline: 13px;
  font-size: 12px;
}
.nav-label { font-size: 10px; letter-spacing: .12em; }
.nav-item { min-height: 43px; border-radius: 11px; font-size: 12px; }
.soon {
  color: var(--muted);
  border-color: var(--line-strong);
  background: var(--surface);
  font-size: 9px;
  padding: 2px 7px;
}
.history-head { margin-top: 28px; }
.icon-button { min-width: 44px; min-height: 44px; border-radius: 12px; }
.icon-button.tiny { width: 36px; height: 36px; }
.history-row { min-height: 39px; border-radius: 9px; font-size: 12px; }
.history-empty { font-size: 11px; color: var(--muted); }
.profile-link { min-height: 58px; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { font-size: 10px; }

.topbar { height: 68px; padding-inline: clamp(22px, 4vw, 54px); }
.workspace-select { min-height: 42px; font-size: 12px; }
.connection { font-size: 11px; }
.top-actions { gap: 10px; }
.view { scroll-padding-block: 24px; }
.welcome {
  width: min(100% - 40px, 780px);
  padding: 48px 0 30px;
}
.welcome-kicker { font-size: 10px; letter-spacing: .16em; }
.hero-mark { width: 62px; height: 62px; margin: 29px auto 19px; }
.hero-mark svg { width: 58px; }
.welcome h1 {
  font-size: clamp(34px, 4.2vw, 50px);
  letter-spacing: -.052em;
  line-height: 1.08;
  font-weight: 570;
}
.hero-copy { font-size: 14px; line-height: 1.65; margin: 15px 0 31px; }
.composer-wrap { max-width: 680px; }
.composer {
  border-radius: 22px;
  padding: 15px 15px 11px;
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(0, 0, 0, .13);
}
.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--line));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .16), 0 0 0 3px var(--accent-wash);
}
.composer textarea { min-height: 49px; padding: 8px 8px 5px; font-size: 15px; line-height: 1.55; }
.composer textarea::placeholder { opacity: .88; }
.composer-bottom { min-height: 45px; padding-left: 8px; }
.composer-hint { font-size: 10px; }
.send-button { width: 44px; height: 44px; border-radius: 14px; box-shadow: 0 5px 15px rgba(80, 65, 170, .23); }
.send-button svg { width: 19px; height: 19px; }
.suggestions { max-width: 680px; margin-top: 15px; gap: 9px; }
.suggestion {
  min-height: 62px;
  gap: 11px;
  border-radius: 14px;
  padding: 11px 13px;
}
.suggestion-icon { width: 34px; height: 34px; border-radius: 11px; }
.suggestion strong { font-size: 11px; }
.suggestion small { font-size: 10px; }
.suggestion-arrow { font-size: 13px; }
.home-footer { max-width: 680px; margin-top: 29px; padding-top: 14px; font-size: 9px; }

.memory-view { width: min(100%, 920px); margin: 0 auto; padding: clamp(22px, 4vw, 48px) clamp(16px, 4vw, 38px) 42px; }
.memory-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 27px; }
.memory-heading h1 { margin: 4px 0 0; font-size: clamp(27px, 4vw, 38px); line-height: 1.1; letter-spacing: -.055em; font-weight: 590; }
.memory-heading p, .memory-toolbar p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.memory-back, .memory-cancel { min-height: 42px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 11px; white-space: nowrap; }
.memory-control-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 17px; background: linear-gradient(110deg, var(--accent-wash), color-mix(in srgb, var(--surface) 85%, transparent) 58%); }
.memory-control-copy { display: flex; align-items: center; gap: 12px; min-width: 0; }
.memory-control-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 13px; background: var(--accent-wash); color: var(--accent); font-size: 17px; }
.memory-control-copy>span:last-child { display: grid; gap: 3px; }
.memory-control-copy strong { font-size: 12px; font-weight: 620; }
.memory-control-copy small { color: var(--muted); font-size: 10px; }
.switch-control { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 42px; height: 25px; border-radius: 20px; padding: 3px; background: var(--surface-3); transition: background var(--motion); }
.switch-track::after { display: block; width: 19px; height: 19px; border-radius: 50%; content: ""; background: var(--muted); transition: transform var(--motion), background var(--motion); }
.switch-control input:checked + .switch-track { background: var(--accent-strong); }
.switch-control input:checked + .switch-track::after { transform: translateX(17px); background: white; }
.switch-control input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.memory-notice { min-height: 18px; margin: 8px 4px 3px; color: var(--muted); font-size: 10px; }
.memory-notice.error { color: var(--danger); }
.memory-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 25px 0 13px; }
.memory-toolbar h2 { margin: 0; font-size: 15px; letter-spacing: -.025em; font-weight: 620; }
.memory-toolbar p { margin-top: 3px; font-size: 10px; }
.memory-search-form { display: flex; width: min(100%, 300px); gap: 6px; }
.memory-toolbar input { width: 100%; min-width: 0; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); padding: 0 12px; font-size: 11px; }
.memory-search-form button { flex: none; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.memory-editor { margin: 0 0 15px; padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: color-mix(in srgb, var(--surface) 92%, transparent); }
.memory-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.memory-editor-head h2 { margin: 3px 0 0; font-size: 14px; letter-spacing: -.025em; font-weight: 600; }
.memory-fields { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.memory-fields label, .memory-content-label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.memory-fields input, .memory-fields select, .memory-content-label textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); padding: 10px 11px; color: var(--text); font-size: 11px; }
.memory-fields input, .memory-fields select { min-height: 41px; }
.memory-content-label { margin-top: 11px; }
.memory-content-label textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
.memory-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 11px; }
.memory-form-foot>span { color: var(--subtle); font-size: 9px; }
.memory-save { min-height: 40px; border: 0; border-radius: 11px; padding: 0 15px; background: var(--accent-strong); color: #fff; font-size: 11px; font-weight: 600; }
.memory-save span { padding-left: 7px; }
.memory-list { display: grid; gap: 9px; padding-bottom: 25px; }
.memory-card { padding: 16px 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); animation: rise .2s ease both; }
.memory-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.memory-card-title { margin: 0; font-size: 12px; font-weight: 620; }
.memory-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.memory-tag { border: 1px solid var(--line); border-radius: 99px; padding: 2px 7px; color: var(--muted); font-size: 8px; }
.memory-tag.shared { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 24%, var(--line)); }
.memory-card-content { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.memory-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.memory-provenance { color: var(--subtle); font-size: 9px; }
.memory-actions { display: flex; gap: 5px; }
.memory-actions button { min-height: 33px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); padding: 0 10px; color: var(--muted); font-size: 9px; }
.memory-actions .memory-delete { color: var(--danger); }
.memory-empty { padding: 26px 16px; border: 1px dashed var(--line-strong); border-radius: 15px; text-align: center; color: var(--muted); font-size: 11px; }
.memory-empty strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.memory-delete-dialog { width: min(100% - 30px, 390px); border: 1px solid var(--line-strong); border-radius: 19px; padding: 23px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.memory-delete-dialog::backdrop { background: rgba(4, 6, 10, .58); backdrop-filter: blur(7px); }
.memory-delete-dialog h2 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.04em; }
.memory-delete-dialog p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.memory-delete-dialog>div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.memory-delete-dialog button { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); padding: 0 12px; color: var(--muted); font-size: 10px; }
.memory-delete-dialog #memoryDeleteConfirm { border-color: transparent; background: color-mix(in srgb, var(--danger) 88%, #501c24); color: #fff; }

.conversation { width: min(100%, 940px); padding-inline: 32px; }
.conversation-heading { height: 76px; gap: 14px; }
.conversation-heading h2 { font-size: 15px; font-weight: 610; }
.eyebrow { font-size: 9px; }
.message-list { padding: 31px 15px 26px; scroll-behavior: smooth; }
.message-row { max-width: 760px; gap: 13px; margin-bottom: 28px; }
.message-avatar { width: 31px; height: 31px; border-radius: 10px; }
.message-content { max-width: min(84%, 700px); font-size: 14px; line-height: 1.78; }
.message-row.user .message-content {
  background: color-mix(in srgb, var(--accent-wash) 75%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  padding: 11px 15px;
  border-radius: 17px 17px 5px 17px;
}
.message-row.assistant .message-content { padding-top: 2px; }
.message-content h1, .message-content h2, .message-content h3 { line-height: 1.3; letter-spacing: -.02em; margin: 1.1em 0 .45em; }
.message-content h1 { font-size: 1.35em; }
.message-content h2 { font-size: 1.2em; }
.message-content h3 { font-size: 1.08em; }
.message-content blockquote { margin: 12px 0; padding: 2px 0 2px 15px; border-left: 2px solid var(--accent); color: var(--muted); }
.message-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .92em; }
.message-content th, .message-content td { border: 1px solid var(--line-strong); padding: 7px 10px; text-align: left; }
.message-content th { background: var(--surface-2); }
.message-content pre {
  margin: 13px 0;
  padding: 16px;
  border-radius: 14px;
  background: #111620;
  border-color: var(--line-strong);
  font-size: 12px;
  line-height: 1.7;
  tab-size: 2;
}
html[data-theme="light"] .message-content pre { background: #202638; color: #f2f3f8; }
.message-content :not(pre)>code { padding: 2px 6px; border-radius: 5px; }
.message-actions { gap: 7px; margin-top: 9px; }
.message-actions button { min-height: 44px; padding: 6px 10px; border-radius: 9px; font-size: 11px; }
.message-actions button:hover { background: var(--surface-2); }
.conversation-compose { padding: 15px 0 max(20px, var(--safe-b)); }
.conversation-compose .composer { padding: 12px 14px 10px; }
.conversation-compose .composer textarea { min-height: 40px; }
.scroll-bottom { width: 42px; height: 42px; right: 39px; bottom: 120px; color: var(--text); }

.auth-layer { padding: 24px; background: rgba(4, 6, 10, .66); }
.auth-card {
  max-height: min(92dvh, 780px);
  overflow-y: auto;
  border-radius: 25px;
  padding: 34px;
}
.auth-back { min-height: 44px; margin: -4px 0 22px; }
.auth-card h2 { font-size: 27px; }
.auth-card>p { line-height: 1.6; }
.auth-input { height: 48px; border-radius: 11px; font-size: 13px; }
.field-label { font-size: 11px; margin-top: 16px; }
.password-toggle { min-width: 44px; min-height: 44px; font-size: 11px; }
.auth-submit { min-height: 48px; border-radius: 12px; font-size: 13px; transition: transform var(--motion), filter var(--motion), opacity var(--motion); }
.auth-submit:hover, .logout-button:hover { filter: brightness(1.08); }
.auth-submit:active, .send-button:active, .suggestion:active, .new-chat:active { transform: scale(.985); }
.auth-switch, .auth-switch button { font-size: 11px !important; }
.profile-dialog {
  max-height: min(90dvh, 760px);
  overflow-y: auto;
  border-radius: 22px;
  padding: 27px;
}
.profile-dialog-head h2 { font-size: 22px; }
.settings-profile { min-height: 68px; }
.settings-profile strong, .settings-line strong { font-size: 12px; }
.settings-profile small, .settings-line small { font-size: 11px; }
.settings-note { font-size: 11px; }
.profile-dialog { max-height: min(90dvh, 860px); overflow-y: auto; }
.ops-panel { display: grid; gap: 12px; margin: 17px 0; padding: 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-2); }
.ops-panel[hidden] { display: none; }
.ops-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ops-panel-head h3 { margin: 3px 0 0; font-size: 16px; font-weight: 560; }
.ops-collected { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.ops-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.ops-summary>div { display: grid; gap: 4px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; }
.ops-summary span,.ops-summary small { color: var(--muted); font-size: 8px; }
.ops-summary strong { overflow-wrap: anywhere; font-size: 15px; font-weight: 600; }
.ops-panel h4 { margin: 4px 0 7px; font-size: 10px; font-weight: 600; }
.ops-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ops-columns>div { min-width: 0; }
.ops-columns ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.ops-columns li { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; text-transform: capitalize; }
.ops-columns li strong { color: var(--text); }
.ops-usage { min-width: 0; }
.ops-usage>div { max-height: 210px; overflow: auto; }
.ops-usage table { width: 100%; border-collapse: collapse; font-size: 8px; text-align: left; }
.ops-usage th,.ops-usage td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ops-usage th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 550; }
.ops-usage td:first-child { max-width: 130px; overflow-wrap: anywhere; }
.ops-usage td:not(:first-child),.ops-usage th:not(:first-child) { white-space: nowrap; text-align: right; }
.logout-button { min-height: 44px; font-size: 11px; }
.toast-region { right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 13px 16px; border-radius: 13px; font-size: 12px; }

button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 78%, white);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent; }
.skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); }
.stop-glyph { width: 13px; height: 13px; border-radius: 3px; background: currentColor; }
.message-row.pending .message-content:empty::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 2px 1px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 11px 0 0 color-mix(in srgb, var(--accent) 60%, transparent), 22px 0 0 color-mix(in srgb, var(--accent) 32%, transparent);
  animation: typing-pulse 1s ease-in-out infinite alternate;
}
.message-row.failed .message-content { color: var(--danger); }
@keyframes typing-pulse { from { opacity: .45; transform: translateY(0); } to { opacity: 1; transform: translateY(-2px); } }

@media (max-width: 760px) {
  .knowledge-view { padding: 24px 15px calc(96px + var(--safe-b)); }
  .knowledge-form-foot { align-items: stretch; flex-direction: column; }
  .knowledge-form-foot button { width: 100%; }
  .knowledge-source-list { grid-template-columns: 1fr; }
  .document-upload-row { align-items: stretch; flex-direction: column; }
  .document-scope select { max-width: none; }
  .knowledge-card { padding: 13px; }
  .sidebar { padding: max(20px, env(safe-area-inset-top)) 15px 14px; }
  .topbar { height: 62px; padding-inline: 13px; }
  .menu-toggle { display: grid; width: 44px; height: 44px; }
  .workspace-select { margin-left: 5px; gap: 8px; }
  .top-actions { gap: 5px; }
  .top-actions .icon-button { width: 44px; height: 44px; }
  .view { padding-bottom: calc(68px + var(--safe-b)); }
  .welcome { width: min(100% - 34px, 560px); padding: 32px 0 20px; }
  .hero-mark { margin-top: 25px; }
  .welcome h1 { font-size: clamp(32px, 8vw, 40px); }
  .hero-copy { font-size: 13px; margin: 13px 0 25px; }
  .composer { border-radius: 20px; }
  .composer textarea { min-height: 44px; font-size: 16px; }
  .composer-hint { max-width: calc(100% - 56px); font-size: 10px; }
  .suggestions { gap: 8px; }
  .suggestion { min-height: 60px; padding: 9px 10px; }
  .suggestion-icon { width: 31px; height: 31px; }
  .suggestion strong { font-size: 10px; }
  .suggestion small { font-size: 9px; }
  .home-footer { margin-top: 23px; font-size: 8px; }
  .conversation { padding: 0 13px; }
  .memory-view { padding: 24px 16px calc(90px + var(--safe-b)); }
  .memory-heading { margin-bottom: 18px; }
  .memory-heading h1 { font-size: 30px; }
  .memory-heading p { max-width: 42ch; font-size: 11px; }
  .memory-back { min-height: 39px; padding-inline: 10px; font-size: 10px; }
  .memory-control-card { padding: 13px; }
  .memory-toolbar { align-items: stretch; flex-direction: column; gap: 10px; margin-top: 19px; }
  .memory-toolbar input { width: 100%; }
  .memory-editor { padding: 14px; }
  .memory-fields { grid-template-columns: 1fr 1fr; }
  .memory-fields label:first-child { grid-column: 1 / -1; }
  .memory-form-foot { align-items: flex-start; flex-direction: column; }
  .memory-save { width: 100%; }
  .memory-card { padding: 13px; }
  .conversation-heading { height: 62px; }
  .conversation-heading h2 { font-size: 14px; }
  .back-home { display: grid; }
  .message-list { padding: 20px 3px 18px; }
  .message-row { gap: 9px; margin-bottom: 22px; }
  .message-content { max-width: min(87%, 700px); font-size: 14px; line-height: 1.7; }
  .message-row.user .message-content { padding: 10px 13px; }
  .message-avatar { width: 28px; height: 28px; }
  .conversation-compose {
    position: sticky;
    bottom: 0;
    padding: 10px 0 max(12px, var(--safe-b));
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 24%);
  }
  .conversation-compose .composer { padding: 10px 11px 8px; }
  .conversation-compose .composer textarea { min-height: 42px; }
  .scroll-bottom { right: 18px; bottom: 115px; }
  .mobile-nav {
    height: calc(66px + var(--safe-b));
    padding: 6px 8px var(--safe-b);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(18px);
  }
  .mobile-item { min-width: 68px; height: 50px; gap: 4px; font-size: 10px; }
  .mobile-item svg { width: 19px; height: 19px; }
  .mobile-item .soon { margin: -1px 0 0; padding: 0 5px; font-size: 8px; line-height: 1.35; }
  .avatar.mini { width: 21px; height: 21px; font-size: 9px; }
  .toast-region { left: 12px; right: 12px; bottom: calc(78px + var(--safe-b)); }
  .toast { text-align: center; }
  .auth-layer { align-items: center; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .auth-card { width: min(100%, 430px); padding: 27px; }
  .profile-dialog { padding: 22px; }
  .keyboard-open .mobile-nav { display: none; }
  .keyboard-open .view { padding-bottom: var(--safe-b); }
  .keyboard-open .toast-region { bottom: max(12px, var(--safe-b)); }
}

@media (max-width: 400px) {
  .welcome { width: calc(100% - 26px); padding-top: 26px; }
  .welcome-kicker { font-size: 9px; gap: 7px; }
  .kicker-line { width: 15px; }
  .welcome h1 { font-size: clamp(29px, 8.3vw, 34px); }
  .hero-copy { font-size: 12px; margin-bottom: 22px; }
  .suggestions { gap: 7px; }
  .suggestion { gap: 7px; padding: 8px 7px; min-height: 56px; }
  .suggestion-icon { width: 27px; height: 27px; }
  .suggestion strong { font-size: 9px; }
  .suggestion small { font-size: 8px; }
  .home-footer span:last-child { display: none; }
  .conversation { padding-inline: 9px; }
  .message-content { max-width: 89%; font-size: 13px; }
  .mobile-item { min-width: 60px; }
}

@media (max-width: 350px) {
  .topbar { padding-inline: 8px; }
  .workspace-select { font-size: 11px; }
  .welcome h1 { font-size: 29px; }
  .suggestion small { display: none; }
  .home-footer { justify-content: center; }
  .mobile-item { min-width: 54px; }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
  .view { padding-bottom: var(--safe-b); }
  .welcome { padding-block: 16px; }
  .hero-mark { width: 42px; height: 42px; margin: 12px auto 8px; }
  .hero-mark svg { width: 42px; }
  .welcome h1 { font-size: 29px; }
  .hero-copy { margin: 8px 0 14px; }
  .suggestions { margin-top: 8px; }
  .suggestion { min-height: 48px; }
  .home-footer { margin-top: 12px; padding-top: 8px; }
  .mobile-nav { display: none; }
}

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

.runway-status-card, .runway-estimate { display:flex; align-items:flex-start; gap:14px; padding:16px 18px; margin:14px 0; border:1px solid var(--border, rgba(138,160,210,.18)); border-radius:16px; background:var(--surface, rgba(18,25,42,.7)); }
.runway-status-dot { flex:0 0 10px; width:10px; height:10px; margin-top:6px; border-radius:50%; background:#9b6dff; box-shadow:0 0 14px #8254ff88; }
.runway-status-dot.available { background:#53d6b0; box-shadow:0 0 14px #53d6b088; }
.runway-status-card strong, .runway-estimate strong { display:block; font-size:14px; }
.runway-status-card p, .runway-estimate small { display:block; margin:5px 0 0; color:var(--muted, #9aa6bd); line-height:1.5; }
.runway-form { display:grid; gap:11px; }
.runway-form input[type=file], .runway-form select { max-width:100%; padding:10px; border:1px solid var(--border, rgba(138,160,210,.2)); border-radius:10px; background:var(--surface, #111827); color:inherit; }
.runway-estimate { display:block; margin:3px 0; }
.runway-estimate span { display:block; margin:7px 0; color:var(--accent, #8eabff); font-weight:600; }
.runway-generation-card { display:grid; gap:10px; }
.runway-generation-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.runway-generation-head h3 { margin:0; overflow-wrap:anywhere; }
.runway-generation-meta { margin:0; color:var(--muted, #9aa6bd); font-size:13px; }
.runway-generation-card video { width:min(100%,720px); max-height:480px; border-radius:12px; background:#080a10; }
.runway-source-preview, .runway-history-source { display:block; width:min(100%,520px); max-height:320px; object-fit:contain; border:1px solid var(--border, rgba(138,160,210,.18)); border-radius:12px; background:#080a10; }
#runwayApprovalDialog { max-width:min(540px, calc(100vw - 28px)); }
@media (max-width:600px) { .runway-generation-head { flex-direction:column; } .runway-status-card { padding:13px; } }
