/* ========================================
   Context X-Ray Bar
   ======================================== */
.xray-bar-wrap { margin: 1.5rem 0; }
.xray-bar {
  display: flex;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-surface);
}
.xray-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  min-width: 2px;
  transition: width 1s cubic-bezier(0.22,1,0.36,1);
  position: relative;
}
.xray-seg.invisible::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.2) 3px,
    rgba(0,0,0,0.2) 6px
  );
}
.xray-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.xray-legend span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

/* ========================================
   X-Ray Callout
   ======================================== */
.xray-callout {
  background: linear-gradient(135deg, rgba(196,212,224,0.05), rgba(107,141,181,0.03));
  border: 1px solid rgba(196,212,224,0.15);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  text-align: center;
}
.xray-callout-value {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  color: var(--wash-5);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.xray-callout-label {
  font-size: 1rem;
  color: var(--text-primary);
  margin-top: 0.3rem;
}
.xray-callout-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ========================================
   Tax Breakdown Accordion
   ======================================== */
.tax-bar-seg[data-tax-type] {
  cursor: pointer;
  transition: opacity 0.2s, filter 0.2s;
}
.tax-bar-seg[data-tax-type]:hover {
  filter: brightness(1.15);
}
.tax-bar-seg.active {
  filter: brightness(1.2);
  box-shadow: 0 0 8px rgba(255,255,255,0.15);
}
.tax-legend-item[data-tax-type] {
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: border-color 0.2s, color 0.2s;
}
.tax-legend-item[data-tax-type]:hover {
  color: var(--text-primary);
}
.tax-legend-item.active {
  color: var(--text-primary);
  border-left-color: var(--accent);
}
.tax-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.5rem 1.8rem;
  margin-top: 1rem;
}
.tax-explain {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.tax-detail-panel .metric-grid {
  margin-bottom: 1rem;
}
.tax-contributors .section-label {
  margin-bottom: 0.4rem;
}
.tax-contributors ul {
  font-size: 0.82rem;
  color: var(--text-muted);
  list-style: disc;
  padding-left: 1.2rem;
  line-height: 1.8;
  margin: 0;
}
@media (max-width: 640px) {
  .tax-detail-panel {
    padding: 1.2rem 1rem;
  }
}

/* ========================================
   Wash Breakdown Accordion (Weigh-In)
   ======================================== */
.bloat-seg[data-wash-type] {
  cursor: pointer;
  transition: width 1s cubic-bezier(0.22,1,0.36,1), filter 0.2s;
}
.bloat-seg[data-wash-type]:hover {
  filter: brightness(1.3);
}
.bloat-seg[data-wash-type].active {
  filter: brightness(1.4);
  box-shadow: 0 0 8px rgba(255,255,255,0.15);
}
.bloat-legend span[data-wash-type] {
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: border-color 0.2s, color 0.2s;
}
.bloat-legend span[data-wash-type]:hover {
  color: var(--text-primary);
}
.bloat-legend span[data-wash-type].active {
  color: var(--text-primary);
  border-left-color: var(--accent);
}
.wash-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-top: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.wash-detail-panel .wash-explain {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
/* Fat threshold marker on bloat bar */
.bloat-bar-fat-marker {
  position: absolute;
  top: 0;
  height: 34px;
  pointer-events: none;
  transform: translateX(2px);
}
.bloat-bar-fat-line {
  position: absolute;
  top: -6px;
  height: calc(34px + 12px);
  border-left: 3px solid var(--red);
  opacity: 0.85;
}
.bloat-bar-fat-label {
  position: absolute;
  top: -22px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--red);
  opacity: 0.9;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .wash-detail-panel {
    padding: 1rem;
  }
}

/* ========================================
   Fattest Chats Expandable Rows
   ======================================== */
.fattest-row {
  cursor: pointer;
}
.fattest-row:hover td {
  background: var(--bg-card) !important;
}
.fattest-row.expanded td {
  background: var(--bg-card);
  border-bottom-color: transparent;
}
.detail-row td {
  padding: 0 !important;
  background: var(--bg-raised);
  border-bottom: 2px solid var(--border-medium);
}
.detail-row:hover td {
  background: var(--bg-raised) !important;
}

/* Per-conversation X-Ray (inside detail row) */
.conv-xray {
  padding: 1.2rem 1.5rem;
}
.conv-xray-callout {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(196,212,224,0.06);
  border-left: 3px solid var(--wash-5);
  border-radius: 0 6px 6px 0;
}
.conv-xray-callout strong {
  color: var(--wash-5);
  font-family: var(--font-mono);
}
.conv-xray-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 2rem;
  margin-top: 0.75rem;
}
.conv-xray-stat {
  font-size: 0.78rem;
}
.conv-xray-stat .stat-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline;
  margin-right: 0.4rem;
}
.conv-xray-stat .stat-value {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: inline;
}

/* ========================================
   Jeans Card
   ======================================== */
/* Size Tag card (replaces old gradient jeans card) */
.jeans-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 2rem 1.5rem;
  margin-top: 1.5rem;
  background: #F5F0E8;
  border: 1px solid var(--stitch);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.jeans-card-bg { display: none; }
