/* Dashboard 2 layout (ported from dashbord2.css) for the Laravel admin dashboard.
   Everything is scoped by d2- class names; .d2-page resets spacing like the React app's global reset. */
.d2-page, .d2-page * { box-sizing: border-box; }
.d2-page * { margin: 0; padding: 0; }
.d2-page {
  --d2-bg-app: #f2f4f7; --d2-bg-surface: #f7f8fa; --d2-card-white: #ffffff;
  --d2-color-dark: #121316; --d2-color-dark-subtle: #1e2025; --d2-color-gray: #7c828d;
  --d2-color-gray-light: #f0f2f5; --d2-color-border: #e6e8ed;
  --d2-color-pink-orange: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  --d2-color-peach-light: linear-gradient(135deg, #fce7f3 0%, #ffedd5 100%);
  --d2-color-green: #22c55e; --d2-color-red: #ef4444; --d2-color-yellow: #f59e0b;
  --d2-shadow-card: 0 4px 18px rgba(0, 0, 0, 0.03);
  --d2-font-main: 'Plus Jakarta Sans', 'Inter', sans-serif;
  display: flex; flex-direction: column; gap: 12px; font-family: var(--d2-font-main); color: var(--d2-color-dark); line-height: 1.4;
}
.d2-page a { text-decoration: none; }
/* links take their colour from the d2- class they carry; theme.css must not recolour them (also on hover) */
.d2-page a:not([class]) { color: inherit; }
.d2-page .d2-btn-sell, .d2-page .d2-btn-sell:hover { color: #ffffff; }
.d2-page .d2-btn-buy, .d2-page .d2-btn-buy:hover, .d2-page .d2-banner-btn, .d2-page .d2-banner-btn:hover, .d2-page .d2-filter-pill, .d2-page .d2-filter-pill:hover { color: var(--d2-color-dark); }
.d2-page .d2-card-feature, .d2-page .d2-card-feature:hover { color: var(--d2-color-dark); }
.d2-page .d2-balance-action-btn, .d2-page .d2-balance-action-btn:hover { color: #ffffff; }
.d2-page table { border-collapse: collapse; }
.d2-row-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr;
  gap: 10px;
  flex-shrink: 0;
}

.d2-card-feature {
  background: var(--d2-card-white);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: var(--d2-shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 85px;
  box-sizing: border-box;
}

.d2-feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.d2-feature-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--d2-color-dark);
  margin: 0;
}

.d2-feature-title span {
  font-weight: 400;
  color: var(--d2-color-gray);
}

.d2-feature-icon {
  color: #8c919d;
}

.d2-pill-badge {
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 14px;
  background: #f4f5f8;
  font-size: 11px;
  font-weight: 700;
  color: var(--d2-color-dark);
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.d2-pill-badge:hover {
  background: #e8ecf2;
}

/* Banner Card (Retire on your terms) */
.d2-card-banner {
  background: var(--d2-color-pink-orange);
  border-radius: 20px;
  padding: 14px 18px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 85px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(244, 63, 94, 0.25);
  box-sizing: border-box;
}

.d2-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.d2-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.d2-banner-title span {
  font-weight: 400;
  opacity: 0.9;
}

.d2-banner-clock {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.d2-banner-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 2;
  margin-top: 8px;
}

.d2-banner-btn {
  background: #ffffff;
  color: var(--d2-color-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.d2-banner-btn:hover {
  transform: scale(1.05);
}

/* Soundwave Equalizer Graphic */
.d2-soundwave-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.d2-wave-bar {
  width: 2px;
  background: #ffffff;
  border-radius: 2px;
  opacity: 0.85;
}

/* ==========================================================================
   ROW 2: MIDDLE SECTION (3 COLUMNS)
   ========================================================================== */
.d2-row-middle {
  display: grid;
  grid-template-columns: 1.15fr 1.6fr 1.35fr;
  gap: 10px;
  flex: 1;
  min-height: 215px;
}

/* Column 1: Current Price / Stock Ticker */
.d2-card-stock {
  background: var(--d2-card-white);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--d2-shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.d2-stock-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.d2-stock-label {
  font-size: 11px;
  color: var(--d2-color-gray);
  margin: 0;
}

.d2-stock-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--d2-color-dark);
  margin: 2px 0 0;
  letter-spacing: -0.4px;
}

.d2-stock-flag-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e5eb;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--d2-color-dark);
  cursor: pointer;
}

.d2-stock-stats-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
  border-top: 1px solid #f2f4f7;
  border-bottom: 1px solid #f2f4f7;
  padding: 10px 0;
}

