/* ==========================================================================
   pro_cons_generator.css — Pro & Cons Generator
   SandBox AI Platform — Tool Extension Stylesheet
   Scoped under .pc-root
   Uses only existing SandBox tokens:
     --bg, --bg-panel, --surface-0/1/2, --border-0/1/2
     --ink-0/1/2/6/7/8, --text, --text-soft, --text-muted
     --text-xs/sm/base/md/lg/xl/2xl/3xl
     --weight-medium/semi/bold
     --radius-md/lg/xl/2xl/pill
     --shadow-sm/md/lg/xl
     --accent, --success, --error, --warning
     --dur-fast/base/slow, --ease, --ease-spring
     --font, --sidebar-w, --topbar-h
   ========================================================================== */

/* ─── 1. ROOT SHELL ────────────────────────────────────────────────────────── */

.pc-root {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 1.5rem) 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

/* ─── 2. HERO ──────────────────────────────────────────────────────────────── */

.pc-hero {
  padding: 2.5rem 2rem 2.25rem;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%),
    var(--bg-panel);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
}

.pc-hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}

.pc-hero-glow--left {
  width: 350px;
  height: 350px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
}

.pc-hero-glow--right {
  width: 280px;
  height: 280px;
  bottom: -100px;
  right: -60px;
  background: radial-gradient(circle, rgba(168,85,247,0.06) 0%, transparent 70%);
}

.pc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  width: fit-content;
  position: relative;
  z-index: 1;
}

.pc-hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pc-pulse-dot 2s ease-in-out infinite;
}

@keyframes pc-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.25); }
}

.pc-hero-heading {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: var(--weight-bold);
  letter-spacing: -0.035em;
  color: var(--ink-0);
  line-height: 1.1;
  margin: 0;
  position: relative;
  z-index: 1;
}

.pc-hero-heading-accent {
  background: linear-gradient(90deg, rgba(99,102,241,0.9), rgba(168,85,247,0.9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pc-hero-desc {
  font-size: var(--text-sm);
  color: var(--text-soft);
  line-height: 1.7;
  margin: 0;
  max-width: 52ch;
  position: relative;
  z-index: 1;
}

.pc-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}

.pc-hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: var(--surface-1);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-pill);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  cursor: default;
}

.pc-hero-pill:hover {
  color: var(--ink-2);
  border-color: var(--border-1);
}

/* ─── 3. CARDS ─────────────────────────────────────────────────────────────── */

.pc-card {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%),
    var(--bg-panel);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
}

.pc-card:hover {
  border-color: var(--border-1);
}

.pc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pc-card-header-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.pc-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.pc-card-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pc-card-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  letter-spacing: -0.01em;
  color: var(--ink-1);
  margin: 0 0 0.2rem;
}

.pc-card-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0;
}

/* ─── 4. TEXTAREA ──────────────────────────────────────────────────────────── */

.pc-textarea-wrap {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  background: var(--surface-0);
  overflow: hidden;
  transition:
    border-color var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
}

.pc-textarea-wrap:focus-within {
  border-color: var(--border-2);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04), 0 0 0 1px rgba(99,102,241,0.12);
}

.pc-textarea {
  width: 100%;
  min-height: 160px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 1.125rem 1.25rem 0.75rem;
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--ink-1);
  line-height: 1.7;
  caret-color: var(--ink-0);
  box-sizing: border-box;
  display: block;
}

.pc-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.55;
  white-space: pre-line;
}

.pc-textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem 0.75rem;
  border-top: 1px solid var(--border-0);
  flex-wrap: wrap;
}

.pc-counters {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pc-counter-sep {
  opacity: 0.4;
}

.pc-textarea-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ─── 5. BUTTONS ───────────────────────────────────────────────────────────── */

/* Primary */
.pc-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0 1.25rem;
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink-8);
  background: var(--ink-0);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 4px 20px rgba(0,0,0,0.4);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.pc-btn-primary:hover:not(:disabled) {
  background: var(--ink-1);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 8px 32px rgba(0,0,0,0.5);
}

.pc-btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.pc-btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pc-btn-primary svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Ghost */
.pc-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0 0.875rem;
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-soft);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease-spring);
  white-space: nowrap;
}

.pc-btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--ink-1);
  transform: translateY(-1px);
}

.pc-btn-ghost:active {
  transform: translateY(1px) scale(0.98);
}

.pc-btn-ghost svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Small variant */
.pc-btn-sm {
  min-height: 32px;
  padding: 0 0.625rem;
  font-size: var(--text-xs);
}

/* ─── 6. ADVANCED SETTINGS ─────────────────────────────────────────────────── */

