:root {
  color-scheme: light;
  --topbar: #4b168c;
  --topbar-2: #673ab7;
  --bg: #f7f5fb;
  --panel: rgba(255, 255, 255, .9);
  --solid: #ffffff;
  --ink: #111827;
  --muted: #687080;
  --line: rgba(17, 24, 39, .09);
  --soft: #f0eef7;
  --green: #673ab7;
  --green-soft: #efe7ff;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --teal: #2563eb;
  --teal-soft: #dbeafe;
  --shadow: 0 18px 52px rgba(17, 24, 39, .13);
  --soft-shadow: 0 10px 28px rgba(17, 24, 39, .085);
  --press-shadow: 0 4px 14px rgba(17, 24, 39, .12);
  --app-height: 100dvh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-bg: rgba(255,255,255,.96);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body,
#root {
  height: var(--app-height);
  min-height: var(--app-height);
  width: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  color: var(--ink);
  touch-action: manipulation;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  background:
    linear-gradient(180deg, #fbfaff 0%, #f2f0f8 100%),
    #f7f5fb;
  user-select: none;
  -webkit-user-select: none;
  position: fixed;
  inset: 0;
  height: var(--app-height);
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.rx-app {
  height: var(--app-height);
  min-height: var(--app-height);
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  overflow-x: clip;
  overflow-y: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    linear-gradient(180deg, var(--topbar) 0, var(--topbar) calc(34px + env(safe-area-inset-top, 0px)), transparent calc(34px + env(safe-area-inset-top, 0px))),
    linear-gradient(180deg, #fbfaff 0%, #f2f0f8 100%),
    #f7f5fb;
}

.rx-panel,
.rx-card,
.rx-quick,
.rx-month-total,
.rx-bulk-prompt {
  min-width: 0;
  max-width: 100%;
}

@media (display-mode: standalone) {
  .rx-app {
    max-width: none;
  }
}

.rx-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.rx-boot-shell {
  pointer-events: none;
}

.rx-boot-card {
  display: grid;
  gap: 12px;
}

.rx-boot-card.small {
  gap: 10px;
}

.rx-skel-avatar,
.rx-skel-icon,
.rx-skel-line,
.rx-skel-amount,
.rx-skel-input,
.rx-skel-grid span,
.rx-skel-row span,
.rx-nav-skel span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.34), rgba(255,255,255,.78), rgba(255,255,255,.34));
  background-size: 220% 100%;
  animation: rxShimmer 1.1s ease-in-out infinite;
}

.rx-skel-avatar {
  width: 42px;
  height: 42px;
  border-radius: 15px;
}

.rx-skel-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
}

.rx-skel-line {
  width: 92px;
  height: 11px;
  background: linear-gradient(90deg, rgba(103,58,183,.1), rgba(103,58,183,.22), rgba(103,58,183,.1));
  background-size: 220% 100%;
}

.rx-topbar .rx-skel-line {
  background: linear-gradient(90deg, rgba(255,255,255,.28), rgba(255,255,255,.7), rgba(255,255,255,.28));
  background-size: 220% 100%;
}

.rx-skel-line.short { width: 118px; height: 10px; }
.rx-skel-line.title { width: 210px; height: 24px; border-radius: 12px; }
.rx-skel-line.title.wide { width: 70%; }

.rx-skel-amount {
  height: 76px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(103,58,183,.06), rgba(103,58,183,.15), rgba(103,58,183,.06));
  background-size: 220% 100%;
}

.rx-skel-input {
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(90deg, rgba(17,24,39,.04), rgba(17,24,39,.09), rgba(17,24,39,.04));
  background-size: 220% 100%;
}

.rx-skel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.5);
}

.rx-skel-grid span {
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,.65), rgba(103,58,183,.12), rgba(255,255,255,.65));
  background-size: 220% 100%;
}

.rx-skel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rx-skel-row span {
  height: 70px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(17,24,39,.04), rgba(103,58,183,.1), rgba(17,24,39,.04));
  background-size: 220% 100%;
}

.rx-nav-skel {
  pointer-events: none;
}

.rx-nav-skel span {
  width: 50px;
  height: 44px;
  align-self: center;
  justify-self: center;
  background: linear-gradient(90deg, rgba(17,24,39,.04), rgba(103,58,183,.12), rgba(17,24,39,.04));
  background-size: 220% 100%;
}

.rx-nav-skel span.big {
  width: 72px;
  height: 72px;
  background: linear-gradient(90deg, rgba(75,22,140,.5), rgba(103,58,183,.8), rgba(75,22,140,.5));
  background-size: 220% 100%;
}

.rx-login-card,
.rx-glass,
.rx-panel,
.rx-card,
.rx-quick {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--soft-shadow);
}

.rx-login-card {
  width: min(370px, 100%);
  display: grid;
  gap: 13px;
  padding: 22px;
  border-radius: 22px;
  animation: rxLift .28s ease both;
}

.rx-brand {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #2d1b69, #673ab7);
  color: #fff;
  font-size: 29px;
  font-weight: 950;
  box-shadow: var(--shadow);
}

.rx-eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: 20px; line-height: 1.05; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; font-size: 15px; }

.rx-muted {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

.rx-input,
.rx-select,
.rx-textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .92);
  outline: none;
  font-size: 16px;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.rx-textarea { min-height: 84px; resize: vertical; }

.rx-input:focus,
.rx-select:focus,
.rx-textarea:focus {
  border-color: rgba(103, 58, 183, .44);
  box-shadow: 0 0 0 4px rgba(103, 58, 183, .11);
}

.rx-btn {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 7px 16px rgba(17,24,39,.055);
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.rx-btn:disabled {
  opacity: .46;
  filter: grayscale(.25);
  box-shadow: none;
  transform: none;
}

.rx-btn:active,
.rx-icon-btn:active,
.rx-nav button:active,
.rx-chip:active,
.rx-key:active {
  transform: scale(.955);
  box-shadow: var(--press-shadow);
}

.rx-add:active {
  transform: scale(.94);
}

.rx-primary { background: linear-gradient(135deg, #2d1b69, #673ab7); color: #fff; }
.rx-danger { background: var(--red-soft); color: var(--red); }
.rx-blue { background: var(--blue); color: #fff; }
.rx-green { background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; }
.rx-amber { background: linear-gradient(135deg, #f59e0b, #b45309); color: #fff; }

.rx-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rx-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 9px;
  align-items: center;
  min-height: calc(66px + env(safe-area-inset-top, 0px));
  margin: 0;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-left, 0px)) 12px max(14px, env(safe-area-inset-right, 0px));
  background: linear-gradient(135deg, var(--topbar), var(--topbar-2));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  color: #fff;
  box-shadow: 0 12px 28px rgba(75, 22, 140, .18);
}

.rx-topbar .rx-eyebrow {
  color: rgba(255,255,255,.72);
}

.rx-icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 8px 18px rgba(45,27,105,.18);
}

.rx-profile-menu {
  overflow: hidden;
  padding: 0;
}

.rx-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  object-fit: cover;
}

.rx-sync-dot {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #22c55e;
}

.rx-sync-dot.off { background: var(--red); }

.rx-title-stack {
  position: relative;
  min-width: 0;
}

.rx-profile-title {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
}

.rx-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.rx-avatar.tiny {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  font-size: 14px;
  background: rgba(255,255,255,.24);
}

.rx-top-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--amber);
  color: #fff;
  font-size: 10px;
  border: 2px solid rgba(255,255,255,.9);
}

.rx-inbox-top {
  background: rgba(255,255,255,.24);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 8px 18px rgba(45,27,105,.18);
}

.rx-inbox-top .rx-icon {
  width: 23px;
  height: 23px;
  stroke-width: 2.35;
}

.rx-inbox-top.has-pending {
  animation: rxInboxNudge 1300ms ease-in-out infinite;
  background: rgba(255,255,255,.3);
}

