/* ─────────────────────────────────────────────────────────────────────────
   GENERATED FILE — DO NOT EDIT

   Written by web/docs/tools/build-anim-css.py from the application's own
   stylesheets in src/. Every rule below is the shipped CSS, scoped under
   `.tri-stage` so a window-sized UI can sit inside a page.

   To change how the replica looks, change the app. Then run:
       python3 tools/build-anim-css.py

   Sources, in the order SpotlightBar composes them:
     src/styles/global.css
     src/components/SpotlightBar.css
     src/components/TopBar.css
     src/components/IconButton.css
     src/components/Tooltip.css
     src/components/ModelSelector.css
     src/components/InstructionSelector.css
     src/components/SelectorPopup.css
     src/components/ActivityStrip.css
     src/components/ChatArea.css
     src/components/PromptInput.css
     src/components/PresetSuggestions.css
     src/components/BottomBar.css
     src/components/ActionGrid.css
     src/components/PromptEditor.css
     src/components/ConfirmAutomationModal.css
   ───────────────────────────────────────────────────────────────────────── */

/* ── src/styles/global.css ─────────────────────────────── */
.tri-stage * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.tri-stage button, .tri-stage input, .tri-stage select, .tri-stage textarea, .tri-stage a, .tri-stage[tabindex] {
  outline: none;
}
.tri-stage button:focus-visible, .tri-stage input:focus-visible, .tri-stage select:focus-visible, .tri-stage textarea:focus-visible, .tri-stage a:focus-visible {
  outline: none;
}
.tri-stage {
  --bg-primary: rgba(30, 30, 32, 0.98);
  --bg-secondary: rgba(44, 44, 48, 0.85);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-tertiary: rgba(255, 255, 255, 0.3);
  --accent-green: #34c759;
  --accent-green-dim: rgba(52, 199, 89, 0.6);
  --accent-blue: #0a84ff;
  --accent-purple: #bf5af2;
  --shadow-glow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(0, 0, 0, 0.2);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --window-bg: #1e1e20;
}
.tri-stage[data-theme="light"] {
  --bg-primary: rgba(248, 248, 250, 0.98);
  --bg-secondary: rgba(235, 235, 240, 0.9);
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-active: rgba(0, 0, 0, 0.08);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.04);
  --text-primary: rgba(0, 0, 0, 0.88);
  --text-secondary: rgba(0, 0, 0, 0.5);
  --text-tertiary: rgba(0, 0, 0, 0.3);
  --accent-green: #28a745;
  --accent-green-dim: rgba(40, 167, 69, 0.6);
  --accent-blue: #0071e3;
  --accent-purple: #9b59b6;
  --shadow-glow: 0 0 40px rgba(0, 0, 0, 0.1), 0 0 80px rgba(0, 0, 0, 0.05);
  --window-bg: #f8f8fa;
}
.tri-stage ::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.tri-stage ::-webkit-scrollbar-track {
  background: transparent;
}
.tri-stage ::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.2);
  border-radius: 4px;
}
.tri-stage ::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.35);
}
.tri-stage img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.tri-stage select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(128,128,128,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px !important;
}
.tri-stage :is(
  .settings-header,
  .help-header,
  .llm-header,
  .hotkeys-panel-header,
  .prompt-editor-header,
  .selector-header,
  .upgrade-header,
  .confirm-dialog-header,
  .confirm-auto-header,
  .right-drawer-header,
  .history-header
) {
  cursor: default;
}

