.help-widget {
  position: fixed;
  z-index: 1000;
  font-family: var(--hw-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* Help Button */
.hw-button {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background-color: var(--hw-primary, #4C6EF5);
  color: var(--text-on-accent, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 150ms ease;
  z-index: 1001;
  animation: hw-pulse 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 3;
}

.hw-button.bottom-right { bottom: 24px; right: 24px; }
.hw-button.bottom-left { bottom: 24px; left: 24px; }
.hw-button:hover { transform: scale(1.05); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); }
.hw-button:active { transform: scale(0.98); }

@keyframes hw-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* "New version available" badge on the help button */
.hw-button-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #FA5252;
  border: 2px solid var(--bg-elevated, #fff);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Chat Panel */
.hw-chat-panel {
  position: fixed;
  width: 400px;
  height: 500px;
  background-color: var(--bg-elevated, #fff);
  border-radius: 16px;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  animation: hw-panel-slide-up 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hw-chat-panel.bottom-right { bottom: 92px; right: 24px; }
.hw-chat-panel.bottom-left { bottom: 92px; left: 24px; }

@keyframes hw-panel-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chat Header */
.hw-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 12px 0 16px;
  background-color: var(--bg-surface, #F8F9FA);
  border-bottom: 1px solid var(--border-default, #E9ECEF);
  flex-shrink: 0;
}

.hw-chat-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #212529);
}

.hw-chat-header-actions {
  display: flex;
  gap: 4px;
}

.hw-chat-header-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted, #868E96);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 150ms ease, background-color 150ms ease;
}

.hw-chat-header-btn:hover {
  color: var(--text-primary, #212529);
  background-color: var(--bg-hover, #F1F3F5);
}

.hw-chat-header-btn.active {
  color: var(--accent, #4C6EF5);
  background-color: var(--accent-subtle, #EDF2FF);
}

/* New-version / reload banner */
.hw-update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--accent-subtle, #EDF2FF);
  border-bottom: 1px solid var(--border-default, #E9ECEF);
  font-size: 13px;
  color: var(--accent-pressed, #364FC7);
  flex-shrink: 0;
}

.hw-update-banner-text { flex: 1; line-height: 1.4; }

.hw-update-banner-reload {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  background-color: var(--hw-primary, #4C6EF5);
  color: var(--text-on-accent, #fff);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter 150ms ease;
  font-family: inherit;
}

.hw-update-banner-reload:hover { filter: brightness(0.92); }

/* Messages Area */
.hw-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Help Banner */
.hw-help-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background-color: var(--accent-subtle, #EDF2FF);
  border-radius: 10px;
  font-size: 13px;
  color: var(--accent-pressed, #364FC7);
  line-height: 1.4;
}

.hw-help-banner-text { flex: 1; }

.hw-help-banner-dismiss {
  border: none;
  background: transparent;
  color: var(--accent-pressed, #364FC7);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.6;
  flex-shrink: 0;
}

.hw-help-banner-dismiss:hover { opacity: 1; }

/* Picking Banner */
.hw-picking-banner {
  padding: 10px 12px;
  background-color: #FFF9DB;
  border-radius: 10px;
  font-size: 13px;
  color: #E67700;
  text-align: center;
  line-height: 1.4;
}

/* Message Bubble */
.hw-message-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.hw-message-bubble.user {
  align-self: flex-end;
  background-color: var(--hw-primary, #4C6EF5);
  color: var(--text-on-accent, #fff);
}

.hw-message-bubble.response {
  align-self: flex-start;
  background-color: var(--bg-surface, #F8F9FA);
  color: var(--text-primary, #212529);
}

.hw-message-context-badge {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 4px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: inline-block;
}

.hw-message-bubble-text { margin-bottom: 4px; white-space: pre-wrap; }
.hw-message-bubble-time { font-size: 11px; opacity: 0.7; }
.hw-message-bubble.response .hw-message-bubble-time { color: var(--text-hint, #ADB5BD); opacity: 1; }

/* Element Context Display */
.hw-element-context {
  padding: 8px 12px;
  border-top: 1px solid var(--border-default, #E9ECEF);
  background-color: var(--bg-surface, #F8F9FA);
  flex-shrink: 0;
  font-size: 12px;
}

.hw-element-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hw-element-context-label {
  font-weight: 600;
  color: var(--accent, #4C6EF5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hw-element-context-clear {
  border: none;
  background: transparent;
  color: var(--text-muted, #868E96);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.hw-element-context-clear:hover { color: var(--text-primary, #212529); }

.hw-element-context-tag {
  color: var(--text-primary, #495057);
  font-family: "SF Mono", "Fira Code", monospace;
  margin-bottom: 4px;
}

.hw-element-context-text {
  color: var(--text-muted, #868E96);
  font-style: italic;
  font-family: inherit;
}

.hw-element-context-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  line-height: 1.6;
}

.hw-element-context-component {
  color: var(--text-primary, #495057);
  font-family: "SF Mono", "Fira Code", monospace;
}

.hw-element-context-arrow {
  color: var(--text-hint, #ADB5BD);
}

/* Chat Input */
.hw-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-default, #E9ECEF);
  background-color: var(--bg-surface, #F8F9FA);
  flex-shrink: 0;
  min-height: 48px;
}

.hw-chat-input input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-default, #E9ECEF);
  border-radius: 8px;
  background-color: var(--bg-base, #fff);
  color: var(--text-primary, #212529);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease;
  font-family: inherit;
}

.hw-chat-input input::placeholder { color: var(--text-hint, #ADB5BD); }
.hw-chat-input input:focus { border-color: var(--accent, #4C6EF5); }
.hw-chat-input input:disabled { opacity: 0.5; cursor: not-allowed; }

.hw-chat-send-button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background-color: var(--hw-primary, #4C6EF5);
  color: var(--text-on-accent, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease;
  flex-shrink: 0;
}

.hw-chat-send-button:hover:not(:disabled) { filter: brightness(0.9); }
.hw-chat-send-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Typing Indicator */
.hw-typing-indicator {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background-color: var(--bg-surface, #F8F9FA);
  border-radius: 12px;
}

.hw-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-hint, #ADB5BD);
  animation: hw-typing-bounce 1.4s infinite ease-in-out;
}

.hw-typing-dot:nth-child(1) { animation-delay: 0ms; }
.hw-typing-dot:nth-child(2) { animation-delay: 200ms; }
.hw-typing-dot:nth-child(3) { animation-delay: 400ms; }

@keyframes hw-typing-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hw-button { animation: none; }
  .hw-typing-dot { animation: none; opacity: 0.5; }
  .hw-chat-panel { animation: none; }
}

@media (max-width: 767px) {
  .hw-chat-panel {
    width: 100vw;
    height: 100vh;
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: 0;
  }
  .hw-chat-panel.bottom-left { right: 0; }
}
/* Auth gate: login screen, session-check spinner, and the sidebar user menu. */

.auth-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  background: var(--bg-base);
  font-size: 0.95rem;
}

.auth-loading__spinner {
  animation: auth-spin 0.8s linear infinite;
  color: var(--accent);
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-base);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

.auth-card__logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.auth-card__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-card__subtitle {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.auth-card__error {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--danger-subtle);
  color: var(--danger);
  font-size: 0.875rem;
  line-height: 1.4;
}

.auth-card__button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-card__button:hover {
  background: var(--accent-hover);
}

/* ---- sidebar user menu --------------------------------------------------- */

.appnav__user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-default);
}

.appnav__user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.appnav__user-info {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.appnav__user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appnav__user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appnav__logout {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.appnav__logout:hover {
  background: var(--neutral-subtle);
  color: var(--text-primary);
}
.appshell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

/* ---- Sidebar ------------------------------------------------------------ */
.appshell__sidebar {
  width: 240px;
  flex: none;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  height: 100vh;
}

.appnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  height: 100%;
}

.appnav__wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin-bottom: 16px;
}

.appnav__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.appnav__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.appnav__section {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-disabled);
}

.appnav__item--standalone {
  margin-top: 12px;
}

.appnav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease;
}

.appnav__item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.appnav__item--active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.appnav__item--active svg {
  color: var(--accent);
}

/* ---- Main column -------------------------------------------------------- */
.appshell__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.appshell__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 12px 32px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 20;
}

.appshell__topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.appshell__topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.appshell__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.appshell__hamburger:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.appshell__content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px;
}

/* ---- Breadcrumbs -------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
}

.breadcrumbs__crumb {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.breadcrumbs__sep {
  color: var(--text-disabled);
  flex: none;
}

.breadcrumbs__link {
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 120ms ease, background-color 120ms ease;
}

.breadcrumbs__link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.breadcrumbs__current {
  color: var(--text-primary);
  font-weight: 500;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* ---- Mobile drawer ------------------------------------------------------ */
.appshell__scrim {
  display: none;
}

@media (max-width: 767px) {
  .appshell__sidebar {
    display: none;
  }

  .appshell__hamburger {
    display: inline-flex;
  }

  .appshell__topbar {
    padding: 12px 16px;
  }

  .appshell__content {
    padding: 16px;
  }

  .appshell__scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--backdrop);
  }

  .appshell__drawer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    animation: drawer-in 200ms ease-out;
  }

  @keyframes drawer-in {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(0);
    }
  }
}
/* ==========================================================================
   AppsList page — SummaryTiles, AppsTable, AppsEmptyState.
   ========================================================================== */
.appslist {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.appslist__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- Summary tiles ------------------------------------------------------ */
.summary-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.summary-tile__value {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.summary-tile__label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- Apps table --------------------------------------------------------- */
.apps-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.apps-table {
  width: 100%;
  border-collapse: collapse;
}

.apps-table__col-head {
  text-align: left;
  padding: 0 16px;
  height: 40px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.apps-table__col-head--num {
  text-align: right;
}

.apps-table__row {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.apps-table__row:hover {
  background: var(--bg-subtle);
}

.apps-table__row:focus-visible {
  outline: none;
  background: var(--bg-subtle);
  box-shadow: inset 3px 0 0 var(--accent);
}

.apps-table__cell {
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
}

.apps-table__row:last-child .apps-table__cell {
  border-bottom: none;
}

/* Name + an optional clone-status pill, side by side in the Name cell. */
.apps-table__name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.apps-table__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.apps-table__cell--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.apps-table__col-head--actions {
  width: 128px;
}

/* Auto-report toggle: a small dot button beside the run button. The dot is
   filled (green) when the app's "Auto-report missed bugs" setting is on and
   hollow when off; clicking it toggles the setting in place. */
.apps-auto-report {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
}

.apps-auto-report:hover {
  background: var(--bg-subtle);
}

.apps-auto-report:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.apps-auto-report:disabled {
  cursor: default;
  opacity: 0.6;
}

.apps-auto-report__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--text-disabled);
  background: transparent;
  flex: none;
}

.apps-auto-report--on .apps-auto-report__dot {
  border-color: var(--success);
  background: var(--success);
}

.apps-table__cell--actions {
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
}

/* Found % cell content: the percent value plus an optional "running" pill,
   right-aligned in the table and inline in the mobile card meta. */
.apps-found {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.apps-running-pill {
  font-weight: 600;
}

/* Enabled QA-setting tag pills, rendered inside the AppTags tag area on the
   Apps list (Tags column / mobile card) and App Detail: one accent pill per
   active setting. */
.apps-setting-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.apps-setting-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: var(--accent-subtle);
  color: var(--accent);
  cursor: default;
}

.apps-run-spin {
  animation: apps-run-spin 0.8s linear infinite;
}

@keyframes apps-run-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Run-trigger error banner ------------------------------------------- */
.apps-run-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--danger-subtle);
  border: 1px solid var(--danger);
  border-radius: var(--radius-card);
  color: var(--danger);
  font-size: 14px;
}

/* ---- Run-trigger success banner ------------------------------------------ */
/* Success counterpart to .apps-run-error: confirms a triggered QA run. */
.apps-run-success {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--success-subtle);
  border: 1px solid var(--success);
  border-radius: var(--radius-card);
  color: var(--success);
  font-size: 14px;
}

.apps-run-success__msg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.apps-run-success__link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--success);
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

.apps-run-success__link:focus-visible {
  outline: 2px solid var(--success);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Mobile: collapse table into stacked cards -------------------------- */
.apps-cards {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.apps-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.apps-card:hover {
  background: var(--bg-subtle);
}

.apps-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.apps-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Name + an optional clone-status pill, side by side in the card header. */
.apps-card__name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.apps-card__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.apps-card__meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---- Empty state -------------------------------------------------------- */
.apps-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 64px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.apps-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.apps-empty__prompt {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
}

.apps-empty .btn {
  margin-top: 4px;
}

/* ---- Loading / error placeholders --------------------------------------- */
.apps-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 767px) {
  .summary-tiles {
    grid-template-columns: 1fr;
  }

  .apps-table-wrap {
    display: none;
  }

  .apps-cards {
    display: flex;
  }
}

/* ---- Import-from-QA-project dialog --------------------------------------- */
.import-projects__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---- New-app dialog (mode switch + clone flag) --------------------------- */
.new-app-modes {
  display: flex;
  gap: 8px;
}

.new-app-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.new-app-mode:hover {
  border-color: var(--border-strong);
}

.new-app-mode--selected {
  border-color: var(--border-focus);
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-primary);
}

.new-app-mode input[type='radio'] {
  flex: none;
  accent-color: var(--border-focus);
}

.new-app-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.new-app-clone {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-control);
  cursor: pointer;
}

.new-app-clone input[type='checkbox'] {
  flex: none;
  margin-top: 2px;
  accent-color: var(--border-focus);
}

.new-app-clone__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.new-app-clone__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.new-app-clone__hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Button — shared control covering every style-guide variant. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Primary ------------------------------------------------------------ */
.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn--primary:active {
  background: var(--accent-hover);
}

.btn--primary:disabled {
  background: #c7cbf5;
  border-color: #c7cbf5;
  color: #ffffff;
}

/* ---- Secondary / Surface ------------------------------------------------ */
.btn--secondary {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.btn--secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn--secondary:active {
  background: #eceff3;
}

.btn--secondary:disabled {
  color: var(--text-disabled);
  border-color: var(--border-default);
  background: var(--bg-surface);
}

/* ---- Ghost -------------------------------------------------------------- */
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn--ghost:active {
  background: #eceff3;
}

.btn--ghost:disabled {
  color: var(--text-disabled);
  background: transparent;
}

/* ---- Destructive -------------------------------------------------------- */
.btn--destructive {
  background: var(--bg-surface);
  border-color: #fda29b;
  color: var(--danger);
}

.btn--destructive:hover {
  background: var(--danger-subtle);
  border-color: var(--danger);
}

.btn--destructive:active {
  background: #fee4e2;
}

.btn--destructive:disabled {
  color: var(--text-disabled);
  border-color: var(--border-default);
  background: var(--bg-surface);
}

/* ---- Icon-only ---------------------------------------------------------- */
.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn--icon:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn--icon:active {
  background: #eceff3;
}

.btn--icon:disabled {
  color: var(--text-disabled);
  background: transparent;
}
/* ==========================================================================
   Modal + form fields — shared dialog primitives per AppStyle.md.
   Centered 480px modal over a dimmed backdrop with a compact single-column
   form. Reused by Add App, Expected Bug, New QA Project, and confirm dialogs.
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--backdrop);
  animation: modal-backdrop-in 150ms ease;
}

@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 480px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-lg);
  animation: modal-in 150ms ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.modal__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 20px;
}

/* ---- Form fields -------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field__control {
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea.field__control {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.field__control::placeholder {
  color: var(--text-disabled);
}

.field__control:hover {
  border-color: var(--border-strong);
}

.field__control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.field__control--error {
  border-color: #fda29b;
}

.field__control--error:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18);
}

.field__error {
  font-size: 13px;
  color: var(--danger);
}

.field__hint {
  font-size: 12px;
  color: var(--text-tertiary, var(--text-secondary));
  line-height: 1.45;
}

.field__optional {
  font-weight: 400;
  color: var(--text-tertiary, var(--text-secondary));
}

@media (max-width: 767px) {
  .modal-backdrop {
    padding: 16px;
  }

  .modal {
    width: 100%;
  }
}
/* ==========================================================================
   AppTags — the editable tag area shared by the Apps list and App Detail, plus
   the TagsEditor modal it opens.
   ========================================================================== */

.app-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Muted placeholder shown when an app has no tags, so the edit affordance still
   reads as an editable area. */
.app-tags__empty {
  font-size: 12px;
  color: var(--text-muted);
}

/* Pencil button that opens the TagsEditor; mirrors the row's auto-report dot
   button so the tag area's affordance feels native to the table. */
.app-tags__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
}

.app-tags__edit:hover {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.app-tags__edit:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* ---- TagsEditor modal --------------------------------------------------- */
.tags-editor__hint {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tags-editor__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* A selectable tag chip: outlined (with a +) when off, accent-filled (with a
   check) when on. Clicking toggles the tag's underlying QA setting. */
.tags-editor__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.tags-editor__chip:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.tags-editor__chip--on {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.tags-editor__chip:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.tags-editor__chip:disabled {
  cursor: default;
  opacity: 0.6;
}

.tags-editor__error {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--danger);
}
/* ScoreBadge & StatusPill — shared status signal pills. */

.score-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: default;
}

/* ---- ScoreBadge --------------------------------------------------------- */
.score-badge--success {
  background: var(--success-subtle);
  color: var(--success);
}

.score-badge--danger {
  background: var(--danger-subtle);
  color: var(--danger);
}

.score-badge--muted {
  background: var(--neutral-subtle);
  color: var(--text-disabled);
  min-width: 28px;
  justify-content: center;
}

.score-badge--headline {
  font-size: 13px;
  padding: 4px 12px;
}

.score-badge__missed-list {
  color: var(--bg-subtle);
  font-weight: 400;
}

/* ---- StatusPill --------------------------------------------------------- */
.status-pill {
  text-transform: capitalize;
}

.status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: currentColor;
  flex: none;
}

.status-pill--running {
  background: var(--warning-subtle);
  color: var(--warning);
}

.status-pill--finished {
  background: var(--success-subtle);
  color: var(--success);
}

.status-pill--failed {
  background: var(--danger-subtle);
  color: var(--danger);
}

.status-pill__dot--pulse {
  animation: status-pulse 1.4s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
/* ==========================================================================
   Buttons — shared variants per AppStyle.md (Clinical Slate).
   Base: 36px tall, 8px radius, 14px/500, optional 16px leading icon.
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.btn:disabled {
  cursor: not-allowed;
}

/* ---- Primary (indigo) --------------------------------------------------- */
.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--primary:active:not(:disabled) {
  background: var(--accent-hover);
}

.btn--primary:disabled {
  background: #c7cbf5;
  color: var(--text-on-accent);
}

/* ---- Surface / Secondary ------------------------------------------------ */
.btn--secondary {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn--secondary:active:not(:disabled) {
  background: #eceff3;
}

.btn--secondary:disabled {
  color: var(--text-disabled);
  border-color: var(--border-default);
}

/* ---- Ghost -------------------------------------------------------------- */
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn--ghost:active:not(:disabled) {
  background: #eceff3;
}

.btn--ghost:disabled {
  color: var(--text-disabled);
}

/* ---- Icon-only ---------------------------------------------------------- */
.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-control);
}

.btn--icon:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
/* Form fields — shared label/input/textarea styling for dialogs. */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field__input,
.field__textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field__textarea {
  min-height: 96px;
  resize: vertical;
}

.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--text-disabled);
}

.field__input:hover,
.field__textarea:hover {
  border-color: var(--border-strong);
}

.field__input:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.field--error .field__input,
.field--error .field__textarea {
  border-color: var(--danger);
}

.field__error {
  font-size: 13px;
  color: var(--danger);
}
/* App Detail page — header block, section cards, list rows, empty states. */

.app-detail {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- AppHeader ---------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.app-header__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.app-header__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

/* The app name doubles as a rename affordance: clicking it opens the edit
   dialog (focused on the Name field). A pencil fades in on hover/focus so the
   rename action is discoverable from the title itself, not just the Edit
   button. */
.app-header__title-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -2px -6px;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.app-header__title-button:hover {
  background: var(--accent-subtle, #eef2ff);
}

.app-header__title-button:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
}

.app-header__title-pencil {
  flex-shrink: 0;
  color: var(--text-secondary, #6b7280);
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}

.app-header__title-button:hover .app-header__title-pencil,
.app-header__title-button:focus-visible .app-header__title-pencil {
  opacity: 1;
}

.app-header__description {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 720px;
}

.app-header__url {
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
}

.app-header__url:hover {
  text-decoration: underline;
}

/* Tags row beneath the URL: a small "Tags" label followed by the editable
   AppTags area (pills + pencil edit button). */
.app-header__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.app-header__tags-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* ---- Section card ------------------------------------------------------- */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}

.section-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-primary);
}

.section-card__count {
  color: var(--text-muted);
  font-weight: 400;
}

.section-card__body {
  padding: 4px 0;
}

/* ---- List rows ---------------------------------------------------------- */
.detail-list {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-default);
  transition: background-color 120ms ease;
}

.detail-row:last-child {
  border-bottom: none;
}

/* ---- Expected bug row --------------------------------------------------- */
.bug-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.bug-row__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bug-row__description {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bug-row__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

.bug-row:hover .bug-row__actions,
.bug-row:focus-within .bug-row__actions {
  opacity: 1;
}

/* ---- QA project row ----------------------------------------------------- */
.project-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
  border-bottom: 1px solid var(--border-default);
  transition: background-color 120ms ease;
}

.project-row:last-child {
  border-bottom: none;
}

.project-row:hover {
  background: var(--bg-subtle);
}

.project-row:focus-within {
  background: var(--bg-subtle);
}

/* The clickable area that opens the QA Project Detail page. */
.project-row__open {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 10px 20px;
  cursor: pointer;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  font: inherit;
  color: inherit;
}

.project-row__open:focus-visible {
  outline: none;
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Trailing link to the backing Loop QA run on loop-qa.replay.io. */
.project-row__loop-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.project-row__loop-link:hover {
  background: var(--bg-surface);
  color: var(--accent);
}

.project-row__loop-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.project-row__status {
  flex: none;
}

.project-row__time {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex: 1 1 auto;
  min-width: 0;
}

/* Pill counting this run's missed expected bugs reported back to Loop QA. */
.project-row__reported {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--neutral-subtle);
  color: var(--text-muted);
}

.project-row__score {
  flex: none;
}

/* ---- QA project settings ------------------------------------------------ */
.qa-settings {
  display: flex;
  flex-direction: column;
}

.qa-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-default);
}

.qa-setting:last-of-type {
  border-bottom: none;
}

.qa-setting__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.qa-setting__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.qa-setting__desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* The switch control: a pill track with a sliding thumb. */
.qa-toggle {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--neutral-subtle);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.qa-toggle--on {
  background: var(--accent);
}

.qa-toggle:disabled {
  opacity: 0.6;
  cursor: default;
}

.qa-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.qa-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.18);
  transition: transform 120ms ease;
}

.qa-toggle--on .qa-toggle__thumb {
  transform: translateX(18px);
}

.qa-settings__error {
  margin: 0;
  padding: 10px 20px 14px;
  font-size: 13px;
  color: var(--danger);
}

/* ---- Empty states ------------------------------------------------------- */
.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 20px;
  text-align: center;
}

.detail-empty__prompt {
  margin: 0;
  max-width: 420px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- Loading / error / not-found --------------------------------------- */
.detail-skeleton {
  height: 16px;
  margin: 12px 20px;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
}

.detail-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 64px 20px;
  text-align: center;
}

.detail-message__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-message__text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---- Spinner ------------------------------------------------------------ */
.spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .app-header__actions {
    width: 100%;
  }
}

/* ---- Loop Builder clone state in the header ------------------------------ */
.app-header__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-header__loop-builder {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--accent);
}

.app-header__loop-builder:hover {
  text-decoration: underline;
}

.app-header__clone-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 720px;
}

.app-header__clone-note--failed {
  color: var(--status-failed-text, #b91c1c);
}
.tooltip {
  position: relative;
  display: inline-flex;
}

.tooltip__popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  min-width: 160px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--text-primary);
  color: var(--text-on-accent);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.tooltip__popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
}
/* ==========================================================================
   QA Project Detail — header, status banner, coverage strip, comparison
   list + detail layout.
   ========================================================================== */
.qapd {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- ProjectHeader ------------------------------------------------------ */
.qapd-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qapd-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-control);
  padding: 2px 6px 2px 2px;
  transition: color 120ms ease, background-color 120ms ease;
}

.qapd-header__back:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

.qapd-header__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qapd-header__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.qapd-header__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

.qapd-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.qapd-header__stamp {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.qapd-header__stamp-label {
  color: var(--text-muted);
  font-weight: 500;
}

.qapd-header__stamp-value {
  color: var(--text-secondary);
}

/* Link out to the backing Loop QA run on loop-qa.replay.io. */
.qapd-header__loop-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-radius: var(--radius-control);
  padding: 2px 6px;
  transition: color 120ms ease, background-color 120ms ease;
}

.qapd-header__loop-link:hover {
  background: var(--accent-subtle);
}

.qapd-header__loop-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.qapd-header__score {
  margin-top: 4px;
}

/* ---- StatusBanner ------------------------------------------------------- */
.qapd-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-default);
}

.qapd-banner--running {
  background: var(--warning-subtle);
  border-color: #fde9c8;
  color: var(--warning);
}

.qapd-banner--failed {
  background: var(--danger-subtle);
  border-color: #fcdcd7;
  color: var(--danger);
}

.qapd-banner__icon {
  flex: none;
  margin-top: 1px;
}

.qapd-banner__icon--spin {
  animation: qapd-spin 1s linear infinite;
}

@keyframes qapd-spin {
  to {
    transform: rotate(360deg);
  }
}

.qapd-banner__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qapd-banner__title {
  font-size: 14px;
  font-weight: 600;
}

.qapd-banner__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.qapd-banner__refresh {
  flex: none;
}

/* ---- CoverageSummary ---------------------------------------------------- */
.coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.coverage-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.coverage-stat__value {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.coverage-stat--success .coverage-stat__value {
  color: var(--success);
}

.coverage-stat--danger .coverage-stat__value {
  color: var(--danger);
}

.coverage-stat--neutral .coverage-stat__value {
  color: var(--neutral);
}

.coverage-stat__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.coverage-stat__info {
  display: inline-flex;
  align-items: center;
  color: var(--text-disabled);
  cursor: help;
  border-radius: var(--radius-pill);
}

.coverage-stat__info:hover,
.coverage-stat__info:focus-visible {
  color: var(--text-muted);
  outline: none;
}

/* ---- Comparison cards (shared list styles) ------------------------------ */
.qapd-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.qapd-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-default);
}

.qapd-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.qapd-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.qapd-card__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* "Report missing" / "Report all missing" controls */
.qapd-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.qapd-report-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.qapd-report-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.qapd-report-btn--all {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.qapd-report-btn--all:hover:not(:disabled) {
  filter: brightness(0.95);
  color: #fff;
}

.qapd-row__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 12px 16px;
}

.qapd-report-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}

.qapd-report-status--pending {
  color: var(--text-muted);
}

.qapd-report-status--reported {
  color: var(--success, #15803d);
}

.qapd-report-status--error {
  color: var(--danger, #b91c1c);
}

.qapd-spin {
  animation: qapd-spin 800ms linear infinite;
}

@keyframes qapd-spin {
  to {
    transform: rotate(360deg);
  }
}

.qapd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qapd-list > li {
  border-bottom: 1px solid var(--border-default);
}

.qapd-list > li:last-child {
  border-bottom: none;
}

.qapd-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.qapd-row:hover {
  background: var(--bg-subtle);
}

.qapd-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--border-focus);
}

.qapd-row--selected {
  background: var(--accent-subtle);
  border-left-color: var(--accent);
}

.qapd-row--selected:hover {
  background: var(--accent-subtle);
}

.qapd-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.qapd-row__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qapd-row__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qapd-row__matched-to {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qapd-row__matched-to span {
  color: var(--success);
  font-weight: 500;
}

/* ---- Badges (Matched / Missed / Extra) ---------------------------------- */
.qapd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.qapd-badge--matched {
  background: var(--success-subtle);
  color: var(--success);
}

.qapd-badge--missed {
  background: var(--danger-subtle);
  color: var(--danger);
}

.qapd-badge--extra {
  background: var(--neutral-subtle);
  color: var(--neutral);
}

/* ---- Two-column list + detail layout ------------------------------------ */
.qapd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 40%);
  gap: 24px;
  align-items: start;
}

