/* LibreQoS Bufferbloat Test Styles */

:root {
    /* LibreQoS-aligned palette */
    --background: #0b1224;
    --surface: rgba(255, 255, 255, 0.04);
    --card: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --primary: #4f78b5;
    --primary-strong: #3f68a5;
    --text: #e6edf5;
    --muted: #b4bdc9;
    --accent: #3f68a5;
    --error: #e15757;
    --success: #2ec27e;
    --warning: #f4b400;
    --nav-height: 56px;
    --brand-gradient: radial-gradient(circle at 20% 20%, rgba(56,189,248,0.12), transparent 35%), radial-gradient(circle at 80% 0%, rgba(34,197,94,0.12), transparent 30%), linear-gradient(135deg, #0b1224 0%, #0e182f 60%, #0b1224 100%);
    /* Legacy colors mapped to new palette */
    --baseline-color: #3498db;
    --download-warmup-color: #a9dfbf;
    --download-color: #2ec27e;
    --upload-warmup-color: #f5b7b1;
    --upload-color: #e15757;
    --bidirectional-color: #9c27b0;
    --font-body: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: var(--font-body);
}

/* Layout & Hierarchy */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.box-plot-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}
.latency-time-series-card {
  background: linear-gradient(135deg, rgba(12,22,42,0.95), rgba(9,16,32,0.92));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 12px 6px 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.02);
}

.results-container,
.statistics-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}

/* Chart mode toggle */
.toggle-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-left: 6px;
  cursor: pointer;
}
.toggle-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: var(--primary-strong);
  color: #fff;
}

/* Capture mode: hide share-only UI while keeping real styling for SnapDOM */
.results-container.capture-mode .share-container {
  display: none !important;
}

/* SnapDOM capture: ensure the captured subtree has the same gradient behind translucent cards */
#resultsSection.capture-mode {
  background: var(--brand-gradient);
  background-color: var(--background);
}

/* Prevent top-margin collapse creating transparent space in exported PNGs */
#resultsSection.capture-mode {
  padding-top: 1px;
}
#resultsSection.capture-mode .results-container {
  margin-top: 0 !important;
}

/* Export PNG: omit the "Test Results" title so the image starts at the content cards. */
#resultsSection.capture-mode #results > h2 {
  display: none !important;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.modal-card h3 {
  margin: 0 0 10px;
  color: #e5edff;
  font-size: 18px;
  font-weight: 800;
}
.modal-card p {
  margin: 0 0 16px;
  color: rgba(229, 237, 255, 0.9);
  font-size: 14px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.capture-mode .chart-toggle {
  display: none !important;
}

.individual-grades-section,
.throughput-boxes,
#statisticsTable {
  margin-top: 16px;
}

/* Results Emphasis */
.results-container h2,
.statistics-container h3 {
  margin: 0 0 12px;
}

h2, h3 {
  color: #ffffff;
  font-weight: 800;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.section-header .title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
}

.total-grade {
  font-size: 3rem;
  font-weight: 800;
  text-shadow: none;
}

.grade-badge {
  box-shadow: none;
  text-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Throughput Boxes */
.throughput-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 120px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.throughput-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.latency-increase {
  opacity: 0.85;
  font-size: 0.95rem;
}

/* Stats Table */
.stats-table {
  border-collapse: separate;
  border-spacing: 0;
}

.stats-table th,
.stats-table td {
  border: none;
}

.stats-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.stats-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
}

.with-raleway {
    --font-heading: 'Raleway', var(--font-body);
    --font-heading-weight: 500;
}

.with-manrope {
    --font-body: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: var(--font-body);
    --font-heading-weight: 700;
}

.with-raleway h1,
.with-raleway h2,
.with-raleway h3,
.with-raleway .page-title,
.with-raleway .results-container h2,
.with-raleway .statistics-container h3,
.with-raleway .total-hero .hero-header,
.with-raleway .cq-hero .hero-header,
.with-raleway .educational-content .edu-title,
.with-raleway .section-header .title,
.with-raleway .accordion summary,
.with-raleway .modal-card h3 {
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
}

.with-manrope .page-title,
.with-manrope h2,
.with-manrope h3 {
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
}

.nav-bar {
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.nav-left a {
    display: inline-flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
    font-size: 14px;
}

.nav-links a {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .nav-bar { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 8px 12px; }
    .nav-links { flex: 1; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
    .nav-links a { padding: 5px 10px; font-size: 12px; }
    .nav-left { width: auto; justify-content: flex-start; font-size: 13px; gap: 6px; }
    .nav-left span { display: none; }

    .total-hero .hero-contrib { grid-template-columns: 1fr; }
}

.nav-links a:hover {
    border-color: var(--border);
    background: rgba(255,255,255,0.04);
}

.nav-links .active {
    border-color: var(--primary);
    background: rgba(79,120,181,0.15);
}

.page {
    background: var(--brand-gradient);
    min-height: 100vh;
}

.page-hero {
    text-align: center;
    margin: 0 auto 8px;
    padding: 12px 0 12px 0;
    margin-top: calc(var(--nav-height) + 6px);
}

.logo-hero {
    height: 38px;
    width: auto;
    max-width: 220px;
    display: inline-block;
    margin-bottom: 0;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 4px 0;
    color: var(--text);
}

.page-subtitle {
    margin: 2px 0 4px 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.test-location {
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Single Test inline styles moved from index.html */
.test-status {
    text-align: center;
    padding: 20px;
    margin: 10px 0 8px;
}
.status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-direction: column;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid #60A5FA;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.bloat-fact {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    line-height: 1.4;
    text-align: center;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.stats-table th,
.stats-table td {
    border: 1px solid #444;
    padding: 8px;
    text-align: left;
    font-size: 12px;
}
.stats-table th {
    background-color: #333;
    color: #fff;
    font-size: 13px;
}
#downloadPlan.is-testing {
    margin-top: 4px;
    margin-bottom: 8px;
}
.test-location {
    font-size: 0.95rem;
    margin-top: 4px;
}
.download-plan {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 10px 0 6px;
}
.plan-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 120px;
    display: grid;
    gap: 4px;
}
.plan-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
}
.plan-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin: 6px 0 10px;
}
.context-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2px 16px;
}
.context-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.context-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
.context-ellipsis {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1400px) {
    .context-grid {
        grid-template-columns: repeat(8, minmax(120px, 1fr));
    }
}
/* Logo block */
.logo-container { text-align: center; margin-bottom: 1rem; }
.logo { height: 40px; width: auto; max-width: 200px; margin-bottom: 0.5rem; }
.logo-container a { display: inline-block; margin-bottom: 0.5rem; }
.logo-container h1 { margin: 0.5rem 0; font-size: 1.8rem; }
.logo-container p { margin: 0.3rem 0; font-size: 1rem; }