.rx-inbox-top.has-pending .rx-icon {
  animation: rxInboxZoom 1300ms ease-in-out infinite;
}

@keyframes rxInboxNudge {
  0%, 100% { transform: translateY(0) rotate(0deg); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 8px 18px rgba(45,27,105,.18); }
  20% { transform: translateY(-1px) rotate(-5deg); }
  40% { transform: translateY(1px) rotate(5deg); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 0 0 8px rgba(245,158,11,0); }
  60% { transform: translateY(0) rotate(0deg); }
}

@keyframes rxInboxZoom {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.16); }
}

.rx-main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 92px;
  display: grid;
  align-content: start;
  gap: 14px;
  animation: rxPage .22s ease both;
  transition: opacity 160ms ease, transform 180ms ease, filter 180ms ease;
}

.rx-main.switching {
  opacity: .68;
  transform: translateX(-10px) scale(.995);
  filter: blur(.6px);
}

.rx-view {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: grid;
  gap: 14px;
  animation: rxPage .24s cubic-bezier(.2,.8,.2,1) both;
}

.rx-panel,
.rx-card,
.rx-quick {
  border-radius: 18px;
  padding: 14px;
}

.rx-quick {
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(247,245,251,.94)),
    var(--panel);
  box-shadow: 0 16px 40px rgba(45, 27, 105, .09);
}

.rx-quick-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.rx-quick-head-actions .rx-btn {
  min-width: 92px;
}

.rx-quick-camera {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(75, 22, 140, .16);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #522093;
  background: #f1e9fb;
  box-shadow: 0 6px 14px rgba(75, 22, 140, .1);
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}

.rx-quick-camera:active {
  transform: scale(.92);
  background: #e5d5f8;
  box-shadow: inset 0 2px 5px rgba(75, 22, 140, .14);
}

.rx-quick-camera .rx-icon {
  width: 21px;
  height: 21px;
}

.rx-file-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rx-receipt-scan {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}

.rx-receipt-head {
  padding-right: 2px;
}

.rx-receipt-head h2 {
  margin-top: 2px;
  font-size: 20px;
  letter-spacing: 0;
}

.rx-receipt-head-icon,
.rx-receipt-success {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #57239d;
  box-shadow: 0 8px 18px rgba(75, 22, 140, .2);
}

.rx-receipt-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.rx-receipt-choices > button {
  min-width: 0;
  min-height: 116px;
  border: 1px solid rgba(75, 22, 140, .12);
  border-radius: 16px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 5px;
  padding: 13px;
  color: var(--ink);
  background: #faf8fd;
  text-align: left;
  box-shadow: 0 8px 20px rgba(35, 24, 58, .06);
}

.rx-receipt-choices > button:active {
  transform: scale(.97);
  background: #f0e8fa;
}

.rx-receipt-choices > button > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #57239d;
  background: #e9dcf8;
}

.rx-receipt-choices b {
  font-size: 13px;
  font-weight: 950;
}

.rx-receipt-choices small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  font-weight: 780;
}

.rx-receipt-privacy {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 12px;
  color: #2f684f;
  background: #eaf8f1;
}

.rx-receipt-privacy > .rx-icon {
  width: 20px;
  height: 20px;
  justify-self: center;
}

.rx-receipt-privacy span {
  display: grid;
  gap: 1px;
}

.rx-receipt-privacy b {
  font-size: 11px;
  font-weight: 950;
}

.rx-receipt-privacy small {
  color: #527665;
  font-size: 8px;
  font-weight: 760;
}

.rx-receipt-preview {
  position: relative;
  min-height: 126px;
  max-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(75, 22, 140, .12);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f2eff5;
}

.rx-receipt-preview img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: contain;
}

.rx-receipt-preview > span {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(75, 22, 140, .88);
  box-shadow: 0 10px 28px rgba(30, 15, 60, .28);
  animation: rxReceiptScan 1.1s ease-in-out infinite;
}

.rx-receipt-progress {
  display: grid;
  gap: 5px;
}

.rx-receipt-progress > div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e0eb;
}

.rx-receipt-progress > div span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #5c25a3;
  transition: width .22s ease;
}

.rx-receipt-progress strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.rx-receipt-progress small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 780;
}

.rx-receipt-result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.rx-receipt-success {
  width: 44px;
  height: 44px;
  color: #276c51;
  background: #dff8ec;
  box-shadow: none;
}

.rx-receipt-result > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rx-receipt-result h3 {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.rx-receipt-result > div > strong {
  color: #4b168c;
  font-size: 22px;
  font-weight: 950;
}

.rx-receipt-result > div > small {
  color: #39775d;
  font-size: 9px;
  font-weight: 850;
}

.rx-receipt-result-grid,
.rx-receipt-actions {
  grid-column: 1 / -1;
}

.rx-receipt-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.rx-receipt-actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 8px;
}

.rx-receipt-batch {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.rx-receipt-batch-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rx-receipt-batch-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rx-receipt-batch-head h3 {
  font-size: 16px;
}

.rx-receipt-batch-head small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.rx-receipt-batch-list {
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(75, 22, 140, .12);
  border-radius: 12px;
  background: #fbfafd;
}

.rx-receipt-batch-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(75, 22, 140, .08);
}

.rx-receipt-batch-row:last-child {
  border-bottom: 0;
}

.rx-receipt-batch-row > span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #276c51;
  background: #dff8ec;
}

.rx-receipt-batch-row.duplicate > span {
  color: #665d70;
  background: #ece8f0;
}

.rx-receipt-batch-row.failed > span {
  color: #a42b2b;
  background: #ffe4e4;
}

.rx-receipt-batch-row > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.rx-receipt-batch-row b,
.rx-receipt-batch-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-receipt-batch-row b {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.rx-receipt-batch-row small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 760;
}

.rx-receipt-batch-row > strong {
  color: #4b168c;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.rx-receipt-error {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  color: #9b2c2c;
  background: #fff0f0;
  text-align: center;
}

.rx-receipt-error.duplicate {
  color: #326b52;
  background: #ebf8f1;
}

.rx-receipt-error > .rx-icon {
  width: 28px;
  height: 28px;
}

.rx-receipt-error strong {
  font-size: 12px;
  line-height: 1.4;
}

@keyframes rxReceiptScan {
  0%, 100% { transform: scale(.9); opacity: .76; }
  50% { transform: scale(1.05); opacity: 1; }
}

.rx-head,
.rx-row-main,
.rx-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.rx-amount-display {
  border: 1px solid rgba(103,58,183,.18);
  border-radius: 16px;
  padding: 10px 14px;
  min-height: 64px;
  display: grid;
  justify-items: end;
  background: linear-gradient(180deg, #f6f1ff, #ffffff);
  color: #2d1b69;
}

.rx-amount-display small {
  min-height: 17px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 900;
  color: rgba(45,27,105,.62);
}

.rx-amount-display strong {
  font-size: 29px;
  font-weight: 950;
}

.rx-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rx-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rx-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rx-stack { display: grid; gap: 10px; }

.rx-bulk-add {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(74px, .74fr) 42px;
  gap: 8px;
  align-items: center;
}

.rx-bulk-add .rx-btn {
  min-width: 0;
  height: 44px;
  padding: 0;
}

.rx-bulk-list {
  display: grid;
  gap: 7px;
  max-height: min(38vh, 330px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rx-bulk-row {
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 70px;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.82);
}

.rx-bulk-row:has(.rx-bulk-edit-name) {
  grid-template-columns: minmax(0, 1fr) minmax(72px, 88px) 32px;
}

.rx-bulk-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 850;
}

.rx-bulk-row b {
  color: var(--red);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.rx-icon-mini {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--red-soft);
}

.rx-icon-mini.edit {
  color: var(--green);
  background: var(--green-soft);
}

.rx-icon-mini.good {
  color: #fff;
  background: var(--green);
}

.rx-row-icons {
  display: grid;
  grid-template-columns: 32px 32px;
  gap: 6px;
}

.rx-bulk-edit-name,
.rx-bulk-edit-amount {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: 11px;
}

.rx-bulk-prompt-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 7px;
  align-items: center;
}

