/* Ayutor platform shell — two top rows (platform + tool sections), start page,
   ⌘K palette, mobile bottom tabs. Loaded last; uses only --ay-* tokens. */

#appShell.ay-app {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ay-bg);
}

.ay-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- platform row ---------- */

.ay-platform {
  position: relative;
  z-index: 40;
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--ay-border);
  background: var(--ay-surface-sunken);
}

.ay-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 6px;
  color: var(--ay-text);
}

.ay-brand-mark {
  width: auto;
  height: 28px;
}

.ay-brand-word {
  width: auto;
  height: 12px;
}

.ay-brand-word-dark,
[data-theme="light"] .ay-brand-word-light {
  display: none;
}

[data-theme="light"] .ay-brand-word-dark {
  display: block;
}

.ay-tool-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ay-tool-nav::-webkit-scrollbar,
.ay-section-nav::-webkit-scrollbar {
  display: none;
}

.ay-tool {
  flex: none;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--ay-radius-sm);
  color: var(--ay-text-muted);
  background: transparent;
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-medium);
  white-space: nowrap;
  transition: background var(--ay-duration) var(--ay-ease), color var(--ay-duration) var(--ay-ease);
}

.ay-tool:hover {
  color: var(--ay-text);
  background: var(--ay-surface-hover);
}

.ay-tool.is-active {
  color: var(--ay-text);
  border-color: var(--ay-border-strong);
  background: var(--ay-accent-soft);
}

.ay-tool .ay-tool-ext {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.ay-tool-sep {
  flex: none;
  width: 1px;
  height: 18px;
  margin: 0 6px;
  background: var(--ay-border);
}

.ay-platform-actions {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ay-search {
  height: 34px;
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-sm);
  color: var(--ay-text-muted);
  background: var(--ay-surface-input);
  font-size: var(--ay-text-sm);
}

.ay-search:hover {
  color: var(--ay-text);
  border-color: var(--ay-border-strong);
}

.ay-search span {
  flex: 1;
  text-align: left;
}

.ay-search kbd,
.ay-palette-field kbd {
  padding: 2px 6px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-xs);
  color: var(--ay-text-muted);
  background: var(--ay-surface);
  font-family: var(--ay-font-sans);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
}

.ay-icon-btn {
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-sm);
  color: var(--ay-text);
  background: var(--ay-surface);
  font-size: var(--ay-text-xs);
  font-weight: var(--ay-weight-semibold);
}

.ay-icon-btn:hover {
  border-color: var(--ay-border-strong);
}

.ay-avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ay-border-strong);
  border-radius: 50%;
  color: var(--ay-ice);
  background: var(--ay-violet-deep);
}

.ay-account-menu {
  position: absolute;
  z-index: 90;
  top: 44px;
  right: 0;
  width: 280px;
  padding: 6px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-lg);
  background: var(--ay-surface-2);
  box-shadow: var(--ay-shadow-overlay);
}

.ay-menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--ay-radius-sm);
  color: var(--ay-text);
  background: transparent;
  text-align: left;
}

a.ay-menu-item {
  text-decoration: none;
}

.ay-menu-item:hover {
  background: var(--ay-surface-hover);
}

.ay-menu-item .ay-icon {
  color: var(--ay-accent-text);
}

.ay-menu-item b {
  display: block;
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-medium);
}

.ay-menu-item small {
  display: block;
  margin-top: 2px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-xs);
}

#appShell .ay-account-menu #apiSettingsToggle {
  display: flex;
}

.ay-account-menu .rail-status.ay-service {
  margin: 6px 0 0;
  padding: 10px;
  border: 0;
  border-top: 1px solid var(--ay-border);
  border-radius: 0;
  background: transparent;
}

.ay-account-menu .rail-status.ay-service b {
  font-size: var(--ay-text-xs);
}

.ay-account-menu .rail-status.ay-service small {
  font-size: var(--ay-text-label);
}

/* ---------- section row ---------- */

.ay-sections {
  position: relative;
  z-index: 30;
  flex: none;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--ay-border);
  background: color-mix(in srgb, var(--ay-violet-deep) 9%, var(--ay-bg));
}

.ay-tool-chip {
  flex: none;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 14px;
  border-right: 1px solid var(--ay-border);
  color: var(--ay-text);
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-semibold);
}

.ay-chip-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--ay-radius-xs);
  color: var(--ay-ice);
  background: var(--ay-violet-deep);
}

.ay-chip-icon .ay-icon {
  width: 14px;
  height: 14px;
}