/* Educational + recommendations blocks (single test) */
.educational-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    row-gap: 22px;
}
.educational-content .edu-section {
    display: grid;
    row-gap: 10px;
}
.educational-content .phase-explanations,
.educational-content .grade-explanations,
.educational-content .recommendations {
    margin: 0;
    padding-top: 0;
}
.educational-content .what-is-libreqos {
    margin: 0;
}
.educational-content .edu-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}
.what-is-libreqos {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 12px 0 0;
}
.what-is-libreqos h3 { margin: 0 0 10px; }
.what-is-libreqos p { margin: 0; color: rgba(229,237,255,0.9); line-height: 1.6; font-size: 14px; }
.what-is-libreqos a { color: #93c5fd; font-weight: 700; text-decoration: none; }
.what-is-libreqos a:hover { text-decoration: underline; }
.what-is-libreqos .vh-grade-explainer-lines {
    margin-top: 10px;
    display: grid;
    row-gap: 6px;
    color: rgba(229,237,255,0.9);
    line-height: 1.5;
    font-size: 14px;
}
.what-is-libreqos .vh-grade-explainer-lines .line strong {
    color: #ffffff;
    font-weight: 800;
}
.what-is-libreqos .vh-grade-explainer-lines code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(229,237,255,0.95);
}
.what-is-libreqos .vh-grade-explainer-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.what-is-libreqos .vh-grade-explainer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.what-is-libreqos .vh-grade-explainer-table td {
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    vertical-align: top;
    font-size: 13px;
}
.what-is-libreqos .vh-grade-explainer-table tr:first-child td {
    border-top: 0;
}
.what-is-libreqos .vh-grade-explainer-table td:first-child {
    width: 160px;
    color: rgba(229,237,255,0.85);
    font-weight: 800;
}
.vh-grade-explainer-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.vh-grade-role {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 12px;
}
.vh-grade-role summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 800;
    color: #ffffff;
}
.vh-grade-role summary::-webkit-details-marker { display: none; }
.vh-grade-role summary::after {
    content: '▾';
    color: rgba(229,237,255,0.75);
    font-weight: 800;
}
.vh-grade-role[open] summary::after { content: '▴'; }
.vh-grade-role-meta {
    font-weight: 700;
    color: rgba(229,237,255,0.75);
    font-size: 12px;
}
.vh-grade-role-body {
    margin-top: 8px;
}
@media (max-width: 900px) {
    .vh-grade-explainer-grid { grid-template-columns: 1fr; }
}
.phase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 0.85rem;
    margin: 0;
}
.phase-explanation {
    display: flex;
    align-items: center;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.phase-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 1rem;
    flex-shrink: 0;
}
.phase-info h4 {
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    font-size: 16px;
    font-weight: 700;
}
.phase-info p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}
.baseline-color { background-color: var(--baseline-color); }
.download-color { background-color: var(--download-color); }
.upload-color { background-color: var(--upload-color); }
.bidirectional-color { background-color: var(--bidirectional-color); }
.cooldown-color { background-color: var(--baseline-color); }
.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 1.5rem;
    margin: 0;
}
.grade-explanation {
    display: flex;
    align-items: flex-start;
    padding: 1.4rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.grade-explanation:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.grade-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4rem;
    color: #ffffff;
    margin-right: 1.5rem;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.grade-description h4 {
    color: #ffffff;
    margin: 0 0 0.75rem 0;
    font-size: 16px;
    font-weight: 700;
}
.grade-description p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.55;
    font-size: 14px;
}
.grade-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin: 0 0 6px 0;
}
.grade-explanation.is-user-grade {
    border-color: #00ff88;
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.18);
}
.grade-user-pill {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #00ff88;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.recommendations {
    margin-top: 32px;
    padding-top: 0;
}
.recommendations-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.1rem;
}
.recommendation {
    padding: 1.15rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.recommendation h4 {
    color: #60A5FA;
    margin: 0 0 1rem 0;
    font-size: 15px;
    display: flex;
    align-items: center;
}
.recommendation p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.55;
    font-size: 14px;
}
.recommendation strong {
    color: #93C5FD;
    font-weight: 600;
}
@media (max-width: 768px) {
    .educational-content {
        margin-top: 2rem;
        padding-top: 1.5rem;
        row-gap: 18px;
    }
    .educational-content .edu-section {
        row-gap: 10px;
    }
    .grades-grid,
    .recommendations-content {
        gap: 1rem;
    }
    .phase-explanation,
    .grade-explanation,
    .recommendation {
        padding: 1rem;
    }
    .grade-badge {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-right: 1rem;
    }
    .educational-content .edu-title {
        font-size: 1.3rem;
    }
}
/* Virtual Household styles */
.vh-header { text-align:center; margin: 0.3rem 0; font-size: 1rem; }
.vh-controls { display:flex; gap:10px; justify-content:center; margin: 0 0 20px; align-items:center; flex-wrap:wrap; }
.vh-legend { display:none; }
.vh-grid { display:grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 12px; }
.vh-tile { min-height: 180px; padding: 0; display: flex; flex-direction: column; }
.vh-card-top { padding: 10px 12px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.vh-role-badge { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border-radius:999px; border:1px solid rgba(255,255,255,0.12); font-size: 12px; color: #e2e8f0; }
.vh-role-badge .label { font-weight:700; }
.vh-grade { padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); font-size: 13px; font-weight: 800; color: #e2e8f0; background: rgba(255,255,255,0.08); justify-self: start; }
.vh-card-header { display:flex; align-items:center; justify-content: space-between; gap: 10px; }
.vh-card-meta { display: grid; gap: 6px; }
.vh-lat-line { font-size: 1.25rem; font-weight:800; flex: 1 1 auto; }
.vh-card-title { flex: 0 0 auto; }
.vh-metrics-row { display:flex; align-items:center; gap: 12px; font-size: 12px; opacity:0.9; flex-wrap: wrap; }
.vh-metric .label { margin-right: 4px; opacity:0.7; font-size:11px; text-transform: uppercase; letter-spacing:0.02em; }
.vh-spark-wrap { position: relative; width: 100%; flex: 1 1 50%; padding: 0 12px 10px; min-height: 80px; }
.vh-spark { height: 100%; width: 100%; min-height: 70px; }
.vh-spark-mask { position: absolute; inset: 8px 12px 0 12px; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.06) 40%, rgba(0,0,0,0.10) 100%); }
.vh-fairness { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 10px; margin: 8px 0 16px 0; }
.vh-fair-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.vh-fair-title { font-weight: 700; margin-bottom: 4px; }
.vh-fair-val { font-weight: 800; font-size: 16px; }
.vh-progress { height: 3px; width: 100%; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; margin: 20px 0 12px; display: none; }
.vh-progress .fill { height: 100%; width: 0%; background: linear-gradient(90deg, #34d399, #60a5fa); }
.vh-grade-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 14px 0 8px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.2);
}
.vh-grade-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.vh-grade-pill {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    background: #3b82f6;
    box-shadow: 0 6px 16px rgba(59,130,246,0.45);
    flex-shrink: 0;
}
.vh-grade-text { display: grid; gap: 4px; }
.vh-grade-title { font-weight: 800; font-size: 15px; color: #e5edff; }
.vh-grade-verdict { font-size: 13px; color: rgba(229,237,255,0.9); line-height: 1.4; }
.vh-grade-subtext { margin-top: 8px; font-size: 12px; color: rgba(229,237,255,0.8); }
.vh-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-left:6px; vertical-align:middle; background:#9ca3af; }
.vh-dot.good { background:#22c55e; }
.vh-dot.warn { background:#f59e0b; }
.vh-dot.bad  { background:#ef4444; }
@media (max-width: 768px) {
  .vh-grid { grid-template-columns: 1fr; }
  .vh-spark { min-height: 52px; }
}

/* Rankings styles */
.rankings-controls {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.rankings-select {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}
.rankings-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px 40px;
}
.rankings-table-wrapper {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.rankings-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
}
.rankings-table thead {
    background: rgba(255,255,255,0.03);
}
.rankings-table th,
.rankings-table td {
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.rankings-table th:last-child,
.rankings-table td:last-child { text-align: right; }
.isp-col { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-col { width: 100px; text-align: left; }
.flag-col { width: 60px; text-align: center; }
.rankings-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34,197,94,0.18);
}
.hidden { display: none; }

/* Page footer (memorial + copyright) */
.site-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  color: rgba(229, 237, 255, 0.75);
}
.site-footer-memorial {
  font-size: 13px;
  line-height: 1.5;
}
.site-footer-memorial a {
  color: rgba(229, 237, 255, 0.9);
  font-weight: 700;
  text-decoration: none;
}
.site-footer-memorial a:hover {
  text-decoration: underline;
}
.site-footer-copyright {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.9;
}
@media (max-width: 760px) {
    .rankings-table th, .rankings-table td { padding: 10px 12px; font-size: 13px; }
    .page-title { font-size: 22px; }
    .isp-col { max-width: 190px; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 10px;
    width: 100%;
}

/* Keep same container width as Single User Test - no override needed */

@media (max-width: 768px) {
    .container {
        padding: 10px 5px;
    }
}

header {
    text-align: center;
    margin-bottom: 5px;
    padding: 20px 0 10px 0;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 225px; /* Reduced by 25% from 300px */
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
}

.logo-container h1 {
    color: var(--text);
    margin-bottom: 10px;
    text-align: center;
}

/* Sponsor info display */
.sponsor-info {
    font-size: 14px;
    color: var(--text);
    font-weight: normal;
    text-align: center;
    margin-top: 5px;
}

.sponsor-info a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sponsor-info a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Sponsor heading */
.sponsor-heading {
    text-align: center;
    font-size: 14px;
    color: var(--text);
    margin-top: 5px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.sponsor-heading a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.sponsor-heading a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Telemetry opt-out UI */
.telemetry-control {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background-color: var(--secondary);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.telemetry-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.telemetry-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-grow: 1;
}

.telemetry-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.telemetry-text {
    font-size: 14px;
    color: var(--text);
    opacity: 0.9;
}

.telemetry-info-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.telemetry-info-btn:hover {
    opacity: 1;
}

.info-icon {
    font-size: 16px;
}

.telemetry-info {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.telemetry-info h4 {
    margin: 0 0 10px 0;
    color: var(--text);
    font-size: 16px;
}

.telemetry-info p {
    margin: 10px 0;
    font-size: 14px;
    color: var(--text);
    opacity: 0.9;
    line-height: 1.5;
}

.telemetry-info ul {
    margin: 5px 0 10px 20px;
    font-size: 14px;
}

.telemetry-info li {
    margin: 5px 0;
    color: var(--text);
    opacity: 0.8;
}

.telemetry-info strong {
    color: var(--primary);
}

/* Server discovery and info */
.server-info {
    max-width: 800px;
    margin: 10px auto;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.server-location {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text);
    opacity: 0.8;
}

.server-icon {
    margin-right: 8px;
    font-size: 16px;
}

.discovery-error {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.discovery-error .error-message h4 {
    color: #dc3545;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.discovery-error .error-message p {
    color: var(--text);
    margin: 8px 0;
    font-size: 14px;
}

.discovery-error .error-details {
    font-family: monospace;
    font-size: 12px;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
}

.test-container {
    background-color: var(--secondary);
    border-radius: 8px;
    padding: 0 20px 20px;
    margin-bottom: 30px;
}

.test-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    margin-bottom: 20px;
}

/* Live latency sparkline */
.live-latency {
    width: 100%;
    max-width: 1100px;
    margin: 10px auto 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 18px rgba(0,0,0,0.14);
}
.live-latency-row {
    display: grid;
    grid-template-columns: 0.9fr 1.4fr 0.9fr;
    gap: 12px;
    align-items: flex-start;
}
.gauge-card {
    min-width: 0;
    min-height: 116px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-direction: column;
    gap: 8px;
}
.gauge-shell {
    width: 140px;
    height: 82px;
}
.gauge-label {
    font-size: 15px;
    font-weight: 800;
    color: #dbeafe;
    opacity: 0.98;
    letter-spacing: 0.01em;
}
.gauge-metric {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.62);
    margin-top: 4px;
}
.live-latency-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    min-width: 0;
}
.live-latency-header {
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    opacity: 0.98;
    margin-bottom: 0;
    color: #dbeafe;
    letter-spacing: 0.01em;
    text-transform: none;
}
.live-latency-chart {
    height: 66px;
    width: 100%;
    background: linear-gradient(180deg, rgba(96,165,250,0.10), rgba(96,165,250,0.03));
    border-radius: 8px;
    padding: 6px 12px 10px 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 6px 20px rgba(0,0,0,0.18);
}

.btn {
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 700;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    border-color: var(--primary-strong);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stepper-container {
    width: 100%;
    margin: 20px 0 12px;
}

.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
}

@media (max-width: 900px) {
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 27, 46, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    font-size: 18px;
    position: relative;
    transition: all 0.3s ease;
    opacity: 1;
    border: 2px solid rgba(255,255,255,0.14);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.03), inset 0 1px 0 rgba(255,255,255,0.09);
}

/* Center glyph icons consistently across platform fonts */
.step-icon::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
    display: block;
    pointer-events: none;
}

/* Step-specific icons using CSS symbols with LibreQoS Blue */
.step.baseline .step-icon::before {
    content: "-";
    color: rgba(255,255,255,0.55);
    font-size: 16px;
}

.step.download_warmup .step-icon::before {
    content: "↗";
    color: rgba(255,255,255,0.55);
    font-size: 16px;
}

.step.download .step-icon::before {
    content: "↓";
    color: rgba(255,255,255,0.55);
    font-weight: bold;
    font-size: 18px;
}

.step.upload_warmup .step-icon::before {
    content: "↗";
    color: rgba(255,255,255,0.55);
    font-size: 16px;
}

.step.upload .step-icon::before {
    content: "↑";
    color: rgba(255,255,255,0.55);
    font-weight: bold;
    font-size: 18px;
}

.step.bidirectional .step-icon::before {
    content: "↕";
    color: rgba(255,255,255,0.55);
    font-weight: bold;
    font-size: 16px;
}

.step.recovery .step-icon::before {
    content: "↘";
    color: rgba(255,255,255,0.55);
    font-size: 16px;
}

.step-label {
    font-size: 12px;
    font-weight: normal;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.step-connector {
    position: absolute;
    top: 18px;
    right: -50%;
    width: 100%;
    height: 2px;
    background-color: rgba(255,255,255,0.10);
    z-index: -1;
}

/* Active and completed states */
.step.active .step-icon {
    opacity: 1;
    transform: scale(1.1);
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.03), 0 0 0 2px rgba(79, 120, 181, 0.3);
}

.step.active .step-icon::before {
    color: white; /* White symbols for contrast on LibreQoS Blue background */
}

.step.active .step-label {
    font-weight: bold;
    color: var(--text);
}

.step.completed .step-icon {
    opacity: 1;
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.03), 0 0 0 2px rgba(79,120,181,0.25);
}

.step.completed .step-icon::before {
    color: white; /* White symbols for contrast on LibreQoS Blue background */
}

.step.completed .step-connector {
    background-color: var(--primary);
}

/* Animation for completion */
@keyframes completedStep {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.step.just-completed .step-icon {
    animation: completedStep 0.5s ease;
    background-color: var(--primary); /* LibreQoS Blue background for just-completed */
    border-color: var(--primary); /* LibreQoS Blue border for just-completed */
    box-shadow: 0 0 0 4px rgba(255,255,255,0.03), 0 0 0 2px rgba(79,120,181,0.25);
}

.step.just-completed .step-icon::before {
    color: white; /* White symbols for contrast on LibreQoS Blue background */
}

/* Progress bar below stepper */
.progress-bar {
    height: 6px;
    background-color: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin-top: 5px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
    transition: width 0.9s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.progress-fill.no-anim {
    transition: none !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .step-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .step-icon::before {
        font-size: 14px;
    }
    
    .step.download .step-icon::before,
    .step.upload .step-icon::before {
        font-size: 15px;
    }
    
    .step-label {
        font-size: 10px;
    }
    
    .step-connector {
        top: 15px;
    }
}

@media (max-width: 480px) {
    .step-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .step-icon::before {
        font-size: 12px;
    }
    
    .step.download .step-icon::before,
    .step.upload .step-icon::before {
        font-size: 13px;
    }
    
    .step-label {
        font-size: 8px;
    }
    
    .step-connector {
        top: 12px;
    }
}

#currentPhase {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    text-align: center;
}

.chart-container {
    height: 400px;
    margin: 20px 0 10px 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.throughput-chart-container {
    height: 200px;
    margin: 10px 0 20px 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.results-container {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--secondary);
    border-radius: 8px;
}

/* Total Grade Hero */
.total-hero {
  position: relative;
  padding: 16px 16px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.018) 100%),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}
.total-hero .share-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  line-height: 12px;
  color: rgba(255,255,255,0.62);
  letter-spacing: 0.06em;
  pointer-events: none;
  user-select: none;
}
.total-hero .share-footer-logo {
  height: 14px;
  width: auto;
  opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
.total-hero .share-footer-text { white-space: nowrap; }

/* Share-friendly "Your connection" row (Ookla-style dots) */
.connection-score {
  margin-top: 6px;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.connection-score-title {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}
.connection-score-items {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
}
.connection-score-item {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.connection-score-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: rgba(229, 237, 255, 0.9);
  background: rgba(0,0,0,0.14);
  border: 1px solid rgba(255,255,255,0.10);
}
.connection-score-icon svg {
  width: 26px;
  height: 26px;
}
.connection-score-dots {
  display: flex;
  gap: 6px;
}
.connection-score-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(96,165,250,0.14);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.05);
}
.connection-score-dots .dot.is-on {
  background: #60A5FA;
  box-shadow: 0 0 10px rgba(96,165,250,0.55), 0 0 0 3px rgba(96,165,250,0.14);
}
.connection-score-label {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
  white-space: nowrap;
}
@media (max-width: 760px) {
  .connection-score-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* Connection Quality hero (reuse total-hero visuals) */
.cq-hero {
  position: relative;
  padding: 12px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}
.cq-hero .hero-header { font-weight: 700; font-size: 1.1rem; margin: 0 0 8px 0; }
.cq-hero .hero-content { display:flex; align-items:center; gap:18px; }
.cq-hero .hero-contrib { margin-left:auto; display:grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap:10px; }
.cq-hero .mini-phase-card { min-width: 160px; }

.total-hero .hero-header {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 8px 0;
}
.verdict-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 7px 11px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.verdict-title {
  font-weight: 700;
  color: #e5edff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 12px;
  opacity: 0.8;
}

.verdict-text {
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.total-hero .hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.donut-wrap {
  position: relative;
  width: 86px;
  height: 86px;
}
.donut-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 5px solid var(--donut-color, #22c55e);
  background: rgba(0,0,0,0.2);
  display: grid;
  place-items: center;
}
.donut-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
}
.hero-metric .metric-big {
  font-size: 1.55rem;
  font-weight: 800;
}
.hero-metric {
  max-width: 520px;
}
.hero-metric .metric-sub {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.25;
  padding: 0 8px;
}
.hero-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

/* Phase chips inside hero */
.total-hero .hero-contrib {
  margin-left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 12px;
  justify-items: stretch;
}
.mini-phase-card {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 4px 4px;
  min-width: 160px;
}
.mini-phase-card::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--phase-color, rgba(96,165,250,0.70));
  box-shadow: 0 0 12px rgba(96,165,250,0.20);
  opacity: 0.9;
  pointer-events: none;
}
.mini-phase-card .mini-title { font-weight: 700; }
.mini-phase-card .mini-pill {
  justify-self: end;
  background: #00ff88;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
}
.mini-phase-card .mini-inc {
  grid-column: 1 / -1;
  font-size: 1.05rem;
  font-weight: 800;
}
.mini-phase-card .mini-badge {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}
.mini-phase-card .mini-sub { font-size: 12px; opacity: 0.85; }

