/* Inherit Matrix's neutral surfaces, blue actions, and system type. */
.ar-page {
  display: grid;
  gap: 18px;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.ar-page [hidden] { display: none !important; }
.ar-page ::selection { background: var(--primary-soft); color: var(--ink); }
.ar-page :is(button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.ar-page :is(input, textarea) { caret-color: var(--primary); }
.ar-page :is(button, summary) { cursor: pointer; }
.ar-page button:disabled { cursor: wait; opacity: .65; }
.ar-page button:hover:not(:disabled):not(.primary) { background: var(--surface-2); border-color: var(--line-strong); }
.ar-page .btn.primary:hover { background: var(--accent-fill); }
.ar-page :is(h2, h3, p) { margin: 0; }
.ar-page h2 { font-size: 17px; }
.ar-page h3 { font-size: 14px; }
.ar-page small { font-size: 12px; }
.ar-page p { line-height: 1.6; }
.ar-identity, .ar-section-head, .ar-recommendation-head, .ar-overview-tools, .ar-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ar-identity { padding-bottom: 4px; }
.ar-identity strong { font-size: 18px; font-weight: var(--fw-semibold); }
.ar-identity p { margin-top: 4px; font-size: 13px; }
.ar-identity > div, .ar-section-head > div { min-width: 0; }
.ar-identity > button, .ar-section-head > button, .ar-recommendation-head > button { flex-shrink: 0; }
.ar-message:empty { display: none; }
.ar-message { padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); color: var(--ink); }
.ar-message.error, .ar-form-error { color: var(--rose); }
.ar-message .mini-btn { margin-left: 8px; }
.ar-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.ar-tabs button { padding: 10px 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; font-weight: var(--fw-bold); }
.ar-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.ar-page .ar-tabs button:hover { border-bottom-color: var(--primary); background: transparent; }
.ar-range-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ar-range-presets, .ar-date-form, .ar-day-controls, .ar-ad-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ar-range-bar > span { width: 100%; color: var(--muted); font-size: 12px; }
.ar-page label { display: grid; gap: 6px; color: var(--ink); font-weight: 600; font-size: 13px; min-width: 0; }
.ar-date-form label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ar-page :is(input, select, textarea) { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-xs); padding: 7px 9px; color: var(--ink); background: var(--surface); font-size: 13px; line-height: 1.5; }
.ar-page input[type="date"] { width: 140px; }
.ar-page textarea { resize: vertical; }
.ar-page input::placeholder, .ar-page textarea::placeholder { color: var(--muted); }
.ar-page button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ar-page [role="tabpanel"] { min-width: 0; }
.ar-page [role="tabpanel"] > * + * { margin-top: 18px; }
.ar-overview-tools { margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.ar-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.ar-page .ar-overview-tools + .ar-metrics { margin-top: 0; }
.ar-metric { display: flex; flex-direction: column; padding: 18px; min-width: 0; }
.ar-metric + .ar-metric { border-left: 1px solid var(--line); }
.ar-metric h3 { color: var(--muted); font-size: 13px; font-weight: 600; }
.ar-metric-value { font-size: 27px; line-height: 1.3; font-weight: var(--fw-semibold); margin: 12px 0 8px; letter-spacing: -.02em; }
.ar-metric p, .ar-metric > span { font-size: 12px; line-height: 1.65; color: var(--ink); }
.ar-metric small { display: block; margin-top: auto; padding-top: 12px; color: var(--muted); line-height: 1.5; }
.ar-panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ar-section-head { margin-bottom: 16px; align-items: flex-start; }
.ar-section-head p { font-size: 13px; margin-top: 5px; }
.ar-section-head > span { color: var(--muted); font-size: 12px; }
.ar-state { display: inline-flex; align-items: center; padding: 2px 7px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; line-height: 1.65; }
.ar-state.warning { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-strong); }
.ar-empty { padding: 24px 0; max-width: 70ch; }
.ar-empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.ar-empty p { font-size: 13px; color: var(--muted); }
.ar-recommendation-list { list-style: none; margin: 0; padding: 0; }
.ar-recommendation-list > li { padding: 16px 0; }
.ar-recommendation-list > li:first-child { padding-top: 0; }
.ar-recommendation-list > li:last-child { padding-bottom: 0; }
.ar-recommendation-list > li + li { border-top: 1px solid var(--line); }
.ar-recommendation-head { margin-bottom: 8px; }
.ar-recommendation-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ar-recommendation-list p { font-size: 13px; max-width: 80ch; }
.ar-page .ar-next-step { margin-top: 4px; color: var(--ink); }
.ar-page details > summary { font-size: 13px; font-weight: 600; padding: 9px 0; color: var(--ink); }
.ar-page details:not([open]) > :not(summary) { display: none; }
.ar-page details[open] > summary { margin-bottom: 6px; }
.ar-facts { margin: 0; }
.ar-facts > div { display: grid; grid-template-columns: minmax(115px, 35%) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.ar-facts > div:last-child { border-bottom: 0; }
.ar-facts dt { color: var(--muted); font-size: 12px; font-weight: 500; }
.ar-facts dd { margin: 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.ar-preserve { white-space: pre-wrap; }
.ar-chart-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 118px; }
.ar-chart-row + .ar-chart-row { border-top: 1px solid var(--line-soft); }
.ar-chart-row small { display: block; color: var(--muted); margin-top: 4px; }
.ar-chart { width: 100%; height: auto; display: block; max-height: 155px; overflow: visible; color: var(--primary); }
.ar-chart-units { color: var(--teal); }
.ar-chart-spend { color: var(--amber); }
.ar-chart text { fill: var(--muted); font-size: 12px; font-family: inherit; }
.ar-chart circle { fill: currentColor; stroke: var(--surface); stroke-width: 1; }
.ar-chart-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.ar-chart-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.ar-event-mark { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.ar-chart-empty { padding: 26px 10px; color: var(--muted); font-size: 13px; }
.ar-footnote, .ar-page .ar-footnote { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 14px; }
.ar-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; min-width: 0; }
.ar-keyword-list { padding: 0; margin: 0; list-style: none; }
.ar-keyword-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ar-keyword-list li:last-child { border-bottom: 0; }
.ar-keyword-list strong { font-weight: 600; }
.ar-keyword-list span { text-align: right; font-size: 13px; }
.ar-keyword-list small { display: block; color: var(--muted); margin-top: 3px; }
.ar-control { max-width: 280px; flex-shrink: 0; }
.ar-search-controls { display: flex; gap: 12px; margin-bottom: 16px; }
.ar-search-controls label:first-child { flex: 1; max-width: 400px; }
.ar-search-controls label:last-child { width: 140px; }
.ar-period-label, .ar-page .ar-period-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ar-ad-tabs { margin-bottom: 14px; }
.ar-current-settings { margin-bottom: 18px; }
.ar-current-settings > details { margin-top: 8px; }
.ar-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-xs); overscroll-behavior-x: contain; }
.ar-table { border-collapse: collapse; min-width: 100%; width: max-content; table-layout: auto; }
.ar-table :is(th, td) { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; vertical-align: top; max-width: 340px; }
.ar-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; vertical-align: middle; white-space: nowrap; }
.ar-table th button { display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; min-height: 30px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; color: var(--muted); font-weight: 600; white-space: nowrap; }
.ar-sort-arrow { flex-shrink: 0; opacity: .35; }
.ar-sort-arrow.descending { transform: rotate(180deg); }
.ar-table th[aria-sort="ascending"] .ar-sort-arrow, .ar-table th[aria-sort="descending"] .ar-sort-arrow { opacity: 1; color: var(--primary); }
.ar-table td { color: var(--ink); line-height: 1.6; }
.ar-table td strong { display: block; max-width: 240px; min-width: 150px; font-weight: 600; }
.ar-table td small { display: block; color: var(--muted); font-size: 11px; max-width: 280px; margin-top: 3px; }
.ar-table td.ar-numeric { text-align: right; white-space: nowrap; }
.ar-table tbody tr:last-child td { border-bottom: 0; }
.ar-table tbody tr:hover { background: var(--surface-2); }
.ar-table .ar-table-facts { width: 320px; }
.ar-table-facts > div { grid-template-columns: 105px 1fr; }
.ar-table td details > summary { min-width: 92px; padding: 0; font-size: 12px; }
.ar-supply-evidence { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.ar-supply-evidence .ar-section-head { margin-bottom: 10px; }
.ar-muted { color: var(--muted); }
.ar-page .ar-attribution-split h4, .ar-page .ar-ad-object-list h4 { margin: 0 0 8px; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.ar-table td:has(.ar-attribution-split) { max-width: 620px; }
.ar-attribution-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; width: 560px; max-width: calc(100vw - 80px); padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.ar-attribution-split p { font-size: 12px; }
.ar-attribution-split .ar-facts > div { grid-template-columns: 1fr; gap: 3px; }
.ar-ad-object-list { width: 560px; max-width: calc(100vw - 80px); }
.ar-ad-object-list > details { padding: 14px 0; }
.ar-ad-object-list > details + details { border-top: 1px solid var(--line-strong); }
.ar-ad-object-list > details:last-child { padding-bottom: 0; }
.ar-action-form { padding: 18px; margin-bottom: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius-xs); background: var(--surface-2); }
.ar-action-form > p { font-size: 12px; margin-bottom: 16px; }
.ar-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ar-field-wide { grid-column: 1 / -1; }
.ar-supply-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-xs); background: var(--surface); }
.ar-supply-fields .ar-footnote { grid-column: 1 / -1; margin-top: 0; }
.ar-form-grid input[type="date"] { width: 100%; }
.ar-form-footer { margin-top: 18px; justify-content: flex-start; }
.ar-form-footer span { font-size: 12px; color: var(--muted); }
.ar-form-error:empty { display: none; }
.ar-action-form .ar-form-error { margin-top: 14px; margin-bottom: 0; }
.ar-sources > summary { display: flex; align-items: center; gap: 12px; list-style: revert; }
.ar-sources > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); margin-right: 4px; }
.ar-sources[open] > summary::before { transform: rotate(45deg); }
.ar-sources > summary::-webkit-details-marker { display: none; }
.ar-sources > summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
.ar-source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.ar-source-list > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ar-source-list strong { font-size: 13px; font-weight: 600; }
.ar-source-list :is(small, p, div > span:not(.ar-state)) { width: 100%; font-size: 12px; color: var(--muted); }
.ar-limitations { color: var(--muted); padding-left: 18px; font-size: 12px; }
.ar-limitations li + li { margin-top: 5px; }
.ar-skeleton { padding: 20px; min-height: 155px; display: grid; align-content: start; gap: 18px; }
.ar-skeleton span { display: block; height: 12px; width: 65%; border-radius: 3px; background: var(--line); }
.ar-skeleton span:nth-child(2) { height: 28px; width: 40%; }
.ar-skeleton span:nth-child(3) { width: 90%; }
@media (max-width: 1200px) {
  .ar-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-metric:nth-child(3) { border-left: 0; }
  .ar-metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ar-chart-row { grid-template-columns: 110px minmax(0, 1fr); }
  .ar-two-columns { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ar-page { gap: 14px; font-size: 13px; }
  .ar-panel { padding: 16px; }
  .ar-identity { align-items: flex-start; }
  .ar-identity strong { font-size: 16px; }
  .ar-identity p { font-size: 12px; }
  .ar-tabs { gap: 22px; }
  .ar-tabs button { font-size: 13px; min-height: 44px; }
  .ar-page .mini-btn { min-height: 36px; }
  .ar-range-bar { gap: 10px; }
  .ar-date-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; width: 100%; align-items: end; gap: 8px; }
  .ar-date-form label { display: grid; }
  .ar-date-form > span { display: none; }
  .ar-date-form input[type="date"] { width: 100%; min-width: 0; }
  .ar-overview-tools { flex-wrap: wrap; gap: 8px; }
  .ar-metric { padding: 14px; }
  .ar-metric-value { font-size: 23px; }
  .ar-chart-row { grid-template-columns: 1fr; gap: 3px; padding: 14px 0; }
  .ar-chart-row > div { display: flex; align-items: baseline; gap: 8px; }
  .ar-chart-empty { min-height: 65px; }
  .ar-chart { min-height: 95px; }
  .ar-section-head { flex-wrap: wrap; gap: 10px; }
  .ar-recommendation-head { align-items: flex-start; }
  .ar-recommendation-head > div { align-items: flex-start; flex-direction: column; gap: 6px; }
  .ar-control { max-width: 100%; width: 100%; }
  .ar-facts > div { grid-template-columns: minmax(100px, 36%) minmax(0, 1fr); }
  .ar-search-controls { gap: 8px; }
  .ar-search-controls label:last-child { width: 105px; }
  .ar-form-grid, .ar-source-list { grid-template-columns: 1fr; }
  .ar-supply-fields { grid-template-columns: 1fr; }
  .ar-attribution-split { grid-template-columns: 1fr; gap: 16px; }
  .ar-attribution-split, .ar-ad-object-list { width: 280px; }
  .ar-form-footer { align-items: flex-start; flex-direction: column; }
  .ar-keyword-list li { flex-direction: column; gap: 6px; }
  .ar-keyword-list span { text-align: left; }
}
