/* —— Desktop / web view for /app: full-page web app —— */
@media (min-width: 960px) {
  body.app-body {
    background:
      radial-gradient(1100px 600px at 100% -10%, rgba(0, 174, 239, 0.10), transparent 60%),
      radial-gradient(800px 500px at 30% 110%, rgba(0, 126, 182, 0.08), transparent 60%),
      #f3f6f9;
    min-height: 100vh;
  }

  .app-web {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Sidebar */
  .app-web-aside {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.6rem 1.1rem 1.4rem;
    color: #e8f2f9;
    overflow: hidden;
    background:
      radial-gradient(420px 320px at 0% 0%, rgba(0, 174, 239, 0.22), transparent 60%),
      radial-gradient(360px 300px at 100% 100%, rgba(0, 126, 182, 0.35), transparent 60%),
      linear-gradient(175deg, #001c30 0%, #00395d 55%, #002640 100%);
    animation: slideInLeft 560ms var(--ease) both;
  }
  .app-web-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
    pointer-events: none;
  }
  .app-web-aside > * { position: relative; z-index: 1; }
  .aside-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.045em;
    color: #fff;
    padding: 0 0.6rem;
  }
  .aside-brand span { color: #7fd6f7; }

  .aside-nav { display: grid; gap: 0.25rem; }
  .aside-nav a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.78rem 0.85rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.94rem;
    color: rgba(232, 245, 242, 0.72);
    position: relative;
    transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
    animation: rise 480ms var(--ease) both;
  }
  .aside-nav a:nth-child(1) { animation-delay: 60ms; }
  .aside-nav a:nth-child(2) { animation-delay: 100ms; }
  .aside-nav a:nth-child(3) { animation-delay: 140ms; }
  .aside-nav a:nth-child(4) { animation-delay: 180ms; }
  .aside-nav a:nth-child(5) { animation-delay: 220ms; }
  .aside-nav a:nth-child(6) { animation-delay: 260ms; }
  .aside-nav a:nth-child(7) { animation-delay: 300ms; }
  .aside-nav svg { width: 20px; height: 20px; flex-shrink: 0; }
  .aside-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    transform: translateX(3px);
  }
  .aside-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(0, 174, 239, 0.22), rgba(0, 174, 239, 0.06));
    box-shadow: inset 0 0 0 1px rgba(127, 214, 247, 0.22);
  }
  .aside-nav a.active::before {
    content: "";
    position: absolute;
    left: -1.1rem;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #7fd6f7;
    box-shadow: 0 0 14px rgba(127, 214, 247, 0.8);
  }

  .aside-status {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .aside-status strong { display: block; font-size: 0.88rem; color: #fff; }
  .aside-status span:not(.status-dot) { font-size: 0.76rem; color: rgba(232, 245, 242, 0.6); }
  .aside-links { display: flex; gap: 1rem; padding: 0 0.6rem; }
  .aside-links a {
    font-size: 0.82rem;
    font-weight: 600;
    color: #b3e6fa;
    opacity: 0.85;
  }
  .aside-links a:hover { opacity: 1; color: #fff; }

  /* Main canvas */
  .app-device {
    width: 100%;
    min-width: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
  }
  .app-device::before { display: none; }

  .app-shell {
    width: 100%;
    max-width: 1120px;
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 2.25rem clamp(1.75rem, 3.5vw, 3.25rem) 3rem;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
  }
  .bottom-nav { display: none; }

  /* Home header → hero banner */
  .app-header {
    border-radius: 24px;
    padding: 2rem 2.1rem 3.6rem;
    background:
      radial-gradient(500px 260px at 85% 0%, rgba(127, 214, 247, 0.35), transparent 60%),
      linear-gradient(135deg, #007eb6 0%, #005a8c 50%, #00395d 100%);
    background-size: 160% 160%;
    animation: rise 520ms var(--ease) both, heroPan 14s ease-in-out infinite alternate;
    box-shadow: 0 24px 60px rgba(0, 126, 182, 0.25);
  }
  .app-header::after {
    width: 340px;
    height: 340px;
    right: -80px;
    top: -120px;
    animation: orbFloat 9s var(--ease) infinite alternate;
  }
  .app-greet .eyebrow { font-size: 0.85rem; }
  .app-greet strong { font-size: clamp(1.7rem, 2.6vw, 2.3rem); }
  .app-avatar { width: 52px; height: 52px; font-size: 1.15rem; }

  .app-balance-card {
    margin: -2.2rem 1.6rem 0;
    padding: 1.4rem 1.6rem;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
  }
  .app-balance-card .amount-xl { font-size: 2rem !important; }

  .app-section { padding: 2rem 0 0; }
  .app-section-title strong { font-size: 1.15rem; }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
  .quick-action {
    grid-auto-flow: row;
    justify-items: start;
    text-align: left;
    gap: 0.9rem;
    padding: 1.3rem 1.3rem 1.2rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), border-color 220ms var(--ease);
  }
  .quick-action:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 126, 182, 0.25);
    box-shadow: 0 18px 40px rgba(0, 126, 182, 0.14);
  }
  .quick-action .ico {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #e5f4fb;
    color: var(--teal);
    box-shadow: none;
  }
  .quick-action:hover .ico { transform: scale(1.06) rotate(-3deg); box-shadow: none; }
  .quick-action.primary {
    background: linear-gradient(145deg, #00aeef, #007eb6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 34px rgba(0, 126, 182, 0.3);
  }
  .quick-action.primary .ico { background: rgba(255, 255, 255, 0.18); color: #fff; }

  .app-card {
    border-radius: 20px;
    padding: 1.3rem 1.45rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.05);
    animation: rise 520ms var(--ease) 160ms both;
  }
  .txn {
    padding: 0.95rem 0.5rem;
    border-radius: 12px;
    transition: background 180ms var(--ease);
  }
  .txn:hover { background: #f5f8fb; }

  /* Inner pages */
  .app-page-head {
    padding: 0 0 1.4rem;
    gap: 1rem;
    animation: rise 480ms var(--ease) both;
  }
  .app-page-head h1 { font-size: clamp(1.7rem, 2.4vw, 2.2rem); }
  .app-back {
    width: 44px;
    height: 44px;
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
  }
  .app-back:hover { transform: translateX(-3px); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12); }
  .app-page-body {
    padding: 0;
    max-width: 760px;
  }
  .app-page-body > * { animation: rise 520ms var(--ease) both; }
  .app-page-body > *:nth-child(2) { animation-delay: 70ms; }
  .app-page-body > *:nth-child(3) { animation-delay: 140ms; }
  .app-page-body > *:nth-child(4) { animation-delay: 210ms; }

  .pay-amount-wrap {
    padding: 2rem 1.5rem 1.6rem;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.05);
  }
  .fab-pay { position: static; background: none; padding: 1.1rem 0 0; }
  .fab-pay .btn { max-width: 320px; }

  /* Profile */
  .profile-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.25rem;
    align-items: center;
    text-align: left;
    padding: 1.8rem 2rem;
    margin-bottom: 1.5rem;
    border-radius: 24px;
    color: #fff;
    background:
      radial-gradient(420px 220px at 90% 0%, rgba(127, 214, 247, 0.3), transparent 60%),
      linear-gradient(135deg, #007eb6, #00395d);
    box-shadow: 0 20px 50px rgba(0, 126, 182, 0.22);
    animation: rise 520ms var(--ease) both;
  }
  .profile-hero .big-avatar {
    grid-row: span 2;
    margin: 0;
    width: 76px;
    height: 76px;
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.4);
  }
  .profile-hero h1 { color: #fff; font-size: 1.7rem !important; }
  .profile-hero p { color: rgba(255, 255, 255, 0.78) !important; }
  .profile-hero + .app-page-body {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.25rem;
    max-width: none;
    align-items: start;
  }
  .profile-hero + .app-page-body > #msg { grid-column: 1 / -1; }
  .profile-hero + .app-page-body > .app-card { margin: 0 !important; }

  .settings-list a,
  .settings-list button { transition: background 180ms var(--ease), padding 180ms var(--ease); border-radius: 12px; }
  .settings-list a:hover,
  .settings-list button:hover { background: #f5f8fb; padding-left: 0.6rem; }
}

@media (min-width: 1400px) {
  .app-web { grid-template-columns: 300px minmax(0, 1fr); }
  .app-shell { padding-left: 4rem; padding-right: 4rem; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroPan {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
