/* TrueScore: phone layout. Mirrors the Figma mobile set (sections 12 and 13): full-screen auth, app bar + bottom tab bar
   with a More sheet instead of the sidebar, stacked cards, list rows instead of tables. Everything here applies under 640px. */
:root { --tab-bg: rgba(255,255,255,.82); }
[data-theme="dark"] { --tab-bg: rgba(14,14,16,.82); }
.m-only { display: none !important; }
.auth-top-r { display: flex; align-items: center; gap: 16px; }

/* bottom sheet (used by the More tab, any width) */
.sheet-scrim { position: fixed; inset: 0; z-index: 90; background: var(--scrim); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .18s ease; }
.sheet { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--card-solid); border: 1px solid var(--card-border); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); animation: sheetIn .25s cubic-bezier(.22,.8,.36,1); }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 12px; }
.sheet .user { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--border); cursor: pointer; color: var(--ink); }
.sheet .user .tx { flex: 1; min-width: 0; } .sheet .user b { display: block; font-size: 15px; font-weight: 600; } .sheet .user small { font-size: 12px; color: var(--muted); }
.sheet .user svg { color: var(--faint); }
.sheet .menu-list { margin-top: 10px; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }
.sheet .mrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; background: none; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 600; }
.sheet .menu-list .mrow:last-child { border-bottom: 0; }
.sheet .mrow .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--surface2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex: 0 0 auto; }
.sheet .mrow .tx { flex: 1; min-width: 0; } .sheet .mrow .tx small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.sheet .mrow .chev { color: var(--faint); display: inline-flex; }
.sheet .mrow.logout { justify-content: center; color: var(--muted); border: 0; margin-top: 8px; }
.sheet .foot { text-align: center; font-size: 11px; color: var(--faint); margin-top: 4px; }
.sheet .foot a { text-decoration: underline; text-underline-offset: 2px; }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }

/* mobile steps (onboarding) */
.msteps .r { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); }
.msteps .r b { color: var(--ink); }
.msteps .segs { display: flex; gap: 6px; margin-top: 8px; }
.msteps .segs i { flex: 1; height: 4px; border-radius: 2px; background: var(--track); }
.msteps .segs i.on { background: var(--accent); }

