.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-weight: 500; transition: background 0.12s, border-color 0.12s; }
.btn:active { background: var(--surface-3); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 50%; color: var(--text); position: relative; }
.icon-btn:active { background: var(--surface-3); }
.icon-btn.round { border: 1px solid var(--line); background: var(--surface-2); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.accent { background: var(--blue); color: #fff; }
.icon-btn.danger { background: var(--red); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; }
.chip.blue { border-color: var(--blue); background: var(--blue-soft); }
.chip.amber { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.chip.green { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
button.chip:active { background: var(--surface-3); }

.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--green); background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill[data-tone="amber"] { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: currentColor; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); outline: none; }
.input:focus { border-color: var(--blue); }
textarea.input { resize: vertical; min-height: 84px; }
.hint { color: var(--muted); font-size: 13px; }
.error-text { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.section-title { margin: 18px 0 8px; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 22px; }
.auth-card h1 { font-size: 22px; margin: 14px 0 4px; }
.auth-card p { margin: 0 0 18px; color: var(--muted); }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--blue); color: #fff; display: grid; place-items: center; }

.tabs { display: flex; gap: 4px; padding: 8px 12px 0; overflow-x: auto; border-bottom: 1px solid var(--line); flex: none; }
.tab { flex: none; padding: 8px 12px; border: 0; background: transparent; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tab.on { color: var(--text); border-bottom-color: var(--blue); }

.list { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; text-align: left; width: 100%; }
.list-row.on { border-color: var(--blue); background: var(--blue-soft); }
.list-row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.group-title { margin: 14px 4px 6px; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.session-actions { display: flex; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

.empty { text-align: center; color: var(--muted); padding: 48px 12px; }
.empty h2 { color: var(--text); margin: 14px 0 6px; font-size: 20px; }
.empty .ic-big { width: 44px; height: 44px; color: var(--blue); }

.msg { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.msg.user { align-items: flex-end; }
.msg.user .msg-body { background: var(--blue); color: #fff; border-radius: 16px 16px 4px 16px; padding: 9px 14px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 12px 14px 6px; max-width: 100%; }
.msg.assistant .timeline { background: var(--bg); }
.msg.assistant .msg-body { padding: 0; overflow-wrap: anywhere; min-width: 0; line-height: 1.62; letter-spacing: -0.003em; }
.msg.assistant .msg-body > :first-child { margin-top: 0; }
.msg.assistant .msg-body > :last-child { margin-bottom: 0; }
.msg-body p { margin: 0 0 10px; }
.msg-body ul, .msg-body ol { margin: 0 0 10px; padding-left: 22px; }
.msg-body a { color: var(--blue); }
.msg-body h1, .msg-body h2, .msg-body h3 { margin: 16px 0 8px; line-height: 1.25; }
.msg-body h1 { font-size: 20px; } .msg-body h2 { font-size: 17px; } .msg-body h3 { font-size: 15px; }
.msg-body blockquote { margin: 0 0 10px; padding: 2px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.msg-body table { border-collapse: collapse; display: block; overflow-x: auto; margin-bottom: 10px; }
.msg-body th, .msg-body td { border: 1px solid var(--line); padding: 6px 10px; }
.msg-body :not(pre) > code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.msg-body img { max-width: 100%; border-radius: var(--radius-sm); }
.msg-tools { display: flex; gap: 6px; margin: 4px 0 4px -4px; padding-top: 6px; border-top: 1px solid var(--line); }
.msg-tools:empty { display: none; }
.msg.user .msg-tools { display: none; }
.msg.live .msg-tools { display: none; }
.msg-error { color: var(--red); background: var(--red-soft); border: 1px solid var(--red); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; }
.att-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.att-row img { max-width: 160px; max-height: 120px; border-radius: var(--radius-sm); }
.msg:not(.live) .cursor { display: none !important; }
.cursor { display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--green); animation: pulse 1s steps(2) infinite; }

.codecard { margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.codecard-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; background: var(--surface-2); font-size: 12px; color: var(--muted); font-family: var(--mono); }
.codecard-head .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codecard pre { margin: 0; padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.codecard.collapsed pre { max-height: 190px; overflow-y: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }

.artifact { margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.artifact-top { display: flex; align-items: center; gap: 10px; }
.artifact-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }
.artifact-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.artifact-actions .btn { flex: 1; min-width: 96px; }

.timeline { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.timeline > summary, .tl-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; }
.timeline > summary::-webkit-details-marker { display: none; }
.tl-head.amber { color: var(--amber); }
.tl-head.green { color: var(--green); }
.tl-head.red { color: var(--red); }
.tl-head .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-steps { padding: 2px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.step .ico { width: 16px; height: 16px; margin-top: 2px; display: grid; place-items: center; flex: none; }
.step .ico svg { width: 15px; height: 15px; }
.step.running { color: var(--amber); }
.step.done { color: var(--muted); }
.step.done .ico { color: var(--green); }
.step.error { color: var(--red); }
.step .lbl { min-width: 0; overflow-wrap: anywhere; }
.step .det { color: var(--muted); display: block; font-size: 12px; }
.lanes-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 12px 6px; }
.lanes { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 12px; scroll-snap-type: x proximity; }
.lane { flex: 0 0 min(200px, 70%); scroll-snap-align: start; border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: var(--radius-sm); background: var(--bg); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.lane.done { border-top-color: var(--green); }
.lane.error { border-top-color: var(--red); }
.lane-head { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.lane-head .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane .det { color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.clarify { border: 1px solid var(--amber); background: var(--amber-soft); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.clarify.sent { border-color: var(--line); background: var(--surface); opacity: 0.75; pointer-events: none; }
.clarify-q { font-weight: 600; margin-bottom: 8px; }
.clarify .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.clarify .chip { min-height: 40px; padding: 0 16px; font-size: 14px; }

.voice-stage { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.voice-stage .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.voice-stage canvas { width: 100%; height: 34px; display: block; }
.stage-cap { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 18px; }
.stage-cap.live { color: var(--text); font-weight: 500; }
.mic-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; flex: none; background: linear-gradient(135deg, #38bdf8, #2563eb); color: #fff; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); transition: transform 0.14s, box-shadow 0.15s; }
.mic-btn:active { transform: scale(0.95); }
.mic-btn svg { width: 22px; height: 22px; }
.mic-btn.listening { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 0 0 8px var(--red-soft); }
.mic-btn.thinking { background: linear-gradient(135deg, #fbbf24, #d97706); }
.mic-btn.speaking { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 0 0 8px var(--green-soft); }

.composer { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; min-height: 42px; max-height: 140px; resize: none; padding: 9px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); outline: none; line-height: 1.4; }
.composer textarea:focus { border-color: var(--blue); }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; }

#call-overlay .call-top { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#call-overlay .call-state { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
#call-overlay .call-sub { font-size: 13px; color: var(--muted); }
#call-overlay .call-mode { margin-top: 6px; background: rgba(16, 20, 28, 0.72); border-radius: 999px; }
#call-overlay .call-mode button { padding: 7px 14px; font-size: 13px; border-radius: 999px; }
#call-overlay .call-state.listening { color: var(--blue); }
#call-overlay .call-state.thinking { color: var(--amber); }
#call-overlay .call-state.speaking { color: var(--green); }
.call-center { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 0; }
.call-orb-wrap { border: 0; background: transparent; padding: 0; width: min(280px, 68vw); height: min(280px, 68vw); border-radius: 50%; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
#call-wave { width: 100%; height: 100%; display: block; pointer-events: none; }
#call-caption { max-width: 540px; width: 100%; min-height: 64px; max-height: 22vh; overflow-y: auto; text-align: center; color: var(--text); font-size: 16px; line-height: 1.5; padding: 0 12px; overflow-wrap: anywhere; }
.call-actions { display: flex; align-items: center; gap: 18px; }
.call-actions .icon-btn { width: 62px; height: 62px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.call-actions .icon-btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.call-actions .icon-btn.on { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
#call-bar canvas { width: 72px; height: 28px; flex: none; }
#call-bar .st { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-wrap { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: min(480px, 100%); max-height: 86%; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 18px 16px calc(16px + var(--safe-b)); }
.modal h3 { margin: 0 0 10px; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
@media (min-width: 700px) { .modal-wrap { align-items: center; } .modal { border-radius: 16px; } }

.toast { pointer-events: auto; max-width: 480px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.toast.error { border-color: var(--red); }
.toast.ok { border-color: var(--green); }
.toast button { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 0; }

.qr-box { background: #fff; padding: 12px; border-radius: var(--radius-sm); width: fit-content; max-width: 100%; }
.qr-box img { display: block; width: 240px; max-width: 100%; }
.mono-box { font-family: var(--mono); font-size: 12px; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.bubble-wa { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); max-width: 86%; overflow-wrap: anywhere; }
.bubble-wa.me { align-self: flex-end; background: var(--green-soft); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 16px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--blue); color: #fff; }
.seg button.on.amber { background: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  .dot, .spin, .cursor { animation: none; }
  .drawer { transition: none; }
}

.act-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; transition: background 0.12s, color 0.12s; }
.act-btn:hover, .act-btn:active { background: var(--surface-2); color: var(--text); }
.act-btn.playing { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.act-btn.loading { color: var(--text); }
.act-btn.done { color: var(--green); }
.starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.starter { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 500; }
.starter:active { background: var(--surface-3); border-color: var(--blue); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 14px; margin: 14px 0; }
.card-title { font-weight: 700; margin-bottom: 8px; }
.card .hint { margin: 0 0 10px; }
#net-banner { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: calc(26px + var(--safe-t)); padding: var(--safe-t) 12px 0; font-size: 12.5px; font-weight: 600; background: var(--amber-soft); color: var(--amber); border-bottom: 1px solid var(--amber); animation: bannerIn 0.2s ease-out; }
#net-banner[data-kind="ok"] { background: var(--green-soft); color: var(--green); border-bottom-color: var(--green); }
#net-banner + .topbar { height: var(--topbar-h); padding-top: 0; }
@keyframes bannerIn { from { transform: translateY(-100%); opacity: 0; } }
.voice-stage .mid { align-items: stretch; justify-content: center; }
.voice-stage[data-state="idle"] canvas, .voice-stage[data-state="thinking"] canvas, .voice-stage[data-state="paused"] canvas { display: none; }
.voice-stage[data-state="idle"] .stage-cap, .voice-stage[data-state="paused"] .stage-cap { align-self: flex-start; display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.voice-stage[data-state="thinking"] .stage-cap { color: var(--amber); }
.voice-stage[data-state="listening"] canvas, .voice-stage[data-state="speaking"] canvas { height: 32px; }

/* Gemini + AI Studio layer */
.btn { min-height: 44px; border-radius: 999px; }
.btn.primary { color: #fff; }
.btn.small { min-height: 44px; }
.icon-btn { width: 44px; height: 44px; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.small::after, .chip-x::after { content: ""; position: absolute; inset: -4px; }
.session-actions { gap: 8px; }
.chip.on, .seg button.on { color: #fff; }
button.chip, .clarify .chip { min-height: 44px; }
.seg { border-radius: 999px; }
.seg button { min-height: 44px; border-radius: 999px; }
.tab { min-height: 44px; }
.list-row { min-height: 56px; }
select.input, .input { min-height: 44px; }
.toast button, .act-btn { min-height: 44px; min-width: 44px; }
.starter { min-height: 48px; border-radius: 16px; background: var(--surface-2); border-color: transparent; }

.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.wordmark { flex: none; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.model-pill { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; max-width: fit-content; padding: 0 8px 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500; overflow: hidden; }
.model-pill:active { background: var(--surface-2); }
.model-pill #model-pill-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.model-pill svg { width: 16px; height: 16px; }
.pill { min-height: 44px; max-width: 120px; }
.pill .pill-text { overflow: hidden; text-overflow: ellipsis; }

.empty { padding: 12vh 12px 24px; text-align: left; max-width: 560px; }
.empty h2 { font-size: 30px; font-weight: 500; margin: 14px 0 2px; letter-spacing: -0.02em; }
.empty p { font-size: 26px; font-weight: 500; margin: 0; color: var(--muted); letter-spacing: -0.02em; }
.spark-lg { color: var(--blue-text); }
.spark-lg svg, .spark svg { fill: currentColor; stroke: none; }
.starters { justify-content: flex-start; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.starter { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 14px; text-align: left; }
.starter svg { color: var(--blue-text); }

.msg.user .msg-body { background: var(--user-bubble); color: var(--text); border-radius: 22px 22px 6px 22px; padding: 10px 16px; }
.msg.assistant { background: transparent; border: 0; border-radius: 0; padding: 0; gap: 8px; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.msg-head .spark { color: var(--blue-text); display: grid; }
.msg.assistant .msg-body { font-size: 15.5px; line-height: 1.6; }
.msg.assistant .timeline { background: var(--surface-2); border: 0; border-radius: 14px; align-self: flex-start; max-width: 100%; }
.msg-tools { border-top: 0; margin: 0 0 0 -10px; padding: 0; min-height: 44px; }
.att-pill, .att-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; max-width: 220px; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { position: relative; width: 28px; height: 28px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; color: inherit; }

.artifact-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.artifact-actions .btn { min-width: 0; min-height: 44px; padding: 0 8px; gap: 6px; }
.artifact-actions .hint { grid-column: 1 / -1; }

.timeline > summary, .tl-head { min-height: 40px; }
.tl-head .chev { margin-left: auto; display: grid; }
.timeline[open] .chev { transform: rotate(180deg); }

.composer { align-items: flex-end; gap: 0; padding: 4px; background: var(--composer); border-radius: 28px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28); }
.composer textarea { min-height: 44px; max-height: 140px; border: 0; background: transparent; border-radius: 0; padding: 11px 6px; font-size: 16px; line-height: 1.4; }
.composer textarea:focus { border: 0; }
.mic-btn { position: relative; background: transparent; color: var(--text); box-shadow: none; touch-action: none; user-select: none; -webkit-user-select: none; width: 44px; height: 44px; }
.mic-btn svg { width: 22px; height: 22px; }
.mic-btn::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; transform: scale(calc(1 + var(--lvl, 0) * 0.45)); transition: opacity 0.15s; pointer-events: none; }
.mic-btn.listening { background: var(--blue-soft); color: var(--blue-text); box-shadow: none; }
.mic-btn.listening::after { opacity: 0.7; }
.mic-btn.thinking { background: var(--amber-soft); color: var(--amber); box-shadow: none; }
.mic-btn.speaking { background: var(--green-soft); color: var(--green); box-shadow: none; }
.send-btn { background: var(--text); color: var(--bg); width: 44px; height: 44px; margin-left: 2px; }
.send-btn[data-mode="live"] { background: var(--surface-3); color: var(--text); }
.send-btn[data-mode="send"] { background: var(--blue); color: #fff; }
.send-btn[data-mode="stop"] { background: var(--text); color: var(--bg); }
.send-btn:disabled { opacity: 0.6; }

.voice-stage { display: flex; align-items: center; gap: 10px; padding: 6px 14px; min-height: 36px; background: var(--composer); border: 0; border-radius: 999px; box-shadow: none; }
.voice-stage canvas { flex: none; width: 72px; height: 24px; display: block; }
.voice-stage[data-state="thinking"] canvas { display: none; }
.stage-cap { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.stage-cap.live { color: var(--text); }
.voice-stage .mid { display: none; }

#call-overlay::before { content: ""; position: absolute; left: 50%; top: 42%; width: 120vmax; height: 120vmax; transform: translate(-50%, -50%); background: radial-gradient(circle, var(--glow, rgba(76, 141, 246, 0.2)) 0%, transparent 55%); opacity: 0.9; animation: breathe 5s ease-in-out infinite; pointer-events: none; }
#call-overlay[data-state="listening"] { --glow: rgba(76, 141, 246, 0.26); }
#call-overlay[data-state="thinking"] { --glow: rgba(245, 158, 11, 0.2); }
#call-overlay[data-state="speaking"] { --glow: rgba(20, 184, 166, 0.24); }
#call-overlay[data-state="paused"], #call-overlay[data-state="idle"] { --glow: rgba(100, 116, 139, 0.12); }
@keyframes breathe { 50% { opacity: 0.55; } }
#call-overlay > * { position: relative; }
#call-overlay .call-top { width: 100%; flex-direction: row; justify-content: space-between; gap: 8px; }
.call-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; font-size: 15px; }
.call-badge .spark { color: #8ab4f8; display: grid; }
#call-overlay .call-mode { margin: 0; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
#call-overlay .call-mode button { padding: 0 14px; font-size: 13px; color: #aab4c5; }
#call-overlay .call-mode button.on { background: #4c8df6; color: #fff; }
#call-overlay .icon-btn { color: #e8ecf3; }
#call-overlay .call-state { font-size: 20px; font-weight: 500; text-align: center; letter-spacing: -0.01em; }
#call-overlay .call-state.listening { color: #8ab4f8; }
#call-overlay .call-state.thinking { color: #fbbf24; }
#call-overlay .call-state.speaking { color: #5eead4; }
#call-caption { min-height: 72px; max-height: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 17px; color: #e8ecf3; }
#call-overlay .call-sub { font-size: 13px; color: #8b95a7; }
.call-actions { display: flex; align-items: flex-start; gap: 28px; }
.call-ctl { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 84px; }
.call-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); color: #e8ecf3; }
.call-btn:active { background: rgba(255, 255, 255, 0.2); }
.call-btn.on { background: #e8ecf3; color: #0f1218; }
.call-btn.danger { background: #ea4335; color: #fff; }
.call-btn-label { font-size: 12px; color: #aab4c5; text-align: center; }
#call-overlay .call-actions .icon-btn { all: unset; }

.card .card-title { font-size: 14px; }
.tool-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.tool-row .col { flex: 1; min-width: 0; }
.tool-row .s { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 52px; height: 32px; flex: none; border: 0; border-radius: 16px; background: var(--surface-3); }
.switch::before { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform 0.15s; }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::before { transform: translateX(20px); background: #fff; }
.switch:disabled { opacity: 0.45; }
.switch::after { content: ""; position: absolute; inset: -6px -2px; }
.step-expand { display: block; padding: 0; }
.step-expand > summary.step-sum { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 6px; cursor: pointer; border-radius: 8px; }
.step-expand > summary.step-sum::-webkit-details-marker { display: none; }
.step-expand > summary.step-sum:hover { background: var(--surface-2); }
.step-expand > summary.step-sum .chev { transition: transform 0.16s ease; opacity: 0.7; }
.step-expand[open] > summary.step-sum .chev { transform: rotate(180deg); }
.step-detail { margin: 2px 6px 6px 30px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow-y: auto; }

/* Gemini App & AI Studio Native Media Tiles */
.gem-img { position: relative; display: inline-block; margin: 10px 0; border-radius: 18px; overflow: hidden; max-width: min(100%, 420px); background: var(--surface-2); cursor: zoom-in; line-height: 0; }
.gem-img img { display: block; width: 100%; max-height: 400px; object-fit: cover; border-radius: 18px; }
.gem-img-dl { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(11, 15, 23, 0.74); backdrop-filter: blur(8px); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.gem-img-dl:active { transform: scale(0.94); }

.gem-audio { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); max-width: 440px; }
.gem-audio-play { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; }
.gem-audio-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gem-audio-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.gem-audio-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gem-audio-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; font-size: 12px; }
.gem-audio-bar { position: relative; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.gem-audio-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--blue); border-radius: 999px; pointer-events: none; }
.gem-audio-seek { position: absolute; inset: -8px 0; width: 100%; opacity: 0; cursor: pointer; margin: 0; }

.gem-file { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); max-width: 440px; cursor: pointer; transition: background 0.14s, border-color 0.14s; }
.gem-file:active, .gem-file:hover { background: var(--surface-3); border-color: var(--blue); }
.gem-file-badge { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; letter-spacing: 0.03em; background: var(--blue-soft); color: var(--blue-text); }
.gem-file-badge.red { background: rgba(234, 67, 53, 0.16); color: #f28b82; }
.gem-file-badge.green { background: var(--green-soft); color: var(--green); }
.gem-file-meta { flex: 1; min-width: 0; }
.gem-file-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gem-file-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

.gem-video { margin: 10px 0; border-radius: 18px; overflow: hidden; max-width: min(100%, 480px); background: #000; line-height: 0; }
.gem-video video { display: block; width: 100%; max-height: 380px; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(7, 10, 16, 0.94); backdrop-filter: blur(10px); display: flex; flex-direction: column; padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); }
.lightbox-top { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: #f1f5f9; }
.lightbox-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox > img { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding: 12px; }
.doc-viewer { background: #0b0f17; }
.doc-viewer-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }

/* Curated Human-Friendly Model Picker */
.model-picker { display: flex; flex-direction: column; gap: 8px; }
.model-brand-head { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--blue-text); letter-spacing: 0.03em; }
.model-card { width: 100%; text-align: left; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; transition: border-color 0.14s, background 0.14s; }
.model-card.on { border-color: var(--blue); background: var(--blue-soft); }
.model-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-card-name { font-weight: 600; font-size: 14px; color: var(--text); }
.model-card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.model-tier { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.model-tier.tier-max { background: var(--amber-soft); color: var(--amber); }
.model-tier.tier-bal { background: var(--blue-soft); color: var(--blue-text); }
.model-tier.tier-fast { background: var(--green-soft); color: var(--green); }
@media (prefers-reduced-motion: reduce) { #call-overlay::before { animation: none; } }