/* ── src/components/SpotlightBar.css ─────────────────────────────── */
.tri-stage .spotlight-container {
  position: relative;
  width: var(--app-width, 680px);
  overflow: visible;
  padding: 0;
}
.tri-stage .spotlight-container--stretched, .tri-stage .spotlight-container--popup-open {
  height: 100vh;
}
.tri-stage .spotlight-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(
  135deg,
  rgba(52, 199, 89, 0.08) 0%,
  rgba(10, 132, 255, 0.05) 50%,
  rgba(191, 90, 242, 0.08) 100%
  );
  filter: blur(1px);
  z-index: 0;
  pointer-events: none;
}
.tri-stage .spotlight-container--popup-open .spotlight-glow {
  background: var(--bg-primary);
  filter: none;
}
.tri-stage .resize-grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 40px;
  height: 40px;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  z-index: 6;
  cursor: nwse-resize;
  -webkit-app-region: no-drag;
  opacity: 0;
  transition: opacity 0.15s;
}
.tri-stage .resize-grip::after {
  content: '';
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--text-tertiary, var(--border-color));
  border-bottom: 2px solid var(--text-tertiary, var(--border-color));
  border-bottom-right-radius: 3px;
}
.tri-stage .spotlight-container:hover .resize-grip {
  opacity: 0.5;
}
.tri-stage .spotlight-container.is-hover .resize-grip {
  opacity: 0.5;
}
.tri-stage .resize-grip:hover {
  opacity: 0.9;
}
.tri-stage .resize-grip.is-hover {
  opacity: 0.9;
}
.tri-stage .spotlight-inner {
  position: relative;
  z-index: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: clip;
}
.tri-stage .spotlight-inner--stretched {
  min-height: 100vh;
}
.tri-stage .spotlight-spacer {
  flex: 0;
  -webkit-app-region: drag;
}
.tri-stage .spotlight-inner--stretched .spotlight-spacer {
  flex: 1;
}
.tri-stage .spotlight-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
  flex-shrink: 0;
  -webkit-app-region: drag;
}
.tri-stage .drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 40;
  -webkit-app-region: no-drag;
  cursor: pointer;
}

/* ── src/components/TopBar.css ─────────────────────────────── */
.tri-stage .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  -webkit-app-region: drag;
}
.tri-stage .topbar-left, .tri-stage .topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  -webkit-app-region: no-drag;
}
.tri-stage .topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  -webkit-app-region: drag;
}
.tri-stage .logo-icon {
  width: 18px;
  height: 18px;
}

/* ── src/components/IconButton.css ─────────────────────────────── */
.tri-stage .icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-app-region: no-drag;
}
.tri-stage .icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .icon-btn.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .icon-btn--active {
  color: var(--accent-green);
}
.tri-stage .icon-btn--active:hover {
  color: var(--accent-green);
  background: rgba(52, 199, 89, 0.1);
}
.tri-stage .icon-btn--active.is-hover {
  color: var(--accent-green);
  background: rgba(52, 199, 89, 0.1);
}