.ay-section-nav {
  min-width: 0;
  height: 100%;
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ay-sec {
  position: relative;
  flex: none;
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  color: var(--ay-text-muted);
  background: transparent;
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-medium);
  white-space: nowrap;
}

.ay-sec:hover {
  color: var(--ay-text);
}

.ay-sec.is-active {
  color: var(--ay-text);
}

.ay-sec.is-active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--ay-accent);
}

.ay-sec .ay-chev {
  width: 13px;
  height: 13px;
  opacity: 0.7;
}

.ay-sec[aria-expanded="true"] .ay-chev {
  transform: rotate(180deg);
}

.ay-badge {
  padding: 1px 6px;
  border-radius: var(--ay-radius-pill);
  color: var(--ay-on-info);
  background: var(--ay-info);
  font-size: 10px;
  font-weight: var(--ay-weight-bold);
}

.ay-only-narrow,
.ay-only-narrow-block {
  display: none !important;
}

.ay-section-actions {
  flex: none;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ay-section-settings {
  height: 100%;
  display: flex;
}

.ay-market {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-sm);
  background: var(--ay-surface-input);
}

.ay-market span {
  color: var(--ay-text-muted);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
  letter-spacing: var(--ay-label-tracking);
  text-transform: uppercase;
}

.ay-market select {
  height: 30px;
  border: 0;
  color: var(--ay-text);
  background: transparent;
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-semibold);
}

.ay-market select option {
  color: var(--ay-text);
  background: var(--ay-surface-2);
}

.ay-sections #homeScopeToggle {
  min-height: 32px;
}

.ay-sec-end-first {
  margin-left: auto;
}

.ay-sec-end-first::before {
  content: "";
  align-self: center;
  width: 1px;
  height: 18px;
  margin-right: 10px;
  margin-left: -4px;
  background: var(--ay-border);
}

/* ---------- popover ---------- */

.ay-popover {
  position: fixed;
  z-index: 95;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-md);
  background: var(--ay-surface-2);
  box-shadow: var(--ay-shadow-overlay);
}

.ay-pop-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--ay-radius-xs);
  color: var(--ay-text);
  background: transparent;
  font-size: var(--ay-text-sm);
  text-align: left;
}

.ay-pop-item:hover,
.ay-pop-item:focus-visible {
  outline: none;
  background: var(--ay-surface-hover);
}

.ay-pop-item.is-active {
  color: var(--ay-accent-text);
  font-weight: var(--ay-weight-semibold);
}

.ay-sheet-scrim {
  position: fixed;
  z-index: 94;
  inset: 0;
  background: var(--ay-scrim);
}

.ay-popover.is-sheet {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 70dvh;
  overflow-y: auto;
  padding: 8px 10px calc(14px + env(safe-area-inset-bottom, 0px));
  border-width: 1px 0 0;
  border-radius: 16px 16px 0 0;
}

.ay-popover.is-sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 2px auto 8px;
  border-radius: 2px;
  background: var(--ay-border);
}

.ay-sheet-title {
  margin: 0;
  padding: 4px 10px 8px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
  letter-spacing: var(--ay-label-tracking);
  text-transform: uppercase;
}

.ay-popover.is-sheet .ay-pop-item {
  min-height: 46px;
  font-size: var(--ay-text-md);
}

/* ---------- surface & views ---------- */

#appShell .surface {
  position: relative;
  flex: 1 1 auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

#appShell .surface > .view {
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

#appShell .surface > .marketboard-view,
#appShell .surface > .analyzer-view,
#appShell .surface > .crm-view {
  overflow: hidden;
}

#appShell .api-settings {
  top: 8px;
}

/* ---------- start page ---------- */

.ay-start {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 28px 40px;
}

.ay-start-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.ay-access {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-pill);
  color: var(--ay-text);
  background: var(--ay-surface);
  font-size: var(--ay-text-xs);
  font-weight: var(--ay-weight-semibold);
  white-space: nowrap;
}

.ay-access i,
.ay-run i {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--ay-text-disabled);
}

.ay-access.is-ok i,
.ay-run i.is-ok {
  background: var(--ay-profit);
}

.ay-access.is-warn i {
  background: var(--ay-warning);
}

.ay-access.is-bad i,
.ay-run i.is-bad {
  background: var(--ay-loss);
}

.ay-run i.is-run {
  background: var(--ay-accent);
}

.ay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.ay-action {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-md);
  color: var(--ay-text);
  background: var(--ay-surface);
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-medium);
}

