/* Restrained semantic accents. Existing labels and directional glyphs carry
 * meaning independently of color. Historical themes retain their palette. */
.phone.app-theme-refined :is(
  [data-icon-tone],
  .account-icon,
  .next-home-tool-grid > button > span:first-child,
  .next-business-destination-grid > button > span:first-child,
  .next-more-group button > span:first-child,
  .next-home-feature-icon,
  .receive-method-grid > button > span:first-child,
  .energy-mark,
  .health-hero-mark,
  .health-service-grid > button > span:first-child
) {
  color: var(--biz-accent-ink, var(--biz-icon));
  background: var(--biz-accent-surface, var(--biz-surface-soft));
}

/* Context color follows the service, consistently across its entry points. */
.phone.app-theme-refined :is(
  .account-icon,
  [data-icon-tone="account"],
  [data-icon-tone="info"],
  .next-more-group [data-next-home-action="account"] > span:first-child,
  .next-more-group [data-next-home-action="card"] > span:first-child,
  .next-home-tool-grid [data-hub-target="cashflow"] > span:first-child,
  .next-business-destination-grid [data-hub-target="cashflow"] > span:first-child,
  .receive-method-grid [data-receive-step="pos-form"] > span:first-child,
  [data-hub-target="cashflow"] > .next-home-feature-icon
) {
  --biz-accent-ink: var(--biz-info);
  --biz-accent-surface: var(--biz-info-soft);
}
.phone.app-theme-refined :is(
  [data-icon-tone="incoming"],
  [data-icon-tone="success"],
  .next-home-tool-grid [data-hub-target="receive"] > span:first-child,
  .next-business-destination-grid [data-hub-target="receive"] > span:first-child,
  .next-home-account-actions [data-hub-target="receive"] > span,
  [data-hub-target="receive"] > .next-home-feature-icon,
  .receive-method-grid [data-receive-step="link-form"] > span:first-child,
  .receive-method-grid [data-receive-step="request-form"] > span:first-child,
  .health-hero-mark,
  .health-service-grid > button > span:first-child
) {
  --biz-accent-ink: var(--biz-incoming);
  --biz-accent-surface: var(--biz-incoming-soft);
}
.phone.app-theme-refined :is(
  [data-icon-tone="outgoing"],
  [data-icon-tone="danger"]
) {
  --biz-accent-ink: var(--biz-outgoing);
  --biz-accent-surface: var(--biz-outgoing-soft);
}
.phone.app-theme-refined :is(
  [data-icon-tone="warning"],
  .next-home-tool-grid [data-hub-target="invoices"] > span:first-child,
  .next-business-destination-grid [data-hub-target="invoices"] > span:first-child,
  .receive-method-grid [data-hub-target="invoices"] > span:first-child,
  .next-business-destination-grid [data-hub-target="energy"] > span:first-child,
  .next-more-group [data-hub-target="energy"] > span:first-child,
  .energy-mark
) {
  --biz-accent-ink: var(--biz-warning);
  --biz-accent-surface: var(--biz-warning-soft);
}

/* These shortcut slots otherwise inherit the primary-action component. */
.phone.app-theme-refined .next-home-account-actions button[data-hub-target="receive"] > span {
  color: var(--biz-accent-ink);
  background: var(--biz-accent-surface);
}

/* Compact tags use the same type scale and padding. Long descriptions and
 * interactive filter buttons are deliberately outside this component. */
.phone.next-ui-theme.app-theme-refined :is(
  [data-tag-tone],
  .connection-chip,
  .next-connected-links em,
  .profile-identity-badges > span
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--biz-space-1);
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: var(--biz-tag-padding-block) var(--biz-tag-padding-inline);
  border: 0;
  border-radius: var(--biz-tag-radius);
  color: var(--biz-tag-ink, var(--biz-muted));
  background: var(--biz-tag-surface, var(--biz-surface-soft));
  font-family: var(--biz-font-medium);
  font-size: var(--biz-text-caption) !important;
  font-style: normal;
  line-height: var(--biz-line-caption);
  letter-spacing: 0;
  text-align: start;
  box-shadow: none;
}
.phone.app-theme-refined :is(
  [data-tag-tone="success"],
  .connection-chip,
  .next-connected-links em,
  .profile-identity-badges > span:has(use[href="#i-shield"])
) {
  --biz-tag-ink: var(--biz-success);
  --biz-tag-surface: var(--biz-success-soft);
}
.phone.app-theme-refined [data-tag-tone="warning"] {
  --biz-tag-ink: var(--biz-warning);
  --biz-tag-surface: var(--biz-warning-soft);
}
.phone.app-theme-refined [data-tag-tone="danger"] {
  --biz-tag-ink: var(--biz-danger);
  --biz-tag-surface: var(--biz-danger-soft);
}
.phone.app-theme-refined :is(
  [data-tag-tone="info"],
  .profile-identity-badges > span:has(use[href="#i-account"])
) {
  --biz-tag-ink: var(--biz-info);
  --biz-tag-surface: var(--biz-info-soft);
}
.phone.app-theme-refined .profile-identity-badges > span > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Status-tag colors must beat legacy state selectors, without tinting rows. */
.phone.next-ui-theme.app-theme-refined :is(.invoice-document > header > b,
  .scf-screen .scf-invoice > b)[data-tag-tone] {
  color: var(--biz-tag-ink, var(--biz-muted));
  background: var(--biz-tag-surface, var(--biz-surface-soft));
}

/* Row actions are readable action labels, not tiny outlined status badges.
 * The entire row remains the existing hit target. */
