/* ============================================================
   TIER 11C — DEEP PARENT/BUGGY MODE
   "Not step-free. Buggy-smart."
   Line Buggy Rankings + Buggy-Smart Station Report Cards.

   Integration: Add <link rel="stylesheet" href="/tier11c-parents.css"> to <head>
   All classes prefixed with t11c-
   ============================================================ */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --t11c-accent: #FF8C42;
  --t11c-accent-dim: rgba(255, 140, 66, 0.12);
  --t11c-accent-glow: rgba(255, 140, 66, 0.25);
  --t11c-green: #36B37E;
  --t11c-green-dim: rgba(54, 179, 126, 0.12);
  --t11c-amber: #FFAB00;
  --t11c-amber-dim: rgba(255, 171, 0, 0.12);
  --t11c-red: #FF5630;
  --t11c-red-dim: rgba(255, 86, 48, 0.12);
  --t11c-text: #E8EAED;
  --t11c-dim: #8B8FA3;
  --t11c-card: #141926;
  --t11c-bg: #0A0E1A;
}

/* ============================================================
   1. LINE BUGGY RANKINGS — HOME SCREEN CARD
   ============================================================ */

.t11c-rankings-card {
  margin: 12px 0;
  border-radius: var(--radius, 14px);
  border: 1px solid rgba(255, 140, 66, 0.15);
  background: var(--t11c-card);
  overflow: hidden;
  animation: t11c-fadeIn 0.3s ease;
}

@keyframes t11c-fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.t11c-rankings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.t11c-rankings-header:active {
  background: rgba(255, 255, 255, 0.04);
}

.t11c-rankings-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t11c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.t11c-rankings-subtitle {
  font-size: 11px;
  color: var(--t11c-dim);
  margin-top: 2px;
}

.t11c-rankings-chevron {
  font-size: 14px;
  color: var(--t11c-dim);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.t11c-rankings-card.t11c-expanded .t11c-rankings-chevron {
  transform: rotate(180deg);
}

/* Rankings preview — top 3 lines */
.t11c-rankings-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
}

.t11c-preview-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.t11c-preview-label {
  font-size: 11px;
  color: var(--t11c-dim);
}

.t11c-preview-score {
  font-size: 11px;
  font-weight: 700;
  margin-left: 2px;
}

.t11c-rankings-card.t11c-expanded .t11c-rankings-preview {
  display: none;
}

/* Rankings body — full list */
.t11c-rankings-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.t11c-rankings-card.t11c-expanded .t11c-rankings-body {
  max-height: 3000px;
}

/* Individual line row */
.t11c-line-row {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.t11c-line-row:active {
  background: rgba(255, 255, 255, 0.04);
}

.t11c-line-row-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.t11c-line-rank {
  font-size: 14px;
  font-weight: 800;
  color: var(--t11c-dim);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.t11c-line-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.t11c-line-info {
  flex: 1;
  min-width: 0;
}

.t11c-line-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t11c-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.t11c-line-emoji {
  font-size: 14px;
}

.t11c-line-summary {
  font-size: 12px;
  color: var(--t11c-dim);
  margin-top: 2px;
  line-height: 1.3;
}

/* Score bar */
.t11c-score-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 80px;
}

.t11c-score-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.t11c-score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.t11c-score-num {
  font-size: 13px;
  font-weight: 800;
  min-width: 24px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Expandable detail for each line */
.t11c-line-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.t11c-line-row.t11c-line-expanded .t11c-line-detail {
  max-height: 600px;
}

.t11c-line-detail-inner {
  padding: 12px 0 4px 32px;
}

.t11c-detail-section {
  margin-bottom: 10px;
}

.t11c-detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--t11c-dim);
  margin-bottom: 6px;
}