.rx-inbox-raw {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  line-height: 1.35;
}

.rx-icon-mini .rx-icon {
  width: 16px;
  height: 16px;
}

.rx-bulk-actions {
  position: sticky;
  bottom: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(247,245,251,0), rgba(247,245,251,.98) 26%, rgba(247,245,251,.98));
  backdrop-filter: blur(12px);
}

.rx-segment {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.rx-segment.four {
  grid-template-columns: repeat(4, 1fr);
}

.rx-segment.three {
  grid-template-columns: repeat(3, 1fr);
}

.rx-chip,
.rx-segment button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(17,24,39,.035);
  transition: transform 130ms ease, background 130ms ease, color 130ms ease;
}

.rx-chip.active,
.rx-segment button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green-soft), #fff);
  color: var(--green);
}

.rx-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rx-tag-grid.compact {
  max-height: 78px;
  overflow: hidden;
  align-content: flex-start;
}

.rx-tag-grid.compact .rx-chip {
  max-width: 44%;
  min-height: 34px;
}

.rx-tag-grid.compact .rx-chip:not(.rx-all-chip) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.rx-all-chip {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.86);
}

.rx-tag-grid.four .rx-chip {
  min-width: calc(25% - 6px);
}

.rx-tag-picker {
  display: grid;
  gap: 8px;
}

.rx-tag-search-trigger {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(75, 22, 140, .14);
  border-radius: 16px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: linear-gradient(135deg, #fbf8ff, #fff);
  box-shadow: 0 7px 18px rgba(35,24,58,.055);
  text-align: left;
}

.rx-tag-search-trigger b {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-tag-search-trigger small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.rx-selected-tags,
.rx-tag-modal-selected {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 1px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rx-selected-tags::-webkit-scrollbar,
.rx-tag-modal-selected::-webkit-scrollbar {
  display: none;
}

.rx-selected-tags button,
.rx-tag-modal-selected button {
  min-height: 30px;
  border: 1px solid rgba(75, 22, 140, .16);
  border-radius: 999px;
  padding: 0 9px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: #4b168c;
  background: #f0e7ff;
  font-size: 10.5px;
  font-weight: 920;
}

.rx-selected-tags .rx-icon,
.rx-tag-modal-selected .rx-icon {
  width: 14px;
  height: 14px;
}

.rx-tag-modal-search {
  min-height: 44px;
  border: 1px solid rgba(75, 22, 140, .14);
  border-radius: 14px;
  padding: 0 8px 0 11px;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 7px;
  background: #faf8fd;
}

.rx-tag-modal-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.rx-tag-modal-search button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
}

.rx-tag-empty {
  min-height: 72px;
  border: 1px dashed rgba(75, 22, 140, .18);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fbf9ff;
  font-size: 12px;
  font-weight: 850;
}

.rx-entry-status {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.rx-entry-status span {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  background: rgba(255,255,255,.78);
  font-size: 8.5px;
  font-weight: 900;
  line-height: 1;
}

.rx-entry-status span.ready {
  border-color: rgba(18, 128, 94, .16);
  color: var(--teal);
  background: #eaf8f1;
}

.rx-entry-status .rx-icon {
  width: 12px;
  height: 12px;
}

.rx-category-picker {
  display: grid;
}

.rx-tag-select-btn {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  text-align: left;
  font-weight: 950;
}

.rx-tag-select-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-tag-select-btn small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.rx-category-select {
  grid-template-columns: 24px minmax(0, 1fr) 20px;
  min-height: 50px;
}

.rx-category-select span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.16;
}

.rx-category-select small {
  display: none;
}

.rx-mini-modal {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgba(17,24,39,.22);
  backdrop-filter: blur(7px);
  overscroll-behavior: none;
  touch-action: none;
  animation: rxFade .16s ease both;
}

.rx-mini-panel {
  width: min(100%, 760px);
  max-height: min(76dvh, 680px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px 24px 0 0;
  padding-bottom: calc(14px + var(--safe-bottom));
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
  touch-action: pan-y;
  animation: rxSheetUp .2s ease both;
}

.rx-mini-handle {
  width: 42px;
  height: 5px;
  flex: 0 0 auto;
  margin: -5px auto 1px;
  border-radius: 999px;
  background: #d8d1e2;
}

.rx-overlay-open .rx-main,
.rx-overlay-open .rx-sheet-panel {
  overflow: hidden;
  touch-action: none;
}

@keyframes rxSheetUp {
  from { transform: translateY(100%); opacity: .72; }
  to { transform: translateY(0); opacity: 1; }
}

.rx-picker-current {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(103,58,183,.14);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(239,231,255,.86), rgba(255,255,255,.96));
}

.rx-picker-current b {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.rx-picker-current small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.rx-tag-list-scroll {
  min-height: 0;
  flex: 1 1 auto;
  max-height: min(54vh, 450px);
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding-right: 2px;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.rx-tag-list-scroll button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 22px;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255,255,255,.84);
  color: var(--ink);
  text-align: left;
  touch-action: pan-y;
}

.rx-tag-list-scroll button.active {
  border-color: rgba(103,58,183,.24);
  background: linear-gradient(135deg, rgba(239,231,255,.92), #fff);
}

.rx-tag-list-scroll b {
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-tag-list-scroll small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.rx-setting-list {
  display: grid;
  gap: 7px;
}

.rx-setting-row {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  display: grid;
  grid-template-columns: 22px 1fr 34px 34px 34px 34px;
  gap: 5px;
  align-items: center;
  background: rgba(255,255,255,.82);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.rx-setting-row.dragging {
  opacity: .62;
  transform: scale(.985);
  box-shadow: 0 0 0 4px rgba(103,58,183,.12);
}

.rx-drag-handle {
  color: var(--muted);
  font-weight: 950;
  cursor: grab;
  letter-spacing: -3px;
}

.rx-setting-main {
  min-width: 0;
  height: 36px;
  border: 0;
  border-radius: 12px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
}

.rx-setting-main b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-setting-main .rx-icon,
.rx-tags .rx-icon {
  width: 14px;
  height: 14px;
}

.rx-setting-order {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-align: center;
}

.rx-icon-mini.danger {
  color: var(--red);
  background: var(--red-soft);
}

.rx-icon-picker {
  max-height: 230px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  padding: 4px 2px;
}

.rx-icon-picker button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #4c1d95;
}

.rx-icon-picker button.active {
  background: linear-gradient(135deg, #2d1b69, #7c3aed);
  color: #fff;
  border-color: transparent;
}

.rx-icon-edit-panel {
  border: 1px solid rgba(103,58,183,.14);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: rgba(255,255,255,.9);
}

.rx-inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.rx-inline-add .rx-input {
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
}

.rx-inline-add .rx-btn {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 11px;
  white-space: nowrap;
}

.rx-calc-tools,
.rx-calc-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rx-calc-toolbar .rx-key {
  min-height: 44px;
  font-size: 13px;
}

.rx-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(238, 242, 241, .95), rgba(255,255,255,.78));
  border: 1px solid rgba(17,24,39,.06);
}

.rx-keypad-indian {
  grid-template-columns: repeat(4, 1fr);
}

.rx-key {
  min-height: 48px;
  border: 1px solid rgba(17,24,39,.045);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 5px 14px rgba(17,24,39,.06);
  transition: transform 130ms ease, background 130ms ease, box-shadow 130ms ease, filter 130ms ease;
  position: relative;
  overflow: hidden;
}

.rx-keypad-indian .rx-key.op {
  min-height: 50px;
}

.rx-op-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(17,24,39,.06);
}

.rx-key.op { color: #ffffff; background: linear-gradient(145deg, #673ab7, #2d1b69); }
.rx-key.zero,
.rx-key.zero-wide { grid-column: span 2; }
.rx-key.clear { color: var(--red); background: var(--red-soft); justify-content: center; display: inline-flex; align-items: center; gap: 8px; }
.rx-key.back { color: #92400e; background: var(--amber-soft); justify-content: center; display: inline-flex; align-items: center; gap: 8px; }

.rx-key.is-tapping {
  transform: scale(.93);
  filter: saturate(1.2) brightness(.9);
  box-shadow:
    inset 0 0 0 999px rgba(17,24,39,.12),
    0 4px 12px rgba(45,27,105,.22);
}

.rx-key.is-tapping::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: rgba(103,58,183,.16);
  animation: rxTapGlow 170ms ease-out both;
  pointer-events: none;
}

.rx-key.op.is-tapping {
  filter: brightness(.78) saturate(1.18);
  box-shadow:
    inset 0 0 0 999px rgba(0,0,0,.18),
    0 6px 16px rgba(45,27,105,.34);
}

.rx-suggest {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rx-suggest::-webkit-scrollbar { display: none; }

.rx-book-grid {
  display: grid;
  gap: 11px;
}

.rx-month-total {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,245,251,.94)),
    var(--panel);
  box-shadow: var(--soft-shadow);
}

.rx-month-total .rx-money.total {
  margin: 12px 0 12px;
  font-size: 34px;
}

.rx-book-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rx-book-mini {
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.82);
}

.rx-book-mini strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.rx-book-mini .rx-icon {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.rx-bulk-prompt {
  min-width: 0;
  border: 1px solid rgba(103,58,183,.13);
  border-radius: 18px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(239,231,255,.86), rgba(255,255,255,.94));
  box-shadow: var(--soft-shadow);
}

.rx-bulk-prompt b {
  display: block;
  font-size: 13px;
  font-weight: 950;
}

.rx-bulk-prompt small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.rx-bulk-prompt .rx-btn {
  min-height: 38px;
  padding: 0 10px;
}

.rx-bulk-drafts {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
}

.rx-bulk-draft-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(217, 119, 6, .18);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7d6, #fff);
}

