/* ── Welcome modal (invite acceptance) ── */
.welcome-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-card {
  background: white;
  border-radius: 12px;
  padding: 32px 40px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: secureCardAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.welcome-img { width: 128px; height: auto; margin: 0 auto 16px; display: block; }
.welcome-title { font-size: 18px; font-weight: 600; color: var(--color-text-primary, #1c1917); margin-bottom: 4px; }
.welcome-subtitle { font-size: 14px; color: var(--color-text-muted, #79716b); margin-bottom: 8px; }
.welcome-body { font-size: 14px; color: var(--color-text-muted, #79716b); margin-bottom: 20px; }
.welcome-dismiss {
  padding: 8px 24px;
  background: var(--color-brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.welcome-dismiss:hover { background: var(--color-brand-hover); }

/* Chat wrapper layout */
.chat-wrapper {
  display: flex;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  transition: margin-right 0.25s ease;
  min-width: 0;
  overflow: hidden;
  animation: chatEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes chatEnter { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Chat header */
#chat-header {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  min-height: 48px;
  background: linear-gradient(180deg, var(--color-surface) 50%, transparent 100%);
}

.chat-download-group {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
  border-radius: 6px;
}
.chat-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-family: inherit;
  color: var(--color-text-muted, #79716b);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.chat-download-btn:hover {
  color: var(--color-text, #1c1917);
  background: var(--color-surface-hover, rgba(0,0,0,0.04));
}
.chat-download-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.chat-download-btn:hover svg {
  opacity: 1;
}
.chat-download-sep {
  width: 1px;
  height: 14px;
  background: var(--color-border, rgba(0,0,0,0.1));
}

/* TestFlight signup modal */
.testflight-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
}
.testflight-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}
.testflight-modal-card {
  position: relative;
  background: var(--color-surface, #fff);
  border-radius: 12px;
  padding: 28px 24px 24px;
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.testflight-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted, #79716b);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.testflight-close:hover { color: var(--color-text, #1c1917); }
.testflight-icon {
  color: var(--color-brand, #144629);
  margin-bottom: 12px;
}
.testflight-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--color-text, #1c1917);
}
.testflight-desc {
  font-size: 13px;
  color: var(--color-text-muted, #79716b);
  margin: 0 0 16px;
  line-height: 1.45;
}
.testflight-submit {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--color-brand, #144629);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
  box-sizing: border-box;
}
.testflight-submit:hover { opacity: 0.9; }

.chat-title-wrapper {
  position: relative;
}

.chat-title-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 60vw;
  background: none;
  border: none;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.25s ease, background 0.12s;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.chat-title-trigger.visible { opacity: 1; width: auto; padding: 4px 8px; overflow: visible; }
.chat-title-trigger:hover { background: var(--color-hover); }
.chat-title-trigger.open { background: var(--color-hover); }

.chat-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-chevron {
  opacity: 0;
  transition: opacity 0.15s, transform 0.2s;
  flex-shrink: 0;
}
.chat-title-trigger:hover .chat-title-chevron,
.chat-title-trigger.open .chat-title-chevron { opacity: 0.5; }
.chat-title-trigger.open .chat-title-chevron { transform: rotate(180deg); }

.chat-title-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 6px;
  min-width: 240px;
  background: var(--color-card);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px var(--color-border),
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.1),
    0 24px 48px rgba(0,0,0,0.06);
  z-index: var(--z-dropdown);
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.2s;
}
.chat-title-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.chat-rename-input {
  padding: 4px 8px 6px;
}
.chat-rename-input input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s;
}
.chat-rename-input input:focus {
  border-color: var(--color-brand);
}

.chat-credits-breakdown {
  padding: 2px 10px 4px;
}
.chat-credits-loading {
  font-size: 12px;
  color: #aaa;
}
.chat-credit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
  color: #666;
}
.chat-credit-value {
  font-weight: 500;
  color: #333;
  font-variant-numeric: tabular-nums;
}
.chat-credit-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0 2px;
  margin-top: 3px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

/* ── Chat sidebar additions (base sidebar + conversation list styles in application.css) ── */

/* Sidebar toggle (chat-only) */
#sidebar-toggle {
  position: absolute;
  left: 240px;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-sidebar-toggle);
  background: transparent;
  border: none;
  border-radius: 6px;
  width: 24px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #bbb;
  transition: color 0.12s, left 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.12s, scale 0.15s ease;
  padding: 0;
}
#sidebar-toggle:hover { color: #144629; background: rgba(255,255,255,0.95); scale: 1.05; }
#sidebar-toggle:active { scale: 0.95; }
#sidebar-toggle svg { width: 14px; height: 14px; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
#sidebar-toggle .sidebar-toggle-hamburger,
#sidebar-toggle .sidebar-toggle-close { display: none; }
#sidebar:not(.open) ~ #sidebar-toggle { left: 8px; }
#sidebar.open ~ #sidebar-toggle .sidebar-toggle-chevron { transform: rotate(180deg); }

/* Chat messages */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  line-height: 1.6;
  position: relative;
}
.msg-timestamp-hint {
  position: absolute;
  right: calc(100% + 8px);
  top: 8px;
  font-size: 11px;
  color: #bbb;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  cursor: default;
}
.msg-timestamp-hint.visible {
  opacity: 1;
  pointer-events: auto;
}
.msg-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  white-space: nowrap;
  font-size: 12px;
  color: #555;
  line-height: 1.6;
  z-index: 100;
  transform-origin: top left;
  animation: tooltip-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes tooltip-pop {
  0% { opacity: 0; transform: scale(0.4) translateY(-4px); }
  60% { opacity: 1; transform: scale(1.03) translateY(0); }
  80% { transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}
.msg-tooltip-out {
  animation: tooltip-shrink 0.15s ease-in both;
}
@keyframes tooltip-shrink {
  to { opacity: 0; transform: scale(0.85) translateY(-2px); }
}
.msg-tooltip-time {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.msg-tooltip-date {
  color: #999;
  font-size: 11px;
}
.msg-tooltip-meta {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(0,0,0,0.05);
  font-size: 11px;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg-tooltip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.msg-tooltip-dot.user { background: #555; }
.msg-tooltip-dot.assistant { background: #16a34a; }
.msg-tooltip-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 6px 0;
}
.msg-tooltip-timing {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: #999;
  line-height: 1.6;
}
.msg-tooltip-timing span:last-child {
  font-variant-numeric: tabular-nums;
  color: #666;
}

.message.user {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  color: var(--color-text-primary);
}

.message.assistant {
  font-size: 14px;
  padding: 0;
  color: var(--color-text-primary);
}

/* Markdown content */
.markdown-raw { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.content p { margin: 0 0 0.6em 0; }
.content p:last-child { margin-bottom: 0; }
.content h1, .content h2, .content h3, .content h4 {
  margin: 1em 0 0.4em 0;
  line-height: 1.3;
}
.content h1:first-child, .content h2:first-child, .content h3:first-child { margin-top: 0; }
.content h1 { font-size: 1.3em; }
.content h2 { font-size: 1.15em; }
.content h3 { font-size: 1.05em; }
.content ul { margin: 0.4em 0; padding-left: 1.5em; list-style-type: disc; color: inherit; }
.content ol { margin: 0.4em 0; padding-left: 1.5em; list-style-type: decimal; color: inherit; }
.content li::marker { color: #a49d98; }
.content li { margin: 0.2em 0; }
.content li > ul, .content li > ol { margin: 0.1em 0; }
.content a { color: #3b82f6; text-decoration: underline; }
.content a:hover { color: #2563eb; }
.content hr { border: none; border-top: 1px solid rgba(180,170,160,0.2); margin: 1em 0; }
.content blockquote {
  border-left: 3px solid rgba(180,170,160,0.3);
  padding-left: 12px;
  margin: 0.6em 0;
  color: #666;
}
.content code {
  background: rgba(245,243,240,0.6);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
.content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.6em 0;
  font-size: 0.85em;
  line-height: 1.5;
}
.content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.content table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.8em 0;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}
.content th, .content td {
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 8px 12px;
  text-align: left;
  font-size: 0.88em;
}
.content th {
  background: #f8f8f8;
  font-weight: 600;
  font-size: 0.82em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.content tr:last-child td { border-bottom: none; }
.content tbody tr:hover { background: rgba(0,0,0,0.015); }
.content td:not(:last-child), .content th:not(:last-child) {
  border-right: 1px solid rgba(0,0,0,0.04);
}
.content strong { font-weight: 600; }

.error-text {
  color: #a44;
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(170,68,68,0.06);
  border-radius: 8px;
  display: inline-block;
  animation: fadeSlideIn 0.3s ease-out;
}

/* Word fade animation */
.wf {
  display: inline;
  animation: wordIn 0.28s ease-out both;
}
@keyframes wordIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Tool cards */
.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245,243,240,0.6);
  border: none;
  border-radius: 12px;
  margin: 8px 0;
  font-size: 13px;
  transition: background 0.4s ease;
  animation: toolCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.tool-card.complete {
  background: rgba(230,242,233,0.5);
}
.tool-card.error {
  background: rgba(254,240,237,0.5);
}
.tool-card.warning {
  background: rgba(254,247,230,0.5);
}
.tool-card.skipped {
  background: rgba(0,0,0,0.03);
  opacity: 0.5;
}
/* Secure store card — slate theme for completed/resolved secure_store tool cards */
.tool-card[data-tool-name="secure_store"] {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(100,116,139,0.3);
  color: #e2e8f0;
}
.tool-card[data-tool-name="secure_store"].complete {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-color: rgba(100,116,139,0.4);
}
.tool-card[data-tool-name="secure_store"] .tool-icon svg {
  stroke: #3b82f6;
}
.tool-card[data-tool-name="secure_store"] .tool-label {
  color: #e2e8f0;
  font-weight: 600;
}
.tool-card[data-tool-name="secure_store"] .tool-target {
  color: #94a3b8;
}
.tool-card[data-tool-name="secure_store"] .tool-status .check {
  color: #22c55e;
}
.tool-card[data-tool-name="secure_store"] .tool-status .dot {
  background: #3b82f6;
}
.tool-card[data-tool-name="secure_store"] .tool-chevron svg {
  stroke: #64748b;
}
.tool-card[data-tool-name="secure_store"] .tool-duration {
  color: #64748b;
}
.tool-card[data-tool-name="secure_store"] .tool-details {
  border-top-color: rgba(59,130,246,0.15);
}
.tool-card[data-tool-name="secure_store"] .tool-detail-table .td-key {
  color: #64748b;
}
.tool-card[data-tool-name="secure_store"] .tool-detail-table .td-val {
  color: #cbd5e1;
}
.tool-card[data-tool-name="secure_store"] .tool-detail-table code {
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
}
.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #86868b;
  background: none;
  border: none;
  padding: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
}
.secure-badge svg {
  width: 10px;
  height: 10px;
  opacity: 0.6;
}
.secure-credential-list {
  margin: 6px 0 2px;
  padding: 0;
  list-style: none;
}
.secure-credential-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: #94a3b8;
}
.secure-credential-item .cred-label {
  color: #cbd5e1;
  font-weight: 500;
}
.secure-credential-item .cred-dots {
  color: #3b82f6;
  letter-spacing: 2px;
  font-size: 14px;
}
.secure-credential-item .cred-lock {
  display: flex;
  align-items: center;
}
.secure-credential-item .cred-lock svg {
  width: 12px;
  height: 12px;
  stroke: #3b82f6;
}

/* Secure input card — higher specificity to override .tool-card base */
.tool-card.secure-input-card {
  background: rgba(20, 70, 41, 0.03);
  border: 1px solid rgba(20, 70, 41, 0.12);
  box-shadow: 0 1px 3px rgba(20, 70, 41, 0.06);
  color: #333;
  padding: 24px;
  border-radius: 16px;
  flex-direction: column;
  max-width: none;
  animation: secureCardAppear 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes secureCardAppear {
  0% { opacity: 0; transform: scale(0.96) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.secure-input-card .tool-icon {
  display: none;
}
.secure-input-card .tool-body {
  width: 100%;
}
.secure-input-card .tool-label {
  display: none;
}
.tool-card.secure-input-card.resolved {
  padding: 16px 24px;
}
/* Two-column split layout */
.secure-input-split {
  display: flex;
  gap: 24px;
}
.secure-input-left {
  flex: 1;
  min-width: 0;
}
.secure-input-left-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.secure-input-right {
  width: 200px;
  flex-shrink: 0;
}
.secure-input-header-icon {
  width: 36px;
  height: 36px;
  background: rgba(20, 70, 41, 0.06);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  color: var(--color-brand, #144629);
  animation: lockIconAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
@keyframes lockIconAppear {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
.secure-input-header-icon svg {
  width: 22px;
  height: 22px;
}
.secure-input-title {
  font-size: 15px;
  font-weight: 600;
  color: #144629;
  margin: 0;
  letter-spacing: -0.01em;
}
.secure-input-prompt {
  margin-top: 0;
}
.secure-input-details {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: none;
  border-radius: 0;
  border: none;
}
.secure-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.secure-detail-label {
  font-size: 10px;
  font-weight: 600;
  color: #144629;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.secure-detail-value {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
  font-weight: 400;
}
.secure-detail-value code {
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  font-size: 10.5px;
  background: rgba(20, 70, 41, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  color: #144629;
}
.secure-ttl-label {
  display: block;
  color: #888;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.secure-ttl-picker {
  display: flex;
  background: rgba(20, 70, 41, 0.04);
  border: 1px solid rgba(20, 70, 41, 0.08);
  border-radius: 8px;
  padding: 2px;
  margin-bottom: 14px;
  gap: 2px;
}
.secure-ttl-option {
  flex: 1;
  background: none;
  border: none;
  color: #888;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.secure-ttl-option:hover {
  color: #555;
}
.secure-ttl-option.active {
  background: #144629;
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 70, 41, 0.2);
}
/* Multi-field grid */
.secure-fields-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.secure-field-group {
  flex: 1 1 100%;
}
.secure-field-group.secure-field-half {
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
}
.secure-field-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #666;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.secure-input-field {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(20, 70, 41, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  color: #333;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}
.secure-input-field:focus {
  border-color: #144629;
  box-shadow: 0 0 0 3px rgba(20, 70, 41, 0.08);
}
.secure-input-field::placeholder {
  color: #bbb;
  font-weight: 400;
  letter-spacing: 0;
}
.secure-input-field:disabled {
  opacity: 0.4;
}
.secure-input-submit.secure-submit-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 16px;
  background: #144629;
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.secure-input-submit.secure-submit-full:hover {
  opacity: 0.9;
}
.secure-input-submit.secure-submit-full:active {
  transform: scale(0.98);
}
.secure-input-submit.secure-submit-full:disabled {
  background: #144629;
  opacity: 0.4;
  cursor: not-allowed;
}
.secure-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: secureSpinnerRotate 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes secureSpinnerRotate {
  to { transform: rotate(360deg); }
}
.secure-input-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0;
}
.secure-success-icon {
  width: 52px;
  height: 52px;
  background: rgba(20, 70, 41, 0.06);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(20, 70, 41, 0.1);
  position: relative;
  animation: successIconAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes successIconAppear {
  0% { opacity: 0; transform: scale(0.3); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
.secure-success-icon svg {
  width: 26px;
  height: 26px;
}
.secure-success-check {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  background: #144629;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(20,70,41,0.3);
  animation: checkAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}
@keyframes checkAppear {
  0% { opacity: 0; transform: scale(0) rotate(-45deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.secure-success-check svg {
  width: 11px;
  height: 11px;
}
.secure-success-text {
  color: #144629;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  animation: successTextAppear 0.4s ease 0.5s both;
}
@keyframes successTextAppear {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.secure-input-dots {
  color: rgba(20, 70, 41, 0.3);
  letter-spacing: 3px;
  font-size: 12px;
  margin-top: -4px;
  animation: successTextAppear 0.3s ease 0.65s both;
}
.secure-input-expires {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  animation: successTextAppear 0.3s ease 0.8s both;
}

.tool-card.approval {
  background: rgba(245,243,240,0.6);
  outline: 2px solid #144629;
  outline-offset: -2px;
  padding: 16px 20px;
  animation: approvalPulse 2s ease-in-out infinite;
}
.tool-card.approval.resolved {
  outline: none;
  animation: none;
}
@keyframes approvalPulse {
  0%, 100% { outline-color: #144629; }
  50% { outline-color: rgba(20,70,41,0.3); }
}

/* Approval UI */
.approval-title {
  color: #144629;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.approval-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.approval-status.approved { color: #144629; }
.approval-status.denied { color: #999; }
.approval-status svg { flex-shrink: 0; }
/* Hide resolved approval details when card is collapsed */
.tool-card.complete:not(.expanded) .approval-summary,
.tool-card.error:not(.expanded) .approval-summary,
.tool-card.complete:not(.expanded) .browse-link-preview {
  display: none;
}
.approval-summary {
  color: #555;
  font-size: 12.5px;
  margin: 10px 0 0;
  line-height: 1.6;
  white-space: pre-line;
}
.reveal-btn {
  display: inline-block;
  margin-left: 6px;
  background: none;
  border: 1px solid rgba(180,170,160,0.3);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  font-family: inherit;
  vertical-align: middle;
  transition: color 0.12s, border-color 0.12s;
}
.reveal-btn:hover { color: #333; border-color: rgba(180,170,160,0.5); }
.approval-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}
.approval-settings-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: #999;
  text-decoration: none;
  cursor: pointer;
}
.approval-settings-link:hover {
  color: #666;
  text-decoration: underline;
}
.approval-btn {
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.approval-btn.approve { background: #144629; color: #fff; }
.approval-btn.approve:hover { background: #0e321d; }
.approval-btn.approve-session { background: transparent; color: #144629; border: 1.5px solid #144629; }
.approval-btn.approve-session:hover { background: rgba(20,70,41,0.06); }
.approval-btn.deny { background: rgba(235,232,228,0.7); color: #666; }
.approval-btn.deny:hover { background: rgba(225,222,218,0.9); }
.approval-btn:disabled { opacity: 0.5; cursor: default; }
.approval-waiting-text { font-size: 13px; color: #999; margin-top: 8px; border-left: 2px solid #e5e0d8; padding-left: 10px; }

/* Auto-approve modal */
.auto-approve-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.12s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.auto-approve-modal {
  background: #fff;
  border-radius: 14px;
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.15s ease-out;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.auto-approve-header {
  padding: 20px 22px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.auto-approve-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}
.auto-approve-header p {
  margin: 0;
  font-size: 12.5px;
  color: #888;
  line-height: 1.4;
}
.auto-approve-list {
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
}
.auto-approve-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px 4px;
  margin-top: 4px;
}
.auto-approve-group:first-child {
  margin-top: 0;
}
.auto-approve-group-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}
.auto-approve-group-icon svg {
  width: 14px;
  height: 14px;
}
.auto-approve-group-label {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auto-approve-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 22px 7px 46px;
  transition: background 0.1s;
}
.auto-approve-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auto-approve-badge {
  font-size: 11px;
  color: #999;
  min-width: 44px;
  text-align: right;
}
.auto-approve-badge.auto {
  color: #144629;
}
.auto-approve-row:hover {
  background: rgba(0,0,0,0.02);
}
.auto-approve-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auto-approve-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auto-approve-icon svg {
  width: 18px;
  height: 18px;
}
.auto-approve-label {
  font-size: 13.5px;
  color: #333;
}
.auto-approve-toggle {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: #ddd;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.auto-approve-toggle.on {
  background: #144629;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.auto-approve-toggle.on .toggle-knob {
  transform: translateX(16px);
}
.auto-approve-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.auto-approve-cancel {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: rgba(235,232,228,0.7);
  color: #666;
  border: none;
  transition: background 0.15s;
}
.auto-approve-cancel:hover { background: rgba(225,222,218,0.9); }
.auto-approve-save {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: #144629;
  color: #fff;
  border: none;
  transition: background 0.15s;
}
.auto-approve-save:hover { background: #0e321d; }

/* Active phone call */
.tool-card.call-active .tool-header { cursor: default; }

/* Browser live view */
.tool-card.browser-active {
  padding: 12px 14px;
}
.tool-card.browser-active.expanded .tool-details,
.tool-card.browser-viewer-card.expanded .tool-details {
  max-height: none;
  opacity: 1;
  overflow: visible;
}
/* Hide full step log when collapsed */
.tool-card:not(.expanded) .browser-live,
.tool-card:not(.expanded) .browser-steps-log {
  display: none;
}
/* Mini preview: visible only when collapsed + still running */
.browser-preview { display: none; }
.tool-card.browser-active:not(.expanded):not(.complete) .browser-preview {
  display: block;
  margin-top: 8px;
}
.browser-preview-step {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.browser-preview-step .bse-num {
  width: 18px;
  height: 18px;
  font-size: 10px;
}
.browser-preview-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  display: block;
}
/* Hide preview when expanded */
.tool-card.browser-active.expanded .browser-preview {
  display: none;
}
/* Proof of work: last screenshot shown when completed + collapsed */
.browser-proof {
  margin-top: 8px;
  cursor: pointer;
}
.browser-proof-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  display: block;
}
.browser-proof-caption {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}
/* Hide proof when expanded (full step log is visible) */
.tool-card.expanded .browser-proof {
  display: none;
}
.tool-card.browser-viewer-card .td-result {
  max-height: none;
  overflow: visible;
}
.tool-card[data-tool-name="browse_web"] .td-result img {
  display: none;
}
.browser-live {
  margin-top: 10px;
}
.browser-live-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}
.browser-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17b26a;
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
.browser-live-link {
  margin-left: auto;
  color: #144629;
  text-decoration: none;
  font-weight: 500;
  font-size: 11px;
}
.browser-live-link:hover { text-decoration: underline; }
.browser-live-frame {
  width: 100%;
  aspect-ratio: 16/10;
  max-height: 500px;
  border: 1px solid rgba(180,170,160,0.15);
  border-radius: 8px;
  background: #f5f4ef;
}
/* Browser step viewer */
.browser-viewer-card { max-width: 100%; }
.browser-viewer {
  margin-top: 10px;
  border: 1px solid rgba(180,170,160,0.15);
  border-radius: 10px;
  overflow: hidden;
  background: #faf9f7;
}
.bv-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(20,70,41,0.04);
  border-bottom: 1px solid rgba(180,170,160,0.12);
}
.bv-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(20,70,41,0.15);
  border-top-color: #144629;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.tool-card.complete .bv-spinner,
.tool-card.error .bv-spinner,
.tool-card.warning .bv-spinner { display: none; }
.bv-status-text {
  font-size: 12px;
  color: #444;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bv-timer {
  font-size: 11px;
  color: #999;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.bv-screenshot-wrap {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0efeb;
}
.bv-placeholder {
  color: #bbb;
  font-size: 13px;
  padding: 40px;
}
.bv-screenshot {
  display: block;
  width: 100%;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.bv-screenshot.expanded {
  position: fixed;
  top: 3vh;
  left: 3vw;
  width: 94vw;
  height: 94vh;
  object-fit: contain;
  z-index: 1000;
  background: rgba(0,0,0,0.9);
  border-radius: 8px;
  padding: 16px;
  cursor: zoom-out;
}
.bv-step-info {
  padding: 10px 14px;
  border-top: 1px solid rgba(180,170,160,0.12);
}
.bv-step-desc {
  font-size: 13px;
  color: #333;
  line-height: 1.45;
}
.bv-step-url {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bv-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid rgba(180,170,160,0.12);
  background: rgba(180,170,160,0.04);
}
.bv-prev, .bv-next {
  background: none;
  border: 1px solid rgba(180,170,160,0.25);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  transition: all 0.15s;
}
.bv-prev:hover:not(:disabled), .bv-next:hover:not(:disabled) {
  background: #fff;
  border-color: #144629;
  color: #144629;
}
.bv-prev:disabled, .bv-next:disabled {
  opacity: 0.3;
  cursor: default;
}
.bv-counter {
  font-size: 12px;
  color: #888;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: center;
}
.tool-card.browser-active.complete .browser-live-dot { animation: none; background: #999; }

/* Browser step log */
.browser-steps-log {
  margin-top: 8px;
  overflow-y: auto;
}
.browser-step-entry {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 12.5px;
  color: #555;
  animation: fadeIn 0.15s ease-out;
}
.browser-step-entry:last-child { border-bottom: none; }
.bse-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.bse-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(20,70,41,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #144629;
}
.bse-desc { flex: 1; line-height: 1.4; }
.bse-screenshot {
  display: block;
  width: 100%;
  border-radius: 6px;
  margin-top: 2px;
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: opacity 0.15s;
}
.bse-screenshot:hover { opacity: 0.9; }

/* YouTube transcript preview */
.yt-preview {
  position: relative;
  margin: 6px 0 4px;
  max-width: 320px;
}
.yt-preview a {
  display: block;
  position: relative;
  line-height: 0;
}
.yt-preview img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.yt-preview a:hover img {
  opacity: 0.85;
}
.yt-preview .yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 34px;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.15s;
}
.yt-preview a:hover .yt-play {
  opacity: 1;
}
.yt-preview .yt-play svg {
  width: 100%;
  height: 100%;
}
.yt-preview .yt-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  letter-spacing: 0.3px;
  pointer-events: none;
}
.yt-meta {
  padding: 8px 2px 0;
}
.yt-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary, #1c1917);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-channel {
  font-size: 12px;
  color: var(--color-text-muted, #79716b);
  margin-top: 2px;
  line-height: 1.3;
}
.tool-card[data-tool-name="youtube_transcript"] .tool-icon svg {
  fill: #FF0000;
}

/* Browser step shimmer placeholder */
.browser-step-placeholder {
  padding: 10px 0;
}
.browser-step-placeholder .shimmer-circle {
  background: rgba(0,0,0,0.06);
  animation: shimmer-pulse 1.5s ease-in-out infinite;
}
.shimmer-line {
  display: inline-block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.02) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer-sweep 1.5s ease-in-out infinite;
}
.shimmer-block {
  height: 120px;
  border-radius: 6px;
  margin-top: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.015) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer-sweep 1.5s ease-in-out infinite;
}
@keyframes shimmer-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes shimmer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Tool status indicators */
.tool-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: 11px;
  color: #999;
  vertical-align: middle;
}
.tool-status .dot {
  width: 6px;
  height: 6px;
  background: #e8a020;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
.tool-status .check { color: #079455; font-weight: 600; animation: checkPop 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.tool-status .error-x { color: #c53030; font-weight: 600; animation: checkPop 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.tool-status .warning-icon { color: #b7791f; font-weight: 600; animation: checkPop 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

/* Wait tool zzz icon + countdown */
.wait-icon-zzz {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-style: italic;
  color: #144629;
  font-size: 10px;
  line-height: 1;
  gap: 0.5px;
}
.wait-icon-zzz span:nth-child(1) {
  font-size: 12px;
  animation: zzz-float 2s ease-in-out infinite 0.3s;
  transform: translateY(-1px);
}
.wait-icon-zzz span:nth-child(2) {
  font-size: 14px;
  animation: zzz-float 2s ease-in-out infinite 0.6s;
  transform: translateY(-3px);
}
@keyframes zzz-float {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}
.tool-card.complete .wait-icon-zzz span,
.tool-card.error .wait-icon-zzz span,
.tool-card.warning .wait-icon-zzz span {
  animation: none;
  opacity: 0.5;
}
.wait-progress {
  display: inline-block;
  width: 48px;
  height: 4px;
  background: #e5e0d8;
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
}
.wait-bar {
  display: block;
  height: 100%;
  background: #8b7355;
  border-radius: 2px;
  transition: width 1s linear;
}
.tool-error-detail {
  color: #c53030;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.4;
}
.tool-map {
  width: 100%;
  height: 240px;
  border-radius: 8px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(180,170,160,0.2);
}

/* --- Place list (search_places) --- */
.place-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.place-item {
  display: flex;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(180,170,160,0.12);
}
.place-item:last-child { border-bottom: none; }
.place-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #144629;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.place-info { flex: 1; min-width: 0; }
.place-name { font-weight: 600; font-size: 13px; color: #1a1a1a; }
.place-addr { font-size: 12px; color: #666; margin-top: 1px; }
.place-meta { font-size: 12px; color: #888; margin-top: 2px; }
.place-links { margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.place-link {
  font-size: 12px;
  color: #144629;
  text-decoration: none;
}
.place-link:hover { text-decoration: underline; }

/* --- Rich content cards (shared) --- */
.rich-cards {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Flight cards — Google Flights row style */
.flight-cards { gap: 4px; }
.rc-flight {
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.rc-flight:hover { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.rc-flight-body {}
.rc-row {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 14px;
}
.rc-row + .rc-row { padding-top: 2px; }
.rc-logo {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: contain;
}
.rc-logo-fallback {
  fill: #bbb;
}
.rc-col-times { flex: 1; min-width: 0; }
.rc-times {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.rc-time {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
}
.rc-time-sep {
  font-size: 12px;
  color: #999;
}
.rc-airline {
  font-size: 11px;
  color: #888;
  margin-top: 1px;
}
.rc-col-duration {
  width: 56px;
  flex-shrink: 0;
  text-align: center;
}
.rc-duration {
  font-size: 12px;
  color: #555;
}
.rc-col-stops {
  width: 60px;
  flex-shrink: 0;
}
.rc-stops {
  font-size: 11px;
  color: #888;
}
.rc-stops.nonstop {
  color: #15803d;
  font-weight: 500;
}
.rc-leg-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 1px;
}
.rc-leg-icon {
  width: 12px;
  height: 12px;
  fill: #bbb;
  flex-shrink: 0;
}
.rc-leg-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #bbb;
  font-weight: 500;
}
.rc-cabin {
  font-size: 11px;
  color: #999;
}
.rc-price {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  min-width: 55px;
  text-align: right;
}
.rc-chevron {
  color: #bbb;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.rc-chevron-spacer { width: 16px; flex-shrink: 0; }
.rc-flight.expanded .rc-chevron { transform: rotate(180deg); }
.rc-detail {
  display: none;
  padding: 8px 14px 12px;
  border-top: 1px solid rgba(0,0,0,0.04);
  background: #fafafa;
}
.rc-flight.expanded .rc-detail { display: block; }
.rc-detail-leg-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  margin: 8px 0 4px;
}
.rc-detail-leg-label:first-child { margin-top: 0; }
.rc-detail-seg {
  padding: 4px 0;
}
.rc-detail-seg-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rc-detail-seg-main .rc-logo { width: 16px; height: 16px; }
.rc-detail-seg-info { flex: 1; min-width: 0; }
.rc-detail-seg-times {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}
.rc-detail-seg-route {
  font-size: 11px;
  color: #888;
  margin-top: 1px;
}
.rc-detail-seg-dur {
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}
.rc-detail-layover {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0 5px 7px;
  margin-left: 1px;
  border-left: 2px dashed #ddd;
  font-size: 11px;
  color: #b45309;
}
.rc-detail-layover-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ddd;
  flex-shrink: 0;
  margin-left: -10px;
}
.rc-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 12px;
  margin-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.04);
  padding-top: 6px;
}
.rc-detail-key { color: #999; }
.rc-detail-val { color: #333; font-weight: 500; }

/* Hotel cards */
.rc-hotel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(180,170,160,0.2);
}
.rc-hotel-main { flex: 1; min-width: 0; }
.rc-hotel-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}
.rc-hotel-room {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}
.rc-cancel {
  display: inline-block;
  font-size: 11px;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 4px;
}
.rc-cancel-free {
  background: rgba(20,70,41,0.08);
  color: #144629;
}
.rc-cancel-no {
  background: rgba(197,48,48,0.06);
  color: #c53030;
}
.rc-hotel-price {
  text-align: right;
  flex-shrink: 0;
}
.rc-hotel-pernight {
  font-size: 18px;
  font-weight: 700;
  color: #144629;
}
.rc-hotel-perlabel {
  font-size: 11px;
  color: #888;
}
.rc-hotel-total {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 1px;
}

/* Email cards */
.rc-email {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(180,170,160,0.2);
  cursor: default;
}
.rc-email-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #144629;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rc-email-body { flex: 1; min-width: 0; }
.rc-email-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.rc-email-from {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-email-date {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}
.rc-email-subject {
  font-size: 13px;
  color: #1a1a1a;
  font-weight: 500;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-email-snippet {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Calendar event cards */
.rc-event {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(180,170,160,0.2);
}
.rc-event-bar {
  width: 3px;
  border-radius: 2px;
  background: #144629;
  flex-shrink: 0;
}
.rc-event-body { flex: 1; min-width: 0; }
.rc-event-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}
.rc-event-time {
  font-size: 12px;
  color: #666;
  margin-top: 1px;
}
.rc-event-loc {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}
.rc-event-link {
  display: flex;
  align-items: center;
  color: #999;
  flex-shrink: 0;
  transition: color 0.15s;
}
.rc-event-link:hover { color: #144629; }

/* Contact cards */
.rc-contact {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(180,170,160,0.2);
}
.rc-contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #144629, #1a5c36);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rc-contact-info { flex: 1; min-width: 0; }
.rc-contact-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}
.rc-contact-org {
  font-size: 12px;
  color: #888;
  margin-top: 1px;
}
.rc-contact-detail {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
  margin-top: 3px;
}
.rc-contact-detail svg { flex-shrink: 0; color: #999; }

/* File cards */
.file-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}
.rc-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(180,170,160,0.2);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s, box-shadow 0.12s;
}
.rc-file:hover {
  background: rgba(245,243,240,0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rc-file-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rc-file-info { flex: 1; min-width: 0; }
.rc-file-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-file-meta {
  font-size: 11px;
  color: #999;
  margin-top: 1px;
}

/* Visualization embed */
.viz-embed {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.viz-chart {
  width: 100%;
  border: 1px solid var(--color-pine-gray-200, #eceae9);
  border-radius: 10px;
  background: #fff;
  padding: 16px 12px 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.viz-chart .vega-embed {
  width: 100%;
}
.viz-chart .vega-embed .vega-actions a {
  font-family: 'Figtree', ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  color: var(--color-text-secondary, #57534e);
}
.viz-png-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.viz-png-thumb {
  max-width: 180px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid rgba(180,170,160,0.25);
  object-fit: contain;
  background: #fff;
}
.viz-png-download {
  font-size: 12px;
  color: #666;
  text-decoration: none;
  border: 1px solid rgba(180,170,160,0.3);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}
.viz-png-download:hover { background: rgba(180,170,160,0.1); }

/* Task cards */
.rc-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(180,170,160,0.2);
}
.rc-task-done { opacity: 0.6; }
.rc-task-done .rc-task-title { text-decoration: line-through; }
.rc-task-check {
  flex-shrink: 0;
  margin-top: 1px;
}
.rc-task-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.rc-task-title {
  font-size: 13px;
  color: #1a1a1a;
}
.rc-task-priority {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rc-task-due {
  font-size: 11px;
  color: #888;
  margin-left: auto;
}
.google-auth-prompt {
  margin-top: 8px;
  padding: 0;
}
.google-auth-prompt-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  background: #fafafa;
}
.google-auth-prompt-inner svg {
  flex-shrink: 0;
  color: #666;
}
.google-auth-prompt-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.google-auth-prompt-text strong {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}
.google-auth-prompt-text span,
.google-auth-prompt-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}
.google-auth-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: #144629;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.google-auth-btn:hover {
  background: #1a5c35;
}
.tool-card.auth-needed {
  border-color: #e2e2e2;
}
.google-auth-prompt-inner.connected {
  background: #f7f6f3;
  border-color: transparent;
}
.google-auth-prompt-inner.connected strong {
  color: #6b7c6b;
}
.tool-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.tool-icon svg {
  width: 16px;
  height: 16px;
}
.tool-body { flex: 1; min-width: 0; }
.tool-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.tool-header .tool-label { flex: 1; }
.tool-chevron {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #999;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.15s;
  transform: rotate(-90deg);
}
.tool-chevron:hover { color: #555; }
.tool-card.expanded .tool-chevron { transform: rotate(0deg); }
.tool-connection {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #888;
  padding: 3px 0 1px;
  line-height: 1;
}
.tool-connection svg { flex-shrink: 0; opacity: 0.4; }
.tool-conn-link {
  color: #888;
  text-decoration: none;
  cursor: pointer;
}
.tool-conn-link:hover { color: #555; text-decoration: underline; }
.tool-conn-link strong { color: #666; font-weight: 600; }
.tool-conn-email { color: #aaa; }
.tool-conn-email::before { content: "("; }
.tool-conn-email::after { content: ")"; }
.tool-conn-scope {
  font-size: 10px;
  background: rgba(180,170,160,0.15);
  color: #999;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: capitalize;
}
.tool-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, opacity 0.2s;
  opacity: 0;
}
.tool-card.expanded .tool-details {
  max-height: 600px;
  opacity: 1;
  transition: max-height 0.35s ease-in, opacity 0.2s 0.05s;
}
.tool-detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
}
.tool-detail-table tr { border-top: 1px solid rgba(180,170,160,0.15); }
.tool-detail-table tr:first-child { border-top: none; }
.td-key {
  color: #999;
  font-weight: 500;
  padding: 4px 12px 4px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 70px;
}
.td-val {
  color: #555;
  padding: 4px 0;
  word-break: break-word;
}
.td-val code {
  background: rgba(180,170,160,0.12);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
}
.td-result {
  margin: 0;
  font-size: 11px;
  font-family: inherit;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(180,170,160,0.06);
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.5;
}
.td-result img {
  max-width: 100%;
  border-radius: 6px;
  margin: 6px 0;
  cursor: pointer;
  transition: opacity 0.2s;
  border: 1px solid #e5e2d9;
}
.td-result img:hover { opacity: 0.85; }

/* Screenshot lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-lightbox);
  cursor: pointer;
  animation: fadeIn 0.15s ease-out;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
}
.lightbox-close:hover { opacity: 1; }
.td-status { font-weight: 500; }
.td-status-success { color: #079455; }
.td-status-error { color: #c53030; }
.td-status-warning { color: #b7791f; }
.tool-label { color: #333; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-target { color: #666; font-weight: 400; }
.tool-detail {
  color: #888;
  font-size: 12px;
  margin-top: 2px;
}
.tool-params {
  display: none;
}
.tool-params .param-key {
  color: #8250df;
  font-weight: 500;
}
.tool-params .param-val {
  color: #1a1a1a;
}
.sensitive-mask {
  cursor: pointer;
  user-select: none;
}
.sensitive-mask .mask-dots { display: inline; }
.sensitive-mask .mask-real { display: none; }
.sensitive-mask:hover .mask-dots { display: none; }
.sensitive-mask:hover .mask-real { display: inline; }
.tool-result {
  display: none;
}
.tool-query {
  color: #555;
  font-size: 12px;
  margin-top: 2px;
  font-style: italic;
}

/* Search containers */
.search-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(245,243,240,0.6);
  border: none;
  border-radius: 12px;
  margin: 8px 0;
  font-size: 13px;
  animation: toolCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.search-container .search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.search-container .search-icon svg {
  width: 16px;
  height: 16px;
}
.search-body { flex: 1; min-width: 0; }
.search-header {
  color: #333;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 6px;
}
.search-header .search-query { color: #555; }
.search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.search-results .sr-visible {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.search-results .sr-overflow {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.search-results .sr-overflow.open { display: flex; }
.sr-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  font-family: inherit;
}
.sr-toggle:hover { color: #555; }
.sr-toggle .sr-chevron {
  font-size: 8px;
  transition: transform 0.2s;
}
.sr-toggle.open .sr-chevron { transform: rotate(90deg); }
.search-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #555;
  line-height: 1.3;
  animation: resultIn 0.25s ease-out both;
}
.search-result .sr-favicon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-result .sr-favicon img {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}
.search-result .sr-favicon .sr-loading {
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(180,170,160,0.2);
  border-top-color: #999;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.search-result a {
  color: #144629;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result a:hover { text-decoration: underline; }
.search-result .sr-domain {
  color: #888;
  font-size: 10px;
}

/* Cursor / streaming */
.cursor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: text-bottom;
}
.cursor-bar {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #144629;
  animation: blink 0.8s step-end infinite;
}
.message.assistant:has(.thinking-inline:not(.done)) .cursor-status {
  display: none;
}
.cursor-status {
  display: inline-block;
  font-size: 12px;
  font-style: italic;
  background: linear-gradient(90deg, rgba(153,153,153,1) 0%, rgba(180,175,170,1) 40%, rgba(200,195,188,1) 50%, rgba(180,175,170,1) 60%, rgba(153,153,153,1) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 3s ease-in-out infinite;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Input area */
#chat-input-area {
  border-top: none;
  background: linear-gradient(0deg, var(--color-surface) 60%, transparent 100%);
  padding: 20px 24px 16px;
}
#chat-input-area form {
  max-width: 720px;
  margin: 0 auto;
}
#input-container {
  border-radius: 16px;
  background: var(--color-input-bg);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
#input-container:focus-within {
  box-shadow: 0 0 0 3px var(--color-brand-subtle);
}
#input-row {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 4px;
}
#chat-input-area textarea {
  flex: 1;
  padding: 6px 8px;
  border: none;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
  max-height: 150px;
  background: transparent;
  margin-bottom: 2px;
}
#chat-input-area #send-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--color-brand);
  color: var(--color-brand-text);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
  margin-bottom: 2px;
}
#chat-input-area #send-btn svg { width: 16px; height: 16px; stroke-width: 2.5; }
#chat-input-area #send-btn:hover { background: var(--color-brand-hover); }
#chat-input-area #send-btn:active { transform: scale(0.93); }
#chat-input-area #send-btn:disabled { background: rgba(180,170,160,0.35); cursor: default; }
#stop-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--color-brand);
  color: var(--color-brand-text);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
  transition: background 0.15s, transform 0.15s;
  animation: btnSwap 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#stop-btn svg { width: 14px; height: 14px; }
#stop-btn:hover { background: var(--color-brand-hover); }
#stop-btn:active { background: #0e321d; transform: scale(0.93); }
.stopped-indicator {
  display: inline-block;
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-top: 8px;
}

/* File upload */
#chat-input-area #attach-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  margin-bottom: 2px;
}
#chat-input-area #attach-btn:hover { color: #666; background: rgba(0,0,0,0.04); }
#chat-input-area #attach-btn svg { width: 18px; height: 18px; stroke-width: 1.5; }
#file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 12px 4px;
}
#file-previews:empty { display: none; padding: 0; }
.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(225,235,228,0.5);
  border-radius: 10px;
  font-size: 12px;
  color: #144629;
  animation: fadeSlideIn 0.2s ease-out;
}
.file-badge.analyzing {
  background: rgba(225,235,228,0.4);
  color: #2d6a3f;
}
.file-badge.analyzing::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid rgba(20,70,41,0.2);
  border-top-color: #2d6a3f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.file-badge.ready { background: rgba(225,235,228,0.6); color: #144629; }
.file-badge.error { background: rgba(254,240,237,0.5); color: #c53030; }
.file-badge .file-remove {
  cursor: pointer;
  opacity: 0.5;
  font-size: 14px;
  line-height: 1;
}
.file-badge .file-remove:hover { opacity: 1; }
.file-badge .file-icon { flex-shrink: 0; }
.file-badge .file-icon svg { width: 14px; height: 14px; }
.file-badge-image {
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #f0eeeb;
  border: none;
}
.file-badge-image.analyzing {
  background: #f0eeeb;
}
.file-badge-image.analyzing::before {
  display: none;
}
.file-badge-image.analyzing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.4);
  border-radius: 12px;
}
.file-badge-image.analyzing .file-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: rgba(0,0,0,0.6);
  border-radius: 50%;
  animation: fileSpin 0.6s linear infinite;
  z-index: 2;
}
@keyframes fileSpin { to { transform: rotate(360deg); } }
.file-badge-image.ready {
  background: #f0eeeb;
}
.file-badge-image .file-thumb {
  display: block;
  width: auto;
  height: 80px;
  max-width: 140px;
  object-fit: cover;
  border-radius: 12px;
}
.file-badge-image .file-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.55);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
}
.file-badge-image:hover .file-remove { opacity: 1; }
#messages.drag-over {
  outline: 2px dashed rgba(20,70,41,0.3);
  outline-offset: -8px;
  background: rgba(225,235,228,0.1);
}

/* User message attachment previews */
.user-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.user-attach-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s;
}
.user-attach-thumb:hover { opacity: 0.85; }
.user-attach-thumb img {
  display: block;
  max-height: 160px;
  max-width: 240px;
  border-radius: 10px;
  object-fit: cover;
}
.user-attach-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}
.user-attach-file:hover { background: rgba(255,255,255,0.8); }
.user-attach-file svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Link unfurl preview cards */
.link-unfurl {
  display: flex;
  gap: 0;
  margin-top: 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface, #fff);
  transition: background 0.15s;
  max-width: 440px;
}
.link-unfurl:hover { background: rgba(0,0,0,0.02); }
.link-unfurl-image {
  flex-shrink: 0;
  width: 100px;
  min-height: 72px;
  overflow: hidden;
  background: rgba(0,0,0,0.03);
}
.link-unfurl-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.link-unfurl-body {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.link-unfurl-site {
  font-size: 11px;
  color: var(--color-text-muted, #79716b);
  display: flex;
  align-items: center;
  gap: 4px;
}
.link-unfurl-favicon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}
.link-unfurl-title {
  font-size: 13px;
  font-weight: 600;
  color: #3b82f6;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.link-unfurl-desc {
  font-size: 12px;
  color: var(--color-text-muted, #79716b);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lbFadeIn 0.15s ease-out;
}
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
#lightbox .lb-filename {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-family: inherit;
}
#lightbox .lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: rgba(255,255,255,0.6);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
#lightbox .lb-close:hover { color: #fff; }

/* Thinking blocks (inline, collapsible) */
.thinking-inline {
  margin: 8px 0;
  border-radius: 12px;
  background: rgba(245,243,240,0.6);
  border: none;
  overflow: hidden;
  animation: toolCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.thinking-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #888;
  font-family: inherit;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}
.think-text { flex-shrink: 0; }
.thinking-toggle:hover { color: #555; }
.think-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(180,170,160,0.2);
  border-top-color: #999;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.thinking-inline.done .think-spinner { display: none; }
.think-done-icon { display: none; flex-shrink: 0; }
.think-done-icon svg { width: 14px; height: 14px; }
.thinking-inline.done .think-done-icon { display: inline-flex; align-items: center; }
.thinking-inline:not(.done) .think-text {
  background: linear-gradient(90deg, rgba(136,136,136,1) 0%, rgba(170,165,160,1) 40%, rgba(200,195,188,1) 50%, rgba(170,165,160,1) 60%, rgba(136,136,136,1) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 3s ease-in-out infinite;
  transition: opacity 0.2s ease;
}
.think-chevron {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  transition: transform 0.2s;
  transform: rotate(-90deg);
}
.think-chevron:hover { color: #555; }
.thinking-inline.open .think-chevron { transform: rotate(0deg); }
.thinking-inline-body {
  display: none;
  padding: 8px 14px 12px;
  color: #666;
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid rgba(180,170,160,0.15);
  background: rgba(245,243,240,0.5);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}
.thinking-inline.open .thinking-inline-body { display: block; }
.think-preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  color: #aaa;
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
}
.thinking-inline.open .think-preview { display: none; }

/* Empty state container */
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 0 20px 20px;
  overflow: hidden;
}
.empty-state-container::before {
  content: '';
  flex: 3;
}
.empty-state-container::after {
  content: '';
  flex: 5;
}

/* Hero block: icon + greeting stacked */
.empty-state-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 24px;
}

/* Time-of-day icon (hero size) */
.empty-state-icon {
  margin-bottom: 12px;
}
.empty-state-icon .greeting-tod-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state-icon .greeting-tod-icon svg {
  width: 48px;
  height: 48px;
  display: block;
}

/* Pixar-style spring entrance for time-of-day icon */
@keyframes tod-spring {
  0%   { opacity: 0; transform: scale(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tod-pop {
  0%   { opacity: 0; transform: scale(0); }
  100% { opacity: 1; transform: scale(1); }
}
.greeting-tod-icon.has-icon svg > * {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: tod-spring 300ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.greeting-tod-icon.has-icon svg > *:nth-child(1) { animation-delay: 0ms; }
.greeting-tod-icon.has-icon svg > *:nth-child(2) { animation-delay: 30ms; }
.greeting-tod-icon.has-icon svg > *:nth-child(3) { animation-delay: 55ms; }
.greeting-tod-icon.has-icon svg > *:nth-child(4) { animation-delay: 75ms; }
.greeting-tod-icon.has-icon svg > *:nth-child(5) { animation-delay: 95ms; }
.greeting-tod-icon.has-icon svg > *:nth-child(6) { animation-delay: 110ms; }
.greeting-tod-icon.has-icon svg > *:nth-child(7) { animation-delay: 125ms; }
.greeting-tod-icon.has-icon svg > *:nth-last-child(1),
.greeting-tod-icon.has-icon svg > *:nth-last-child(2) {
  animation-name: tod-pop;
  animation-duration: 350ms;
  animation-timing-function: cubic-bezier(0.22, 1.8, 0.36, 1);
}
.greeting-tod-icon.has-icon svg > *:nth-last-child(2) { animation-delay: 150ms; }
.greeting-tod-icon.has-icon svg > *:nth-last-child(1) { animation-delay: 200ms; }

.empty-state-greeting {
  text-align: center;
  flex-shrink: 0;
}
.empty-state-greeting h1 {
  font-size: 24px;
  font-weight: 600;
  color: #1c1917;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
}

/* Sidebar dim on empty state (desktop only — mobile uses opacity for show/hide) */
@media (min-width: 769px) {
  #sidebar.sidebar-dimmed {
    opacity: 0.7;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  #sidebar.sidebar-dimmed:hover {
    opacity: 1;
  }
}

/* Onboarding capabilities banner */
.onboarding-capabilities {
  max-width: 500px;
  margin: 0 auto 16px;
  padding: 16px 20px;
  background: rgba(20, 70, 41, 0.04);
  border: 1px solid rgba(20, 70, 41, 0.1);
  border-radius: 12px;
}
.onboarding-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: #78716c;
  margin: 0 0 12px;
}
.onboarding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.onboarding-cap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #44403c;
}
.onboarding-cap svg {
  flex-shrink: 0;
  color: #144629;
}
.onboarding-dismiss {
  display: block;
  margin: 12px auto 0;
  padding: 4px 16px;
  border: none;
  background: none;
  color: #a8a29e;
  font-size: 12px;
  cursor: pointer;
}
.onboarding-dismiss:hover { color: #78716c; }

.empty-state-container #chat-input-area {
  background: none;
  padding: 0 0 12px;
  width: 100%;
  max-width: 600px;
  flex-shrink: 0;
}
.empty-state-container #input-container {
  display: flex;
  flex-direction: column;
}
.empty-state-container #input-container #file-previews {
  max-height: 200px;
  overflow-y: auto;
}
.empty-state-container .quick-replies {
  justify-content: center;
  align-items: flex-start;
  max-width: 720px;
  flex-shrink: 0;
}
.empty-state-container .nudge-cards {
  margin-top: 12px;
  margin-bottom: 16px;
  max-width: 600px;
  opacity: 0.75;
  font-size: 12px;
}

/* Nudge cards for missing integrations */
.nudge-cards {
  max-width: 720px;
  width: 100%;
  margin: 16px auto 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.nudge-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(180,170,160,0.2);
  background: white;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  flex: 1;
  min-width: 200px;
}
.nudge-card:hover {
  border-color: rgba(20,70,41,0.3);
  box-shadow: 0 2px 8px rgba(20,70,41,0.06);
}
.nudge-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #17693a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nudge-icon svg {
  width: 20px;
  height: 20px;
}
.nudge-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.nudge-title {
  font-size: 13px;
  font-weight: 600;
  color: #1c1917;
  line-height: 1.3;
}
.nudge-desc {
  font-size: 11px;
  color: #79716b;
  line-height: 1.3;
}
.nudge-connect {
  font-size: 12px;
  font-weight: 500;
  color: #17693a;
  white-space: nowrap;
  flex-shrink: 0;
}
.nudge-enter {
  opacity: 0;
  transform: translateY(6px);
  animation: chipReveal 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Quick reply chips */
.running-indicator {
  max-width: 720px;
  width: 100%;
  margin: 10px auto 0;
  padding: 4px 0;
  animation: fadeSlideIn 0.3s ease-out both;
}
.quick-replies {
  max-width: 720px;
  width: 100%;
  margin: 10px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: fadeSlideIn 0.3s ease-out both;
}
.quick-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  background: rgba(225,235,228,0.5);
  color: #17693a;
  border: none;
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1.4;
  max-width: 100%;
  text-align: left;
}
.quick-reply .chip-label {
  flex: 1;
  min-width: 0;
}
.quick-reply em {
  font-style: italic;
  opacity: 0.6;
}
.quick-reply:hover {
  background: rgba(210,228,215,0.7);
  box-shadow: 0 1px 4px rgba(20,70,41,0.08);
}
.quick-reply.skeleton {
  background: linear-gradient(90deg, rgba(225,235,228,0.4) 25%, rgba(210,228,215,0.55) 50%, rgba(225,235,228,0.4) 75%);
  background-size: 200% 100%;
  animation: shimmer 2.8s ease-in-out infinite;
  border: none;
  color: transparent;
  min-width: 80px;
  cursor: default;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.quick-reply.skeleton.fade-out {
  opacity: 0;
  transform: scale(0.92);
}
.quick-reply.chip-enter {
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  animation: chipReveal 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.chip-edit-icon, .chip-send-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.35;
}
.quick-reply.editable:hover .chip-edit-icon { opacity: 1; }
.quick-reply:not(.editable):hover .chip-send-icon { opacity: 0.8; }

/* Execution checklist steps */
.tool-card.exec-step {
  background: rgba(250,249,246,0.6);
}
.tool-card.exec-step .tool-icon,
.tool-card.exec-step .tool-params,
.tool-card.exec-step .tool-status { display: none; }
.tool-card.exec-step .tool-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(232,160,32,0.7);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s ease-in-out infinite;
}
.tool-card.exec-step.complete {
  background: rgba(225,235,228,0.4);
}
.tool-card.exec-step.complete .step-indicator {
  background: #079455;
  border-color: #079455;
  animation: none;
}
.tool-card.exec-step.complete .step-indicator::after {
  content: '\2713';
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.tool-card.exec-step.error {
  background: rgba(254,236,232,0.5);
}
.tool-card.exec-step.error .step-indicator {
  background: #c53030;
  border-color: #c53030;
  animation: none;
}
.tool-card.exec-step.error .step-indicator::after {
  content: '\2717';
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.tool-card.exec-step.error .tool-label {
  color: #c53030;
}
.tool-card.exec-step.warning {
  background: rgba(254,247,230,0.5);
}
.tool-card.exec-step.warning .step-indicator {
  background: #b7791f;
  border-color: #b7791f;
  animation: none;
}
.tool-card.exec-step.warning .step-indicator::after {
  content: '\00D7';
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.tool-card.exec-step.warning .tool-label {
  color: #b7791f;
}
.tool-card.exec-step.complete .tool-label {
  text-decoration: line-through;
  color: #999;
}

/* Plan option cards */
.plan-options {
  max-width: 720px;
  width: 100%;
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeSlideIn 0.3s ease-out both;
}
.plan-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  line-height: 1.4;
  width: 100%;
  background: rgba(245,243,240,0.6);
  border: none;
}
.plan-option:hover {
  background: rgba(235,232,228,0.7);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.plan-option.primary {
  background: #144629;
  color: #fff;
}
.plan-option.primary:hover {
  background: #0e321d;
}
.plan-option .opt-key {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}
.plan-option.primary .opt-key {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
}
.plan-option:not(.primary) .opt-key {
  background: rgba(180,170,160,0.15);
  color: #999;
}
.plan-option .opt-body { flex: 1; min-width: 0; }
.plan-option .opt-msg {
  font-weight: 400;
  line-height: 1.4;
}
.plan-option.primary .opt-msg {
  color: rgba(255,255,255,0.9);
}
/* Options loading shimmer */
.options-shimmer {
  background: linear-gradient(
    90deg,
    rgba(136,136,136,1) 0%,
    rgba(170,165,160,1) 40%,
    rgba(200,195,188,1) 50%,
    rgba(170,165,160,1) 60%,
    rgba(136,136,136,1) 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 3s ease-in-out infinite;
  transition: opacity 0.25s ease;
}

/* Summary card */
.summary-card {
  max-width: 720px;
  width: 100%;
  margin: 12px auto 0;
  background: rgba(225,235,228,0.4);
  border: none;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  animation: fadeSlideIn 0.3s ease-out both;
}
.summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #144629;
  margin-bottom: 8px;
}
.summary-header .check-badge {
  width: 20px;
  height: 20px;
  background: #079455;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.summary-card ul {
  margin: 0;
  padding-left: 6px;
  list-style: none;
  color: #333;
  line-height: 1.7;
}
.summary-card.summary-error {
  background: rgba(254,236,232,0.5);
}
.summary-card.summary-error .summary-header {
  color: #c53030;
}
.summary-card.summary-partial {
  background: rgba(254,248,230,0.5);
}
.summary-card.summary-partial .summary-header {
  color: #92600a;
}

/* Debug panel */
#debug-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: #1a1a1a;
  color: #d4d4d4;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  display: none;
  flex-direction: column;
  z-index: 99;
  border-left: 1px solid #333;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}
#debug-panel.open { display: flex; }
body.debug-open .chat-main { margin-right: 420px; transition: margin-right 0.25s ease; }

.debug-tabs {
  display: flex;
  border-bottom: 1px solid #333;
  background: #222;
  flex-shrink: 0;
}
.debug-tab {
  padding: 8px 14px;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 11px;
  font-family: inherit;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.debug-tab:hover { color: #ccc; }
.debug-tab.active { color: #fff; border-bottom-color: #5580bb; }

.debug-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.debug-pane { display: none; }
.debug-pane.active { display: block; }

/* Scenarios pane */
.scenario-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2a;
}
.scenario-row:last-child { border-bottom: none; }
.scenario-label { color: #ccc; font-size: 11px; }
.scenario-label small { color: #666; display: block; margin-top: 2px; }
.scenario-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  background: #333;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  border: none;
  padding: 0;
}
.scenario-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.scenario-toggle.on { background: #c0392b; }
.scenario-toggle.on::after { transform: translateX(16px); background: #fff; }

/* Event log */
.evt-row {
  padding: 4px 0;
  border-bottom: 1px solid #2a2a2a;
  line-height: 1.4;
}
.evt-row:last-child { border-bottom: none; }
.evt-time { color: #666; margin-right: 6px; }
.evt-type { font-weight: 600; margin-right: 6px; }
.evt-type.text { color: #7cc87c; }
.evt-type.thinking { color: #c89bdf; }
.evt-type.tool_start { color: #e8a020; }
.evt-type.tool_end { color: #5dade2; }
.evt-type.done { color: #888; }
.evt-type.error { color: #e74c3c; }
.evt-detail { color: #999; word-break: break-all; }
.evt-expand {
  color: #666;
  cursor: pointer;
  margin-left: 4px;
  text-decoration: underline;
}
.evt-expand:hover { color: #aaa; }
.evt-full {
  display: none;
  margin-top: 4px;
  padding: 6px 8px;
  background: #252525;
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-all;
  color: #bbb;
  max-height: 300px;
  overflow-y: auto;
}

/* Memory debug */
.mem-category { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mem-cat-label { color: #8b8; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.mem-item { padding: 3px 0; font-size: 12px; line-height: 1.5; }
.mem-key { color: #aaa; font-weight: 500; }
.mem-val { color: #ddd; }
.mem-empty { color: #666; font-size: 13px; padding: 20px 12px; text-align: center; }
.mem-clear-btn {
  background: rgba(200,60,60,0.2); color: #e88; border: 1px solid rgba(200,60,60,0.3);
  padding: 4px 10px; border-radius: 4px; font-size: 11px; cursor: pointer;
}
.mem-clear-btn:hover { background: rgba(200,60,60,0.35); }

/* Thinking view (debug panel) */
.thinking-block {
  padding: 8px;
  margin-bottom: 8px;
  background: #252525;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  color: #c9b0db;
}
.thinking-label {
  color: #9b59b6;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* Location card */
.location-card {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(225,235,228,0.4);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  color: #333;
  animation: fadeSlideIn 0.3s ease-out;
}
.location-card svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.location-card .loc-text { flex: 1; line-height: 1.4; }
.location-card .loc-text strong { font-weight: 600; }
.location-card .loc-btn {
  background: #144629;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.location-card .loc-btn:hover { background: #0e321d; }
.location-card .loc-btn:disabled { background: #999; cursor: default; }
.location-card .loc-dismiss {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
}
.location-card .loc-dismiss:hover { color: #666; }

/* ── Chat-specific status styles (base status indicators in application.css) ── */

/* Header tool icon */
.header-status-icon {
  display: flex;
  align-items: center;
  width: 14px;
  height: 14px;
}
.header-status-icon svg {
  width: 13px;
  height: 13px;
}

/* Header status also uses transitions */
#header-status .status-swap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Header status pill */
#header-status {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  font-size: 12px;
  font-weight: 400;
  color: #999;
  padding: 3px 10px 3px 8px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
#header-status:not(:empty) { display: inline-flex; }
#header-status .status-typing span { background: #999; }
#header-status.tool { color: #144629; background: rgba(20,70,41,0.05); }
#header-status.waiting { color: #144629; background: rgba(20,70,41,0.05); }
#header-status.running { color: #92400e; background: rgba(245,158,11,0.08); }
#header-status.running .status-running { background: #f59e0b; }

/* Keyframe animations */
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes textShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: -50% 50%; }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes resultIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes chipReveal {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes messageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ── Fork/Join icon animation ── */
.fj-icon-animated { color: #555; }
.fj-icon-animated svg { overflow: visible; }
.fj-icon-animated .fj-trunk { stroke-dasharray: 4; stroke-dashoffset: 4; animation: fjDraw 0.4s 0.1s ease forwards; }
.fj-icon-animated .fj-branch-left { stroke-dasharray: 12; stroke-dashoffset: 12; animation: fjDraw 0.5s 0.3s ease forwards; }
.fj-icon-animated .fj-branch-right { stroke-dasharray: 12; stroke-dashoffset: 12; animation: fjDraw 0.5s 0.4s ease forwards; }
.fj-icon-animated .fj-node-root { opacity: 0; animation: fjNodePop 0.3s 0s ease forwards; }
.fj-icon-animated .fj-node-left { opacity: 0; animation: fjNodePop 0.3s 0.7s ease forwards; }
.fj-icon-animated .fj-node-right { opacity: 0; animation: fjNodePop 0.3s 0.8s ease forwards; }
.fj-icon-animated .fj-stem-left { stroke-dasharray: 2; stroke-dashoffset: 2; animation: fjDraw 0.2s 0.6s ease forwards; }
.fj-icon-animated .fj-stem-right { stroke-dasharray: 2; stroke-dashoffset: 2; animation: fjDraw 0.2s 0.7s ease forwards; }
/* Pulse the end nodes while running */
.fork-join-card:not(.complete):not(.warning) .fj-node-left,
.fork-join-card:not(.complete):not(.warning) .fj-node-right {
  animation: fjNodePop 0.3s 0.7s ease forwards, fjNodePulse 1.8s 1s ease-in-out infinite;
}
@keyframes fjDraw { to { stroke-dashoffset: 0; } }
@keyframes fjNodePop { to { opacity: 1; } }
@keyframes fjNodePulse {
  0%, 100% { r: 2; opacity: 1; }
  50% { r: 2.8; opacity: 0.7; }
}

/* ── Fork/Join parallel tasks ── */
.fork-join-card .fj-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.fj-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #555;
  background: rgba(0,0,0,0.025);
  transition: background 0.3s ease;
}
.fj-task.complete { background: rgba(34,139,34,0.06); }
.fj-task.error { background: rgba(220,38,38,0.06); }
.fj-task-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5; }
.fj-task-icon svg { width: 14px; height: 14px; }
.fj-task-label { flex: 1; }
.fj-task-target { opacity: 0.6; font-style: italic; }
.fj-task-status { flex-shrink: 0; font-size: 11px; }
.fj-task-status .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bbb;
  animation: pulse 1.5s ease-in-out infinite;
}
.fj-task-status .check { color: #228B22; font-weight: 600; }
.fj-task-status .error-x { color: #dc2626; font-weight: 600; }
.fj-task.complete .fj-task-icon { opacity: 0.7; }
.fj-task.complete .fj-task-label { color: #333; }

/* ── Fork/Join tasks mini-table (server-rendered) ── */
.fj-tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.4;
}
.fj-tasks-table th {
  text-align: left;
  font-weight: 600;
  color: #888;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px 4px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.fj-tasks-table td {
  padding: 4px 8px 4px 0;
  vertical-align: top;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: #444;
}
.fj-tasks-table tr:last-child td { border-bottom: none; }
.fj-tasks-table code { font-size: 11px; color: #555; background: rgba(0,0,0,0.04); padding: 1px 4px; border-radius: 3px; }
.fj-args-cell { max-width: 360px; }
.fj-arg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.fj-arg-key { color: #888; font-size: 11px; }

@keyframes toolCardIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes checkPop {
  from { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  to { transform: scale(1); opacity: 1; }
}
@keyframes btnSwap {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes sidebarItemIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Dynamic message entrance */
.message.message-enter {
  animation: messageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* New sidebar conversation item */
.conv-item-enter {
  animation: sidebarItemIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Token budget bar */
.token-budget {
  position: relative;
  height: 20px;
  background: #f0efeb;
  border-radius: 4px;
  margin: 0 24px 4px;
  overflow: hidden;
}
.tb-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #17b26a;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.tb-fill.tb-mid { background: #f79009; }
.tb-fill.tb-warn { background: #f04438; }
.tb-label {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-size: 11px;
  line-height: 20px;
  color: #444;
  font-weight: 500;
}

/* Memory compaction debug */
.mem-compaction {
  border: 1px solid #e5e2d9;
  border-radius: 6px;
  margin: 8px;
  background: #faf9f7;
  overflow: hidden;
}
.mc-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e5e2d9;
}
.mc-badge {
  background: #17b26a;
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}
.mc-stats {
  font-size: 12px;
  color: #666;
}
.mc-toggle {
  padding: 6px 12px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e2d9;
}
.mc-btn {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #d5d2c9;
  border-radius: 4px;
  background: white;
  color: #555;
  cursor: pointer;
}
.mc-btn:hover { background: #f0efeb; }
.mc-btn.mc-active {
  background: #144629;
  color: white;
  border-color: #144629;
}
.mc-content {
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: #333;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.mc-kept { color: #333; }
.mc-removed {
  color: #f04438;
  text-decoration: line-through;
  opacity: 0.7;
}

/* Flight search icon animation */
.flight-search-icon .fsi-mag {
  animation: fsiScan 3s ease-in-out infinite;
  transform-origin: 16px 10px;
}
@keyframes fsiScan {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-6px, 2px); }
  40%  { transform: translate(-3px, -3px); }
  60%  { transform: translate(2px, 3px); }
  80%  { transform: translate(4px, -1px); }
  100% { transform: translate(0, 0); }
}
.flight-search-icon .fsi-mag circle {
  animation: fsiGlow 3s ease-in-out infinite;
}
@keyframes fsiGlow {
  0%, 100% { fill: rgba(20,70,41,0.04); }
  50%      { fill: rgba(20,70,41,0.12); }
}
.tool-card:has(.check) .flight-search-icon .fsi-mag,
.tool-card:has(.error-x) .flight-search-icon .fsi-mag,
.tool-card:has(.check) .flight-search-icon .fsi-mag circle,
.tool-card:has(.error-x) .flight-search-icon .fsi-mag circle {
  animation: none !important;
  fill: rgba(20,70,41,0.06);
}

/* Tool icon animations — active while running, freeze on completion */

/* Phone: gentle ring wobble */
.tool-icon .icon-phone {
  animation: phoneRing 1.2s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes phoneRing {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(12deg); }
  20% { transform: rotate(-10deg); }
  30% { transform: rotate(8deg); }
  40% { transform: rotate(-4deg); }
  50%, 100% { transform: rotate(0deg); }
}

/* Email: gentle float up and settle */
.tool-icon .icon-email {
  animation: emailSend 2s ease-in-out infinite;
}
@keyframes emailSend {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-2deg); }
  50% { transform: translateY(0px) rotate(0deg); }
  75% { transform: translateY(-1px) rotate(1deg); }
}

/* Fax: page feed vibration */
.tool-icon .icon-fax {
  animation: faxFeed 1.5s ease-in-out infinite;
}
@keyframes faxFeed {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-1px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-0.5px); }
}

/* Web search: magnifying glass tilt */
.tool-icon .icon-search {
  animation: searchTilt 2.5s ease-in-out infinite;
  transform-origin: 11px 11px;
}
@keyframes searchTilt {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(6deg); }
}

/* Globe: slow rotate */
.tool-icon .icon-globe {
  animation: globeSpin 40s linear infinite;
}
@keyframes globeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Map pin: gentle bounce */
.tool-icon .icon-pin {
  animation: pinBounce 2s ease-in-out infinite;
}
@keyframes pinBounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-3px); }
  50% { transform: translateY(0); }
  65% { transform: translateY(-1.5px); }
  80% { transform: translateY(0); }
}

/* Directions: compass pulse */
.tool-icon .icon-directions {
  animation: compassPulse 2s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes compassPulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.05); }
}

/* Calendar: subtle tick */
.tool-icon .icon-calendar {
  animation: calTick 3s ease-in-out infinite;
}
@keyframes calTick {
  0%, 90%, 100% { transform: scale(1); }
  93% { transform: scale(1.08); }
  96% { transform: scale(1); }
}

/* Contacts: gentle nod */
.tool-icon .icon-contacts {
  animation: contactNod 2.5s ease-in-out infinite;
}
@keyframes contactNod {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-1.5px); }
  60% { transform: translateY(0); }
}

/* Hotel: lights turning on in windows */
.tool-icon .icon-hotel {
  animation: hotelLights 2.5s ease-in-out infinite;
}
@keyframes hotelLights {
  0%, 100% { opacity: 1; filter: brightness(1); }
  30% { filter: brightness(1.15); }
  50% { opacity: 0.92; filter: brightness(0.95); }
  70% { filter: brightness(1.1); }
}

/* Search: gentle pulse */
.tool-icon .icon-search {
  animation: searchPulse 2s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes searchPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Calculator: buttons pressing */
.tool-icon .icon-calc {
  animation: calcPress 1.8s ease-in-out infinite;
}
@keyframes calcPress {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(0.95); }
  40% { transform: scale(1); }
  60% { transform: scale(0.95); }
  80% { transform: scale(1); }
}

/* Currency: coin spin */
.tool-icon .icon-currency {
  animation: coinSpin 2.5s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes coinSpin {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

/* Clock: tick-tock */
.tool-icon .icon-clock {
  animation: clockTick 2s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes clockTick {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(6deg); }
  75% { transform: rotate(-6deg); }
}

/* Brain: gentle think pulse */
.tool-icon .icon-brain {
  animation: brainThink 2s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes brainThink {
  0%, 100% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.06); opacity: 0.85; }
  60% { transform: scale(0.97); opacity: 1; }
}

/* Translate: language switch bounce */
.tool-icon .icon-translate {
  animation: translateSwap 2s ease-in-out infinite;
}
@keyframes translateSwap {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* SMS: bubble pop */
.tool-icon .icon-sms {
  animation: smsPop 2s ease-in-out infinite;
}
@keyframes smsPop {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.08); }
  30% { transform: scale(0.97); }
  45% { transform: scale(1); }
}

/* Plan/strategy: page write shimmer */
.tool-icon .icon-plan {
  animation: planWrite 2.5s ease-in-out infinite;
}
@keyframes planWrite {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-1.5px); }
  60% { transform: translateY(0.5px); }
}

/* Drive: subtle sway */
.tool-icon .icon-drive {
  animation: driveSway 3s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes driveSway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* Sheets: grid pulse */
.tool-icon .icon-sheets {
  animation: sheetsPulse 2s ease-in-out infinite;
}
@keyframes sheetsPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.9; }
}

/* Tasks: checkbox tick */
.tool-icon .icon-tasks {
  animation: taskTick 2.5s ease-in-out infinite;
}
@keyframes taskTick {
  0%, 85%, 100% { transform: scale(1); }
  90% { transform: scale(1.1); }
  95% { transform: scale(0.98); }
}

/* Slides: subtle slide */
.tool-icon .icon-slides {
  animation: slideShift 3s ease-in-out infinite;
}
@keyframes slideShift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(1.5px); }
}

/* Forms: radio fill pulse */
.tool-icon .icon-forms {
  animation: formFill 2.5s ease-in-out infinite;
}
@keyframes formFill {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.03); }
  60% { transform: scale(0.98); }
}

/* Settings/integrations: slow gear spin */
.tool-icon .icon-settings {
  animation: gearSpin 6s linear infinite;
  transform-origin: center center;
}
@keyframes gearSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Lock: shackle jiggle */
.tool-icon .icon-lock {
  animation: lockJiggle 2s ease-in-out infinite;
}
@keyframes lockJiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-3deg); }
  40% { transform: rotate(3deg); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(0deg); }
}

/* GitHub: octocat pulse */
.tool-icon .icon-github {
  animation: githubPulse 2s ease-in-out infinite;
}
@keyframes githubPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* PostHog: bar chart grow */
.tool-icon .icon-posthog {
  animation: posthogGrow 2s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes posthogGrow {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.08); }
}

/* Schedule: clock tick */
.tool-icon .icon-schedule {
  animation: clockTick 2s ease-in-out infinite;
  transform-origin: center center;
}

/* Visualize: staggered bar bounce */
.tool-icon .icon-visualize .viz-bar1 {
  animation: vizBar 1.4s ease-in-out infinite;
  transform-origin: 5px 22px;
}
.tool-icon .icon-visualize .viz-bar2 {
  animation: vizBar 1.4s ease-in-out 0.15s infinite;
  transform-origin: 12px 22px;
}
.tool-icon .icon-visualize .viz-bar3 {
  animation: vizBar 1.4s ease-in-out 0.3s infinite;
  transform-origin: 19px 22px;
}
@keyframes vizBar {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.6); }
}

/* Image generation: wand wobble + sparkle pulse */
.tool-icon .icon-image-gen {
  animation: imgGenPulse 2s ease-in-out infinite;
}
@keyframes imgGenPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.tool-icon .icon-image-gen .img-wand {
  animation: imgWand 1.2s ease-in-out infinite;
  transform-origin: 18px 2px;
}
@keyframes imgWand {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}
.tool-icon .icon-image-gen .img-s1 {
  animation: imgSparkle1 1.6s ease-in-out infinite;
}
@keyframes imgSparkle1 {
  0%, 100% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.2); }
}
.tool-icon .icon-image-gen .img-s2 {
  animation: imgSparkle2 1.6s ease-in-out infinite 0.5s;
}
@keyframes imgSparkle2 {
  0%, 100% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Kill all icon animations when tool is done */
.tool-card:has(.check) .tool-icon svg,
.tool-card:has(.error-x) .tool-icon svg,
.tool-card:has(.warning-icon) .tool-icon svg {
  animation: none !important;
}
.tool-card:has(.check) .tool-icon svg *,
.tool-card:has(.error-x) .tool-icon svg *,
.tool-card:has(.warning-icon) .tool-icon svg * {
  animation: none !important;
}

/* Tool result tables (flight results, etc.) */
.td-result table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e5e2d9;
  margin: 6px 0;
}
.td-result table thead th {
  background: #f5f4ef;
  color: #666;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 7px 8px;
  text-align: left;
  border-bottom: 1px solid #e5e2d9;
  white-space: nowrap;
}
.td-result table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid #f0efeb;
  vertical-align: top;
  color: #444;
}
.td-result table tbody tr:last-child td { border-bottom: none; }
.td-result table tbody tr:hover { background: rgba(20,70,41,0.02); }
.td-result table strong {
  color: #144629;
  font-weight: 700;
}

/* ── Hotel brand logos ── */
.rc-hotel-logo {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: contain;
  margin-top: 2px;
}
.rc-hotel-logo-fallback {
  fill: none;
}

/* ── Place favicons ── */
.place-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.place-favicon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.place-favicon img {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

/* ── Contact photo avatars ── */
.rc-contact-avatar-photo {
  overflow: hidden;
  padding: 0;
}
.rc-contact-avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ── Browse link preview ── */
.browse-link-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(245,243,240,0.8);
  border-radius: 6px;
  border: 1px solid rgba(180,170,160,0.15);
}
.blp-favicon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}
.blp-info {
  flex: 1;
  min-width: 0;
}
.blp-title {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blp-domain {
  font-size: 11px;
  color: #888;
}

/* ── Flight route header ── */
.flight-route-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 2px;
}
.frh-code {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.04em;
}
.frh-line {
  flex: 1;
  height: 1px;
  background: rgba(180,170,160,0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.frh-plane {
  background: #fff;
  padding: 0 4px;
}

/* ── Inline tool duration ── */
.tool-duration {
  font-size: 10px;
  color: #aaa;
  font-weight: 400;
  margin-left: 4px;
  animation: fadeSlideIn 0.25s ease-out;
}

/* ── Sources cited badge ── */
.sources-badge {
  margin-top: 8px;
  animation: fadeSlideIn 0.3s ease-out;
}
.sources-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid rgba(180,170,160,0.25);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, border-color 0.12s;
}
.sources-toggle:hover {
  color: #555;
  border-color: rgba(180,170,160,0.4);
}
.sources-toggle svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.sources-chevron {
  transition: transform 0.2s;
}
.sources-badge.open .sources-chevron {
  transform: rotate(180deg);
}
.sources-list {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  padding: 6px 10px;
  background: rgba(245,243,240,0.5);
  border-radius: 6px;
  font-size: 11px;
  color: #666;
}
.sources-badge.open .sources-list {
  display: flex;
}
.sources-item {
  padding: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Trace Dashboard ── */

.dash-loading {
  color: #666;
  font-size: 11px;
  padding: 16px 0;
  text-align: center;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.dash-card {
  background: #222;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
}
.dash-card-val {
  font-size: 18px;
  font-weight: 700;
  color: #e0e0e0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1.2;
}
.dash-card-label {
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}
.dash-section-label {
  color: #777;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 10px 0 6px;
}

/* Tool timeline bars */
.tl-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.tl-name {
  color: #e8a020;
  font-size: 10px;
  width: 90px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-bar-wrap {
  flex: 1;
  height: 12px;
  background: #2a2a2a;
  border-radius: 2px;
  overflow: hidden;
}
.tl-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 3px;
}
.tl-dur {
  color: #888;
  font-size: 10px;
  width: 38px;
  text-align: right;
  flex-shrink: 0;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.tl-icon {
  font-size: 11px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

/* Tool distribution */
.dist-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.dist-name {
  color: #aaa;
  font-size: 10px;
  width: 100px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-bar-wrap {
  flex: 1;
  height: 8px;
  background: #2a2a2a;
  border-radius: 2px;
  overflow: hidden;
}
.dist-bar {
  height: 100%;
  background: #5580bb;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.dist-count {
  color: #888;
  font-size: 10px;
  width: 20px;
  text-align: right;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Divider between dashboard and eval */
.eval-divider {
  height: 1px;
  background: #333;
  margin: 14px 0 10px;
}

/* ── Eval (AI Judge) ── */

.eval-header {
  padding: 6px 0 8px;
  margin-bottom: 8px;
}
.eval-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eval-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: #ccc;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.eval-model-tag {
  font-size: 9px;
  font-weight: 500;
  color: #999;
  background: #2a2a2a;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.2px;
}
.eval-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.eval-toggle-track {
  display: block;
  position: relative;
  width: 38px;
  height: 20px;
  background: #333;
  border-radius: 10px;
  transition: background 0.2s;
}
.eval-toggle-btn.on .eval-toggle-track {
  background: #27ae60;
}
.eval-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.eval-toggle-btn.on .eval-toggle-knob {
  transform: translateX(18px);
  background: #fff;
}
#eval-status {
  color: #666;
  font-size: 11px;
  margin-top: 6px;
}

/* Eval loading dot */
.eval-loading-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #5580bb;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  animation: evalPulse 1s ease-in-out infinite;
}
@keyframes evalPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Score section */
.eval-score-section {
  padding: 12px 0;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 10px;
}
.eval-score-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.eval-score-num {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.eval-score-max {
  font-size: 16px;
  color: #555;
  font-weight: 400;
  margin-left: -2px;
}
.eval-grade {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.eval-bar {
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.eval-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease, background 0.6s ease;
}
.eval-summary {
  color: #aaa;
  font-size: 12px;
  line-height: 1.5;
}

/* Section labels */
.eval-section-label {
  color: #888;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px;
}

/* Tool cards */
.eval-tool-card {
  background: #222;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 6px;
  border: 1px solid #2a2a2a;
}
.eval-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.eval-tool-name {
  color: #e8a020;
  font-weight: 600;
  font-size: 12px;
}
.eval-tool-score {
  font-size: 18px;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.eval-tool-args {
  color: #666;
  font-size: 10px;
  margin-bottom: 6px;
  word-break: break-all;
}
.eval-tool-comment {
  color: #999;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #2a2a2a;
}

/* Dimension bars */
.eval-dims {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.eval-dim {
  display: flex;
  align-items: center;
  gap: 6px;
}
.eval-dim-label {
  color: #777;
  font-size: 9px;
  width: 52px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.eval-dim-bar {
  flex: 1;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}
.eval-dim-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.eval-dim-val {
  color: #888;
  font-size: 10px;
  width: 16px;
  text-align: right;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Anomalies */
.eval-anomaly {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid #2a2a2a;
  font-size: 11px;
}
.eval-anomaly:last-child { border-bottom: none; }
.eval-anomaly-badge {
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.eval-anomaly-tool {
  color: #e8a020;
  font-weight: 500;
  white-space: nowrap;
}
.eval-anomaly-detail {
  color: #999;
}

/* Download */
.eval-download-section {
  padding: 12px 0 4px;
  margin-top: 8px;
  border-top: 1px solid #2a2a2a;
}
.eval-download-btn {
  background: #2a2a2a;
  color: #aaa;
  border: 1px solid #333;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.eval-download-btn:hover { background: #333; color: #ddd; }

/* Event log enhancements */
.evt-cycle-badge {
  background: #5580bb;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.evt-type.cycle_start { color: #5580bb; }
.evt-duration {
  color: #5dade2;
  font-size: 10px;
  font-weight: 400;
  margin-left: 4px;
}

/* ── Mobile: full-screen sidebar overlay ── */
@media (max-width: 768px) {
  .chat-wrapper #sidebar.open, .chat-wrapper #sidebar:not(.open) {
    width: 100%; height: 100%;
    position: absolute; top: 0; left: 0;
    opacity: 0;
    border-right: none;
    overflow: hidden;
    z-index: var(--z-sidebar-mobile);
    pointer-events: none;
    background: rgba(250,249,247,1);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .chat-wrapper #sidebar.mobile-open, .chat-wrapper #sidebar.open.mobile-open {
    opacity: 1;
    pointer-events: auto;
    padding-top: 56px;
  }

  /* Mobile hamburger toggle — top-left, X top-right when open */
  #sidebar-toggle {
    position: absolute;
    left: 14px;
    top: calc(14px + env(safe-area-inset-top, 0px));
    transform: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: calc(var(--z-sidebar-mobile) + 1);
    transition: left 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.12s, box-shadow 0.12s;
  }
  #sidebar-toggle svg {
    width: 18px; height: 18px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.15s ease;
    position: absolute;
  }
  #sidebar-toggle .sidebar-toggle-chevron { display: none; }

  /* Hamburger → X crossfade with bounce */
  #sidebar-toggle .sidebar-toggle-hamburger {
    display: block;
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  #sidebar-toggle .sidebar-toggle-close {
    display: block;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
  }

  .chat-wrapper #sidebar.mobile-open ~ #sidebar-toggle {
    background: transparent;
    box-shadow: none;
  }
  .chat-wrapper #sidebar.mobile-open ~ #sidebar-toggle .sidebar-toggle-hamburger {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
  }
  .chat-wrapper #sidebar.mobile-open ~ #sidebar-toggle .sidebar-toggle-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  #debug-toggle { display: none; }

  /* ── Mobile chat layout polish ── */

  /* Force everything to respect viewport */
  .chat-wrapper {
    max-width: 100vw;
  }
  .chat-main {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Tighter message padding */
  #messages {
    padding: 16px 14px;
    gap: 12px;
    overflow-x: hidden;
  }

  /* Prevent content overflow */
  .message {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
  }
  .message.user { padding: 10px 14px; }
  .message.assistant { padding: 0; }
  .link-unfurl { max-width: 100%; }
  .link-unfurl-image { width: 80px; min-height: 60px; }

  /* Greeting on mobile */
  .empty-state-greeting h1 {
    font-size: 20px;
  }
  .empty-state-icon .greeting-tod-icon,
  .empty-state-icon .greeting-tod-icon svg {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  /* Markdown content overflow prevention */
  .content { overflow-wrap: break-word; word-break: break-word; }
  .content pre { overflow-x: auto; max-width: calc(100vw - 28px); }
  .content table { font-size: 12px; display: block; overflow-x: auto; }
  .content ul, .content ol { padding-left: 1.2em; }

  .chat-download-group { display: none !important; }

  /* Chat header — left-aligned on mobile, gradient fade */
  #chat-header {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px 56px;
    min-height: 44px;
    justify-content: flex-start;
    gap: 0;
    background: linear-gradient(180deg, var(--color-surface) 60%, transparent);
    border-bottom: none;
  }
  .chat-title-trigger {
    max-width: calc(100vw - 100px);
    font-size: 15px;
    font-weight: 600;
  }
  #header-status {
    position: absolute;
    left: 56px;
    top: calc(100% - 6px);
    margin-left: 0;
    font-size: 11px;
    padding: 2px 8px 2px 6px;
    z-index: 5;
  }

  /* Input area mobile */
  #chat-input-area {
    padding: 12px 14px 10px;
  }
  #chat-input-area form {
    max-width: 100%;
  }
  #input-container {
    border-radius: 14px;
    box-sizing: border-box;
  }

  /* Quick reply chips — full-width, stacked, tappable */
  .quick-replies,
  .empty-state-container .quick-replies {
    padding: 0;
    gap: 8px;
    max-width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: stretch;
  }
  .quick-reply {
    font-size: 13.5px;
    padding: 10px 16px;
    border-radius: 14px;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 40px;
  }

  /* Timestamp hint: reposition above message on mobile */
  .msg-timestamp-hint {
    right: auto;
    left: 0;
    top: -18px;
    font-size: 10px;
  }

  /* Tooltip: keep on screen */
  .msg-tooltip {
    left: 0;
    right: auto;
    max-width: calc(100vw - 56px);
    white-space: normal;
  }

  /* Empty state tighter on mobile */
  .empty-state-container {
    padding: 16px 12px;
  }
  .empty-state-container #chat-input-area {
    padding: 0 0 8px;
  }

  /* Nudge cards stack vertically */
  .nudge-cards {
    flex-direction: column;
    gap: 8px;
  }

  /* Location prompt tighter */
  .connect-prompt {
    margin: 8px 4px 0;
  }

  /* Tool cards don't overflow */
  .tool-card {
    max-width: 100%;
    overflow: hidden;
  }
}

/* ── Dark theme overrides ── */
[data-theme="wistful_juniper"],
[data-theme="deep_current"] {
  /* Broad text color resets — overrides all hardcoded #333/#555/#666/#1a1a1a */
  .chat-main { color: var(--color-text-primary); }

  /* Sidebar toggle */
  #sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
  }
  #sidebar-toggle:hover {
    background: var(--color-hover);
    color: var(--color-brand);
  }

  /* Thinking box */
  .thinking-inline {
    background: var(--color-hover);
  }
  .thinking-inline-body {
    color: var(--color-text-secondary);
    background: transparent;
    border-top-color: var(--color-border);
  }
  .think-preview { color: var(--color-text-muted); }
  .think-chevron { color: var(--color-text-muted); }
  .think-done-icon { color: var(--color-text-muted); }
  .think-spinner {
    border-color: var(--color-border);
    border-top-color: var(--color-text-muted);
  }
  .chat-main .message,
  .chat-main .message.user,
  .chat-main .message.assistant,
  .chat-main .content,
  .chat-main .content p,
  .chat-main .content li,
  .chat-main .content h1,
  .chat-main .content h2,
  .chat-main .content h3,
  .chat-main .content h4 { color: var(--color-text-primary); }

  .chat-wrapper .room-msg-author,
  .chat-wrapper .room-msg-name,
  .chat-wrapper .msg-author-name { color: var(--color-text-primary); }

  .chat-wrapper .room-msg-text,
  .chat-wrapper .room-msg-time,
  .chat-wrapper .msg-timestamp-hint { color: var(--color-text-muted); }
  .msg-tooltip { background: var(--color-card); border-color: var(--color-border); color: var(--color-text-secondary); }
  .msg-tooltip-time { color: var(--color-text-primary); }
  .msg-tooltip-date { color: var(--color-text-muted); }
  .msg-tooltip-meta { color: var(--color-text-muted); border-color: var(--color-border); }
  .msg-tooltip-divider { background: var(--color-border); }
  .msg-tooltip-timing { color: var(--color-text-muted); }
  .msg-tooltip-timing span:last-child { color: var(--color-text-secondary); }

  .content blockquote { color: var(--color-text-secondary); border-color: var(--color-border); }
  .content code { background: var(--color-hover); }
  .content li::marker { color: var(--color-text-muted); }
  .content hr { border-top-color: var(--color-border); }

  /* Tables in markdown content */
  .content table { box-shadow: 0 0 0 1px var(--color-border); }
  .content th {
    background: rgba(255,255,255,0.06);
    color: var(--color-text-muted);
  }
  .content th, .content td { border-bottom-color: var(--color-border); }
  .content td:not(:last-child), .content th:not(:last-child) { border-right-color: var(--color-border); }
  .content tbody tr:hover { background: var(--color-hover); }

  /* Tool cards */
  .tool-card { background: var(--color-card); border-color: var(--color-border); }
  .tool-card.complete { background: rgba(74,222,128,0.08); }
  .tool-card.error { background: rgba(239,68,68,0.1); }
  .tool-card.warning { background: rgba(250,204,21,0.08); }
  .tool-card.skipped { background: rgba(255,255,255,0.03); }
  .tool-label { color: var(--color-text-primary); }
  .tool-target { color: var(--color-text-secondary); }
  .tool-query { color: var(--color-text-muted); }
  .tool-detail { color: var(--color-text-muted); }
  .tool-duration { color: var(--color-text-muted); }
  .tool-chevron { color: var(--color-text-muted); }
  .tool-chevron:hover { color: var(--color-text-secondary); }
  .tool-icon svg { stroke: var(--color-text-muted); }
  .tool-detail-table tr { border-top-color: var(--color-border); }
  .td-key { color: var(--color-text-muted); }
  .td-val { color: var(--color-text-secondary); }
  .td-val code { background: rgba(255,255,255,0.08); color: var(--color-text-primary); }
  .td-result {
    background: rgba(255,255,255,0.04);
    color: var(--color-text-secondary);
  }
  .td-result img { border-color: var(--color-border); }
  .td-status-success { color: #4ade80; }
  .td-status-error { color: #f87171; }
  .td-status-warning { color: #fbbf24; }
  .tool-details { border-top-color: var(--color-border); }

  /* Connection / auth prompts (inline in tool cards) */
  .google-auth-prompt-inner {
    background: var(--color-card);
    border-color: var(--color-border);
  }
  .google-auth-prompt-inner svg { color: var(--color-text-muted); }
  .google-auth-prompt-text strong { color: var(--color-text-primary); }
  .google-auth-prompt-text span,
  .google-auth-prompt-desc { color: var(--color-text-secondary); }
  .google-auth-btn { background: var(--color-brand); color: var(--color-brand-text); }
  .google-auth-btn:hover { opacity: 0.9; }
  .google-auth-prompt-inner.connected {
    background: var(--color-hover);
  }
  .google-auth-prompt-inner.connected strong { color: var(--color-text-muted); }
  .tool-card.auth-needed { border-color: var(--color-border); }
  .tool-conn-link { color: var(--color-text-muted); }
  .tool-conn-link:hover { color: var(--color-text-secondary); }
  .tool-conn-link strong { color: var(--color-text-secondary); }
  .tool-conn-email { color: var(--color-text-muted); }
  .tool-conn-scope { background: rgba(255,255,255,0.08); color: var(--color-text-muted); }

  /* Rich content cards */
  .rc-flight, .rc-contact-card, .rc-search-card, .rc-email-card, .rc-doc-card,
  .rc-event-card, .rc-booking-card, .rc-loyalty-card { background: var(--color-card); border-color: var(--color-border); }

  /* Approval buttons */
  .approval-btn.approve { background: var(--color-brand); color: var(--color-brand-text); }
  .approval-btn.approve-session { color: var(--color-brand); border-color: var(--color-brand); }
  .approval-btn.deny { background: var(--color-hover); color: var(--color-text-secondary); }
  .approval-status.approved { color: var(--color-brand); }
  .approval-status.denied { color: var(--color-text-muted); }

  /* Misc text colors */
  .reveal-btn { color: var(--color-text-muted); border-color: var(--color-border); }
  .reveal-btn:hover { color: var(--color-text-primary); border-color: var(--color-text-muted); }
  .thinking-toggle { color: var(--color-text-muted); }
  .thinking-toggle:hover { color: var(--color-text-secondary); }
  .think-chevron:hover { color: var(--color-text-secondary); }

  /* Header status */
  #header-status.tool { color: var(--color-brand); background: var(--color-brand-subtle); }
  #header-status.waiting { color: var(--color-brand); background: var(--color-brand-subtle); }

  /* Input area tweaks */
  #chat-input-area textarea { color: var(--color-text-primary); }
  #chat-input-area #attach-btn { color: var(--color-text-muted); }
  #chat-input-area #attach-btn:hover { color: var(--color-text-secondary); background: var(--color-hover); }
  .file-badge.ready { background: var(--color-brand-subtle); color: var(--color-brand); }

  /* Scenario/debug panels */
  .scenario-toggle.on::after { background: var(--color-card); }

  /* Empty state */
  .empty-state-container { color: var(--color-text-primary); }
  .empty-state-greeting h1 { color: var(--color-text-primary); }

  /* Flight journey */
  .fj-icon-animated { color: var(--color-text-secondary); }
  .fj-task.complete .fj-task-label { color: var(--color-text-primary); }

  /* Quick replies */
  .quick-reply {
    background: var(--color-brand-subtle);
    color: var(--color-brand);
    border: none;
  }
  .quick-reply:hover {
    background: var(--color-hover);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  }
  .quick-reply.skeleton {
    background: linear-gradient(90deg, var(--color-hover) 25%, var(--color-active) 50%, var(--color-hover) 75%);
    background-size: 200% 100%;
  }

  /* Chat header title */
  .chat-title-trigger { color: var(--color-text-primary); }
  .room-header { border-color: var(--color-border); }
  .room-title-text { color: var(--color-text-primary); }
  .room-title-trigger .room-member-count { color: var(--color-text-muted); }

  /* Chat title menu (credits dropdown) */
  .chat-title-menu {
    background: var(--color-card);
    box-shadow: 0 0 0 1px var(--color-border), 0 8px 24px rgba(0,0,0,0.3);
  }
  .chat-credit-row { color: var(--color-text-secondary); }
  .chat-credit-value { color: var(--color-text-primary); }
  .chat-credit-total { color: var(--color-text-primary); border-color: var(--color-border); }
  .chat-credits-loading { color: var(--color-text-muted); }
  .chat-rename-input input {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-primary);
  }

  /* Nudge cards (new chat empty state) */
  .nudge-card {
    background: var(--color-card);
    border-color: var(--color-border);
  }
  .nudge-card:hover {
    border-color: var(--color-brand);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }
  .nudge-title { color: var(--color-text-primary); }
  .nudge-desc { color: var(--color-text-muted); }
  .nudge-icon { color: var(--color-brand); }
  .nudge-connect { color: var(--color-brand); }

  /* File upload badges */
  .file-badge { background: var(--color-brand-subtle); color: var(--color-brand); }
  .file-badge.analyzing { background: var(--color-brand-subtle); color: var(--color-brand); }
  .file-badge-image, .file-badge-image.analyzing, .file-badge-image.ready { background: var(--color-card); }

  /* Auto-approve modal */
  .auto-approve-modal { background: var(--color-card); }
  .approval-btn.deny { background: var(--color-hover); color: var(--color-text-secondary); }

  /* Secure input/store cards */
  .secure-input-field { background: var(--color-card); color: var(--color-text-primary); border-color: var(--color-border); }
  .secure-card, .sc-secure-header, .sc-section, .sc-detail, .sc-field-wrapper, .sc-modal-footer {
    background: var(--color-card);
  }

  /* Lightbox */
  .lightbox-content { background: var(--color-card); }

  /* Search results card */
  .search-container { background: var(--color-card); }
  .search-header { color: var(--color-text-primary); }
  .search-header .search-query { color: var(--color-text-secondary); }
  .search-result { color: var(--color-text-muted); }
  .search-result a { color: var(--color-brand); }
  .sr-domain { color: var(--color-text-muted); }
  .sr-toggle { color: var(--color-text-muted); }
  .sr-toggle:hover { color: var(--color-text-secondary); }

  /* Disabled send button */
  #chat-input-area #send-btn:disabled { background: rgba(255,255,255,0.12); }
}