.qapd-layout__main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.qapd-layout__detail {
  position: sticky;
  top: 24px;
}

/* ---- MatchDetailPanel --------------------------------------------------- */
.match-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.match-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-default);
}

.match-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.match-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.match-panel__close:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.match-panel__placeholder {
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.match-panel__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-side {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.match-side + .match-side {
  border-left: 1px solid var(--border-default);
}

@media (max-width: 479px) {
  .match-panel__pair {
    grid-template-columns: 1fr;
  }

  .match-side + .match-side {
    border-left: none;
    border-top: 1px solid var(--border-default);
  }
}

.match-side__heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.match-side__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.match-side__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.match-side__empty {
  font-size: 13px;
  color: var(--text-disabled);
  font-style: italic;
}

.match-why {
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-why__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.match-why__tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-secondary);
  background: var(--surface-muted, rgba(0, 0, 0, 0.05));
  border-radius: 999px;
  padding: 2px 8px;
}

.match-why__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---- Mobile bottom sheet (hidden on desktop) ---------------------------- */
.qapd-sheet {
  display: none;
}

/* ---- Loading skeleton & error ------------------------------------------- */
.qapd-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qapd-skeleton__bar {
  height: 20px;
  width: 40%;
  border-radius: var(--radius-control);
  background: var(--bg-subtle);
  animation: qapd-pulse 1.4s ease-in-out infinite;
}

.qapd-skeleton__bar--lg {
  height: 32px;
  width: 55%;
}

.qapd-skeleton__card {
  height: 160px;
  border-radius: var(--radius-card);
  background: var(--bg-subtle);
  animation: qapd-pulse 1.4s ease-in-out infinite;
}

@keyframes qapd-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.qapd-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
}

