@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700;800&family=Suez+One&display=swap');

/* ====== DESIGN TOKENS ====== */
:root {
  --bg-base: #0e1a26;
  --bg-ink: #16263a;
  --bg-ink-soft: #1d3145;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.13);
  --border-soft: rgba(255, 255, 255, 0.07);
  --gold: #d7a53d;
  --gold-bright: #f0c468;
  --gold-deep: #a87b22;
  --teal: #3fa08c;
  --teal-soft: rgba(63, 160, 140, 0.16);
  --clay: #c97456;
  --clay-soft: rgba(201, 116, 86, 0.16);
  --danger: #b5453c;
  --danger-soft: rgba(181, 69, 60, 0.14);
  --paper: #f5efe3;
  --txt: #f7f4ec;
  --txt-soft: #b9c4d2;
  --txt-faint: #7e8da0;
  --font-disp: 'Suez One', serif;
  --font-body: 'Heebo', sans-serif;
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent
}

html {
  font-feature-settings: 'tnum' 1
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-base);
  font-family: var(--font-body);
  color: var(--txt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  overflow: hidden
}

body::before,
body::after {
  content: '';
  position: fixed;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .28;
  z-index: 0;
  pointer-events: none
}

body::before {
  background: var(--gold);
  inset-inline-start: -18vmax;
  top: -22vmax
}

body::after {
  background: var(--teal);
  inset-inline-end: -20vmax;
  bottom: -20vmax
}

/* ====== DEVICE SHELL ====== */
.device {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 412px;
  height: 100svh;
  max-height: none;
  background: linear-gradient(165deg, var(--bg-ink), var(--bg-base));
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column
}

@media(min-width:460px) {
  .device {
    border-radius: var(--r-lg);
    border: 1px solid var(--border-soft);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
    height: 92vh;
    max-height: 920px
  }
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding-top: max(env(safe-area-inset-top, 28px), 12px);
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .38s ease, transform .38s ease
}

.screen[hidden] {
  display: flex;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--r-md)
}

.scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px 110px;
  -webkit-overflow-scrolling: touch
}

.device {
  padding-top: env(safe-area-inset-top, 28px)
}

.bottom-nav {
  bottom: calc(14px + env(safe-area-inset-bottom, 0px))
}

.scroll-body.no-pad {
  padding: 0 0 110px
}

/* ====== LOGIN ====== */
.login-screen {
  padding-top: max(env(safe-area-inset-top, 32px), 20px);
  padding-left: 26px;
  padding-right: 26px;
  padding-bottom: 24px;
  justify-content: space-between;
  text-align: center;
  overflow-y: auto;
  background: none;
  background-image:
    linear-gradient(180deg,
      rgba(26, 45, 61, 0.85) 0%,
      rgba(26, 45, 61, 0.88) 50%,
      rgba(26, 45, 61, 0.90) 100%),
    url('../splash/assets/login-bg.png');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: local;
}

.windowpane {
  margin: 0 auto 16px;
  width: 178px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: rise .7s ease both
}

.windowpane::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(115deg, rgba(255, 255, 255, .55) 0%, transparent 38%);
  pointer-events: none
}

.windowpane img {
  display: block;
  width: 100%;
  border-radius: 10px
}

.login-lede {
  margin: 0 0 22px;
  color: var(--txt-soft);
  font-size: 14px;
  line-height: 1.6;
  animation: rise .7s ease .08s both
}

.login-lede strong {
  color: var(--txt);
  font-weight: 600
}

.lang-toggle-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px
}

.lang-btn {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--txt-soft);
  font-size: 12.5px;
  font-family: var(--font-body);
  cursor: pointer
}

.lang-btn.on {
  background: var(--gold);
  color: #1a0f00;
  border-color: var(--gold);
  font-weight: 700
}

.form {
  text-align: start;
  animation: rise .7s ease .16s both
}

.field {
  margin-bottom: 14px
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--txt-soft);
  margin-bottom: 6px;
  padding-inline-start: 4px
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center
}

.input-shell input {
  width: 100%;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 13px 15px;
  outline: none;
  transition: border-color .2s
}

.input-shell.has-toggle input {
  padding-inline-end: 44px
}

.input-shell input:focus {
  border-color: var(--gold)
}

.input-shell input::placeholder {
  color: var(--txt-faint)
}

.icon-toggle {
  position: absolute;
  inset-inline-end: 4px;
  background: none;
  border: none;
  color: var(--txt-faint);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  cursor: pointer
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: #2a1c05;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 12px 26px -10px rgba(215, 165, 61, .55);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s
}

.btn-primary:hover {
  box-shadow: 0 14px 30px -8px rgba(215, 165, 61, .7)
}

.btn-primary:active {
  transform: scale(.97)
}

.btn-danger-full {
  width: 100%;
  border: none;
  border-radius: var(--r-sm);
  padding: 13px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--danger);
  cursor: pointer
}

.login-helper {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--txt-faint);
  text-align: center
}

.login-footer {
  font-size: 11px;
  color: var(--txt-faint);
  letter-spacing: .04em;
  opacity: .6
}

/* Support Bubble */
.support-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(45, 122, 115, 0.95);
  color: white !important;
  text-decoration: none;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  transition: all .2s ease;
  border: 1px solid rgba(45, 122, 115, 0.5);
  box-shadow: 0 2px 8px rgba(45, 122, 115, 0.2);
}