/* ── src/components/Tooltip.css ─────────────────────────────── */
.tri-stage .tooltip-wrap {
  position: relative;
  display: inline-flex;
}
.tri-stage .tooltip-bubble {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.tri-stage .tooltip-bubble--top {
  bottom: calc(100% + 6px);
}
.tri-stage .tooltip-bubble--bottom {
  top: calc(100% + 6px);
}
.tri-stage .tooltip-bubble--left {
  right: calc(100% + 6px);
  left: auto;
  top: 50%;
  transform: translateY(-50%);
}
.tri-stage .tooltip-bubble--right {
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
}

/* ── src/components/ModelSelector.css ─────────────────────────────── */
.tri-stage .model-selector {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.tri-stage .model-selector:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}
.tri-stage .model-selector.is-hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}
.tri-stage .model-icon {
  color: var(--accent-green);
}
.tri-stage .model-chevron {
  color: var(--text-tertiary);
  transition: transform 0.15s;
}
.tri-stage .model-chevron--open {
  transform: rotate(180deg);
}
.tri-stage .model-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tri-stage .selector-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tri-stage .selector-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.tri-stage .selector-refresh:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.tri-stage .selector-refresh.is-hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.tri-stage .selector-group-loading {
  color: var(--accent-blue);
  animation: spin 1s linear infinite;
}
.tri-stage .selector-group-error {
  color: rgba(255, 69, 58, 0.8);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.tri-stage .selector-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tri-stage .selector-filter-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .selector-dropdown-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.tri-stage .selector-dropdown {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 5px 26px 5px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
  transition: all 0.12s ease;
}
.tri-stage .selector-dropdown:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}
.tri-stage .selector-dropdown.is-hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}
.tri-stage .selector-dropdown:focus-visible {
  border-color: var(--accent-green);
}
.tri-stage .selector-dropdown-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.tri-stage .selector-hermes-block {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 12px 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius-sm);
  background: rgba(52, 199, 89, 0.08);
}
.tri-stage .selector-hermes-body {
  flex: 1;
  min-width: 0;
}
.tri-stage .selector-hermes-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
}
.tri-stage .selector-hermes-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.tri-stage .selector-hermes-use {
  flex-shrink: 0;
  padding: 4px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-green);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.12s;
}
.tri-stage .selector-hermes-use:hover {
  filter: brightness(1.08);
}
.tri-stage .selector-hermes-use.is-hover {
  filter: brightness(1.08);
}
.tri-stage .selector-hermes-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.tri-stage .selector-hermes-dismiss:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .selector-hermes-dismiss.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .selector-option--needs-setup {
  opacity: 0.6;
}
.tri-stage .selector-pi-reason {
  padding: 2px 12px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* ── src/components/InstructionSelector.css ─────────────────────────────── */
.tri-stage .context-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
  max-width: 120px;
}
.tri-stage .context-selector:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.tri-stage .context-selector.is-hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.tri-stage .context-selector--active {
  border-color: var(--accent-green);
  color: var(--text-primary);
}
.tri-stage .context-selector--active .context-selector-icon {
  color: var(--accent-green);
}
.tri-stage .context-selector-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}
.tri-stage .context-selector-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tri-stage .context-selector-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.tri-stage .context-selector-chevron--open {
  transform: rotate(180deg);
}
.tri-stage .context-selector-clear {
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: pointer;
}
.tri-stage .context-selector-clear:hover {
  color: var(--text-primary);
}
.tri-stage .context-selector-clear.is-hover {
  color: var(--text-primary);
}
.tri-stage .context-dropdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.tri-stage .context-dropdown {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 4px;
  z-index: 10000;
}
.tri-stage .context-dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.tri-stage .context-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .context-dropdown-item.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .context-dropdown-item--selected {
  color: var(--accent-green);
}
.tri-stage .context-dropdown-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tri-stage .context-dropdown-item-meta {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.tri-stage .context-dropdown-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
}
.tri-stage .selector-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .selector-filter-chip {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s ease;
}
.tri-stage .selector-filter-chip:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.tri-stage .selector-filter-chip.is-hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.tri-stage .selector-filter-chip--active {
  background: rgba(52, 199, 89, 0.12);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* ── src/components/SelectorPopup.css ─────────────────────────────── */
.tri-stage .selector-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  -webkit-app-region: no-drag;
}
.tri-stage .selector-panel {
  width: 340px;
  max-height: 75vh;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tri-stage .selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .selector-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.tri-stage .selector-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.tri-stage .selector-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .selector-close.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .selector-search-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .selector-search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.tri-stage .selector-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  caret-color: var(--accent-green);
}
.tri-stage .selector-search-input::placeholder {
  color: var(--text-tertiary);
}
.tri-stage .selector-search-input:focus-visible {
  outline: none;
}
.tri-stage .selector-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.tri-stage .selector-list::-webkit-scrollbar {
  width: 4px;
}
.tri-stage .selector-list::-webkit-scrollbar-thumb {
  background: var(--border-color); border-radius: 4px;
}
.tri-stage .selector-group {
  margin-bottom: 4px;
}
.tri-stage .selector-group-label {
  padding: 6px 8px 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tri-stage .selector-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
  font-family: inherit;
}
.tri-stage .selector-option:hover {
  background: var(--bg-hover);
}
.tri-stage .selector-option.is-hover {
  background: var(--bg-hover);
}
.tri-stage .selector-option--selected {
  background: rgba(52, 199, 89, 0.08);
}
.tri-stage .selector-option--selected:hover {
  background: rgba(52, 199, 89, 0.12);
}
.tri-stage .selector-option--selected.is-hover {
  background: rgba(52, 199, 89, 0.12);
}
.tri-stage .selector-option-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 400;
}
.tri-stage .selector-option--selected .selector-option-name {
  color: var(--accent-green);
  font-weight: 500;
}
.tri-stage .selector-option-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tri-stage .selector-check {
  color: var(--accent-green);
}
.tri-stage .lang-selected .selector-option-name, .tri-stage .lang-selected.selector-option-name {
  color: var(--accent-purple);
}
.tri-stage .lang-check {
  color: var(--accent-purple) !important;
}
.tri-stage .selector-option.lang-selected {
  background: rgba(191, 90, 242, 0.08);
}
.tri-stage .selector-option.lang-selected:hover {
  background: rgba(191, 90, 242, 0.12);
}
.tri-stage .selector-option.lang-selected.is-hover {
  background: rgba(191, 90, 242, 0.12);
}
.tri-stage .model-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent-blue);
}
.tri-stage .selector-empty {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}
.tri-stage .selector-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ── src/components/ActivityStrip.css ─────────────────────────────── */
.tri-stage .activity-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 11.5px;
  color: var(--text-secondary);
  min-width: 0;
}
.tri-stage .activity-strip__meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.tri-stage .activity-strip__stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.tri-stage .activity-strip__stat svg {
  color: var(--text-tertiary);
}
.tri-stage .activity-strip__scope {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.14);
  color: var(--accent-green);
  font-weight: 600;
}
.tri-stage .activity-strip__controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.tri-stage .activity-strip__model {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 260px;
}
.tri-stage .activity-strip__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.12s;
}
.tri-stage .activity-strip__btn:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
}
.tri-stage .activity-strip__btn.is-hover {
  border-color: var(--border-color);
  color: var(--text-primary);
}
.tri-stage .activity-strip__btn svg {
  color: var(--text-tertiary);
  flex: 0 0 auto;
}
.tri-stage .activity-strip__btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tri-stage .activity-strip__btn--armed {
  background: rgba(192, 57, 43, 0.16);
  border-color: rgba(192, 57, 43, 0.5);
  color: var(--text-primary);
  font-weight: 600;
}
.tri-stage .activity-strip__btn--armed svg {
  color: #ff6b5e;
}
.tri-stage .activity-strip__muted {
  margin-left: 4px;
  color: var(--text-tertiary);
}
.tri-stage .turn-cap-input {
  width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
}
.tri-stage .turn-cap-input:focus {
  border-color: var(--accent-green);
  outline: none;
}

