.analysis-stats{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  margin:18px 0 24px;
}

.analysis-stats section{
  margin:0;
  padding:20px;
  text-align:center;
}

.analysis-stats strong{
  display:block;
  font-size:clamp(1.65rem,4vw,2.4rem);
  line-height:1;
  letter-spacing:-.04em;
}

.analysis-stats span{
  display:block;
  margin-top:8px;
  color:var(--muted);
  font-size:.82rem;
}

.analysis-generate{
  margin-bottom:24px;
}

.analysis-notice{
  margin-top:18px;
  padding:16px 18px;
  border-radius:10px;
  background:#fff7ed;
  color:#9a3412;
}

.analysis-notice p{
  margin:5px 0 0;
}

.analysis-empty{
  text-align:center;
  padding:36px 20px;
}

.analysis-report{
  margin:24px 0 36px;
  padding:0;
  overflow:hidden;
}

.analysis-report-head{
  margin:0;
  padding:20px 24px;
  border-bottom:1px solid #e7eaf0;
}

.analysis-report-head h2{
  margin:0;
}

.analysis-report-head p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:.86rem;
}

.analysis-report-content{
  max-width:900px;
  padding:28px clamp(20px,5vw,42px) 38px;
}

.analysis-report-content h2{
  margin:36px 0 14px;
  padding-bottom:10px;
  border-bottom:1px solid #e7eaf0;
  font-size:1.55rem;
  letter-spacing:-.025em;
}

.analysis-report-content h2:first-child{
  margin-top:0;
}

.analysis-report-content h3{
  margin:28px 0 10px;
  font-size:1.25rem;
}

.analysis-report-content h4{
  margin:22px 0 8px;
}

.analysis-report-content p{
  margin:10px 0;
  line-height:1.7;
}

.analysis-report-content ul{
  margin:10px 0 20px;
  padding-left:24px;
}

.analysis-report-content li{
  margin:7px 0;
  line-height:1.6;
}

.analysis-report-meta{
  padding:14px 24px;
  border-top:1px solid #e7eaf0;
  color:var(--muted);
  font-size:.78rem;
}

