:root {
  --graphite: var(--ay-bg);
  --graphite-deep: var(--ay-surface-sunken);
  --purple: var(--ay-violet-deep);
  --purple-light: var(--ay-violet);
  --lime: var(--ay-profit);
  --ice: var(--ay-text);
  --muted: var(--ay-text-muted);
  --faint: var(--ay-text-disabled);
  --line: var(--ay-border);
  --line-strong: color-mix(in srgb, var(--ay-ice) 20%, transparent);
  --danger: var(--ay-loss-text);
  --warn: var(--ay-warning-text);
  --panel: var(--ay-surface);
  --shadow: var(--ay-shadow-card);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--graphite);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ice);
  font-family: var(--ay-font-sans);
  background: var(--ay-bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--ay-bg);
  backdrop-filter: blur(18px);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.42;
}

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

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--ay-bg);
  backdrop-filter: blur(22px);
}

.brand {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.brand-mark i {
  position: absolute;
  display: block;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.brand-mark i:nth-child(1) {
  left: 7px;
  top: 4px;
  width: 23px;
  height: 11px;
  background: var(--ay-lime);
  transform: rotate(5deg);
}

.brand-mark i:nth-child(2) {
  left: 6px;
  bottom: 3px;
  width: 10px;
  height: 25px;
  background: var(--ice);
  transform: rotate(-24deg);
}

.brand-mark i:nth-child(3) {
  right: 5px;
  bottom: 3px;
  width: 10px;
  height: 25px;
  background: var(--purple-light);
  transform: rotate(24deg);
}

.brand b {
  display: block;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--ay-accent-text);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(243, 245, 255, 0.72);
  background: transparent;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item.is-active {
  color: var(--ay-text);
  border-color: rgba(134, 134, 226, 0.28);
  background: rgba(97, 97, 172, 0.26);
}

.nav-item:not(:disabled):hover {
  transform: translateX(2px);
  background: rgba(243, 245, 255, 0.06);
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 245, 255, 0.12);
  border-radius: 50%;
  color: var(--ay-text);
  background: var(--ay-accent-soft);
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
}

.nav-item.is-active .nav-icon {
  color: var(--ay-on-accent);
  background: var(--ay-accent);
  box-shadow: none;
}

.nav-item span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-status {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 16%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ay-violet) 7%, transparent);
}

.rail-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: none;
}

.rail-status.is-ok i {
  background: var(--ay-profit);
  box-shadow: none;
}

.rail-status.is-error i {
  background: var(--danger);
  box-shadow: none;
}

.rail-status b {
  display: block;
  font-size: 11px;
}

.rail-status small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surface {
  min-width: 0;
  padding: 24px;
}

.view[hidden] {
  display: none;
}

.view {
  animation: viewIn 180ms ease both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--ay-accent-text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 36px;
  line-height: 1;
}

h2 {
  font-size: 19px;
  line-height: 1.1;
}

.top-actions,
.panel-head,
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ghost-btn,
.primary-btn {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--ay-radius-sm);
  color: var(--ice);
  background: var(--ay-surface);
  font-weight: 900;
}

.primary-btn {
  border-color: var(--ay-accent);
  color: var(--ay-on-accent);
  background: var(--ay-accent);
}

.primary-btn:not(:disabled):hover {
  border-color: var(--ay-accent-hover);
  background: var(--ay-accent-hover);
}

.api-settings {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ay-surface);
  box-shadow: var(--shadow);
}

.api-settings[hidden] {
  display: none;
}

.api-settings label {
  display: grid;
  gap: 6px;
}

.api-settings label span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.api-settings input {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(243, 245, 255, 0.13);
  border-radius: 9px;
  outline: 0;
  color: var(--ice);
  background: var(--ay-surface-input);
}

.products-shell {
  display: grid;
  gap: 12px;
}

.products-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.products-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 138px 182px auto;
  align-items: center;
  gap: 10px;
  width: min(720px, 100%);
}

.products-context {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 26%, transparent);
  border-radius: 999px;
  color: var(--ay-accent-text);
  background: color-mix(in srgb, var(--ay-violet) 8%, transparent);
  font-size: 10px;
  font-weight: 900;
}

.products-context[hidden] {
  display: none;
}

.products-actions input,
.products-actions select {
  min-height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(243, 245, 255, 0.13);
  border-radius: 11px;
  outline: 0;
  color: var(--ice);
  background: var(--ay-surface-input);
  font-weight: 800;
}

.products-actions select {
  padding-right: 34px;
}

.products-actions input:focus,
.products-actions select:focus {
  border-color: color-mix(in srgb, var(--ay-violet) 34%, transparent);
  box-shadow: var(--ay-focus-ring);
}

.product-modes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}

.mode-chip {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid rgba(243, 245, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: var(--ay-surface);
  font-size: 12px;
  font-weight: 900;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.mode-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(134, 134, 226, 0.28);
  color: var(--ay-text);
}

.mode-chip.is-active {
  border-color: color-mix(in srgb, var(--ay-violet) 46%, transparent);
  color: var(--ay-on-accent);
  background: var(--ay-accent);
  box-shadow: none;
}

.product-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-tile {
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(243, 245, 255, 0.1);
  border-radius: 12px;
  background: var(--ay-surface);
  box-shadow: var(--shadow);
}

.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-tile strong {
  display: block;
  margin-top: 12px;
  font-size: 32px;
  line-height: 1;
}

.products-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 12px;
  align-items: start;
}

.products-panel,
.product-inspector {
  min-height: 560px;
}

.product-list {
  display: grid;
  gap: 9px;
  overflow: auto;
  max-height: 620px;
  margin-top: 14px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.product-card {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(330px, 0.86fr);
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 12px;
  color: inherit;
  background: var(--ay-surface);
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.product-card:hover {
  transform: translateY(-1px);
  border-color: rgba(134, 134, 226, 0.3);
  background: var(--ay-surface-hover);
}

.product-card.is-selected {
  border-color: color-mix(in srgb, var(--ay-violet) 38%, transparent);
  background: var(--ay-surface);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ay-violet) 72%, transparent);
}

.product-thumb,
.inspector-thumb {
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 24%, transparent);
  border-radius: 13px;
  color: var(--ay-on-accent);
  background: var(--ay-accent);
  font-weight: 900;
  box-shadow: none;
}

.product-thumb img,
.inspector-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-thumb {
  width: 48px;
  height: 48px;
}

.product-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.product-title {
  display: grid;
  gap: 5px;
}

.product-title b {
  max-width: 440px;
  overflow: hidden;
  color: var(--ay-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-title small,
.metric-muted {
  color: var(--faint);
  font-size: 10px;
}

.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.product-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.product-card-metrics span,
.inspector-price-grid div,
.inspector-facts div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 10px;
  background: var(--ay-surface);
}

.product-card-metrics small,
.inspector-price-grid span,
.inspector-facts span {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.product-card-metrics b,
.inspector-price-grid b,
.inspector-facts b {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--ay-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(134, 134, 226, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(134, 134, 226, 0.08);
  font-size: 9px;
  font-weight: 900;
}

.mini-tag.is-good {
  border-color: var(--ay-profit-border);
  color: var(--ay-profit-text);
  background: var(--ay-profit-soft);
}

.mini-tag.is-warn {
  border-color: color-mix(in srgb, var(--ay-orange) 28%, transparent);
  color: var(--warn);
  background: color-mix(in srgb, var(--ay-orange) 8%, transparent);
}

.metric {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 900;
}

.metric strong {
  color: var(--ice);
  font-size: 15px;
}

.metric.is-good strong {
  color: var(--ay-profit-text);
}

.metric.is-bad strong {
  color: var(--danger);
}

.table-empty {
  height: 220px;
  color: var(--faint);
  text-align: center;
}

.workbench-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px dashed rgba(134, 134, 226, 0.22);
  border-radius: 12px;
  color: var(--muted);
  background: var(--ay-surface);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.product-inspector {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

.product-inspector::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 10%, color-mix(in srgb, var(--ay-violet) 13%, transparent), transparent 30%),
    linear-gradient(145deg, rgba(97, 97, 172, 0.12), transparent 58%);
}

.product-inspector > * {
  position: relative;
}

.inspector-empty {
  min-height: 500px;
  display: grid;
  align-content: center;
  gap: 10px;
  color: var(--muted);
}

.inspector-empty h2,
.inspector-head h2 {
  margin: 0;
  color: var(--ay-text);
}

.inspector-empty p {
  max-width: 330px;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.inspector-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.inspector-thumb {
  width: 62px;
  height: 62px;
  border-radius: 17px;
  font-size: 22px;
}

.inspector-head small {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-price-grid,
.inspector-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.inspector-price-grid div {
  min-height: 68px;
  background: var(--ay-surface);
}

.inspector-price-grid b {
  color: var(--ay-accent-text);
  font-size: 18px;
}

.inspector-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.inspector-actions .primary-btn {
  grid-column: 1 / -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-card {
  padding: 14px 18px 16px;
}

.main-stats {
  position: relative;
  overflow: hidden;
}

.main-stats::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--ay-violet) 10%, transparent), transparent 28%),
    radial-gradient(circle at 92% 14%, rgba(134, 134, 226, 0.18), transparent 28%);
}

.main-stats > * {
  position: relative;
}

.freshness,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(134, 134, 226, 0.22);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(134, 134, 226, 0.08);
  font-size: 9px;
  font-weight: 900;
}

.freshness.is-ok,
.pill.is-ok {
  border-color: var(--ay-profit-border);
  color: var(--ay-profit-text);
  background: var(--ay-profit-soft);
}

.freshness.is-error {
  border-color: color-mix(in srgb, var(--ay-rose) 24%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--ay-rose) 8%, transparent);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.stat-cell {
  position: relative;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "note value";
  align-items: center;
  gap: 4px 18px;
  overflow: hidden;
  padding: 13px 18px 13px 58px;
  border: 1px solid rgba(243, 245, 255, 0.11);
  border-radius: 12px;
  background: var(--ay-surface);
}

.stat-cell::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 35%, transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--ay-accent) 0 4px, transparent 5px),
    color-mix(in srgb, var(--ay-violet) 10%, transparent);
  box-shadow: none;
  transform: translateY(-50%);
}

.stat-cell::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--ay-accent), rgba(134, 134, 226, 0.2));
}

.stat-cell.is-primary {
  border-color: color-mix(in srgb, var(--ay-violet) 22%, transparent);
  background: var(--ay-surface);
}

.stat-cell span {
  grid-area: label;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.stat-cell strong {
  grid-area: value;
  min-width: 58px;
  margin: 0;
  color: var(--ay-text);
  font-size: 32px;
  line-height: 1;
  text-align: right;
}

.stat-cell small {
  grid-area: note;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.coupon-panel,
.amazon-panel {
  position: relative;
  overflow: hidden;
  min-height: 150px;
}

.coupon-panel::before,
.amazon-panel::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 10px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(243, 245, 255, 0.22), transparent);
  opacity: 0.55;
}

.coupon-panel::after,
.amazon-panel::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -42px;
  width: 122px;
  height: 86px;
  border-radius: 48% 0 0 0;
  background: rgba(97, 97, 172, 0.12);
  filter: blur(0.2px);
  opacity: 0.65;
  pointer-events: none;
}

.coupon-panel > *,
.amazon-panel > * {
  position: relative;
  z-index: 1;
}

.coupon-code-row {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 8px;
  border: 1px dashed color-mix(in srgb, var(--ay-violet) 34%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ay-violet) 6%, transparent);
}

.coupon-code-row strong {
  overflow: hidden;
  color: var(--ice);
  font-size: 16px;
  letter-spacing: 0;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.integration-status {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 10px;
  color: var(--muted);
  background: var(--ay-surface);
  font-size: 12px;
  font-weight: 800;
}

.panel {
  min-width: 0;
  padding: 16px 18px;
}

.calendar-panel {
  position: relative;
  min-height: 178px;
  overflow: hidden;
}

.calendar-panel::before {
  content: "";
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ay-violet) 16%, transparent), rgba(134, 134, 226, 0.32), transparent);
}

.calendar-panel::after {
  content: "";
  position: absolute;
  left: -20%;
  bottom: 16px;
  width: 20%;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--ay-violet) 55%, transparent), transparent 70%);
  filter: blur(5px);
  animation: calendar-scan 5.8s ease-in-out infinite;
}

@keyframes calendar-scan {
  0%,
  12% {
    transform: translateX(0);
    opacity: 0;
  }

  24% {
    opacity: 0.85;
  }

  78% {
    opacity: 0.5;
  }

  100% {
    transform: translateX(700%);
    opacity: 0;
  }
}

.calendar-strip {
  display: grid;
  position: relative;
  z-index: 1;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, 76px);
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 14px;
  padding: 2px 2px 10px;
  scrollbar-color: var(--ay-border-strong) transparent;
  scrollbar-width: thin;
}

.calendar-strip.is-preview {
  grid-auto-columns: minmax(58px, 72px);
}

.calendar-strip::-webkit-scrollbar {
  height: 7px;
}

.calendar-strip::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(243, 245, 255, 0.06);
}

.calendar-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-light), var(--ay-accent));
}

.day-card {
  min-height: 104px;
  display: grid;
  grid-template-rows: auto auto auto minmax(34px, 1fr);
  align-content: stretch;
  gap: 6px;
  padding: 9px 8px;
  border: 1px solid rgba(134, 134, 226, 0.16);
  border-radius: 10px;
  background: var(--ay-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.day-card:hover,
.day-card:focus-visible {
  outline: 0;
  border-color: color-mix(in srgb, var(--ay-violet) 34%, transparent);
  background: var(--ay-surface-hover);
  transform: translateY(-2px);
}

.day-card.is-today {
  border-color: color-mix(in srgb, var(--ay-violet) 28%, transparent);
  background: color-mix(in srgb, var(--ay-violet) 8%, transparent);
}

.day-card.is-preview {
  border-color: rgba(134, 134, 226, 0.2);
  opacity: 0.92;
}

.day-card.is-preview .bar i {
  animation: impulse-breathe 2.8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.day-top {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.day-card strong {
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.day-card small {
  color: var(--faint);
  font-size: 9px;
  text-align: center;
}

.bar {
  min-height: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(243, 245, 255, 0.04), transparent),
    rgba(243, 245, 255, 0.055);
}

.bar i {
  display: block;
  width: 100%;
  height: var(--activity, 18%);
  min-height: 6px;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--ay-accent), rgba(134, 134, 226, 0.7));
  box-shadow: none;
}

@keyframes impulse-breathe {
  0%,
  100% {
    filter: brightness(0.92);
  }

  50% {
    filter: brightness(1.18);
  }
}

.calendar-strip.is-empty {
  display: block;
  overflow: hidden;
}

.calendar-empty {
  position: relative;
  min-height: 86px;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px dashed color-mix(in srgb, var(--ay-violet) 22%, transparent);
  border-radius: 12px;
  background: var(--ay-surface);
}

.calendar-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0 34%, rgba(243, 245, 255, 0.055) 45%, transparent 58%);
  animation: calendar-empty-glide 3.8s ease-in-out infinite;
}