/* ── src/components/ChatArea.css ─────────────────────────────── */
.tri-stage .chat-area {
  max-height: var(--chat-max-height, 280px);
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  -webkit-app-region: no-drag;
  user-select: text;
  -webkit-user-select: text;
}
.tri-stage .chat-area--with-history {
  max-height: var(--chat-max-height, 560px);
}
.tri-stage .chat-area::-webkit-scrollbar {
  width: 4px;
}
.tri-stage .chat-area::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.tri-stage .chat-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.tri-stage .chat-row--user {
  flex-direction: row-reverse;
}
.tri-stage .chat-row > .tooltip-wrap {
  opacity: 0;
  transition: opacity 0.15s;
  position: sticky;
  top: 25px;
  align-self: flex-start;
  z-index: 2;
}
.tri-stage .chat-row:hover > .tooltip-wrap {
  opacity: 1;
}
.tri-stage .chat-row.is-hover > .tooltip-wrap {
  opacity: 1;
}
.tri-stage .chat-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
  margin-top: 4px;
}
.tri-stage .chat-copy-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .chat-copy-btn.is-hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .chat-bubble {
  display: flex;
  gap: 8px;
  max-width: calc(100% - 100px);
  line-height: 1.5;
}
.tri-stage .chat-bubble--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.tri-stage .chat-bubble--user .chat-text {
  background: rgba(10, 132, 255, 0.15);
  color: var(--text-primary);
  border-radius: 10px 10px 2px 10px;
  padding: 8px 12px;
  font-size: 13px;
}
.tri-stage .chat-bubble--ai {
  align-self: flex-start;
}
.tri-stage .chat-bubble--ai > .chat-text {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 10px 10px 10px 2px;
  padding: 8px 12px;
  font-size: 13px;
}
.tri-stage .chat-avatar {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  margin-top: 2px;
  position: sticky;
  top: 25px;
  align-self: flex-start;
  z-index: 2;
}
.tri-stage .chat-text {
  margin: 0;
  font-family: inherit;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tri-stage .chat-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}