.support-bubble:hover {
  background: rgba(45, 122, 115, 1);
  box-shadow: 0 4px 12px rgba(45, 122, 115, 0.3);
  transform: translateY(-1px);
}

.support-bubble:active {
  transform: translateY(0);
}

.support-icon {
  display: inline-block;
  flex-shrink: 0;
}

/* ====== SUBSCRIPTION SCREEN ====== */
.sub-screen {
  padding-top: max(env(safe-area-inset-top, 28px), 20px);
  padding-left: 20px;
  padding-right: 20px;
  overflow-y: auto;
  justify-content: flex-start;
  gap: 0
}

.sub-logo {
  width: 72px;
  margin: 0 auto 14px;
  padding: 8px;
  background: var(--paper);
  border-radius: 16px
}

.sub-logo img {
  width: 100%;
  border-radius: 10px
}

.sub-headline {
  text-align: center;
  font-family: var(--font-disp);
  font-size: 22px;
  margin: 0 0 6px
}

.sub-tagline {
  text-align: center;
  font-size: 13.5px;
  color: var(--txt-soft);
  margin: 0 0 22px;
  line-height: 1.5
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px
}

.plan-card {
  padding: 16px 12px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--glass);
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: border-color .2s
}

.plan-card.on {
  border-color: var(--gold);
  background: rgba(215, 165, 61, .1)
}

.plan-card .plan-tenants {
  font-family: var(--font-disp);
  font-size: 28px;
  color: var(--txt)
}

.plan-card .plan-label {
  font-size: 11px;
  color: var(--txt-faint);
  margin: 2px 0 8px
}

.plan-card .plan-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-bright)
}

.plan-card .plan-mo {
  font-size: 10.5px;
  color: var(--txt-faint)
}

.plan-card .popular-badge {
  position: absolute;
  top: -10px;
  inset-inline-end: 10px;
  font-size: 10px;
  background: var(--gold);
  color: #1a0f00;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700
}

.sub-divider {
  text-align: center;
  font-size: 12px;
  color: var(--txt-faint);
  margin: 6px 0 12px
}

.payment-form {
  display: flex;
  flex-direction: column;
  gap: 10px
}

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

.sub-secure {
  text-align: center;
  font-size: 11.5px;
  color: var(--txt-faint);
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px
}

.sub-tos {
  text-align: center;
  font-size: 11.5px;
  color: var(--txt-faint);
  margin: 8px 0 0
}

.sub-tos a {
  color: var(--gold-bright);
  cursor: pointer
}

.btn-outline {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 13px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--txt-soft);
  background: none;
  cursor: pointer;
  margin-top: 6px
}

/* ====== TERMS OF SERVICE ====== */
.tos-screen {
  padding-top: max(env(safe-area-inset-top, 18px), 12px);
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 0
}

.tos-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 40px
}

.tos-updated {
  font-size: 11.5px;
  color: var(--txt-faint);
  margin-bottom: 18px
}

.tos-section {
  margin-bottom: 22px
}

.tos-section h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gold-bright);
  margin: 0 0 8px
}

.tos-section p,
.tos-section li {
  font-size: 13px;
  color: var(--txt-soft);
  line-height: 1.7;
  margin: 0 0 6px
}

.tos-section ul {
  padding-inline-start: 18px;
  margin: 0
}

/* ====== TOPBAR ====== */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
  animation: rise .5s ease both
}

.brand-chip {
  display: flex;
  align-items: center;
  gap: 10px
}

.brand-chip .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
  flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset
}

.brand-chip .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transform: scale(2.05)
}

.brand-chip .apt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt)
}

.brand-chip .apt-sub {
  font-size: 11px;
  color: var(--txt-faint)
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: #fff;
  font-family: var(--font-disp);
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none
}

.notif-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--txt-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative
}

.notif-badge {
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--clay);
  border: 2px solid var(--bg-ink);
  font-size: 8px;
  display: grid;
  place-items: center;
  font-weight: 700
}

/* ====== MONTH-END BANNER ====== */
.month-end-banner {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(201, 116, 86, .16);
  border: 1px solid rgba(201, 116, 86, .3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #e5a78c;
  cursor: pointer;
  animation: rise .5s ease .05s both
}

.month-end-banner .meb-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(201, 116, 86, .22);
  display: grid;
  place-items: center;
  color: var(--clay)
}

.month-end-banner .meb-text {
  flex: 1
}

.month-end-banner .meb-title {
  font-weight: 700;
  margin-bottom: 2px
}

.month-end-banner .meb-sub {
  font-size: 11.5px;
  color: rgba(229, 167, 140, .7)
}

/* ====== DASHBOARD ====== */
.dash-screen {
  overflow-y: auto;
  padding-top: max(env(safe-area-inset-top, 16px), 12px);
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0
}

.greeting {
  margin: 16px 18px 14px;
  font-size: 20px;
  font-weight: 600;
  animation: rise .5s ease .06s both
}

.greeting span {
  color: var(--txt-soft);
  font-weight: 400;
  font-size: 14px;
  display: block;
  margin-top: 2px
}

