/* Round 3 — scoped QA visual rules. */
:root{--u2r3-amber:#f59e0b;--u2r3-emerald:#064e3b;--u2r3-teal:#0b948b}
/* Preserve the existing stack-to-carousel launch animation; polish only swipe context. */
#u2w-root .u2w-card-context{backface-visibility:hidden;will-change:opacity,transform;contain:layout style}
#u2w-root .u2w-carousel-viewport,#u2w-root .u2w-carousel,#u2w-root .u2w-active-card,#u2w-root .u2w-peek{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
#u2w-root .u2-real-card.u2-official-look{background:#123c48!important}
#u2w-root .u2-real-card.u2-official-look .u2-real-official-image{object-fit:contain;object-position:center;opacity:1;z-index:1}
#u2w-root .u2-real-card.u2-official-look .u2-card-chip,#u2w-root .u2-real-card.u2-official-look .u2-real-digits,#u2w-root .u2-real-card.u2-official-look .u2-real-network{visibility:hidden}
#u2w-root .u2-real-card.u2-official-look .u2-real-top{position:absolute;left:9px;right:9px;top:9px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:6px}
#u2w-root .u2-real-card.u2-official-look .u2-real-top span,#u2w-root .u2-real-card.u2-official-look .u2-real-top small{border-radius:8px;background:rgba(1,27,33,.78);color:#fff!important;padding:5px 7px;font-size:9px;box-shadow:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:74%}
#u2w-root .u2-real-card:not(.u2-official-look) .u2-real-top{display:flex;justify-content:space-between;gap:5px;z-index:3}
#u2w-root .u2-real-card .u2-real-top span{max-width:75%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* The reusable existing dock component is the only active Finance subsection control. */
body:not(:has(.finance-full-shell)) #u2w-dock-area{display:none!important}
body:has(.finance-full-shell) .bottom #laari-nav-tab,body:has(.finance-full-shell) .bottom .rufiyaa-tab{visibility:hidden!important;pointer-events:none!important}
#u2w-dock-area{position:fixed!important;right:var(--u2w-dock-right,clamp(15px,5vw,45px))!important;bottom:var(--u2w-dock-bottom,calc(22px + env(safe-area-inset-bottom)))!important;left:auto!important;top:auto!important;transform:none!important;filter:none!important;gap:9px!important;z-index:2147480900!important;justify-items:end!important;pointer-events:none!important}
#u2w-aavi-trigger{font-family:system-ui,-apple-system,sans-serif!important;line-height:1!important;transition:transform .28s ease,background .28s ease,opacity .2s ease!important}
#u2w-aavi-trigger.u2r3-morph{animation:u2r3-dock-morph .28s cubic-bezier(.2,.8,.3,1)}
@keyframes u2r3-dock-morph{from{transform:scale(.8) rotate(-28deg);opacity:.55}to{transform:scale(1) rotate(0);opacity:1}}
#u2w-thought{margin:0 0 9px 0!important;max-width:min(340px,calc(100vw - 32px))!important;transform-origin:90% 100%!important}
#u2w-thought:after{bottom:-8px!important}
/* Native Debit / Prepaid Wallet details use the Credit Details presentation system. */
.u2r3-native-detail .u2native-card{margin-bottom:12px}
.u2r3-native-detail .u2native-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.u2r3-detail-action,.u2r3-history-row{display:flex!important;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;padding:14px 4px!important;border:0!important;border-bottom:1px solid rgba(7,86,63,.12)!important;border-radius:0!important;text-align:left;background:transparent!important;color:#064e3b!important}
.u2r3-detail-action>span{font-size:20px}.u2r3-history-row>span{display:grid;gap:4px;min-width:0}.u2r3-history-row>span>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.u2r3-history-row small{color:#6d8479}.u2r3-history-row strong{white-space:nowrap}
/* At-risk is amber even when 'under budget' and previously marked healthy by R2. */
body .budget-v14-card.risk .budget-v14-progress i,body .budget-v14-card.risk.u2w-healthy .budget-v14-progress i,body .budget-v14-card.risk .budget-v14-bar i,body .budget-v14-card.risk .progress-fill{background:#f59e0b!important;background-image:none!important}
.u2r3-allocation{margin-top:10px;padding:12px;border-radius:14px;background:#eff8f2;border:1px solid #c9e5d5;color:#285342;display:grid;gap:6px}
.u2r3-allocation>div{display:flex;align-items:baseline;justify-content:space-between;gap:10px;font-size:12px}.u2r3-allocation b{font-size:13px;white-space:nowrap;color:#07563f}.u2r3-allocation small{font-size:11px;color:#5d776b}.u2r3-allocation p{margin:3px 0;font-size:12px;line-height:1.4;color:#aa481b}.u2r3-allocation.u2r3-over-allocation{border-color:#f7c57a;background:#fff6e8}.u2r3-allocation.u2r3-over-allocation b:last-child{color:#a64c18}
/* Purple legacy tokens on interactive controls, preserving expense-red and budget-status colors. */
body #app .transaction-filter-chip.active,body #app .tx-filter-chip.active,body #app .tx63-tab.active,body #app .tx-clear-filters,body #app .tx-filter-clear,body #app .transaction-filter-clear,body #modal-root .u1-calc-grid .primary,body #modal-root .u1-make-bill,body #modal-root .u1-calc-make-bill,body #modal-root .u1-calc-tabs button.active{background:#e0f3e9!important;border-color:#a5d9c0!important;color:#075c41!important;box-shadow:none!important}
body #app .tx-filter-clear,body #app .tx-clear-filters,body #modal-root button.primary:not(.danger){--accent:#086044;--accent2:#0d8060}
body #app .transaction-transfer-amount,body #app .tx-transfer-amount,body #app .tx-summary-values-v1251.transfer-amount,body #app .tx-summary-values-v1251.transfer-amount *{color:var(--u2r3-teal)!important}
#modal-root .u2universal-trigger{border-radius:14px!important;background:rgba(250,255,252,.94)!important}
#u2-sync-toast{z-index:2147480700!important}
#notification-pop-v1286{z-index:2147480800!important}
body:has(#modal-root .modal) #u2-sync-toast,body:has(#confirm-root) #u2-sync-toast{display:none!important}
/* Original date/time/currency grid, no change to section ordering. */
@media(prefers-reduced-motion:reduce){#u2w-aavi-trigger.u2r3-morph{animation:none!important}#u2w-root .u2w-card-context{will-change:auto}}

/* No extra floating legacy actions on a Finance subpage. */
body:has(.finance-full-shell) #transaction-fab,body:has(.finance-full-shell) #u2-plus-fab,body:has(.finance-full-shell) .fab-wrap{visibility:hidden!important;pointer-events:none!important}
/* Legacy semantic transfer token is teal everywhere, including amount and unit labels. */
:root{--purple:#0b948b;--blue:#08795b}
body .transfer-amount,body .transfer-amount strong,body .transfer-amount small,body .transfer-amount span,body .tx-transfer-total,body .tx-transfer-total *{color:#0b948b!important}
/* Avoid covering a notification popup with the sync-success animation. */
body:has(#notification-pop-v1286) #u2-sync-toast{visibility:hidden!important}


/* Round 3 QA — transaction accents corrected at the source cascade */
/* The original v13 Appearance setting still allows the old violet --accent.
   Rufiyaa's approved themes are Emerald and Monochrome. Semantic expense-red,
   transfer-teal and amber-risk status remain separate from the UI accent. */
html:not([data-accent="mono"]) {
  --accent:#087654!important;
  --accent-soft:rgba(8,118,84,.13)!important;
  --blue:#087654;
  --purple:#0b948b;
  --u2r3-active-chip:rgba(184,230,209,.46);
  --u2r3-active-border:rgba(8,118,84,.27);
}
html[data-accent="mono"] {
  --accent:#415851!important;
  --accent-soft:rgba(65,88,81,.13)!important;
  --blue:#415851;
  --purple:#0b948b;
  --u2r3-active-chip:rgba(104,116,116,.13);
  --u2r3-active-border:rgba(65,88,81,.22);
}
/* Exact transaction page markup: .chips>.chip.active and
   .tx-active-range-v1251>button. Old selectors missed both. */
html body.rufiyaa-liquid-glass:not(.rufiyaa-admin-mode) #app .tx-toolbar-v129621 ~ .chips > .chip.active,
html[data-theme="light"] body.rufiyaa-liquid-glass:not(.rufiyaa-admin-mode) #app .tx-toolbar-v129621 ~ .chips > .chip.active,
html[data-theme="dark"] body.rufiyaa-liquid-glass:not(.rufiyaa-admin-mode) #app .tx-toolbar-v129621 ~ .chips > .chip.active {
  color:var(--accent)!important;
  background:var(--u2r3-active-chip)!important;
  border-color:var(--u2r3-active-border)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.57),0 4px 14px rgba(6,78,59,.06)!important;
}
html body #app .tx-active-range-v1251>button {
  color:var(--accent)!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
/* Follow the selected palette for calculator, Bill and transaction controls;
   allow financial status elements to keep their own semantic colors. */
body #modal-root .u1-calc-grid button.primary,
body #modal-root .u1-make-bill,
body #modal-root .u1-calc-make-bill,
body #modal-root .u1-calc .u1-keypad-active {
  --accent:#087654;
  border-color:#91cdb1!important;
}

/* Preserve readable selected state in dark theme (including monochrome). */
html[data-theme="dark"] body.rufiyaa-liquid-glass:not(.rufiyaa-admin-mode) #app .tx-toolbar-v129621 ~ .chips > .chip.active {
  color:#b8e6d1!important;
  background:rgba(20,103,79,.35)!important;
  border-color:rgba(111,194,154,.30)!important;
}
html[data-theme="dark"][data-accent="mono"] body.rufiyaa-liquid-glass:not(.rufiyaa-admin-mode) #app .tx-toolbar-v129621 ~ .chips > .chip.active {
  color:#e1e9e4!important;
  background:rgba(110,125,118,.24)!important;
  border-color:rgba(140,155,147,.28)!important;
}
/* Retain readable contextual action colors on dark surfaces. */
html[data-theme="dark"] body #app .tx-active-range-v1251>button{color:#b8e6d1!important}
html[data-theme="dark"][data-accent="mono"] body #app .tx-active-range-v1251>button{color:#e1e9e4!important}
/* Earlier dark-theme rule used violet for transfers: use the single teal family. */
html[data-theme="dark"] body #app .transfer-amount,
html[data-theme="dark"] body #app .transfer-amount *,
html[data-theme="dark"] body #app .tx-summary-values-v1251.transfer-amount,
html[data-theme="dark"] body #app .tx-summary-values-v1251.transfer-amount *{color:#0bbaa9!important}

/* Round 3 follow-up — do not squish the adjacent cards into square slivers.
   Their complete surfaces must keep the 1.68:1 card aspect ratio, with the viewport
   masking all but a small, evenly sized peek. The selected card and its original
   stack-to-carousel motion are unaffected. */
#u2w-root .u2w-carousel-viewport {isolation:isolate;overflow:hidden!important}
#u2w-root .u2w-peek {
  box-sizing:border-box!important;
  width:min(73%,410px)!important;
  height:auto!important;
  aspect-ratio:1.68 / 1!important;
  top:50%!important;
  padding:0!important;
  overflow:hidden!important;
  border-radius:20px!important;
  transform:translateY(-50%) scale(.88);
  opacity:.62!important;
  filter:brightness(.82)!important;
  z-index:1!important;
}
#u2w-root .u2w-peek.left {
  left:calc((100% - min(85%,480px))/2 - 12px - min(73%,410px))!important;
  right:auto!important;
  transform-origin:right center;
}
#u2w-root .u2w-peek.right {
  right:calc((100% - min(85%,480px))/2 - 12px - min(73%,410px))!important;
  left:auto!important;
  transform-origin:left center;
}
#u2w-root .u2w-peek>.u2-real-card {
  display:flex!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  max-width:none!important;
  aspect-ratio:1.68 / 1!important;
  border-radius:inherit!important;
  box-sizing:border-box!important;
  box-shadow:none!important;
}
/* Do not display fragments of the preceding card's labels, digits or chip.
   The artwork itself remains visible, including locally bundled photography when available. */
#u2w-root .u2w-peek .u2-real-top,
#u2w-root .u2w-peek .u2-real-bottom,
#u2w-root .u2w-peek .u2-card-chip {visibility:hidden!important}
#u2w-root .u2w-peek:focus-visible {outline:3px solid #0d8662!important;outline-offset:-3px}
/* The Finance dock position comes from the actual pill geometry, not viewport edges.
   CSS variables are updated from syncDock on page navigation and resize. */
#u2w-dock-area {justify-items:end!important}
@media (prefers-reduced-motion:reduce) {
  #u2w-root .u2w-peek {transition:none!important}
}
/* Finance Accounts: keep the Add Account call-to-action within Emerald/Monochrome,
   instead of the inherited pre-rebrand purple gradient. */
html:not([data-accent="mono"]) body #app .finance-full-shell:has(.beta121-account-groups) button.finance-page-add,
html:not([data-accent="mono"]) body #app .finance-full-shell:has(.beta121-account-groups) button.primary.finance-page-add {
  background:#086044!important;
  background-image:none!important;
  color:#fff!important;
  border-color:#0c7754!important;
  box-shadow:0 10px 26px rgba(6,78,59,.17)!important;
}
html[data-accent="mono"] body #app .finance-full-shell:has(.beta121-account-groups) button.finance-page-add {
  background:#364c44!important;
  background-image:none!important;
  border-color:#53645b!important;
  color:#fff!important;
}