.tri-stage .chat-row--editing .chat-bubble {
  max-width: 100%;
  width: 100%;
}
.tri-stage .chat-edit-textarea {
  width: 100%;
  min-height: 90px;
  max-height: 60vh;
  resize: vertical;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.12s;
}
.tri-stage .chat-edit-textarea:focus {
  border-color: var(--accent-blue);
}
.tri-stage .chat-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.tri-stage .chat-edit-btn {
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
}
.tri-stage .chat-edit-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .chat-edit-btn.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .chat-edit-btn--primary {
  background: rgba(10, 132, 255, 0.15);
  border-color: rgba(10, 132, 255, 0.3);
  color: var(--text-primary);
}
.tri-stage .chat-edit-btn--primary:hover {
  background: rgba(10, 132, 255, 0.25);
}
.tri-stage .chat-edit-btn--primary.is-hover {
  background: rgba(10, 132, 255, 0.25);
}
.tri-stage .chat-edit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tri-stage .chat-inline-tag {
  display: inline;
  padding: 1px 7px;
  margin: 0 2px;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.25);
  border-radius: 4px;
  color: var(--accent-green);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tri-stage .chat-inline-file {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.25);
  color: var(--accent-blue);
}
.tri-stage .chat-bubble--error .chat-text {
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.2);
  color: var(--text-primary);
}
.tri-stage .thinking-block {
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(255, 204, 0, 0.06);
  border: 1px solid rgba(255, 204, 0, 0.15);
  overflow: hidden;
}
.tri-stage .thinking-block--tool {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}
.tri-stage .thinking-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s;
}
.tri-stage .thinking-toggle:hover {
  color: var(--text-primary);
}
.tri-stage .thinking-toggle.is-hover {
  color: var(--text-primary);
}
.tri-stage .thinking-icon {
  color: rgba(255, 204, 0, 0.8);
  flex: none;
}
.tri-stage .thinking-block--tool .thinking-icon {
  color: var(--text-tertiary);
}
.tri-stage .thinking-icon--done {
  color: var(--accent-green);
}
.tri-stage .thinking-icon--failed {
  color: #ff6b6b;
}
.tri-stage .thinking-icon--spin {
  animation: thinking-spin 1s linear infinite;
}
@keyframes thinking-spin {
  to { transform: rotate(360deg); }
}
.tri-stage .thinking-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
  text-align: left;
}
.tri-stage .tool-name {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-primary);
}
.tri-stage .tool-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: 0.7;
}
.tri-stage .thinking-content {
  padding: 0 10px 8px;
  max-height: 150px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.tri-stage .thinking-block--tool .thinking-content {
  max-height: 260px;
}
.tri-stage .thinking-text--code {
  margin: 0 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.tri-stage .thinking-text--code:last-child {
  margin-bottom: 0;
}
@media (prefers-reduced-motion: reduce) {
  .tri-stage .thinking-icon--spin {
    animation: none;
  }
}
.tri-stage .thinking-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}
.tri-stage .streaming-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.tri-stage .streaming-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: streamPulse 1.2s ease-in-out infinite;
}
.tri-stage .streaming-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.tri-stage .streaming-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes streamPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}
.tri-stage .chat-bubble-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  max-width: 100%;
}
.tri-stage .chat-markdown {
  background: var(--bg-secondary);
  border-radius: 10px 10px 10px 2px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
}
.tri-stage .chat-markdown p {
  margin: 0 0 8px;
}
.tri-stage .chat-markdown p:last-child {
  margin-bottom: 0;
}
.tri-stage .chat-markdown h1, .tri-stage .chat-markdown h2, .tri-stage .chat-markdown h3, .tri-stage .chat-markdown h4 {
  margin: 12px 0 6px;
  font-weight: 600;
  line-height: 1.3;
}
.tri-stage .chat-markdown h1 {
  font-size: 16px;
}
.tri-stage .chat-markdown h2 {
  font-size: 15px;
}
.tri-stage .chat-markdown h3 {
  font-size: 14px;
}
.tri-stage .chat-markdown h4 {
  font-size: 13px;
}
.tri-stage .chat-markdown ul, .tri-stage .chat-markdown ol {
  margin: 4px 0;
  padding-left: 18px;
}
.tri-stage .chat-markdown li {
  margin: 2px 0;
}
.tri-stage .chat-markdown code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.tri-stage .chat-markdown pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 8px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tri-stage .chat-markdown pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}
.tri-stage .chat-markdown blockquote {
  border-left: 3px solid var(--accent-blue);
  margin: 8px 0;
  padding: 4px 12px;
  color: var(--text-secondary);
}
.tri-stage .chat-markdown table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  width: 100%;
}
.tri-stage .chat-markdown th, .tri-stage .chat-markdown td {
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  text-align: left;
}
.tri-stage .chat-markdown th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}
.tri-stage .chat-markdown a {
  color: var(--accent-blue);
  text-decoration: none;
}
.tri-stage .chat-markdown a:hover {
  text-decoration: underline;
}
.tri-stage .chat-markdown a.is-hover {
  text-decoration: underline;
}
.tri-stage .chat-markdown hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 10px 0;
}
.tri-stage .chat-markdown strong {
  font-weight: 600;
}
.tri-stage .chat-sources {
  margin-top: 6px;
}
.tri-stage .chat-sources-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(52, 199, 89, 0.08);
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.tri-stage .chat-sources-toggle:hover {
  background: rgba(52, 199, 89, 0.14);
}
.tri-stage .chat-sources-toggle.is-hover {
  background: rgba(52, 199, 89, 0.14);
}
.tri-stage .chat-sources-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  max-width: 100%;
}
.tri-stage .chat-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border: none;
  background: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.tri-stage .chat-source-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .chat-source-item.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .chat-source-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tri-stage .chat-source-score {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

/* ── src/components/PromptInput.css ─────────────────────────────── */
.tri-stage .prompt-wrapper {
  position: relative;
  -webkit-app-region: no-drag;
}
.tri-stage .prompt-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 8px;
}
.tri-stage .prompt-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  caret-color: var(--accent-green);
  min-width: 0;
  min-height: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}