.rx-bulk-draft-bar > span:first-child {
  min-width: 0;
}

.rx-bulk-draft-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.rx-bulk-draft-actions .rx-btn {
  min-height: 32px;
  border-radius: 10px;
  padding: 0 10px;
  color: #92400e;
  background: #fff7d6;
}

.rx-split-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(103,58,183,.14);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(239,231,255,.72), rgba(255,255,255,.9));
}

.rx-split-head,
.rx-split-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.rx-split-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.rx-split-head b.good { color: var(--green); }
.rx-split-head b.warn { color: var(--amber); }

.rx-split-row {
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.78);
}

.rx-split-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
}

.rx-stepper {
  display: grid;
  grid-template-columns: 30px minmax(58px, 78px) 30px;
  gap: 5px;
  align-items: center;
}

.rx-split-side {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px 32px minmax(118px, 1fr);
  gap: 5px;
  align-items: center;
}

.rx-split-side.no-lock {
  grid-template-columns: 32px minmax(118px, 1fr);
}

.rx-split-side.itemized {
  grid-template-columns: 32px minmax(94px, 1fr);
}

.rx-split-side .rx-icon-mini {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.rx-lock {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255,255,255,.92);
}

.rx-lock.active {
  color: #fff;
  background: var(--green);
}

.rx-lock .rx-icon {
  width: 15px;
  height: 15px;
}

.rx-stepper button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 950;
}

.rx-stepper .rx-input {
  min-height: 32px;
  height: 32px;
  padding: 0 7px;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
}

.rx-itemized-amount {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--green);
  background: rgba(255,255,255,.86);
  font-size: 13px;
  font-weight: 950;
}

.rx-split-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.rx-split-detail {
  gap: 5px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(239,231,255,.66));
}

.rx-split-detail .rx-split-head {
  font-size: 11px;
}

.rx-split-detail-list {
  display: grid;
  gap: 4px;
  max-height: 132px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rx-split-detail-line {
  min-width: 0;
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(46px, .6fr) minmax(0, 1.4fr) auto;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 9px;
  background: rgba(255,255,255,.72);
}

.rx-split-detail-line b {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--green);
  font-size: 10px;
  font-weight: 950;
}

.rx-split-detail-line span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
}

.rx-split-detail-line strong {
  color: var(--red);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.rx-raw-preview {
  color: var(--muted);
  background: rgba(247,245,251,.86);
}

.rx-checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.rx-checkline input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.rx-split-items {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding-top: 3px;
}

.rx-split-item-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(68px, 86px) 38px;
  gap: 6px;
}

.rx-split-item-add .rx-input,
.rx-split-item-add .rx-btn {
  min-height: 38px;
  height: 38px;
  border-radius: 11px;
}

.rx-split-item-add .rx-btn {
  padding: 0;
}

.rx-split-item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rx-split-item-list span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px 0 9px;
  border-radius: 999px;
  background: #fff7d6;
  color: #92400e;
  font-size: 11px;
  font-weight: 900;
}

.rx-split-item-list button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #92400e;
  background: rgba(255,255,255,.7);
}

.rx-split-item-list .rx-icon {
  width: 12px;
  height: 12px;
}

.rx-report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.rx-report-tile {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(17,24,39,.075);
  border-radius: 16px;
  display: grid;
  gap: 6px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 7px 18px rgba(17,24,39,.055);
}

.rx-report-tile span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.rx-report-tile.red span { color: var(--red); background: var(--red-soft); }
.rx-report-tile.good span { color: var(--teal); background: var(--teal-soft); }
.rx-report-tile b { font-size: 15px; font-weight: 950; overflow-wrap: anywhere; }
.rx-report-tile small { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }

.rx-intel-hero {
  gap: 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,245,251,.92)),
    var(--panel);
}

.rx-report-card-grid {
  display: grid;
  gap: 10px;
}

.rx-intel-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--soft-shadow);
}

.rx-intel-card-head {
  width: 100%;
  min-height: 72px;
  border: 0;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  text-align: left;
  background: transparent;
  color: var(--ink);
}

.rx-intel-card-head b {
  display: block;
  font-size: 14px;
  font-weight: 950;
}

.rx-intel-card-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.rx-intel-card-head em {
  min-width: 48px;
  border-radius: 999px;
  padding: 7px 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.rx-intel-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.rx-intel-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  animation: rxLift .18s ease both;
}

.rx-intel-body > .rx-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.rx-answer {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--green-soft), rgba(255,255,255,.9));
  border: 1px solid rgba(103,58,183,.12);
}

.rx-answer b {
  font-size: 13px;
  font-weight: 950;
}

.rx-answer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.38;
}

.rx-insight {
  padding: 10px 11px;
  border: 1px solid rgba(103,58,183,.12);
  border-radius: 15px;
  display: grid;
  gap: 4px;
  background: rgba(255,255,255,.72);
}

.rx-insight b {
  font-size: 12px;
  font-weight: 950;
}

.rx-insight span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.rx-insight.warn {
  border-color: rgba(217,119,6,.22);
  background: rgba(254,243,199,.62);
}

.rx-insight.good {
  border-color: rgba(37,99,235,.16);
  background: rgba(219,234,254,.64);
}

.rx-report-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 7px 10px;
  align-items: center;
}