/* Compact phase chips for total grade */
.phase-chip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  align-items: center;
  justify-items: center;
}
.phase-chip::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--phase-accent, rgba(96,165,250,0.70));
  box-shadow: 0 0 12px rgba(96,165,250,0.20);
  opacity: 0.9;
  pointer-events: none;
}
.phase-chip .chip-title { font-weight: 800; font-size: 18px; }
.phase-chip .chip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.phase-chip .chip-delta {
  font-size: 16px;
  font-weight: 800;
  min-width: 90px;
  text-align: center;
}
.phase-chip .chip-grade { justify-self: center; min-width: 46px; text-align: center; font-size: 16px; }
.phase-chip .chip-meta { justify-self: center; font-size: 14px; opacity: 0.85; text-align: center; min-width: 90px; }
.phase-chip .chip-grade {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  font-weight: 800;
}
.phase-chip .chip-lowhigh {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  width: 100%;
}
.phase-chip .chip-lowhigh .chip-sep { opacity: 0.9; }
.phase-chip .chip-lowhigh .chip-unit { font-size: 12px; opacity: 0.8; }
.phase-chip.impacts::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 12px;
  border: 1px solid rgba(96,165,250,0.35);
  pointer-events: none;
}
.phase-chip-wrap { display: grid; gap: 10px; }
.phase-chip.pos-download { --phase-accent: rgba(34,197,94,0.85); }
.phase-chip.pos-upload { --phase-accent: rgba(245,158,11,0.85); }
.phase-chip.pos-bidi { --phase-accent: rgba(156,39,176,0.85); }

