/* Content intelligence workspace. All values come from the existing analysis. */
#traffic-overview-panel { padding: 26px; border-radius: 16px; }
#traffic-overview-panel > summary { font-size: 19px; color: #18243c; font-weight: 700; }
#traffic-overview-panel[open] > summary { margin-bottom: 22px; }
#traffic-overview-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px; border: 1px solid #e4e9f1; border-radius: 12px; background: #f8fafc; }
#traffic-overview-form > label { font-size: 14px; color: #43516a; margin: 0; font-weight: 600; }
#traffic-overview-form select { width: 158px; margin: 0; background: #fff; font-size: 14px; }
#traffic-overview-form > .muted { flex: 1; min-width: 220px; font-size: 13px; margin: 0; color: #62718a; line-height: 1.7; }
#traffic-overview-load { min-height: 42px; padding: 9px 18px; border-color: #cbd4e3; background: #fff; color: #253757; font-size: 14px; font-weight: 600; }
#traffic-overview-load:hover:not(:disabled) { border-color: #087f70; color: #087f70; background: #f1faf7; }
#traffic-overview-dates { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
#traffic-overview-dates[hidden] { display: none; }
#traffic-overview-dates label { font-size: 13px; color: #62718a; margin: 0; }
#traffic-overview-dates input { width: 155px; margin: 0; font-size: 14px; }
#traffic-overview-message { min-height: 22px; font-size: 13px; color: #62718a; margin: 14px 0; }
#traffic-overview-result { min-width: 0; }
#traffic-overview-result[aria-busy=true] { opacity: .62; transition: opacity .15s; }
#traffic-overview-result[aria-busy=true]:empty { min-height: 310px; border-radius: 14px; background: linear-gradient(100deg, #f0f3f8 20%, #fafbfd 40%, #f0f3f8 60%); background-size: 200% 100%; animation: analytics-loading 1.8s ease-in-out infinite; }
.analytics-scopebar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 2px 0 18px; }
.analytics-scope-label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #62718a; }
.analytics-scope-tag { display: inline-flex; align-items: center; border: 1px solid #dfe5ee; border-radius: 7px; padding: 4px 10px; color: #263b59; background: #fff; font-weight: 600; }
#traffic-overview-result .analytics-reference { font-size: 12px; line-height: 1.6; margin: 0; color: #62718a; }
#traffic-overview-result .analytics-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; }
#traffic-overview-result .analytics-stat { display: flex; flex-direction: column; position: relative; gap: 12px; padding: 20px; border: 1px solid #e0e6ef; border-radius: 13px; background: #fff; box-shadow: 0 3px 12px #18243c03; min-width: 0; overflow: hidden; }
#traffic-overview-result .analytics-stat[data-metric=reads] { border-color: #c4d2ff; background: linear-gradient(135deg, #f0f4ff, #fff 88%); }
.analytics-stat-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: #4a5c77; line-height: 1.5; }
.analytics-stat-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: #edf3f7; color: #62718a; font-size: 12px; font-weight: 700; }
.analytics-stat[data-metric=reads] .analytics-stat-icon { background: #e0e8ff; color: #4263eb; }
.analytics-stat[data-metric=articles] .analytics-stat-icon { background: #def4ed; color: #087f70; }
.analytics-stat[data-metric=interactions] .analytics-stat-icon { background: #fff0dc; color: #a7670a; }
#traffic-overview-result .analytics-stat > strong { font-size: clamp(27px, 2.35vw, 37px); line-height: 1.2; letter-spacing: -1.15px; font-weight: 750; color: #18243c; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#traffic-overview-result .analytics-stat[data-metric=reads] > strong { color: #3458d9; }
#traffic-overview-result .analytics-stat-compact, #traffic-overview-result .analytics-stat-exact { display: none; }
#traffic-overview-result .analytics-stat-exact { font-size: 12px; color: #62718a; font-variant-numeric: tabular-nums; line-height: 1.5; }
#traffic-overview-result .analytics-stat-hint { font-size: 12px; line-height: 1.7; color: #62718a; margin: 0; }
.analytics-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; min-width: 0; }
.analytics-dashboard .traffic-figure { min-width: 0; margin: 0; padding: 24px 24px 18px; background: #fff; border: 1px solid #dfe5ee; border-radius: 14px; box-shadow: 0 3px 12px #18243c03; }
.traffic-figure .trend-heading { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; font-size: 18px; color: #18243c; line-height: 1.5; }
.trend-heading .trend-eyebrow { font-size: 12px; color: #62718a; font-weight: 500; letter-spacing: .2px; }
.trend-heading strong { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.traffic-figure .trend-description { font-size: 13px; line-height: 1.8; color: #62718a; margin: 0 0 20px; }
.trend-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.trend-segments { display: inline-flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid #e2e7ef; border-radius: 9px; background: #f3f6fa; }
.trend-segments button { min-height: 34px; border: 0; padding: 6px 13px; border-radius: 6px; background: transparent; color: #62718a; font-size: 13px; font-weight: 500; line-height: 1.5; white-space: nowrap; box-shadow: none; }
.trend-segments button[aria-pressed=true] { background: #fff; color: #3458d9; box-shadow: 0 1px 5px #18243c14; font-weight: 700; }
.trend-segments button:hover:not(:disabled) { background: #e8edfb; color: #3458d9; }
.trend-inspector { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; row-gap: 2px; align-items: baseline; padding: 15px 18px; margin: 0 0 12px; min-height: 88px; background: #f6f8fd; border: 1px solid #e8edf6; border-radius: 10px; }
.trend-selected-date { grid-column: 1/-1; font-size: 13px; color: #62718a; letter-spacing: .1px; }
.trend-selected-value { font-size: 32px; line-height: 1.4; font-weight: 750; letter-spacing: -.8px; color: #263f8e; font-variant-numeric: tabular-nums; }
.trend-selected-context { font-size: 12px; color: #62718a; min-width: 0; line-height: 1.8; }
.trend-date-navigation { grid-column: 1/-1; display: flex; gap: 8px; justify-content: flex-end; padding-top: 7px; }
.trend-date-navigation button { min-height: 32px; padding: 4px 10px; font-size: 12px; color: #43516a; background: #fff; border: 1px solid #dce3ef; border-radius: 6px; font-weight: 500; }
.trend-date-navigation button:hover:not(:disabled) { color: #3458d9; border-color: #a9b9ee; background: #edf2ff; }
.trend-date-navigation button:disabled { opacity: .45; cursor: default; }
.traffic-figure svg { display: block; width: 100%; height: auto; min-height: 220px; overflow: visible; }
.traffic-figure .chart-grid { stroke: #e8edf4; stroke-width: 1; stroke-dasharray: 4 5; }
.traffic-figure .chart-label { font-family: inherit; font-size: 20px; fill: #66758c; font-variant-numeric: tabular-nums; }
.traffic-figure .chart-bar { fill: #b9c8fa; cursor: pointer; transition: fill .12s; }
.traffic-figure .chart-bar[data-active=true], .traffic-figure .chart-bar:hover { fill: #4263eb; }
.traffic-figure .chart-unknown { fill: #b5bfcd; cursor: pointer; }
.traffic-figure [role=button]:focus-visible { outline: 2px solid #4263eb; outline-offset: 4px; }
.chart-selection-band { fill: #4263eb09; pointer-events: none; }
.chart-selection-guide { stroke: #899fe9; stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.chart-hit-target { stroke: transparent; fill: none; pointer-events: stroke; cursor: pointer; }
.trend-line { fill: none; stroke: #4263eb; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trend-area { fill: #4263eb0d; stroke: none; }
.trend-point { fill: #fff; stroke: #4263eb; stroke-width: 2; cursor: pointer; }
.trend-point[data-active=true] { fill: #4263eb; stroke-width: 3; }
.trend-point-unknown { fill: #b5bfcd; stroke: #94a2b6; cursor: pointer; }
.trend-legend { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 12px; color: #62718a; margin: 8px 0 14px; padding-top: 6px; }
.trend-known-key, .trend-unknown-key { display: inline-flex; align-items: center; gap: 7px; }
.trend-known-key:before, .trend-unknown-key:before { content: ''; width: 9px; height: 9px; display: inline-block; border-radius: 3px; background: #4263eb; }
.trend-unknown-key:before { background: #b5bfcd; }.trend-help { margin-left: auto; color: #62718a; }
.traffic-figure .trend-range { font-size: 12px; color: #62718a; line-height: 1.8; margin: 0 0 14px; }
.traffic-figure .chart-data { font-size: 13px; border-color: #e4e9f1; padding-top: 14px; overflow-x: auto; }
.traffic-figure .chart-data summary { color: #3458d9; cursor: pointer; min-height: 34px; display: list-item; font-weight: 600; }
.traffic-figure .chart-data table { font-size: 13px; width: 100%; margin-top: 14px; border-collapse: collapse; white-space: nowrap; }
.traffic-figure .chart-data th { font-weight: 600; font-size: 12px; color: #62718a; background: #f5f7fb; text-align: left; }
.traffic-figure .chart-data th, .traffic-figure .chart-data td { padding: 12px 10px; border-bottom: 1px solid #e8edf4; }
.traffic-figure .chart-data td { color: #3d4e69; font-variant-numeric: tabular-nums; }
.traffic-figure .chart-data caption { font-size: 12px; text-align: left; margin: 8px 0 12px; color: #62718a; }
.analytics-context { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.analytics-context-card { padding: 22px; border: 1px solid #dfe5ee; border-radius: 14px; background: #fff; min-width: 0; }
.analytics-context-card h3 { font-size: 17px; margin: 0 0 18px; font-weight: 700; color: #18243c; line-height: 1.5; }
.analytics-context-card > p { font-size: 13px; color: #62718a; line-height: 1.8; margin: 12px 0 0; }
.analytics-context-card > .analytics-card-kicker { color: #62718a; font-size: 12px; margin: 0 0 5px; font-weight: 500; }
.analytics-context-card .coverage-count { margin: 3px 0 18px; line-height: 1.8; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.coverage-count strong { font-size: 32px; color: #087f70; font-weight: 750; letter-spacing: -.9px; font-variant-numeric: tabular-nums; }
.coverage-count > span { font-size: 13px; color: #62718a; }
.coverage-meter { width: 100%; height: 8px; display: block; border: 0; accent-color: #087f70; overflow: hidden; border-radius: 5px; }
.coverage-meter::-webkit-progress-bar { background: #e6edf0; }.coverage-meter::-webkit-progress-value { background: #087f70; border-radius: 5px; }
.analytics-context-card .analytics-comparison-empty { font-size: 13px; line-height: 1.9; color: #62718a; margin-top: 12px; padding: 14px; border: 1px dashed #dce3ee; background: #f8fafc; border-radius: 9px; }
.analytics-insight { padding: 15px 0; border-top: 1px solid #e8edf4; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; }
.analytics-insight > span { font-size: 13px; color: #43516a; }.analytics-insight > strong { font-size: 19px; color: #18243c; font-variant-numeric: tabular-nums; font-weight: 700; }
.analytics-insight[data-direction=up] > strong { color: #087f70; }.analytics-insight[data-direction=down] > strong { color: #be4c38; }
.analytics-insight > p { grid-column: 1/-1; font-size: 12px; color: #62718a; margin: 0; line-height: 1.8; }
.analytics-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; margin: 22px 0 0; align-items: start; }
.analytics-ranking { padding: 24px; border: 1px solid #dfe5ee; border-radius: 14px; background: #fff; min-width: 0; }
.analytics-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.analytics-section-heading h3 { margin: 0; font-size: 18px; font-weight: 700; color: #18243c; }
.analytics-section-tag { padding: 3px 8px; font-size: 11px; font-weight: 700; color: #62718a; border-radius: 5px; border: 1px solid #e1e7f0; background: #f6f8fc; white-space: nowrap; }
.analytics-section-note { font-size: 13px; color: #62718a; margin: 8px 0 18px; line-height: 1.8; }
.analytics-ranking-list { margin: 0; padding: 0; list-style: none; }
.analytics-ranking-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 0; border-top: 1px solid #e8edf4; }
.analytics-rank { font-size: 13px; color: #8794a8; font-weight: 700; font-variant-numeric: tabular-nums; }.analytics-ranking-row:first-child .analytics-rank { color: #087f70; }
.analytics-ranking-content { min-width: 0; }.analytics-ranking-content > strong { display: block; font-size: 14px; line-height: 1.8; font-weight: 600; color: #253757; overflow-wrap: anywhere; }
.analytics-ranking-content > span { display: block; font-size: 12px; color: #62718a; margin: 3px 0 0; }
.analytics-ranking-value { text-align: right; min-width: 75px; }.analytics-ranking-value > strong { display: block; font-size: 19px; color: #3458d9; font-weight: 700; font-variant-numeric: tabular-nums; }.analytics-ranking-value > span { display: block; font-size: 11px; color: #62718a; margin-top: 2px; }
.analytics-ranking-empty { padding: 25px 18px; border: 1px dashed #dce3ee; background: #f8fafc; border-radius: 10px; }.analytics-ranking-empty > strong { display: block; font-size: 14px; color: #43516a; font-weight: 600; }.analytics-ranking-empty > p { font-size: 13px; color: #62718a; margin: 8px 0 0; line-height: 1.8; }
.analytics-data-notes { margin: 22px 0 0; padding: 15px 18px; border: 1px solid #dfe5ee; border-radius: 11px; background: #f8fafc; font-size: 13px; color: #62718a; }.analytics-data-notes summary { font-size: 13px; color: #43516a; cursor: pointer; font-weight: 600; }.analytics-data-notes p { font-size: 13px; line-height: 1.9; margin: 12px 0 0; }
.traffic-figure .chart-empty { padding: 56px 20px; text-align: center; border: 1px dashed #d7dfeb; background: #f8fafc; border-radius: 11px; margin: 20px 0 4px; }.chart-empty strong { display: block; font-size: 17px; color: #43516a; margin-bottom: 10px; font-weight: 650; }.chart-empty p { font-size: 14px; line-height: 1.9; color: #62718a; margin: 0; }
#traffic-reports-panel { margin-top: 24px; }#traffic-reports-panel > summary { font-size: 18px; color: #18243c; }#traffic-report-form label, #traffic-report-form select, #traffic-report-form button { font-size: 14px; }
#traffic-report-list .task { padding: 18px; border: 1px solid #dfe5ee; border-radius: 10px; background: #f8fafc; }#traffic-report-list .task strong { font-size: 15px; color: #253757; }#traffic-report-list .task p { font-size: 13px; line-height: 1.8; color: #62718a; }#traffic-report-list .task a { color: #3458d9; font-size: 14px; font-weight: 600; }
@keyframes analytics-loading { to { background-position: -200% 0; } }
/* Desktop prioritizes the plot: controls share its heading, and the selected
   record sits immediately below the graph. Mobile keeps its stacked reading order. */
@media (min-width: 1101px) {
  #traffic-overview-panel { padding: 20px; }
  #traffic-overview-panel[open] > summary { margin-bottom: 14px; padding-bottom: 12px; }
  #traffic-overview-form { padding: 10px 12px; }
  #traffic-overview-message { margin: 8px 0; min-height: 21px; }
  .analytics-scopebar { gap: 8px; margin-bottom: 12px; }
  #traffic-overview-result .analytics-totals { margin-bottom: 16px; gap: 14px; }
  #traffic-overview-result .analytics-stat { gap: 8px; padding: 16px; }
  .analytics-stat-icon { width: 26px; height: 26px; }
  #traffic-overview-result .analytics-stat > strong { font-size: 32px; }
  .analytics-dashboard .traffic-figure { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 20px; }
  .traffic-figure .trend-heading { grid-column: 1; grid-row: 1; align-self: center; gap: 3px; margin: 0; }
  .traffic-figure .trend-toolbar { grid-column: 2; grid-row: 1; flex-wrap: nowrap; gap: 9px; align-self: center; margin: 0; }
  .traffic-figure .trend-description { grid-column: 1/-1; grid-row: 2; margin: 10px 0 14px; }
  .traffic-figure > svg { grid-column: 1/-1; grid-row: 3; min-width: 0; }
  .traffic-figure .trend-inspector { grid-column: 1/-1; grid-row: 4; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; padding: 11px 14px; min-height: 0; margin: 12px 0 0; }
  .trend-inspector .trend-selected-date { grid-column: 1/3; grid-row: 1; }
  .trend-inspector .trend-selected-value { grid-column: 1; grid-row: 2; font-size: 28px; }
  .trend-inspector .trend-selected-context { grid-column: 2; grid-row: 2; }
  .trend-inspector .trend-date-navigation { grid-column: 3; grid-row: 1/3; align-self: center; padding-top: 0; }
  .traffic-figure .trend-legend { grid-column: 1/-1; grid-row: 5; margin: 12px 0 8px; }
  .traffic-figure .trend-range { grid-column: 1/-1; grid-row: 6; margin-bottom: 10px; }
  .traffic-figure .chart-data { grid-column: 1/-1; grid-row: 7; min-width: 0; }
  .traffic-figure .chart-empty { grid-column: 1/-1; grid-row: 3; }
}
@media (min-width: 1700px) { .analytics-dashboard, .analytics-detail-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }.analytics-dashboard .traffic-figure { padding: 28px; } }
@media (max-width: 1250px) { .analytics-dashboard, .analytics-detail-grid { grid-template-columns: minmax(0, 1fr); }.analytics-context { display: grid; grid-template-columns: 1fr 1fr; }.analytics-distribution { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 22px; }.analytics-distribution > h3, .analytics-distribution > .analytics-card-kicker { grid-column: 1/-1; }.analytics-distribution .analytics-insight { grid-template-columns: 1fr; }.analytics-distribution .analytics-insight > p { grid-column: auto; } }
@media (max-width: 1100px) { #traffic-overview-result .analytics-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }#traffic-overview-result .analytics-stat > strong { font-size: 34px; } }
@media (max-width: 650px) {
  #traffic-overview-panel { padding: 18px 14px; border-radius: 13px; }#traffic-overview-panel > summary { font-size: 18px; }
  #traffic-overview-form { gap: 10px; padding: 13px; }#traffic-overview-form > label { font-size: 13px; }#traffic-overview-form select { flex: 1; min-width: 150px; }
  #traffic-overview-form > .muted { order: 4; flex-basis: 100%; min-width: 0; font-size: 12px; }#traffic-overview-load { flex: 1; min-width: 100px; font-size: 13px; }
  #traffic-overview-dates { flex-basis: 100%; gap: 8px; }#traffic-overview-dates input { min-width: 0; width: calc(100% - 69px); flex: 1; }#traffic-overview-dates label { flex-basis: 58px; }
  .analytics-scopebar { gap: 8px; margin-bottom: 14px; }.analytics-scope-label { font-size: 12px; gap: 8px; }#traffic-overview-result .analytics-reference { font-size: 11px; }
  #traffic-overview-result .analytics-totals { gap: 10px; margin-bottom: 18px; }#traffic-overview-result .analytics-stat { padding: 15px 13px; gap: 11px; border-radius: 11px; }
  .analytics-stat-heading { font-size: 13px; gap: 5px; }.analytics-stat-icon { width: 25px; height: 25px; font-size: 10px; border-radius: 6px; }
  #traffic-overview-result .analytics-stat > strong { font-size: 27px; letter-spacing: -.8px; }#traffic-overview-result .analytics-stat-hint { font-size: 11px; line-height: 1.7; }
  #traffic-overview-result .analytics-stat-full { display: none; }#traffic-overview-result .analytics-stat-compact { display: block; white-space: nowrap; }#traffic-overview-result .analytics-stat-exact { display: block; margin-top: -7px; font-size: 10px; }
  .analytics-dashboard, .analytics-detail-grid { gap: 16px; }.analytics-dashboard .traffic-figure { padding: 19px 14px 16px; border-radius: 12px; }.trend-heading strong { font-size: 18px; }
  .traffic-figure .trend-description { font-size: 12px; margin-bottom: 17px; }.trend-toolbar { gap: 8px; margin-bottom: 15px; }.trend-segments { gap: 2px; padding: 3px; }.trend-segments button { font-size: 12px; padding: 6px 10px; min-height: 36px; }
  .trend-inspector { padding: 13px; grid-template-columns: 1fr; gap: 3px; }.trend-selected-date { font-size: 12px; }.trend-selected-value { font-size: 29px; }.trend-selected-context { font-size: 12px; }
  .traffic-figure svg { min-height: 205px; }.traffic-figure .chart-label { font-size: 15px; }.trend-legend { gap: 12px; font-size: 12px; line-height: 1.8; }.trend-help { margin-left: 0; flex-basis: 100%; font-size: 11px; }
  .traffic-figure .trend-range { font-size: 11px; }.traffic-figure .chart-data { font-size: 12px; }.traffic-figure .chart-data th, .traffic-figure .chart-data td { font-size: 12px; padding: 11px 7px; }
  .analytics-context { grid-template-columns: 1fr; gap: 16px; }.analytics-context-card { padding: 19px; border-radius: 12px; }.analytics-context-card h3 { font-size: 16px; margin-bottom: 15px; }.coverage-count strong { font-size: 30px; }
  .analytics-detail-grid { margin-top: 16px; }.analytics-ranking { padding: 19px 15px; border-radius: 12px; }.analytics-section-heading h3 { font-size: 16px; }.analytics-section-note { font-size: 12px; }
  .analytics-ranking-row { grid-template-columns: 23px minmax(0, 1fr) 73px; gap: 9px; padding: 15px 0; }.analytics-rank { font-size: 12px; }.analytics-ranking-content > strong { font-size: 13px; }.analytics-ranking-content > span { font-size: 11px; }.analytics-ranking-value > strong { font-size: 17px; }.analytics-ranking-value > span { font-size: 10px; }
  .analytics-distribution { display: block; }.analytics-distribution .analytics-insight { grid-template-columns: minmax(0, 1fr) auto; }.analytics-distribution .analytics-insight > p { grid-column: 1/-1; }
  .analytics-data-notes { margin-top: 16px; padding: 15px; }.analytics-data-notes p { font-size: 12px; }.traffic-figure .chart-empty { padding: 36px 16px; }.chart-empty strong { font-size: 15px; }.chart-empty p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .traffic-figure .chart-bar, #traffic-overview-result[aria-busy=true] { transition: none; }#traffic-overview-result[aria-busy=true]:empty { animation: none; } }