.calendar-empty-rail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-empty-rail i {
  height: 44px;
  border: 1px solid rgba(134, 134, 226, 0.12);
  border-radius: 10px;
  background: var(--ay-surface);
}

.calendar-empty-rail i:nth-child(2n) {
  background: var(--ay-surface);
}

.calendar-empty span {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
}

@keyframes calendar-empty-glide {
  0% {
    transform: translateX(-70%);
  }

  100% {
    transform: translateX(70%);
  }
}

.facts-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.fact-item {
  padding: 12px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 10px;
  color: var(--muted);
  background: var(--ay-surface);
  font-size: 12px;
  line-height: 1.45;
}

.fact-item b {
  color: var(--ay-accent-text);
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--faint);
  text-align: center;
}

.purchase-shell {
  display: grid;
  gap: 12px;
}

.purchase-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.purchase-lead {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.purchase-status-pill {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 13px;
  border: 1px solid rgba(134, 134, 226, 0.22);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(134, 134, 226, 0.08);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-status-pill.is-ok {
  border-color: var(--ay-profit-border);
  color: var(--ay-profit-text);
  background: var(--ay-profit-soft);
}

.purchase-status-pill.is-error {
  border-color: color-mix(in srgb, var(--ay-rose) 30%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--ay-rose) 8%, transparent);
}

.purchase-readiness {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.purchase-readiness-card {
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 12px;
  background: var(--ay-surface);
}

.purchase-readiness-card span,
.purchase-profile-summary span,
.purchase-decision span {
  display: block;
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-readiness-card b {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--ice);
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-readiness-card.is-ok {
  border-color: var(--ay-profit-border);
}

.purchase-readiness-card.is-ok b {
  color: var(--ay-profit-text);
}

.purchase-readiness-card.is-warn {
  border-color: color-mix(in srgb, var(--ay-orange) 22%, transparent);
}

.purchase-readiness-card.is-warn b {
  color: var(--warn);
}

.purchase-readiness-card.is-error {
  border-color: color-mix(in srgb, var(--ay-rose) 22%, transparent);
}

.purchase-readiness-card.is-error b {
  color: var(--danger);
}

.purchase-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.purchase-form label {
  display: grid;
  gap: 6px;
}

.purchase-form span,
.purchase-restrictions span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-form input,
.purchase-form select {
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(243, 245, 255, 0.12);
  border-radius: 11px;
  outline: 0;
  color: var(--ice);
  background: var(--ay-surface-input);
  font-weight: 850;
}

.purchase-form input:focus,
.purchase-form select:focus {
  border-color: color-mix(in srgb, var(--ay-violet) 34%, transparent);
  box-shadow: var(--ay-focus-ring);
}

.purchase-profile-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.purchase-advanced {
  margin-top: 12px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 13px;
  background: var(--ay-surface);
}

.purchase-advanced summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.purchase-advanced summary::-webkit-details-marker {
  display: none;
}

.purchase-advanced summary span {
  color: var(--ice);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.purchase-advanced summary b {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-form-advanced {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0 12px 12px;
  margin-top: 0;
}

.purchase-profile-summary span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 16%, transparent);
  border-radius: 999px;
  color: rgba(243, 245, 255, 0.72);
  background: color-mix(in srgb, var(--ay-violet) 6%, transparent);
}

.purchase-restrictions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.purchase-restrictions label {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(134, 134, 226, 0.2);
  border-radius: 999px;
  background: rgba(134, 134, 226, 0.08);
}

.purchase-restrictions input {
  accent-color: var(--ay-accent);
}

.purchase-run-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 12px;
}

.purchase-run-panel {
  position: relative;
  overflow: hidden;
  min-height: 260px;
}

.purchase-run-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 14%, color-mix(in srgb, var(--ay-violet) 12%, transparent), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(134, 134, 226, 0.18), transparent 30%);
}

.purchase-run-panel > * {
  position: relative;
}

.purchase-run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.purchase-run-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-btn {
  border-color: color-mix(in srgb, var(--ay-rose) 32%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--ay-rose) 8%, transparent);
}

.purchase-progress {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.purchase-progress-track {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(243, 245, 255, 0.12);
  border-radius: 999px;
  background: var(--ay-surface-sunken);
}

.purchase-progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--ay-accent), rgba(134, 134, 226, 0.86));
  box-shadow: none;
  transition: width 220ms ease;
}

.purchase-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.purchase-progress-meta b {
  color: var(--ay-accent-text);
}

.purchase-decision {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--ay-orange) 18%, transparent);
  border-radius: 14px;
  background: var(--ay-surface);
}

.purchase-decision b {
  color: var(--ice);
  font-size: 18px;
  line-height: 1.05;
}

.purchase-decision p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.purchase-decision small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}

.purchase-decision.is-ok {
  border-color: var(--ay-profit-border);
}

.purchase-decision.is-ok b {
  color: var(--ay-profit-text);
}

.purchase-decision.is-error {
  border-color: color-mix(in srgb, var(--ay-rose) 25%, transparent);
}

.purchase-decision.is-error b {
  color: var(--danger);
}

.purchase-status-box,
.purchase-health {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 12px;
  color: var(--muted);
  background: var(--ay-surface);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.purchase-status-box.is-ok {
  border-color: var(--ay-profit-border);
  color: var(--ay-profit-text);
  background: var(--ay-profit-soft);
}

.purchase-status-box.is-error {
  border-color: color-mix(in srgb, var(--ay-rose) 25%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--ay-rose) 7%, transparent);
}

.purchase-health {
  display: grid;
  gap: 6px;
  color: var(--faint);
}

.purchase-explain-panel {
  min-height: 0;
}

.purchase-diagnostics {
  align-self: start;
  padding: 0;
  overflow: hidden;
}

.purchase-diagnostics summary {
  min-height: 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: start;
  gap: 12px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.purchase-diagnostics summary::-webkit-details-marker {
  display: none;
}

.purchase-diagnostics summary h2 {
  margin-bottom: 7px;
}

.purchase-diagnostics summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.purchase-diagnostics summary > b {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 22%, transparent);
  border-radius: 999px;
  color: var(--ay-accent-text);
  background: color-mix(in srgb, var(--ay-violet) 8%, transparent);
  font-size: 12px;
}

.purchase-diagnostics[open] summary {
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.purchase-exclusions {
  display: grid;
  gap: 7px;
  padding: 12px;
  margin-top: 0;
}

.purchase-exclusion-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 62px;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 10px;
  color: var(--muted);
  background: var(--ay-surface);
}

.purchase-exclusion-row b {
  display: block;
  color: var(--ice);
  font-size: 12px;
  font-weight: 900;
}

.purchase-exclusion-row span {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.purchase-exclusion-row em {
  font-style: normal;
  color: var(--ay-accent-text);
  font-size: 17px;
  font-weight: 900;
  text-align: right;
}

.purchase-exclusion-row small {
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
}

.purchase-result-panel {
  min-height: 220px;
}

.purchase-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.purchase-downloads[hidden] {
  display: none;
}

.purchase-result-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.purchase-result-summary div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 12px;
  background: var(--ay-surface);
}

.purchase-result-summary span {
  display: block;
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-result-summary b {
  display: block;
  margin-top: 10px;
  color: var(--ay-text);
  font-size: 22px;
  line-height: 1;
}

#purchaseResultEmpty[hidden] {
  display: none;
}

#purchaseResultEmpty {
  min-height: 170px;
}

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .home-grid,
  .home-actions,
  .product-summary,
  .products-workbench,
  .purchase-run-grid,
  .purchase-result-summary {
    grid-template-columns: 1fr;
  }

  .purchase-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-readiness {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-inspector {
    position: static;
  }

  .product-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .product-card-metrics {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app {
    display: block;
  }

  .rail {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    grid-template-columns: 34px;
    justify-content: center;
    padding: 6px;
  }

  .nav-item span:last-child {
    display: none;
  }

  .surface {
    padding: 16px;
  }

  .topbar,
  .card-head,
  .panel-head,
  .purchase-intro,
  .purchase-run-head {
    align-items: stretch;
    flex-direction: column;
  }

  .api-settings,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .products-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .products-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .product-card {
    grid-template-columns: 1fr;
  }

  .product-thumb {
    display: none;
  }

  .product-card-metrics,
  .inspector-price-grid,
  .inspector-facts,
  .purchase-readiness,
  .inspector-actions,
  .purchase-form {
    grid-template-columns: 1fr;
  }

  .purchase-run-actions,
  .purchase-downloads {
    justify-content: stretch;
  }
}

/* Home workspace v2: compact navigation, impulse strip and an actionable work queue. */
@media (min-width: 761px) {
  .app {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .rail {
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
  }

  .rail .brand {
    width: 48px;
    justify-content: center;
    padding: 0;
  }

  .rail .brand > span:last-child {
    display: none;
  }

  .rail .nav {
    width: 100%;
  }

  .rail .nav-item {
    position: relative;
    width: 48px;
    min-height: 48px;
    grid-template-columns: 34px;
    justify-content: center;
    margin: 0 auto;
    padding: 6px;
  }

  .rail .nav-item span:last-child {
    position: absolute;
    z-index: 80;
    left: 56px;
    top: 50%;
    display: block;
    overflow: visible;
    padding: 7px 9px;
    border: 1px solid rgba(243, 245, 255, 0.11);
    border-radius: 6px;
    color: var(--ice);
    background: var(--ay-surface);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    font-size: 11px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translate(5px, -50%);
    transition: opacity 150ms ease, transform 150ms ease;
  }

  .rail .nav-item:hover span:last-child,
  .rail .nav-item:focus-visible span:last-child {
    opacity: 1;
    transform: translate(0, -50%);
  }

  .rail .rail-status {
    width: 40px;
    height: 40px;
    grid-template-columns: 8px;
    place-content: center;
    gap: 0;
    margin: auto auto 0;
    padding: 0;
  }

  .rail .rail-status span {
    display: none;
  }
}

.view[data-view-panel="home"] .home-workspace {
  grid-template-columns: minmax(0, 1fr) 278px;
}

.view[data-view-panel="home"] .home-command-head {
  min-height: 78px;
  padding: 13px 20px;
}

.view[data-view-panel="home"] .home-command-head h2 {
  font-size: 20px;
}

.view[data-view-panel="home"] .home-command-head > div > p:last-child {
  margin-top: 5px;
  font-size: 11px;
}

.view[data-view-panel="home"] .signal-row {
  min-height: 64px;
  padding: 11px 20px;
}

.view[data-view-panel="home"] .signal-mark {
  width: 26px;
  height: 26px;
}

.view[data-view-panel="home"] .signal-row > strong {
  font-size: 24px;
}

.view[data-view-panel="home"] .activity-stage {
  min-height: 0;
  flex: 0 0 226px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
  background: var(--ay-surface);
}

.view[data-view-panel="home"] .activity-head h3 {
  font-size: 16px;
}

.view[data-view-panel="home"] .activity-head > div > p:last-child {
  margin-top: 4px;
  font-size: 10px;
}

.view[data-view-panel="home"] .calendar-strip {
  height: 132px;
  min-height: 132px;
  flex: none;
  grid-auto-columns: minmax(34px, 1fr);
  gap: 5px;
  margin-top: 8px;
  padding-bottom: 2px;
}

.view[data-view-panel="home"] .day-card {
  height: 128px;
  min-height: 128px;
  grid-template-rows: 88px 17px 17px;
  padding: 3px;
}

.view[data-view-panel="home"] .day-card .bar {
  min-height: 88px;
}

.home-opportunities {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: var(--ay-surface);
}

.home-opportunities-head {
  min-height: 68px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.home-opportunities-head h3 {
  margin: 2px 0 0;
  color: var(--ice);
  font-size: 17px;
  letter-spacing: 0;
}

.home-opportunities-head > div > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.home-opportunities-head .ghost-btn {
  min-height: 34px;
  flex: 0 0 auto;
  border-radius: 6px;
  font-size: 10px;
}

.home-opportunities-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.home-opportunity {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(190px, 1.5fr) repeat(4, minmax(64px, 0.55fr)) 92px 14px;
  gap: 12px;
  align-items: center;
  padding: 8px 20px;
  border: 0;
  border-bottom: 1px solid rgba(243, 245, 255, 0.07);
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background-color 160ms ease;
}

.home-opportunity:hover,
.home-opportunity:focus-visible {
  outline: 0;
  background: rgba(134, 134, 226, 0.07);
}

.home-opportunity-thumb {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(243, 245, 255, 0.1);
  border-radius: 7px;
  color: var(--ice);
  background: var(--ay-surface);
  font-size: 13px;
  font-weight: 900;
}

.home-opportunity-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--ay-white);
}

.home-opportunity-title,
.home-opportunity-metric {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.home-opportunity-title b,
.home-opportunity-title small,
.home-opportunity-metric b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-opportunity-title b {
  color: var(--ice);
  font-size: 11px;
}

.home-opportunity-title small,
.home-opportunity-metric small {
  color: var(--faint);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-opportunity-metric b {
  color: var(--muted);
  font-size: 11px;
}

.home-opportunity-metric.is-profit b,
.home-opportunity-metric.is-roi b {
  color: var(--ay-profit-text);
}

.home-opportunity-fresh {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.home-opportunity-fresh i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ay-profit);
  box-shadow: none;
}

.home-opportunity-route {
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--faint);
  border-right: 2px solid var(--faint);
  transform: rotate(45deg);
}

.home-opportunities-loading,
.home-opportunities-empty {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 28px;
  color: var(--muted);
  text-align: left;
}

.home-opportunities-loading > i,
.home-opportunities-empty > i {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 28%, transparent);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 46%, var(--ay-accent) 47% 53%, transparent 54%),
    color-mix(in srgb, var(--ay-violet) 6%, transparent);
}