.balance-card {
  margin: 0 18px;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: rise .5s ease .1s both
}

.balance-card .sheen {
  position: absolute;
  inset: -40% -10%;
  background: linear-gradient(120deg, var(--gold) 0%, transparent 32%, transparent 68%, var(--teal) 100%);
  opacity: .16;
  pointer-events: none
}

.balance-label {
  font-size: 12.5px;
  color: var(--txt-soft);
  margin: 0 0 7px;
  position: relative
}

.balance-amount {
  font-family: var(--font-disp);
  font-size: 42px;
  line-height: 1;
  margin: 0;
  position: relative
}

.balance-amount .sym {
  font-size: 22px;
  margin-inline-start: 4px
}

.balance-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  position: relative
}

.balance-status.is-credit {
  background: var(--teal-soft);
  color: #7fd6c1
}

.balance-status.is-debt {
  background: var(--clay-soft);
  color: #e5a78c
}

.balance-status.is-even {
  background: rgba(255, 255, 255, .08);
  color: var(--txt-soft)
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 18px 0;
  animation: rise .5s ease .14s both
}

.stat-pill {
  padding: 13px 14px;
  border: none;
  text-align: start;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  gap: 3px
}

.stat-pill .stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--txt-soft)
}

.stat-pill .stat-amount {
  font-size: 18px;
  font-weight: 700
}

.stat-pill.credit .stat-amount {
  color: #7fd6c1
}

.stat-pill.debt .stat-amount {
  color: #e5a78c
}

.stat-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px
}

.stat-pill.credit .stat-icon {
  background: var(--teal-soft);
  color: var(--teal)
}

.stat-pill.debt .stat-icon {
  background: var(--clay-soft);
  color: var(--clay)
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 18px 10px;
  animation: rise .5s ease .18s both
}

.section-head h2 {
  font-size: 14.5px;
  margin: 0;
  color: var(--txt)
}

.section-head a {
  font-size: 12px;
  color: var(--gold-bright);
  text-decoration: none;
  cursor: pointer
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0 18px;
  animation: rise .5s ease .22s both
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px
}

.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  flex: none
}

.feed-body {
  flex: 1;
  min-width: 0
}

.feed-body .feed-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--txt)
}

.feed-body .feed-sub {
  font-size: 11.5px;
  color: var(--txt-faint);
  margin-top: 2px
}

.feed-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt);
  flex: none;
  font-variant-numeric: tabular-nums
}

.dash-spacer {
  height: 96px
}

/* ====== BOTTOM NAV ====== */
.bottom-nav {
  position: absolute;
  inset-inline: 14px;
  bottom: 14px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  background: rgba(10, 18, 28, .75);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .6);
  z-index: 20
}

.nav-item {
  background: none;
  border: none;
  color: var(--txt-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-body);
  font-size: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 12px
}

.nav-item.active {
  color: var(--gold-bright)
}

.nav-item svg {
  width: 20px;
  height: 20px
}

.nav-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a1c05;
  box-shadow: 0 10px 22px -6px rgba(215, 165, 61, .7);
  cursor: pointer;
  transform: translateY(-14px)
}

.nav-fab:active {
  transform: translateY(-14px) scale(.93)
}

.nav-fab svg {
  width: 24px;
  height: 24px
}

/* ====== SUB SCREENS ====== */
.sub-screen-shell {
  padding: 16px 18px 0;
  display: flex;
  flex-direction: column;
  height: 100%
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px
}

.screen-header h1 {
  font-family: var(--font-disp);
  font-size: 20px;
  margin: 0
}

.back-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--txt-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none
}

.back-btn svg {
  width: 16px;
  height: 16px
}

/* ====== DEBTS ====== */
.segmented {
  display: flex;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3px;
  margin-bottom: 16px
}

.segmented button {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 4px;
  border-radius: 11px;
  color: var(--txt-faint);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer
}

.segmented button.on {
  background: var(--glass-strong);
  color: var(--txt);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .4)
}

.debt-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  margin-bottom: 7px
}

.debt-row .mini-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-disp);
  color: #fff;
  flex: none;
  font-size: 15px
}

.debt-row .who {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--txt)
}

.debt-row .amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums
}

.debt-row.credit .amt {
  color: #7fd6c1
}

.debt-row.debt .amt {
  color: #e5a78c
}

.settle-btn {
  font-size: 11.5px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--txt-soft);
  padding: 6px 11px;
  border-radius: 10px;
  cursor: pointer
}

.settle-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold)
}

.breakdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  cursor: pointer;
  color: var(--txt-soft);
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
  margin-top: 10px
}

.breakdown-toggle svg {
  transition: transform .2s
}

.breakdown-toggle.open svg {
  transform: rotate(180deg)
}

.breakdown-body {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 4px 4px 10px
}

.breakdown-body.open {
  display: flex
}

.breakdown-person {
  font-size: 13px
}

.bp-name {
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px
}

.breakdown-line {
  display: flex;
  justify-content: space-between;
  color: var(--txt-soft);
  padding: 3px 0 3px 16px;
  font-size: 12.5px
}

.breakdown-line b {
  color: #e5a78c;
  font-weight: 700
}

/* ====== HISTORY ====== */
.filter-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--txt-soft);
  display: grid;
  place-items: center;
  cursor: pointer
}