.ay-action:hover {
  border-color: var(--ay-border-strong);
  background: var(--ay-surface-hover);
}

.ay-action .ay-icon {
  color: var(--ay-accent-text);
}

.ay-action kbd {
  padding: 1px 6px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-xs);
  color: var(--ay-text-muted);
  font-family: var(--ay-font-sans);
  font-size: var(--ay-text-label);
}

.ay-dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  margin-top: 18px;
}

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

.ay-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ay-kpi-card {
  min-width: 0;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-lg);
  background: var(--ay-surface);
  box-shadow: var(--ay-shadow-sm);
}

.ay-side-card {
  min-height: 0;
}

.ay-kpi-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ay-card-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  color: var(--ay-accent-text);
  background: transparent;
  font-size: var(--ay-text-xs);
  font-weight: var(--ay-weight-semibold);
}

.ay-card-open .ay-icon {
  width: 13px;
  height: 13px;
}

.ay-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ay-kpi {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-sm);
  color: var(--ay-text);
  background: var(--ay-surface-input);
  text-align: left;
}

button.ay-kpi:not(:disabled):hover {
  border-color: var(--ay-border-strong);
}

button.ay-kpi:disabled {
  opacity: 1;
  cursor: default;
}

.ay-kpi small {
  color: var(--ay-text-muted);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
  letter-spacing: var(--ay-label-tracking);
  text-transform: uppercase;
}

.ay-kpi strong {
  overflow: hidden;
  font-size: var(--ay-text-xl);
  font-weight: var(--ay-weight-bold);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.ay-kpi strong.is-loss {
  color: var(--ay-loss-text);
}

.ay-recents {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ay-recent {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--ay-radius-xs);
  color: var(--ay-text);
  background: transparent;
  text-align: left;
}

.ay-recent:hover {
  background: var(--ay-surface-hover);
}

.ay-recent b {
  overflow: hidden;
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ay-recent small {
  flex: none;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-xs);
}

.ay-run {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ay-text);
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-medium);
}

.ay-empty {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--ay-border);
  border-radius: var(--ay-radius-md);
}

.ay-empty span {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ay-text-muted);
  background: var(--ay-surface-input);
}

.ay-empty p {
  margin: 0;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-sm);
  line-height: 1.45;
}

.ay-amazon-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ay-side-card .ay-btn-primary {
  align-self: flex-start;
}

.ay-eyebrow {
  margin: 0 0 6px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
  letter-spacing: var(--ay-label-tracking);
  text-transform: uppercase;
}

.ay-start-head h1,
.ay-calc-head h1 {
  margin: 0;
  color: var(--ay-text);
  font-size: var(--ay-text-2xl);
  font-weight: var(--ay-weight-bold);
  line-height: 1.15;
}









.ay-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-lg);
  background: var(--ay-surface);
  box-shadow: var(--ay-shadow-sm);
}

.ay-card-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  color: var(--ay-text);
  background: transparent;
  font-size: var(--ay-text-md);
}

.ay-card-tool b {
  font-weight: var(--ay-weight-semibold);
}

.ay-card-tool .ay-icon {
  color: var(--ay-accent-text);
}

.ay-card-tool:hover b {
  color: var(--ay-accent-text);
}

.ay-card-lead {
  margin: 0;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-sm);
  line-height: 1.45;
}

.ay-card-note {
  margin: 0;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-xs);
}







.ay-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ay-link {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-xs);
  color: var(--ay-accent-text);
  background: transparent;
  font-size: var(--ay-text-xs);
  font-weight: var(--ay-weight-semibold);
}

.ay-link:hover {
  border-color: var(--ay-border-strong);
  background: var(--ay-surface-hover);
}

.ay-link-ext {
  width: 12px;
  height: 12px;
}

.ay-btn-primary,
.ay-btn-secondary {
  height: var(--ay-control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--ay-control-pad-x);
  border-radius: var(--ay-radius-sm);
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-semibold);
}

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

.ay-btn-primary:hover {
  background: var(--ay-accent-hover);
}

.ay-btn-secondary {
  border: 1px solid var(--ay-violet-deep);
  color: var(--ay-text);
  background: transparent;
}

.ay-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ay-chip {
  padding: 2px 7px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-xs);
  color: var(--ay-text);
  background: var(--ay-surface-input);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
}

/* ---------- calculator page ---------- */

.ay-calc {
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.ay-calc-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ay-calc-head img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.ay-calc-head .ay-eyebrow {
  margin-bottom: 4px;
}

.ay-calc-lead {
  margin: 0;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-md);
  line-height: 1.5;
}