@media (max-width: 900px) {
  .total-hero .hero-contrib { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 900px) {
  .verdict-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.verdict-title {
  font-weight: 700;
  color: #e5edff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 12px;
  opacity: 0.9;
}

.verdict-text {
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.4;
}

.total-hero .hero-content { align-items: center; text-align: center; justify-items: center; }
  .hero-contrib.phase-chip-wrap { justify-items: center; }
}
@media (max-width: 600px) {
  .total-hero {
    max-width: 480px;
    margin: 0 auto;
  }
  .verdict-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.verdict-title {
  font-weight: 700;
  color: #e5edff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 12px;
  opacity: 0.9;
}

.verdict-text {
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.4;
}

.total-hero .hero-content {
    align-items: center;
    justify-items: center;
    text-align: center;
  }
  .hero-contrib.phase-chip-wrap {
    justify-items: center;
    width: 100%;
  }
}
/* VH tile overrides (must come after mini-phase-card) */
.vh-tile {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.vh-tile.mini-phase-card::after {
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
}
.vh-tile .vh-card-top { flex: 0 0 auto; }
.vh-tile .vh-spark-wrap { flex: 1 1 50%; }
.vh-tile .vh-card-top { padding-left: 16px; padding-right: 12px; }
.vh-tile .vh-spark-wrap { padding-left: 16px; padding-right: 12px; }
.vh-tile .vh-spark-mask { inset: 8px 12px 0 16px; }

/* Phase grade cards (Download/Upload/Bidirectional) */
.phase-grade-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 4px solid var(--phase-color, #3b82f6);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: center;
}
.phase-grade-card .phase-title {
  font-weight: 700;
}
.phase-grade-card .phase-badge {
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}
.phase-grade-card .phase-inc {
  font-size: 1.4rem;
  font-weight: 800;
}

.footer-links {
  text-align: center;
  margin: 18px 0 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.footer-links a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}

/* Mobile-friendly layout tweaks */
@media (max-width: 640px) {
  .results-container { padding: 14px; }
  .total-hero,
  .cq-hero { padding: 14px 12px; }
  .total-hero .hero-header,
  .cq-hero .hero-header { font-size: 1rem; }
  .total-hero .hero-content,
  .cq-hero .hero-content { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .donut-wrap,
  .donut-ring { width: 80px; height: 80px; }
  .donut-ring { border-width: 4px; }
  .donut-inner { width: 54px; height: 54px; font-size: 1.1rem; }
  .hero-metric .metric-big { font-size: 1.3rem; }
  .hero-metric .metric-sub { font-size: 0.85rem; }
  .hero-contrib { width: 100%; display: grid; grid-template-columns: 1fr !important; gap: 8px; justify-items: center; }
  .total-hero .hero-contrib { grid-template-columns: 1fr !important; justify-items: center; }
  .mini-phase-card { min-width: 0; grid-template-columns: 1fr auto; font-size: 0.95rem; }
  .mini-phase-card .mini-inc { font-size: 1.05rem; }
  .mini-phase-card .mini-pill { font-size: 9px; padding: 2px 5px; max-width: 70px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
  .mini-phase-card .mini-sub { font-size: 11px; }
  .hero-chips { flex-direction: column; align-items: flex-start; }
}
.phase-grade-card .phase-sub {
  font-size: 12px;
  opacity: 0.85;
}
.phase-grade-card .phase-pill {
  justify-self: end;
  background: #00ff88;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

/* Hero theming by total grade */
.total-hero.grade-a-plus, .total-hero.grade-a {
  border-color: rgba(34, 197, 94, 0.6);
}
.total-hero.grade-b {
  border-color: rgba(250, 204, 21, 0.6);
}
.total-hero.grade-c {
  border-color: rgba(245, 158, 11, 0.6);
}
.total-hero.grade-d, .total-hero.grade-f {
  border-color: rgba(239, 68, 68, 0.6);
}

@media (max-width: 768px) {
.verdict-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.verdict-title {
  font-weight: 700;
  color: #e5edff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 12px;
  opacity: 0.9;
}

.verdict-text {
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.4;
}

.total-hero .hero-content { flex-direction: column; align-items: center; text-align: center; }
}

.results-container h2 {
    text-align: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    margin: 16px 0;
    line-height: 1.2;
}

/* Total Grade Styles */
.total-grade-container {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.total-grade-box {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.total-grade-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.total-grade-box h2 {
    margin-bottom: 20px;
    color: white;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.total-grade {
    font-size: 72px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    line-height: 1;
}

.total-grade-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-style: italic;
}

/* Individual Grades Section */
.individual-grades-section {
    margin-bottom: 30px;
}

.section-title {
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff; /* White text for better contrast on dark backgrounds */
    font-size: 20px;
    font-weight: bold;
}

.grade-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.grade-box {
    text-align: center;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-width: 150px;
    flex: 1;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.grade-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.grade-box h3 {
    margin-bottom: 15px;
    color: #ffffff; /* White text for dark theme containers */
    font-weight: bold;
}

.grade {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

.approved-img {
    width: 26px; /* Reduced by 25% from 35px (which was already reduced by 30% from 50px) */
    height: auto;
    margin-top: 5px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: bounce-and-sparkle 2s infinite;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
}

@keyframes bounce-and-sparkle {
    0% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
    }
    25% {
        transform: translateY(-5px) scale(1.1);
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
    }
    50% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
    }
    75% {
        transform: translateY(-3px) scale(1.05);
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
    }
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
    }
}

.grade.a-plus {
    color: #2ecc71;
}

.grade.a {
    color: #27ae60;
}

.grade.b {
    color: #f1c40f;
}

.grade.c {
    color: #e67e22;
}

.grade.d {
    color: #e74c3c;
}

.grade.f {
    color: #c0392b;
}

/* Total Grade Color Classes */
.total-grade.a-plus {
    color: #2ecc71;
}

.total-grade.a {
    color: #27ae60;
}

.total-grade.b {
    color: #f1c40f;
}

.total-grade.c {
    color: #e67e22;
}

.total-grade.d {
    color: #e74c3c;
}

.total-grade.f {
    color: #c0392b;
}

/* Total Grade Visual Effects */
.total-grade.a-plus {
    animation: victory-glow 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.8), 0 0 40px rgba(46, 204, 113, 0.6);
}

.total-grade.a {
    animation: excellent-shimmer 2.5s ease-in-out infinite;
    text-shadow: 0 0 15px rgba(39, 174, 96, 0.7), 0 0 30px rgba(39, 174, 96, 0.5);
}

.total-grade.b {
    animation: good-pulse 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.6);
}

.total-grade.c {
    animation: fair-fade 3s ease-in-out infinite;
}

.total-grade.d {
    animation: poor-shake 4s ease-in-out infinite;
}

.total-grade.f {
    animation: failure-fizzle 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(192, 57, 43, 0.8);
}

/* Victory Glow Animation for A+ */
@keyframes victory-glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(46, 204, 113, 0.8), 0 0 40px rgba(46, 204, 113, 0.6);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 30px rgba(46, 204, 113, 1), 0 0 60px rgba(46, 204, 113, 0.8), 0 0 80px rgba(46, 204, 113, 0.6);
        transform: scale(1.05);
    }
}

/* Excellent Shimmer Animation for A */
@keyframes excellent-shimmer {
    0%, 100% {
        text-shadow: 0 0 15px rgba(39, 174, 96, 0.7), 0 0 30px rgba(39, 174, 96, 0.5);
    }
    25% {
        text-shadow: 0 0 20px rgba(39, 174, 96, 0.9), 0 0 40px rgba(39, 174, 96, 0.7);
    }
    75% {
        text-shadow: 0 0 10px rgba(39, 174, 96, 0.5), 0 0 20px rgba(39, 174, 96, 0.3);
    }
}

/* Good Pulse Animation for B */
@keyframes good-pulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(241, 196, 15, 0.6);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 15px rgba(241, 196, 15, 0.8);
        transform: scale(1.02);
    }
}