.home-opportunities-loading > i {
  animation: opportunity-scan 1.4s ease-in-out infinite;
}

.home-opportunities-empty div {
  display: grid;
  gap: 5px;
}

.home-opportunities-empty b {
  color: var(--ice);
  font-size: 12px;
}

.home-opportunities-empty span,
.home-opportunities-loading span {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
}

@keyframes opportunity-scan {
  0%, 100% { transform: rotate(-18deg); opacity: 0.55; }
  50% { transform: rotate(72deg); opacity: 1; }
}

.view[data-view-panel="home"] .home-context-head {
  padding: 15px 15px 13px;
}

.view[data-view-panel="home"] .home-context .home-action {
  padding: 15px;
}

.view[data-view-panel="home"] .home-context .card-note {
  font-size: 10px;
}

.view[data-view-panel="home"] .home-context .coupon-code-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.view[data-view-panel="home"] .home-context .coupon-code-row .primary-btn {
  width: auto;
  padding: 0 10px;
  font-size: 9px;
}

@media (max-width: 1120px) {
  .home-opportunity {
    grid-template-columns: 38px minmax(170px, 1fr) repeat(2, minmax(64px, 0.5fr)) 14px;
  }

  .home-opportunity-metric:nth-of-type(3),
  .home-opportunity-metric:nth-of-type(4),
  .home-opportunity-fresh {
    display: none;
  }
}