.qapd-error__msg {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.qapd-error__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.qapd-error__link:hover {
  color: var(--accent-hover);
}

/* ==========================================================================
   Mobile (< 768px): collapse the split; MatchDetailPanel becomes a sheet.
   ========================================================================== */
@media (max-width: 767px) {
  .qapd-layout {
    grid-template-columns: 1fr;
  }

  .qapd-layout__detail {
    display: none;
  }

  .qapd-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
  }

  .qapd-sheet__scrim {
    position: absolute;
    inset: 0;
    background: var(--backdrop);
    animation: qapd-fade 150ms ease;
  }

  .qapd-sheet__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 80vh;
    overflow-y: auto;
    border-top-left-radius: var(--radius-modal);
    border-top-right-radius: var(--radius-modal);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    animation: qapd-sheet-up 200ms ease-out;
  }

  .qapd-sheet__body .match-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  @keyframes qapd-fade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes qapd-sheet-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
}
/* Polish Scripts eval page — list/table layout. Reuses the Clinical Slate
   tokens; mirrors the Apps list spacing. */

.polishscripts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.polishscripts__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.polishscripts__subtitle {
  margin: -12px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 60ch;
}

.polishscripts__notice {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--accent-subtle);
  color: var(--accent-hover);
  font-size: 13px;
}