.pc-settings-wrap {
  margin-top: 0.875rem;
}

.pc-settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: var(--surface-0);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.pc-settings-toggle:hover {
  color: var(--ink-1);
  background: var(--surface-1);
  border-color: var(--border-2);
}

.pc-settings-toggle svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.pc-chevron {
  margin-left: auto;
  transition: transform var(--dur-base) var(--ease);
}

.pc-settings-toggle[aria-expanded="true"] .pc-chevron {
  transform: rotate(180deg);
}

.pc-settings-panel {
  margin-top: 0.875rem;
  padding: 1.25rem;
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-xl);
  animation: pc-panel-in var(--dur-base) var(--ease) both;
}

.pc-settings-panel[hidden] {
  display: none;
}

@keyframes pc-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pc-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pc-settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pc-settings-field--full {
  grid-column: 1 / -1;
}

.pc-settings-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
}

/* Select */
.pc-select-wrap {
  position: relative;
}

.pc-select-wrap--sm {
  min-width: 110px;
}

.pc-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: var(--text-sm);
  color: var(--ink-1);
  outline: none;
  cursor: pointer;
  transition:
    border-color var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
}

.pc-select:focus {
  border-color: var(--border-2);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04), 0 0 0 1px rgba(99,102,241,0.12);
}

.pc-select option {
  background: var(--bg-panel, #111);
  color: var(--ink-1);
}

.pc-select-arrow {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.pc-select--sm {
  padding: 0.3rem 1.75rem 0.3rem 0.6rem;
  font-size: var(--text-xs);
}


/* ─── 7. INPUT ACTIONS ─────────────────────────────────────────────────────── */

.pc-input-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ─── 8. EMPTY STATE ───────────────────────────────────────────────────────── */

.pc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 3rem 1.5rem;
  text-align: center;
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
}

.pc-empty-illustration svg {
  width: 160px;
  height: 120px;
  opacity: 0.75;
  animation: pc-float 4s ease-in-out infinite;
}

@keyframes pc-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.pc-empty-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  color: var(--text-soft);
  margin: 0;
}

.pc-empty-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
  max-width: 38ch;
  line-height: 1.6;
}

/* ─── 9. LOADING STATE ─────────────────────────────────────────────────────── */

.pc-loading-state {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: pc-enter var(--dur-base) var(--ease) both;
}

.pc-loading-state[hidden] { display: none; }

/* Skeleton elements */
@keyframes pc-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.pc-skeleton-summary {
  height: 120px;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
  background-size: 200% 100%;
  animation: pc-shimmer 1.5s ease-in-out infinite;
}

.pc-skeleton-stat {
  flex: 1;
  min-width: 0;
  height: 90px;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
  background-size: 200% 100%;
  animation: pc-shimmer 1.5s ease-in-out infinite;
}

.pc-skeleton-table {
  flex: 1;
  min-width: 0;
  height: 300px;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
  background-size: 200% 100%;
  animation: pc-shimmer 1.5s ease-in-out infinite;
}

/* Progress wrap */
.pc-loading-progress-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-xl);
}

.pc-loading-icon {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  border-top-color: var(--ink-0);
  animation: pc-spin 1s linear infinite;
}

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

.pc-loading-bolt {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: relative;
  z-index: 1;
}

.pc-loading-info {
  flex: 1;
  min-width: 0;
}

.pc-loading-message {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-1);
  margin: 0 0 0.625rem;
  transition: opacity var(--dur-base) var(--ease);
}

.pc-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.pc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(99,102,241,0.9), rgba(168,85,247,0.9));
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 0.6s var(--ease);
}

/* ─── 10. STICKY TOOLBAR ───────────────────────────────────────────────────── */

.pc-sticky-toolbar {
  position: sticky;
  top: calc(var(--topbar-h, 60px) + 0.75rem);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: rgba(9,9,11,0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
}

.pc-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pc-toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border-0);
  flex-shrink: 0;
  margin: 0 0.125rem;
}

.pc-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease-spring);
  white-space: nowrap;
  position: relative;
}

.pc-toolbar-btn:hover {
  background: var(--surface-1);
  border-color: var(--border-1);
  color: var(--ink-1);
  transform: translateY(-1px);
}

.pc-toolbar-btn:active {
  transform: translateY(1px) scale(0.96);
}

.pc-toolbar-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.pc-toolbar-btn--primary {
  background: var(--surface-1);
  border-color: var(--border-1);
  color: var(--ink-1);
}

.pc-toolbar-btn--primary:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--ink-0);
}