.rx-report-row > div:first-child {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rx-report-row b {
  min-width: 0;
  font-size: 12px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.rx-report-row span,
.rx-report-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.rx-bar {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(103,58,183,.09);
}

.rx-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #673ab7, #2563eb);
  transition: width 220ms ease;
}

.rx-split-report {
  display: grid;
  gap: 10px;
}

.rx-split-hero {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(103,58,183,.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(239,231,255,.92), rgba(255,255,255,.96)),
    #fff;
  box-shadow: 0 10px 24px rgba(45,27,105,.08);
}

.rx-split-hero > span {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #4b168c, #7c3aed);
  box-shadow: 0 10px 18px rgba(76,29,149,.22);
}

.rx-split-hero h3 {
  margin: 2px 0 4px;
  font-size: 17px;
  font-weight: 950;
  color: var(--ink);
}

.rx-split-hero small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.rx-split-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rx-split-mini-grid article {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(17,24,39,.07);
  border-radius: 15px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 8px 18px rgba(17,24,39,.045);
}

.rx-split-mini-grid b {
  display: block;
  color: #2d1b69;
  font-size: 13px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.rx-split-mini-grid span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  line-height: 1.2;
  text-transform: uppercase;
}

.rx-split-rank {
  display: grid;
  gap: 8px;
  max-height: min(46vh, 390px);
  overflow: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.rx-split-rank article {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(17,24,39,.07);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,247,252,.9));
}

.rx-split-rank-head {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.rx-split-rank-head span {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #4b168c;
  background: rgba(103,58,183,.1);
  font-size: 10px;
  font-weight: 950;
}

.rx-split-rank-head b {
  min-width: 0;
  font-size: 13px;
  font-weight: 950;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.rx-split-rank-head strong {
  color: #2d1b69;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.rx-split-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(103,58,183,.09);
}

.rx-split-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4b168c, #7c3aed, #2563eb);
  transition: width 220ms ease;
}

.rx-split-rank small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.rx-book {
  position: relative;
  overflow: hidden;
  padding: 15px;
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}

.rx-book::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #2d1b69, var(--green));
}

.rx-book.business::before { background: var(--blue); }

.rx-money {
  margin: 10px 0 5px;
  font-size: 29px;
  line-height: 1;
  font-weight: 950;
}

.rx-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.rx-inbox-tools {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
}

.rx-inbox-tools .rx-btn {
  min-height: 34px;
  border-radius: 11px;
  padding: 0 8px;
  font-size: 11px;
}

.rx-check-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.rx-check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.rx-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,251,247,.9)),
    rgba(255,255,255,.9);
  box-shadow: var(--soft-shadow);
  animation: rxRow .18s ease both;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.rx-item:active {
  transform: scale(.985);
  border-color: rgba(103,58,183,.22);
}

.rx-item.vanish { animation: rxVanish .2s ease both; }

.rx-amount {
  color: var(--red);
  font-size: 17px;
  font-weight: 950;
  white-space: nowrap;
}

.rx-amount.good { color: var(--teal); }

.rx-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
}

.rx-facts div {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 7px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rx-facts div:nth-child(2n) { border-right: 0; }
.rx-facts .wide { grid-column: 1 / -1; border-right: 0; }
.rx-facts b { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.rx-facts span { font-size: 12px; font-weight: 850; overflow-wrap: anywhere; }

.rx-txn {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
}

.rx-txn-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--red-soft);
}

.rx-txn-icon.good { color: var(--teal); background: var(--teal-soft); }

.rx-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.rx-tags span {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(103,58,183,.09);
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.rx-filter {
  position: sticky;
  top: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
}

.rx-filter .rx-chip {
  min-height: 38px;
  padding: 0 6px;
  font-size: 10.5px;
  line-height: 1.05;
  text-align: center;
}

.rx-filter .rx-icon {
  width: 16px;
  height: 16px;
}

.rx-pagination {
  display: grid;
  grid-template-columns: 82px 1fr 82px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--soft-shadow);
}