.ay-calc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.ay-calc-facts small {
  display: block;
  margin-bottom: 6px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
  letter-spacing: var(--ay-label-tracking);
  text-transform: uppercase;
}

.ay-calc-facts b {
  font-size: var(--ay-text-lg);
  font-variant-numeric: tabular-nums;
}

.ay-calc-what h2 {
  margin: 0;
  font-size: var(--ay-text-md);
  font-weight: var(--ay-weight-semibold);
}

.ay-calc-what ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ay-text);
  font-size: var(--ay-text-sm);
  line-height: 1.7;
}

.ay-calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- ⌘K palette ---------- */

.ay-palette {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: var(--ay-scrim);
}

.ay-palette-box {
  width: min(640px, 100%);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ay-border);
  border-radius: 14px;
  background: var(--ay-surface-2);
  box-shadow: var(--ay-shadow-overlay);
}

.ay-palette-field {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--ay-border);
  color: var(--ay-text-muted);
}

.ay-palette-field input {
  height: 52px;
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  color: var(--ay-text);
  background: transparent;
  font-size: 15px;
}

.ay-palette-field input::-webkit-search-cancel-button {
  display: none;
}

.ay-palette-list {
  overflow-y: auto;
  padding: 6px;
}

.ay-palette-group {
  margin: 0;
  padding: 10px 10px 4px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-label);
  font-weight: var(--ay-weight-semibold);
  letter-spacing: var(--ay-label-tracking);
  text-transform: uppercase;
}

.ay-palette-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--ay-radius-sm);
  color: var(--ay-text);
  background: transparent;
  text-align: left;
}

.ay-palette-item > .ay-icon:first-child {
  color: var(--ay-accent-text);
}

.ay-palette-item span {
  flex: 1;
  min-width: 0;
}

.ay-palette-item b {
  display: block;
  font-size: var(--ay-text-sm);
  font-weight: var(--ay-weight-medium);
}

.ay-palette-item small {
  display: block;
  margin-top: 1px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-xs);
}

.ay-palette-go {
  opacity: 0;
}

.ay-palette-item.is-active {
  background: var(--ay-accent-soft);
}

.ay-palette-item.is-active .ay-palette-go {
  opacity: 0.8;
}

.ay-palette-empty {
  margin: 0;
  padding: 24px 12px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-sm);
  text-align: center;
}

/* ---------- mobile tabs ---------- */

.ay-tabs {
  display: none;
}

@media (max-width: 1180px) {
  .ay-dash {
    grid-template-columns: 1fr;
  }

  .ay-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }


  .ay-search {
    min-width: 0;
  }

  .ay-search kbd {
    display: none;
  }

  .ay-tool {
    padding: 0 9px;
  }
}

@media (max-width: 980px) and (min-width: 761px) {
  .ay-search span,
  .ay-brand b {
    display: none;
  }

  .ay-tool-chip > span:last-child {
    display: none;
  }

  .ay-brand .ay-brand-word {
    display: none;
  }
}