.d2-stat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.d2-stat-divider-v {
  width: 1px;
  height: 46px;
  background: #f0f2f5;
  margin: 0 14px;
}

.d2-stat-item {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.d2-stat-key {
  color: var(--d2-color-gray);
}

.d2-stat-val {
  font-weight: 700;
  color: var(--d2-color-dark);
}

.d2-stock-actions {
  display: flex;
  gap: 10px;
}

.d2-btn-sell {
  flex: 1;
  background: var(--d2-color-dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 0;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.d2-btn-sell:hover {
  background: #252830;
}

.d2-btn-buy {
  flex: 1;
  background: #f4f5f8;
  color: var(--d2-color-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 0;
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.d2-btn-buy:hover {
  background: #e8ecf2;
}

/* Column 2: Active Users Stepped Area Graph */
.d2-card-chart {
  background: var(--d2-card-white);
  border-radius: 22px;
  padding: 16px 18px 12px;
  box-shadow: var(--d2-shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-sizing: border-box;
}

.d2-chart-header {
  display: flex;
  flex-direction: column;
}

.d2-chart-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--d2-color-dark);
  margin: 0;
}

.d2-chart-subtitle {
  font-size: 11px;
  color: var(--d2-color-gray);
  margin-top: 2px;
}

.d2-chart-body {
  position: relative;
  height: 125px;
  display: flex;
  align-items: flex-end;
  margin-top: 8px;
}

.d2-chart-y-axis {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  color: #a0a6b2;
  padding-bottom: 22px;
  box-sizing: border-box;
}

.d2-chart-svg-area {
  margin-left: 28px;
  width: calc(100% - 28px);
  height: 100%;
  position: relative;
}

.d2-chart-days-row {
  display: flex;
  justify-content: space-between;
  margin-left: 28px;
  padding-top: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #8c919d;
}

.d2-day-label {
  padding: 3px 8px;
  border-radius: 12px;
}

.d2-day-label.active {
  background: var(--d2-color-dark);
  color: #ffffff;
  font-weight: 700;
}

/* Column 3: 2x2 Metrics Grid */
.d2-metrics-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.d2-metric-tile {
  background: var(--d2-card-white);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--d2-shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.d2-metric-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.d2-metric-label {
  font-size: 11px;
  color: var(--d2-color-gray);
  margin: 0;
}

.d2-metric-badge {
  align-self: flex-start;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.d2-badge-orange-red {
  background: #ff5722;
  color: #ffffff;
}

.d2-badge-magenta {
  background: #e11d48;
  color: #ffffff;
}

.d2-metric-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--d2-color-dark);
  margin: 0;
}

/* ==========================================================================
   ROW 3: BOTTOM SECTION (TRANSACTIONS & WALLET)
   ========================================================================== */
.d2-row-bottom {
  display: grid;
  grid-template-columns: 2.75fr 1.35fr;
  gap: 10px;
  flex: 1.15;
  min-height: 200px;
}

/* Recent Transactions Table Card */
.d2-card-transactions {
  background: var(--d2-card-white);
  border-radius: 22px;
  padding: 16px 18px 12px;
  box-shadow: var(--d2-shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.d2-tx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.d2-tx-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--d2-color-dark);
  margin: 0;
}

.d2-tx-controls {
  display: flex;
  gap: 8px;
}

.d2-filter-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e5eb;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--d2-color-dark);
  cursor: pointer;
}

.d2-tx-table {
  width: 100%;
  border-collapse: collapse;
}

.d2-tx-table th {
  font-size: 10px;
  font-weight: 600;
  color: #8c919d;
  text-align: left;
  padding-bottom: 6px;
  border-bottom: 1px solid #f2f4f7;
}

.d2-tx-table td {
  padding: 7px 0;
  font-size: 11px;
  color: var(--d2-color-dark);
  border-bottom: 1px solid #f7f8fa;
}

.d2-tx-table tr:last-child td {
  border-bottom: none;
}

/* Checkbox */
.d2-checkbox {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid #cbd0dc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s;
}

.d2-checkbox.checked {
  background: var(--d2-color-dark);
  border-color: var(--d2-color-dark);
  color: #ffffff;
}

.d2-activity-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.d2-activity-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.d2-activity-icon.apple { background: #38bdf8; color: #fff; }
.d2-activity-icon.concert { background: #f87171; color: #fff; }
.d2-activity-icon.grocery { background: #4ade80; color: #fff; }
.d2-activity-icon.software { background: #facc15; color: #fff; }

.d2-date-subtext {
  font-size: 9px;
  color: #8c919d;
  display: block;
}

.d2-status-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.d2-status-tag.failed {
  background: #fef2f2;
  color: #ef4444;
}

.d2-status-tag.success {
  background: #f0fdf4;
  color: #22c55e;
}

.d2-status-tag.pending {
  background: #fffbeb;
  color: #f59e0b;
}

/* Right Stacked Column: Your Balance & Investment Banner */
.d2-col-wallet {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Dark Balance Card */
.d2-card-balance {
  background: #141518;
  border-radius: 22px;
  padding: 16px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  flex: 1.3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.d2-balance-watermark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 90px;
  height: 90px;
  opacity: 0.15;
  pointer-events: none;
}

.d2-balance-label {
  font-size: 11px;
  color: #9ba0aa;
  margin: 0;
  z-index: 2;
}

.d2-balance-amount {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 2px 0 10px;
  letter-spacing: -0.4px;
  z-index: 2;
}

.d2-balance-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.d2-balance-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.d2-action-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #252830;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.2s, background 0.2s;
}

.d2-action-circle.highlight {
  background: #ffe4e6;
  color: #e11d48;
}

.d2-balance-action-btn:hover .d2-action-circle {
  transform: translateY(-2px);
}

.d2-action-label {
  font-size: 9px;
  color: #9ba0aa;
  font-weight: 600;
}

/* Investment Summary Banner (Pastel Pink/Peach) */
.d2-card-invest-summary {
  background: var(--d2-color-peach-light);
  border-radius: 20px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 0.7;
  box-shadow: var(--d2-shadow-card);
  box-sizing: border-box;
}

.d2-invest-summary-text {
  font-size: 12px;
  color: var(--d2-color-dark);
  margin: 0;
}

.d2-invest-summary-text strong {
  font-size: 17px;
  font-weight: 800;
}

.d2-invest-summary-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--d2-color-dark);
  margin-top: 1px;
}

/* Page-flow adjustments (the React app fixed everything to one 100vh screen) */
.d2-page .d2-row-middle, .d2-page .d2-row-bottom { flex: none; }
.d2-page .d2-row-middle { min-height: 240px; }
.d2-page .d2-card-chart svg { width: 100%; height: 100%; }
.d2-page .d2-chart-svg-area { position: relative; }
.d2-page .d2-pill-badge, .d2-page .d2-banner-btn, .d2-page .d2-btn-sell, .d2-page .d2-btn-buy { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.d2-page .d2-tx-table { width: 100%; }
@media (max-width: 1199px) {
  .d2-page .d2-row-top { grid-template-columns: 1fr 1fr; }
  .d2-page .d2-row-middle, .d2-page .d2-row-bottom { grid-template-columns: 1fr; }
}

/* ---------- Load animations ---------- */
@keyframes d2-rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes d2-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes d2-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes d2-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes d2-pop { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.35); opacity: 1; } 100% { transform: scale(1); } }

.d2-page .d2-card-feature, .d2-page .d2-card-banner, .d2-page .d2-card-stock, .d2-page .d2-card-chart,
.d2-page .d2-metric-tile, .d2-page .d2-card-transactions, .d2-page .d2-card-balance, .d2-page .d2-card-invest-summary {
  animation: d2-rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.d2-page .d2-row-top > :nth-child(1) { animation-delay: .05s; }
.d2-page .d2-row-top > :nth-child(2) { animation-delay: .12s; }
.d2-page .d2-row-top > :nth-child(3) { animation-delay: .19s; }
.d2-page .d2-row-top > :nth-child(4) { animation-delay: .26s; }
.d2-page .d2-row-middle > :nth-child(1) { animation-delay: .3s; }
.d2-page .d2-row-middle > :nth-child(2) { animation-delay: .38s; }
.d2-page .d2-metric-tile:nth-child(1) { animation-delay: .44s; }
.d2-page .d2-metric-tile:nth-child(2) { animation-delay: .5s; }
.d2-page .d2-metric-tile:nth-child(3) { animation-delay: .56s; }
.d2-page .d2-metric-tile:nth-child(4) { animation-delay: .62s; }
.d2-page .d2-row-bottom > :nth-child(1) { animation-delay: .5s; }
.d2-page .d2-col-wallet > :nth-child(1) { animation-delay: .58s; }
.d2-page .d2-col-wallet > :nth-child(2) { animation-delay: .68s; }

/* chart: line draws itself, then the peak glow, dot, tooltip and month labels appear */
.d2-page .d2-card-chart path[data-draw] { stroke-dasharray: 1; stroke-dashoffset: 1; animation: d2-draw 1.8s .55s cubic-bezier(.4, .1, .2, 1) forwards; }
.d2-page .d2-card-chart [data-peak] { opacity: 0; animation: d2-fade .6s 2.1s ease forwards; }
.d2-page .d2-card-chart circle[data-peak] { transform-box: fill-box; transform-origin: center; animation: d2-pop .5s 2.1s ease forwards; }
.d2-page .d2-card-chart .d2-peak-tip { opacity: 0; animation: d2-fade .5s 2.3s ease forwards; }
.d2-page .d2-day-label { opacity: 0; animation: d2-fade .5s ease forwards; }
.d2-page .d2-day-label:nth-child(1) { animation-delay: .7s; } .d2-page .d2-day-label:nth-child(2) { animation-delay: .78s; }
.d2-page .d2-day-label:nth-child(3) { animation-delay: .86s; } .d2-page .d2-day-label:nth-child(4) { animation-delay: .94s; }
.d2-page .d2-day-label:nth-child(5) { animation-delay: 1.02s; } .d2-page .d2-day-label:nth-child(6) { animation-delay: 1.1s; }
.d2-page .d2-day-label:nth-child(7) { animation-delay: 1.18s; } .d2-page .d2-day-label:nth-child(8) { animation-delay: 1.26s; }
.d2-page .d2-day-label:nth-child(9) { animation-delay: 1.34s; } .d2-page .d2-day-label:nth-child(10) { animation-delay: 1.42s; }
.d2-page .d2-day-label:nth-child(11) { animation-delay: 1.5s; } .d2-page .d2-day-label:nth-child(12) { animation-delay: 1.58s; }

/* banner sound-wave bars rise one after another, then breathe */
@keyframes d2-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.72); } }
.d2-page .d2-wave-bar { transform-origin: bottom; animation: d2-grow-y .6s cubic-bezier(.2, .8, .2, 1) both, d2-breathe 2.4s 1.4s ease-in-out infinite; }
.d2-page .d2-wave-bar:nth-child(odd) { animation-duration: .6s, 2.1s; }
.d2-page .d2-wave-bar:nth-child(3n) { animation-duration: .6s, 2.8s; }
.d2-page .d2-tx-table tbody tr { animation: d2-fade .5s ease both; }
.d2-page .d2-tx-table tbody tr:nth-child(1) { animation-delay: .8s; } .d2-page .d2-tx-table tbody tr:nth-child(2) { animation-delay: .9s; }
.d2-page .d2-tx-table tbody tr:nth-child(3) { animation-delay: 1s; } .d2-page .d2-tx-table tbody tr:nth-child(4) { animation-delay: 1.1s; }
.d2-page .d2-tx-table tbody tr:nth-child(5) { animation-delay: 1.2s; } .d2-page .d2-tx-table tbody tr:nth-child(6) { animation-delay: 1.3s; }

@media (prefers-reduced-motion: reduce) {
  .d2-page *, .d2-page *::before { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; transform: none !important; }
}

/* chart month pill uses the accent instead of black */
.d2-page .d2-day-label.active { background: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%); color: #fff; }

/* ---------- Mobile layout for the dashboard ---------- */
@media (max-width: 767.98px) {
  .d2-page { gap: 10px; }
  .d2-page .d2-row-top { grid-template-columns: 1fr 1fr; gap: 8px; }
  .d2-page .d2-card-banner { grid-column: 1 / -1; min-height: 96px; }
  .d2-page .d2-card-feature { padding: 12px 14px; min-height: 80px; }
  .d2-page .d2-feature-title { font-size: 13px; }
  .d2-page .d2-row-middle, .d2-page .d2-row-bottom { grid-template-columns: 1fr; gap: 10px; min-height: 0; }
  .d2-page .d2-card-stock, .d2-page .d2-card-chart { padding: 16px; }
  .d2-page .d2-stock-price { font-size: 26px; }
  .d2-page .d2-card-chart .d2-chart-body { min-height: 150px; }
  .d2-page .d2-chart-days-row { gap: 0; justify-content: space-between; }
  .d2-page .d2-day-label { font-size: 8px; padding: 3px 4px; }
  .d2-page .d2-metrics-2x2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .d2-page .d2-metric-tile { min-height: 96px; padding: 14px; }
  .d2-page .d2-metric-value { font-size: 18px; word-break: break-word; }
  /* payments table: scroll sideways instead of squeezing every column */
  .d2-page .d2-card-transactions { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .d2-page .d2-tx-table { min-width: 560px; }
  .d2-page .d2-tx-table th, .d2-page .d2-tx-table td { white-space: nowrap; }
  .d2-page .d2-card-balance { min-height: 190px; }
  .d2-page .d2-balance-amount { font-size: 26px; }
}

/* mobile: payments table fits the card (no sideways scroll) by dropping the Loan ID column and the time line */
@media (max-width: 767.98px) {
  .d2-page .d2-hide-sm, .d2-page .d2-date-subtext { display: none !important; }
  .d2-page .d2-card-transactions { overflow-x: hidden; }
  .d2-page .d2-tx-table { min-width: 0; table-layout: auto; }
  .d2-page .d2-tx-table th, .d2-page .d2-tx-table td { white-space: normal; padding-right: 6px; font-size: 11px; }
  .d2-page .d2-activity-cell { gap: 6px; }
  .d2-page .d2-activity-cell span:last-child { overflow: hidden; text-overflow: ellipsis; }
}

/* mobile: nothing may be wider than the screen (grid items default to min-width:auto and can force sideways scroll) */
@media (max-width: 767.98px) {
  .d2-page, .d2-page > section, .d2-page [class*="d2-card-"], .d2-page .d2-metric-tile, .d2-page .d2-col-wallet { min-width: 0; max-width: 100%; }
  .d2-page .d2-row-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d2-page .d2-row-middle, .d2-page .d2-row-bottom { grid-template-columns: minmax(0, 1fr); }
  .d2-page .d2-metrics-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d2-page .d2-chart-days-row { min-width: 0; overflow: hidden; }
  .d2-page .d2-chart-body, .d2-page .d2-chart-svg-area { min-width: 0; }
  .d2-page .d2-stock-stats-grid { min-width: 0; }
}