/* Tooltip */
.pc-toolbar-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 8px;
  font-size: 10px;
  color: var(--ink-1);
  background: rgba(15,15,16,0.98);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  z-index: 100;
}

.pc-toolbar-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── 11. SUMMARY CARD ─────────────────────────────────────────────────────── */

.pc-summary-card {
  animation-delay: 50ms;
}

.pc-summary-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.pc-summary-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.pc-summary-icon svg {
  width: 16px;
  height: 16px;
  stroke: #a5b4fc;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pc-summary-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.2rem;
}

.pc-summary-topic {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.025em;
  color: var(--ink-0);
  margin: 0;
}

.pc-summary-badge-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pc-summary-text {
  font-size: var(--text-sm);
  color: var(--text-soft);
  line-height: 1.75;
  margin: 0;
}

/* ─── 12. STATS ROW ────────────────────────────────────────────────────────── */

.pc-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.875rem;
}

.pc-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.125rem 1.25rem;
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-xl);
  transition:
    background var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease),
    transform var(--dur-fast) var(--ease-spring);
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
}

.pc-stat-card:hover {
  background: var(--surface-1);
  border-color: var(--border-1);
  transform: translateY(-2px);
}

.pc-stat-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}

.pc-stat-icon--pros   { background: rgba(74,222,128,0.1);  color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.pc-stat-icon--cons   { background: rgba(239,68,68,0.1);   color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.pc-stat-icon--score  { background: rgba(99,102,241,0.1);  color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.pc-stat-icon--confidence { background: rgba(168,85,247,0.1); color: #d8b4fe; border: 1px solid rgba(168,85,247,0.2); }
.pc-stat-icon--risk   { background: rgba(245,158,11,0.1);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }

.pc-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.035em;
  color: var(--ink-0);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pc-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

/* ─── 13. FILTER BAR ───────────────────────────────────────────────────────── */

.pc-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  padding: 0.875rem 1.125rem;
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-xl);
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
  animation-delay: 100ms;
}

.pc-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  flex: 1;
  min-width: 180px;
}

.pc-search-icon {
  position: absolute;
  left: 0.625rem;
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.pc-search-input {
  width: 100%;
  height: 34px;
  padding: 0 2rem 0 2rem;
  font-family: var(--font);
  font-size: var(--text-xs);
  color: var(--ink-1);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
}

.pc-search-input::placeholder {
  color: var(--text-muted);
}

.pc-search-input:focus {
  border-color: var(--border-2);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

.pc-search-clear {
  position: absolute;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.pc-search-clear:hover { color: var(--ink-1); }
.pc-search-clear[hidden] { display: none; }

.pc-search-clear svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.pc-filter-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pc-filter-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  margin-right: 0.125rem;
}

.pc-filter-chip {
  padding: 0.25rem 0.6rem;
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease-spring);
  white-space: nowrap;
}

.pc-filter-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--ink-1);
  transform: translateY(-1px);
}

.pc-filter-chip--active {
  background: var(--ink-0);
  border-color: var(--ink-0);
  color: var(--ink-8);
}

.pc-filter-chip--active:hover {
  background: var(--ink-1);
  color: var(--ink-8);
  transform: translateY(-1px);
}

.pc-filter-chip--pros.pc-filter-chip--active {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.35);
  color: #4ade80;
}

.pc-filter-chip--cons.pc-filter-chip--active {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #f87171;
}

/* ─── 14. COMPARISON TABLES ────────────────────────────────────────────────── */

.pc-tables-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pc-table-card {
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition:
    border-color var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
  animation-delay: 150ms;
}

.pc-table-card--pros { border-top: 3px solid rgba(74,222,128,0.4); }
.pc-table-card--cons { border-top: 3px solid rgba(239,68,68,0.4); }

.pc-table-card:hover {
  border-color: var(--border-1);
  box-shadow: var(--shadow-sm);
}

.pc-table-card--pros:hover { border-top-color: rgba(74,222,128,0.6); }
.pc-table-card--cons:hover { border-top-color: rgba(239,68,68,0.6); }

.pc-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.875rem;
  border-bottom: 1px solid var(--border-0);
}

.pc-table-title-group {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.pc-table-icon {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.pc-table-icon--pros {
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.2);
  color: #4ade80;
}

.pc-table-icon--cons {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #f87171;
}

.pc-table-icon svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pc-table-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink-1);
  letter-spacing: -0.01em;
  margin: 0;
}

.pc-table-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.3rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}

.pc-table-wrap {
  overflow-x: auto;
}

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