@media(max-width:900px){
  .analysis-stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:520px){
  .analysis-stats{
    grid-template-columns:1fr 1fr;
  }

  .analysis-report-head{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* ==========================================================
   AI REPORT MARKDOWN RENDERING
   ========================================================== */

.analysis-report-content{
  color:var(--ink);
}

.analysis-report-content > p{
  max-width:850px;
}

.analysis-report-content strong{
  font-weight:750;
}

.analysis-report-content em{
  font-style:italic;
}

.analysis-report-content code{
  padding:2px 6px;
  border-radius:5px;
  background:#f1f3f7;
  font:0.9em ui-monospace,SFMono-Regular,Menlo,monospace;
}

.analysis-report-content hr{
  margin:36px 0;
  border:0;
  border-top:1px solid #e6e9ef;
}

.analysis-report-content ol,
.analysis-report-content ul{
  max-width:850px;
  padding-left:26px;
}

.analysis-report-content ol{
  list-style:decimal;
}

.analysis-report-content ul{
  list-style:disc;
}

.analysis-report-content li{
  padding-left:3px;
}

.analysis-table-wrap{
  width:100%;
  margin:18px 0 28px;
  overflow-x:auto;
  border:1px solid #e2e6ed;
  border-radius:12px;
}

.analysis-table{
  width:100%;
  min-width:560px;
  border-collapse:collapse;
  background:#fff;
}

.analysis-table th,
.analysis-table td{
  padding:13px 15px;
  border-bottom:1px solid #e8ebf0;
  text-align:left;
  vertical-align:top;
  line-height:1.5;
}

.analysis-table th{
  background:#f7f8fa;
  font-size:.84rem;
  font-weight:750;
}

.analysis-table td{
  font-size:.92rem;
}

.analysis-table tbody tr:last-child td{
  border-bottom:0;
}

.analysis-table tbody tr:hover td{
  background:#fafbfc;
}

@media(max-width:640px){
  .analysis-report-content{
    padding-left:18px;
    padding-right:18px;
  }

  .analysis-table th,
  .analysis-table td{
    padding:11px 12px;
  }
}


/* ==========================================================
   COHORT REPORT TABLES V3
   ========================================================== */

.analysis-table-wrap{
  width:100%;
  margin:18px 0 30px;
  overflow-x:auto;
  border:1px solid #dde2e9;
  border-radius:12px;
  background:#fff;
}

.analysis-table{
  width:100%;
  min-width:520px;
  border-collapse:collapse;
  border-spacing:0;
}

.analysis-table thead{
  background:#f5f6f8;
}

.analysis-table th{
  padding:13px 16px;
  border-right:1px solid #e4e7ec;
  border-bottom:2px solid #dfe3e9;
  color:var(--ink);
  font-size:.82rem;
  font-weight:750;
  text-align:left;
  vertical-align:bottom;
  white-space:normal;
}

.analysis-table td{
  padding:13px 16px;
  border-right:1px solid #edf0f3;
  border-bottom:1px solid #e7eaee;
  color:var(--ink);
  font-size:.91rem;
  line-height:1.5;
  text-align:left;
  vertical-align:top;
}

.analysis-table th:last-child,
.analysis-table td:last-child{
  border-right:0;
}

.analysis-table tbody tr:last-child td{
  border-bottom:0;
}

.analysis-table tbody tr:nth-child(even) td{
  background:#fafbfc;
}

.analysis-table .align-right{
  text-align:right;
}

.analysis-table .align-center{
  text-align:center;
}

.analysis-table td.align-right{
  font-variant-numeric:tabular-nums;
}

@media(max-width:640px){
  .analysis-table{
    min-width:480px;
  }

  .analysis-table th,
  .analysis-table td{
    padding:11px 12px;
  }
}


/* ==========================================================
   STRUCTURED HTML REPORT
   ========================================================== */

.structured-report{
  max-width:960px;
}

.report-document-title{
  margin:0 0 22px;
  font-size:1.85rem;
  letter-spacing:-.035em;
}

.report-summary{
  max-width:860px;
  font-size:1.02rem;
  line-height:1.75;
}

.report-section{
  margin-top:34px;
}

.report-section > h2{
  margin:0 0 16px;
  padding-bottom:10px;
  border-bottom:1px solid #e4e5ea;
  font-size:1.45rem;
  letter-spacing:-.025em;
}

.report-subsection{
  margin:25px 0 10px;
}

.report-subsection h3{
  margin-bottom:10px;
  font-size:1.12rem;
}

.structured-report p{
  max-width:880px;
  margin:9px 0 13px;
  line-height:1.7;
}

.structured-report ul{
  max-width:850px;
  margin:9px 0 20px;
  padding-left:25px;
}

.structured-report li{
  margin:7px 0;
  line-height:1.6;
}


/* REAL HTML TABLES */

.report-table-wrap{
  width:100%;
  margin:16px 0 28px;
  overflow-x:auto;
  border:1px solid #dedfe5;
  border-radius:12px;
  background:#fff;
}

.report-table{
  width:100%;
  min-width:540px;
  border-collapse:collapse;
  border-spacing:0;
}

.report-table th{
  padding:13px 15px;
  border-right:1px solid #e3e4e9;
  border-bottom:2px solid #dadce2;
  background:#f5f5f7;
  text-align:left;
  vertical-align:bottom;
  font-size:.84rem;
  font-weight:750;
}

.report-table td{
  padding:13px 15px;
  border-right:1px solid #ececf0;
  border-bottom:1px solid #e6e7eb;
  text-align:left;
  vertical-align:top;
  line-height:1.5;
  font-size:.91rem;
}

.report-table th:last-child,
.report-table td:last-child{
  border-right:0;
}

.report-table tbody tr:last-child td{
  border-bottom:0;
}

.report-table tbody tr:nth-child(even) td{
  background:#fafafa;
}

.analysis-legacy{
  padding:26px;
}

.analysis-legacy pre{
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  margin-top:20px;
}

@media(max-width:640px){
  .report-table{
    min-width:480px;
  }
}