.month-header {
  font-size: 12px;
  color: var(--txt-faint);
  margin: 16px 4px 7px;
  font-weight: 600
}

.history-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 7px;
  cursor: pointer
}

.mini-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  color: #fff
}

.avatar-stack {
  display: flex
}

.avatar-stack .mini-av {
  border: 2px solid var(--bg-ink);
  margin-inline-start: -8px
}

.avatar-stack .mini-av:first-child {
  margin-inline-start: 0
}

.history-detail {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.hd-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start
}

.hd-title {
  font-size: 16px;
  font-weight: 700
}

.hd-meta {
  font-size: 12px;
  color: var(--txt-faint);
  margin-top: 3px
}

.hd-actions {
  display: flex;
  gap: 7px
}

.review-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px
}

.review-row .rl {
  color: var(--txt-faint)
}

.review-row .rv {
  color: var(--txt);
  font-weight: 600;
  font-variant-numeric: tabular-nums
}

.review-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 3px 0
}

.review-split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0
}

.review-split-row .who {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--txt-soft)
}

/* ====== WIZARD ====== */
.wizard-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 20, .6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  z-index: 30;
  transition: opacity .3s
}

.wizard-overlay[hidden] {
  display: flex;
  opacity: 0;
  pointer-events: none
}

.wizard-sheet {
  width: 100%;
  max-height: 90%;
  background: linear-gradient(170deg, #1b2e43, #101d2c);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  padding: 12px 20px 22px;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto
}

.wizard-overlay[hidden] .wizard-sheet {
  transform: translateY(40px)
}

.wizard-grip {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 12px
}

.wizard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px
}

.wizard-title {
  font-size: 14.5px;
  font-weight: 600
}

.wizard-close {
  background: none;
  border: none;
  color: var(--txt-faint);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center
}

.wizard-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 8px 0 18px
}

.wizard-dots span {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background .2s
}

.wizard-dots span.on {
  background: var(--gold)
}

.wizard-step {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: rise .3s ease both
}

.wizard-step.active {
  display: flex
}

.step-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px
}

.step-actions .btn-primary {
  flex: 1
}

.btn-ghost {
  flex: none;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--txt-soft);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer
}

/* === WIZARD STEP 1 — AMOUNT === */
.amount-display {
  text-align: center;
  padding: 12px 0 4px
}

.amount-display .amt {
  font-family: var(--font-disp);
  font-size: 44px;
  color: var(--txt)
}

.amount-display .sym {
  font-size: 22px;
  color: var(--txt-soft);
  margin-inline-start: 4px
}

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

.keypad button {
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--glass);
  color: var(--txt);
  font-size: 18px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer
}

.keypad button:active {
  background: var(--glass-strong)
}

.keypad button.key-back {
  color: var(--clay)
}

/* === WIZARD STEP 3 — PARTICIPANTS === */
.select-all-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px
}

.select-all-row a {
  color: var(--gold-bright);
  cursor: pointer
}

.select-all-row .count {
  color: var(--txt-faint)
}

.participant-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 6px
}

.participant-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none
}

.p-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-disp);
  font-size: 17px;
  color: #fff;
  border: 2px solid transparent;
  position: relative;
  opacity: .38;
  transition: opacity .15s, border-color .15s, transform .15s
}

.participant-chip.on .p-avatar {
  opacity: 1;
  border-color: var(--gold-bright);
  transform: scale(1.05)
}

.p-check {
  position: absolute;
  bottom: -2px;
  inset-inline-end: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--gold);
  color: #2a1c05;
  display: none;
  place-items: center;
  border: 2px solid #1b2e43
}

.participant-chip.on .p-check {
  display: grid
}

.p-name {
  font-size: 11px;
  color: var(--txt-soft)
}

.split-preview {
  text-align: center;
  padding: 11px;
  border-radius: var(--r-sm);
  background: rgba(215, 165, 61, .1);
  border: 1px solid rgba(215, 165, 61, .28);
  font-size: 13.5px;
  color: var(--gold-bright)
}

.split-preview strong {
  font-size: 15.5px
}

/* === WIZARD STEP 3P — PAYERS === */
.payer-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-soft);
  background: var(--glass);
  transition: border-color .15s
}

.payer-row.selected {
  border-color: var(--gold)
}

.payer-row .pr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-disp);
  font-size: 14px;
  color: #fff;
  flex: none
}

.payer-row .pr-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--txt)
}

.payer-row .pr-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  color: transparent;
  transition: background .15s, border-color .15s
}

.payer-row .pr-check.on {
  background: var(--gold);
  border-color: var(--gold);
  color: #2a1c05
}

.payer-amount-wrap {
  width: 100%;
  padding: 4px 13px 11px;
  display: none
}

.payer-amount-wrap.show {
  display: block
}

.payer-amount-input {
  width: 100%;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--txt);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 13px;
  outline: none;
  text-align: start
}

.payer-amount-input:focus {
  border-color: var(--gold)
}

.payer-total-bar {
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--glass);
  border: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between
}

.payer-total-bar .pt-label {
  color: var(--txt-soft)
}

.payer-total-bar .pt-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums
}

.payer-total-bar .pt-val.ok {
  color: #7fd6c1
}