/* Pros/Cons lists */
.t11c-pros-list,
.t11c-cons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.t11c-pros-list li,
.t11c-cons-list li {
  font-size: 12px;
  color: var(--t11c-text);
  line-height: 1.5;
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.t11c-pros-list li::before {
  content: '+';
  color: var(--t11c-green);
  font-weight: 800;
  flex-shrink: 0;
  font-size: 13px;
}

.t11c-cons-list li::before {
  content: '\2212';
  color: var(--t11c-red);
  font-weight: 800;
  flex-shrink: 0;
  font-size: 13px;
}

/* Station chips */
.t11c-station-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.t11c-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.2;
}

.t11c-chip-good {
  background: var(--t11c-green-dim);
  color: var(--t11c-green);
  border: 1px solid rgba(54, 179, 126, 0.2);
}

.t11c-chip-bad {
  background: var(--t11c-red-dim);
  color: var(--t11c-red);
  border: 1px solid rgba(255, 86, 48, 0.2);
}

/* Meta info row */
.t11c-meta-row {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}

.t11c-meta-item {
  font-size: 11px;
  color: var(--t11c-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.t11c-meta-item strong {
  color: var(--t11c-text);
  font-weight: 600;
}

.t11c-expand-hint {
  font-size: 11px;
  color: var(--t11c-dim);
  text-align: center;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================================
   2. LINE BUGGY RANKINGS — FULL OVERLAY
   ============================================================ */

.t11c-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.t11c-overlay.t11c-open {
  opacity: 1;
  pointer-events: auto;
}

.t11c-overlay-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: var(--t11c-bg);
  border-radius: var(--radius, 14px) var(--radius, 14px) 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.t11c-overlay.t11c-open .t11c-overlay-sheet {
  transform: translateY(0);
}

.t11c-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 10px auto 0;
  flex-shrink: 0;
}

.t11c-sheet-header {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.t11c-sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--t11c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.t11c-sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--t11c-dim);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.t11c-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom, 0px));
}

/* ============================================================
   3. BUGGY-SMART STATION REPORT CARD (result screen)
   ============================================================ */

.t11c-report-card {
  margin: 12px 0;
  border-radius: var(--radius, 14px);
  border: 1px solid rgba(255, 140, 66, 0.15);
  background: var(--t11c-card);
  overflow: hidden;
  animation: t11c-fadeIn 0.3s ease;
}

/* Report header */
.t11c-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--t11c-accent-dim);
  border-bottom: 1px solid rgba(255, 140, 66, 0.12);
}

.t11c-report-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--t11c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.t11c-report-title-icon {
  font-size: 18px;
}