@media (max-width: 640px) {
  .m-only { display: block !important; }
  .m-only.inline { display: inline-flex !important; }
  .m-only.tabbar { display: flex !important; }
  .desk-only { display: none !important; }
  .blob.mint { width: 460px; height: 320px; right: -130px; top: -140px; }
  .blob.sky { width: 400px; height: 300px; left: -160px; bottom: -120px; }
  .blob.peach { width: 320px; height: 240px; left: 30%; top: 40%; }

  /* ---------- auth: full screen, no floating card ---------- */
  .auth { display: block; min-height: 100vh; }
  .auth-panel { position: relative; display: block; min-height: 100vh; padding: 0 0 24px; overflow: hidden; }
  .auth-panel::after { content: ''; position: absolute; z-index: 0; top: 40px; right: 0; width: 150px; height: 110px; pointer-events: none;
    background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.4px); background-size: 10px 10px; opacity: .55;
    -webkit-mask-image: radial-gradient(120% 120% at 100% 0%, #000 0%, rgba(0,0,0,.5) 38%, transparent 72%); mask-image: radial-gradient(120% 120% at 100% 0%, #000 0%, rgba(0,0,0,.5) 38%, transparent 72%); }
  .auth-top { position: relative; z-index: 1; top: auto; right: auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 0; font-size: 13px; }
  .auth-top .auth-top-r { gap: 12px; }
  .auth-top .icon-btn { width: 40px; height: 40px; border-radius: 999px; }
  .auth-top .lockup { gap: 8px; } .auth-top .lockup img { height: 26px; } .auth-top .lockup b { font-size: 17px; }
  .auth-card, .auth-card.card { position: relative; z-index: 1; width: 100%; max-width: none; padding: 26px 24px 20px; border-radius: 0; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }
  .auth-card.card::after, .auth-card.card.spot::before { display: none; }
  .auth-card .h-display { font-size: 30px; line-height: 36px; }
  .auth-card .sub { font-size: 15px; margin-bottom: 22px; }
  .auth .input { height: 50px; border-radius: 12px; }
  .auth .btn-block { height: 52px; border-radius: 12px; font-size: 15px; }
  .code-row { gap: 8px; }
  .code-box { flex: 1 1 0; width: auto; min-width: 0; height: 60px; font-size: 24px; }
  .consent-box.lead { padding: 12px 14px; gap: 10px; }
  .consent-text { font-size: 12px; line-height: 17px; }

  /* ---------- app shell: app bar + tab bar ---------- */
  .shell { display: block; }
  .side { display: none; }
  .main { min-height: 100vh; }
  .topbar { padding: 10px 20px 10px; gap: 10px; }
  .topbar .t { display: flex; flex-direction: column-reverse; gap: 1px; min-width: 0; flex: 1; }
  .topbar .t h1 { font-size: 22px; line-height: 1.25; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .t p { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .tools { gap: 8px; }
  .topbar .tools .searchbox, .topbar .tools [data-usermenu] { display: none; }
  .topbar .icon-btn { width: 38px; height: 38px; border-radius: 999px; }
  .m-lead .icon-btn.av { padding: 0; overflow: hidden; background: none; border: 0; box-shadow: none; }
  .m-lead .icon-btn.av .avatar { width: 38px; height: 38px; }
  .content { padding: 4px 20px calc(112px + env(safe-area-inset-bottom)); gap: 12px; }
  .content > * { min-width: 0; max-width: 100%; }
  .row { gap: 12px; }
  .grid-4a .card-pad { padding: 12px 10px; }
  .grid-4a .card .chip { white-space: normal; text-align: center; line-height: 1.25; font-size: 10px; padding: 3px 7px; }
  .card { border-radius: 16px; }
  .card::after { width: 120px; height: 90px; }
  .card-pad { padding: 16px; }
  .section-title h2 { font-size: 15px; }
  .section-title p { font-size: 12px; }
  #toasts { bottom: calc(100px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }

  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-between; padding: 10px 22px calc(16px + env(safe-area-inset-bottom));
    background: var(--tab-bg); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; padding: 0; background: none; border: 0;
    font-family: var(--font); font-size: 10px; font-weight: 500; color: var(--muted); cursor: pointer; }
  .tabbar .on { color: var(--accent); font-weight: 600; }
  .tabbar .badge { position: absolute; top: -5px; left: 34px; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

  /* menus and modals */
  .modal-scrim { padding: 16px; }
  .modal { padding: 22px 20px; border-radius: 20px; }
  .modal-actions { flex-direction: column-reverse; gap: 8px; margin-top: 18px; }
  .modal-actions .btn { width: 100%; height: 48px; border-radius: 12px; }
  .drawer { width: 100vw; border-left: 0; padding: 20px; }
  .palette-scrim { padding-top: 8vh; }

  /* ---------- overview ---------- */
  .grid-4a { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
  .grid-4a .score-card { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 16px; }
  .score-card .info { gap: 8px; }
  .score-card .note { max-width: none; font-size: 12px; line-height: 17px; }
  .dial-center b { font-size: 34px; }
  .bureau-card .bc-body { display: flex; flex-direction: column; padding: 12px 10px 12px; }
  .bureau-card .top { display: contents; }
  .bureau-card .top .bureau-chip { order: 1; align-self: flex-start; }
  .bureau-card .top .chip { order: 3; align-self: flex-start; padding: 2px 7px; font-size: 11px; }
  .bureau-card .mid { order: 2; margin: 10px 0 6px; }
  .bureau-card .num { font-size: 22px; }
  .bureau-card .foot, .bureau-card .graph { display: none; }
  .hist-stats { flex-wrap: wrap; gap: 12px 20px; }
  .kv .v { font-size: 18px; }
  .seg button { padding: 3px 8px; font-size: 11px; }
  .step-row { flex-wrap: wrap; gap: 8px 12px; padding: 12px 2px; }
  .step-row .tx { flex: 1 1 calc(100% - 34px); font-size: 13px; }
  .step-row .gain { margin-left: 32px; font-size: 12px; }
  .step-row .btn { display: none; }
  .ccard { height: 168px; }

  /* ---------- reports ---------- */
  .filters { gap: 10px; }
  .rtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
  .rtab { justify-content: center; gap: 6px; padding: 9px 6px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--card); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: var(--shadow); }
  .rtab span { display: none; }
  .rtab.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
  .filters .r { width: 100%; }
  .filters .r .btn { flex: 1; }
  .grid-factors { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .factor { padding: 14px; gap: 4px; }
  .factor .v { font-size: 24px; }
  .grid-report { display: flex; flex-direction: column; gap: 12px; }
  .grid-report > div:not(.card) { display: contents; }
  #negCard { order: -1; } #acctCard { order: 0; } #inqCard { order: 1; }
  #acctCard .section-title { padding: 16px 16px 10px !important; }
  .tbl, .tbl tbody, .tbl tfoot { display: block; width: 100%; }
  .tbl thead, .tbl td.t-type, .tbl td.t-bal, .tbl td.t-lim, .tbl td.t-util { display: none; }
  .tbl tr { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--border); }
  .tbl td { display: block; padding: 0; border: 0; }
  .tbl td.nm { grid-column: 1; grid-row: 1; }
  .tbl td.nm b { font-size: 13px; }
  .tbl td.t-status { grid-column: 2; grid-row: 1 / span 2; }
  .tbl td.t-meta { grid-column: 1; grid-row: 2; font-size: 11px; color: var(--muted); }
  .tbl tr.neg td { background: none; }
  .tbl tr.neg { background: var(--danger-soft); }
  .tbl tbody tr:hover td { background: none; }
  .tbl tfoot tr { display: block; padding: 10px 16px; }
  .tbl tfoot td:last-child { display: none; }

  /* ---------- alerts ---------- */
  .filters:has(#alSeg) { flex-direction: column; align-items: stretch; }
  #alSeg { width: 100%; display: flex; }
  #alSeg button { flex: 1; padding: 7px 4px; }
  #markAll { align-self: flex-end; }
  .al-head { padding: 12px; gap: 10px; }
  .al-body { padding: 0 14px 14px; }

  /* ---------- tracker, steps, disputes ---------- */
  .goal-wrap { flex-wrap: wrap; gap: 14px; }
  .letter { padding: 14px; font-size: 12.5px; }

  /* ---------- settings ---------- */
  .set-grid { display: flex; flex-direction: column; gap: 12px; }
  .set-nav { position: static; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; min-width: 0; width: calc(100% + 40px); overflow-x: auto; padding: 2px 20px 6px; margin: 0 -20px; scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav a { flex: 0 0 auto; white-space: nowrap; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--card-border); background: var(--card); font-size: 13px; }
  .set-nav a.on { background: var(--btn-fill); color: var(--btn-text); border-color: transparent; }
  .set-nav a.on svg { color: var(--btn-text); }
  #panel .card-pad { padding: 18px !important; }
  #panel div[style*="gap:10px"] { flex-wrap: wrap; }
  #panel div[style*="gap:10px"] .u-grow { display: none; }
  .content .btn { max-width: 100%; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid .span3 { grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
  .theme-cards { gap: 8px; }
  .theme-card .prev { height: 56px; }
  .set-row { padding: 12px 0; gap: 12px; }
  .plan-current { flex-wrap: wrap; }

  /* ---------- onboarding ---------- */
  .onb-grid { display: flex; flex-direction: column; gap: 12px; }
  .onb-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .onb-head .linklike { align-self: flex-end; }
  .stepper { display: none; }
  .onb-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0 !important; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); gap: 10px;
    background: var(--tab-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-top: 1px solid var(--border); }
  .onb-actions .btn { height: 50px; border-radius: 12px; }
  .onb-actions .btn-primary { flex: 1; }
  .pull-row { padding: 12px 14px; }
  .opt { padding: 13px 14px; }

  /* ---------- identity + privacy ---------- */
  .grid-4, .grid-4b { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .grid-4b .removal-card { grid-column: 1 / -1; }
  .stat { padding: 14px; gap: 6px; }
  .stat .v { font-size: 24px; }
  .stat .l { font-size: 12px; }
  .removal { gap: 14px; }
}