.payer-total-bar .pt-val.err {
  color: #e5a78c
}

/* === WIZARD STEP 4 — RECEIPT === */
.receipt-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.receipt-option {
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  color: var(--txt-soft);
  font-size: 13px;
  transition: border-color .2s
}

.receipt-option:hover {
  border-color: var(--gold);
  color: var(--txt)
}

.receipt-option svg {
  display: block;
  margin: 0 auto 8px;
  width: 26px;
  height: 26px;
  color: var(--txt-soft)
}

.receipt-option.has-file {
  border-color: var(--teal);
  background: var(--teal-soft)
}

.receipt-preview-wrap {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden
}

.receipt-preview-img {
  width: 100%;
  border-radius: var(--r-md);
  max-height: 200px;
  object-fit: cover
}

.receipt-remove {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer
}

.receipt-skip {
  text-align: center;
  padding: 6px;
  font-size: 12.5px;
  color: var(--gold-bright);
  cursor: pointer
}

/* === WIZARD STEP 3R — RECURRING === */
.freq-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px
}

.stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--txt);
  font-size: 18px;
  cursor: pointer
}

.freq-value {
  font-family: var(--font-disp);
  font-size: 28px;
  min-width: 70px;
  text-align: center
}

.freq-unlimited {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px
}

.toggle-switch {
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  border: none;
  flex: none
}

.toggle-switch::after {
  content: '';
  position: absolute;
  inset-inline-start: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--txt-soft);
  transition: inset-inline-start .2s, background .2s
}

.toggle-switch.on {
  background: rgba(215, 165, 61, .3)
}

.toggle-switch.on::after {
  inset-inline-start: 19px;
  background: var(--gold-bright)
}

/* === WIZARD STEP 5 — REVIEW === */
.review-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px
}

/* ====== CHIP ROW ====== */
.chip-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px
}

.chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--txt-soft);
  font-size: 12.5px;
  cursor: pointer
}

.chip:hover {
  color: var(--txt);
  border-color: var(--gold)
}

/* ====== MORE MENU ====== */
.more-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 13px;
  margin-bottom: 7px;
  cursor: pointer
}

.mr-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--glass-strong);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  flex: none
}

.mr-label {
  flex: 1;
  font-size: 14px;
  color: var(--txt);
  font-weight: 600
}

.mr-chev {
  color: var(--txt-faint)
}

/* ====== SHOPPING LIST ====== */
.add-item-row {
  display: flex;
  gap: 7px;
  margin-bottom: 16px
}

.add-item-row .input-shell {
  flex: 1
}

.add-item-row button {
  flex: none;
  width: 46px;
  border-radius: var(--r-sm);
  border: none;
  background: var(--gold);
  color: #2a1c05;
  display: grid;
  place-items: center;
  cursor: pointer
}

.list-section-title {
  font-size: 12px;
  color: var(--txt-faint);
  margin: 16px 4px 8px;
  font-weight: 600
}

.shopping-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  margin-bottom: 6px
}

.shopping-check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  color: transparent
}

.shopping-check.checked {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff
}

.s-name {
  flex: 1;
  font-size: 14px;
  color: var(--txt)
}

.shopping-row.checked .s-name {
  color: var(--txt-faint);
  text-decoration: line-through
}

.shopping-del {
  background: none;
  border: none;
  color: var(--txt-faint);
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center
}

.reset-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px
}

.reset-row button {
  font-size: 12px;
  color: var(--txt-faint);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px
}

/* ====== RECURRING ====== */
.recurring-card {
  padding: 13px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 11px
}

.rc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(215, 165, 61, .14);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  flex: none
}

.rc-body {
  flex: 1
}

.rc-title {
  font-size: 13.5px;
  font-weight: 600
}

.rc-sub {
  font-size: 11.5px;
  color: var(--txt-faint);
  margin-top: 2px
}

.rc-badge {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--txt-soft);
  white-space: nowrap
}

.rc-cancel {
  background: none;
  border: none;
  color: var(--clay);
  font-size: 12px;
  cursor: pointer;
  flex: none
}

/* ====== REPORTS ====== */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 16px
}

.m-label {
  font-family: var(--font-disp);
  font-size: 15.5px
}

.report-total {
  padding: 18px;
  text-align: center
}

.rt-label {
  font-size: 12px;
  color: var(--txt-soft);
  margin-bottom: 5px
}

.rt-amount {
  font-family: var(--font-disp);
  font-size: 32px;
  font-variant-numeric: tabular-nums
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 140px;
  padding: 16px 12px 12px
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end
}

.bar-col .bar {
  width: 100%;
  max-width: 32px;
  border-radius: 7px 7px 4px 4px;
  transition: height .6s cubic-bezier(.2, .8, .2, 1)
}

.bar-col .bar-amt {
  font-size: 10.5px;
  color: var(--txt-soft);
  font-variant-numeric: tabular-nums
}

.bar-col .bar-name {
  font-size: 10px;
  color: var(--txt-faint);
  text-align: center
}

/* ====== SETTINGS ====== */
.settings-section {
  margin-bottom: 20px
}

.ss-title {
  font-size: 12px;
  color: var(--txt-faint);
  margin: 0 0 9px 4px
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 11px;
  margin: 4px 0 6px
}

.swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform .15s, border-color .15s
}

.swatch:hover {
  transform: scale(1.08)
}

.swatch.selected {
  border-color: var(--txt);
  transform: scale(1.1)
}

.swatch svg {
  width: 15px;
  height: 15px;
  opacity: 0
}

.swatch.selected svg {
  opacity: 1
}

.logout-row {
  text-align: center;
  padding: 18px 0 4px
}

.logout-row button {
  background: none;
  border: none;
  color: var(--clay);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer
}

/* ====== ONBOARDING ====== */
.onboarding-screen {
  padding-top: max(env(safe-area-inset-top, 40px), 28px);
  padding-left: 26px;
  padding-right: 26px;
  padding-bottom: 26px;
  justify-content: flex-start;
  text-align: center;
  overflow-y: auto
}

.onb-step-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 24px
}

.onb-step-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border)
}

.onb-step-dots span.on {
  background: var(--gold);
  width: 16px;
  border-radius: 3px
}

.onboarding-screen h1 {
  font-family: var(--font-disp);
  font-size: 23px;
  margin: 0 0 5px
}

.onb-sub {
  color: var(--txt-soft);
  font-size: 13.5px;
  margin: 0 0 22px;
  line-height: 1.5
}

/* ====== CONFIRM OVERLAY ====== */
.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 20, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 0 24px
}

.confirm-overlay[hidden] {
  display: none
}

.confirm-card {
  width: 100%;
  padding: 20px;
  text-align: center
}

.confirm-card h3 {
  margin: 0 0 4px;
  font-size: 15.5px
}

.confirm-card p {
  font-size: 13.5px;
  color: var(--txt-soft);
  line-height: 1.6;
  margin: 6px 0 16px
}

.confirm-actions {
  display: flex;
  gap: 9px
}

/* ====== EMPTY STATES ====== */
.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--txt-faint)
}

.empty-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--gold-bright)
}

.empty-icon svg {
  width: 26px;
  height: 26px
}

.empty-state h3 {
  color: var(--txt);
  font-size: 15.5px;
  margin: 0 0 6px
}

.empty-state p {
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.6
}

/* ====== ADMIN ====== */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px
}

.admin-stat {
  padding: 11px 9px;
  text-align: center
}

.admin-stat .as-val {
  font-family: var(--font-disp);
  font-size: 18px;
  font-variant-numeric: tabular-nums
}

.admin-stat .as-label {
  font-size: 10px;
  color: var(--txt-faint);
  margin-top: 3px;
  line-height: 1.3
}

.apt-card {
  padding: 14px;
  margin-bottom: 9px;
  cursor: pointer
}

.ac-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 9px
}

.ac-name {
  font-size: 14px;
  font-weight: 700
}

.ac-sub {
  font-size: 11px;
  color: var(--txt-faint);
  margin-top: 2px
}

.ac-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px
}

.badge.active {
  background: var(--teal-soft);
  color: #7fd6c1
}

.badge.pending {
  background: rgba(255, 255, 255, .08);
  color: var(--txt-soft)
}

.badge.overdue {
  background: var(--clay-soft);
  color: #e5a78c
}

.fab-add {
  position: absolute;
  bottom: 22px;
  inset-inline-end: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #2a1c05;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 22px -6px rgba(215, 165, 61, .7);
  cursor: pointer;
  z-index: 10
}

.admin-tabs {
  display: flex;
  gap: 3px;
  margin: 3px 0 14px;
  border-bottom: 1px solid var(--border-soft)
}

.admin-tabs button {
  flex: 1;
  background: none;
  border: none;
  color: var(--txt-faint);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent
}

.admin-tabs button.on {
  color: var(--gold-bright);
  border-color: var(--gold)
}

.danger-zone {
  border: 1px solid rgba(181, 69, 60, .4);
  border-radius: var(--r-md);
  padding: 14px;
  margin-top: 22px;
  background: rgba(181, 69, 60, .06)
}

.danger-zone h3 {
  color: #e08b82;
  font-size: 13.5px;
  margin: 0 0 5px
}

.danger-zone p {
  font-size: 12px;
  color: var(--txt-soft);
  margin: 0 0 11px;
  line-height: 1.6
}

/* ====== ANIMATIONS ====== */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

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

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px
}

@media(prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important
  }
}

.device {
  padding-top: env(safe-area-inset-top, 28px)
}

.bottom-nav {
  bottom: calc(14px + env(safe-area-inset-bottom, 0px))
}

.wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 2px auto 16px;
  padding: 11px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2ecc71, #25a95c);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 10px 24px -8px rgba(37, 211, 102, .6), 0 0 0 1px rgba(255, 255, 255, .15) inset;
  direction: ltr;
  transition: transform .15s, box-shadow .2s
}

.wa-cta:hover {
  box-shadow: 0 14px 30px -8px rgba(37, 211, 102, .8)
}

.wa-cta:active {
  transform: scale(.96)
}

.wa-cta svg {
  width: 20px;
  height: 20px;
  flex: none
}

.tabular {
  font-variant-numeric: tabular-nums
}

/* ================================================================
   V3 ADDITIONS — login hero CTA, notifications panel, success
   animation, setup wizard, credentials, admin panel, empty states
   ================================================================ */