/* Fair Fade Animation for C */
@keyframes fair-fade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Poor Shake Animation for D */
@keyframes poor-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

/* Failure Fizzle Animation for F */
@keyframes failure-fizzle {
    0%, 100% {
        text-shadow: 0 0 10px rgba(192, 57, 43, 0.8);
        opacity: 1;
    }
    25% {
        text-shadow: 0 0 5px rgba(192, 57, 43, 0.6);
        opacity: 0.9;
    }
    50% {
        text-shadow: 0 0 15px rgba(192, 57, 43, 1);
        opacity: 0.8;
    }
    75% {
        text-shadow: 0 0 3px rgba(192, 57, 43, 0.4);
        opacity: 0.9;
    }
}

/* Enhanced Total Grade Box for Celebrations */
.total-grade-box {
    position: relative;
    overflow: hidden;
}

.total-grade-box.celebration {
    animation: celebration-bounce 1s ease-out;
}

@keyframes celebration-bounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.1);
    }
    60% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Confetti Animation for A/A+ Grades */
.total-grade-box.celebration::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(255, 215, 0, 0.3) 20.5%, rgba(255, 215, 0, 0.3) 40%, transparent 40.5%),
                radial-gradient(circle, transparent 20%, rgba(46, 204, 113, 0.3) 20.5%, rgba(46, 204, 113, 0.3) 40%, transparent 40.5%),
                radial-gradient(circle, transparent 20%, rgba(52, 152, 219, 0.3) 20.5%, rgba(52, 152, 219, 0.3) 40%, transparent 40.5%);
    background-size: 30px 30px, 40px 40px, 35px 35px;
    background-position: 0 0, 15px 15px, 30px 5px;
    animation: confetti-fall 3s ease-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(-100px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(200px) rotate(360deg);
    }
}

/* Sparkle Animation for A+ Grades */
@keyframes sparkle-twinkle {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
        box-shadow: 0 0 0px rgba(255, 255, 255, 0);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
        box-shadow: 0 0 0px rgba(255, 255, 255, 0);
    }
}

