/* BoostGrid global styles, shared by every page: base type, app shell and header, bell + notification panel,
   slide panels, alert modal, welcome banner, skeleton and load-error states; load after theme.css */

*{
  box-sizing:border-box;
  -webkit-tap-highlight-color:transparent;
  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
}
/* text people actually need to select/copy stays selectable: form fields, and anything explicitly marked
   selectable */
input, textarea, [contenteditable="true"], .selectable{
  -webkit-user-select:text;
  -moz-user-select:text;
  -ms-user-select:text;
  user-select:text;
}

html,body{
  margin:0; padding:0; height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:'sora', system-ui, sans-serif;
  transition:background .35s var(--ease), color .35s var(--ease);
  overscroll-behavior-y:none;
  -webkit-touch-callout:none;
}

h1,h2,h3{
  font-family:'Space Grotesk', system-ui, sans-serif;
}

.brand-font{
  font-family:'Unbounded', system-ui, sans-serif;
}

.app{
  display:flex;
  flex-direction:column;
  height:100svh;
  max-width:560px;
  margin:0 auto;
  position:relative;
  background:
    radial-gradient(120% 60% at 50% 0%, var(--brand-soft) 0%, transparent 60%),
    var(--bg);
}

/* HEADER */
.app-header{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px 14px;
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(14px);
  background:color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom:1px solid transparent;
}

.brand-mark{
  display:flex;
  align-items:center;
  gap:9px;
}

.brand-mark .dot{
  width:9px; height:9px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow:0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.brand-mark span{
  font-size:19px;
  font-weight:800;
  letter-spacing:-0.02em;
}

.header-title{
  display:flex; align-items:center; gap:9px;
  font-family:'Space Grotesk', sans-serif;
  font-size:18px;
  font-weight:700;
  letter-spacing:-0.01em;
}
.header-title .dot{
  width:9px; height:9px;
  border-radius:50%;
  flex:0 0 auto;
  background:linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow:0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
.header-title span#headerTitleText{
  animation:headerTitleIn .32s var(--spring);
}
@keyframes headerTitleIn{
  from{ opacity:0; transform:translateY(-6px); }
  to{ opacity:1; transform:translateY(0); }
}

.bell-btn{
  position:relative;
  width:40px; height:40px;
  border-radius:50%;
  border:1px solid var(--border);
  background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:transform .35s var(--spring), border-color .2s var(--ease);
}
.bell-btn:active{ transform:scale(.88); }
.bell-btn svg{ width:19px; height:19px; stroke:var(--text); fill:none; }

.bell-btn .ping{
  position:absolute;
  top:8px; right:9px;
  width:7px; height:7px;
  border-radius:50%;
  background:var(--danger);
  box-shadow:0 0 0 2px var(--surface);
}

/* notification panel: expands from the bell (stretches across the app width, then grows down above the bottom
   nav); closing plays in reverse; top/right pinned to the bell's corner */
.notif-overlay{
  position:fixed; inset:0;
  background:rgba(5,16,12,.4);
  backdrop-filter:blur(2px);
  z-index:55;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s var(--ease);
}
.notif-overlay.open{ opacity:1; pointer-events:auto; }

.notif-panel{
  position:fixed;
  top:18px;                              /* .app-header padding-top, lines up with the bell */
  right:max(20px, calc(50% - 260px));    /* bell's right edge inside the 560px .app column */
  width:40px; height:40px;
  border-radius:20px;
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  z-index:56;
  overflow:hidden;
  display:flex; flex-direction:column;
  opacity:0;
  visibility:hidden;
  pointer-events:none;                   /* closed: must never sit invisibly on top of the bell */
  /* closing: height first, then width, then fade */
  transition:
    height .15s var(--ease),
    width .15s var(--ease) .1s,
    opacity .07s linear .21s,
    visibility 0s linear .28s;
}
.notif-panel.open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  width:min(520px, calc(100% - 40px));
  height:min(72vh, calc(100% - 128px));
  border-radius:22px;
  /* opening: width first, then height */
  transition:
    width .16s var(--ease),
    height .22s var(--ease) .12s,
    opacity .06s linear,
    visibility 0s;
}