@media (max-width: 760px) {
  .ay-platform {
    height: 52px;
    gap: 8px;
    padding: 0 10px;
  }

  .ay-tool-nav,
  .ay-platform .lang-toggle,
  #ayThemeToggle {
    display: none;
  }

  .ay-search {
    width: 36px;
    height: 36px;
    justify-content: center;
    padding: 0;
  }

  .ay-search span,
  .ay-search kbd {
    display: none;
  }

  .ay-search .ay-icon {
    width: 18px;
    height: 18px;
  }

  .ay-avatar {
    width: 34px;
    height: 34px;
  }

  .ay-account-menu {
    position: fixed;
    top: 56px;
    right: 8px;
    width: min(300px, calc(100vw - 16px));
  }

  .ay-sections {
    height: 44px;
    gap: 8px;
    padding: 0 10px 0 4px;
  }

  .ay-tool-chip {
    display: none;
  }

  .ay-only-wide {
    display: none !important;
  }

  .ay-only-narrow {
    display: inline-flex !important;
  }

  .ay-only-narrow-block {
    display: block !important;
  }

  .ay-market span {
    display: none;
  }

  .ay-market {
    padding-left: 4px;
  }

  .ay-sections #homeScopeToggle b {
    max-width: 90px;
  }

  .ay-tabs {
    flex: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--ay-border);
    background: var(--ay-surface-sunken);
  }

  .ay-tab {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 2px;
    border: 0;
    color: var(--ay-text-muted);
    background: transparent;
    font-size: 10.5px;
    font-weight: var(--ay-weight-medium);
  }

  .ay-tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ay-tab .ay-icon {
    width: 19px;
    height: 19px;
  }

  .ay-tab.is-active {
    color: var(--ay-accent-text);
  }

  .ay-tab.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--ay-accent);
    transform: translateX(-50%);
  }

  .ay-start {
    padding: 16px 14px 28px;
  }

  .ay-start-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .ay-action {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .ay-action kbd {
    display: none;
  }

  .ay-kpi-grid,
  .ay-side {
    grid-template-columns: 1fr;
  }

  .ay-kpi-card {
    min-height: 0;
  }

  .ay-kpi strong {
    font-size: var(--ay-text-lg);
  }

  .ay-brand-mark {
    height: 26px;
  }

  .ay-start-head h1,
  .ay-calc-head h1 {
    font-size: var(--ay-text-xl);
  }


  .ay-calc {
    padding: 18px 14px 28px;
  }

  .ay-palette {
    padding: 0;
    align-items: stretch;
  }

  .ay-palette-box {
    width: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ay-tool,
  .ay-sec .ay-chev {
    transition: none;
  }
}

/* ---------- home (post-login start page) ---------- */

.ay-home {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: calc(100dvh - 108px);
}

@media (min-width: 1600px) {
  .ay-home {
    padding-left: 32px;
    padding-right: 32px;
  }
}

.ay-h-card {
  min-width: 0;
  padding: 20px 24px;
  border: 1px solid var(--ay-border);
  border-radius: 14px;
  color: var(--ay-text);
  background: var(--ay-surface);
  box-shadow: var(--ay-shadow-sm);
}

.ay-h-card h2 {
  margin: 0;
  font-size: var(--ay-text-xl);
  font-weight: var(--ay-weight-semibold);
  line-height: 1.2;
}

/* Amazon strip */
.ay-h-amz {
  display: grid;
  grid-template-columns: 170px 160px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 132px;
}

.ay-h-amz.is-empty,
.ay-h-amz.is-placeholder {
  grid-template-columns: 170px 160px minmax(0, 1fr) auto;
}

.ay-h-amz-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ay-h-amz-title b {
  font-size: 21px;
  font-weight: var(--ay-weight-semibold);
}

.ay-h-amz-title small,
.ay-h-amz-meta small {
  color: var(--ay-text-muted);
  font-size: var(--ay-text-md);
}

.ay-gauge {
  position: relative;
  width: 160px;
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  --gauge: var(--ay-text-disabled);
}

.ay-gauge.is-ok { --gauge: var(--ay-profit); }
.ay-gauge.is-warn { --gauge: var(--ay-warning); }
.ay-gauge.is-bad { --gauge: var(--ay-loss); }

.ay-gauge svg {
  position: absolute;
  inset: 0 0 auto;
  width: 160px;
  height: 86px;
  overflow: visible;
}

.ay-gauge path {
  fill: none;
  stroke-width: 11;
  stroke-linecap: round;
}

.ay-gauge-track {
  stroke: color-mix(in srgb, var(--ay-ice) 22%, transparent);
}

.ay-gauge-val {
  stroke: var(--gauge);
}

.ay-gauge strong {
  position: relative;
  color: var(--gauge);
  font-size: 38px;
  font-weight: var(--ay-weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ay-gauge small {
  position: relative;
  margin-top: 6px;
  color: var(--ay-text);
  font-size: var(--ay-text-md);
}

.ay-h-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ay-h-pill {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--ay-warning-border);
  border-radius: var(--ay-radius-sm);
  color: var(--ay-warning-text);
  background: var(--ay-warning-soft);
  font-size: var(--ay-text-md);
  font-weight: var(--ay-weight-medium);
  white-space: nowrap;
}

.ay-h-pill .ay-icon {
  width: 16px;
  height: 16px;
}

.ay-h-pill.is-bad {
  border-color: var(--ay-loss-border);
  color: var(--ay-loss-text);
  background: var(--ay-loss-soft);
}

.ay-h-allok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-md);
}

.ay-h-allok .ay-icon {
  color: var(--ay-profit);
}

.ay-h-amz-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.ay-h-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ay-text);
  font-size: var(--ay-text-lg);
  font-weight: var(--ay-weight-medium);
  white-space: nowrap;
}

.ay-h-more:hover {
  color: var(--ay-accent-text);
}

.ay-h-more .ay-icon {
  width: 16px;
  height: 16px;
}

.ay-h-note {
  margin: 0;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-md);
  line-height: 1.45;
}