/* Total Grade Approved Image */
.total-grade-box .approved-img {
    width: 40px;
    height: auto;
    margin-top: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: bounce-and-sparkle 2s infinite;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.stats-box {
    flex: 1;
    min-width: 250px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto; /* Enable horizontal scrolling */
}

@media (max-width: 768px) {
    .stats-container {
        flex-direction: column;
    }
    
    .stats-box {
        width: 100%;
        min-width: unset;
    }
}

.stats-box h3 {
    margin-bottom: 15px;
    text-align: center;
    color: var(--primary);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.stats-table th,
.stats-table td {
    padding: 8px 4px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.stats-table th {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Mobile optimizations for tables */
@media (max-width: 768px) {
    .stats-table th,
    .stats-table td {
        padding: 6px 3px;
        font-size: 0.9rem;
        text-align: left;
    }
    
    /* Detailed Statistics: keep only Phase, Duration, Increase */
    #statisticsTable .stats-table th:nth-child(3),
    #statisticsTable .stats-table td:nth-child(3),
    #statisticsTable .stats-table th:nth-child(4),
    #statisticsTable .stats-table td:nth-child(4),
    #statisticsTable .stats-table th:nth-child(5),
    #statisticsTable .stats-table td:nth-child(5),
    #statisticsTable .stats-table th:nth-child(6),
    #statisticsTable .stats-table td:nth-child(6),
    #statisticsTable .stats-table th:nth-child(8),
    #statisticsTable .stats-table td:nth-child(8),
    #statisticsTable .stats-table th:nth-child(9),
    #statisticsTable .stats-table td:nth-child(9),
    #statisticsTable .stats-table th:nth-child(10),
    #statisticsTable .stats-table td:nth-child(10),
    #statisticsTable .stats-table th:nth-child(11),
    #statisticsTable .stats-table td:nth-child(11) {
        display: none;
    }
    
    /* Phase and key metrics stack vertically */
    .stats-table {
        table-layout: auto;
    }
    .stats-table th,
    .stats-table td {
        white-space: normal;
    }
}

.additional-stats {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 5px;
}

@media (max-width: 480px) {
    .stat-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.stat-label {
    font-weight: bold;
}

.stat-value.a-plus {
    color: #2ecc71;
}

.stat-value.a {
    color: #27ae60;
}

.stat-value.b {
    color: #f1c40f;
}

.stat-value.c {
    color: #e67e22;
}

.stat-value.d {
    color: #e74c3c;
}

.stat-value.f {
    color: #c0392b;
}

.hidden {
    display: none;
}

/* Results Explanation Styles */
.results-explanation {
    margin-bottom: 30px;
    background-color: var(--secondary);
    border-radius: 8px;
    overflow: hidden;
}

.explanation-toggle {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--primary);
    color: var(--text);
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.3s ease;
}

.explanation-toggle:hover {
    background-color: var(--accent);
}

.toggle-icon {
    font-size: 18px;
}

.toggle-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.explanation-toggle.expanded .toggle-arrow {
    transform: rotate(180deg);
}

.explanation-content {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.02);
}

.explanation-intro {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(75, 108, 151, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
}

.explanation-intro p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.grade-explanations {
    display: block;
    margin: 24px 0 12px 0;
    gap: 0;
}

/* Grid wrapper for the grade meaning cards */
.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: 1.5rem;
    margin-bottom: 0;
}

.grade-explanation {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grade-explanation:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.grade-explanation.a-plus .grade-badge { 
    background: linear-gradient(135deg, #10B981, #34D399); 
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}
.grade-explanation.a .grade-badge { 
    background: linear-gradient(135deg, #34D399, #6EE7B7); 
    box-shadow: 0 4px 15px rgba(52, 211, 153, 0.4);
}
.grade-explanation.b .grade-badge { 
    background: linear-gradient(135deg, #FBBF24, #FCD34D); 
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}
.grade-explanation.c .grade-badge { 
    background: linear-gradient(135deg, #F59E0B, #FBBF24); 
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}
.grade-explanation.d .grade-badge { 
    background: linear-gradient(135deg, #EF4444, #F87171); 
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}
.grade-explanation.f .grade-badge { 
    background: linear-gradient(135deg, #DC2626, #EF4444); 
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.grade-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 1.4rem;
    color: #ffffff !important;
    margin-right: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.grade-badge .grade-letter {
    display: block;
    line-height: 1;
}

/* Reusable grade badge colors (shared with hero) */
.grade-badge.a-plus {
    background: linear-gradient(135deg, #10B981, #34D399);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}
.grade-badge.a {
    background: linear-gradient(135deg, #34D399, #6EE7B7);
    box-shadow: 0 4px 15px rgba(52, 211, 153, 0.4);
}
.grade-badge.b {
    background: linear-gradient(135deg, #FBBF24, #FCD34D);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}
.grade-badge.c {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}
.grade-badge.d {
    background: linear-gradient(135deg, #EF4444, #F87171);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}
.grade-badge.f {
    background: linear-gradient(135deg, #DC2626, #EF4444);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

/* Total hero grade badge (match Grade Meanings style, but larger) */
.grade-badge-hero {
    width: 92px;
    height: 92px;
    margin: 2px 0 0 0;
    margin-right: 0;
    font-size: 3.2rem;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.32));
}
.grade-badge-hero.a-plus {
    font-size: 2.8rem;
    letter-spacing: -0.04em;
}

.explanation-footer {
    padding: 15px;
    background-color: rgba(75, 108, 151, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
}

.explanation-footer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Mobile responsiveness for explanations */
@media (max-width: 768px) {
    .explanation-toggle {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .explanation-content {
        padding: 15px;
    }

    .grade-explanation {
        padding: 12px;
    }

    .grade-explanation .grade-badge {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-right: 1rem;
    }
    
    .grade-description h4 {
        font-size: 16px;
    }
    
    .grade-description p {
        font-size: 13px;
    }
    
    .explanation-intro p {
        font-size: 14px;
    }
    
    .explanation-footer p {
        font-size: 13px;
    }
}

/* Total Grade Explanation Styles */
.total-grade-explanation-section,
.individual-grades-explanation-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(75, 108, 151, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
}

.total-grade-explanation-section h4,
.individual-grades-explanation-section h4 {
    margin: 0 0 10px 0;
    color: var(--primary);
    font-size: 18px;
}

.total-grade-explanation-section p,
.individual-grades-explanation-section p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

/* Mobile responsiveness for Total Grade */
@media (max-width: 768px) {
    .total-grade-box {
        min-width: 250px;
        padding: 20px;
    }
    
    .total-grade-box h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .total-grade {
        font-size: 60px;
    }
    
    .total-grade-description {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .total-grade-explanation-section h4,
    .individual-grades-explanation-section h4 {
        font-size: 16px;
    }
    
    .total-grade-explanation-section p,
    .individual-grades-explanation-section p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .total-grade-box {
        min-width: 200px;
        padding: 15px;
    }
    
    .total-grade-box h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .total-grade {
        font-size: 48px;
    }
    
    .total-grade-description {
        font-size: 13px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .total-grade-explanation-section,
    .individual-grades-explanation-section {
        padding: 12px;
    }
    
    .total-grade-explanation-section h4,
    .individual-grades-explanation-section h4 {
        font-size: 15px;
    }
    
    .total-grade-explanation-section p,
    .individual-grades-explanation-section p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .explanation-toggle {
        padding: 10px 12px;
        font-size: 13px;
        gap: 8px;
    }
    
    .toggle-icon {
        font-size: 16px;
    }
    
    .explanation-content {
        padding: 12px;
    }
    
    .grade-explanation {
        padding: 10px;
    }
    
    .grade-badge {
        font-size: 18px;
        min-width: 30px;
        padding: 6px;
    }
}

/* Stream debug UI styles */
.stream-debug {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 300px;
    max-height: 200px;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    font-size: 10px;
    font-family: monospace;
    z-index: 9999;
    border-radius: 5px;
    display: none; /* Hidden by default, shown when debug mode is enabled */
}

.stream-event {
    padding: 2px 4px;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
}

.stream-event.created {
    border-left-color: var(--success);
}

.stream-event.terminated {
    border-left-color: var(--error);
}

.stream-event.reset {
    border-left-color: #ff00ff;
    background-color: rgba(255, 0, 0, 0.3);
}

.debug-toggle {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    font-family: monospace;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s;
}

.debug-toggle:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.debug-toggle-container {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px;
    border-radius: 5px;
    color: white;
    font-family: monospace;
    font-size: 12px;
}

/* Footer styles */
footer {
    text-align: center;
    margin-top: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--primary);
}

footer p {
    margin: 5px 0;
}

footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 0.8;
}

.heart {
    color: #e74c3c;
    display: inline-block;
}

/* Grade Tooltip Styles */
.grade-tooltip {
    position: absolute;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.9);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.grade-tooltip.hidden {
    opacity: 0;
    pointer-events: none;
}

.tooltip-header {
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--primary);
}

.tooltip-content {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.tooltip-content strong {
    color: var(--text);
    font-weight: bold;
}


/* Mobile responsiveness for tooltips */
@media (max-width: 768px) {
    .grade-tooltip {
        font-size: 13px;
        padding: 10px 12px;
        max-width: 250px;
    }
    
    .tooltip-header {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .tooltip-content {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .grade-tooltip {
        font-size: 12px;
        padding: 8px 10px;
        max-width: 200px;
    }
    
    .tooltip-header {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .tooltip-content {
        font-size: 11px;
    }
}

/* Share Button Styles */
.share-container {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px 0;
}

.share-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.share-scale-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-weight: 600;
}

.share-scale-label {
    font-size: 14px;
}

.share-scale-select {
    background: rgba(10, 10, 10, 0.6);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
}

.share-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.share-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    border: 1px solid var(--primary-strong);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
}

.share-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
}

.share-btn.secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.share-icon {
    font-size: 18px;
}

/* Mobile responsiveness for share buttons */
@media (max-width: 768px) {
    .share-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .share-scale-control {
        justify-content: space-between;
        width: 100%;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Shareable content container for PNG generation */
.shareable-content {
    background-color: var(--background);
    padding: 25px;
    border-radius: 12px;
    width: 500px;
    margin: 0 auto;
    box-sizing: border-box;
}

.shareable-content .total-grade-container {
    margin-bottom: 25px;
}

.shareable-content .individual-grades-section {
    margin-bottom: 20px;
}

.shareable-content .grade-container {
    justify-content: center;
    gap: 15px;
}

.shareable-content .grade-box {
    flex: none;
    min-width: 140px;
    max-width: 140px;
}

.shareable-content .share-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== VIRTUAL HOUSEHOLD MODE STYLES ===== */

/* Mode Toggle Styles */
.mode-toggle {
    background: var(--secondary);
    border: 1px solid var(--primary);
    border-radius: 25px;
    padding: 4px;
    display: flex;
    gap: 4px;
    z-index: 100;
    margin: 5px auto 30px auto;
    width: fit-content;
}

.mode-option {
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
}

.mode-option:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.mode-option.active {
    background: var(--primary);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(75, 108, 151, 0.3);
}

.mode-icon {
    font-size: 16px;
}

.mode-text {
    white-space: nowrap;
}

/* Mobile responsiveness for mode toggle */
@media (max-width: 768px) {
    .mode-toggle {
        margin: 15px auto 25px auto;
    }
    
    .mode-option {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .mode-icon {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .mode-text {
        display: none;
    }
    
    .mode-option {
        padding: 8px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }
    
    .mode-icon {
        font-size: 18px;
    }
}

/* Household Container */
.household-container {
    background-color: var(--secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.household-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.household-controls .btn.primary {
    margin-bottom: 20px;
}

.household-status {
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

/* Test Progress Container - Controls spacing for progress bar and text */
.test-progress-container {
    margin: 10px 0 5px 0;
    width: 100%;
}

.progress-bar-container {
    margin-bottom: 8px;
}

.progress-text {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* User Cards Grid */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.user-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.user-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(75, 108, 151, 0.3);
}

.dscp-tag {
    position: absolute;
    top: 8px;
    right: 12px;
    background: var(--primary);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}


.user-icon.gamer {
    background: rgba(46, 204, 113, 0.1);
    border-color: #2ecc71;
}

.user-icon.worker {
    background: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
}

.user-icon.streamer {
    background: rgba(155, 89, 182, 0.1);
    border-color: #9b59b6;
}

.user-icon.downloader {
    background: rgba(230, 126, 34, 0.1);
    border-color: #e67e22;
}


.user-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.metric-value {
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
}

.user-status {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 15px;
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.user-status.warning {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.3);
}

.user-status.error {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.sparkline {
    width: 100%;
    height: 40px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

/* Timeline Chart */
.timeline-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
}

.timeline-container h3 {
    margin: 0 0 20px 0;
    text-align: center;
    color: var(--primary);
    font-size: 18px;
}

#householdTimelineChart {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Household Results */
.household-results {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.household-results h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 24px;
}

.overall-performance {
    margin-bottom: 40px;
}

.overall-performance h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text);
    font-size: 20px;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.performance-card {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.performance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.performance-card h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--text);
}

.performance-grade {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1;
}

.performance-card p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* User Results */
.user-results {
    margin-bottom: 40px;
}

.user-results h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text);
    font-size: 20px;
}

.user-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.user-result-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.user-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.user-result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.user-result-header .user-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
}

.user-result-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}

.user-result-grade {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1;
}

.user-result-card p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* Grade Colors for Performance and User Results */
.performance-grade.a-plus,
.user-result-grade.a-plus {
    color: #2ecc71;
}

.performance-grade.a,
.user-result-grade.a {
    color: #27ae60;
}

.performance-grade.b,
.user-result-grade.b {
    color: #f1c40f;
}

.performance-grade.c,
.user-result-grade.c {
    color: #e67e22;
}

.performance-grade.d,
.user-result-grade.d {
    color: #e74c3c;
}

.performance-grade.f,
.user-result-grade.f {
    color: #c0392b;
}

/* Recommendations */
.recommendations h3 {
    text-align: center;
    margin: 0 0 1.5rem;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation-item {
    background: rgba(75, 108, 151, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 15px;
}

.recommendation-item.warning {
    background: rgba(241, 196, 15, 0.1);
    border-left-color: #f1c40f;
}

.recommendation-item.error {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
}

.recommendation-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--text);
}

.recommendation-item p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* Mobile Responsiveness for Household Mode */
@media (max-width: 768px) {
    .household-container {
        padding: 15px;
    }
    
    .user-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .user-card {
        padding: 15px;
    }
    
    .user-header {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .user-icon {
        font-size: 28px;
        width: 45px;
        height: 45px;
    }
    
    .user-info h3 {
        font-size: 16px;
    }
    
    .performance-grid,
    .user-results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .performance-card,
    .user-result-card {
        padding: 15px;
    }
    
    .performance-grade,
    .user-result-grade {
        font-size: 32px;
    }
    
    .timeline-container {
        padding: 15px;
    }
    
    #householdTimelineChart {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .household-container {
        padding: 10px;
    }
    
    .user-card {
        padding: 12px;
    }
    
    .user-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .user-icon {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
    
    .user-info h3 {
        font-size: 15px;
    }
    
    .user-info p {
        font-size: 13px;
    }
    
    .performance-grade,
    .user-result-grade {
        font-size: 28px;
    }
    
    .timeline-container {
        padding: 12px;
    }
    
    #householdTimelineChart {
        height: 200px;
    }
    
    .household-results h2 {
        font-size: 20px;
    }
    
    .overall-performance h3,
    .user-results h3,
    .recommendations h3 {
        font-size: 18px;
    }
}

/* ===== HOUSEHOLD FLOORPLAN STYLES ===== */

/* Virtual Users Container */
.virtual-users {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px;
}


/* Users Sections */
.users-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 1100px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 10px;
}

/* Give all-rooms layout more space within the container */
.floor-section.all-rooms {
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 8px;
    padding-right: 8px;
}

.floor-label {
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--primary);
    font-weight: bold;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Ensure all 4 users stay in the same row */
.users-section .users-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: auto;
}

.users-section .user-card {
    min-width: 0; /* Allow cards to shrink below 300px if needed */
    padding: 18px;
}

/* Responsive adjustments - keep 4 columns until very small screens */
@media (max-width: 1200px) {
    .users-grid {
        gap: 12px;
    }
    
    .users-section .user-card {
        padding: 16px;
    }
}

@media (max-width: 1000px) {
    .users-grid {
        gap: 10px;
    }
    
    .users-section .user-card {
        padding: 14px;
    }
}

/* Only break to 2x2 on very small screens */
@media (max-width: 768px) {
    .users-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Single column only on mobile */
@media (max-width: 480px) {
    .users-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* User Cards */
.user-card {
    position: relative;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    border-radius: 15px;
    z-index: 0;
}

.user-card > * {
    position: relative;
    z-index: 1;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.user-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(75, 108, 151, 0.4);
}

/* User-Specific Themes */
.user-card[data-user="gamer"] {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.05));
    border-color: rgba(46, 204, 113, 0.3);
}

.user-card[data-user="gamer"]::before {
    background: radial-gradient(circle at 20% 80%, #2ecc71 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #27ae60 0%, transparent 50%);
}

.user-card[data-user="worker"] {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.05));
    border-color: rgba(52, 152, 219, 0.3);
}

.user-card[data-user="worker"]::before {
    background: radial-gradient(circle at 20% 80%, #3498db 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #2980b9 0%, transparent 50%);
}

.user-card[data-user="streamer"] {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1), rgba(142, 68, 173, 0.05));
    border-color: rgba(155, 89, 182, 0.3);
}

.user-card[data-user="streamer"]::before {
    background: radial-gradient(circle at 20% 80%, #9b59b6 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #8e44ad 0%, transparent 50%);
}

.user-card[data-user="downloader"] {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.1), rgba(211, 84, 0, 0.05));
    border-color: rgba(230, 126, 34, 0.3);
}

.user-card[data-user="downloader"]::before {
    background: radial-gradient(circle at 20% 80%, #e67e22 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #d35400 0%, transparent 50%);
}

/* User Header */
.user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(75, 108, 151, 0.2);
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: var(--text);
}

.user-info p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.room-icon {
    font-size: 24px;
    margin-right: 10px;
}

.room-title {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
}

.dscp-tag {
    position: absolute;
    top: 4px;
    right: 12px;
    background: var(--primary);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Family Member */
.family-member {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.member-avatar {
    font-size: 32px;
    margin-right: 15px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.member-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--text);
}

.member-info p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Activity Info */
.activity-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
}

.activity-icon {
    font-size: 20px;
    margin-right: 10px;
}

.activity-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* User Metrics */
.user-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.user-metrics .metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.user-metrics .metric-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.user-metrics .metric-value {
    font-size: 13px;
    font-weight: bold;
    color: var(--text);
    transition: color 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* Color-coded performance indicators */
.metric-value.ping-excellent {
    color: #2ecc71 !important;
    text-shadow: 0 0 4px rgba(46, 204, 113, 0.3);
}

.metric-value.ping-good {
    color: #f1c40f !important;
    text-shadow: 0 0 4px rgba(241, 196, 15, 0.3);
}

.metric-value.ping-fair {
    color: #e67e22 !important;
    text-shadow: 0 0 4px rgba(230, 126, 34, 0.3);
}

.metric-value.ping-poor {
    color: #e74c3c !important;
    text-shadow: 0 0 4px rgba(231, 76, 60, 0.3);
}

/* Jitter color coding */
.metric-value.jitter-excellent {
    color: #2ecc71 !important;
}

.metric-value.jitter-good {
    color: #f1c40f !important;
}

.metric-value.jitter-fair {
    color: #e67e22 !important;
}

.metric-value.jitter-poor {
    color: #e74c3c !important;
}

/* Loss color coding */
.metric-value.loss-excellent {
    color: #2ecc71 !important;
}

.metric-value.loss-good {
    color: #f1c40f !important;
}

.metric-value.loss-fair {
    color: #e67e22 !important;
}

.metric-value.loss-poor {
    color: #e74c3c !important;
}

/* Progress bar styles for throughput */
.metric-progress-container {
    margin-top: 8px;
    width: 100%;
    clear: both;
}

.metric-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.metric-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 3px;
    transition: width 0.3s ease-out;
    position: relative;
}

.metric-progress-fill.download {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.metric-progress-fill.upload {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Improved spacing for throughput metrics */
.metric-download,
.metric-upload {
    flex-direction: column;
    align-items: flex-start;
}

.metric-download .metric-label,
.metric-upload .metric-label {
    margin-bottom: 2px;
}

.metric-download .metric-value,
.metric-upload .metric-value {
    margin-bottom: 4px;
    align-self: flex-end;
}

/* Removed animated progress bar effect for cleaner appearance */

/* Health indicator icons */
.health-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    animation: health-pulse 2s infinite;
}

.health-indicator.excellent {
    color: #2ecc71;
}

.health-indicator.good {
    color: #f1c40f;
}

.health-indicator.fair {
    color: #e67e22;
}

.health-indicator.poor {
    color: #e74c3c;
    animation: health-alert 1s infinite;
}

@keyframes health-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes health-alert {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Enhanced Family Status */
.family-status {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 15px;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 2px solid rgba(46, 204, 113, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
}

.family-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.family-status:hover::before {
    left: 100%;
}

.family-status.warning {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.4);
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.2);
}

.family-status.error {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.4);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
    animation: status-alert 2s infinite;
}

.family-status.excellent {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.4);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
    animation: status-excellent 3s infinite;
}

.family-status.good {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.family-status.fair {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.4);
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.2);
}

.family-status.poor {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
    border-color: rgba(230, 126, 34, 0.4);
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.2);
    animation: status-warning 1.5s infinite;
}

/* Status message animations */
@keyframes status-excellent {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
        border-color: rgba(46, 204, 113, 0.4);
    }
    50% {
        box-shadow: 0 4px 16px rgba(46, 204, 113, 0.4);
        border-color: rgba(46, 204, 113, 0.6);
    }
}

@keyframes status-warning {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(230, 126, 34, 0.2);
    }
    50% {
        box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
    }
}

@keyframes status-alert {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
        transform: scale(1.02);
    }
}

/* Status icon indicators */
.status-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 16px;
    animation: icon-pulse 2s infinite;
}

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



/* Sparkline in User Cards */
.user-card .sparkline {
    width: 100%;
    height: 40px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

/* Mobile Responsiveness for Virtual Users */
@media (max-width: 768px) {
    .virtual-users {
        padding: 15px;
    }
    
    .users-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    /* Keep 2x2 grid on tablets */
    .users-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .user-card {
        padding: 15px;
    }
    
    .family-member {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .member-avatar {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .virtual-users {
        padding: 10px;
    }
    
    /* Single column on mobile */
    .users-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .user-card {
        padding: 12px;
    }
    
    .user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .room-title {
        font-size: 16px;
    }
    
    .member-avatar {
        font-size: 28px;
        width: 45px;
        height: 45px;
    }
    
    .member-info h4 {
        font-size: 15px;
    }
    
    .member-info p {
        font-size: 13px;
    }
}

/* ===== SENTIMENT SYSTEM STYLES ===== */

/* Sentiment color classes for dynamic status messages */
.sentiment-excellent {
    color: #2ecc71 !important;
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.sentiment-good {
    color: #27ae60 !important;
    text-shadow: 0 0 6px rgba(39, 174, 96, 0.3);
}

.sentiment-fair {
    color: #f1c40f !important;
    text-shadow: 0 0 4px rgba(241, 196, 15, 0.3);
}

.sentiment-poor {
    color: #e67e22 !important;
    text-shadow: 0 0 4px rgba(230, 126, 34, 0.3);
}

.sentiment-terrible {
    color: #e74c3c !important;
    text-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}

/* Smooth transitions for sentiment changes */
.family-status .status-text {
    transition: color 0.3s ease, opacity 0.3s ease, text-shadow 0.3s ease;
}

/* Enhanced sentiment animations for excellent performance */
.sentiment-excellent {
    animation: excellent-glow 3s ease-in-out infinite;
}

@keyframes excellent-glow {
    0%, 100% {
        text-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
    }
    50% {
        text-shadow: 0 0 12px rgba(46, 204, 113, 0.6), 0 0 16px rgba(46, 204, 113, 0.3);
    }
}

/* Subtle pulse for good performance */
.sentiment-good {
    animation: good-pulse 4s ease-in-out infinite;
}

@keyframes good-pulse {
    0%, 100% {
        text-shadow: 0 0 6px rgba(39, 174, 96, 0.3);
    }
    50% {
        text-shadow: 0 0 8px rgba(39, 174, 96, 0.4);
    }
}

/* Warning flicker for poor performance */
.sentiment-poor {
    animation: poor-flicker 2s ease-in-out infinite;
}

@keyframes poor-flicker {
    0%, 100% {
        text-shadow: 0 0 4px rgba(230, 126, 34, 0.3);
        opacity: 1;
    }
    25% {
        text-shadow: 0 0 6px rgba(230, 126, 34, 0.5);
        opacity: 0.9;
    }
    75% {
        text-shadow: 0 0 2px rgba(230, 126, 34, 0.2);
        opacity: 0.95;
    }
}

/* Alert pulse for terrible performance */
.sentiment-terrible {
    animation: terrible-alert 1.5s ease-in-out infinite;
}

@keyframes terrible-alert {
    0%, 100% {
        text-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 10px rgba(231, 76, 60, 0.6), 0 0 14px rgba(231, 76, 60, 0.3);
        transform: scale(1.02);
    }
}

/* ===== 4x2 GRID SENTIMENT SYSTEM ===== */

/* Sentiment Grid - Bottom Row */
.sentiment-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin-top: 20px !important;
}

/* Base sentiment container styling */
#gamerSentiment,
#workerSentiment,
#streamerSentiment,
#downloaderSentiment {
    padding: 12px 16px !important;
    border-radius: 12px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border: 2px solid !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.9 !important;
    box-sizing: border-box !important;
}

.sentiment-text {
    font-style: italic !important;
    line-height: 1.3 !important;
    color: inherit !important;
}

/* User-specific sentiment colors using IDs for higher specificity */
#gamerSentiment {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.3)) !important;
    border-color: rgba(46, 204, 113, 0.6) !important;
    color: #22c55e !important;
}

#workerSentiment {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(52, 152, 219, 0.3)) !important;
    border-color: rgba(52, 152, 219, 0.6) !important;
    color: #3498db !important;
}

#streamerSentiment {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(155, 89, 182, 0.3)) !important;
    border-color: rgba(155, 89, 182, 0.6) !important;
    color: #9b59b6 !important;
}

#downloaderSentiment {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.2), rgba(230, 126, 34, 0.3)) !important;
    border-color: rgba(230, 126, 34, 0.6) !important;
    color: #e67e22 !important;
}

/* Hover effects for sentiment containers */
.sentiment-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gamer-sentiment:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.25), rgba(46, 204, 113, 0.35));
    border-color: rgba(46, 204, 113, 0.5);
}

.worker-sentiment:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.25), rgba(52, 152, 219, 0.35));
    border-color: rgba(52, 152, 219, 0.5);
}

.streamer-sentiment:hover {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.25), rgba(155, 89, 182, 0.35));
    border-color: rgba(155, 89, 182, 0.5);
}