.notif-head{
  flex:0 0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px 12px;
  border-bottom:1px solid var(--border);
  opacity:0;
  transition:opacity .12s var(--ease);
}
.notif-panel.open .notif-head{ opacity:1; transition:opacity .12s var(--ease) .16s; }
.notif-head h2{ margin:0; font-size:16.5px; }
.notif-close{
  width:30px; height:30px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:var(--surface-2);
  border:1px solid var(--border);
  font-size:17px; line-height:1; color:var(--text-dim);
  cursor:pointer;
  transition:transform .25s var(--spring);
}
.notif-close:active{ transform:scale(.88); }

.notif-body{
  flex:1 1 auto; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:6px 10px 16px;
  opacity:0;
  transition:opacity .12s var(--ease);
}
.notif-panel.open .notif-body{ opacity:1; transition:opacity .14s var(--ease) .2s; }

.notif-item{
  display:flex; gap:12px;
  padding:13px 10px;
  border-radius:14px;
  cursor:pointer;
  transition:background .2s var(--ease);
}
.notif-item:active{ background:var(--surface-2); }
.notif-item .n-icon{
  flex:0 0 auto; width:38px; height:38px; border-radius:11px;
  display:flex; align-items:center; justify-content:center;
  background:var(--brand-soft);
}
.notif-item .n-icon svg{ width:17px; height:17px; stroke:var(--brand-deep); fill:none; stroke-width:2; }
body.dark .notif-item .n-icon svg{ stroke:var(--brand); }
.notif-item .n-text{ flex:1 1 auto; min-width:0; }
.notif-item .n-text b{ display:block; font-size:13.5px; font-weight:700; }
.notif-item .n-text span{ display:block; font-size:12px; color:var(--text-dim); margin-top:2px; line-height:1.4; }
.notif-item .n-time{ flex:0 0 auto; font-size:10.5px; color:var(--text-dim); padding-top:2px; }
.notif-item.unread .n-icon{ background:linear-gradient(135deg, var(--brand), var(--brand-deep)); }
.notif-item.unread .n-icon svg{ stroke:#04140d; }

.notif-empty{
  text-align:center; color:var(--text-dim); font-size:13.5px;
  padding:50px 20px;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

::-webkit-scrollbar{ display:none; }

/* Deposit history slide-in panel */
.slide-panel{
  position:fixed;
  top:0; right:0;
  height:100%;
  width:min(86%, 420px);
  background:var(--surface);
  border-left:1px solid var(--border);
  box-shadow:-14px 0 34px rgba(13,31,23,.14);
  z-index:60;
  transform:translateX(100%);
  transition:transform .38s var(--ease);
  display:flex;
  flex-direction:column;
}
.slide-panel.open{ transform:translateX(0); }

.panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:20px 20px 14px;
  border-bottom:1px solid var(--border);
  flex:0 0 auto;
}
.panel-header h2{
  font-size:17px;
  margin:0;
}

.panel-overlay{
  position:fixed;
  inset:0;
  background:rgba(5,16,12,.4);
  backdrop-filter:blur(2px);
  z-index:55;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s var(--ease);
}
.panel-overlay.open{
  opacity:1;
  pointer-events:auto;
}

/* Alert modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(5,16,12,.45);
  backdrop-filter:blur(3px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:80;
  padding:24px;
}
.modal-content{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:26px 22px 20px;
  width:100%;
  max-width:320px;
  box-shadow:var(--shadow);
  text-align:center;
}
.modal-message{
  font-size:14.5px;
  line-height:1.55;
  color:var(--text);
  margin-bottom:18px;
}
.modal-buttons button{
  width:100%;
  border:none;
  border-radius:var(--radius-sm);
  padding:12px;
  font-family:'Space Grotesk', sans-serif;
  font-weight:700;
  font-size:14px;
  color:#04140d;
  background:linear-gradient(135deg, var(--brand), var(--brand-deep));
  cursor:pointer;
  transition:transform .28s var(--spring);
}
.modal-buttons button:active{ transform:scale(.96); }
/* BANNER (reusable, sits in the middle of the screen) */
.bn-layer{
  position:fixed;
  inset:0;
  z-index:70;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.bn-layer.show{ display:flex; }

.bn-scrim{
  position:absolute;
  inset:0;
  background:rgba(5,16,12,.34);
  backdrop-filter:blur(2px);
  opacity:0;
  transition:opacity .3s var(--ease);
}

.bn-card{
  --bn-tone:var(--brand-deep);
  position:relative;
  width:100%;
  max-width:400px;
  max-height:calc(100svh - 48px);
  overflow-y:auto;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow), 0 30px 60px -20px rgba(5,16,12,.45);
  opacity:0;
  transform:translateY(22px) scale(.94);
  transition:opacity .22s var(--ease), transform .42s var(--spring);
}
.bn-card:focus{ outline:none; }

.bn-layer.in .bn-scrim{ opacity:1; }
.bn-layer.in .bn-card{ opacity:1; transform:none; }
.bn-layer:not(.in) .bn-card{
  transition:opacity .18s var(--ease), transform .2s var(--ease);
}

/* hero: big type on the brand gradient, or a promo image */
.bn-hero{
  position:relative;
  min-height:176px;
  padding:56px 24px 22px;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
  color:#04140d;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.35) 0%, transparent 45%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
}
.bn-hero::before,
.bn-hero::after{
  content:"";
  position:absolute;
  z-index:1;
  border-radius:50%;
  pointer-events:none;
}
.bn-hero::before{
  width:210px; height:210px;
  right:-64px; top:-96px;
  border:28px solid rgba(255,255,255,.16);
}
.bn-hero::after{
  width:110px; height:110px;
  right:64px; bottom:-58px;
  background:rgba(255,255,255,.14);
}

.bn-hero.has-image{
  min-height:224px;
  color:#fff;
  background:var(--brand-deep);
}
.bn-hero.has-image::before{
  inset:0;
  width:auto; height:auto;
  border:0;
  border-radius:0;
  background:linear-gradient(to top, rgba(4,20,13,.84) 0%, rgba(4,20,13,.1) 72%);
}
.bn-hero.has-image::after{ display:none; }

.bn-img{
  position:absolute;
  inset:0;
  width:100%; height:100%;
  object-fit:cover;
  z-index:0;
}

.bn-hero-copy{
  position:relative;
  z-index:2;
}

.bn-eyebrow{
  font-size:13px;
  font-weight:600;
  opacity:.75;
  margin:0 0 8px;
}

.bn-title{
  font-family:'Unbounded', system-ui, sans-serif;
  font-size:26px;
  font-weight:700;
  line-height:1.15;
  letter-spacing:-0.02em;
  margin:0;
  text-wrap:balance;
}

.bn-body{ padding:20px 22px 22px; }

.bn-text{
  margin:0;
  font-size:14.5px;
  line-height:1.55;
  color:var(--text);
}

.bn-notes{
  list-style:none;
  margin:16px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.bn-notes li{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:13px;
  line-height:1.5;
  color:var(--text-dim);
}
.bn-tick{
  flex:0 0 auto;
  width:20px; height:20px;
  border-radius:50%;
  background:var(--brand-soft);
  display:flex; align-items:center; justify-content:center;
}
.bn-tick svg{
  width:11px; height:11px;
  stroke:var(--brand-deep);
  fill:none;
  stroke-width:3;
  stroke-linecap:round;
  stroke-linejoin:round;
}
body.dark .bn-tick svg{ stroke:var(--brand); }

.bn-actions{
  display:flex;
  gap:10px;
  margin-top:20px;
}
.bn-actions.stack{ flex-direction:column; }

.bn-btn{
  flex:1;
  border:1px solid transparent;
  border-radius:var(--radius-sm);
  padding:13px 10px;
  font-family:'Space Grotesk', sans-serif;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:transform .28s var(--spring);
}
.bn-btn:active{ transform:scale(.96); }
.bn-btn.primary{
  color:#04140d;
  background:linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow:0 10px 24px -8px color-mix(in srgb, var(--brand) 55%, transparent);
}
.bn-btn.ghost{
  color:var(--text);
  background:var(--surface-2);
  border-color:var(--border-strong);
}

.bn-close{
  position:absolute;
  top:14px; right:14px;
  z-index:3;
  width:32px; height:32px;
  padding:0;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.35);
  background:rgba(4,20,13,.32);
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  backdrop-filter:blur(6px);
  transition:transform .25s var(--spring);
}
.bn-close:active{ transform:scale(.88); }
.bn-close svg{
  width:14px; height:14px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.4;
  stroke-linecap:round;
}

.bn-btn:focus-visible,
.bn-close:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
}