.polish-table-wrap {
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
}

.polish-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.polish-table__col-head {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-default);
}

.polish-table__row {
  border-bottom: 1px solid var(--border-default);
}

.polish-table__row:last-child {
  border-bottom: none;
}

.polish-table__cell {
  padding: 12px 16px;
  color: var(--text-secondary);
  vertical-align: top;
}

.polish-table__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-primary);
}

.polish-table__results {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 380px;
  max-height: 5.6em;
  overflow: hidden;
}

.polish-table__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.polish-eval-results {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  resize: vertical;
  min-height: 120px;
}

.polish-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.polish-empty__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
/* ==========================================================================
   Settings page — MCP server documentation cards.
   ========================================================================== */
.settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
}

.settings__intro {
  margin: -12px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 720px;
}

/* ---- Cards --------------------------------------------------------------- */
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

.settings-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.settings-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  background: var(--accent-subtle);
  color: var(--accent);
}

.settings-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-card__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.settings-card__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ---- Code block --------------------------------------------------------- */
.codeblock {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.codeblock__caption {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.codeblock__body {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--text-primary);
  border-radius: var(--radius-control);
}

.codeblock__pre {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  overflow-x: auto;
  font-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #e6e8ee;
  white-space: pre;
}

.codeblock__copy {
  flex: none;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

/* ---- Tools list --------------------------------------------------------- */
.mcp-tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mcp-tool {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  border-top: 1px solid var(--border-default);
}

.mcp-tool:first-child {
  border-top: none;
  padding-top: 0;
}

.mcp-tool__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcp-tool__name {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-control);
}

.mcp-tool__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.mcp-tool__params {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mcp-tool__param {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.mcp-tool__param-name {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-primary);
}

.mcp-tool__param-type {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}

.mcp-tool__param-required {
  font-size: 11px;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-subtle);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}

.mcp-tool__param-desc {
  flex: 1 1 240px;
  min-width: 0;
}

/* ---- Placeholders ------------------------------------------------------- */
.settings-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 32px 24px;
  background: var(--bg-subtle);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: 14px;
}