/* «Сейчас» */
.ay-h-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  border-left: 5px solid var(--ay-warning);
}

.ay-h-now.is-bad {
  border-left-color: var(--ay-loss);
}

.ay-h-now.is-calm {
  border-left-color: var(--ay-border);
}

.ay-h-now h2 {
  margin: 4px 0 10px;
  font-size: 26px;
  font-weight: var(--ay-weight-semibold);
}

.ay-h-label {
  margin: 0;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-md);
}

.ay-h-then {
  margin: 6px 0 0;
  color: var(--ay-text);
  font-size: var(--ay-text-md);
}

.ay-h-now.is-calm .ay-h-then {
  color: var(--ay-text-muted);
}

/* buttons: lime = the one primary action; light / outline = secondary */
.ay-h-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--ay-radius-sm);
  font-size: var(--ay-text-lg);
  font-weight: var(--ay-weight-semibold);
  white-space: nowrap;
  cursor: pointer;
}

.ay-h-btn.is-light {
  color: #222;
  background: #e6e7ec;
}

.ay-h-btn.is-light:hover {
  background: var(--ay-white);
}

.ay-h-btn.is-outline {
  color: var(--ay-text);
  border-color: color-mix(in srgb, var(--ay-ice) 22%, transparent);
  background: transparent;
}

.ay-h-btn.is-outline:hover {
  border-color: color-mix(in srgb, var(--ay-ice) 40%, transparent);
  background: var(--ay-surface-hover);
}

.ay-h-btn.is-lime {
  color: #222;
  background: var(--ay-lime);
}

.ay-h-btn.is-lime:hover {
  background: color-mix(in srgb, var(--ay-lime) 88%, var(--ay-white));
}

/* doors */
.ay-h-doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ay-h-door {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 236px;
}

.ay-h-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ay-h-head span {
  color: var(--ay-text-muted);
  font-size: var(--ay-text-md);
}