/* alert / note style: header line + short notes, no hero */
.bn-card.alert{ border-top:3px solid var(--bn-tone); }
.bn-card.tone-warning{ --bn-tone:#d8a81a; }
.bn-card.tone-danger{ --bn-tone:var(--danger); }

.bn-head{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:22px 56px 0 22px;
}
.bn-head-icon{
  flex:0 0 auto;
  width:40px; height:40px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--bn-tone) 16%, transparent);
}
.bn-head-icon svg{
  width:20px; height:20px;
  stroke:var(--bn-tone);
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.bn-card.alert .bn-eyebrow{ color:var(--text-dim); opacity:1; margin-bottom:3px; }
.bn-card.alert .bn-title{
  font-family:'Space Grotesk', system-ui, sans-serif;
  font-size:18px;
  letter-spacing:-0.01em;
  line-height:1.25;
  padding-top:2px;
}
.bn-card.alert .bn-body{ padding-top:14px; }
.bn-card.alert .bn-tick{
  width:6px; height:6px;
  margin:7px 7px 0 7px;
  background:var(--bn-tone);
}
.bn-card.alert .bn-tick svg{ display:none; }
.bn-card.alert .bn-close{
  background:var(--surface-2);
  border-color:var(--border);
  color:var(--text-dim);
  backdrop-filter:none;
}

@media (prefers-reduced-motion: reduce){
  .bn-scrim, .bn-card{ transition:none !important; }
}

/* BANNER responsive sizing */
@media (max-width:400px){
  .bn-layer{ padding:0; align-items:flex-end; }
  .bn-card{
    max-width:none;
    width:100%;
    max-height:92svh;
    border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  }
  .bn-hero{ min-height:150px; padding:44px 20px 18px; }
  .bn-hero.has-image{ min-height:190px; }
  .bn-title{ font-size:22px; }
  .bn-body{ padding:18px 18px 20px; }
}

@media (min-width:1024px){
  .bn-card{ max-width:460px; }
  .bn-hero{ min-height:196px; padding:60px 26px 24px; }
  .bn-hero.has-image{ min-height:248px; }
  .bn-title{ font-size:28px; }
  .bn-body{ padding:22px 24px 24px; }
}

@media (min-width:1300px){
  .bn-card{ max-width:520px; }
  .bn-hero{ min-height:216px; padding:64px 30px 26px; }
  .bn-hero.has-image{ min-height:268px; }
  .bn-title{ font-size:30px; }
  .bn-body{ padding:24px 28px 26px; }
}

/* Skeleton loaders */
.sk{
  --sk-base:color-mix(in srgb, var(--text) 9%, transparent);
  --sk-hi:color-mix(in srgb, var(--text) 17%, transparent);
  display:block;
  position:relative;
  overflow:hidden;
  border-radius:8px;
  background:var(--sk-base);
  color:transparent !important;
  -webkit-text-fill-color:transparent;
  pointer-events:none;
}
.sk::after{
  content:"";
  position:absolute; inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, var(--sk-hi), transparent);
  animation:skSweep 1.3s ease-in-out infinite;
}
@keyframes skSweep{ to{ transform:translateX(100%); } }
.sk-inline{ display:inline-block; vertical-align:baseline; }
 /* the balance number */
