/* Legacy tool styles still referenced by JS (auto-pruned after the v8 tool migration). */
/* Panel card */
.panel-card{
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.panel-card-title{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.panel-card-body{
  flex: 1;
  overflow: auto;
  padding: 0;
}
/* --------------------------------------------------------------------------
   Diff Viewer
   -------------------------------------------------------------------------- */
.diff-line{
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  padding: 0 8px;
  white-space: pre-wrap;
  word-break: break-all;
}
.regex-match{
  background: rgba(255, 215, 64, 0.25);
  border-bottom: 2px solid var(--warning);
  border-radius: 2px;
}
/* --------------------------------------------------------------------------
   Color preview swatch
   -------------------------------------------------------------------------- */
.color-swatch{
  width: 52px;
  height: 52px;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}
.modal-overlay.open{
  opacity: 1;
  pointer-events: all;
}
.modal{
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--border-radius-lg);
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform var(--transition-med);
  scrollbar-gutter: stable;
}
.modal-overlay.open .modal{
  transform: translateY(0);
}
/* Custom scrollbar so long modal content never gets visually clipped */
.modal::-webkit-scrollbar{
  width: 8px;
}
.modal::-webkit-scrollbar-track{
  background: transparent;
}
.modal::-webkit-scrollbar-thumb{
  background: var(--border-strong);
  border-radius: 4px;
}
.modal::-webkit-scrollbar-thumb:hover{
  background: var(--text-secondary);
}
.modal-header{
  text-align: center;
  margin-bottom: 18px;
}
.modal-header h2{
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal-header p{
  font-size: 13px;
  color: var(--text-secondary);
}
/* Sidebar Pro section and locked items */
.nav-item-locked{
  opacity: 0.55;
}
.nav-item-locked:hover{
  opacity: 0.85;
  background: var(--accent-dim);
}
.nav-item-lock{
  font-size: 11px;
  flex-shrink: 0;
}
/* --------------------------------------------------------------------------
   Markdown Preview (Pro tool)
   -------------------------------------------------------------------------- */
.md-preview{
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}
.md-preview h1{ font-size: 28px; font-weight: 700; margin: 16px 0 8px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 6px; }
.md-preview h2{ font-size: 22px; font-weight: 600; margin: 14px 0 6px; }
.md-preview h3{ font-size: 18px; font-weight: 600; margin: 12px 0 4px; }
.md-preview h4{ font-size: 16px; font-weight: 600; margin: 10px 0 4px; }
.md-preview p{ margin: 8px 0; }
.md-preview ul,
.md-preview ol{ margin: 8px 0 8px 20px; }
.md-preview li{ margin: 4px 0; }
.md-preview hr{ border: none; border-top: 1px solid var(--border-default); margin: 16px 0; }
.md-preview a{
  color: var(--accent);
  text-decoration: none;
}
.md-preview a:hover{
  text-decoration: underline;
}
.md-code-block{
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: 12px;
  margin: 10px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}
.md-inline-code{
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}
.md-blockquote{
  border-left: 3px solid var(--accent);
  padding: 8px 14px;
  margin: 10px 0;
  background: var(--accent-dim);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.md-table{
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.md-table th,
.md-table td{
  border: 1px solid var(--border-default);
  padding: 8px 12px;
  text-align: left;
}
.md-table th{
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}
.md-checkbox{
  padding: 4px 0;
  font-size: 14px;
}
.md-checkbox.checked{
  color: var(--success);
}
.md-preview-body{
  background: var(--bg-base);
}
.pro-feature-gate-btn{
  flex-shrink: 0;
  font-size: 11px !important;
  padding: 4px 10px !important;
}
/* --------------------------------------------------------------------------
   Milestone Toast (non-blocking upgrade prompt)
   -------------------------------------------------------------------------- */
.milestone-toast{
  max-width: 420px !important;
  gap: 8px;
}
.milestone-toast-btn{
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.milestone-toast-btn:hover{
  background: var(--accent-dim);
}
/* --------------------------------------------------------------------------
   Sidebar Streak Badge
   -------------------------------------------------------------------------- */
.sidebar-streak{
  font-size: 11px;
  font-weight: 500;
  color: var(--warning);
  padding: 8px 14px 4px;
  text-align: center;
  opacity: 0.85;
}
/* --------------------------------------------------------------------------
   IO Toolbar (Import / Export bar)
   -------------------------------------------------------------------------- */
.io-toolbar{
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.io-toolbar .btn{
  font-size: 11px;
  padding: 3px 8px;
}
.pro-feature-gate-btn{
  margin-top: 4px;
}
/* ==========================================================================
   AI Features — Styles
   ========================================================================== */
/* AI sparkle button */
.ai-btn{
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #a78bfa;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.ai-btn:hover{
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.25));
  border-color: rgba(139, 92, 246, 0.5);
  color: #c4b5fd;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}
.ai-btn:active{
  transform: translateY(0);
}
.ai-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* Credit cost badge inside AI buttons */
.ai-cost-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.25);
  font-size: 10px;
  font-weight: 600;
  color: #c4b5fd;
  margin-left: 4px;
}
/* AI result panel */
.ai-result-panel{
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--border-radius);
  background: rgba(139, 92, 246, 0.06);
  margin: 8px 0;
  overflow: hidden;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  animation: aiPanelSlide 0.25s ease-out;
  flex-shrink: 0;
}
.ai-result-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(139, 92, 246, 0.12);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
  flex-shrink: 0;
}
.ai-result-actions{
  display: flex;
  gap: 4px;
}
.ai-result-body{
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}
.ai-result-body::-webkit-scrollbar{
  width: 6px;
}
.ai-result-body::-webkit-scrollbar-track{
  background: transparent;
}
.ai-result-body::-webkit-scrollbar-thumb{
  background: rgba(139, 92, 246, 0.4);
  border-radius: 3px;
}
.ai-result-body::-webkit-scrollbar-thumb:hover{
  background: rgba(139, 92, 246, 0.7);
}
.ai-result-content{
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  background: transparent;
  border: none;
  padding: 0;
}
/* AI retry button */
.ai-retry-btn{
  color: #a78bfa;
  font-size: 11px;
}
/* Sidebar AI credit indicator */
.ai-credit-indicator{
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
}
.ai-credit-count{
  font-size: 14px;
  font-weight: 700;
  color: #a78bfa;
  font-family: var(--font-mono);
}
.ai-pack-grid{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.ai-pack-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}
.ai-pack-card:hover{
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}
.ai-pack-card.popular{
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.06);
  position: relative;
}
.ai-pack-card.popular::before{
  content: 'BEST VALUE';
  position: absolute;
  top: -8px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  letter-spacing: 0.5px;
}
.ai-pack-credits{
  font-size: 24px;
  font-weight: 800;
  color: #a78bfa;
  font-family: var(--font-mono);
}
.ai-pack-label{
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.ai-pack-price{
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
}
.ai-pack-equiv{
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}
/* --------------------------------------------------------------------------
   AI Buttons & Badges
   -------------------------------------------------------------------------- */
.ai-btn{
  color: #a78bfa !important;
  border: 1px solid rgba(167, 139, 250, 0.3) !important;
  font-weight: 500;
  transition: all 0.2s ease;
}
.ai-btn:hover{
  background: rgba(167, 139, 250, 0.1) !important;
  border-color: rgba(167, 139, 250, 0.6) !important;
  color: #c4b5fd !important;
}
.ai-cost-badge{
  display: inline-block;
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  border-radius: 12px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  border: 1px solid rgba(167, 139, 250, 0.3);
}
.ai-result-panel{
  background: rgba(167, 139, 250, 0.05);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 8px;
}
.ai-result-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(167, 139, 250, 0.1);
  border-bottom: 1px solid rgba(167, 139, 250, 0.15);
  font-size: 12px;
  font-weight: 600;
  color: #c4b5fd;
}
.ai-result-body{
  padding: 12px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.ai-result-content{
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
}
/* ===========================================================================
   In-App Review Prompter (js/review.js)
   Bottom-right card, sits just above the toast stack. Non-blocking on
   purpose — a rating request should never trap the user in a modal.
   =========================================================================== */
.review-prompt{
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  width: 330px;
  max-width: calc(100vw - 40px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px 16px 12px;
  font-size: 13px;
  color: var(--text-primary);
  animation: reviewSlideIn 0.24s ease forwards;
}
.review-prompt.closing{
  animation: reviewSlideOut 0.2s ease forwards;
}
.review-prompt-close{
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.review-prompt-close:hover{ color: var(--text-primary); }
.review-prompt-title{
  font-size: 14px;
  font-weight: 600;
  margin: 0 20px 4px 0;
}
.review-prompt-sub{
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.review-stars{
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.review-star{
  background: none;
  border: none;
  padding: 2px 3px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--border-strong);
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.review-star:hover,
.review-star:focus-visible{ transform: scale(1.12); outline: none; }
.review-star.lit{ color: var(--warning); }
.review-prompt-actions{
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.review-prompt-actions .btn{ flex: 0 0 auto; }
.review-prompt-later,
.review-prompt-never{
  background: none;
  border: none;
  padding: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition-fast);
}
.review-prompt-later:hover,
.review-prompt-never:hover{ color: var(--text-secondary); }
.review-feedback-input{
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  resize: vertical;
}
.review-feedback-input:focus{
  outline: none;
  border-color: var(--accent);
}
.review-prompt-note{
  margin: 8px 0 0;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}
/* Milestone toasts carry buttons, so they need clicks back — the toast
   container itself is pointer-events:none so it never blocks the app. */
.milestone-toast{ pointer-events: auto; }
.cb-result-item{
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease, border-color 0.1s ease;
  user-select: none;
  color: var(--text-primary);
  font-family: var(--font-ui);
}
.cb-result-item:hover,
.cb-result-item.cb-selected{
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
}
.cb-result-icon{
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: #a78bfa;
}
.cb-result-text{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cb-result-label{
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-result-desc{
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-clipboard-btn{
  border: 1px dashed rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.05);
}
.cb-clipboard-btn:hover{
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
}
.cb-clipboard-loaded{
  font-size: 11px;
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 6px;
  padding: 6px 12px;
  margin-bottom: 8px;
}
.cb-no-results{
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
}
.cb-no-results p{
  margin: 0 0 6px;
  font-size: 13px;
}
.cb-no-results-hint{
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
}
.cb-ai-loading{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 16px;
  color: #a78bfa;
  font-size: 13px;
}
.ai-credit-indicator{ padding: 6px 10px; border-top: none; }
.ai-credit-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
}
.ai-credit-chip:hover{ background: rgba(139, 92, 246, 0.16); }
.ai-credit-popover{
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.ai-credit-popover-row{ display: flex; justify-content: space-between; gap: 12px; }
.ai-credit-popover-note{ margin: 0; color: var(--text-muted); font-size: 11px; }
.command-center{ max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 8px 4px 24px; }
.command-center-row{
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.command-center-row:hover{ background: var(--bg-hover); color: var(--text-primary); }
/* --------------------------------------------------------------------------
   API Workspace
   -------------------------------------------------------------------------- */
.apiws-layout{
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  height: calc(100vh - 160px);
  min-height: 520px;
}
.apiws-sidebar,
.apiws-main{
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.apiws-list-body{ padding: 0; flex: 1; overflow-y: auto; }
.apiws-main-body{
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.apiws-name-row input{
  font-size: 12px;
  padding: 4px 8px;
  width: 200px;
}
.apiws-bar{
  display: flex;
  gap: 8px;
  align-items: center;
}
.apiws-bar select{
  width: 118px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 8px;
}
.apiws-bar input{
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 7px 10px;
}
.apiws-tabs{ display: flex; gap: 4px; flex-wrap: wrap; }
.apiws-tab{
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.apiws-tab.active{
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--bg-input);
}
.apiws-pane-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.apiws-kv{
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  margin-bottom: 6px;
}
.apiws-kv input{
  font-size: 12px;
  padding: 5px 8px;
  font-family: 'JetBrains Mono', monospace;
}
.apiws-auth{ display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.apiws-auth select,
.apiws-auth input{ font-size: 12px; padding: 6px 8px; }
.apiws-auth-fields{ display: flex; flex-direction: column; gap: 6px; }
.apiws-pre{
  margin: 0;
  background: var(--bg-input);
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 80px;
  max-height: 280px;
  overflow: auto;
}
.apiws-output{ min-height: 160px; max-height: 400px; }
.apiws-meta{
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.apiws-status{ font-weight: 600; color: var(--text-secondary); }
.apiws-actions{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.apiws-empty{
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.apiws-row{
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  padding: 10px 12px;
  cursor: pointer;
}
.apiws-row:hover,
.apiws-row.active{ background: var(--bg-input); }
.apiws-row-name{ font-size: 13px; font-weight: 500; }
.apiws-row-meta{ font-size: 11px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 900px) {
.apiws-layout{ grid-template-columns: 1fr; height: auto; }
.apiws-sidebar{ max-height: 220px; }
.apiws-bar{ flex-wrap: wrap; }
.apiws-bar input{ min-width: 180px; }
}
