/* Insights uses the shared homepage palette, spacing and form controls. */
.insights-intro {
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}
.insights-intro > div { max-width: 710px; }
.insights-intro .button-secondary { flex-shrink: 0; }
.insights-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line, #dce5e8);
  border-radius: 8px;
  background: white;
}
.insights-controls > div { min-width: 0; }
.insights-controls label {
  display: block;
  color: var(--ink, #122b39);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px;
}
.insights-controls select {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 8px 24px 8px 11px;
  border: 1px solid #ccd8dd;
  border-radius: 5px;
  background: white;
  color: var(--ink, #122b39);
  font: inherit;
  font-size: 13px;
}
.insights-controls select:focus { border-color: var(--teal, #007c72); }
.insights-page .insights-status {
  margin: 18px 0;
  color: var(--muted, #536875);
  font-size: 12px;
}
.insights-status:empty { display: none; }
.insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.insight-card,
.insights-page .panel {
  min-width: 0;
  background: white;
  border: 1px solid var(--line, #dce5e8);
  border-radius: 8px;
}
.insight-card { padding: 24px; }
.stat-label {
  color: var(--muted, #536875);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.stat-value {
  margin-top: 10px;
  color: var(--ink, #122b39);
  font-size: 29px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.insight-card:first-child .stat-value { color: var(--teal, #007c72); }
.insights-page .stat-note {
  margin: 10px 0 0;
  color: var(--muted, #536875);
  font-size: 12px;
  line-height: 1.65;
}
.insights-page .panel { margin: 24px 0; padding: 28px; }
.insights-page .panel h2 { font-size: 22px; margin-bottom: 8px; }
.insights-page .panel p { font-size: 13px; }
.insights-page .panel > p:last-child { margin-bottom: 0; }
.insights-page .panel-note { margin: 0 0 20px; color: var(--muted, #536875); }
#dashboard > .panel:first-child { background: #edf5f3; border-color: #d5e5df; }
#dashboard > .panel:first-child h2 { font-size: 19px; }
.mini-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--line, #dce5e8);
  padding: 15px 14px;
  text-align: left;
  vertical-align: top;
  color: var(--ink, #122b39);
  font-size: 13px;
}
.mini-table thead th {
  background: #ebf1f3;
  color: var(--muted, #536875);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.mini-table tbody th { font-weight: 600; width: 32%; }
.mini-table tbody tr:nth-child(even) { background: #fbfcfd; }
.mini-table tbody tr:last-child > * { border-bottom: 0; }
.mobile-stat-label { display: none; }
.bar-list { display: grid; gap: 18px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) minmax(90px, auto);
  align-items: center;
  gap: 18px;
  font-size: 13px;
}
.bar-row strong { font-weight: 600; }
.bar-row > span { color: var(--muted, #536875); text-align: right; }
.bar-track { background: #e6edef; border-radius: 4px; height: 9px; overflow: hidden; }
.bar-fill { background: #285565; height: 100%; min-width: 5px; border-radius: inherit; }
.bar-row.teal .bar-fill { background: var(--teal, #007c72); }
.split-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.insights-page .split-panels .panel { margin: 0; }
.method-box { padding-top: 8px; }
.insights-page .method-box p { font-size: 13px; line-height: 1.75; }
.method-box p:last-child { margin-bottom: 0; }
.insights-page .empty-state,
.insights-page .loading,
.insights-page .error {
  padding: 28px;
  border: 1px solid var(--line, #dce5e8);
  border-radius: 8px;
  background: white;
  color: var(--muted, #536875);
  text-align: center;
  font-size: 14px;
  font-style: normal;
}
.insights-page .loading,
.insights-page .error { margin-top: 24px; }
.insights-page .error { color: #873a2a; background: #fff4f0; border-color: #e7b0a0; }
.insights-page .error p { color: inherit; font-size: 14px; margin: 8px 0 16px; }
.insights-controls select:focus-visible,
.insights-retry:focus-visible { outline: 3px solid #009f91; outline-offset: 4px; }
#dashboard[hidden], #loading[hidden], #error[hidden], #insights-controls[hidden] { display: none; }

@media (max-width: 1050px) {
  .insights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights-intro { gap: 24px; }
  .insights-intro > div { max-width: 580px; }
}
@media (max-width: 780px) {
  .insights-intro { align-items: flex-start; flex-direction: column; gap: 18px; }
  .insights-intro > div { max-width: none; }
  .insights-controls { padding: 20px; gap: 14px; }
  .insights-controls select { font-size: 16px; }
  .insights-page .panel { padding: 22px; }
  .insights-page .panel h2 { font-size: 20px; }
  .split-panels { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  .mini-table,
  .mini-table thead,
  .mini-table tbody,
  .mini-table tr,
  .mini-table th,
  .mini-table td { display: block; }
  .mini-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .mini-table tbody tr {
    border: 1px solid var(--line, #dce5e8);
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
  }
  .mini-table tbody tr:last-child { margin-bottom: 0; }
  .mini-table tbody tr:nth-child(even) { background: white; }
  .mini-table tbody th {
    width: 100%;
    padding: 12px 14px;
    background: #ebf1f3;
    border: 0;
  }
  .mini-table td {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    padding: 10px 14px;
    border: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
  }
  .mini-table td > span:last-child { text-align: right; }
  .mobile-stat-label { display: inline; color: var(--muted, #536875); font-weight: 500; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  .insights-controls { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; gap: 12px; }
  .insight-card { padding: 20px; }
  .insights-page .panel { padding: 20px; }
  .insights-page .insights-status { line-height: 1.75; }
}