/* Big score display */
.t11c-big-score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.t11c-big-score-num {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.t11c-big-score-of {
  font-size: 12px;
  color: var(--t11c-dim);
  font-weight: 500;
}

.t11c-score-green .t11c-big-score-num { color: var(--t11c-green); }
.t11c-score-amber .t11c-big-score-num { color: var(--t11c-amber); }
.t11c-score-red .t11c-big-score-num { color: var(--t11c-red); }

/* Access method badge */
.t11c-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.t11c-access-lift {
  background: var(--t11c-green-dim);
  color: var(--t11c-green);
  border: 1px solid rgba(54, 179, 126, 0.25);
}

.t11c-access-escalator {
  background: var(--t11c-amber-dim);
  color: var(--t11c-amber);
  border: 1px solid rgba(255, 171, 0, 0.25);
}

.t11c-access-stairs {
  background: var(--t11c-red-dim);
  color: var(--t11c-red);
  border: 1px solid rgba(255, 86, 48, 0.25);
}

.t11c-access-level {
  background: rgba(76, 154, 255, 0.12);
  color: #4C9AFF;
  border: 1px solid rgba(76, 154, 255, 0.25);
}

/* Key info grid */
.t11c-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.t11c-info-cell {
  padding: 12px 14px;
  background: var(--t11c-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t11c-info-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--t11c-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.t11c-info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--t11c-text);
  display: flex;
  align-items: center;
  gap: 5px;
}

.t11c-info-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.t11c-val-good { color: var(--t11c-green); }
.t11c-val-warn { color: var(--t11c-amber); }
.t11c-val-bad { color: var(--t11c-red); }
.t11c-val-na { color: var(--t11c-dim); font-style: italic; }

/* Gap mm callout */
.t11c-gap-mm {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 2px;
}

.t11c-gap-mm-large {
  background: var(--t11c-red-dim);
  color: var(--t11c-red);
}

.t11c-gap-mm-medium {
  background: var(--t11c-amber-dim);
  color: var(--t11c-amber);
}

/* Verdict section */
.t11c-verdict {
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.t11c-verdict-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.t11c-verdict-text {
  font-size: 13px;
  color: var(--t11c-text);
  line-height: 1.5;
}

/* Full report expandable */
.t11c-full-report-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--t11c-accent);
  font-family: var(--font, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.t11c-full-report-toggle:active {
  background: rgba(255, 255, 255, 0.03);
}

.t11c-full-report-chevron {
  font-size: 10px;
  transition: transform 0.25s;
}

.t11c-report-card.t11c-report-expanded .t11c-full-report-chevron {
  transform: rotate(180deg);
}

.t11c-full-report-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.t11c-report-card.t11c-report-expanded .t11c-full-report-body {
  max-height: 400px;
}

.t11c-full-report-inner {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Full report detail rows */
.t11c-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.t11c-detail-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  margin-top: 1px;
}

.t11c-detail-content {
  flex: 1;
  min-width: 0;
}

.t11c-detail-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--t11c-text);
  margin-bottom: 2px;
}

.t11c-detail-desc {
  font-size: 12px;
  color: var(--t11c-dim);
  line-height: 1.4;
}

/* ============================================================
   4. LINE BUGGY SCORE BADGE (result screen, inline)
   ============================================================ */

.t11c-line-badge {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 10px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.t11c-line-badge:active {
  filter: brightness(1.1);
}

.t11c-line-badge-good {
  background: var(--t11c-green-dim);
  border: 1px solid rgba(54, 179, 126, 0.2);
}

.t11c-line-badge-ok {
  background: var(--t11c-amber-dim);
  border: 1px solid rgba(255, 171, 0, 0.15);
}

.t11c-line-badge-bad {
  background: var(--t11c-red-dim);
  border: 1px solid rgba(255, 86, 48, 0.2);
}

.t11c-line-badge-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.t11c-line-badge-text {
  flex: 1;
  min-width: 0;
  color: var(--t11c-text);
  font-weight: 500;
  line-height: 1.3;
}

.t11c-line-badge-score {
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.t11c-line-badge-good .t11c-line-badge-score { color: var(--t11c-green); }
.t11c-line-badge-ok .t11c-line-badge-score { color: var(--t11c-amber); }
.t11c-line-badge-bad .t11c-line-badge-score { color: var(--t11c-red); }

/* ============================================================
   5. PARENT MODE PROMINENCE BOOST
   ============================================================ */

body.t9p-active .t11c-report-card {
  border-color: rgba(255, 140, 66, 0.25);
}

body.t9p-active .t11c-rankings-card {
  border-color: rgba(255, 140, 66, 0.25);
}

/* ============================================================
   6. RESPONSIVE
   ============================================================ */

@media (max-width: 340px) {
  .t11c-info-grid {
    grid-template-columns: 1fr;
  }

  .t11c-score-area {
    width: 60px;
  }

  .t11c-meta-row {
    flex-direction: column;
    gap: 4px;
  }
}

@media (min-width: 420px) {
  .t11c-big-score-num {
    font-size: 32px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .t11c-rankings-card,
  .t11c-report-card {
    animation: none;
  }

  .t11c-score-bar-fill {
    transition: none;
  }
}

/* ============================================================
   7. HIDDEN HELPER
   ============================================================ */

.t11c-hidden {
  display: none !important;
}
