.dev-preview-auth {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #f3f6fb;
  color: #152036;
}
.dev-preview-auth[hidden] { display: none; }
.dev-auth-card {
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid #e5eaf2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 55px #1520361c;
}
.dev-auth-card h1 { margin: 0 0 6px; font-size: 23px; }
.dev-auth-card p { margin: 0 0 20px; color: #68758a; line-height: 1.5; }
.dev-auth-card label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 650; }
.dev-auth-card input {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d8dfeb;
  border-radius: 11px;
  background: #fff;
  color: inherit;
  font: inherit;
}
.dev-auth-card button, .dev-signout {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: #2563eb;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dev-auth-card button { width: 100%; margin-top: 18px; }
.dev-auth-card button:disabled { opacity: .65; cursor: wait; }
.dev-auth-message { min-height: 20px; margin: 12px 0 0 !important; font-size: 13px; }
.dev-auth-message[data-error="true"] { color: #b42318; }
.dev-preview-version { display: block; margin-top: 12px; color: #7a8495; font-size: 11px; letter-spacing: .01em; }
.dev-auth-config { padding: 12px; border-radius: 10px; background: #fff4ce; color: #694b00; font-size: 13px; line-height: 1.5; }
.dev-preview-status {
  position: fixed;
  z-index: 9000;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(460px, calc(100vw - 24px));
  padding: 9px 12px;
  border: 1px solid #d8dfeb;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 5px 22px #1520361c;
  color: #344054;
  font-size: 12px;
}
.dev-preview-status[hidden] { display: none; }
.dev-preview-status[data-state="error"], .dev-preview-status[data-state="offline"] { border-color: #f2b8b5; color: #a12d25; }
.dev-preview-status[data-state="pending"] { border-color: #f0d28a; color: #785600; }
.dev-signout { min-height: 30px; padding: 4px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.dev-account-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 9px; background: #edf3ff; color: #344054; font-size: 12px; }
.dev-account-chip .dev-signout { margin-left: 4px; }
.dev-retry { border: 0; padding: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 430px) {
  .dev-auth-card { padding: 20px; border-radius: 16px; }
  .dev-preview-status { left: 10px; right: 10px; justify-content: space-between; max-width: none; border-radius: 14px; }
  .dev-account-chip { max-width: 46vw; }
  .dev-account-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 600px) {
  .wrap, #main, .dash, .col, .grid, .card { min-width: 0; }
  .wrap { width: 100%; padding-inline: clamp(12px, 4vw, 18px); }
  .top { gap: 8px; flex-wrap: wrap; }
  .top > div:first-child { min-width: 0; flex: 1 1 120px; }
  .top h1 { font-size: clamp(20px, 6vw, 25px); overflow-wrap: anywhere; }
  .top > div:last-child { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
  .dev-account-chip { max-width: min(140px, 36vw); min-width: 0; }
  .per { flex: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sc { min-width: 0; padding: 12px 10px; gap: 7px; }
  .sc > div:last-child { min-width: 0; }
  .sv, .sc .dl { white-space: normal; overflow-wrap: anywhere; }
  .sv { font-size: clamp(13px, 3.6vw, 16px); }
  .hero, .bcard, .budget-dashboard, .budget-overview { min-width: 0; }
  .hero { flex-wrap: wrap; padding: 17px; }
  .hero > div, .bcard > div { min-width: 0; }
  .big, .amt { white-space: normal; overflow-wrap: anywhere; }
  .row { min-width: 0; align-items: flex-start; }
  .row .rm, .row .rt, .row .rs { min-width: 0; overflow-wrap: anywhere; }
  .allocation-card, .virtual-dashboard-goals, .budget-page, .investment-page { width: 100%; max-width: 100%; }
  #ov .sheet { max-width: 100vw; max-height: min(94dvh, 94vh); }
  #ov .sh-b { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #ov .sh-f { flex: none; }
  .investment-history-row, .investment-asset-row, .virtual-goal-row { overflow-wrap: anywhere; }
  .investment-form input[type="range"] { width: 100%; min-width: 0; }
  .dev-preview-status { gap: 6px; flex-wrap: wrap; line-height: 1.35; }
  .dev-preview-status > span { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 370px) {
  .stats { gap: 8px; }
  .sc .ci { width: 28px; height: 28px; }
  .card { padding: 13px; }
  .dev-preview-status { bottom: max(8px, env(safe-area-inset-bottom)); }
}