@media (max-width: 760px) {
  .view[data-view-panel="home"] .activity-stage {
    min-height: 218px;
    flex-basis: auto;
  }

  .view[data-view-panel="home"] .calendar-strip {
    height: 132px;
    min-height: 132px;
    grid-auto-columns: 48px;
  }

  .view[data-view-panel="home"] .day-card {
    height: 128px;
    min-height: 128px;
  }

  .home-opportunities {
    min-height: 330px;
  }

  .home-opportunities-head {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .home-opportunities-head > div > p:last-child {
    display: none;
  }

  .home-opportunity {
    grid-template-columns: 38px minmax(0, 1fr) 58px 58px 12px;
    gap: 8px;
    padding: 8px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-opportunities-loading > i,
  .home-opportunity {
    animation: none;
    transition: none;
  }
}

/* Product Inspector v2: one decision surface with evidence on demand. */
@media (min-width: 1181px) {
  .products-workbench {
    grid-template-columns: minmax(560px, 1.12fr) minmax(460px, 0.88fr);
  }
}

.product-inspector {
  max-height: calc(100dvh - 126px);
  overflow: auto;
  padding: 0;
  background: var(--ay-surface);
  scrollbar-width: thin;
}

.product-inspector::before {
  display: none;
}

.inspector-workspace {
  min-height: 558px;
  display: flex;
  flex-direction: column;
}

.inspector-preview-note {
  padding: 7px 18px;
  border-bottom: 1px solid rgba(134, 134, 226, 0.18);
  color: var(--ay-accent-text);
  background: rgba(97, 97, 172, 0.14);
  font-size: 11px;
  font-weight: 800;
}

.inspector-sticky-head {
  position: relative;
  z-index: 2;
  padding: 18px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
  background: var(--ay-surface);
}

.inspector-identity {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
}

.inspector-identity h2 {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ay-text);
  font-size: 18px;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inspector-identity small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.inspector-listing-static,
.inspector-listing-select {
  min-height: 38px;
  display: flex;
  align-items: center;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid rgba(134, 134, 226, 0.2);
  border-radius: 8px;
  color: var(--ay-text);
  background: rgba(97, 97, 172, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.inspector-listing-select {
  justify-content: space-between;
  gap: 12px;
}

.inspector-listing-select > span {
  flex: 0 0 auto;
  color: var(--muted);
}

.inspector-listing-select select {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  color: var(--ice);
  background: transparent;
  font: inherit;
  text-align: right;
}

.inspector-decision {
  margin-top: 14px;
  padding: 13px 0 2px 14px;
  border-left: 3px solid rgba(134, 134, 226, 0.7);
}

.inspector-workspace[data-decision="good"] .inspector-decision {
  border-left-color: var(--ay-profit);
}

.inspector-workspace[data-decision="warning"] .inspector-decision {
  border-left-color: var(--warn);
}

.inspector-workspace[data-decision="blocked"] .inspector-decision {
  border-left-color: var(--danger);
}

.inspector-decision small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inspector-decision strong {
  display: block;
  margin-top: 4px;
  color: var(--ay-text);
  font-size: 16px;
}

.inspector-decision p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inspector-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 16px;
}

.inspector-actions .primary-btn {
  grid-column: 1 / -1;
}

.inspector-actions .ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 14px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
  background: var(--ay-surface-sunken);
}

.inspector-tabs button {
  min-height: 44px;
  position: relative;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
  transition: color 160ms ease, background 160ms ease;
}

.inspector-tabs button:hover {
  color: var(--ay-text);
  background: rgba(134, 134, 226, 0.05);
}

.inspector-tabs button::after {
  content: "";
  position: absolute;
  right: 18%;
  bottom: -1px;
  left: 18%;
  height: 2px;
  background: var(--violet);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 160ms ease, transform 160ms ease;
}

.inspector-tabs button.is-active {
  color: var(--ice);
}

.inspector-tabs button.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.inspector-tab-body {
  flex: 1 1 auto;
  padding: 16px 18px 20px;
}

.inspector-tab-panel {
  animation: inspector-panel-in 180ms ease both;
}

@keyframes inspector-panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.inspector-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 8px;
  background: var(--ay-surface);
}

.inspector-metric {
  min-width: 0;
  min-height: 64px;
  display: grid;
  align-content: center;
  padding: 10px 11px;
}

.inspector-metric + .inspector-metric {
  border-left: 1px solid rgba(243, 245, 255, 0.08);
}

.inspector-metric span {
  overflow: hidden;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-metric b {
  overflow: hidden;
  margin-top: 6px;
  color: var(--ay-text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-metric.is-profit b {
  color: var(--ay-profit-text);
}

.inspector-match-line {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  padding: 15px 2px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.inspector-match-line div {
  min-width: 0;
}

.inspector-match-line small,
.inspector-section header span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.inspector-match-line b {
  display: block;
  margin-top: 5px;
  color: var(--ice);
  font-size: 12px;
  line-height: 1.4;
}

.inspector-section {
  padding-top: 15px;
}

.inspector-exceptions {
  display: grid;
  gap: 0;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.inspector-exceptions li {
  min-height: 48px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(243, 245, 255, 0.07);
}

.inspector-exceptions li > span {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--violet);
}

.inspector-exceptions li.is-warning > span { background: var(--warn); }
.inspector-exceptions li.is-change > span { background: var(--violet); }
.inspector-exceptions li.is-clear > span { background: var(--ay-profit); }

.inspector-exceptions b {
  color: var(--ice);
  font-size: 12px;
}

.inspector-exceptions p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.inspector-provenance {
  margin-top: 12px;
  border-top: 1px solid rgba(243, 245, 255, 0.08);
}

.inspector-provenance summary {
  padding: 13px 0 2px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.inspector-source-table {
  margin-top: 10px;
  border-top: 1px solid rgba(243, 245, 255, 0.08);
}

.inspector-source-row {
  display: grid;
  grid-template-columns: minmax(94px, 0.8fr) minmax(70px, 0.7fr) minmax(120px, 1.1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(243, 245, 255, 0.07);
  font-size: 11px;
}

.inspector-source-row > span,
.inspector-source-row small,
.inspector-source-row time {
  color: var(--muted);
}

.inspector-source-row.is-stale time { color: var(--warn); }
.inspector-source-row.is-missing b,
.inspector-source-row.is-missing time { color: var(--faint); }

.inspector-context-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
  font-size: 12px;
}

.inspector-context-line span,
.inspector-context-line small {
  color: var(--muted);
}

.inspector-calc-list {
  margin-top: 4px;
}

.inspector-calc-list > div {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.075);
  color: var(--muted);
  font-size: 12px;
}

.inspector-calc-list > div b {
  color: var(--ice);
}

.inspector-calc-list > div.is-result {
  color: var(--ice);
  font-weight: 850;
}

.inspector-calc-list > div.is-result b {
  color: var(--ay-profit-text);
  font-size: 15px;
}

.inspector-change {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 2px solid var(--violet);
  background: rgba(97, 97, 172, 0.08);
}

.inspector-change small,
.inspector-change p {
  color: var(--muted);
  font-size: 12px;
}

.inspector-change b { display: block; margin-top: 4px; color: var(--ice); }
.inspector-change p { margin: 5px 0 0; }

.inspector-market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 8px;
  background: var(--ay-surface);
}

.inspector-market-grid .inspector-metric:nth-child(3n + 1) {
  border-left: 0;
}

.inspector-market-grid .inspector-metric:nth-child(n + 4) {
  border-top: 1px solid rgba(243, 245, 255, 0.08);
}

.inspector-listing-proof {
  display: grid;
  gap: 5px;
  padding: 12px 0 2px;
}

.inspector-listing-proof b { color: var(--ice); font-size: 14px; }
.inspector-listing-proof span { color: var(--muted); font-size: 12px; }
.inspector-listing-proof small { color: var(--faint); font-size: 11px; }

.inspector-history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.inspector-history li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.inspector-history time {
  color: var(--faint);
  font-size: 11px;
}

.inspector-history b { color: var(--ice); font-size: 12px; }
.inspector-history p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.inspector-history li.is-empty { grid-template-columns: 1fr; }

@media (max-width: 1180px) {
  .product-inspector {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .inspector-sticky-head,
  .inspector-tab-body {
    padding-right: 14px;
    padding-left: 14px;
  }

  .inspector-tabs {
    overflow-x: hidden;
    overflow-y: hidden;
    display: flex;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .inspector-tabs::-webkit-scrollbar {
    display: none;
  }

  .inspector-tabs button {
    min-width: 0;
    flex: 1 1 25%;
    padding-inline: 4px;
    font-size: 11px;
  }

  .inspector-metric-strip,
  .inspector-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspector-metric:nth-child(odd) {
    border-left: 0;
  }

  .inspector-metric:nth-child(n + 3) {
    border-top: 1px solid rgba(243, 245, 255, 0.08);
  }

  .inspector-match-line,
  .inspector-source-row {
    grid-template-columns: 1fr;
  }

  .inspector-source-row {
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inspector-tab-panel,
  .inspector-tabs button,
  .inspector-tabs button::after {
    animation: none;
    transition: none;
  }
}

/* Home v4 cascade repair: keep the state-driven layer above the legacy prototype rules. */
.app.has-context .topbar h1 {
  display: none;
}

.context-nav-head {
  min-height: 48px;
  justify-content: flex-end;
  padding: 0 10px;
}

.context-sections {
  gap: 24px;
  padding: 16px 10px;
}

.context-sections > section > p,
.context-nav-head small,
.home-v3 .eyebrow,
.home-scope-popover header small {
  font-size: 11px;
  letter-spacing: 0;
}

.context-item {
  min-height: 54px;
  gap: 10px;
  padding: 7px 9px;
}

.context-item b {
  font-size: 13px;
}

.context-item small {
  margin-top: 4px;
  color: rgba(243, 245, 255, 0.58);
  font-size: 12px;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.context-item:disabled {
  opacity: 0.38;
}

.context-item.is-active {
  border-color: rgba(134, 134, 226, 0.28);
  background: rgba(97, 97, 172, 0.16);
  box-shadow: inset 2px 0 rgba(134, 134, 226, 0.72);
}

.rail .nav-item.is-active .nav-icon {
  border-color: color-mix(in srgb, var(--ay-violet) 85%, transparent);
  background: var(--ay-accent);
  box-shadow: none;
}

.scope-trigger span,
.scope-trigger b,
.topbar .ghost-btn {
  font-size: 12px;
}

.home-v3 {
  gap: 8px;
  padding-bottom: 8px;
  background: var(--ay-bg);
}

.home-overview,
.view[data-view-panel="home"] .activity-stage,
.home-priority-layout,
.home-operations {
  border: 0;
}

.home-overview-head {
  min-height: 96px;
  padding: 18px 24px 12px;
}

.home-overview-head h2 {
  font-size: 26px;
}

.home-overview-head > div > p:last-child,
.home-opportunities-head > div > p:last-child,
.activity-head > div > p:last-child {
  color: rgba(243, 245, 255, 0.66);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.home-action-notice {
  min-height: 60px;
  margin: 0 24px 12px;
  padding: 10px 12px;
  border-color: rgba(134, 134, 226, 0.28);
  background: rgba(97, 97, 172, 0.09);
}

.home-action-notice > span {
  background: var(--purple-light);
  box-shadow: none;
}

.home-action-notice b {
  font-size: 14px;
}

.home-action-notice small {
  margin-top: 4px;
  color: rgba(243, 245, 255, 0.66);
  font-size: 12px;
  font-weight: 600;
}

.home-action-notice .ghost-btn {
  min-height: 36px;
  font-size: 12px;
}

.view[data-view-panel="home"] .signal-copy b {
  font-size: 13px;
}

.view[data-view-panel="home"] .signal-copy small {
  color: rgba(243, 245, 255, 0.55);
  font-size: 12px;
}

.view[data-view-panel="home"] .signal-row > strong {
  font-size: 18px;
}

.view[data-view-panel="home"] .activity-stage {
  min-height: 132px;
  padding: 16px 24px 12px;
  background: var(--ay-surface);
}

.activity-head h3,
.home-opportunities-head h3,
.home-operations h3 {
  font-size: 18px;
}

.calendar-empty-state {
  color: rgba(243, 245, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
}

.home-priority-layout {
  min-height: 292px;
  border: 0;
  background: var(--ay-surface);
}

.home-opportunities-head {
  min-height: 80px;
  padding: 15px 24px;
}

.home-opportunity {
  min-height: 74px;
  padding: 10px 20px 10px 24px;
  border: 0;
}

.home-opportunity + .home-opportunity {
  box-shadow: inset 0 1px rgba(243, 245, 255, 0.055);
}

.home-opportunity-title b,
.home-inspector-product b {
  font-size: 14px;
}

.home-opportunity-title small,
.home-inspector-product small {
  color: rgba(243, 245, 255, 0.56);
  font-size: 12px;
}

.home-opportunity-reason small,
.home-inspector-prices dt,
.home-inspector-proof small,
.home-inspector-head small {
  font-size: 11px;
}

.home-opportunity-reason b,
.home-inspector-proof b,
.home-inspector-source {
  font-size: 12px;
}

.home-inspector-head b {
  font-size: 14px;
}

.home-operations > article {
  min-height: 184px;
  padding: 16px 24px 20px;
}

.home-job b {
  font-size: 13px;
}

.home-job small,
.home-job-empty {
  color: rgba(243, 245, 255, 0.58);
  font-size: 12px;
}

.home-job em {
  font-size: 12px;
}

.home-scope-popover h2 {
  font-size: 18px;
}

.home-scope-current span,
.home-scope-current b,
.home-scope-popover > p {
  font-size: 12px;
}

@media (max-width: 760px) {
  .home-overview-head {
    min-height: 86px;
    padding: 14px 16px 10px;
  }

  .home-overview-head h2 {
    font-size: 24px;
  }

  .view[data-view-panel="home"] .activity-stage,
  .home-opportunities-head,
  .home-operations > article {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Home v4: state-driven workspace, readable typography and restrained AYUTOR accents. */
.app.has-context .topbar h1 {
  display: none;
}

.context-nav-head {
  min-height: 48px;
  justify-content: flex-end;
  padding: 0 10px;
}

.context-sections {
  gap: 24px;
  padding: 16px 10px;
}

.context-sections > section > p,
.context-nav-head small,
.home-v3 .eyebrow,
.home-scope-popover header small {
  font-size: 11px;
  letter-spacing: 0;
}

.context-item {
  min-height: 54px;
  gap: 10px;
  padding: 7px 9px;
}

.context-item b {
  font-size: 13px;
}

.context-item small {
  margin-top: 4px;
  color: rgba(243, 245, 255, 0.58);
  font-size: 12px;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.context-item:disabled {
  opacity: 0.38;
}

.context-item.is-active {
  border-color: rgba(134, 134, 226, 0.28);
  background: rgba(97, 97, 172, 0.16);
  box-shadow: inset 2px 0 rgba(134, 134, 226, 0.72);
}

.rail .nav-item.is-active .nav-icon {
  border-color: color-mix(in srgb, var(--ay-violet) 85%, transparent);
  background: var(--ay-accent);
  box-shadow: none;
}

.rail-status[data-state="unconfigured"] i,
.rail-status[data-state="syncing"] i {
  background: var(--purple-light);
  box-shadow: none;
}

.rail-status[data-state="stale"] i,
.rail-status[data-state="partial"] i {
  background: var(--warn);
  box-shadow: none;
}

.rail-status[data-state="error"] i {
  background: var(--danger);
  box-shadow: none;
}

.scope-trigger span,
.scope-trigger b,
.topbar .ghost-btn {
  font-size: 12px;
}

.scope-trigger[data-state="unconfigured"] {
  border-color: rgba(134, 134, 226, 0.3);
  background: rgba(97, 97, 172, 0.13);
}

.scope-trigger[data-state="partial"],
.scope-trigger[data-state="stale"] {
  border-color: color-mix(in srgb, var(--ay-orange) 38%, transparent);
}

.scope-trigger[data-state="error"] {
  border-color: color-mix(in srgb, var(--ay-rose) 42%, transparent);
}

.home-v3 {
  gap: 8px;
  padding-bottom: 8px;
  background: var(--ay-bg);
}

.home-onboarding {
  position: relative;
  min-height: calc(100dvh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  overflow: hidden;
  background: var(--ay-surface);
}

.home-onboarding::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--purple-light);
  opacity: 0.72;
}

.home-onboarding-main {
  align-self: center;
  max-width: 760px;
  padding: 54px clamp(30px, 6vw, 88px);
}

.home-onboarding-mark {
  display: flex;
  align-items: center;
  margin-bottom: 34px;
}

.home-onboarding-mark span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(134, 134, 226, 0.32);
  border-radius: 8px;
  color: rgba(243, 245, 255, 0.72);
  background: var(--ay-surface);
  font-size: 12px;
  font-weight: 900;
}

.home-onboarding-mark span:nth-of-type(2) {
  color: var(--ice);
  border-color: rgba(134, 134, 226, 0.62);
  background: var(--purple);
  box-shadow: none;
}

.home-onboarding-mark i {
  position: relative;
  width: 48px;
  height: 1px;
  background: rgba(134, 134, 226, 0.26);
}

.home-onboarding-mark i::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--purple-light);
}

.home-onboarding h2 {
  max-width: 660px;
  margin: 7px 0 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.home-onboarding-main > p:not(.eyebrow) {
  max-width: 650px;
  margin: 14px 0 0;
  color: rgba(243, 245, 255, 0.72);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.home-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 34px 0 30px;
  padding: 0;
  list-style: none;
}

.home-setup-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.home-setup-steps li + li::before {
  content: "";
  position: absolute;
  top: 13px;
  right: calc(100% + 4px);
  width: 12px;
  height: 1px;
  background: rgba(134, 134, 226, 0.32);
}

.home-setup-steps span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(134, 134, 226, 0.42);
  border-radius: 50%;
  color: var(--purple-light);
  background: rgba(97, 97, 172, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.home-setup-steps b {
  font-size: 13px;
  line-height: 1.25;
}

.home-setup-action {
  min-width: 220px;
  min-height: 48px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: none;
}

.home-onboarding-result {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px clamp(26px, 4vw, 56px);
  background: rgba(97, 97, 172, 0.09);
  box-shadow: inset 1px 0 rgba(134, 134, 226, 0.14);
}

.home-onboarding-result h3 {
  margin: 7px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.home-onboarding-result ul {
  display: grid;
  gap: 24px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.home-onboarding-result li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.home-onboarding-result li > i {
  position: relative;
  width: 38px;
  height: 38px;
  display: block;
  border: 1px solid rgba(134, 134, 226, 0.3);
  border-radius: 50%;
  background: rgba(97, 97, 172, 0.13);
}

.home-onboarding-result li > i::before,
.home-onboarding-result li > i::after {
  content: "";
  position: absolute;
  background: var(--purple-light);
}

.setup-result-signal::before { left: 10px; bottom: 10px; width: 3px; height: 9px; box-shadow: 7px -6px 0 var(--purple-light), 14px 2px 0 var(--purple-light); }
.setup-result-products::before { left: 10px; right: 10px; top: 11px; height: 2px; box-shadow: 0 7px 0 var(--purple-light), 0 14px 0 var(--purple-light); }
.setup-result-jobs::before { inset: 10px; border: 2px solid var(--purple-light); border-left-color: transparent; border-radius: 50%; background: transparent !important; }

.home-onboarding-result b,
.home-onboarding-result small {
  display: block;
}

.home-onboarding-result b {
  font-size: 14px;
}

.home-onboarding-result small {
  margin-top: 5px;
  color: rgba(243, 245, 255, 0.62);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.app[data-home-state="syncing"] .home-onboarding-mark i::after {
  animation: homeSyncTravel 1.1s ease-in-out infinite;
}

@keyframes homeSyncTravel {
  from { right: calc(100% - 4px); opacity: 0.35; }
  50% { opacity: 1; }
  to { right: -1px; opacity: 0.35; }
}

.app[data-home-state="error"] .home-onboarding::before {
  background: var(--danger);
}

.app[data-home-state="error"] .home-onboarding-mark span:nth-of-type(2) {
  border-color: color-mix(in srgb, var(--ay-rose) 50%, transparent);
}

.home-overview,
.view[data-view-panel="home"] .activity-stage,
.home-priority-layout,
.home-operations {
  border: 0;
}

.home-overview {
  background: var(--ay-surface);
}

.home-overview-head {
  min-height: 96px;
  padding: 18px 24px 12px;
}

.home-overview-head h2 {
  font-size: 26px;
}

.home-overview-head > div > p:last-child,
.home-opportunities-head > div > p:last-child,
.activity-head > div > p:last-child {
  color: rgba(243, 245, 255, 0.66);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.freshness {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-color: rgba(134, 134, 226, 0.28);
  color: var(--purple-light);
  background: rgba(97, 97, 172, 0.1);
  font-size: 11px;
}

.freshness[data-state="ready"] { color: var(--ay-profit-text); border-color: var(--ay-profit-border); }
.freshness[data-state="stale"], .freshness[data-state="partial"] { color: var(--warn); border-color: color-mix(in srgb, var(--ay-orange) 38%, transparent); }
.freshness[data-state="error"] { color: var(--danger); border-color: color-mix(in srgb, var(--ay-rose) 40%, transparent); }

.home-action-notice {
  min-height: 60px;
  margin: 0 24px 12px;
  padding: 10px 12px;
  border-color: rgba(134, 134, 226, 0.28);
  background: rgba(97, 97, 172, 0.09);
}

.home-action-notice > span {
  background: var(--purple-light);
  box-shadow: none;
}

.home-action-notice[data-kind="warning"] {
  border-color: color-mix(in srgb, var(--ay-orange) 34%, transparent);
  background: color-mix(in srgb, var(--ay-orange) 6%, transparent);
}

.home-action-notice[data-kind="warning"] > span { background: var(--warn); box-shadow: none; }
.home-action-notice[data-kind="danger"] { border-color: color-mix(in srgb, var(--ay-rose) 36%, transparent); background: color-mix(in srgb, var(--ay-rose) 6%, transparent); }
.home-action-notice[data-kind="danger"] > span { background: var(--danger); box-shadow: none; }
.home-action-notice b { font-size: 14px; }
.home-action-notice small { margin-top: 4px; color: rgba(243, 245, 255, 0.66); font-size: 12px; font-weight: 600; }
.home-action-notice .ghost-btn { min-height: 36px; font-size: 12px; }

.signal-panel {
  margin: 0 24px 16px;
  overflow: hidden;
  border: 1px solid rgba(134, 134, 226, 0.18);
  border-radius: 8px;
  background: var(--ay-surface);
}

.signal-panel > header {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(97, 97, 172, 0.08);
}

.signal-panel > header b {
  font-size: 13px;
}

.signal-panel > header span {
  color: rgba(243, 245, 255, 0.56);
  font-size: 12px;
}

.view[data-view-panel="home"] .signal-panel .signal-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

.view[data-view-panel="home"] .signal-panel .signal-row {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 64px;
  grid-template-columns: 26px minmax(0, 1fr) auto 9px;
  gap: 9px;
  padding: 10px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.view[data-view-panel="home"] .signal-panel .signal-row + .signal-row {
  border-left: 1px solid rgba(243, 245, 255, 0.08);
}

.view[data-view-panel="home"] .signal-panel .signal-row:hover,
.view[data-view-panel="home"] .signal-panel .signal-row:focus-visible {
  background: rgba(97, 97, 172, 0.14);
  transform: none;
}

.view[data-view-panel="home"] .signal-copy b {
  font-size: 13px;
}

.view[data-view-panel="home"] .signal-copy small {
  color: rgba(243, 245, 255, 0.55);
  font-size: 12px;
}

.view[data-view-panel="home"] .signal-row > strong {
  font-size: 18px;
}

.view[data-view-panel="home"] .activity-stage {
  min-height: 132px;
  padding: 16px 24px 12px;
  background: var(--ay-surface);
}

.activity-head h3,
.home-opportunities-head h3,
.home-operations h3 {
  font-size: 18px;
}

.calendar-empty-state {
  color: rgba(243, 245, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
}

.home-priority-layout {
  min-height: 292px;
  background: var(--ay-surface);
}

.home-opportunities-head {
  min-height: 80px;
  padding: 15px 24px;
}

.home-opportunity {
  min-height: 74px;
  padding: 10px 20px 10px 24px;
  border: 0;
}

.home-opportunity + .home-opportunity {
  box-shadow: inset 0 1px rgba(243, 245, 255, 0.055);
}

.home-opportunity-title b,
.home-inspector-product b {
  font-size: 14px;
}

.home-opportunity-title small,
.home-inspector-product small {
  color: rgba(243, 245, 255, 0.56);
  font-size: 12px;
}

.home-opportunity-reason small,
.home-inspector-prices dt,
.home-inspector-proof small,
.home-inspector-head small {
  font-size: 11px;
}

.home-opportunity-reason b,
.home-inspector-proof b,
.home-inspector-source {
  font-size: 12px;
}

.home-inspector-head b {
  font-size: 14px;
}

.home-inspector {
  border-left-color: rgba(134, 134, 226, 0.22);
}

.home-inspector-source {
  color: rgba(243, 245, 255, 0.56);
}

.home-operations {
  background: var(--ay-surface);
}

.home-operations > article {
  min-height: 184px;
  padding: 16px 24px 20px;
}

.home-operations > article + article {
  border-left-color: rgba(134, 134, 226, 0.12);
}

.home-job b {
  font-size: 13px;
}

.home-job small,
.home-job-empty {
  color: rgba(243, 245, 255, 0.58);
  font-size: 12px;
}

.home-job em {
  font-size: 12px;
}

.home-scope-popover h2 {
  font-size: 18px;
}

.home-scope-current span,
.home-scope-current b,
.home-scope-popover > p {
  font-size: 12px;
}

@media (max-width: 980px) {
  .home-onboarding {
    grid-template-columns: 1fr;
  }

  .home-onboarding-main {
    max-width: none;
    padding: 40px 32px;
  }

  .home-onboarding-result {
    padding: 30px 32px 38px;
    box-shadow: inset 0 1px rgba(134, 134, 226, 0.14);
  }

  .home-onboarding-result ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .home-onboarding-result li {
    grid-template-columns: 34px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .home-onboarding {
    min-height: calc(100dvh - 112px);
  }

  .home-onboarding-main {
    padding: 30px 18px 34px;
  }

  .home-onboarding h2 {
    font-size: 24px;
  }

  .home-onboarding-mark {
    margin-bottom: 26px;
  }

  .home-onboarding-mark i {
    width: 32px;
  }

  .home-setup-steps {
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 28px 0;
  }

  .home-setup-steps li + li::before {
    top: auto;
    right: auto;
    bottom: calc(100% + 2px);
    left: 13px;
    width: 1px;
    height: 11px;
  }

  .home-setup-action {
    width: 100%;
  }

  .home-onboarding-result {
    padding: 28px 18px 34px;
  }

  .home-onboarding-result ul {
    grid-template-columns: 1fr;
  }

  .home-overview-head {
    min-height: 86px;
    padding: 14px 16px 10px;
  }

  .home-overview-head h2 {
    font-size: 24px;
  }

  .signal-panel {
    margin: 0 16px 14px;
  }

  .signal-panel > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 9px 11px;
  }

  .view[data-view-panel="home"] .signal-panel .signal-rail {
    grid-template-columns: 1fr 1fr;
  }

  .view[data-view-panel="home"] .signal-panel .signal-row:nth-child(odd) {
    border-left: 0;
  }

  .view[data-view-panel="home"] .signal-panel .signal-row:nth-child(n + 3) {
    border-top: 1px solid rgba(243, 245, 255, 0.08);
  }

  .view[data-view-panel="home"] .signal-copy small {
    display: none;
  }

  .home-action-notice {
    margin: 0 16px 12px;
  }

  .view[data-view-panel="home"] .activity-stage,
  .home-opportunities-head,
  .home-operations > article {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Purchase workspace v2: one guided flow instead of a stack of status panels. */
.purchase-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  gap: 14px;
}

.purchase-composer,
.purchase-run-panel,
.purchase-result-panel {
  border: 1px solid rgba(243, 245, 255, 0.12);
  border-radius: 8px;
  background: var(--ay-surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.purchase-composer {
  overflow: hidden;
}

.purchase-composer-head {
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.purchase-composer-head h2 {
  font-size: 24px;
}

.purchase-lead {
  max-width: 620px;
  margin-top: 7px;
  font-size: 12px;
}

.purchase-status-pill {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 9px;
}

.purchase-composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.purchase-recipe {
  min-width: 0;
  padding: 18px 22px 20px;
}

.purchase-source-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.purchase-form label {
  gap: 7px;
}

.purchase-form span,
.purchase-thresholds > label > span {
  color: rgba(243, 245, 255, 0.48);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-form input,
.purchase-form select {
  min-height: 42px;
  border-radius: 7px;
  background: var(--ay-surface-input);
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.purchase-form input:hover,
.purchase-form select:hover {
  background: var(--ay-surface-hover);
}

.purchase-thresholds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid rgba(134, 134, 226, 0.23);
  border-radius: 8px;
  background: rgba(134, 134, 226, 0.18);
}

.purchase-thresholds label {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 13px 14px 12px;
  background: var(--ay-surface-2);
}

.purchase-thresholds label > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.purchase-thresholds input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ice);
  background: transparent;
  font-size: 25px;
  font-weight: 900;
}

.purchase-thresholds input::placeholder {
  color: rgba(243, 245, 255, 0.27);
  font-size: 14px;
}

.purchase-thresholds i {
  color: var(--ay-accent-text);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.purchase-advanced {
  margin-top: 12px;
  border-radius: 7px;
  background: var(--ay-surface);
  transition: border-color 180ms ease, background 180ms ease;
}

.purchase-advanced[open] {
  border-color: rgba(134, 134, 226, 0.24);
  background: var(--ay-surface);
}

.purchase-advanced summary {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 18px;
  justify-content: initial;
  padding: 0 13px;
}

.purchase-advanced summary b {
  text-align: right;
}

.purchase-advanced summary > i,
.purchase-diagnostics-toggle > i {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(243, 245, 255, 0.55);
  border-bottom: 2px solid rgba(243, 245, 255, 0.55);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.purchase-advanced[open] summary > i {
  transform: rotate(225deg) translate(-2px, -2px);
}

.purchase-advanced-body {
  padding: 2px 13px 13px;
  transform-origin: top;
  animation: purchase-expand 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.purchase-form-advanced {
  grid-template-columns: repeat(2, minmax(0, 220px));
  padding: 0;
  margin-top: 8px;
}

.purchase-restrictions {
  margin-top: 12px;
}

.purchase-restrictions label {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.purchase-restrictions label:has(input:checked) {
  border-color: color-mix(in srgb, var(--ay-violet) 32%, transparent);
  background: color-mix(in srgb, var(--ay-violet) 9%, transparent);
}

.purchase-launch-dock {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 19px;
  border-left: 1px solid rgba(243, 245, 255, 0.08);
  background: var(--ay-surface-2);
}

.purchase-launch-mark {
  width: 62px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.purchase-launch-mark i {
  height: 9px;
  display: block;
  border-radius: 3px;
  background: var(--purple-light);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.22);
}

.purchase-launch-mark i:nth-child(1) {
  width: 14px;
  background: var(--ay-lime);
}

.purchase-launch-mark i:nth-child(2) {
  width: 23px;
}

.purchase-launch-mark i:nth-child(3) {
  width: 9px;
  background: var(--ice);
}

.purchase-launch-dock > div > span {
  display: block;
  color: var(--faint);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-profile-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 7px;
}

.purchase-profile-summary span {
  min-height: 25px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(243, 245, 255, 0.72);
  background: transparent;
  text-transform: none;
}

.purchase-profile-summary span:nth-child(n + 5) {
  display: none;
}

.purchase-decision {
  gap: 6px;
  margin-top: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.purchase-decision b {
  font-size: 18px;
}

.purchase-decision small {
  display: none;
}

.purchase-decision.is-error b {
  color: var(--ice);
}

.purchase-connection-note {
  padding: 10px 11px;
  border-left: 2px solid var(--danger);
  color: rgba(243, 245, 255, 0.72);
  background: color-mix(in srgb, var(--ay-rose) 7%, transparent);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.purchase-launch-dock .purchase-run-actions {
  display: grid;
  justify-content: stretch;
  gap: 6px;
}

.purchase-start-btn {
  min-height: 48px;
  width: 100%;
  border-radius: 8px;
  font-size: 14px;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.purchase-start-btn:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: none;
}

.purchase-text-btn {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}

.purchase-text-btn:hover {
  color: var(--ice);
}

.purchase-flow-stage:not([hidden]),
.purchase-result-grid:not([hidden]) {
  display: block;
  animation: purchase-rise 360ms cubic-bezier(0.18, 0.82, 0.28, 1) both;
}

.purchase-run-panel,
.purchase-result-panel {
  padding: 20px 22px;
}

.purchase-run-panel {
  min-height: 0;
  overflow: hidden;
}

.purchase-run-panel::before {
  display: none;
}

.purchase-run-head {
  align-items: center;
}

.purchase-run-head h2 {
  font-size: 22px;
}

.purchase-flow-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 24px;
}

.purchase-flow-steps::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 6px;
  height: 2px;
  background: rgba(243, 245, 255, 0.1);
}

.purchase-flow-steps div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  transition: color 220ms ease;
}

.purchase-flow-steps i {
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 3px solid var(--ay-surface);
  border-radius: 50%;
  background: rgba(243, 245, 255, 0.24);
  box-shadow: 0 0 0 1px rgba(243, 245, 255, 0.12);
  transition: background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.purchase-flow-steps div.is-active,
.purchase-flow-steps div.is-done {
  color: var(--ice);
}

.purchase-flow-steps div.is-active i {
  background: var(--ay-accent);
  box-shadow: 0 0 0 1px var(--ay-accent);
  transform: scale(1.16);
  animation: purchase-pulse 1.4s ease-in-out infinite;
}

.purchase-flow-steps div.is-done i {
  background: var(--purple-light);
  box-shadow: 0 0 0 1px rgba(134, 134, 226, 0.8);
}

.purchase-flow-stage.is-complete .purchase-flow-steps div.is-done i {
  background: var(--ay-accent);
  box-shadow: 0 0 0 1px var(--ay-accent);
}

.purchase-progress {
  margin-top: 22px;
}

.purchase-progress-track {
  height: 8px;
  border: 0;
  border-radius: 999px;
}

.purchase-progress-track i {
  position: relative;
  overflow: hidden;
  transition: width 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.purchase-progress-track i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: translateX(-100%);
  animation: purchase-shimmer 1.5s linear infinite;
}

.purchase-status-box,
.purchase-health {
  margin-top: 12px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.purchase-status-box:empty,
.purchase-health:empty {
  display: none;
}

.purchase-status-box.is-error {
  padding: 10px 11px;
  border-left: 2px solid var(--danger);
  color: var(--danger);
  background: color-mix(in srgb, var(--ay-rose) 7%, transparent);
}

.purchase-result-panel {
  min-height: 0;
}

.purchase-result-summary {
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 8px;
  background: rgba(243, 245, 255, 0.08);
}

.purchase-result-summary div {
  min-height: 72px;
  border: 0;
  border-radius: 0;
  background: var(--ay-surface);
}

.purchase-result-summary b {
  font-size: 20px;
}

#purchaseResultEmpty {
  min-height: 92px;
  margin-top: 12px;
  border: 1px dashed rgba(243, 245, 255, 0.1);
  border-radius: 8px;
}

.purchase-diagnostics {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 8px;
  background: var(--ay-surface);
}

.purchase-diagnostics-toggle {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  color: var(--ice);
  background: transparent;
  text-align: left;
}

.purchase-diagnostics-toggle:hover {
  background: rgba(243, 245, 255, 0.025);
}

.purchase-diagnostics-toggle span {
  min-width: 0;
}

.purchase-diagnostics-toggle small,
.purchase-diagnostics-toggle b,
.purchase-diagnostics-toggle em {
  display: block;
}

.purchase-diagnostics-toggle small {
  color: var(--ay-accent-text);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-diagnostics-toggle b {
  margin-top: 3px;
  font-size: 15px;
}

.purchase-diagnostics-toggle em {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-diagnostics-toggle strong {
  min-width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--ay-on-accent);
  background: var(--ay-accent);
  font-size: 11px;
}

.purchase-diagnostics-toggle[aria-expanded="true"] > i {
  transform: rotate(225deg) translate(-2px, -2px);
}

.purchase-exclusions-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 280ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
}

.purchase-exclusions-body > div {
  min-height: 0;
  overflow: hidden;
}

.purchase-diagnostics.is-open .purchase-exclusions-body {
  grid-template-rows: 1fr;
  opacity: 1;
}

.purchase-exclusions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 12px 12px;
}

.purchase-exclusion-row {
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 11px 12px;
  border-radius: 7px;
}

.purchase-exclusion-row em {
  font-size: 18px;
}

.purchase-exclusion-row small {
  display: none;
}

@keyframes purchase-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes purchase-expand {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes purchase-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--ay-accent); }
  50% { box-shadow: 0 0 0 1px var(--ay-accent), 0 0 0 4px color-mix(in srgb, var(--ay-violet) 22%, transparent); }
}

@keyframes purchase-shimmer {
  to { transform: translateX(100%); }
}

@media (max-width: 1040px) {
  .purchase-composer-grid {
    grid-template-columns: 1fr;
  }

  .purchase-launch-dock {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.55fr);
    align-items: center;
    border-top: 1px solid rgba(243, 245, 255, 0.08);
    border-left: 0;
  }

  .purchase-launch-dock .purchase-decision {
    display: none;
  }

  .purchase-connection-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .purchase-composer-head,
  .purchase-run-head,
  .purchase-result-panel .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .purchase-recipe,
  .purchase-composer-head,
  .purchase-run-panel,
  .purchase-result-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .purchase-source-form,
  .purchase-thresholds,
  .purchase-form-advanced,
  .purchase-result-summary,
  .purchase-exclusions {
    grid-template-columns: 1fr;
  }

  .purchase-launch-dock {
    display: flex;
    align-items: stretch;
  }

  .purchase-launch-mark {
    display: none;
  }

  .purchase-flow-steps span {
    font-size: 8px;
  }

  .purchase-downloads,
  .purchase-downloads button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .purchase-flow-stage:not([hidden]),
  .purchase-result-grid:not([hidden]),
  .purchase-advanced-body,
  .purchase-flow-steps div.is-active i,
  .purchase-progress-track i::after {
    animation: none;
  }

  .purchase-exclusions-body,
  .purchase-progress-track i {
    transition: none;
  }
}

/* Full-screen web app shell. The marketing background belongs to index.html only. */
body {
  overflow: hidden;
  background: var(--ay-bg);
}

body::before {
  z-index: 0;
  background: var(--ay-bg);
  background-size: 48px 48px;
  backdrop-filter: none;
}

.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  min-height: 0;
  grid-template-columns: 176px minmax(0, 1fr);
  overflow: hidden;
}

.rail {
  height: 100dvh;
  gap: 16px;
  padding: 14px 12px 12px;
  border-right-color: rgba(243, 245, 255, 0.09);
  background: var(--ay-bg);
  backdrop-filter: none;
}

.rail .brand {
  min-height: 42px;
  padding: 0 8px;
}

.rail .brand b {
  font-size: 17px;
}

.rail .nav {
  gap: 5px;
}

.rail .nav-item {
  min-height: 44px;
  border-radius: 7px;
}

.rail .nav-item.is-active {
  border-color: rgba(134, 134, 226, 0.22);
  background: rgba(97, 97, 172, 0.2);
}

.rail .rail-status {
  border-radius: 7px;
  background: color-mix(in srgb, var(--ay-violet) 4.5%, transparent);
}

.surface {
  position: relative;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
  background: var(--ay-bg);
}

.topbar {
  min-height: 56px;
  align-items: center;
  margin: 0;
  padding: 0 18px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
  background: var(--ay-bg);
}

.topbar > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.topbar h1 {
  order: -1;
  font-size: 17px;
  line-height: 1;
}

.topbar .eyebrow {
  margin: 0;
  padding-left: 11px;
  border-left: 1px solid rgba(243, 245, 255, 0.13);
  font-size: 9px;
}

.topbar .ghost-btn {
  min-height: 34px;
  border-radius: 7px;
  background: rgba(243, 245, 255, 0.045);
  font-size: 11px;
}

.topbar .lang-toggle {
  min-width: 42px;
  padding: 0 10px;
}

.api-settings {
  position: absolute;
  z-index: 50;
  top: 64px;
  right: 12px;
  width: min(520px, calc(100% - 24px));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.view {
  min-height: 0;
  overflow: auto;
}

.view[data-view-panel="home"] {
  overflow: hidden;
}

.view[data-view-panel="products"],
.view[data-view-panel="purchase"] {
  padding: 18px;
}

.view[data-view-panel="marketboard"] {
  overflow: hidden;
  padding: 0;
  background: var(--ay-bg);
}

.marketboard-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: var(--ay-bg);
}



.home-workspace {
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 0;
  margin: 0;
}

.home-command {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-right: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 0;
  background: var(--ay-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.home-command-head {
  min-height: 92px;
  flex: 0 0 auto;
  align-items: center;
  padding: 17px 22px;
}

.home-command-head h2 {
  font-size: 22px;
}

.signal-rail {
  flex: 0 0 auto;
  background: rgba(243, 245, 255, 0.012);
}

.signal-row {
  min-height: 78px;
}

.signal-row:hover,
.signal-row:focus-visible {
  background: rgba(134, 134, 226, 0.065);
}

.activity-stage {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 14px;
  background: var(--ay-surface);
  background-size: 100% 64px;
}

.activity-head {
  flex: 0 0 auto;
}

.home-workspace .calendar-strip {
  min-height: 0;
  flex: 1 1 auto;
  grid-auto-columns: minmax(46px, 1fr);
  align-items: stretch;
  margin-top: 16px;
  padding-bottom: 8px;
}

.home-workspace .day-card {
  height: 100%;
  min-height: 160px;
  grid-template-rows: minmax(100px, 1fr) 18px 18px;
  align-content: normal;
  align-self: stretch;
}

.home-workspace .day-card .bar {
  height: 100%;
  min-height: 100px;
}

.home-context {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--ay-bg);
}

.home-context-head {
  flex: 0 0 auto;
  padding: 20px 18px 17px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
}

.home-context-head h2 {
  margin: 2px 0 0;
  color: var(--ice);
  font-size: 18px;
}

.home-context-head > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.home-context .home-action {
  min-height: auto;
  display: block;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.home-context .home-action h2 {
  font-size: 17px;
}

.home-context .home-action .card-note {
  max-width: none;
  margin-top: 9px;
  line-height: 1.5;
}

.home-context .amazon-action {
  min-width: 0;
  margin-top: 17px;
}

.home-context .integration-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 6px;
  background: var(--ay-surface);
  text-align: left;
}

.home-context .coupon-panel {
  margin-top: 0;
  border-top: 0;
  border-bottom: 0;
}

.home-context .coupon-code-row {
  min-width: 0;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 15px;
  padding: 6px;
}

.home-context .coupon-code-row strong {
  min-height: 32px;
  display: grid;
  place-items: center;
}

.home-context .primary-btn {
  width: 100%;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app,
  .surface {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .surface {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .view[data-view-panel="home"] {
    overflow: visible;
  }

  .home-workspace {
    min-height: calc(100dvh - 56px);
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 760px) {
  .surface {
    padding: 0;
  }

  .topbar {
    top: 55px;
    min-height: 52px;
    padding: 0 12px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .view[data-view-panel="products"],
  .view[data-view-panel="purchase"] {
    padding: 12px;
  }

  .home-workspace {
    display: block;
    min-height: 0;
  }

  .home-command {
    border-right: 0;
  }

  .activity-stage {
    min-height: 430px;
  }

  .home-workspace .calendar-strip {
    height: 260px;
    flex: none;
    grid-auto-columns: 52px;
  }

  .home-context {
    overflow: visible;
    border-top: 1px solid rgba(243, 245, 255, 0.09);
  }

  .home-context .coupon-panel {
    margin-top: 0;
  }
}

/* Home: one market workspace, not a stack of dashboard cards. */
.home-workspace {
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
  margin: 0 auto;
}

.home-command {
  overflow: hidden;
  border: 1px solid rgba(243, 245, 255, 0.12);
  border-radius: 8px;
  background: var(--ay-surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
}

.home-command-head {
  min-height: 98px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.home-command-head h2,
.activity-head h3,
.home-action h2 {
  margin: 3px 0 0;
  color: var(--ice);
  letter-spacing: 0;
}

.home-command-head h2 {
  font-size: 25px;
}

.home-command-head > div > p:last-child,
.activity-head > div > p:last-child {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.signal-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.signal-row {
  min-width: 0;
  min-height: 86px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 18px;
  gap: 13px;
  align-items: center;
  padding: 15px 22px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.signal-row + .signal-row {
  border-left: 1px solid rgba(243, 245, 255, 0.08);
}

.signal-row:hover,
.signal-row:focus-visible {
  outline: 0;
  background: rgba(134, 134, 226, 0.075);
}

.signal-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--ay-violet) 28%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--ay-violet) 8%, transparent);
}

.signal-mark::before,
.signal-mark::after {
  content: "";
  position: absolute;
  background: var(--ay-accent);
}

.signal-mark-drops::before {
  width: 3px;
  height: 11px;
  left: 9px;
  top: 9px;
  box-shadow: 6px -4px 0 rgba(134, 134, 226, 0.95);
}

.signal-mark-profit::before {
  width: 12px;
  height: 2px;
  left: 7px;
  top: 15px;
  transform: rotate(-42deg);
}

.signal-mark-profit::after {
  width: 5px;
  height: 5px;
  right: 6px;
  top: 7px;
  border-radius: 50%;
}

.signal-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.signal-copy b {
  overflow: hidden;
  color: var(--ice);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-copy small {
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-row > strong {
  min-width: 72px;
  color: var(--ice);
  font-size: 30px;
  line-height: 1;
  text-align: right;
}

.signal-route {
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--faint);
  border-right: 2px solid var(--faint);
  transform: rotate(45deg);
  transition: border-color 180ms ease, transform 180ms ease;
}

.signal-row:hover .signal-route,
.signal-row:focus-visible .signal-route {
  border-color: var(--ay-accent);
  transform: translateX(3px) rotate(45deg);
}

.activity-stage {
  padding: 19px 22px 16px;
  background: var(--ay-surface);
}

.activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.activity-head h3 {
  font-size: 18px;
}

.home-workspace .calendar-strip {
  grid-auto-columns: minmax(48px, 1fr);
  gap: 4px;
  margin-top: 14px;
  padding: 0 0 7px;
}

.home-workspace .day-card {
  min-height: 122px;
  grid-template-rows: 68px auto auto;
  gap: 5px;
  padding: 7px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.home-workspace .day-card:hover,
.home-workspace .day-card:focus-visible,
.home-workspace .day-card.is-today {
  background: rgba(134, 134, 226, 0.09);
  transform: none;
}

.home-workspace .day-card.is-today {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ay-violet) 24%, transparent);
}

.home-workspace .day-card .bar {
  grid-row: 1;
  min-height: 68px;
  align-self: stretch;
  border-radius: 4px 4px 2px 2px;
  background: rgba(243, 245, 255, 0.035);
}

.home-workspace .day-card .bar i {
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--ay-accent), rgba(134, 134, 226, 0.72));
  box-shadow: none;
}

.home-workspace .day-card strong {
  grid-row: 2;
  font-size: 12px;
}

.home-workspace .day-card small {
  display: none;
}

.home-workspace .day-top {
  grid-row: 3;
  display: flex;
  justify-content: center;
  gap: 4px;
  font-size: 8px;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-action {
  min-width: 0;
  min-height: 128px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid rgba(243, 245, 255, 0.11);
  border-radius: 8px;
  background: var(--ay-surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
}

.home-action.coupon-panel,
.home-action.amazon-panel {
  min-height: 128px;
}

.home-action.coupon-panel::before,
.home-action.coupon-panel::after,
.home-action.amazon-panel::before,
.home-action.amazon-panel::after {
  display: none;
}

.home-action-copy {
  min-width: 0;
}

.home-action h2 {
  font-size: 18px;
}

.home-action .card-note {
  max-width: 430px;
  margin-top: 7px;
  font-size: 11px;
}

.home-action .coupon-code-row {
  min-width: 260px;
  grid-template-columns: minmax(112px, 1fr) auto;
  margin: 0;
  padding: 6px;
  border-radius: 7px;
}

.home-action .coupon-code-row strong {
  font-size: 13px;
}

.amazon-action {
  min-width: 190px;
  display: grid;
  gap: 8px;
}

.home-action .integration-status {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--faint);
  background: transparent;
  font-size: 10px;
  text-align: right;
}

.home-action .primary-btn {
  min-height: 38px;
}

@media (max-width: 980px) {
  .home-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .rail {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--ay-bg);
  }

  .rail .brand {
    min-height: 38px;
    padding: 0;
  }

  .rail .brand-mark {
    width: 32px;
    height: 32px;
  }

  .rail .brand > span:last-child {
    display: none;
  }

  .rail .nav {
    grid-template-columns: repeat(5, minmax(34px, 1fr));
    gap: 3px;
  }

  .rail .nav-item {
    min-height: 38px;
    grid-template-columns: 30px;
    padding: 3px;
    border-radius: 7px;
  }

  .rail .nav-icon {
    width: 30px;
    height: 30px;
  }

  .rail .rail-status {
    width: 34px;
    height: 34px;
    grid-template-columns: 8px;
    place-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
    border-radius: 7px;
  }

  .rail .rail-status span {
    display: none;
  }

  .home-command-head,
  .activity-head {
    flex-direction: column;
    gap: 12px;
  }

  .signal-rail {
    grid-template-columns: 1fr;
  }

  .signal-row + .signal-row {
    border-top: 1px solid rgba(243, 245, 255, 0.08);
    border-left: 0;
  }

  .signal-row {
    padding-right: 16px;
    padding-left: 16px;
  }

  .activity-stage,
  .home-command-head {
    padding-right: 16px;
    padding-left: 16px;
  }

  .home-workspace .calendar-strip {
    grid-auto-columns: 50px;
  }

  .home-action {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .home-action .coupon-code-row,
  .amazon-action {
    min-width: 0;
    width: 100%;
  }

  .home-action .integration-status {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signal-row,
  .signal-route,
  .home-workspace .day-card,
  .home-workspace .day-card.is-preview .bar i {
    animation: none;
    transition: none;
  }
}

/* Final home geometry: these rules intentionally follow the legacy home styles. */
.view[data-view-panel="home"] .home-workspace {
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 0;
  margin: 0;
}

.view[data-view-panel="home"] .home-command {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-right: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 0;
  background: var(--ay-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.view[data-view-panel="home"] .home-command-head {
  min-height: 92px;
  flex: 0 0 auto;
  align-items: center;
  padding: 17px 22px;
}

.view[data-view-panel="home"] .signal-rail {
  flex: 0 0 auto;
  background: rgba(243, 245, 255, 0.012);
}

.view[data-view-panel="home"] .signal-row {
  min-height: 78px;
}

.view[data-view-panel="home"] .activity-stage {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 14px;
  background: var(--ay-surface);
  background-size: 100% 64px;
}

.view[data-view-panel="home"] .calendar-strip {
  min-height: 0;
  flex: 1 1 auto;
  grid-auto-columns: minmax(46px, 1fr);
  align-items: stretch;
  margin-top: 16px;
  padding-bottom: 8px;
}

.view[data-view-panel="home"] .day-card {
  height: 100%;
  min-height: 160px;
  grid-template-rows: minmax(100px, 1fr) 18px 18px;
  align-content: normal;
  align-self: stretch;
}

.view[data-view-panel="home"] .day-card .bar {
  height: 100%;
  min-height: 100px;
}

.view[data-view-panel="home"] .home-context {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--ay-bg);
}

.view[data-view-panel="home"] .home-context .home-action {
  min-height: auto;
  display: block;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.view[data-view-panel="home"] .home-context .coupon-panel {
  margin-top: 0;
  border-top: 0;
}

.view[data-view-panel="home"] .home-context .coupon-code-row {
  min-width: 0;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 15px;
  padding: 6px;
}

@media (max-width: 980px) {
  .view[data-view-panel="home"] .home-workspace {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 760px) {
  .surface .topbar {
    min-height: 52px;
    flex-direction: row;
    align-items: center;
  }

  .view[data-view-panel="home"] .home-workspace {
    display: block;
    height: auto;
  }

  .view[data-view-panel="home"] .home-command {
    border-right: 0;
  }

  .view[data-view-panel="home"] .activity-stage {
    min-height: 430px;
  }

  .view[data-view-panel="home"] .calendar-strip {
    height: 260px;
    flex: none;
    grid-auto-columns: 52px;
  }

  .view[data-view-panel="home"] .day-card {
    min-height: 220px;
  }
}

/* Definitive v2 geometry. Keep this block last while the legacy prototype CSS exists. */
@media (min-width: 761px) {
  .app {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .rail {
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
  }

  .rail .brand {
    width: 48px;
    justify-content: center;
    padding: 0;
  }

  .rail .brand > span:last-child,
  .rail .rail-status span {
    display: none;
  }

  .rail .nav {
    width: 100%;
  }

  .rail .nav-item {
    width: 48px;
    min-height: 48px;
    grid-template-columns: 34px;
    justify-content: center;
    margin: 0 auto;
    padding: 6px;
  }

  .rail .rail-status {
    width: 40px;
    height: 40px;
    grid-template-columns: 8px;
    place-content: center;
    gap: 0;
    margin: auto auto 0;
    padding: 0;
  }
}

.view[data-view-panel="home"] .home-workspace {
  grid-template-columns: minmax(0, 1fr) 272px;
}

.view[data-view-panel="home"] .home-command-head {
  min-height: 76px;
  padding: 12px 20px;
}

.view[data-view-panel="home"] .signal-row {
  min-height: 62px;
  padding: 10px 20px;
}

.view[data-view-panel="home"] .activity-stage {
  min-height: 204px;
  flex: 0 0 204px;
  padding: 12px 20px 8px;
}

.view[data-view-panel="home"] .calendar-strip {
  height: 116px;
  min-height: 116px;
  flex: none;
  grid-auto-columns: minmax(34px, 1fr);
  margin-top: 6px;
}

.view[data-view-panel="home"] .day-card {
  height: 112px;
  min-height: 112px;
  grid-template-rows: 76px 17px 17px;
}

.view[data-view-panel="home"] .day-card .bar {
  min-height: 76px;
}

.view[data-view-panel="home"] .home-opportunities {
  min-height: 0;
  flex: 1 1 auto;
}

.view[data-view-panel="home"] .home-context-head,
.view[data-view-panel="home"] .home-context .home-action {
  padding: 14px;
}

@media (max-width: 760px) {
  .view[data-view-panel="home"] .activity-stage {
    min-height: 204px;
    flex-basis: auto;
  }

  .view[data-view-panel="home"] .calendar-strip {
    height: 116px;
    min-height: 116px;
    grid-auto-columns: 48px;
  }

  .view[data-view-panel="home"] .day-card {
    height: 112px;
    min-height: 112px;
  }
}

.home-opportunities-empty:has(.home-source-flow) {
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.home-opportunities-empty .home-source-flow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-source-flow span,
.home-source-flow b {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 245, 255, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: var(--ay-surface);
  font-size: 9px;
  font-weight: 900;
}

.home-source-flow b {
  border-color: color-mix(in srgb, var(--ay-violet) 34%, transparent);
  color: var(--ay-accent-text);
  box-shadow: none;
}

.home-source-flow i {
  position: relative;
  width: 58px;
  height: 1px;
  overflow: hidden;
  background: rgba(243, 245, 255, 0.1);
}

.home-source-flow i::after {
  content: "";
  position: absolute;
  top: 0;
  left: -18px;
  width: 18px;
  height: 1px;
  background: var(--ay-accent);
  box-shadow: none;
  animation: source-flow-scan 2.2s ease-in-out infinite;
}

.home-source-flow i:last-of-type::after {
  animation-delay: 0.55s;
}

.home-source-copy {
  max-width: 430px;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.home-source-copy b {
  color: var(--ice);
  font-size: 13px;
}

.home-source-copy span {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
}

.home-source-copy .ghost-btn {
  min-height: 34px;
  margin-top: 7px;
  border-radius: 6px;
  font-size: 9px;
}

@keyframes source-flow-scan {
  0%, 16% { transform: translateX(0); opacity: 0; }
  34% { opacity: 1; }
  84%, 100% { transform: translateX(76px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .home-source-flow i::after {
    animation: none;
  }
}

/* Main-screen cleanup: no global market context, integration panel or promo rail. */
.view[data-view-panel="home"] .home-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.view[data-view-panel="home"] .eyebrow {
  color: rgba(134, 134, 226, 0.92);
}

.view[data-view-panel="home"] .signal-rail {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--ay-surface-sunken);
}

.view[data-view-panel="home"] .signal-row {
  width: min(300px, 100%);
  min-height: 50px;
  grid-template-columns: 26px minmax(0, 1fr) auto 12px;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 7px;
  background: var(--ay-surface);
}

.view[data-view-panel="home"] .signal-row + .signal-row {
  border-left: 1px solid rgba(243, 245, 255, 0.08);
}

.view[data-view-panel="home"] .signal-row > strong {
  min-width: 38px;
  font-size: 20px;
}

.view[data-view-panel="home"] .signal-mark {
  border-color: rgba(134, 134, 226, 0.34);
  background: rgba(97, 97, 172, 0.11);
}

.view[data-view-panel="home"] .signal-mark::before,
.view[data-view-panel="home"] .signal-mark::after {
  background: var(--purple-light);
}

.view[data-view-panel="home"] .calendar-strip {
  gap: 2px;
}

.view[data-view-panel="home"] .day-card,
.view[data-view-panel="home"] .day-card:hover,
.view[data-view-panel="home"] .day-card:focus-visible,
.view[data-view-panel="home"] .day-card.is-preview,
.view[data-view-panel="home"] .day-card.is-today {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.view[data-view-panel="home"] .day-card .bar {
  align-items: flex-end;
  background: transparent;
}

.view[data-view-panel="home"] .day-card .bar i {
  width: 5px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--purple-light);
  box-shadow: none;
  transition: width 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.view[data-view-panel="home"] .day-card:hover .bar i,
.view[data-view-panel="home"] .day-card:focus-visible .bar i,
.view[data-view-panel="home"] .day-card.is-today .bar i {
  width: 7px;
  background: var(--ay-accent);
  box-shadow: none;
}

.view[data-view-panel="home"] .home-source-flow b {
  border-color: rgba(134, 134, 226, 0.4);
  color: var(--purple-light);
  box-shadow: none;
}

.view[data-view-panel="home"] .home-source-flow i::after {
  background: var(--purple-light);
  box-shadow: none;
}

@media (max-width: 760px) {
  .view[data-view-panel="home"] .signal-rail {
    display: grid;
    grid-template-columns: 1fr;
    padding: 8px 16px;
  }

  .view[data-view-panel="home"] .signal-row {
    width: 100%;
  }
}

/* Home v3: operational workspace. This block is intentionally last. */
body {
  background: var(--ay-bg);
}

body::before {
  display: none;
}

.app {
  grid-template-columns: 72px minmax(0, 1fr);
  background: var(--ay-bg);
}

.app.has-context {
  grid-template-columns: 72px 210px minmax(0, 1fr);
}

.app.has-context.is-context-collapsed {
  grid-template-columns: 72px 56px minmax(0, 1fr);
}

.nav-icon svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.context-nav {
  position: sticky;
  top: 0;
  z-index: 25;
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(243, 245, 255, 0.08);
  background: var(--ay-bg);
}

.app:not(.has-context) .context-nav {
  display: none;
}

.context-nav-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.context-nav-head div {
  min-width: 0;
}

.context-nav-head small,
.context-nav-head b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-nav-head small,
.context-sections > section > p,
.context-scope small {
  color: rgba(134, 134, 226, 0.86);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.context-nav-head b {
  margin-top: 2px;
  font-size: 14px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(243, 245, 255, 0.025);
}

.icon-btn:hover {
  color: var(--ice);
  border-color: rgba(134, 134, 226, 0.34);
  background: rgba(97, 97, 172, 0.12);
}

.context-sections {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 10px;
}

.context-sections > section > p {
  margin: 0 8px 7px;
  color: var(--faint);
}

.context-item {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.context-item:hover,
.context-item.is-active {
  color: var(--ice);
  background: rgba(243, 245, 255, 0.045);
}

.context-item.is-active {
  border-color: rgba(134, 134, 226, 0.22);
  background: rgba(97, 97, 172, 0.13);
}

.context-glyph {
  position: relative;
  width: 28px;
  height: 28px;
  display: block;
  border: 1px solid rgba(134, 134, 226, 0.26);
  border-radius: 50%;
  background: rgba(97, 97, 172, 0.1);
}

.context-glyph::before,
.context-glyph::after {
  content: "";
  position: absolute;
  background: var(--purple-light);
}

.context-glyph-overview::before { inset: 7px 13px; }
.context-glyph-overview::after { inset: 13px 7px; }
.context-glyph-products::before { left: 7px; right: 7px; top: 8px; height: 2px; box-shadow: 0 5px 0 var(--purple-light), 0 10px 0 var(--purple-light); }
.context-glyph-activity::before { left: 7px; bottom: 7px; width: 3px; height: 8px; box-shadow: 5px -5px 0 var(--purple-light), 10px 2px 0 var(--purple-light); }
.context-glyph-jobs::before { inset: 7px; border: 2px solid var(--purple-light); border-left-color: transparent; border-radius: 50%; background: transparent; }

.context-item span:last-child {
  min-width: 0;
}

.context-item b,
.context-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-item b {
  font-size: 11px;
}

.context-item small {
  margin-top: 3px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
}

.context-scope {
  width: calc(100% - 20px);
  display: grid;
  gap: 3px;
  margin: auto 10px 12px;
  padding: 11px;
  border: 1px solid rgba(134, 134, 226, 0.18);
  border-radius: 7px;
  color: var(--ice);
  background: rgba(97, 97, 172, 0.08);
  text-align: left;
}

.context-scope b {
  overflow: hidden;
  margin-top: 3px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-scope span {
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
}

.app.is-context-collapsed .context-nav-head {
  justify-content: center;
  padding: 0;
}

.app.is-context-collapsed .context-nav-head div,
.app.is-context-collapsed .context-item span:last-child,
.app.is-context-collapsed .context-sections > section > p,
.app.is-context-collapsed .context-scope > * {
  display: none;
}

.app.is-context-collapsed .context-sections {
  padding: 12px 8px;
}

.app.is-context-collapsed .context-item {
  grid-template-columns: 28px;
  justify-content: center;
  padding: 6px;
}

.app.is-context-collapsed .context-scope {
  position: relative;
  width: 34px;
  height: 34px;
  margin: auto auto 12px;
  padding: 0;
  border-color: rgba(134, 134, 226, 0.34);
  background: rgba(97, 97, 172, 0.16);
}

.app.is-context-collapsed .context-scope::before,
.app.is-context-collapsed .context-scope::after {
  content: "";
  position: absolute;
  left: 9px;
  width: 14px;
  height: 7px;
  border: 1px solid var(--purple-light);
  border-radius: 50%;
}

.app.is-context-collapsed .context-scope::before {
  top: 8px;
}

.app.is-context-collapsed .context-scope::after {
  top: 15px;
  border-top-color: transparent;
}

.surface {
  background: var(--ay-bg);
}

.topbar {
  background: var(--ay-bg);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scope-trigger {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(134, 134, 226, 0.22);
  border-radius: 7px;
  color: var(--ice);
  background: rgba(97, 97, 172, 0.1);
}

.scope-trigger span {
  color: var(--purple-light);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.scope-trigger b {
  max-width: 180px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-trigger.is-warning {
  border-color: color-mix(in srgb, var(--ay-orange) 24%, transparent);
}

.view[data-view-panel="home"] {
  overflow-y: auto;
  background: var(--ay-bg);
  scroll-behavior: smooth;
}

.home-v3 {
  position: relative;
  min-height: 100%;
  display: grid;
  align-content: start;
  background: var(--ay-bg);
}

.home-overview,
.view[data-view-panel="home"] .activity-stage,
.home-priority-layout,
.home-operations {
  scroll-margin-top: 12px;
}

.home-overview {
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
  background: var(--ay-surface);
}

.home-overview-head {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 22px 10px;
}

.home-overview-head h2,
.home-opportunities-head h3,
.home-operations h3,
.activity-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.home-overview-head h2 {
  font-size: 23px;
}

.home-overview-head > div > p:last-child,
.home-opportunities-head > div > p:last-child,
.activity-head > div > p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.home-action-notice {
  min-height: 54px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 22px 10px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--ay-rose) 28%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--ay-rose) 5.5%, transparent);
}

.home-action-notice > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: none;
}

.home-action-notice b,
.home-action-notice small {
  display: block;
}

.home-action-notice b { font-size: 11px; }
.home-action-notice small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.home-action-notice .ghost-btn { min-height: 32px; border-radius: 6px; font-size: 9px; }

.view[data-view-panel="home"] .signal-rail {
  display: flex;
  align-items: stretch;
  gap: 7px;
  padding: 0 22px 14px;
  background: transparent;
}

.view[data-view-panel="home"] .signal-row {
  width: auto;
  max-width: 260px;
  min-width: 160px;
  min-height: 48px;
  flex: 0 1 220px;
  grid-template-columns: 24px minmax(0, 1fr) auto 9px;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(243, 245, 255, 0.08);
  border-radius: 6px;
  color: var(--ice);
  background: var(--ay-surface);
}

.view[data-view-panel="home"] .signal-row:hover {
  border-color: rgba(134, 134, 226, 0.3);
  background: var(--ay-surface-hover);
  transform: translateY(-1px);
}

.view[data-view-panel="home"] .signal-row + .signal-row {
  border-left: 1px solid rgba(243, 245, 255, 0.08);
}

.view[data-view-panel="home"] .signal-mark {
  width: 24px;
  height: 24px;
  border-color: rgba(134, 134, 226, 0.3);
  background: rgba(97, 97, 172, 0.1);
}

.view[data-view-panel="home"] .signal-row > strong {
  min-width: 24px;
  font-size: 17px;
}

.view[data-view-panel="home"] .signal-copy b { font-size: 9px; }
.view[data-view-panel="home"] .signal-copy small { font-size: 7px; }

.view[data-view-panel="home"] .activity-stage {
  min-height: 108px;
  height: auto;
  display: block;
  padding: 12px 22px 10px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
  background: var(--ay-surface);
}

.activity-head {
  align-items: center;
}

.activity-head h3 {
  font-size: 14px;
}

.view[data-view-panel="home"] .calendar-strip,
.view[data-view-panel="home"] .calendar-strip.is-preview {
  height: 58px;
  min-height: 58px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(42px, 1fr);
  align-items: end;
  gap: 2px;
  margin-top: 7px;
  padding: 0;
  overflow-x: auto;
}

.view[data-view-panel="home"] .day-card,
.view[data-view-panel="home"] .day-card:hover,
.view[data-view-panel="home"] .day-card:focus-visible,
.view[data-view-panel="home"] .day-card.is-today {
  height: 58px;
  min-height: 58px;
  grid-template-rows: 31px 11px 10px;
  gap: 1px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
}

.view[data-view-panel="home"] .day-card:hover,
.view[data-view-panel="home"] .day-card:focus-visible {
  background: rgba(134, 134, 226, 0.08);
}

.view[data-view-panel="home"] .day-card .bar {
  grid-row: 1;
  min-height: 31px;
  align-items: flex-end;
  background: transparent;
}

.view[data-view-panel="home"] .day-card .bar i {
  width: 4px;
  height: var(--activity);
  max-height: 29px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--purple-light);
  box-shadow: none;
}

.view[data-view-panel="home"] .day-card.is-today .bar i,
.view[data-view-panel="home"] .day-card:hover .bar i {
  width: 6px;
  background: var(--ay-accent);
  box-shadow: none;
}

.view[data-view-panel="home"] .day-card strong {
  grid-row: 2;
  font-size: 8px;
}

.view[data-view-panel="home"] .day-card small { display: none; }
.view[data-view-panel="home"] .day-top { grid-row: 3; justify-content: center; gap: 3px; font-size: 6px; }

.calendar-empty-state {
  min-width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
}

.calendar-empty-state i {
  width: 38px;
  height: 16px;
  display: block;
  background: repeating-linear-gradient(90deg, rgba(134, 134, 226, 0.38) 0 3px, transparent 3px 8px);
  mask-image: linear-gradient(135deg, transparent 0 20%, #000 22% 68%, transparent 70%);
}

.home-priority-layout {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
  background: var(--ay-surface);
}

.home-priority-layout:has(.home-inspector:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.view[data-view-panel="home"] .home-opportunities {
  min-width: 0;
  background: transparent;
}

.home-opportunities-head {
  min-height: 68px;
  padding: 12px 22px;
}

.home-opportunities-head h3,
.home-operations h3 { font-size: 15px; }

.home-opportunities-list {
  max-height: 392px;
  overflow-y: auto;
}

.home-opportunity {
  min-height: 68px;
  grid-template-columns: 38px minmax(180px, 1.4fr) minmax(116px, 0.75fr) minmax(116px, 0.75fr) minmax(132px, 0.85fr) 10px;
  gap: 11px;
  padding: 8px 18px 8px 22px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.065);
  background: transparent;
}

.home-opportunity:hover,
.home-opportunity.is-selected {
  background: rgba(97, 97, 172, 0.08);
}

.home-opportunity.is-selected {
  box-shadow: inset 3px 0 var(--purple-light);
}

.home-opportunity-title b { font-size: 11px; }
.home-opportunity-title small { font-size: 8px; }

.home-opportunity-reason {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.home-opportunity-reason small {
  color: var(--faint);
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-opportunity-reason b {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-opportunity-reason.is-value b { color: var(--ice); }
.home-opportunity-reason.is-urgency b { color: var(--warn); }
.home-opportunity-reason.is-trust b { color: var(--purple-light); }

.home-inspector {
  min-width: 0;
  border-left: 1px solid rgba(134, 134, 226, 0.18);
  background: var(--ay-surface);
  animation: homeInspectorIn 180ms ease both;
}

@keyframes homeInspectorIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

.home-inspector-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid rgba(243, 245, 255, 0.08);
}

.home-inspector-head small,
.home-inspector-head b { display: block; }
.home-inspector-head small { color: var(--purple-light); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.home-inspector-head b { margin-top: 3px; font-size: 12px; }

.home-inspector-body {
  display: grid;
  gap: 10px;
  padding: 14px 16px 18px;
}

.home-inspector-product {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.home-inspector-product > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(243, 245, 255, 0.09);
  border-radius: 6px;
  color: var(--purple-light);
  background: var(--ay-surface);
  font-weight: 900;
}

.home-inspector-product img { width: 100%; height: 100%; object-fit: contain; }
.home-inspector-product b, .home-inspector-product small { display: block; }
.home-inspector-product b { font-size: 11px; line-height: 1.25; }
.home-inspector-product small { margin-top: 4px; color: var(--faint); font-size: 8px; }

.home-inspector-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
}

.home-inspector-prices div,
.home-inspector-proof {
  padding: 9px;
  border: 1px solid rgba(243, 245, 255, 0.07);
  border-radius: 6px;
  background: var(--ay-surface);
}

.home-inspector-prices dt,
.home-inspector-proof small {
  color: var(--faint);
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-inspector-prices dd { margin: 4px 0 0; font-size: 13px; font-weight: 900; }
.home-inspector-proof b { display: block; margin-top: 5px; font-size: 9px; line-height: 1.4; }
.home-inspector-source { display: flex; justify-content: space-between; gap: 10px; padding: 3px 1px; color: var(--faint); font-size: 8px; }
.home-inspector-source b { color: var(--muted); }
.home-inspector-body .primary-btn { min-height: 36px; border-radius: 6px; }

.home-operations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--ay-surface);
}

.home-operations > article {
  min-width: 0;
  min-height: 168px;
  padding: 13px 22px 18px;
}

.home-operations > article + article {
  border-left: 1px solid rgba(243, 245, 255, 0.08);
}

.home-job-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.home-job {
  position: relative;
  min-height: 46px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid rgba(243, 245, 255, 0.07);
  border-radius: 6px;
  color: var(--ice);
  background: var(--ay-surface);
  text-align: left;
}

.home-job:not(:disabled):hover { border-color: rgba(134, 134, 226, 0.28); background: var(--ay-surface-hover); }
.home-job-state { width: 7px; height: 7px; border-radius: 50%; background: var(--purple-light); box-shadow: none; }
.home-job-state.is-ready { background: var(--ay-profit); box-shadow: none; }
.home-job b, .home-job small { display: block; }
.home-job b { font-size: 10px; }
.home-job small { margin-top: 3px; color: var(--faint); font-size: 8px; }
.home-job em { color: var(--muted); font-size: 9px; font-style: normal; font-weight: 900; }
.home-job-progress { position: absolute; inset: auto 0 0; height: 2px; background: rgba(243, 245, 255, 0.05); }
.home-job-progress span { display: block; width: var(--progress); height: 100%; background: var(--purple-light); transition: width 240ms ease; }

.home-job-empty {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
}

.home-job-empty i { width: 7px; height: 7px; border: 1px solid rgba(134, 134, 226, 0.44); border-radius: 50%; }

.home-scope-popover {
  position: fixed;
  z-index: 70;
  top: 62px;
  right: 84px;
  width: min(380px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid rgba(134, 134, 226, 0.25);
  border-radius: 8px;
  background: var(--ay-surface-2);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: scopeIn 150ms ease both;
}

@keyframes scopeIn {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-scope-popover header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.home-scope-popover header small { color: var(--purple-light); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.home-scope-popover h2 { margin: 3px 0 0; font-size: 15px; letter-spacing: 0; }
.home-scope-current { display: grid; gap: 4px; margin-top: 13px; padding: 10px; border: 1px solid rgba(243, 245, 255, 0.08); border-radius: 6px; background: var(--ay-surface); }
.home-scope-current span { color: var(--faint); font-size: 8px; font-weight: 800; }
.home-scope-current b { font-size: 11px; }
.home-scope-popover > p { margin: 11px 1px; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.5; }
.home-scope-popover > .ghost-btn { min-height: 34px; border-radius: 6px; }

@media (max-width: 1180px) {
  .app.has-context { grid-template-columns: 72px 184px minmax(0, 1fr); }
  .home-opportunity { grid-template-columns: 38px minmax(170px, 1.3fr) minmax(110px, 0.8fr) minmax(120px, 0.8fr) 10px; }
  .home-opportunity-reason.is-trust { display: none; }
  .home-priority-layout:has(.home-inspector:not([hidden])) { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 980px) and (min-width: 761px) {
  .app.has-context { grid-template-columns: 72px 56px minmax(0, 1fr); }
  .context-nav-head { justify-content: center; padding: 0; }
  .context-nav-head div,
  .context-item span:last-child,
  .context-sections > section > p,
  .context-scope > * { display: none; }
  .context-sections { padding: 12px 8px; }
  .context-item { grid-template-columns: 28px; justify-content: center; padding: 6px; }
  .context-scope { width: 34px; height: 34px; margin: auto auto 12px; padding: 0; background: var(--purple); }
  .home-priority-layout:has(.home-inspector:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .home-inspector { position: fixed; z-index: 55; top: 56px; right: 0; bottom: 0; width: min(360px, 90vw); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
  .home-opportunity { grid-template-columns: 38px minmax(150px, 1fr) minmax(108px, 0.75fr) 10px; }
  .home-opportunity-reason.is-urgency { display: none; }
}

@media (max-width: 760px) {
  body {
    padding: 0;
  }

  .app,
  .app.has-context,
  .app.has-context.is-context-collapsed {
    display: block;
    min-height: 100dvh;
  }

  .context-nav { display: none; }

  .rail {
    position: fixed;
    z-index: 80;
    inset: auto 0 0;
    width: 100%;
    height: 56px;
    display: block;
    padding: 0;
    border-top: 1px solid rgba(243, 245, 255, 0.09);
    border-right: 0;
    background: var(--ay-bg);
  }

  .rail .brand,
  .rail .rail-status {
    display: none;
  }

  .rail .nav {
    width: 100%;
    height: 55px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  .rail .nav-item {
    position: relative;
    width: 100%;
    min-height: 55px;
    display: grid;
    grid-template-columns: 34px;
    place-content: center;
    margin: 0;
    padding: 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .rail .nav-item::before {
    display: none;
  }

  .rail .nav-item.is-active {
    background: rgba(97, 97, 172, 0.13);
  }

  .rail .nav-item.is-active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--ay-accent);
    transform: translateX(-50%);
  }

  .rail .nav-item > span:last-child {
    display: none;
  }

  .surface {
    height: auto;
    min-height: 100dvh;
    padding: 0 0 56px;
  }

  .topbar { position: sticky; top: 0; z-index: 30; padding: 0 10px; }
  .scope-trigger b { max-width: 92px; }
  .topbar .ghost-btn#apiSettingsToggle { display: none; }
  .view[data-view-panel="home"] { overflow: visible; }
  .home-overview-head { min-height: 76px; padding: 12px 14px 8px; }
  .home-overview-head > div > p:last-child { max-width: 260px; }
  .view[data-view-panel="home"] .signal-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 14px 12px; }
  .view[data-view-panel="home"] .signal-row { width: 100%; min-width: 0; max-width: none; grid-template-columns: 22px minmax(0, 1fr) auto; }
  .view[data-view-panel="home"] .signal-route { display: none; }
  .view[data-view-panel="home"] .activity-stage { min-height: 106px; padding: 11px 14px 9px; }
  .view[data-view-panel="home"] .calendar-strip,
  .view[data-view-panel="home"] .calendar-strip.is-preview { height: 58px; min-height: 58px; grid-auto-columns: 44px; }
  .home-opportunities-head { padding: 11px 14px; }
  .home-opportunity { min-height: 66px; grid-template-columns: 36px minmax(0, 1fr) 9px; padding: 8px 14px; }
  .home-opportunity-reason { display: none; }
  .home-priority-layout:has(.home-inspector:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .home-inspector { position: fixed; z-index: 60; inset: 110px 0 0; overflow-y: auto; border-left: 0; border-top: 1px solid rgba(134, 134, 226, 0.25); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
  .home-operations { grid-template-columns: 1fr; }
  .home-operations > article { min-height: 140px; padding: 12px 14px 16px; }
  .home-operations > article + article { border-top: 1px solid rgba(243, 245, 255, 0.08); border-left: 0; }
  .home-scope-popover { top: 62px; right: 8px; }
  .home-action-notice { grid-template-columns: 8px minmax(0, 1fr); margin: 0 14px 10px; }
  .home-action-notice .ghost-btn { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .home-inspector,
  .home-scope-popover,
  .home-job-progress span,
  .view[data-view-panel="home"] .signal-row {
    animation: none;
    transition: none;
  }
}

.view[data-view-panel="analyzer"],
.view.analyzer-view {
  overflow: hidden;
  padding: 0 !important;
  margin: 0;
  background: var(--ay-bg);
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.analyzer-frame {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: var(--ay-bg);
}

/* Analyzer rail: always-visible label in compact icon rail */
@media (min-width: 761px) {
  .rail .nav-item.nav-item-analyzer {
    width: 48px;
    min-height: 58px;
    padding-bottom: 16px;
  }

  .rail .nav-item.nav-item-analyzer .nav-label-analyzer,
  .rail .nav-item.nav-item-analyzer span.nav-label-analyzer {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 2px;
    z-index: 2;
    display: block !important;
    overflow: visible;
    width: max-content;
    max-width: 64px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--ay-text-muted);
    background: transparent;
    box-shadow: none;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    opacity: 1 !important;
    pointer-events: none;
    transform: translateX(-50%);
    text-align: center;
  }

  .rail .nav-item.nav-item-analyzer.is-active .nav-label-analyzer {
    color: var(--ay-text);
  }
}

.nav-icon.nav-analyzer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(134, 134, 226, 0.22);
  box-shadow: inset 0 0 0 1px rgba(243, 245, 255, 0.12);
}

.nav-item.is-active .nav-icon.nav-analyzer {
  background: color-mix(in srgb, var(--ay-violet) 28%, transparent);
}

.nav-analyzer-mark {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.view[data-view-panel="crm"],
.view.crm-view {
  overflow: hidden;
  padding: 0 !important;
  margin: 0;
  background: var(--ay-bg);
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.crm-frame {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: var(--ay-bg);
}

@media (min-width: 761px) {
  .rail .nav-item.nav-item-crm {
    width: 48px;
    min-height: 58px;
    padding-bottom: 16px;
  }

  .rail .nav-item.nav-item-crm .nav-label-crm,
  .rail .nav-item.nav-item-crm span.nav-label-crm {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 2px;
    z-index: 2;
    display: block !important;
    overflow: visible;
    width: max-content;
    max-width: 64px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--ay-text-muted);
    background: transparent;
    box-shadow: none;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    opacity: 1 !important;
    pointer-events: none;
    transform: translateX(-50%);
    text-align: center;
  }

  .rail .nav-item.nav-item-crm.is-active .nav-label-crm {
    color: var(--ay-text);
  }
}

.nav-icon.nav-crm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ay-violet) 18%, transparent);
  box-shadow: inset 0 0 0 1px rgba(243, 245, 255, 0.12);
}

.nav-icon.nav-crm svg {
  width: 18px;
  height: 18px;
  fill: var(--ay-text-muted);
  stroke: none;
}

.nav-item.is-active .nav-icon.nav-crm {
  background: color-mix(in srgb, var(--ay-violet) 28%, transparent);
}