/* 21 Oct Round 3 follow-up: one red unread dot; sync details inside More only. */
body .u2-h-more.u2-sync-needs-attention::after{content:none!important;display:none!important}
body .u2-h-more .u2-more-dot{background:#d24e4e!important;width:8px!important;height:8px!important;top:3px!important;right:4px!important;bottom:auto!important}
/* Legacy expense split actions used a literal violet outline (not a theme token). */
body.rufiyaa-liquid-glass #modal-root .u1-regular-expense-splitting button,
body.rufiyaa-liquid-glass #modal-root .u1-regular-expense-splitting button.active{
 outline:0!important;border:1px solid rgba(6,104,76,.27)!important;
 color:#07563f!important;background:rgba(224,243,233,.88)!important;
 box-shadow:none!important;
}
body.rufiyaa-liquid-glass #modal-root .u1-regular-expense-splitting button.active{
 border:2px solid #087654!important;background:#def2e5!important;
}
body.rufiyaa-liquid-glass #modal-root .u1-regular-expense-splitting button:focus-visible{
 outline:2px solid #087654!important;outline-offset:2px!important;
}
body.rufiyaa-liquid-glass #modal-root .tx-add-split-v13029 .tx-split-toggle-v13029>span{
 color:#087654!important;background:#dff2e8!important;
}
body.rufiyaa-liquid-glass #modal-root .tx-add-split-v13029 .tx-split-toggle-v13029.active{
 border-color:#83bea5!important;background:#e7f5eb!important;
}
body #modal-root .transfer-arrow-v128{color:#0b948b!important}
/* Aavi actions and Notification Center follow the approved emerald palette. */
body #modal-root .notification-center-v129 .notification-row-v1286 u,
body #modal-root .notification-center-v129 .notification-center-summary-v129>button,
body #modal-root .notification-center-v129 .notification-center-head-v1286 button{
 color:#087654!important;
}
body #modal-root .notification-center-v129 .notification-cat-icon-v129{
 color:#087654!important;background:rgba(184,230,209,.34)!important;
}
/* Home widget controls: never revive old violet accents. Retain red for actual alerts. */
body #app .home-customize-bar button,
body #app .smart-home-reason-v127,
body #app .smart-home-reason-v127 *{color:#087654!important}
body #app .home-widgets .progress-fill:not(.danger):not(.warning){background:#087654!important}
/* Transactions: on iPhone show amounts without ellipsis. Two wide cards, then Transfers. */
@media(max-width:540px){
 body #app .tx-summary-v1251{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
 body #app .tx-summary-v1251>.tx-summary-card-v1251{padding:12px 12px!important;min-width:0!important;margin-bottom:0!important}
 body #app .tx-summary-v1251>.tx-summary-card-v1251:last-child{grid-column:1 / -1!important}
 body #app .tx-summary-values-v1251>div{white-space:normal!important;flex-wrap:wrap!important;column-gap:4px!important;row-gap:1px!important;align-items:baseline!important}
 body #app .tx-summary-values-v1251 strong{font-size:clamp(13px,3.8vw,18px)!important;overflow:visible!important;text-overflow:clip!important;white-space:normal!important;overflow-wrap:anywhere!important}
 body #app .tx-summary-values-v1251 span{font-size:10px!important;white-space:nowrap!important}
}
/* Override the more-specific legacy active button rule in the Round 2 modal. */
body.rufiyaa-liquid-glass #modal-root .modal .u1-regular-expense-splitting button.active:not(.primary):not(.danger){
 border-color:#087654!important;background:#def2e5!important;color:#07563f!important;outline:none!important;
}
/* Home Budget and Card Overview progress tracks used fixed blue/violet fills. */
body.rufiyaa-liquid-glass #app .home-widgets .home-widget .progress>i{
 background:#087654!important;background-image:none!important;
}
