*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  overflow-x: auto;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.icon,
.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body .lr-product-shell > .lr-topbar > .lr-topbar-space {
  flex: 1;
}

body .lr-product-shell {
  height: 100vh;
}

body .lr-product-shell > .lr-topbar .lr-window-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

body .lr-product-shell > .lr-topbar .lr-window-tool {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--lr-text-muted);
  cursor: pointer;
  font-size: 12px;
}

body .lr-product-shell > .lr-topbar .lr-window-controls {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--lr-text-disabled);
  font-size: 13px;
}

body .lr-product-shell > .lr-sidebar .lr-operator {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--lr-line-soft);
}

body .lr-product-shell > .lr-sidebar .lr-operator > img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

body .lr-product-shell > .lr-sidebar .lr-operator > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

body .lr-product-shell > .lr-sidebar .lr-operator strong,
body .lr-product-shell > .lr-sidebar .lr-operator span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .lr-product-shell > .lr-sidebar .lr-operator strong {
  font-size: 12px;
}

body .lr-product-shell > .lr-sidebar .lr-operator span {
  color: var(--lr-text-disabled);
  font-size: 10px;
}

body .lr-product-shell > .lr-main {
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
}

body .lr-product-shell > .lr-main .lr-continuous-workspace {
  width: 100%;
  height: 100%;
}

body .lr-product-shell > .lr-main .lr-region {
  min-width: 0;
  min-height: 0;
  background: var(--lr-bg);
}

.report-title-row,
.report-meta,
.report-actions,
.export-actions {
  display: flex;
  align-items: center;
}

.analytics-page {
  display: grid;
  overflow: hidden;
}

.analytics-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 268px minmax(0, 1fr);
  overflow: hidden;
}

.session-browser {
  display: grid;
  min-height: 0;
  grid-template-rows: 54px auto minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid var(--lr-line);
}

.session-browser > .lr-region-header span {
  color: var(--lr-text-disabled);
  font-size: 12px;
  white-space: nowrap;
}

.session-tools {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--lr-line-soft);
}

.search-field {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--lr-line);
  border-radius: 5px;
  background: var(--lr-surface);
}

.search-field:focus-within {
  border-color: #4b5359;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lr-text);
  font-size: 12px;
}

.search-field input::placeholder {
  color: var(--lr-text-disabled);
}

.status-filter,
.group-filter {
  display: flex;
  align-items: center;
  gap: 2px;
}

.status-filter button,
.group-filter button {
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--lr-text-muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.status-filter button:hover,
.group-filter button:hover {
  color: var(--lr-text);
}

.status-filter button.is-active,
.group-filter button.is-active {
  background: var(--lr-surface-selected);
  color: var(--lr-text);
}

.session-list {
  min-height: 0;
  overflow-y: auto;
}

.session-row {
  position: relative;
  display: block;
  width: 100%;
  min-height: 68px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--lr-line-soft);
  background: transparent;
  color: var(--lr-text);
  text-align: left;
  cursor: pointer;
}

.session-row:hover,
.session-row[aria-selected="true"] {
  background: var(--lr-surface-selected);
}

.session-row[aria-selected="true"]::before {
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--lr-accent);
  content: "";
}

.session-row-head,
.session-row-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-row-title {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-row-meta {
  margin-top: 8px;
  color: var(--lr-text-disabled);
  font-size: 11px;
}

.session-row-meta > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.session-row-meta .icon {
  width: 13px;
  height: 13px;
}

.session-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lr-text-disabled);
}

.session-status-dot.status-ready,
.session-status-dot.status-ended,
.session-status-dot.status-live {
  background: var(--lr-success);
}

.session-status-dot.status-processing,
.session-status-dot.status-scheduled {
  background: var(--lr-warning);
}

.session-status-dot.status-failed,
.session-status-dot.status-review {
  background: var(--lr-danger);
}

.session-state {
  min-height: 0;
  padding: 18px 14px;
}

.session-state h3 {
  margin: 14px 0 7px;
  font-size: 14px;
}

.session-skeleton,
.report-heading-skeleton {
  display: grid;
  width: 100%;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.session-skeleton i,
.session-skeleton b,
.session-skeleton span,
.report-heading-skeleton i,
.report-heading-skeleton b,
.report-heading-skeleton span,
.metric-skeletons i {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: var(--lr-surface-selected);
  animation: pulse 1.4s ease-in-out infinite;
}

.session-skeleton i {
  border-radius: 50%;
}

.session-skeleton span,
.report-heading-skeleton span {
  grid-column: 2;
  width: 58%;
}

.report-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 54px minmax(0, 1fr);
  overflow: hidden;
}