.jeans-card-overlay { display: none; }
.jeans-card-content {
  position: relative;
  z-index: 2;
  width: 100%;
}
.jeans-card .jeans-brand {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #5A4A3A;
  margin-bottom: 0.75rem;
}
.jeans-card .jeans-hours {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 700;
  color: #1B2838;
  line-height: 1;
  text-shadow: none;
}
.jeans-card .jeans-hours .unit {
  font-size: 0.35em;
  font-weight: 400;
  color: #5A4A3A;
}
.jeans-card .jeans-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  margin-top: 0.15rem;
}
.jeans-card .jeans-stats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #5A7088;
  margin-top: 0.5rem;
}
.jeans-card .jeans-fold {
  width: 80%;
  border: none;
  border-top: 2px dashed var(--stitch);
  margin: 1rem auto 0.75rem;
  opacity: 0.5;
}
.jeans-card .jeans-tier-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2A3F55;
}
.jeans-card .jeans-wash-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #5A7088;
  margin-top: 0.2rem;
}
.jeans-card .jeans-watermark {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: rgba(90,112,136,0.4);
  z-index: 2;
}
.jeans-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.jeans-btn {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}
.jeans-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card-hover);
}
.jeans-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-base);
}
.jeans-btn.primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

/* Jeans placeholder (admin page) */
.jeans-placeholder {
  border: 2px dashed var(--border-medium);
  border-radius: 10px;
  padding: 3rem;
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========================================
   Quiz
   ======================================== */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}
@media (max-width: 640px) {
  .quiz-grid { grid-template-columns: 1fr; }
}
.quiz-choice {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.quiz-choice:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}
.quiz-choice .quiz-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quiz-choice .quiz-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.quiz-choice.correct {
  border-color: var(--green);
  background: var(--green-bg);
}
.quiz-choice.correct .quiz-title { color: var(--green); }
.quiz-choice.wrong {
  border-color: var(--red);
  background: var(--red-bg);
  opacity: 0.7;
}
.quiz-choice.dimmed {
  opacity: 0.4;
  pointer-events: none;
}
.quiz-result {
  margin-top: 1rem;
  padding: 1rem 1.3rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}
.quiz-result.show { display: block; }
.quiz-result.correct-result {
  background: var(--green-bg);
  border: 1px solid rgba(232,224,212,0.2);
  color: var(--green);
}
.quiz-result.wrong-result {
  background: var(--red-bg);
  border: 1px solid rgba(194,59,34,0.2);
  color: var(--text-secondary);
}
.quiz-result strong {
  color: var(--text-primary);
}

/* ========================================
   Email Gate
   ======================================== */
.gate-section {
  text-align: center;
  padding: 3rem 0;
}
.gate-cta {
  display: inline-block;
  padding: 2rem 2.5rem;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
  border: 2px dashed var(--stitch);
  border-radius: 0 0 40% 40% / 0 0 20% 20%;
  max-width: 480px;
  width: 100%;
}
.gate-cta h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.gate-cta p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.gate-form {
  display: flex;
  gap: 0.5rem;
}
.gate-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.gate-input:focus {
  border-color: var(--accent);
}
.gate-input::placeholder {
  color: var(--text-muted);
}
.gate-submit {
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg-base);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.gate-submit:hover {
  background: var(--accent-bright);
}
@media (max-width: 640px) {
  .gate-form { flex-direction: column; }
  .gate-cta { padding: 1.5rem; }
}

/* Gate pulse animation */
.gate-submit {
  animation: gate-pulse 2s ease-in-out infinite;
}
@keyframes gate-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,115,51,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(184,115,51,0); }
}

/* ========================================
   Gated Sections
   ======================================== */
.gated-section { display: none; }
#results-container.unlocked .gated-section { display: block; }

/* ========================================
   Fitness Plan Fixes
   ======================================== */
.fix-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem 1.8rem;
  margin-bottom: 1rem;
}
.fix-card .fix-number {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.fix-card .fix-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}
.fix-card .fix-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.fix-card .fix-action {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  padding: 0.6rem 1rem;
  background: var(--accent-glow);
  border-radius: 6px;
  display: inline-block;
}
.fix-examples {
  margin-top: 0.75rem;
}
.fix-example-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}
.fix-example-row:last-child { border-bottom: none; }
.fix-example-title {
  color: var(--text-primary);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fix-example-stat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.fix-see-all {
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 0.3rem;
  transition: color 0.2s;
}
.fix-see-all:hover { color: var(--accent); }

/* ========================================
   Soft Bridge (CTA)
   ======================================== */
.soft-bridge {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-card);
}
.soft-bridge p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========================================
   Wash Border Classes (fattest chats rows)
   ======================================== */
.wash-border-1 { border-left: 3px solid var(--wash-1); }
.wash-border-2 { border-left: 3px solid var(--wash-2); }
.wash-border-3 { border-left: 3px solid var(--wash-3); }
.wash-border-4 { border-left: 3px solid var(--wash-4); }
.wash-border-5 { border-left: 3px solid var(--wash-5); }