.tri-stage .prompt-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  font-weight: 400;
  pointer-events: none;
}
.tri-stage .prompt-input .prompt-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  margin: 0 2px;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.25);
  border-radius: 4px;
  color: var(--accent-green);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.4;
  user-select: all;
  cursor: default;
}
.tri-stage .prompt-input .prompt-file-tag {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.25);
  color: var(--accent-blue);
}
.tri-stage .prompt-input .prompt-file-tag--processing {
  opacity: 0.7;
  animation: prompt-file-pulse 1.2s ease-in-out infinite;
}
.tri-stage .prompt-file-spinner {
  display: inline-block;
  margin-left: 4px;
  animation: prompt-file-spin 1.1s linear infinite;
}
.tri-stage .prompt-transcribing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.tri-stage .prompt-transcribing .prompt-file-spinner {
  margin-left: 0;
}
@keyframes prompt-file-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}
@keyframes prompt-file-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.tri-stage .prompt-input .prompt-selected-tag {
  background: rgba(255, 159, 10, 0.12);
  border-color: rgba(255, 159, 10, 0.3);
  color: #ff9f0a;
  font-style: italic;
}
.tri-stage .prompt-input .prompt-clipboard-tag {
  background: rgba(175, 82, 222, 0.12);
  border-color: rgba(175, 82, 222, 0.3);
  color: #af52de;
  font-style: italic;
}
.tri-stage .prompt-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tri-stage .prompt-attach:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .prompt-attach.is-hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .prompt-stop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 69, 58, 0.3);
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tri-stage .prompt-stop:hover {
  background: rgba(255, 69, 58, 0.22);
  color: #ff453a;
}
.tri-stage .prompt-stop.is-hover {
  background: rgba(255, 69, 58, 0.22);
  color: #ff453a;
}
.tri-stage .prompt-row--recording {
  justify-content: center;
  gap: 10px;
}
.tri-stage .prompt-waveform {
  flex: 1;
  height: 32px;
  border-radius: var(--radius-sm);
}
.tri-stage .prompt-record-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 69, 58, 0.3);
  background: rgba(255, 69, 58, 0.1);
  color: #ff453a;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tri-stage .prompt-record-cancel:hover {
  background: rgba(255, 69, 58, 0.2);
}
.tri-stage .prompt-record-cancel.is-hover {
  background: rgba(255, 69, 58, 0.2);
}
.tri-stage .prompt-record-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--accent-green);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tri-stage .prompt-record-submit:hover {
  opacity: 0.85;
}
.tri-stage .prompt-record-submit.is-hover {
  opacity: 0.85;
}