.report-body {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.report-state {
  height: 100%;
}

.state-asset,
.state-icon {
  width: 36px;
  height: 36px;
  opacity: .55;
}

.state-error .state-asset,
.state-error .state-icon {
  opacity: .8;
}

.report-loading {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  height: 100%;
  padding: 40px;
  color: var(--lr-text-muted);
  font-size: 12px;
}

.report-heading-skeleton {
  width: min(420px, 70%);
}

.metric-skeletons {
  display: grid;
  width: min(760px, 90%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
}

.metric-skeletons i {
  height: var(--lr-metric-h);
}

.report-content {
  display: grid;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto 42px minmax(0, 1fr);
  overflow: hidden;
}

.report-header {
  display: flex;
  min-width: 0;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lr-line-soft);
}

.report-title-block {
  min-width: 0;
}

.report-title-row {
  min-width: 0;
  gap: 9px;
}

.report-header h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 650 16px/24px var(--lr-font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-meta {
  min-width: 0;
  gap: 14px;
  margin-top: 7px;
  color: var(--lr-text-muted);
  font-size: 12px;
}

.report-meta span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.report-meta .icon {
  width: 14px;
  height: 14px;
}

.report-actions,
.export-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.is-loading img {
  animation: spin .8s linear infinite;
}

.danger-icon-button {
  filter: sepia(.35) saturate(1.8);
}

.status-badge,
.delta-badge,
.analysis-depth,
.claim-label {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.status-badge {
  color: var(--lr-text-muted);
}

.status-badge.status-ready,
.status-badge.status-ended {
  color: var(--lr-success);
}

.status-badge.status-live,
.status-badge.status-processing,
.status-badge.status-scheduled {
  color: var(--lr-warning);
}

.status-badge.status-failed,
.status-badge.status-review {
  color: var(--lr-danger);
}

.analysis-statuses {
  display: flex;
  min-width: 0;
  gap: 16px;
  margin-top: 8px;
}

.analysis-statuses > span {
  display: grid;
  min-width: 0;
  grid-template-columns: 14px auto auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--lr-text-muted);
  font-size: 11px;
}

.analysis-statuses img {
  width: 14px;
  height: 14px;
}

.analysis-statuses b {
  color: var(--lr-text-disabled);
  font-weight: 500;
}

.analysis-statuses strong {
  color: var(--lr-text);
  font-weight: 650;
  white-space: nowrap;
}

.analysis-statuses small {
  min-width: 0;
  overflow: hidden;
  color: var(--lr-text-disabled);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-tabs {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 24px;
  padding: 0 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--lr-line-soft);
}

.report-tabs button {
  position: relative;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--lr-text-muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.report-tabs button:hover,
.report-tabs button[aria-selected="true"] {
  color: var(--lr-text);
}

.report-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--lr-accent);
  content: "";
}

.tab-panel {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.tab-panel > div + div:not(:empty) {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--lr-line-soft);
}

.content-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  min-height: 38px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h3,
.section-heading p {
  margin: 0;
}

.section-heading h3 {
  font: 650 16px/24px var(--lr-font);
  white-space: nowrap;
}

.section-heading p {
  margin-top: 2px;
  color: var(--lr-text-muted);
  font-size: 12px;
}

.claim-pair {
  display: flex;
  gap: 6px;
}

.claim-fact {
  color: var(--lr-success);
}

.claim-inference {
  color: var(--lr-warning);
}

.claim-action {
  color: #9db9ee;
}

.metric-grid {
  width: 100%;
}

.metric-card {
  justify-content: flex-start;
}

.metric-value-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.metric-value {
  font-size: 16px;
}

.delta-badge {
  padding: 0;
  color: var(--lr-text-muted);
}

.direction-up {
  color: var(--lr-success);
}

.direction-down {
  color: var(--lr-danger);
}

.report-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--lr-text-disabled);
  font-size: 11px;
}

.report-note .icon {
  width: 14px;
  height: 14px;
}

.group-filter {
  margin-bottom: 12px;
}

.user-grid,
.touchpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}

.user-card,
.touchpoint-card,
.attribution-card,
.action-card {
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--lr-line-soft);
}

.user-card-head,
.touchpoint-card-head,
.attribution-card-head,
.action-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.touchpoint-card-head > div,
.attribution-card-head > div,
.action-card-head > div {
  min-width: 0;
  flex: 1;
}

.touchpoint-card h4,
.attribution-card h4,
.action-card h4 {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}

.touchpoint-card-head > strong {
  font-size: 14px;
}

