.jarvis-panel,
.jarvis-launcher {
  --j-surface: #0c1112;
  --j-line: #283233;
  --j-accent: #55d8b7;
  --j-muted: #899899;
  --j-text: #eff4f3;
  color: var(--j-text);
  letter-spacing: 0;
}

.jarvis-panel [hidden],
.jarvis-panel[hidden],
.jarvis-launcher[hidden] { display: none !important; }
.jarvis-panel svg, .jarvis-launcher svg, .jarvis-nav svg { width: 18px; height: 18px; stroke-width: 1.7; flex-shrink: 0; }
.jarvis-nav { width: 100%; font: inherit; }
.jarvis-nav-badge { margin-left: auto; font-size: 10px; color: #55d8b7; }
.jarvis-launcher { position: fixed; right: 24px; bottom: 24px; z-index: 35; display: flex; gap: 14px; align-items: center; height: 52px; padding: 0 20px; border: 1px solid #425451; border-radius: 8px; background: #0c1112; box-shadow: 0 8px 30px #0006; font-size: 12px; font-weight: 700; }
.jarvis-launcher svg { color: var(--j-accent); }
.jarvis-launcher-dot, .j-status-indicator, .j-footer-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--j-accent); flex-shrink: 0; }
.jarvis-panel { position: fixed; z-index: 40; right: 20px; top: 20px; bottom: 20px; width: min(440px, calc(100vw - 40px)); display: grid; grid-template-rows: auto auto 164px auto auto auto minmax(80px, 1fr) auto auto auto; background: var(--j-surface); border: 1px solid #3b4948; border-radius: 8px; box-shadow: 0 20px 70px #0008; overflow: hidden; }
.jarvis-panel.is-expanded { width: min(740px, calc(100vw - 40px)); }
.jarvis-header { grid-row: 1; }
.jarvis-settings { grid-row: 2; }
.jarvis-core { grid-row: 3; }
.jarvis-statusline { grid-row: 4; }
.jarvis-data-strip { grid-row: 5; }
.jarvis-modebar { grid-row: 6; }
.jarvis-messages { grid-row: 7; }
.jarvis-notice { grid-row: 8; }
.jarvis-composer { grid-row: 9; }
.jarvis-footer { grid-row: 10; }
.jarvis-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 76px; padding: 0 22px; border-bottom: 1px solid var(--j-line); }
.jarvis-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.jarvis-identity > img { width: 20px; height: 38px; object-fit: contain; }
.jarvis-identity h2 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 650; }
.jarvis-identity span { display: block; color: var(--j-muted); font-size: 10px; margin-top: 4px; }
.jarvis-header-tools { display: flex; gap: 3px; }
.j-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; color: var(--j-muted); background: transparent; }
.j-icon-button:hover, .j-icon-button[aria-pressed="true"] { background: #202a29; color: var(--j-text); }
.jarvis-panel button:disabled { opacity: .4; cursor: not-allowed; }
.jarvis-panel :focus-visible, .jarvis-launcher:focus-visible { outline: 2px solid var(--j-accent); outline-offset: 2px; }
.jarvis-settings { padding: 12px 22px; border-bottom: 1px solid var(--j-line); display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 12px; }
.jarvis-settings input[type="password"] { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--j-line); border-radius: 4px; color: var(--j-text); background: #080d0e; }
.j-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; grid-column: 1 / -1; }
.j-setting-row input { accent-color: var(--j-accent); }
.j-setting-row input[type="range"] { width: 130px; }
.j-setting-row output { color: var(--j-muted); margin-left: 8px; font-variant-numeric: tabular-nums; }
.jarvis-core { position: relative; height: 164px; overflow: hidden; }
.jarvis-core canvas { display: block; width: 100%; height: 164px; }
.jarvis-core-center { position: absolute; width: 32px; height: 53px; left: 50%; top: 51px; transform: translateX(-50%); }
.jarvis-core-center img { width: 100%; height: 100%; object-fit: contain; opacity: .94; }
.jarvis-core-code, .jarvis-core-state { position: absolute; color: #718380; font-family: ui-monospace, monospace; font-size: 8px; pointer-events: none; }
.jarvis-core-code { top: 18px; left: 22px; }
.jarvis-core-state { top: 18px; right: 22px; color: var(--j-accent); }
.jarvis-statusline { display: flex; align-items: center; gap: 7px; padding: 0 22px 12px; font-size: 11px; min-width: 0; }
#jarvisStateLabel { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jarvis-connection { margin-left: auto; white-space: nowrap; color: var(--j-muted); font-size: 10px; }
.jarvis-data-strip { display: flex; align-items: center; gap: 22px; padding: 11px 22px; border-top: 1px solid var(--j-line); border-bottom: 1px solid var(--j-line); font-size: 10px; color: var(--j-muted); }
.jarvis-data-strip b { font-size: 12px; color: #d9e3e0; font-weight: 500; font-variant-numeric: tabular-nums; }
.jarvis-data-strip time { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jarvis-modebar { display: flex; align-items: center; gap: 8px; padding: 9px 22px; color: var(--j-muted); font-size: 10px; }
.jarvis-modebar select { border: 0; background: #1b2423; color: #dce6e4; padding: 6px 8px; border-radius: 4px; font: inherit; font-size: 11px; max-width: 108px; }
#jarvisModelLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jarvis-modebar .j-icon-button { margin-left: auto; width: 26px; height: 26px; flex-shrink: 0; }
.jarvis-modebar .j-icon-button svg { width: 14px; height: 14px; }
.jarvis-messages { overflow-y: auto; overscroll-behavior: contain; padding: 6px 22px 20px; scrollbar-width: thin; scrollbar-color: #354440 transparent; }
.jarvis-welcome { padding-top: 18px; }
.j-welcome-eyebrow { color: #748883; font-size: 9px; font-family: ui-monospace, monospace; }
.jarvis-welcome h3 { margin: 11px 0 22px; font-size: 20px; font-weight: 500; line-height: 1.5; }
.jarvis-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.jarvis-quick-actions button { display: flex; align-items: center; gap: 7px; min-height: 49px; padding: 0 2px; border: 0; border-top: 1px solid var(--j-line); border-radius: 0; background: transparent; color: #c2ceca; font: inherit; font-size: 11px; text-align: left; }
.jarvis-quick-actions button:hover { color: var(--j-accent); }
.jarvis-quick-actions button > svg:first-child { width: 14px; height: 14px; color: var(--j-accent); }
.jarvis-quick-actions button > svg:last-child { width: 12px; height: 12px; margin-left: auto; color: #6c7a76; }
.j-message { padding: 18px 0; border-bottom: 1px solid #202a28; min-width: 0; animation: j-message-appear .18s ease-out; }
.j-message:last-child { border-bottom: 0; }
.j-message-heading { display: flex; gap: 8px; align-items: center; color: #91a39e; font-size: 9px; margin-bottom: 10px; font-family: ui-monospace, monospace; }
.j-message-heading b { font-size: 10px; font-weight: 500; color: var(--j-accent); }
.j-message[data-role="user"] .j-message-heading b { color: #d1dcd8; }
.j-message-heading time { margin-left: auto; font-variant-numeric: tabular-nums; }
.j-message-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.85; color: #dce6e3; }
.j-citation { color: var(--j-accent); text-decoration: none; padding: 0 2px; }
.j-citation:hover { text-decoration: underline; }
.j-message[data-role="user"] .j-message-text { font-size: 13px; color: #f1f5f3; }
.j-message-text.is-pending::after { content: ""; display: inline-block; height: 11px; width: 4px; background: var(--j-accent); margin-left: 4px; animation: j-cursor 1s steps(2) infinite; }
.j-sources { margin-top: 16px; display: grid; gap: 0; }
.j-sources summary { font-size: 10px; color: var(--j-muted); cursor: pointer; padding: 7px 0; }
.j-source { display: grid; grid-template-columns: 22px minmax(0, 1fr) 20px; column-gap: 8px; padding: 10px 0; border-top: 1px solid #25302d; text-decoration: none; color: #d4e2db; }
.j-source > b { font: 10px ui-monospace, monospace; color: var(--j-accent); padding-top: 3px; }
.j-source-title { display: block; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.j-source-meta { display: block; font-size: 9px; line-height: 1.6; margin-top: 4px; color: #788c84; }
.j-source svg { width: 12px; height: 12px; margin-top: 5px; color: #94b0a3; }
.j-source:hover .j-source-title { color: var(--j-accent); }
.j-message-actions { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.j-message-actions .j-icon-button { width: 27px; height: 27px; }
.j-message-actions svg { width: 14px; height: 14px; }
.j-navigation { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 12px; max-width: 100%; color: var(--j-accent); background: transparent; border: 1px solid #364e45; border-radius: 4px; font: inherit; font-size: 11px; }
.j-navigation svg { width: 13px; height: 13px; }
.j-message-error { font-size: 11px; line-height: 1.7; color: #e0b375; padding: 8px 0; }
.jarvis-notice { padding: 9px 22px; border-top: 1px solid #454032; color: #e0b375; font-size: 11px; line-height: 1.7; background: #1b1b15; }
.jarvis-composer { padding: 12px 14px 10px; border-top: 1px solid var(--j-line); background: #101817; }
.jarvis-composer textarea { display: block; width: 100%; min-height: 48px; max-height: 96px; resize: none; border: 0; background: transparent; color: var(--j-text); font: inherit; font-size: 12px; line-height: 1.7; padding: 0 8px; outline: none; }
.jarvis-composer textarea::placeholder { color: #74877f; }
.jarvis-composer-bottom { display: flex; align-items: center; gap: 5px; padding-top: 5px; }
#jarvisInputCount { margin-left: auto; margin-right: 8px; font: 9px ui-monospace, monospace; color: #75877e; }
.j-send-button { width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; border: 0; border-radius: 4px; background: var(--j-accent); color: #07110c; }
.j-send-button svg { width: 17px; height: 17px; }
.j-stop-button { background: #e0b375; }
.jarvis-footer { min-height: 31px; display: flex; align-items: center; gap: 7px; padding: 0 22px; font-size: 8px; color: #788c82; border-top: 1px solid #1e2a24; font-family: ui-monospace, monospace; }
.jarvis-footer > span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.j-footer-dot { width: 3px; height: 3px; }
.jarvis-panel[data-state="listening"] .j-status-indicator, .jarvis-panel[data-state="speaking"] .j-status-indicator { animation: j-cursor .8s ease-in-out infinite; }
.jarvis-panel[data-state="listening"] #jarvisMic { color: var(--j-accent); background: #20372e; }
.jarvis-panel[data-state="error"] .j-status-indicator { background: #e0b375; }
.j-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
@keyframes j-cursor { 50% { opacity: .25; } }
@keyframes j-message-appear { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-height: 760px) {
  .jarvis-panel { grid-template-rows: auto auto 116px auto auto auto minmax(60px, 1fr) auto auto auto; }
  .jarvis-core, .jarvis-core canvas { height: 116px; }
  .jarvis-core-center { height: 38px; width: 24px; top: 34px; }
  .jarvis-header { height: 62px; }
  .jarvis-welcome { padding-top: 5px; }
  .jarvis-welcome h3 { font-size: 18px; margin: 7px 0 12px; }
}
@media (max-width: 600px) {
  .jarvis-panel, .jarvis-panel.is-expanded { width: 100%; top: 0; right: 0; bottom: 0; height: 100dvh; border: 0; border-radius: 0; }
  .jarvis-launcher { right: 16px; bottom: 16px; height: 46px; padding: 0 16px; }
  .jarvis-header { padding: 0 18px; }
  #jarvisExpand { display: none; }
  .jarvis-footer { padding-bottom: env(safe-area-inset-bottom); }
  .jarvis-messages { padding-left: 18px; padding-right: 18px; }
  .jarvis-settings { padding: 10px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .jarvis-panel *, .jarvis-launcher * { animation: none !important; scroll-behavior: auto !important; }
}