.settings-placeholder--error {
  background: var(--danger-subtle);
  color: var(--danger);
}

@media (max-width: 767px) {
  .settings-card {
    padding: 16px;
  }
}
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
@layer properties {
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
    *, :before, :after, ::backdrop {
      --tw-border-style: solid;
      --tw-ordinal: initial;
      --tw-slashed-zero: initial;
      --tw-numeric-figure: initial;
      --tw-numeric-spacing: initial;
      --tw-numeric-fraction: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
      --tw-ease: initial;
    }
  }
}

@layer theme {
  :root, :host {
    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
      "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --shadow-sm: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
    --shadow-md: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
    --shadow-lg: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
    --ease-out: cubic-bezier(0, 0, .2, 1);
    --default-transition-duration: .15s;
    --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}

@layer base {
  *, :after, :before, ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::file-selector-button {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html, :host {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }

  b, strong {
    font-weight: bolder;
  }

  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }

  small {
    font-size: 80%;
  }

  sub, sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub {
    bottom: -.25em;
  }

  sup {
    top: -.5em;
  }

  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring {
    outline: auto;
  }

  progress {
    vertical-align: baseline;
  }

  summary {
    display: list-item;
  }

  ol, ul, menu {
    list-style: none;
  }

  img, svg, video, canvas, audio, iframe, embed, object {
    vertical-align: middle;
    display: block;
  }

  img, video {
    max-width: 100%;
    height: auto;
  }

  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }

  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }

  ::file-selector-button {
    margin-inline-end: 4px;
  }

  ::placeholder {
    opacity: 1;
  }

  @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentColor;
    }

    @supports (color: color-mix(in lab, red, red)) {
      ::placeholder {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }

  textarea {
    resize: vertical;
  }

  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit {
    display: inline-flex;
  }

  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }

  ::-webkit-datetime-edit {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-year-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-month-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-day-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-hour-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-minute-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-second-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-millisecond-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }

  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }

  :-moz-ui-invalid {
    box-shadow: none;
  }

  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }

  ::file-selector-button {
    appearance: button;
  }

  ::-webkit-inner-spin-button {
    height: auto;
  }

  ::-webkit-outer-spin-button {
    height: auto;
  }

  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }
}