.user-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.user-avatar,
.touchpoint-icon,
.action-index {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 4px;
  background: var(--lr-surface-selected);
  color: var(--lr-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.user-name strong,
.user-name small {
  display: block;
}

.user-name strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name small {
  margin-top: 3px;
  color: var(--lr-text-disabled);
  font-size: 10px;
}

.analysis-depth {
  color: var(--lr-text-muted);
}

.user-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.user-facts > div {
  min-width: 0;
  padding-right: 10px;
}

.user-facts span,
.user-facts strong {
  display: block;
  white-space: nowrap;
}

.user-facts span {
  color: var(--lr-text-disabled);
  font-size: 10px;
}

.user-facts strong {
  margin-top: 4px;
  font-size: 12px;
}

.user-inference,
.inference-block,
.fact-block,
.action-basis,
.evidence-panel {
  margin-top: 12px;
  padding-left: 10px;
  border-left: 2px solid var(--lr-line);
}

.user-inference-head,
.attribution-summary,
.signal-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-inference p,
.inference-block p,
.fact-block p,
.action-basis p,
.evidence-panel p,
.touchpoint-card p,
.attribution-card p,
.action-card p {
  margin: 6px 0 0;
  color: var(--lr-text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.attribution-list,
.action-list {
  display: grid;
}

.action-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
}

.attribution-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, .7fr);
  gap: 18px;
  margin-top: 12px;
}

.gift-amount {
  color: var(--lr-text);
  font-size: 14px;
  white-space: nowrap;
}

.evidence-chain,
.example-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.evidence-chain li,
.example-list li {
  color: var(--lr-text-muted);
  font-size: 12px;
  line-height: 1.55;
}

.example-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.example-list time,
.evidence-chain time {
  color: var(--lr-text-disabled);
  white-space: nowrap;
}

.content-empty {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.content-empty h3,
.content-empty p {
  margin: 0;
}

.content-empty h3 {
  margin-top: 12px;
  font-size: 14px;
}

.content-empty p {
  margin-top: 7px;
  color: var(--lr-text-muted);
  font-size: 12px;
}

.export-dialog,
.delete-dialog {
  text-align: left;
}

.export-dialog form,
.delete-dialog form,
.settings-dialog form {
  margin: 0;
}

.dialog-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 4px;
  background: var(--lr-surface-selected);
}

.dialog-icon img {
  width: 18px;
  height: 18px;
}

.settings-dialog {
  width: min(560px, calc(100vw - 64px));
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--lr-line-soft);
}

.dialog-header h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--lr-text-muted);
  font-size: 11px;
}

.policy-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  color: var(--lr-text-muted);
  font-size: 12px;
  border-bottom: 1px solid var(--lr-line-soft);
}

.policy-room strong {
  color: var(--lr-text);
}

.policy-state {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--lr-text-muted);
  font-size: 12px;
}

.policy-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--lr-line);
  border-top-color: var(--lr-accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.policy-error {
  flex-direction: column;
  color: var(--lr-danger);
}

.policy-fields {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 0 0;
  border: 0;
}

.policy-choice,
.policy-field,
.retention-note {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--lr-line-soft);
}

.policy-choice strong,
.policy-choice small,
.retention-note strong,
.retention-note span {
  display: block;
}

.policy-choice strong,
.policy-field > span,
.retention-note strong {
  font-size: 12px;
}

.policy-choice small,
.retention-note span {
  margin-top: 4px;
  color: var(--lr-text-disabled);
  font-size: 10px;
  line-height: 1.5;
}

.policy-choice input {
  position: relative;
  width: 34px;
  height: 19px;
  flex: 0 0 auto;
  margin: 0;
  appearance: none;
  border: 1px solid var(--lr-line);
  border-radius: 10px;
  background: var(--lr-surface);
  cursor: pointer;
}

.policy-choice input::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--lr-text-muted);
  transition: transform .16s ease;
  content: "";
}

.policy-choice input:checked {
  border-color: var(--lr-accent);
  background: var(--lr-accent);
}

.policy-choice input:checked::after {
  transform: translateX(15px);
  background: #fff;
}

.policy-field select {
  min-width: 170px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--lr-line);
  border-radius: 5px;
  background: var(--lr-surface);
  color: var(--lr-text);
}

.policy-validation {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-left: 2px solid var(--lr-warning);
  color: var(--lr-warning);
  font-size: 11px;
}

.policy-actions {
  margin-top: 12px;
}

.delete-session-name {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.toast-region {
  position: fixed;
  z-index: 120;
  top: 0;
  right: 0;
}

.is-error {
  color: var(--lr-danger);
}

.account-gate {
  min-height: calc(100vh - var(--lr-topbar-height));
  display: grid;
  place-items: center;
  padding: 48px;
  text-align: center;
}

.account-gate > div {
  max-width: 420px;
}

.account-gate h1 {
  margin: 14px 0 8px;
  font-size: 22px;
}

.account-gate p {
  margin: 0 0 18px;
  color: var(--lr-text-secondary);
}

@media (max-width: 1200px) {
  .analytics-workspace {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .report-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .user-grid,
  .touchpoint-grid,
  .attribution-body {
    grid-template-columns: 1fr;
  }

  .metric-grid .delta-badge {
    display: none;
  }

  .metric-card {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
  }
}

@media (max-width: 1023px) {
  html,
  body {
    min-width: 1024px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: .42; }
  50% { opacity: .86; }
}