/* --- Login hero CTA ("התחל בשימוש") --- */
.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--txt-faint);
  font-size: 12px
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft)
}

.btn-hero {
  width: 100%;
  position: relative;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16px;
  color: #1a0f00;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 55%, #e8b954 100%);
  box-shadow: 0 14px 34px -10px rgba(215, 165, 61, .65), 0 0 0 1px rgba(255, 255, 255, .15) inset;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s, box-shadow .2s
}

.btn-hero:hover {
  box-shadow: 0 18px 40px -8px rgba(215, 165, 61, .8), 0 0 0 1px rgba(255, 255, 255, .2) inset
}

.btn-hero:active {
  transform: scale(.97)
}

.btn-hero::after {
  content: '';
  position: absolute;
  top: -60%;
  bottom: -60%;
  width: 38px;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: shine 3.2s ease-in-out infinite
}

@keyframes shine {

  0%,
  60% {
    inset-inline-start: -25%
  }

  100% {
    inset-inline-start: 120%
  }
}

.btn-hero svg {
  flex: none
}

/* --- Notifications panel --- */
.notif-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 20, .55);
  backdrop-filter: blur(3px);
  z-index: 35;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px 0
}

.notif-overlay[hidden] {
  display: none
}

.notif-panel {
  width: 100%;
  max-height: 70%;
  overflow-y: auto;
  background: linear-gradient(170deg, #1b2e43, #101d2c);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px
}

.notif-head h3 {
  margin: 0;
  font-size: 15px;
  font-family: var(--font-disp)
}

.notif-item {
  display: flex;
  gap: 11px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-start
}

.notif-item:last-child {
  border-bottom: none
}

.notif-item .ni-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--glass-strong);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 2px
}

.notif-item .ni-text {
  flex: 1;
  font-size: 13px;
  color: var(--txt-soft);
  line-height: 1.5
}

.notif-item .ni-time {
  font-size: 10.5px;
  color: var(--txt-faint);
  margin-top: 3px
}

.notif-item.unread .ni-text {
  color: var(--txt);
  font-weight: 600
}

.notif-empty {
  text-align: center;
  color: var(--txt-faint);
  font-size: 13px;
  padding: 26px 0
}

/* --- Success animation overlay --- */
.success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 20, .7);
  backdrop-filter: blur(5px);
  z-index: 50;
  display: grid;
  place-items: center
}

.success-overlay[hidden] {
  display: none
}

.success-box {
  text-align: center
}

.success-box .draw-check {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px
}

.draw-check circle {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.4;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: dash .55s cubic-bezier(.65, 0, .45, 1) forwards
}

.draw-check path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: dash .38s .5s cubic-bezier(.65, 0, .45, 1) forwards
}

@keyframes dash {
  to {
    stroke-dashoffset: 0
  }
}

.success-box .success-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt);
  animation: rise .4s .6s ease both
}

/* --- Setup wizard (apartment creation) --- */
.setup-screen {
  padding-top: max(env(safe-area-inset-top, 20px), 12px);
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
  overflow-y: auto
}

.setup-steps-bar {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin: 8px 0 20px
}

.setup-steps-bar span {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--border)
}

.setup-steps-bar span.on {
  background: var(--gold)
}

.tenant-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 14px 0
}

.tenant-stepper .stepper-btn {
  width: 52px;
  height: 52px;
  font-size: 22px;
  border-radius: 16px
}

.tenant-stepper .tn-value {
  font-family: var(--font-disp);
  font-size: 52px;
  min-width: 90px;
  text-align: center;
  color: var(--gold-bright)
}

.tenant-hint {
  text-align: center;
  font-size: 12px;
  color: var(--txt-faint);
  margin-top: 4px
}

/* --- Credentials screen --- */
.cred-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  margin-bottom: 8px
}

.cred-row .cr-badge {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-disp);
  font-size: 13px;
  color: #fff
}

.cred-row .cr-meta {
  flex: 1;
  min-width: 0
}

.cred-row .cr-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--txt)
}

.cred-row .cr-line {
  font-size: 11.5px;
  color: var(--txt-soft);
  font-family: 'Courier New', monospace;
  direction: ltr;
  text-align: start;
  user-select: all
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--txt-faint);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none
}

.copy-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold)
}

.manager-tag {
  font-size: 9.5px;
  background: rgba(215, 165, 61, .2);
  color: var(--gold-bright);
  border-radius: 999px;
  padding: 2px 7px;
  margin-inline-start: 6px;
  font-weight: 700
}

/* --- Admin panel --- */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px
}

.admin-topbar .at-title {
  display: flex;
  align-items: center;
  gap: 10px
}

.admin-topbar .at-title .mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--paper);
  overflow: hidden
}

.admin-topbar .at-title .mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transform: scale(2.05)
}

.admin-topbar h1 {
  font-family: var(--font-disp);
  font-size: 17px;
  margin: 0
}

.role-chip {
  font-size: 10px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  color: var(--txt-soft);
  padding: 3px 9px;
  border-radius: 999px
}

.res-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 7px
}

.res-row .rr-meta {
  flex: 1;
  min-width: 0
}

.res-row .rr-name {
  font-size: 13.5px;
  font-weight: 600
}