/* ── src/components/PresetSuggestions.css ─────────────────────────────── */
.tri-stage .preset-suggestions {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  max-height: 260px;
  display: flex;
  flex-direction: column;
}
.tri-stage .preset-suggestions-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.tri-stage .preset-suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
  gap: 12px;
}
.tri-stage .preset-suggestion-item:hover, .tri-stage .preset-suggestion-item--active {
  background: rgba(52, 199, 89, 0.08);
}
.tri-stage .preset-suggestion-item.is-hover, .tri-stage .preset-suggestion-item--active {
  background: rgba(52, 199, 89, 0.08);
}
.tri-stage .preset-suggestion-item--active {
  background: rgba(52, 199, 89, 0.12);
}
.tri-stage .preset-suggestion-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.tri-stage .preset-suggestion-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tri-stage .preset-suggestion-desc {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tri-stage .preset-suggestion-code {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  background: rgba(52, 199, 89, 0.1);
  border-radius: 4px;
  color: var(--accent-green);
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.tri-stage .preset-code-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}
.tri-stage .preset-suggestions-footer {
  padding: 6px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ── src/components/BottomBar.css ─────────────────────────────── */
.tri-stage .bottombar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  position: relative;
  -webkit-app-region: drag;
}
.tri-stage .bottombar-center {
  display: flex;
  align-items: center;
  -webkit-app-region: no-drag;
}
.tri-stage .bottombar-left {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  -webkit-app-region: no-drag;
}
.tri-stage .token-counter {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: default;
  transition: color 0.15s, background 0.15s;
}
.tri-stage .token-counter:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .token-counter.is-hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .token-counter-text {
  font-weight: 500;
}
.tri-stage .token-counter--depleted {
  color: var(--accent-red, #ff453a);
}
.tri-stage .token-counter--depleted:hover {
  color: var(--accent-red, #ff453a);
}
.tri-stage .token-counter--depleted.is-hover {
  color: var(--accent-red, #ff453a);
}
.tri-stage .bottombar-right {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  -webkit-app-region: no-drag;
  z-index: 7;
}
.tri-stage .grid-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
}
.tri-stage .grid-toggle:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .grid-toggle.is-hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .grid-toggle--active {
  color: var(--text-primary);
  background: var(--bg-active);
}
.tri-stage .bottom-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
}
.tri-stage .bottom-toggle:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .bottom-toggle.is-hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.tri-stage .bottom-toggle--on {
  color: var(--accent-green);
  background: rgba(52, 199, 89, 0.1);
}
.tri-stage .bottom-toggle--on:hover {
  color: var(--accent-green);
  background: rgba(52, 199, 89, 0.15);
}
.tri-stage .bottom-toggle--on.is-hover {
  color: var(--accent-green);
  background: rgba(52, 199, 89, 0.15);
}
.tri-stage .bottom-toggle--locked, .tri-stage .bottom-toggle--locked:hover {
  opacity: 0.6;
  color: var(--text-tertiary);
  background: rgba(52, 199, 89, 0.06);
  cursor: not-allowed;
}
.tri-stage .bottom-toggle--locked, .tri-stage .bottom-toggle--locked.is-hover {
  opacity: 0.6;
  color: var(--text-tertiary);
  background: rgba(52, 199, 89, 0.06);
  cursor: not-allowed;
}

/* ── src/components/ActionGrid.css ─────────────────────────────── */
.tri-stage .action-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 10px 12px 12px;
  -webkit-app-region: no-drag;
}
.tri-stage .action-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.tri-stage .action-grid-item:hover {
  background: var(--bg-hover);
  cursor: pointer;
}
.tri-stage .action-grid-item.is-hover {
  background: var(--bg-hover);
  cursor: pointer;
}
.tri-stage .action-grid-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: transform 0.15s;
}
.tri-stage .action-grid-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* ── src/components/PromptEditor.css ─────────────────────────────── */
.tri-stage .prompt-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  -webkit-app-region: no-drag;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tri-stage .prompt-editor-panel {
  width: 600px;
  max-width: 92vw;
  max-height: 85vh;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-app-region: no-drag;
}
.tri-stage .prompt-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .prompt-editor-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.tri-stage .prompt-editor-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.tri-stage .prompt-editor-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .prompt-editor-close.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .prompt-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.tri-stage .pe-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tri-stage .pe-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.tri-stage .pe-input, .tri-stage .pe-textarea {
  padding: 7px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
}
.tri-stage .pe-input:focus, .tri-stage .pe-textarea:focus {
  border-color: rgba(52, 199, 89, 0.4);
}
.tri-stage .pe-input::placeholder, .tri-stage .pe-textarea::placeholder {
  color: var(--text-tertiary);
}
.tri-stage .pe-textarea {
  line-height: 1.5;
  min-height: 80px;
}
.tri-stage .pe-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 34px;
  align-items: center;
  transition: border-color 0.15s;
}
.tri-stage .pe-tags-wrap:focus-within {
  border-color: rgba(52, 199, 89, 0.4);
}
.tri-stage .pe-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  background: rgba(52, 199, 89, 0.1);
  border-radius: 3px;
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 500;
}
.tri-stage .pe-tag-remove {
  border: none;
  background: none;
  color: var(--accent-green);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
}
.tri-stage .pe-tag-remove:hover {
  opacity: 1;
}
.tri-stage .pe-tag-remove.is-hover {
  opacity: 1;
}
.tri-stage .pe-tag-input {
  flex: 1;
  min-width: 60px;
  border: none;
  background: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
}
.tri-stage .pe-tag-input::placeholder {
  color: var(--text-tertiary);
}
.tri-stage .prompt-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .pe-btn {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
  border: none;
}
.tri-stage .pe-btn--cancel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.tri-stage .pe-btn--cancel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .pe-btn--cancel.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .pe-btn--save {
  background: var(--accent-green);
  color: #fff;
}
.tri-stage .pe-btn--save:hover {
  opacity: 0.9;
}
.tri-stage .pe-btn--save.is-hover {
  opacity: 0.9;
}
.tri-stage .pe-label--section {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.tri-stage .pe-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 10px;
}
.tri-stage .pe-magnets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.tri-stage .pe-magnet-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tri-stage .pe-magnet-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tri-stage .pe-magnet-select {
  padding: 5px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}