.sk-fit{ width:fit-content; }

/* real content arriving */
@keyframes skIn{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
@keyframes skFade{ from{ opacity:0; } to{ opacity:1; } }
.sk-in{ animation:skIn .45s var(--ease) both; animation-delay:calc(var(--i, 0) * 60ms); }
.sk-fade{ animation:skFade .4s var(--ease) both; }

/* notification row skeleton */
.notif-item.sk-row{ pointer-events:none; }
.sk-row .sk-ico{ flex:0 0 auto; width:38px; height:38px; border-radius:11px; }
.sk-row .sk-t{ width:52%; height:13px; }
.sk-row .sk-l1{ width:92%; height:11px; margin-top:8px; }
.sk-row .sk-l2{ width:64%; height:11px; margin-top:6px; }
.sk-row .sk-time{ flex:0 0 auto; width:22px; height:10px; margin-top:3px; }
@media (prefers-reduced-motion: reduce){
  .sk::after, .sk-in, .sk-fade{ animation:none; }
}
/* Load error state */
.ld-error{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  text-align:center;
  padding:26px 22px 24px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  animation:skIn .45s var(--ease) both;
}
.ld-error.compact{ background:none; border:none; box-shadow:none; padding:44px 20px 30px; }
.ld-error-ico{
  width:46px; height:46px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--danger) 14%, transparent);
}
.ld-error-ico svg{ width:22px; height:22px; stroke:var(--danger); fill:none; stroke-width:2; }
.ld-error-title{
  font-family:'Space Grotesk', sans-serif;
  font-size:15px; font-weight:700; color:var(--text);
  margin-top:4px;
}
.ld-error-text{ font-size:12.5px; line-height:1.5; color:var(--text-dim); max-width:250px; }
.ld-retry{
  margin-top:8px;
  display:inline-flex; align-items:center; gap:7px;
  padding:10px 18px;
  border:none; border-radius:999px; cursor:pointer;
  font-family:'Space Grotesk', sans-serif; font-size:13px; font-weight:700;
  color:#04140d;
  background:linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow:0 8px 20px -8px color-mix(in srgb, var(--brand) 60%, transparent);
  transition:transform .28s var(--spring);
}
.ld-retry svg{ width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round; }
.ld-retry:active{ transform:scale(.94); }
.ld-retry:focus-visible, .ld-mini:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }
.ld-error-hint{ margin-top:6px; font-size:11.5px; color:var(--text-dim); }
.ld-error-hint a{ color:var(--brand-deep); font-weight:600; text-decoration:none; }
body.dark .ld-error-hint a{ color:var(--brand); }