.ay-h-door-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.ay-h-big {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.ay-h-big strong {
  font-size: 52px;
  font-weight: var(--ay-weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.ay-h-big span {
  font-size: var(--ay-text-lg);
  font-weight: var(--ay-weight-medium);
}

.ay-h-meta,
.ay-h-quiet {
  display: block;
  margin: 0;
  color: var(--ay-text-muted);
  font-size: var(--ay-text-md);
  line-height: 1.45;
}

.ay-h-panels {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ay-h-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-md);
  background: var(--ay-surface-sunken);
}

.ay-h-panel .ay-h-big strong {
  font-size: 34px;
}

.ay-h-panel .ay-h-btn {
  margin-top: auto;
  width: 100%;
}

.ay-h-panel-title {
  margin: 0;
  font-size: var(--ay-text-lg);
  font-weight: var(--ay-weight-medium);
}

.ay-h-panel-text {
  margin: 0;
  font-size: var(--ay-text-md);
  line-height: 1.45;
}

.ay-h-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ay-h-chip {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-xs);
  color: var(--ay-text);
  background: var(--ay-surface-input);
  font-size: var(--ay-text-sm);
}

/* bottom row */
.ay-h-row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ay-h-tile {
  min-height: 136px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.ay-h-tile:hover {
  border-color: var(--ay-border-strong);
}

.ay-h-tile-title {
  font-size: var(--ay-text-lg);
  font-weight: var(--ay-weight-medium);
}

.ay-h-profit {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.ay-h-profit strong,
.ay-h-mid strong {
  font-size: 36px;
  font-weight: var(--ay-weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.ay-h-profit strong.is-profit { color: var(--ay-profit-text); }
.ay-h-profit strong.is-loss { color: var(--ay-loss-text); }

.ay-h-mid {
  display: block;
}

.ay-h-mid span {
  color: var(--ay-text-muted);
  font-size: var(--ay-text-xl);
}

.ay-h-spark {
  width: 160px;
  height: 46px;
  flex: none;
}

.ay-h-spark-line {
  fill: none;
  stroke: var(--ay-profit);
  stroke-width: 2;
}

.ay-h-spark-fill {
  fill: color-mix(in srgb, var(--ay-lime) 18%, transparent);
}

.ay-h-overdue {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--ay-loss-border);
  border-radius: var(--ay-radius-xs);
  color: var(--ay-loss-text);
  background: var(--ay-loss-soft);
  font-size: var(--ay-text-sm);
}

@media (max-width: 1180px) {
  .ay-h-amz {
    grid-template-columns: 150px 160px minmax(0, 1fr);
  }
  .ay-h-amz-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 980px) {
  .ay-h-doors,
  .ay-h-row3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .ay-home {
    padding: 14px 14px 96px;
    gap: 12px;
  }
  .ay-h-card {
    padding: 16px;
  }
  .ay-h-amz,
  .ay-h-amz.is-empty {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
  }
  .ay-h-pills {
    grid-column: 1 / -1;
  }
  .ay-h-now {
    flex-direction: column;
    align-items: stretch;
  }
  .ay-h-now h2 {
    font-size: var(--ay-text-xl);
  }
  .ay-h-panels {
    grid-template-columns: minmax(0, 1fr);
  }
  .ay-h-big strong {
    font-size: 40px;
  }
}

/* ---------- home v2 (colorful structure) ---------- */

.ay-v2-head h1 {
  margin: 0;
  font-size: 34px;
  font-weight: var(--ay-weight-semibold);
  letter-spacing: -0.02em;
}

.ay-v2-head p {
  margin: 4px 0 0;
  color: var(--ay-text-muted);
}

.ay-v2-row1,
.ay-v2-row2,
.ay-v2-row3 {
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.ay-v2-row1 { grid-template-columns: minmax(0, 2fr) minmax(0, 0.62fr); }
.ay-v2-row2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.2fr) minmax(0, 0.78fr); }
.ay-v2-row3 { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.25fr) minmax(0, 0.9fr); }

.ay-v2-now,
.ay-v2-amazon,
.ay-v2-qogita,
.ay-v2-crm,
.ay-v2-analyzer,
.ay-v2-actions,
.ay-v2-mb,
.ay-v2-ai {
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ay-v2-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ay-v2-card-head h2 { font-size: 18px; }
.ay-v2-card-head small { color: var(--ay-text-muted); }

.ay-v2-amazon > .ay-v2-card-head {
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 8px;
}

.ay-amz-market-select {
  margin-left: auto;
  height: 34px;
  max-width: 100%;
  padding: 0 28px 0 10px;
  border: 1px solid var(--ay-border);
  border-radius: var(--ay-radius-sm);
  color: var(--ay-text);
  background-color: var(--ay-surface-input);
  background-image: linear-gradient(45deg, transparent 50%, var(--ay-text-muted) 50%), linear-gradient(135deg, var(--ay-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  font: inherit;
  font-size: var(--ay-text-sm);
  cursor: pointer;
  appearance: none;
}

.ay-amz-market-select:hover,
.ay-amz-market-select:focus-visible {
  border-color: var(--ay-border-strong);
  outline: none;
}

.ay-seller-mark {
  display: block;
  width: 282px;
  height: auto;
  flex: none;
  mix-blend-mode: lighten;
}

[data-theme="light"] .ay-seller-mark {
  mix-blend-mode: normal;
  border-radius: 6px;
}

.ay-qogita-mark {
  display: block;
  height: 66px;
  width: auto;
  flex: none;
  background: none;
  filter: invert(1);
}

[data-theme="light"] .ay-qogita-mark {
  filter: none;
}

.ay-v2-ico {
  width: 18px;
  height: 18px;
  display: block;
}

.ay-v2-ico-wrap {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #6d5efc;
}

.ay-v2-ico-wrap.is-warn { background: #e0a100; color: #1c1400; }
.ay-v2-ico-wrap.is-bad { background: #e23b4a; }
.ay-v2-ico-wrap.is-box { background: #3b82f6; }
.ay-v2-ico-wrap.is-amz { background: #f0b429; color: #1c1400; }
.ay-v2-ico-wrap.is-lime { background: #b6f23a; color: #1a2408; }
.ay-v2-ico-wrap.is-purple { background: #7c5cfc; }
.ay-v2-ico-wrap.is-blue { background: #3b82f6; }
.ay-v2-ico-wrap.is-gold { background: #f5c542; color: #1c1400; }
.ay-v2-ico-wrap.is-teal { background: #14b8a6; }
.ay-v2-ico-wrap.is-ok { background: #1f9d55; }

.ay-v2-signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ay-v2-signal,
.ay-v2-action,
.ay-v2-mb {
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.ay-v2-signal,
.ay-v2-action {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--ay-border);
  border-radius: 12px;
  color: inherit;
  background: color-mix(in srgb, var(--ay-surface) 70%, var(--ay-bg));
  text-decoration: none;
}

.ay-v2-signal:hover,
.ay-v2-action:hover,
.ay-v2-mb:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ay-ice) 45%, var(--ay-border));
  background: var(--ay-surface-hover);
}

.ay-v2-signal-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ay-v2-signal-copy { flex: 1; text-align: left; }
.ay-v2-signal-copy b {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
  font-weight: var(--ay-weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ay-v2-signal-copy small { display: block; color: var(--ay-text-muted); font-size: 12px; line-height: 1.3; }
.ay-v2-chevron { margin-left: auto; color: var(--ay-text-muted); display: grid; }
.ay-v2-chevron .ay-v2-ico { width: 16px; height: 16px; }
.ay-v2-signal:hover .ay-v2-chevron { color: var(--ay-text); }

.ay-v2-ai {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding-right: 108px;
  background:
    radial-gradient(180px 140px at 88% 78%, color-mix(in srgb, #7c5cfc 46%, transparent), transparent 70%),
    var(--ay-surface);
}

.ay-v2-ai h2,
.ay-v2-ai-body {
  font-size: 14px;
}

.ay-v2-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  color: #efeaff;
  background: color-mix(in srgb, #7c5cfc 55%, transparent);
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}

.ay-v2-ai-body {
  margin: 8px 0 0;
  max-width: 36ch;
  color: var(--ay-text-muted);
  line-height: 1.45;
}

.ay-v2-kicker {
  margin: 0;
  color: #b9a6ff;
  font-size: 12px;
  font-weight: var(--ay-weight-semibold);
  letter-spacing: 0.08em;
}

.ay-v2-mascot {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: auto;
  max-width: 34%;
  height: 150px;
  pointer-events: none;
  filter: drop-shadow(0 14px 28px color-mix(in srgb, #7c5cfc 48%, transparent));
}

.ay-v2-amz-body,
.ay-v2-split,
.ay-v2-stats {
  display: grid;
  gap: 12px;
  align-items: center;
}

.ay-v2-amz-body { grid-template-columns: minmax(0, 132px) minmax(0, 1fr); align-items: center; min-width: 0; }
.ay-v2-amazon .ay-gauge { width: 100%; max-width: 128px; height: 96px; }
.ay-v2-amazon .ay-gauge svg { width: 100%; height: 78px; }
.ay-v2-amazon .ay-gauge strong { font-size: 28px; }
.ay-v2-rows { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ay-v2-metric {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  min-width: 0;
}
.ay-v2-metric > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.ay-v2-metric b { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.ay-v2-wide { width: 100%; }
.ay-v2-split { grid-template-columns: 1fr 1fr; align-items: start; }
.ay-v2-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ay-v2-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--ay-text-muted);
}

.ay-v2-row b { color: var(--ay-text); }

.ay-v2-stat { min-width: 0; text-align: left; }
.ay-v2-stat b { display: block; font-size: 22px; line-height: 1; }
.ay-v2-stat small { display: block; color: var(--ay-text-muted); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.ay-v2-stat.is-bad b { color: var(--ay-loss-text); }
.ay-v2-stat.is-ok b { color: var(--ay-profit-text); }

.ay-h-btn.is-purple {
  color: #fff;
  background: #7c5cfc;
  border-color: transparent;
}

.ay-h-btn.is-purple:hover { background: #6a4cf0; }

.ay-v2-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ay-v2-action span:last-child {
  min-width: 0;
  font-size: 13px;
  font-weight: var(--ay-weight-medium);
  line-height: 1.2;
}

.ay-v2-profit {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.ay-v2-profit strong { font-size: 28px; }
.ay-v2-profit.is-profit strong { color: var(--ay-profit-text); }
.ay-v2-profit.is-loss strong { color: var(--ay-loss-text); }

.ay-v2-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
}

.ay-v2-bars i {
  display: block;
  width: 8px;
  border-radius: 3px 3px 1px 1px;
  background: #14b8a6;
}

.ay-v2-reimb-label {
  margin: 0;
  color: var(--ay-text-muted);
  font-size: 13px;
}

.ay-v2-reimb { margin: 0; }

.ay-v2-mb { width: 100%; font: inherit; }

@media (max-width: 900px) {
  .ay-v2-row1,
  .ay-v2-row2,
  .ay-v2-row3,
  .ay-v2-signals,
  .ay-v2-action-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ay-v2-ai { min-height: 0; }
}

@media (max-width: 720px) {
  .ay-v2-row1,
  .ay-v2-row2,
  .ay-v2-row3,
  .ay-v2-signals,
  .ay-v2-split,
  .ay-v2-stats,
  .ay-v2-action-grid,
  .ay-v2-amz-body { grid-template-columns: minmax(0, 1fr); }
}
