/* Apple-inspired presentation layer for diagnostics and local rules.
   Deliberately more specific than the styles emitted by insights.js. */
.insight-page.insight-page {
  --it: var(--apple-accent, #007aff);
  --ink: var(--apple-text, #1d1d1f);
  --line: var(--apple-line, #e8e8ed);
  min-width: 0;
  color: var(--apple-text, #1d1d1f);
  font-family: inherit;
  animation-duration: 320ms;
}
.insight-page .insight-top { margin-bottom: 28px; gap: 24px; }
.insight-page .insight-eyebrow {
  color: #6e6e73;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
}
.insight-page .insight-eyebrow i {
  background: #007aff;
  box-shadow: 0 0 0 4px #007aff0d;
}
.insight-page .insight-top h1 {
  color: #1d1d1f;
  font-size: clamp(28px, 2.6vw, 34px);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.2;
}
.insight-page .insight-top p { color: #6e6e73; font-size: 13px; }
.insight-demo.insight-demo {
  color: #0066cc;
  background: #edf5ff;
  border-color: #dceaff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
}
.insight-page .insight-banner {
  background: #fff;
  border: 1px solid #e8e8ed;
  border-radius: 14px;
  color: #6e6e73;
  font-size: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px #00000002;
}
.insight-page .insight-banner svg { color: #007aff; }
.insight-page .insight-stats { gap: 16px; margin-bottom: 28px; }
.insight-page .insight-stat {
  background: #fff;
  border-color: #e8e8ed;
  border-radius: 20px;
  padding: 22px 23px;
  box-shadow: 0 2px 8px #00000002;
}
.insight-page .insight-stat-label { color: #6e6e73; font-size: 12px; }
.insight-page .insight-stat-label svg { color: #86868b; }
.insight-page .insight-stat-number {
  color: #1d1d1f;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.045em;
  margin-top: 13px;
}
.insight-page .insight-stat-number em { color: #6e6e73; font-size: 12px; }
.insight-page .insight-stat-sub { color: #6e6e73; font-size: 11px; }
.insight-page .insight-stat-sub strong { color: #c65b00; }
.insight-page .insight-stat.teal { background: #fff; border-color: #e8e8ed; }
.insight-page .insight-stat.teal:after { display: none; }
.insight-page .insight-stat.teal .insight-stat-label,
.insight-page .insight-stat.teal .insight-stat-sub,
.insight-page .insight-stat.teal .insight-stat-number em { color: #6e6e73; }
.insight-page .insight-stat.teal .insight-stat-label svg,
.insight-page .insight-stat.teal .insight-stat-number { color: #007aff; }
.insight-page .insight-tools { gap: 16px; margin-bottom: 20px; }
.insight-page .insight-tabs {
  max-width: 100%;
  min-width: 0;
  padding: 4px;
  gap: 3px;
  background: #e9e9ee;
  border-radius: 11px;
  overflow-x: auto;
  scrollbar-width: none;
}
.insight-page .insight-tabs::-webkit-scrollbar { display: none; }
.insight-page .insight-tab {
  min-height: 34px;
  flex-shrink: 0;
  color: #6e6e73;
  border-radius: 8px;
  padding: 8px 13px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.insight-page .insight-tab span { font-size: 11px; }
.insight-page .insight-tab:hover { background: #ffffff80; color: #1d1d1f; }
.insight-page .insight-tab.active {
  color: #1d1d1f;
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px #00000012;
}
.insight-page .insight-tools-note { color: #6e6e73; font-size: 11px; }
.insight-page .insight-grid { gap: 20px; }
.insight-page .insight-card {
  min-width: 0;
  border-radius: 20px;
  border-color: #e8e8ed;
  background: #fff;
  box-shadow: 0 2px 8px #00000002;
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), box-shadow 240ms ease, border-color 240ms ease;
}
.insight-page .insight-card:hover {
  transform: translateY(-2px);
  border-color: #d7d7dc;
  box-shadow: 0 10px 26px #00000006;
}
.insight-page .insight-card-body { padding: 24px; }
.insight-card-icon.insight-card-icon {
  border-radius: 12px;
  background: #edf5ff;
  color: #007aff;
}
.insight-card-icon.insight-card-icon.coral { color: #d84b34; background: #fff0ed; }
.insight-card-icon.insight-card-icon.amber { color: #b86b00; background: #fff6e7; }
.insight-card-icon.insight-card-icon.blue { color: #007aff; background: #edf5ff; }
.insight-priority.insight-priority {
  font-size: 11px;
  color: #b75019;
  background: #fff5eb;
  border-color: #f7e8d8;
  border-radius: 999px;
  padding: 5px 9px;
}
.insight-priority.insight-priority.opportunity {
  color: #248044;
  background: #edf8ef;
  border-color: #dcefe0;
}
.insight-priority.insight-priority.watch {
  color: #0066cc;
  background: #edf5ff;
  border-color: #dceaff;
}
.insight-page .insight-card-title {
  color: #1d1d1f;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.insight-page .insight-card-description { color: #6e6e73; font-size: 13px; }
.insight-page .insight-scope { color: #6e6e73; font-size: 11px; line-height: 1.7; }
.insight-page .insight-comparison { border-color: #eeeeef; padding: 18px 0; }
.insight-page .insight-metric-name { color: #6e6e73; font-size: 11px; }
.insight-page .insight-metric-value { color: #1d1d1f; font-weight: 600; letter-spacing: -.035em; }
.insight-page .insight-metric-change { color: #c44332; background: #fff0ed; border-radius: 7px; }
.insight-page .insight-metric-change.good { color: #248044; background: #edf8ef; }
.insight-page .insight-comparison-side { border-color: #eeeeef; color: #6e6e73; font-size: 11px; }
.insight-page .insight-comparison-side strong { color: #424245; font-weight: 500; }
.insight-page .insight-card-evidence { color: #6e6e73; font-size: 11px; }
.insight-page .insight-card-evidence svg { color: #007aff; }
.insight-page .insight-card-footer {
  padding: 14px 24px;
  border-color: #eeeeef;
  background: #fafafa;
  gap: 12px;
}
.insight-confidence.insight-confidence { color: #6e6e73; font-size: 11px; }
.insight-confidence.insight-confidence:before { background: #a1a1a6; }
.insight-detail-link.insight-detail-link {
  color: #007aff;
  font: inherit;
  font-size: 12px;
  min-height: 30px;
}
.insight-page .insight-footnote { color: #6e6e73; font-size: 11px; }
.insight-page .insight-rule-panel { border-color: #e8e8ed; border-radius: 20px; background: #fff; }
.insight-page .insight-rule-panel-head { padding: 22px 24px; border-color: #eeeeef; }
.insight-page .insight-rule-panel-head h2,
.insight-page .insight-log-head h2 { color: #1d1d1f; font-size: 15px; font-weight: 600; }
.insight-page .insight-rule-panel-head p,
.insight-page .insight-log-head span { color: #6e6e73; font-size: 11px; line-height: 1.6; }
.insight-page .insight-rule-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.insight-page .insight-rule-table { min-width: 920px; font-size: 12px; }
.insight-page .insight-rule-table th { color: #6e6e73; font-size: 11px; background: #fafafa; padding: 14px 20px; }
.insight-page .insight-rule-table td { color: #424245; border-color: #eeeeef; padding: 20px; }
.insight-page .insight-rule-table tbody tr:hover { background: #f8fbff; }
.insight-page .insight-rule-name .insight-card-icon { background: #edf5ff; color: #007aff; border-radius: 10px; }
.insight-page .insight-rule-name strong { color: #1d1d1f; font-size: 13px; font-weight: 600; }
.insight-page .insight-rule-name small { color: #6e6e73; font-size: 11px; }
.insight-page .insight-rule-condition { color: #424245; background: #f5f5f7; border-radius: 7px; padding: 6px 8px; }
.insight-page .insight-rule-cell-note { color: #6e6e73; font-size: 11px; }
.insight-page .insight-switch { width: 36px; height: 22px; padding: 2px; background: #d1d1d6; }
.insight-page .insight-switch:after { width: 18px; height: 18px; box-shadow: 0 1px 3px #00000020; }
.insight-page .insight-switch.on { background: #007aff; }
.insight-page .insight-switch.on:after { transform: translateX(14px); }
.insight-page .insight-state-text { color: #6e6e73; font-size: 11px; }
.insight-page .insight-state-text.on { color: #248044; }
.insight-page .insight-small-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #6e6e73;
}
.insight-page .insight-small-icon:hover { color: #007aff; background: #edf5ff; }
.insight-page .insight-log-section { margin-top: 28px; }
.insight-page .insight-log-empty { color: #6e6e73; background: #fff; border-color: #dedee3; border-radius: 16px; }
.insight-log-line.insight-log-line {
  color: #6e6e73;
  font-size: 12px;
  border-color: #eeeeef;
  gap: 12px;
  background: #fff;
}
.insight-log-line.insight-log-line:first-child { border-radius: 16px 16px 0 0; }
.insight-log-line.insight-log-line:last-child { border-radius: 0 0 16px 16px; }
.insight-log-time.insight-log-time { color: #6e6e73; font-size: 11px; }
.insight-log-result.insight-log-result { color: #248044; background: #edf8ef; font-size: 11px; border-radius: 6px; }
.insight-log-result.insight-log-result.skipped { color: #6e6e73; background: #f5f5f7; }
.insight-log-text.insight-log-text strong { color: #424245; }
.insight-drawer-intro.insight-drawer-intro { border-color: #e8e8ed; border-radius: 16px; background: #f5f5f7; }
.insight-drawer-intro.insight-drawer-intro p { color: #6e6e73; font-size: 13px; }
.insight-section-label.insight-section-label { color: #1d1d1f; font-size: 13px; font-weight: 600; }
.insight-detail-table.insight-detail-table { color: #424245; border-color: #e8e8ed; border-radius: 12px; }
.insight-detail-table.insight-detail-table th { background: #f5f5f7; color: #6e6e73; font-size: 11px; }
.insight-detail-table.insight-detail-table td { color: #424245; border-color: #eeeeef; font-size: 12px; }
.insight-detail-table.insight-detail-table td.good { color: #248044; }
.insight-detail-table.insight-detail-table td.bad { color: #c44332; }
.insight-detail-table.insight-detail-table td.neutral { color: #6e6e73; }
.insight-evidence-note.insight-evidence-note { color: #6e6e73; font-size: 11px; line-height: 1.8; }
.insight-explanation.insight-explanation { color: #6e6e73; font-size: 13px; }
.insight-recommendations.insight-recommendations li { color: #6e6e73; font-size: 13px; }
.insight-recommendations.insight-recommendations li:before { color: #007aff; font-size: 11px; }
.insight-drawer-actions.insight-drawer-actions { border-color: #e8e8ed; gap: 10px; }
.insight-form.insight-form { gap: 20px; font-family: inherit; }
.insight-form.insight-form label { color: #424245; font-size: 13px; font-weight: 500; }
.insight-form.insight-form input,
.insight-form.insight-form select {
  min-width: 0;
  min-height: 44px;
  border-color: #d2d2d7;
  border-radius: 10px;
  color: #1d1d1f;
  background: #fff;
  font: inherit;
  font-size: 13px;
  padding: 11px 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.insight-form.insight-form input::placeholder { color: #86868b; }
.insight-form.insight-form input:focus,
.insight-form.insight-form select:focus { border-color: #007aff; box-shadow: 0 0 0 4px #007aff1a; }
.insight-form.insight-form small { color: #6e6e73; font-size: 11px; }
.insight-form-row.insight-form-row > div { min-width: 0; }
.insight-form-condition.insight-form-condition { grid-template-columns: minmax(0,1fr) 86px minmax(0,1fr); }
.insight-form-notice.insight-form-notice { color: #6e6e73; background: #f5f5f7; border-color: #e8e8ed; border-radius: 12px; font-size: 12px; padding: 14px; }
.insight-form-error.insight-form-error { color: #c44332; background: #fff0ed; border-radius: 10px; font-size: 12px; }
.insight-form-actions.insight-form-actions { gap: 10px; padding-top: 8px; }
.insight-execution-summary.insight-execution-summary { gap: 12px; }
.insight-execution-summary.insight-execution-summary div { background: #f5f5f7; border-color: #e8e8ed; border-radius: 16px; }
.insight-execution-summary.insight-execution-summary strong { color: #1d1d1f; font-size: 28px; font-weight: 600; }
.insight-execution-summary.insight-execution-summary span { color: #6e6e73; font-size: 11px; }
.insight-log-modal.insight-log-modal { border-color: #e8e8ed; border-radius: 14px; }
.insight-page .insight-no-results { color: #6e6e73; border-color: #dedee3; border-radius: 20px; }
.insight-draft-row.insight-draft-row { border-color: #e8e8ed; border-radius: 16px; padding: 20px; background: #fff; }
.insight-draft-meta.insight-draft-meta { color: #6e6e73; font-size: 11px; }
.insight-draft-meta.insight-draft-meta .insight-demo { font-size: 11px; }
.insight-draft-row.insight-draft-row h3 { color: #1d1d1f; font-size: 15px; font-weight: 600; }
.insight-draft-row.insight-draft-row p { color: #6e6e73; font-size: 12px; }
.insight-draft-snapshot.insight-draft-snapshot { border-color: #e8e8ed; border-radius: 14px; padding: 18px; gap: 12px; }
.insight-draft-snapshot.insight-draft-snapshot dt { color: #6e6e73; }
.insight-draft-snapshot.insight-draft-snapshot dd { color: #424245; }
.insight-draft-warning.insight-draft-warning { color: #9f5c00; background: #fff6e7; border-color: #f1e2c6; border-radius: 12px; font-size: 12px; }
.insight-draft-back.insight-draft-back { color: #007aff; font: inherit; font-size: 12px; min-height: 32px; }
.insight-page button:focus-visible,
.insight-draft-back.insight-draft-back:focus-visible { outline: 3px solid #007aff40; outline-offset: 3px; }
@media (max-width: 1150px) {
  .insight-page .insight-stat { padding: 20px; }
  .insight-page .insight-rule-table th,
  .insight-page .insight-rule-table td { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 800px) {
  .insight-page .insight-top { gap: 12px; }
  .insight-page .insight-top-actions { flex-wrap: wrap; max-width: 100%; }
  .insight-page .insight-stats { gap: 12px; }
  .insight-page .insight-grid { gap: 16px; }
  .insight-page .insight-card-description { min-height: 0; }
}
@media (max-width: 480px) {
  .insight-page .insight-top h1 { font-size: 28px; }
  .insight-page .insight-top-actions { gap: 8px; }
  .insight-page .insight-stats { gap: 10px; }
  .insight-page .insight-stat { padding: 18px 15px; border-radius: 18px; }
  .insight-page .insight-stat-number { font-size: 29px; }
  .insight-page .insight-stat-number em { display: inline-block; margin-left: 4px; font-size: 11px; }
  .insight-page .insight-tools { display: block; }
  .insight-page .insight-tabs { width: fit-content; }
  .insight-page .insight-tab { padding: 8px 10px; }
  .insight-page .insight-tab span { margin-left: 4px; }
  .insight-page .insight-card-body { padding: 20px; }
  .insight-page .insight-card-top { gap: 10px; }
  .insight-page .insight-card-footer { padding: 12px 20px; }
  .insight-page .insight-comparison { flex-wrap: wrap; gap: 10px 12px; }
  .insight-page .insight-comparison-side { flex-basis: 100%; border-left: 0; padding-left: 0; }
  .insight-page .insight-rule-panel-head { padding: 20px; flex-wrap: wrap; }
  .insight-page .insight-small-icon { width: 38px; height: 38px; }
  .insight-page .insight-footnote { overflow-wrap: anywhere; }
  .insight-form-row.insight-form-row { grid-template-columns: 1fr; gap: 18px; }
  .insight-form-condition.insight-form-condition { grid-template-columns: minmax(0,1fr) 82px; }
  .insight-form-condition.insight-form-condition input { grid-column: 1 / -1; }
  .insight-form-actions.insight-form-actions,
  .insight-drawer-actions.insight-drawer-actions { flex-wrap: wrap; }
  .insight-form-actions.insight-form-actions > .btn,
  .insight-drawer-actions.insight-drawer-actions > .btn { flex: 1 1 130px; }
  .insight-execution-summary.insight-execution-summary { gap: 8px; }
  .insight-execution-summary.insight-execution-summary div { padding: 13px 10px; border-radius: 12px; }
  .insight-execution-summary.insight-execution-summary strong { font-size: 25px; }
  .insight-log-line.insight-log-line { flex-wrap: wrap; padding: 14px; gap: 8px; }
  .insight-log-text.insight-log-text { flex-basis: 100%; }
  .insight-detail-table.insight-detail-table th,
  .insight-detail-table.insight-detail-table td { padding: 11px 8px; font-size: 11px; }
  .insight-draft-snapshot.insight-draft-snapshot { grid-template-columns: 56px minmax(0,1fr); padding: 15px; gap: 10px; }
  .insight-section-label.insight-section-label { flex-wrap: wrap; }
}
@media (hover: none) {
  .insight-page .insight-card:hover { transform: none; box-shadow: 0 2px 8px #00000002; }
}
@media (prefers-reduced-motion: reduce) {
  .insight-page.insight-page { animation: none; }
  .insight-page .insight-card,
  .insight-page .insight-tab,
  .insight-page .insight-switch,
  .insight-page .insight-switch:after,
  .insight-form.insight-form input,
  .insight-form.insight-form select { transition: none; }
  .insight-page .insight-card:hover { transform: none; }
}