.downloader-sentiment:hover {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.25), rgba(230, 126, 34, 0.35));
    border-color: rgba(230, 126, 34, 0.5);
}

/* Responsive sentiment grid */
@media (max-width: 768px) {
    .sentiment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 15px;
    }
    
    #gamerSentiment,
    #workerSentiment,
    #streamerSentiment,
    #downloaderSentiment {
        padding: 10px 12px !important;
        font-size: 13px !important;
        min-height: 45px !important;
    }
}

@media (max-width: 480px) {
    .sentiment-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    #gamerSentiment,
    #workerSentiment,
    #streamerSentiment,
    #downloaderSentiment {
        padding: 8px 10px !important;
        font-size: 12px !important;
        min-height: 40px !important;
    }
}

/* Mobile responsiveness for sentiment animations */
@media (max-width: 768px) {
    .sentiment-excellent,
    .sentiment-good,
    .sentiment-poor,
    .sentiment-terrible {
        animation: none; /* Disable animations on mobile for better performance */
    }
    
    .family-status .status-text {
        transition: color 0.2s ease, opacity 0.2s ease;
    }
}

/* =============================================================================
   MODE-AWARE RESULTS MANAGEMENT
   Ensures strict separation between Single User and Virtual Household results
   ============================================================================= */

/* Hide Virtual Household results when in Single User mode */
.single-user-mode #householdResults,
.single-user-mode .household-results,
.single-user-mode .virtual-household-results {
    display: none !important;
    visibility: hidden !important;
}