@layer components;

@layer utilities {
  .visible {
    visibility: visible;
  }

  .absolute {
    position: absolute;
  }

  .fixed {
    position: fixed;
  }

  .relative {
    position: relative;
  }

  .static {
    position: static;
  }

  .sticky {
    position: sticky;
  }

  .container {
    width: 100%;
  }

  @media (min-width: 40rem) {
    .container {
      max-width: 40rem;
    }
  }

  @media (min-width: 48rem) {
    .container {
      max-width: 48rem;
    }
  }

  @media (min-width: 64rem) {
    .container {
      max-width: 64rem;
    }
  }

  @media (min-width: 80rem) {
    .container {
      max-width: 80rem;
    }
  }

  @media (min-width: 96rem) {
    .container {
      max-width: 96rem;
    }
  }

  .block {
    display: block;
  }

  .contents {
    display: contents;
  }

  .hidden {
    display: none;
  }

  .inline {
    display: inline;
  }

  .table {
    display: table;
  }

  .shrink {
    flex-shrink: 1;
  }

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

  .rounded {
    border-radius: .25rem;
  }

  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }

  .uppercase {
    text-transform: uppercase;
  }

  .tabular-nums {
    --tw-numeric-spacing: tabular-nums;
    font-variant-numeric: var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, );
  }

  .shadow {
    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .ring {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .filter {
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .transition {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .ease-out {
    --tw-ease: var(--ease-out);
    transition-timing-function: var(--ease-out);
  }
}

:root {
  --bg-base: #f7f8fa;
  --bg-surface: #fff;
  --bg-sidebar: #fff;
  --bg-subtle: #f1f3f6;
  --border-default: #e4e7ec;
  --border-strong: #d0d5dd;
  --border-focus: #6366f1;
  --text-primary: #101828;
  --text-secondary: #344054;
  --text-muted: #667085;
  --text-disabled: #98a2b3;
  --text-on-accent: #fff;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-subtle: #eef2ff;
  --success: #067647;
  --success-subtle: #ecfdf3;
  --danger: #b42318;
  --danger-subtle: #fef3f2;
  --warning: #b54708;
  --warning-subtle: #fffaeb;
  --neutral: #475467;
  --neutral-subtle: #f2f4f7;
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-modal: 16px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px #1018280d;
  --shadow-md: 0 4px 12px #10182814;
  --shadow-lg: 0 16px 32px -8px #10182833;
  --backdrop: #10182873;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-ordinal {
  syntax: "*";
  inherits: false
}

@property --tw-slashed-zero {
  syntax: "*";
  inherits: false
}

@property --tw-numeric-figure {
  syntax: "*";
  inherits: false
}

@property --tw-numeric-spacing {
  syntax: "*";
  inherits: false
}

@property --tw-numeric-fraction {
  syntax: "*";
  inherits: false
}

@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-ring-inset {
  syntax: "*";
  inherits: false
}

@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0;
}

@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}

@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-blur {
  syntax: "*";
  inherits: false
}

@property --tw-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-invert {
  syntax: "*";
  inherits: false
}

@property --tw-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-sepia {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false
}

@property --tw-ease {
  syntax: "*";
  inherits: false
}