/* small round retry button that sits next to a single value (the balance) */
.ld-mini{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; padding:0; margin-left:10px;
  vertical-align:middle;
  border-radius:50%; cursor:pointer;
  border:1px solid var(--border-strong);
  background:var(--surface-2);
  color:var(--text);
  transition:transform .28s var(--spring);
}
.ld-mini svg{ width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round; }
.ld-mini:active{ transform:scale(.88) rotate(-40deg); }

@media (prefers-reduced-motion: reduce){ .ld-error{ animation:none; } }

/* mobile gestures: swipe right closes an open panel, swipe left/right changes tab; pan-y leaves horizontal
   movement to the page script */
.app-main, .cr-panel, .slide-panel{ touch-action:pan-y; overscroll-behavior-x:contain; }
.chip-row, .td-shots{ touch-action:pan-x pan-y; }
.cr-panel.gesture-drag, .slide-panel.gesture-drag{ transition:none !important; }

@keyframes tabInFromRight{ from{ opacity:0; transform:translateX(28px); } to{ opacity:1; transform:none; } }
@keyframes tabInFromLeft{  from{ opacity:0; transform:translateX(-28px); } to{ opacity:1; transform:none; } }
.tab.swipe-next{ animation:tabInFromRight .3s var(--ease); }
.tab.swipe-prev{ animation:tabInFromLeft .3s var(--ease); }
@media (prefers-reduced-motion: reduce){
  .tab.swipe-next, .tab.swipe-prev{ animation:none; }
}