/* Hide Single User results when in Virtual Household mode */
.virtual-household-mode #results,
.virtual-household-mode .single-user-results,
.virtual-household-mode .test-results:not(.household-results) {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure proper visibility for active mode results */
.single-user-mode #results {
    display: block !important;
    visibility: visible !important;
}

.virtual-household-mode #householdResults {
    display: block !important;
    visibility: visible !important;
}

/* Additional safety - hide any cross-contamination but preserve mode toggles */
.single-user-mode [class*="household"]:not(.mode-option):not(.mode-toggle),
.single-user-mode [id*="household"]:not(#householdMode) {
    display: none !important;
}

.virtual-household-mode [class*="single-user"]:not(.mode-option):not(.mode-toggle),
.virtual-household-mode [id*="single-user"]:not(#singleUserMode) {
    display: none !important;
}
/* Throughput Boxes */
.throughput-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.throughput-box {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.throughput-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.download-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    border: 1px solid #10b981;
}

.upload-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    border: 1px solid #f59e0b;
}

.throughput-box h3 {
    color: #ffffff;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.throughput-value {
    color: #ffffff;
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.latency-increase {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin: 0;
}

/* Mobile responsiveness for throughput boxes */
@media (max-width: 768px) {
    .throughput-boxes {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .throughput-box {
        padding: 1rem;
    }
    
    .throughput-value {
        font-size: 1.5rem;
    }
}


.verdict-panel { width: 100%; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.verdict-title { font-weight: 700; color: #e5edff; text-transform: uppercase; letter-spacing: 0.02em; font-size: 13px; opacity: 0.9; }
.verdict-text { color: #dbeafe; font-size: 15px; line-height: 1.4; }
.charts-panel { margin: 12px 0 16px; }
.accordion { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 12px; margin: 12px 0; overflow: hidden; }
.accordion summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; color: #e5edff; font-weight: 700; font-size: 14px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '▾'; font-size: 12px; opacity: 0.85; transition: transform 0.2s ease; }
.accordion[open] summary::after { transform: rotate(180deg); }
.accordion .accordion-body { padding: 0 16px 14px 16px; }
@media (max-width: 768px) { .verdict-text { font-size: 13px; } .accordion summary { font-size: 13px; padding: 11px 14px; } }