.tri-stage .pe-magnet-select:focus {
  border-color: var(--accent-green);
}
.tri-stage .pe-hotkey-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tri-stage .pe-hotkey-capture-wrap {
  position: relative;
  flex: 1;
}
.tri-stage .pe-hotkey-input {
  width: 100%;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s;
}
.tri-stage .pe-hotkey-input:focus {
  border-color: var(--accent-green);
}
.tri-stage .pe-hotkey-input--empty {
  color: var(--text-muted);
}
.tri-stage .pe-hotkey-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.tri-stage .pe-hotkey-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--bg-hover);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
}
.tri-stage .pe-hotkey-clear:hover {
  color: var(--text-primary);
}
.tri-stage .pe-hotkey-clear.is-hover {
  color: var(--text-primary);
}
.tri-stage .pe-hotkey-error {
  font-size: 11px;
  color: #ff3b30;
  margin-top: 2px;
}

/* ── src/components/ConfirmAutomationModal.css ─────────────────────────────── */
.tri-stage .confirm-auto-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  -webkit-app-region: no-drag;
}
.tri-stage .confirm-auto-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tri-stage .confirm-auto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .confirm-auto-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.tri-stage .confirm-auto-title svg {
  color: var(--accent-orange, #ff9f0a);
}
.tri-stage .confirm-auto-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.tri-stage .confirm-auto-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .confirm-auto-close.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .confirm-auto-body {
  padding: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.tri-stage .confirm-auto-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.tri-stage .confirm-auto-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.tri-stage .confirm-auto-endpoint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 7px 9px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tri-stage .confirm-auto-method {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 159, 10, 0.15);
  color: var(--accent-orange, #ff9f0a);
  flex-shrink: 0;
}
.tri-stage .confirm-auto-url {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tri-stage .confirm-auto-params-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin: 16px 0 8px;
}
.tri-stage .confirm-auto-empty {
  font-size: 12px;
  color: var(--text-tertiary);
}
.tri-stage .confirm-auto-param {
  margin-bottom: 10px;
}
.tri-stage .confirm-auto-param-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.tri-stage .confirm-auto-param-desc {
  font-weight: 400;
  color: var(--text-tertiary);
}
.tri-stage .confirm-auto-input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 32px;
  padding: 7px 9px;
  background: var(--bg-secondary, var(--bg-hover));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s;
}
.tri-stage .confirm-auto-input:focus {
  border-color: var(--accent-green);
}
.tri-stage .confirm-auto-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.tri-stage .confirm-auto-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s;
}
.tri-stage .confirm-auto-btn--ghost {
  background: none;
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.tri-stage .confirm-auto-btn--ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .confirm-auto-btn--ghost.is-hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tri-stage .confirm-auto-btn--run {
  background: var(--accent-green);
  color: #fff;
}
.tri-stage .confirm-auto-btn--run:hover {
  filter: brightness(1.08);
}
.tri-stage .confirm-auto-btn--run.is-hover {
  filter: brightness(1.08);
}