.rx-pagination span {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.rx-select-icon {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
}

.rx-select-icon > .rx-icon {
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 14px;
  color: var(--green);
  background: var(--green-soft);
}

.rx-day-cell {
  min-height: 48px;
  padding: 5px 2px;
  border: 1px solid rgba(17,24,39,.075);
  border-radius: 12px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(17,24,39,.045);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.rx-day-cell span {
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.rx-day-cell small {
  min-height: 13px;
  color: var(--red);
  font-size: 8.5px;
  font-weight: 950;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rx-day-cell.has-spend {
  border-color: rgba(220,38,38,.18);
  background: linear-gradient(180deg, #fff, #fff7f7);
}

.rx-day-cell:active {
  transform: scale(.96);
  box-shadow: var(--press-shadow);
}

.rx-empty {
  padding: 20px;
  border: 1px dashed rgba(104,112,128,.35);
  border-radius: 18px;
  display: grid;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.58);
}

.rx-nav {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 31;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px max(12px, env(safe-area-inset-left, 0px)) 8px max(12px, env(safe-area-inset-right, 0px));
  background: var(--dock-bg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  backdrop-filter: blur(20px);
  box-shadow: 0 -14px 34px rgba(17,24,39,.09);
}

.rx-nav button {
  position: relative;
  min-height: 58px;
  border: 0;
  border-radius: 15px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.rx-nav button.active {
  color: var(--ink);
  background: linear-gradient(145deg, #f0eef7, #fff);
}

.rx-add {
  width: 58px;
  height: 58px;
  min-height: 58px;
  justify-self: center;
  margin-top: -25px;
  border-radius: 50% !important;
  color: #fff !important;
  background: linear-gradient(145deg, #2d1b69, #673ab7) !important;
  box-shadow: var(--shadow);
}

.rx-badge {
  position: absolute;
  top: 5px;
  right: 12px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--amber);
  color: #fff;
  font-size: 10px;
}

.rx-fab-backdrop {
  position: fixed;
  inset: 0 0 78px 0;
  z-index: 33;
  border: 0;
  background: rgba(255,255,255,.58);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.rx-fab-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rx-fab {
  position: fixed;
  left: 50%;
  bottom: 108px;
  z-index: 34;
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 9px;
  width: min(330px, calc(100vw - 34px));
  transform: translate(-50%, 18px) scale(.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, transform 240ms cubic-bezier(.18,.88,.24,1.15), visibility 220ms ease;
}

.rx-fab.open {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rx-fab-action {
  min-height: 74px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 18px 36px rgba(45,27,105,.18);
  opacity: 0;
  transform: translateY(12px) scale(.88);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(.18,.88,.24,1.16), box-shadow 160ms ease, filter 160ms ease;
}

.rx-fab-action span {
  width: 38px;
  height: 38px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
}

.rx-fab-action b {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.rx-fab-action b small {
  font: inherit;
  font-size: 11px;
  opacity: .78;
}

.rx-fab-action.primary span { background: linear-gradient(135deg, #2d1b69, #7c3aed); }
.rx-fab-action.blue span { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.rx-fab-action.amber span { background: linear-gradient(135deg, #f59e0b, #b45309); }
.rx-fab-action:active {
  transform: translateY(0) scale(.95);
  filter: brightness(.96);
}

.rx-fab.open .rx-fab-action {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.rx-fab.open .rx-fab-action:nth-child(2) {
  transition-delay: 45ms;
}

.rx-fab.open .rx-fab-action:nth-child(3) {
  transition-delay: 90ms;
}

.rx-loan-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
}

.rx-loan-page {
  display: grid;
  gap: 9px;
}

.rx-loan-title .rx-icon-btn,
.rx-loan-savebar .rx-icon-btn,
.rx-detail-back {
  color: #3f1d7a;
  background: rgba(103,58,183,.1);
  box-shadow: none;
  border: 1px solid rgba(103,58,183,.14);
}

.rx-detail-back {
  width: fit-content;
  min-height: 38px;
  border-radius: 14px;
  padding: 0 12px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
}

.rx-loan-savebar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  padding: 2px 0 7px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(246,245,251,0));
}

.rx-loan-savebar .rx-btn {
  min-height: 42px;
  border-radius: 14px;
}

.rx-loan-summary {
  border: 1px solid rgba(103,58,183,.12);
  border-radius: 17px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  align-items: center;
  background: linear-gradient(135deg, rgba(103,58,183,.09), rgba(255,255,255,.92));
  box-shadow: 0 10px 22px rgba(45,27,105,.08);
}

.rx-loan-summary span,
.rx-loan-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.rx-loan-summary strong {
  color: var(--red);
  font-size: 20px;
  font-weight: 950;
}

.rx-loan-summary small {
  grid-column: 1 / -1;
}

.rx-loan-list {
  display: grid;
  gap: 8px;
  max-height: min(54vh, 430px);
  overflow-y: auto;
  padding-right: 2px;
}

.rx-loan-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.rx-loan-row:active,
.rx-loan-row.active {
  transform: scale(.985);
  border-color: rgba(103,58,183,.38);
  box-shadow: 0 0 0 4px rgba(103,58,183,.1);
}

.rx-loan-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rx-loan-row b,
.rx-loan-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-loan-row strong,
.rx-loan-focus-card strong {
  color: var(--red);
  font-weight: 950;
}

.rx-loan-side {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
}

.rx-eye-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(103,58,183,.1);
  color: #4c1d95;
}

.rx-loan-expanded {
  display: grid;
  gap: 9px;
  animation: rxCardIn 220ms ease both;
}

.rx-loan-focus-card {
  border: 1px solid rgba(103,58,183,.18);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(124,58,237,.14), transparent 38%),
    rgba(255,255,255,.9);
  box-shadow: 0 14px 30px rgba(45,27,105,.12);
}

.rx-loan-focus-card h3,
.rx-loan-focus-card p {
  margin: 0;
}

.rx-loan-focus-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.rx-loan-paybox {
  border: 1px solid rgba(245,158,11,.22);
  border-radius: 15px;
  padding: 9px;
  display: grid;
  gap: 7px;
  background: linear-gradient(180deg, rgba(255,251,235,.9), rgba(255,255,255,.84));
}

.rx-loan-note {
  min-height: 42px;
}

.rx-loan-auto-note {
  border: 1px dashed rgba(103,58,183,.22);
  border-radius: 13px;
  padding: 7px 9px;
  background: rgba(103,58,183,.055);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.rx-loan-paybox .rx-stack {
  gap: 4px;
}

.rx-loan-paybox .rx-input,
.rx-loan-paybox .rx-select {
  min-height: 40px;
}

.rx-loan-paybox .rx-btn {
  min-height: 40px;
}

.rx-loan-bottom-save {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  margin-top: 2px;
}

.rx-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

@keyframes rxCardIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.rx-grid-2.compact {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.rx-drawer,
.rx-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  background: rgba(17,24,39,.18);
  transition: opacity 180ms ease;
}

.rx-drawer.open,
.rx-sheet.open {
  opacity: 1;
  pointer-events: auto;
}

.rx-drawer-panel {
  width: min(342px, 88vw);
  height: 100%;
  padding: calc(18px + env(safe-area-inset-top,0px)) 16px 16px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  transform: translateX(-104%);
  transition: transform 220ms ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rx-drawer.open .rx-drawer-panel { transform: translateX(0); }

.rx-profile-card {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7f5fb);
  box-shadow: var(--soft-shadow);
}

.rx-profile-main {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}

.rx-profile-photo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  object-fit: cover;
}

.rx-profile-photo.fallback {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #4b168c, #673ab7);
  font-size: 22px;
  font-weight: 950;
}

.rx-profile-main h3 {
  margin-bottom: 4px;
}

.rx-profile-edit {
  display: grid;
  gap: 9px;
}

.rx-menu-link {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 12px;
  text-align: left;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
}

.rx-menu-link.danger { color: var(--red); background: var(--red-soft); }

.rx-sheet {
  display: grid;
  align-items: end;
  overscroll-behavior: contain;
}

.rx-sheet-panel {
  position: relative;
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: 8px 14px calc(18px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow);
  transform: translateY(105%);
  transition: transform 220ms ease;
  -webkit-overflow-scrolling: touch;
}

.rx-sheet.open .rx-sheet-panel { transform: translateY(0); }

.rx-sheet-back {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #3f1d7a;
  background: rgba(103,58,183,.1);
  box-shadow: 0 8px 16px rgba(45,27,105,.08);
}

.rx-grip {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  margin: 2px auto 12px;
  background: var(--line);
}

.rx-form {
  display: grid;
  gap: 11px;
}

.rx-sheet-sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px 0 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.86));
  backdrop-filter: blur(14px);
}

.rx-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.rx-actions .rx-btn { min-width: 0; }

.rx-toast {
  position: fixed;
  left: 50%;
  top: calc(62px + env(safe-area-inset-top,0px));
  z-index: 90;
  width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translate(-50%, -18px);
  pointer-events: auto;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  transition: opacity 180ms ease, transform 180ms ease;
  touch-action: pan-x;
}

.rx-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rx-toast.error { background: var(--red); }

.rx-loader {
  position: fixed;
  left: 50%;
  top: calc(62px + env(safe-area-inset-top,0px));
  z-index: 88;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px) scale(.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.rx-loader.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.rx-loader-pill {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: linear-gradient(135deg, #4b168c, #673ab7);
  box-shadow: 0 12px 32px rgba(75,22,140,.26);
  font-size: 12px;
  font-weight: 950;
}

.rx-loader-pill .rx-icon {
  animation: rxPulse .76s ease-in-out infinite alternate;
}

.rx-local-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18px 18px, rgba(75,22,140,.035) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, #f7f2ff, #f5f1fb);
  background-size: 28px 28px, 100% 100%;
}

.rx-local-shell {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
}

.rx-local-chatbar {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid rgba(17,24,39,.06);
  backdrop-filter: blur(14px);
}

.rx-local-chatbar > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #332158;
  font-size: 13px;
  font-weight: 950;
}

.rx-local-messages {
  overflow: auto;
  display: grid;
  align-content: end;
  gap: 7px;
  padding: 12px 10px 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rx-local-only {
  color: rgba(51, 33, 88, .62);
  font-size: 10px;
  font-weight: 900;
}

.rx-local-query {
  gap: 9px;
}

.rx-local-prompts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 2px 3px;
}

.rx-local-prompts button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(75, 22, 140, .14);
  border-radius: 999px;
  color: #4b168c;
  background: rgba(255,255,255,.86);
  font-size: 11px;
  font-weight: 900;
}

.rx-local-answer {
  border-color: rgba(75, 22, 140, .14);
}

.rx-local-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rx-local-metrics div {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.rx-local-metrics span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.rx-local-metrics strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.rx-local-summary {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 850;
}

.rx-local-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.rx-local-table .head,
.rx-local-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 78px;
  gap: 8px;
  align-items: center;
}

.rx-local-table .head {
  padding: 8px 10px;
  color: var(--muted);
  background: #f7f5fb;
  font-size: 10px;
  font-weight: 950;
}

.rx-local-row {
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.rx-local-row b,
.rx-local-row strong {
  display: block;
  font-size: 12px;
  font-weight: 950;
}

.rx-local-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.28;
  font-weight: 750;
}

.rx-agent-page {
  width: 100%;
  min-width: 0;
  padding-bottom: 10px;
}

.rx-agent-hero {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(75, 22, 140, .12);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #f6f0ff 58%, #eef7ff);
  box-shadow: 0 12px 32px rgba(54, 31, 101, .1);
}

.rx-agent-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.rx-agent-hero-copy h2,
.rx-agent-answer h2 {
  margin: 2px 0 0;
  letter-spacing: 0;
}

.rx-agent-hero-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.rx-agent-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #6b2fc4, #3e157f);
  box-shadow: 0 10px 20px rgba(75, 22, 140, .25);
}

.rx-agent-global-open {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(75, 22, 140, .14);
  border-radius: 14px;
  display: grid;
  place-items: center;
  gap: 1px;
  color: #4b168c;
  background: rgba(255,255,255,.9);
  box-shadow: 0 7px 16px rgba(31,24,58,.08);
}

.rx-agent-global-open .rx-icon {
  width: 19px;
  height: 19px;
}

.rx-agent-global-open small {
  font-size: 8px;
  font-weight: 950;
}

.rx-agent-prompt {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 42px;
  gap: 6px;
  min-height: 52px;
  padding: 5px;
  border: 1px solid rgba(75, 22, 140, .15);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(31, 24, 58, .08);
}

.rx-agent-prompt input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 8px;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
}

.rx-agent-prompt input::placeholder {
  color: #8e879b;
}

.rx-agent-clear,
.rx-agent-run {
  border: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.rx-agent-clear {
  color: var(--muted);
  background: #f2eff6;
}

.rx-agent-run {
  color: #fff;
  background: linear-gradient(145deg, #6a2dbf, #421782);
  box-shadow: 0 7px 14px rgba(75, 22, 140, .2);
}

.rx-agent-run:disabled {
  opacity: .6;
}

.rx-agent-quick,
.rx-agent-periods,
.rx-agent-tags {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}

.rx-agent-quick::-webkit-scrollbar,
.rx-agent-history::-webkit-scrollbar,
.rx-agent-periods::-webkit-scrollbar,
.rx-agent-tags::-webkit-scrollbar,
.rx-agent-pipeline::-webkit-scrollbar { display: none; }

.rx-agent-quick button,
.rx-agent-periods button,
.rx-agent-tags button,
.rx-agent-wizard-tags button,
.rx-agent-modal-tags button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(75, 22, 140, .12);
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #5f5870;
  background: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.rx-agent-history {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.rx-agent-history > div {
  flex: 0 0 auto;
  max-width: min(72vw, 280px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  border: 1px solid rgba(75, 22, 140, .12);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  overflow: hidden;
}

.rx-agent-history > div > button:first-child {
  min-width: 0;
  min-height: 34px;
  overflow: hidden;
  padding: 0 4px 0 11px;
  border: 0;
  color: #5f5870;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.rx-agent-history-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  color: #8b8496;
  background: transparent;
}

.rx-agent-history-remove .rx-icon {
  width: 13px;
  height: 13px;
}

.rx-agent-history-empty {
  position: relative;
  z-index: 1;
  color: rgba(62, 51, 77, .62);
  font-size: 10px;
  font-weight: 800;
}

.rx-agent-index-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(151, 81, 0, .18);
  border-radius: 14px;
  background: #fff9e9;
}

.rx-agent-index-card > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #8c5108;
  background: #ffedbd;
}

.rx-agent-index-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rx-agent-index-card strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.rx-agent-index-card small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  font-weight: 780;
}

.rx-agent-index-card .rx-btn {
  min-height: 36px;
  padding: 0 11px;
  font-size: 10px;
}

.rx-agent-periods button.active,
.rx-agent-tags button.active,
.rx-agent-wizard-tags button.active,
.rx-agent-modal-tags button.active {
  border-color: rgba(75, 22, 140, .26);
  color: #4b168c;
  background: #efe5ff;
  box-shadow: inset 0 0 0 1px rgba(75, 22, 140, .05);
}

.rx-agent-builder {
  gap: 11px;
}

.rx-query-builder {
  padding: 14px;
  border-color: rgba(75, 22, 140, .11);
  background: #fff;
  box-shadow: 0 10px 28px rgba(35, 24, 58, .07);
}

.rx-query-head {
  align-items: flex-start;
}

.rx-query-head h2 {
  margin-top: 2px;
  font-size: 18px;
  letter-spacing: 0;
}

.rx-query-head > div:first-child > small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.rx-query-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rx-query-prepare {
  min-height: 34px;
  border: 1px solid #ebcf8b;
  border-radius: 10px;
  padding: 0 10px;
  color: #80500d;
  background: #fff4d7;
  font-size: 9px;
  font-weight: 950;
}

.rx-query-keyword {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr) 32px 38px;
  align-items: center;
  gap: 7px;
  min-height: 50px;
  padding: 5px 7px 5px 12px;
  border: 1px solid rgba(75, 22, 140, .15);
  border-radius: 14px;
  background: #faf8fd;
  box-shadow: inset 0 1px 2px rgba(31, 24, 58, .03);
}

.rx-query-keyword > .rx-icon {
  color: #6f657f;
}

.rx-query-keyword input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
}

.rx-query-keyword input::placeholder {
  color: #9891a4;
}

.rx-query-keyword input:disabled {
  color: #8f8899;
  opacity: 1;
}

.rx-query-keyword button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #766e82;
  background: #eeebf2;
}

.rx-query-keyword .rx-keyword-add {
  width: 38px;
  color: #fff;
  background: #4b168c;
}

.rx-query-keyword .rx-keyword-add:disabled {
  color: #9b94a5;
  background: #ece9f0;
}

.rx-keyword-space {
  width: 32px;
}

.rx-query-keyword-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rx-query-keyword-chips button {
  max-width: 100%;
  min-height: 30px;
  border: 1px solid rgba(75,22,140,.14);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  color: #4b168c;
  background: #f0e7ff;
  font-size: 10px;
  font-weight: 900;
}

.rx-query-keyword-chips button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-query-keyword-chips .rx-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.rx-query-keyword-chips small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.rx-agent-tag-sheet .rx-agent-modal-tags {
  min-height: 0;
  flex: 1 1 auto;
  align-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.rx-query-keyword button .rx-icon {
  width: 14px;
  height: 14px;
}

.rx-query-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.rx-query-section-label span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
}

.rx-query-section-label small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.rx-query-date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 9px;
  border-radius: 12px;
  background: #f6f3fa;
}

.rx-query-date-range .rx-stack {
  min-width: 0;
  gap: 4px;
}

.rx-query-date-range .rx-input {
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  font-size: 12px;
}

.rx-query-calculate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-top: 1px solid rgba(75, 22, 140, .08);
  border-bottom: 1px solid rgba(75, 22, 140, .08);
  background: #fcfbfd;
}

.rx-query-calculate > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rx-query-calculate strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.rx-query-calculate small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  font-weight: 780;
}

.rx-query-switch {
  width: 48px;
  height: 28px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #d8d3df;
  transition: background .18s ease;
}

.rx-query-switch span {
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(31, 24, 58, .2);
  transition: transform .18s ease;
}

.rx-query-switch.active {
  background: #5b23a6;
}

.rx-query-switch.active span {
  transform: translateX(20px);
}

.rx-query-page-status {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(75, 22, 140, .1);
  border-radius: 13px;
  background: #f8f5fb;
}

.rx-query-page-status > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #5b23a6;
  background: #ece2fb;
}