.pc-th {
  padding: 0.625rem 1rem;
  font-size: 10px;
  font-weight: var(--weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  background: var(--surface-0);
  border-bottom: 1px solid var(--border-0);
  white-space: nowrap;
}

.pc-th-num { width: 2rem; text-align: center; padding-left: 1rem; }
.pc-th-impact { width: 6rem; text-align: right; padding-right: 1rem; }

/* Table rows */
.pc-tr {
  border-bottom: 1px solid var(--border-0);
  transition:
    background var(--dur-fast) var(--ease);
  cursor: pointer;
  animation: pc-row-in var(--dur-base) var(--ease-spring) both;
}

@keyframes pc-row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.pc-tr:last-child { border-bottom: none; }

.pc-tr:nth-child(even) { background: rgba(255,255,255,0.015); }

.pc-tr:hover { background: var(--surface-1); }

.pc-td {
  padding: 0.75rem 1rem;
  vertical-align: top;
}

.pc-td-num {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  width: 2rem;
  padding-left: 1rem;
}

.pc-td-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--ink-1);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.pc-td-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  display: none;
  margin-top: 0.25rem;
}

.pc-tr.is-expanded .pc-td-desc { display: block; }

.pc-td-impact {
  text-align: right;
  padding-right: 1rem;
  white-space: nowrap;
}

/* Impact badges */
.pc-impact-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.175rem 0.55rem;
  font-size: 10px;
  font-weight: var(--weight-semi);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
}

.pc-impact-badge--high   { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.pc-impact-badge--medium { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.pc-impact-badge--low    { background: rgba(99,102,241,0.1);  color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }

/* Highlight for search */
.pc-highlight {
  background: rgba(245,158,11,0.25);
  color: var(--ink-0);
  border-radius: 2px;
  padding: 0 1px;
}

/* Table empty state */
.pc-table-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 2rem 1rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pc-table-empty[hidden] { display: none; }

.pc-table-empty svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.5;
  flex-shrink: 0;
}

/* ─── 15. VERDICT BADGES ───────────────────────────────────────────────────── */

.pc-verdict-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
}

.pc-verdict-badge--recommended { background: rgba(74,222,128,0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.25); }
.pc-verdict-badge--neutral      { background: rgba(99,102,241,0.1);  color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.pc-verdict-badge--caution      { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.pc-verdict-badge--avoid        { background: rgba(239,68,68,0.1);   color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

/* Risk badges */
.pc-risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.175rem 0.55rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  border-radius: var(--radius-pill);
}

.pc-risk-badge--low    { background: rgba(74,222,128,0.12);  color: #4ade80; border: 1px solid rgba(74,222,128,0.25); }
.pc-risk-badge--medium { background: rgba(245,158,11,0.12);  color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.pc-risk-badge--high   { background: rgba(239,68,68,0.12);   color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* ─── 16. RECOMMENDATION CARD ──────────────────────────────────────────────── */

.pc-reco-card {
  animation-delay: 200ms;
}

.pc-reco-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.pc-reco-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.pc-reco-icon svg {
  width: 16px;
  height: 16px;
  stroke: #fcd34d;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pc-reco-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.2rem;
}

.pc-reco-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  color: var(--ink-1);
  margin: 0;
}

.pc-reco-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pc-reco-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pc-reco-block {
  padding: 1rem;
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}

.pc-reco-block:hover {
  background: var(--surface-1);
  border-color: var(--border-1);
}

.pc-reco-block-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.pc-reco-block-text {
  font-size: var(--text-sm);
  color: var(--text-soft);
  line-height: 1.65;
  margin: 0;
}

/* Confidence bar */
.pc-confidence-bar-wrap {
  border-top: 1px solid var(--border-0);
  padding-top: 1rem;
}

.pc-confidence-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pc-confidence-label-text {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pc-confidence-pct {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}

.pc-confidence-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.pc-confidence-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(99,102,241,0.9), rgba(168,85,247,0.9));
  border-radius: var(--radius-pill);
  transition: width 1s var(--ease) 0.3s;
}

/* ── WHY THIS TOOL ──────────────────────────────────── */
.pc-why {
  margin: 40px 0;
}

.pc-why-heading {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-0, #fff);
  margin-bottom: 8px;
}

.pc-why-subheading {
  font-size: 0.9rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-bottom: 24px;
}

.pc-why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pc-why-card {
  padding: 22px;
  border: 1px solid var(--border-0, rgba(255,255,255,0.08));
  border-radius: 14px;
  background: var(--surface-0, rgba(255,255,255,0.02));
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pc-why-card:hover {
  border-color: var(--border-1, rgba(255,255,255,0.14));
  background: var(--surface-1, rgba(255,255,255,0.04));
  transform: translateY(-2px);
}

.pc-why-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2, rgba(255,255,255,0.06));
  color: var(--text-muted, rgba(255,255,255,0.6));
  margin-bottom: 18px;
}

.pc-why-icon svg {
  width: 16px;
  height: 16px;
}

.pc-why-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(255,255,255,0.55));
  margin-bottom: 12px;
}