.phone.app-theme-refined .next-home-task-list > button > em {
  padding: var(--biz-space-1) var(--biz-space-2);
  border: 0;
  border-radius: var(--biz-tag-radius);
  color: var(--biz-info);
  background: var(--biz-info-soft);
  font-family: var(--biz-font-medium);
  font-size: var(--biz-text-caption);
  line-height: var(--biz-line-caption);
}

/* SCF workspace tags: stronger semantic pairs and a solid selected filter. */
.phone .scf-screen :is(.scf-case-filters, .scf-case-list, .scf-case-summary) {
  --scf-tag-neutral: #46566c;
  --scf-tag-neutral-soft: #e8edf4;
  --scf-tag-warning: #965208;
  --scf-tag-warning-soft: #fff0cc;
  --scf-tag-info: #245fca;
  --scf-tag-info-soft: #e4eeff;
  --scf-tag-success: #14744e;
  --scf-tag-success-soft: #d9f3e5;
  --scf-tag-ink: var(--scf-tag-neutral);
  --scf-tag-surface: var(--scf-tag-neutral-soft);
}
.phone .scf-screen :is([data-scf-case-filter="action"], [data-scf-summary="action"], .scf-case-status[data-tag-tone="warning"]) {
  --scf-tag-ink: var(--scf-tag-warning);
  --scf-tag-surface: var(--scf-tag-warning-soft);
}
.phone .scf-screen :is([data-scf-case-filter="active"], [data-scf-summary="active"], .scf-case-status[data-tag-tone="info"], .scf-case-row.review .scf-case-status) {
  --scf-tag-ink: var(--scf-tag-info);
  --scf-tag-surface: var(--scf-tag-info-soft);
}
.phone .scf-screen :is([data-scf-case-filter="closed"], [data-scf-summary="closed"], .scf-case-status[data-tag-tone="success"]) {
  --scf-tag-ink: var(--scf-tag-success);
  --scf-tag-surface: var(--scf-tag-success-soft);
}
.phone .scf-screen .scf-case-row.unavailable .scf-case-status {
  --scf-tag-ink: var(--scf-tag-neutral);
  --scf-tag-surface: var(--scf-tag-neutral-soft);
}
/* Three quiet metric cards share the filters' status colors. */
.phone .scf-screen .scf-case-summary.scf-summary-cards {
  margin-top: 16px;
  padding: 0;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.phone .scf-screen .scf-case-summary.scf-summary-cards > .scf-summary-card {
  min-height: 94px;
  padding: 12px;
  gap: 10px;
  justify-content: space-between;
  border: 1px solid #ffffffb3;
  border-radius: 18px;
  color: var(--scf-tag-ink);
  background: var(--scf-tag-surface);
  box-shadow: 0 2px 4px #15271c04;
}
.phone .scf-screen .scf-summary-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.phone .scf-screen .scf-summary-card strong {
  color: inherit;
  font-family: "Vazirmatn SemiBold", Tahoma, sans-serif;
  font-size: 26px !important;
  font-weight: 600;
  line-height: 32px;
}
.phone .scf-screen .scf-summary-card > span {
  margin: 0;
  color: inherit;
  font-family: "Vazirmatn SemiBold", Tahoma, sans-serif;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 20px;
}
.phone .scf-screen .scf-summary-card svg {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 6px;
  flex: 0 0 30px;
  border-radius: 10px;
  color: inherit;
  background: #ffffffa6;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 360px) {
  .phone .scf-screen .scf-case-summary.scf-summary-cards { gap: 6px; }
  .phone .scf-screen .scf-case-summary.scf-summary-cards > .scf-summary-card { padding: 10px 8px; }
}
.phone .scf-screen .scf-case-filters {
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px 0 7px;
  overflow-x: auto;
}
.phone .scf-screen .scf-case-filters button {
  min-height: 44px;
  padding: 8px 6px;
  gap: 4px;
  flex: 1 0 auto;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--scf-tag-ink);
  background: var(--scf-tag-surface);
  font-family: "Vazirmatn SemiBold", Tahoma, sans-serif;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.phone .scf-screen .scf-case-filters button > span {
  min-width: 18px;
  height: 20px;
  padding: 0 3px;
  border-radius: 999px;
  color: inherit;
  background: #ffffffb8;
  font: inherit;
  font-size: 12px !important;
  line-height: 1;
}
.phone .scf-screen .scf-case-filters button.active {
  border-color: var(--scf-tag-ink);
  color: #fff;
  background: var(--scf-tag-ink);
  box-shadow: 0 3px 8px #14233014;
}
.phone .scf-screen .scf-case-filters button.active > span {
  color: #fff;
  background: #ffffff30;
}
.phone .scf-screen .scf-case-filters button:focus-visible {
  outline: 2px solid var(--scf-tag-ink);
  outline-offset: 2px;
}
@media (hover: hover) {
  .phone .scf-screen .scf-case-filters button:hover {
    box-shadow: inset 0 0 0 1px var(--scf-tag-ink);
  }
}
.phone .scf-screen .scf-case-row > header {
  padding: 12px 12px 0;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  background: transparent;
}
.phone .scf-screen .scf-case-row > header > .scf-case-status[data-tag-tone] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--scf-tag-ink);
  background: var(--scf-tag-surface);
  font-family: "Vazirmatn SemiBold", Tahoma, sans-serif;
  font-size: 13px !important;
  font-weight: 600;
  line-height: 22px;
}
.phone .scf-screen :is(.scf-case-filters button, .scf-case-status) > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.phone .scf-screen .scf-case-filters button > svg {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .phone .scf-screen .scf-case-filters button { transition: none; }
}