.rx-query-page-status > div {
  display: grid;
  gap: 2px;
}

.rx-query-page-status strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.rx-query-page-status small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.rx-agent-builder .rx-head h3 {
  margin-top: 2px;
}

.rx-agent-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.rx-agent-select-grid .rx-stack {
  min-width: 0;
  gap: 4px;
}

.rx-agent-select-grid .rx-select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 24px 0 8px;
  font-size: 11px;
}

.rx-agent-tag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rx-agent-tag-head > span {
  display: grid;
  gap: 1px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.rx-agent-tag-head small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.rx-agent-tag-head button {
  min-height: 30px;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #4b168c;
  background: transparent;
  font-size: 11px;
  font-weight: 950;
}

.rx-agent-tag-head .rx-icon,
.rx-agent-tags .rx-icon,
.rx-agent-wizard-tags .rx-icon,
.rx-agent-modal-tags .rx-icon {
  width: 14px;
  height: 14px;
}

.rx-agent-pipeline {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding: 8px;
  border: 1px dashed rgba(75, 22, 140, .18);
  border-radius: 13px;
  background: #faf8fd;
  scrollbar-width: none;
}

.rx-agent-pipeline > div {
  flex: 0 0 auto;
  min-width: 76px;
  max-width: 128px;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(75, 22, 140, .1);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(31, 24, 58, .04);
}

.rx-agent-pipeline small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.rx-agent-pipeline b {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-agent-link {
  color: rgba(75, 22, 140, .45);
  font-size: 14px;
  font-weight: 950;
}

.rx-agent-fetch {
  min-height: 46px;
}

.rx-agent-answer {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(50, 132, 95, .2);
  border-radius: 18px;
  color: var(--ink);
  background: linear-gradient(145deg, #f3fff9, #fff 58%, #f7f2ff);
  box-shadow: 0 12px 26px rgba(31, 81, 61, .08);
}

.rx-agent-answer-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.rx-agent-answer-head > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #277255;
  background: #dff8ec;
}

.rx-agent-answer h2 {
  font-size: 18px;
}

.rx-agent-answer-copy {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid #64b48f;
  border-radius: 0 10px 10px 0;
  color: #263b33;
  background: rgba(255,255,255,.74);
  font-size: 12px;
  line-height: 1.42;
  font-weight: 850;
}

.rx-agent-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.rx-agent-metrics div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid rgba(29, 93, 68, .09);
  border-radius: 11px;
  background: rgba(255,255,255,.86);
}

.rx-agent-metrics small,
.rx-agent-scope,
.rx-agent-read-note {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.rx-agent-metrics strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-agent-scope {
  margin: 0;
}

.rx-agent-summary-note {
  margin: 0;
  padding: 7px 9px;
  border-radius: 9px;
  color: #4f4960;
  background: #f1eef5;
  font-size: 9px;
  line-height: 1.35;
  font-weight: 800;
}

.rx-agent-limit {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: #975100;
  background: #fff4d8;
  font-size: 10px;
  font-weight: 850;
}

.rx-agent-row-amount {
  min-width: 0;
  text-align: right;
}

.rx-agent-row-amount.debit strong {
  color: var(--red);
}

.rx-agent-row-amount.credit strong {
  color: var(--teal);
}

.rx-agent-row-amount small {
  white-space: nowrap;
}

.rx-agent-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 12px;
  background: rgba(247,245,251,.78);
  backdrop-filter: blur(10px);
  animation: rxFade .16s ease both;
}

.rx-agent-modal > section {
  width: min(100%, 520px);
  max-height: min(72vh, 620px);
  margin: 0 auto;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(75, 22, 140, .12);
  border-radius: 20px 20px 12px 12px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(24, 15, 44, .22);
  animation: rxLift .2s ease both;
}

.rx-agent-modal-tags,
.rx-agent-wizard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rx-global-search-overlay {
  position: fixed;
  z-index: 135;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(244,241,249,.76);
  backdrop-filter: blur(10px);
  animation: rxFade .16s ease both;
}

.rx-global-search-sheet {
  width: min(100%, 640px);
  max-height: min(82vh, 720px);
  margin: 0 auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(120px, 1fr) auto;
  gap: 11px;
  padding: 7px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(75,22,140,.12);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #fbfaff;
  box-shadow: 0 -22px 60px rgba(24,15,44,.2);
  animation: rxLift .22s cubic-bezier(.2,.8,.2,1) both;
}

.rx-global-search-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: #d8d1e2;
}

