/* Existing native interiors only. No grid coordinates, module handles or evidence transformations. */
#appShell :is(#changesView,#businessOutcomesView) {--re663-field:#737C85;--re663-green:#22DB68;--re663-add:#143B29;--re663-remove:#44272D}
#appShell[data-theme=light] :is(#changesView,#businessOutcomesView) {--re663-field:#727D86;--re663-green:#146C37;--re663-add:#DDF4E5;--re663-remove:#FBE4E5}

/* History filters and record hierarchy reflow to the actual list panel. */
#appShell #changesView .changes-panel {container-type:inline-size}
#appShell #changesView .history-controls {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,135px),1fr));align-items:end;gap:10px;background:var(--ruction-surface-raised)!important;border-color:var(--ruction-border)!important}
#appShell #changesView .history-control {min-width:0;max-width:100%}
#appShell #changesView .history-control span {color:var(--ruction-text-primary)!important;--ruction-body-size:12px;line-height:1.45}
#appShell #changesView .history-control :is(input,select) {width:100%;min-width:0;box-sizing:border-box;min-height:44px;background:var(--ruction-surface-card)!important;color:var(--ruction-text-primary)!important;border:1px solid var(--re663-field)!important}
#appShell #changesView .history-search {grid-column:span 2}
@container(max-width:420px) {#appShell #changesView .history-search {grid-column:1/-1}#appShell #changesView .history-control {width:100%}}
#appShell #changesView :is(.history-group,.history-heading,.history-session,.change-row) {background:var(--ruction-surface-card)!important;border-color:var(--ruction-border)!important;color:var(--ruction-text-primary)!important}
#appShell #changesView :is(.history-group-events,.history-session-events) {background:var(--ruction-surface-raised)!important;border-color:var(--ruction-border)!important;min-width:0}
#appShell #changesView :is(.history-heading,.change-row) {gap:10px;padding:12px;min-width:0;min-height:44px}
#appShell #changesView :is(.history-heading,.change-row):hover {background:var(--ruction-surface-raised)!important}
#appShell #changesView .change-row[aria-pressed=true] {background:color-mix(in srgb,var(--ruction-action) 10%,var(--ruction-surface-card))!important;border-color:var(--ruction-interactive-ink)!important;box-shadow:inset 3px 0 var(--ruction-interactive-ink)}
#appShell #changesView :is(.history-heading-stack,.change-row-main) {min-width:0;overflow-wrap:anywhere}
#appShell #changesView :is(.history-heading-title,.change-title) {color:var(--ruction-text-primary)!important;--ruction-body-size:14px;font-weight:650;white-space:normal;overflow-wrap:anywhere;line-height:1.45}
#appShell #changesView :is(.history-heading-meta,.change-url,.change-actor,.change-date,.history-summary) {color:var(--ruction-text-muted)!important;white-space:normal;overflow-wrap:anywhere;line-height:1.45}
#appShell #changesView .history-heading-count {background:var(--ruction-surface-raised)!important;color:var(--ruction-text-primary)!important;border:1px solid var(--ruction-border);white-space:normal;text-align:center;flex-shrink:0}
#appShell #changesView :is(.history-heading-chevron,.change-arrow) {color:var(--ruction-interactive-ink)!important;flex:none}
#appShell #changesView :is(.history-heading,.change-row):focus-visible {outline-offset:-3px!important}
@container(max-width:470px) {
  #appShell #changesView .history-heading {flex-wrap:wrap;gap:6px}
  #appShell #changesView .history-heading-stack {flex:1 1 100%}
  #appShell #changesView .change-row {flex-wrap:wrap;gap:7px}
  #appShell #changesView .change-row-main {flex:1 1 calc(100% - 45px)}
  #appShell #changesView .change-date {flex:1 1 auto;margin-inline-start:4px}
}
#appShell #changesView :is(.history-load-more,#refreshHistory,.comparison-toggle,#re318ClearDay) {background:var(--ruction-surface-raised)!important;border-color:var(--ruction-border)!important;color:var(--ruction-interactive-ink)!important;min-height:42px;white-space:normal}
#appShell #changesView :is(.empty-state,.empty-detail) {color:var(--ruction-text-muted)!important;line-height:1.55;overflow-wrap:anywhere}

/* Chart preserves the existing 30 dates and counts. Gaps are dashed, not zero bars. */
#appShell #changesView .re318-history-chart-panel {min-width:0;container-type:inline-size}
#appShell #changesView #re318HistoryChart {grid-template-columns:repeat(30,minmax(16px,1fr));gap:3px;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;padding-top:18px;padding-bottom:26px;box-sizing:border-box}
#appShell #changesView #re318HistoryChart .re318-day-bar {background:var(--ruction-action);color:var(--ruction-text-primary);border-radius:3px 3px 0 0}
#appShell #changesView #re318HistoryChart .re318-day-bar.new-month {background:var(--ruction-interactive-ink)}
#appShell #changesView :is(.re318-day-bar span,.re318-day-bar small,.re318-weekday,.re318-cal-day small,#re318HistoryCaption) {color:var(--ruction-text-muted)!important}
#appShell #changesView #re318Calendar .re318-cal-day {background:color-mix(in srgb,var(--ruction-action) calc(var(--intensity)*24%),var(--ruction-surface-card));color:var(--ruction-text-primary)!important;border-color:var(--ruction-border)!important;min-width:0;min-height:34px}
#appShell #changesView :is(.re318-day-bar,.re318-cal-day)[aria-pressed=true] {outline:2px solid var(--ruction-interactive-ink)!important;outline-offset:-1px}
#appShell #changesView #re318Calendar .re318-cal-day[data-re663-state=unknown] {border-style:dashed;background:var(--ruction-surface-raised)!important;color:var(--ruction-text-muted)!important}
#appShell #changesView #re318HistoryChart .re318-day-bar[data-re663-state=unknown],
#appShell #overviewView .re411-history-chart .re318-day-bar[data-re663-state=unknown] {background:transparent!important;border:1px dashed var(--ruction-text-muted)!important;box-shadow:none!important}
#appShell #changesView #re318HistoryChart .re318-day-bar[data-re663-state=partial] {border:1px dashed var(--ruction-text-muted)}
#appShell #changesView #re318HistoryCaption {opacity:1;line-height:1.55}
#appShell #changesView #re318HistoryChart:focus-visible {outline:2px solid var(--ruction-interactive-ink);outline-offset:2px}

/* Change inspector preserves exact before/after text; wrap long URL/code and make deletion/addition distinct. */
#appShell #changesView .detail-panel {container-type:inline-size;min-width:0}
#appShell #changesView #historyDetail :is(.detail-url,.detail-actor,.diff-label) {color:var(--ruction-text-muted)!important;overflow-wrap:anywhere;line-height:1.5}
#appShell #changesView #historyDetail .diff {background:var(--ruction-surface-raised)!important;border-color:var(--ruction-border)!important;color:var(--ruction-text-primary)!important;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}
#appShell #changesView #historyDetail .diff mark.removed {background:var(--re663-remove)!important;color:var(--ruction-error)!important;text-decoration:line-through}
#appShell #changesView #historyDetail .diff mark.added {background:var(--re663-add)!important;color:var(--re663-green)!important}
#appShell #changesView #historyDetail .diff-columns {grid-template-columns:repeat(2,minmax(0,1fr))}
#appShell #changesView #historyDetail .diff-columns>div {min-width:0}
@container(max-width:520px) {#appShell #changesView #historyDetail .diff-columns {grid-template-columns:minmax(0,1fr)}}

/* Business outcomes: keep shopping observations separate from imported orders. */
#appShell #businessOutcomesView :is(.re398-mode-notice,.business-small,.business-muted,#wooNotice,.woo-summary-note,.woo-order-count,.re397-muted,.re397-caveat,.re397-date,.re397-meta,.re397-source small,.re400-evidence,.re400-feedback) {color:var(--ruction-text-muted)!important;overflow-wrap:anywhere;line-height:1.55}
#appShell #businessOutcomesView .business-card {min-width:0;container-type:inline-size}
#appShell #businessOutcomesView .business-card .section-head {flex-wrap:wrap;gap:10px}
#appShell #businessOutcomesView .business-card .section-head>div {min-width:0}
#appShell #businessOutcomesView .business-metrics {grid-template-columns:repeat(auto-fit,minmax(min(100%,138px),1fr));gap:10px}
#appShell #businessOutcomesView :is(.business-metric,.business-suggestions article,.woo-summary,.woo-currency-list li,.woo-orders-detail,.woo-sync-progress,.re397-evidence,.re397-measurement,.re400-activity-card,.re400-activity-review) {background:var(--ruction-surface-raised)!important;border-color:var(--ruction-border)!important;color:var(--ruction-text-primary)!important;min-width:0;overflow-wrap:anywhere}
#appShell #businessOutcomesView .business-metric strong {--ruction-body-size:25px;font-variant-numeric:tabular-nums;color:var(--ruction-text-primary)!important;line-height:1.25}
#appShell #businessOutcomesView .business-metric span {color:var(--ruction-text-muted)!important;line-height:1.45}
#appShell #businessOutcomesView :is(.woo-summary strong,.woo-detail-heading h3,.business-suggestions strong,.re397-evidence h3,.re400-top strong) {color:var(--ruction-text-primary)!important}
#appShell #businessOutcomesView :is(#commerceEvidence,#wooResults)[data-re663-state=pending] {padding:11px 12px;border:1px dashed var(--ruction-border);border-radius:8px;color:var(--ruction-text-muted)!important}
#appShell #businessOutcomesView :is(#commerceEvidence,#wooResults)[data-re663-state=error] {padding:11px 12px;border:1px solid var(--ruction-error);border-radius:8px;color:var(--ruction-error)!important}
#appShell #businessOutcomesView .woo-table-scroll {max-width:100%;overflow:auto;overscroll-behavior-inline:contain;border-color:var(--ruction-border)!important;min-width:0}
#appShell #businessOutcomesView .woo-orders-table {min-width:560px;width:100%;color:var(--ruction-text-primary)!important}
#appShell #businessOutcomesView .woo-orders-table :is(th,td) {padding:10px 11px;border-color:var(--ruction-border)!important;color:var(--ruction-text-primary)!important;background:var(--ruction-surface-card)!important;line-height:1.45}
#appShell #businessOutcomesView .woo-orders-table th,#appShell #businessOutcomesView .woo-orders-table tbody tr:nth-child(even) td {background:var(--ruction-surface-raised)!important}
#appShell #businessOutcomesView .woo-orders-table .woo-amount {font-variant-numeric:tabular-nums;text-align:right}
#appShell #businessOutcomesView .woo-actions {gap:9px;flex-wrap:wrap}
#appShell #businessOutcomesView .woo-actions .woo-action {min-height:44px;white-space:normal;max-width:100%}
#appShell #businessOutcomesView :is(#wooSync,#re397Analyze,#loadCommerceEvidence,.re400-actions .primary) {background:var(--ruction-action)!important;color:var(--ruction-action-text)!important;border-color:var(--ruction-action)!important;min-height:44px}
#appShell #businessOutcomesView :is(#wooRefresh,#wooReconnect) {background:var(--ruction-surface-raised)!important;border-color:var(--ruction-border)!important;color:var(--ruction-text-primary)!important}
#appShell #businessOutcomesView #wooRefresh[aria-expanded=true] {border-color:var(--ruction-interactive-ink)!important;color:var(--ruction-interactive-ink)!important}
#appShell #businessOutcomesView #wooDisconnect {background:var(--re663-remove)!important;border-color:var(--ruction-error)!important;color:var(--ruction-error)!important}
#appShell #businessOutcomesView .business-card :is(input,select,textarea) {box-sizing:border-box;min-width:0;max-width:100%;min-height:44px;background:var(--ruction-surface-card)!important;color:var(--ruction-text-primary)!important;border:1px solid var(--re663-field)!important}
#appShell #businessOutcomesView .re397-insights {grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
#appShell #businessOutcomesView .re400-activity-list {grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))}
#appShell #businessOutcomesView .re400-activity-card {container-type:inline-size}
#appShell #businessOutcomesView :is(.re397-eyebrow,.re397-source a,.re400-confidence,.re400-evidence a) {color:var(--ruction-interactive-ink)!important}
@container(max-width:450px) {#appShell #businessOutcomesView .woo-actions .woo-action {flex:1 1 100%}#appShell #businessOutcomesView .re400-fields {grid-template-columns:minmax(0,1fr)}#appShell #businessOutcomesView .re400-actions button {flex:1 1 140px}}
#appShell :is(#changesView,#businessOutcomesView) :is(button,input,select,textarea,summary,[role=region]):focus-visible {outline:2px solid var(--ruction-interactive-ink)!important;outline-offset:2px}
@media(prefers-reduced-motion:reduce) {#appShell #changesView :is(.change-row,.history-heading-chevron) {transition:none!important}}