.pc-why-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-soft, rgba(255,255,255,0.75));
}

@media (max-width: 900px) {
  .pc-why-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .pc-why-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── 17. ERROR STATE ──────────────────────────────────────────────────────── */

.pc-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  padding: 3rem 1.5rem;
  text-align: center;
  animation: pc-enter var(--dur-slow) var(--ease-spring) both;
}

.pc-error-state[hidden] { display: none; }

.pc-error-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-lg);
}

.pc-error-icon svg {
  width: 22px;
  height: 22px;
  stroke: #f87171;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pc-error-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  color: var(--text-soft);
  margin: 0;
}

.pc-error-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
  max-width: 36ch;
  line-height: 1.6;
}

.pc-error-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* ─── 18. TOAST ────────────────────────────────────────────────────────────── */

.pc-toast-container {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}

.pc-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 260px;
  max-width: 380px;
  padding: 0.875rem 1.125rem;
  background: rgba(15,15,16,0.97);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-1);
  pointer-events: all;
  animation: pc-toast-in 260ms var(--ease-spring) both;
}

.pc-toast.is-exiting {
  animation: pc-toast-out 200ms var(--ease) both;
}

.pc-toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pc-toast--success .pc-toast-icon { stroke: #4ade80; fill: none; }
.pc-toast--error   .pc-toast-icon { stroke: #f87171; fill: none; }
.pc-toast--info    .pc-toast-icon { stroke: #a5b4fc; fill: none; }

@keyframes pc-toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pc-toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ─── 19. GENERIC ANIMATIONS ───────────────────────────────────────────────── */

@keyframes pc-enter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 20. HIDDEN UTILITY ───────────────────────────────────────────────────── */

.pc-results[hidden],
.pc-empty-state[hidden],
.pc-loading-state[hidden] {
  display: none !important;
}

/* ─── 21. FOCUS VISIBLE ────────────────────────────────────────────────────── */

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

/* ─── 22. SCROLLBARS ────────────────────────────────────────────────────────── */

.pc-root ::-webkit-scrollbar        { width: 4px; height: 4px; }
.pc-root ::-webkit-scrollbar-track  { background: transparent; }
.pc-root ::-webkit-scrollbar-thumb  { background: var(--border-1); border-radius: 10px; }

/* ─── 23. RESPONSIVE — Tablet ──────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .pc-stats-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .pc-reco-body {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .pc-tables-row {
    grid-template-columns: 1fr;
  }
}

/* ─── 24. RESPONSIVE — Mobile ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  .pc-root {
    padding: 1rem 0 3rem;
    gap: 0.875rem;
  }

  .pc-hero {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .pc-hero-pills { display: none; }

  .pc-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .pc-reco-body {
    grid-template-columns: 1fr;
  }

  .pc-settings-grid {
    grid-template-columns: 1fr;
  }

  .pc-filter-bar {
    gap: 0.625rem;
  }

  .pc-sticky-toolbar {
    position: relative;
    top: 0;
    gap: 0.25rem;
  }

  .pc-toolbar-btn span { display: none; }
  .pc-toolbar-btn { padding: 0.5rem; }
}

@media (max-width: 480px) {
  .pc-stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .pc-input-actions,
  .pc-error-actions {
    flex-direction: column;
  }

  .pc-btn-primary,
  .pc-btn-ghost {
    width: 100%;
    justify-content: center;
  }
}

/* ─── 25. REDUCED MOTION ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .pc-hero,
  .pc-card,
  .pc-stat-card,
  .pc-empty-state,
  .pc-loading-state,
  .pc-filter-bar,
  .pc-table-card,
  .pc-tr,
  .pc-toast,
  .pc-sticky-toolbar {
    animation: none !important;
    transition: none !important;
  }

  .pc-hero-badge-dot,
  .pc-empty-illustration svg,
  .pc-loading-ring {
    animation: none !important;
  }

  .pc-confidence-fill,
  .pc-progress-fill {
    transition: none !important;
  }
}

/* ─── 26. BOOKMARK BUTTON ──────────────────────────────────────────────────── */

#tb-bookmark.pc-bookmarked {
    background: var(--surface-1);
    border-color: var(--border-2);
    color: var(--ink-0);
}

#tb-bookmark:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}