.rx-global-search-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rx-global-search-controls .rx-stack {
  gap: 4px;
}

.rx-global-search-box {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 50px;
  padding: 5px 5px 5px 11px;
  border: 1px solid rgba(75,22,140,.13);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(31,24,58,.06);
}

.rx-global-search-box > .rx-icon {
  color: #6d657a;
}

.rx-global-search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
}

.rx-global-search-box button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  padding: 0 13px;
  color: #fff;
  background: #4b168c;
  font-size: 11px;
  font-weight: 950;
}

.rx-global-search-box button:disabled {
  color: #8c8497;
  background: #ece9f0;
}

.rx-global-results {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rx-global-results .rx-empty {
  min-height: 132px;
}

.rx-global-pagination {
  margin-top: 0;
}

.rx-agent-wizard {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(42, 116, 85, .2);
  border-radius: 17px;
  background: linear-gradient(145deg, #fff, #f0fff8);
  box-shadow: 0 10px 24px rgba(35, 90, 68, .09);
  animation: rxLift .2s ease both;
}

.rx-agent-wizard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rx-agent-wizard-head h3 {
  margin: 2px 0 0;
}

.rx-agent-wizard-head > button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  color: #276c51;
  background: #dff8ec;
  font-size: 10px;
  font-weight: 950;
}

.rx-agent-draft-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 11px;
  color: var(--ink);
  background: #f7f4fb;
}

.rx-agent-draft-line strong {
  color: #4b168c;
}

.rx-agent-draft-line span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-agent-draft-line small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.rx-agent-wizard-actions {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 8px;
}

@media (max-width: 390px) {
  .rx-agent-hero,
  .rx-agent-answer,
  .rx-agent-wizard { padding: 12px; }
  .rx-query-builder { padding: 12px; }
  .rx-query-head h2 { font-size: 17px; }
  .rx-query-date-range { gap: 6px; padding: 7px; }
  .rx-agent-select-grid { gap: 5px; }
  .rx-agent-select-grid .rx-select { padding-left: 6px; font-size: 10px; }
  .rx-agent-metrics div { padding: 8px 6px; }
  .rx-agent-metrics strong { font-size: 12px; }
  .rx-agent-prompt { grid-template-columns: minmax(0, 1fr) 32px 40px; }
}

@keyframes rxPage {
  from { opacity: 0; transform: translateX(24px) scale(.99); filter: blur(1px); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes rxRow {
  from { opacity: 0; transform: translateX(16px) scale(.99); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes rxLift {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rxFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rxVanish {
  to { opacity: 0; transform: translateX(26px) scale(.96); filter: blur(5px); }
}

@keyframes rxPulse {
  from { transform: scale(.92); opacity: .72; }
  to { transform: scale(1.08); opacity: 1; }
}

@keyframes rxTapGlow {
  from { opacity: .85; transform: scale(.72); }
  to { opacity: 0; transform: scale(1.32); }
}

@keyframes rxShimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@media (min-width: 720px) {
  .rx-book-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 390px) {
  .rx-main { padding-left: 10px; padding-right: 10px; }
  .rx-key { min-height: 47px; border-radius: 14px; }
  .rx-amount-display strong { font-size: 25px; }
  .rx-filter { gap: 5px; padding: 6px; }
  .rx-chip { padding: 0 8px; font-size: 11px; }
}

.rx-tag-modal-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  align-items: center;
}

.rx-tag-add-toggle {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(18, 128, 94, .16);
}

.rx-tag-add-toggle .rx-icon {
  width: 15px;
  height: 15px;
}

.rx-tag-modal-add {
  padding: 8px;
  border: 1px solid rgba(75, 22, 140, .1);
  border-radius: 15px;
  background: #fbf9ff;
}

.rx-sheet.page-like {
  background: rgba(247,245,251,.98);
}

.rx-sheet.page-like .rx-sheet-panel {
  width: 100%;
  height: 100dvh;
  max-height: none;
  padding: calc(8px + env(safe-area-inset-top,0px)) 14px calc(18px + var(--safe-bottom));
  border-radius: 0;
}

.rx-date-group {
  display: grid;
  gap: 8px;
}

.rx-date-divider {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(75, 22, 140, .08);
  border-radius: 999px;
  color: #4b168c;
  background: rgba(247,245,251,.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 5px 14px rgba(35,24,58,.045);
}

.rx-date-divider span {
  font-size: 11px;
  font-weight: 950;
}

.rx-date-divider small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}