.res-row .rr-user {
  font-size: 11px;
  color: var(--txt-faint);
  font-family: 'Courier New', monospace;
  direction: ltr;
  text-align: start
}

.res-row .rr-actions {
  display: flex;
  gap: 6px;
  flex: none
}

.add-row-link {
  text-align: center;
  padding: 11px;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-sm);
  color: var(--txt-soft);
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px
}

.add-row-link:hover {
  border-color: var(--gold);
  color: var(--gold-bright)
}

/* --- Manager overlay form --- */
.form-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 20, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
  padding: 0 22px
}

.form-overlay[hidden] {
  display: none
}

.form-card {
  width: 100%;
  padding: 20px
}

.form-card h3 {
  margin: 0 0 14px;
  font-size: 15.5px;
  font-family: var(--font-disp)
}

/* --- Empty dashboard hero --- */
.empty-dash {
  margin: 14px 18px 0;
  padding: 30px 22px;
  text-align: center
}

.empty-dash .ed-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(215, 165, 61, .12);
  border: 1px solid rgba(215, 165, 61, .3);
  display: grid;
  place-items: center;
  color: var(--gold-bright)
}

.empty-dash h3 {
  margin: 0 0 6px;
  font-size: 16px
}

.empty-dash p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--txt-soft);
  line-height: 1.6
}

/* ===== עדכון מודל ===== */

.update-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.update-modal-content {
  background: #f3efe4;
  border-radius: 20px;
  width: 90%;
  max-width: 340px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

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

.update-modal-header {
  background: linear-gradient(135deg, #2d7a73 0%, #d4941e 100%);
  color: white;
  padding: 20px;
  text-align: center;
}

.update-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  direction: rtl;
}

.update-version {
  margin: 6px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.update-modal-body {
  padding: 20px;
}

.update-changes {
  margin: 0;
  padding: 0;
  padding-right: 16px;
  font-size: 13px;
  color: #333;
  line-height: 1.6;
  list-style-position: inside;
}

.update-changes li {
  margin: 6px 0;
}

.update-modal-actions {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.update-btn-primary {
  background: linear-gradient(180deg, #2d7a73 0%, #1f5048 100%);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  direction: rtl;
}

.update-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 122, 115, 0.3);
}

.update-btn-primary:active {
  transform: translateY(0);
}

.update-btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  direction: rtl;
}

.update-btn-secondary:hover {
  background: #e8e8e8;
}

/* ===== סוף עדכון מודל ===== */

/* ===== ADMIN TABS ===== */
.aa-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.aa-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--txt-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.aa-tab:hover {
  color: var(--txt);
}

.aa-tab.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

/* ===== RESIDENT ACTIONS ===== */
.btn-sm-block,
.btn-sm-remove {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--txt-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-sm-block:hover {
  background: rgba(197, 154, 62, 0.2);
  color: var(--gold-bright);
}

.btn-sm-remove:hover {
  background: rgba(229, 167, 140, 0.2);
  color: #e5a78c;
}

.btn-danger {
  background: #e5a78c;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #d68774;
}

/* ===== END TABS ===== */

/* ===== NATIVE APP ONLY — פינוי סטטוס-בר (WebView מחזיר env()=0) ===== */
html.is-native .screen:not(.login-screen) {
  padding-top: max(env(safe-area-inset-top, 28px), 34px);
}

html.is-native .sub-screen-shell {
  padding-top: max(env(safe-area-inset-top, 28px), 34px);
}

html.is-native .dash-screen {
  padding-top: max(env(safe-area-inset-top, 16px), 34px);
}

html.is-native .tos-screen {
  padding-top: max(env(safe-area-inset-top, 18px), 34px);
}

/* ===== APT MANAGER BADGE ===== */
.mgr-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: 3px;
  margin-inline-start: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(215, 165, 61, .45);
  background: rgba(215, 165, 61, .14);
  color: var(--gold-bright);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.mgr-badge:active {
  background: rgba(215, 165, 61, .28);
}

/* ===== WEB / PWA — התחלה צמודה למעלה, ללא ריווח סטטוס-בר =====
   בדפדפני 2026 (edge-to-edge) env(safe-area-inset-top) אינו 0 —
   לכן בדפדפן אנחנו דורסים כל ריווח עליון. הנייטיב (is-native) לא מושפע. */
html:not(.is-native) .device {
  padding-top: 0;
}

html:not(.is-native) .screen {
  padding-top: 12px;
}

html:not(.is-native) .login-screen {
  padding-top: 20px;
}

html:not(.is-native) .sub-screen-shell {
  padding-top: 16px;
}

html:not(.is-native) .dash-screen {
  padding-top: 12px;
}

html:not(.is-native) .tos-screen {
  padding-top: 12px;
}

html:not(.is-native) .sub-screen {
  padding-top: 20px;
}

html:not(.is-native) .onboarding-screen {
  padding-top: 28px;
}

html:not(.is-native) .setup-screen {
  padding-top: 12px;
}

/* ===== WEB MOBILE: ביטול פער vh/svh — צמוד למעלה ===== */
@media (max-width: 459.98px) {
  html:not(.is-native) body {
    min-height: 100dvh;
    align-items: flex-start;
  }

  html:not(.is-native) .device {
    height: 100dvh;
    max-height: none;
  }
}