.mobile-nav,.mobile-movements{display:none}
@media(max-width:760px){
  html{scroll-padding-bottom:100px}
  body{min-width:0;-webkit-text-size-adjust:100%}
  button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
  input,select,textarea{font-size:16px;min-height:48px}
  input[type=checkbox]{min-height:24px;width:24px;height:24px}
  label{font-size:13px;line-height:1.4}
  .btn,.link,.profile button,.demo button{min-height:44px}
  .btn{font-size:14px;line-height:1.4;white-space:normal}
  .content,.card,.metric,.columns>*,.heading>*,.details>*{min-width:0}
  .heading{flex-wrap:wrap;gap:14px}
  .heading p{font-size:13px;line-height:1.6;overflow-wrap:anywhere}
  .heading .btn{white-space:normal}
  .row{overflow-wrap:anywhere}
  .notice{overflow-wrap:anywhere;font-size:13px}
  .topbar{gap:12px;height:auto;min-height:68px}
  .profile{min-width:0;max-width:58%;font-size:12px;text-align:right}
  .profile>div:last-child{min-width:0;overflow-wrap:anywhere}
  .profile button{padding:8px 0}
  .footer{line-height:1.7}
  .footer a{display:inline-flex;align-items:center;min-height:44px}
  .login{min-height:100dvh}
  .login-story{padding:24px}
  .login-story h1{margin:28px 0 16px;font-size:34px}
  .login-story>div>p{margin-bottom:0}
  .login-story .pill{display:none}
  .login-form{padding:30px 24px 24px}
  .login-box h2{font-size:26px}
  .demo{margin-top:24px}
  .demo button{padding:10px 12px}
  dialog{position:fixed;inset:auto 0 0;margin:0;padding:20px;width:100%;max-width:100%;max-height:calc(100dvh - 12px);border-radius:20px 20px 0 0;overscroll-behavior:contain;scrollbar-gutter:stable}
  .modal-head{position:sticky;top:-20px;background:#fff;z-index:2;margin:-20px -20px 20px;padding:14px 16px;border-bottom:1px solid var(--line);gap:12px}
  .modal-head h2{font-size:19px;line-height:1.35}
  .close{width:44px;height:44px;flex-shrink:0;font-size:25px}
  .modal-actions{position:sticky;bottom:-20px;z-index:1;background:white;display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin:24px -20px -20px;padding:16px 20px calc(16px + env(safe-area-inset-bottom));border-top:1px solid var(--line)}
  .modal-actions .btn{min-height:48px;width:100%}
  .details{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 14px}
  .details strong{font-size:14px;line-height:1.5}
  .steps{font-size:10px;gap:6px;line-height:1.5;flex-wrap:wrap}
  #toast{bottom:calc(90px + env(safe-area-inset-bottom));left:16px;right:16px;max-width:none;line-height:1.5}
  body[data-role=student] .sidebar{padding:16px 20px;height:64px;display:flex;justify-content:center}
  body[data-role=student] .sidebar .brand{font-size:18px}
  body[data-role=student] .sidebar .mark{width:32px;height:32px;font-size:22px}
  body[data-role=student] .sidebar .nav{display:none}
  body[data-role=student] .topbar{padding:8px 20px;background:#fff}
  body[data-role=student] .topbar>div:first-child{font-size:12px;font-weight:600}
  body[data-role=student] .topbar small{font-size:10px;font-weight:400}
  body[data-role=student] .content{padding:24px 16px calc(96px + env(safe-area-inset-bottom))}
  body[data-role=student] .heading{margin-bottom:20px}
  body[data-role=student] h1{font-size:28px;letter-spacing:-.8px}
  body[data-role=student] .eyebrow{font-size:10px;letter-spacing:1.5px}
  body[data-role=student] .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:20px}
  body[data-role=student] .metric{min-height:122px;padding:18px 14px;border-radius:14px}
  body[data-role=student] .metric.primary{padding:24px;min-height:155px}
  body[data-role=student] .metric .label{font-size:12px;margin-bottom:14px}
  body[data-role=student] .metric .amount{font-size:clamp(14px,4vw,23px);letter-spacing:-.5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
  body[data-role=student] .metric .amount span{display:block;font-size:11px;margin:6px 0 0;letter-spacing:0}
  body[data-role=student] .metric.primary .amount{font-size:clamp(26px,8vw,36px)}
  body[data-role=student] .metric.primary .amount span{display:inline;font-size:13px;margin-left:8px}
  body[data-role=student] .metric small{font-size:10px;line-height:1.5;display:block}
  body[data-role=student] .card{padding:20px 16px;margin-bottom:20px}
  body[data-role=student] .card h2{font-size:18px}
  body[data-role=student] .columns{gap:16px;margin-bottom:20px}
  body[data-role=student] .columns .card{margin-bottom:0}
  body[data-role=student] .actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:20px}
  body[data-role=student] .action{padding:12px 5px 8px;text-align:center;border:0;background:#f5f8f3;min-width:0;min-height:104px}
  body[data-role=student] .action:hover{transform:none}
  body[data-role=student] .action .symbol{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#e4eddf;font-size:23px;margin:0 auto 10px}
  body[data-role=student] .action strong{font-size:11px;line-height:1.5;margin:0;overflow-wrap:anywhere}
  body[data-role=student] .action small{display:none}
  body[data-role=student] .lesson{display:none}
  body[data-role=student] .student-table{display:none}
  .mobile-movements{display:grid;gap:0}
  .movement{display:block;text-align:left;width:100%;min-width:0;border:0;border-bottom:1px solid var(--line);padding:18px 0;background:white;color:inherit}
  .movement:last-child{border-bottom:0}
  .movement-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
  .movement-head strong{font-size:13px;line-height:1.5}
  .movement-amount{display:block;font-size:19px;font-weight:650;letter-spacing:-.3px;overflow-wrap:anywhere}
  .movement-target{display:block;color:var(--muted);font-size:12px;margin-top:5px}
  .movement-info{display:flex;justify-content:space-between;gap:10px;margin-top:10px;color:var(--muted);font-size:10px;line-height:1.6}
  .movement-info span{min-width:0;overflow-wrap:anywhere}
  .movement-bank{display:block;margin-top:6px;color:var(--muted);font-size:11px;line-height:1.5}
  .mobile-nav{position:fixed;inset:auto 0 0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;z-index:4;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);box-shadow:0 -4px 24px #103c3208}
  .mobile-nav button{background:none;border:0;border-radius:10px;color:#748279;min-height:54px;min-width:0;padding:6px 2px;display:grid;place-items:center;gap:5px;font-size:10px;line-height:1.2}
  .mobile-nav button span{font-size:21px;line-height:1}
  .mobile-nav button.active{background:#edf3e6;color:#1d523f;font-weight:700}
}
@media(max-width:360px){
  .login-story{padding:22px 20px}
  .login-story h1{font-size:30px}
  .login-form{padding:26px 20px}
  body[data-role=student] .content{padding-left:12px;padding-right:12px}
  body[data-role=student] .metric.primary{padding:22px 18px}
  body[data-role=student] .metric{padding:16px 12px}
  body[data-role=student] .card{padding-left:14px;padding-right:14px}
  .movement-head{gap:6px}
  .movement-head strong{font-size:12px}
  .status{font-size:10px;padding:6px 8px}
}
@media(prefers-reduced-motion:reduce){
  .action{transition:none}
  .spinner{animation-duration:2s}
}

@media(max-width:760px){
 body[data-role=student] .topbar{min-height:60px;padding-top:4px;padding-bottom:4px}
 body[data-role=student] .metric{min-height:110px;padding:16px 14px}
 body[data-role=student] .metric.primary{min-height:145px;padding:22px}
 body[data-role=student] .metric .label{margin-bottom:10px}
 body[data-role=student] .metric .amount span{display:inline;margin:0 0 0 5px}
 body[data-role=student] .columns>.card{padding-top:18px;padding-bottom:18px}
 body[data-role=student] .columns>.card h2{margin-bottom:8px}
 body[data-role=student] .columns>.card>.welcome{margin-bottom:0}
 body[data-role=student] .actions{margin-top:14px}
 body[data-role=student] .action{min-height:98px}
}
.admin-menu-toggle{display:none}
@media screen and (max-width:760px){
 body:is([data-role=admin],[data-role=superadmin]) .sidebar{position:sticky;top:0;z-index:4;width:100%;padding:12px 16px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;max-height:85dvh;overflow-y:auto;box-shadow:0 3px 14px #103c3214}
 body:is([data-role=admin],[data-role=superadmin]) .sidebar .brand{min-width:0;font-size:16px;letter-spacing:0;gap:8px}
 body:is([data-role=admin],[data-role=superadmin]) .brand-name{overflow-wrap:anywhere}
 body:is([data-role=admin],[data-role=superadmin]) .sidebar .mark,body:is([data-role=admin],[data-role=superadmin]) .institution-logo{width:34px;height:34px;flex-shrink:0;font-size:18px}
 .admin-menu-toggle{display:flex;flex-direction:column;justify-content:center;gap:3px;min-width:88px;min-height:48px;padding:8px 12px;border:1px solid #ffffff55;border-radius:10px;background:transparent;color:inherit;font-size:15px;text-align:left}
 .admin-menu-toggle span{font-size:10px;opacity:.85}
 body:is([data-role=admin],[data-role=superadmin]) .sidebar .nav{display:none;grid-column:1/-1;margin:0;padding:8px 0;overflow:visible}
 body:is([data-role=admin],[data-role=superadmin]) .sidebar.menu-open .nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body:is([data-role=admin],[data-role=superadmin]) .nav button{white-space:normal;min-height:48px;font-size:13px;line-height:1.4;padding:12px 10px}
 body:is([data-role=admin],[data-role=superadmin]) .topbar{padding:10px 16px;font-size:12px}
 body:is([data-role=admin],[data-role=superadmin]) .topbar small{font-size:10px}
 body:is([data-role=admin],[data-role=superadmin]) .content{padding:24px 14px 32px}
 body:is([data-role=admin],[data-role=superadmin]) h1{font-size:27px;line-height:1.2;overflow-wrap:anywhere}
 body:is([data-role=admin],[data-role=superadmin]) .card{padding:18px 14px;margin-bottom:18px}
 body:is([data-role=admin],[data-role=superadmin]) .card h2{font-size:18px;line-height:1.4}
 body:is([data-role=admin],[data-role=superadmin]) .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 body:is([data-role=admin],[data-role=superadmin]) .metric{padding:18px 14px;min-height:120px}
 body:is([data-role=admin],[data-role=superadmin]) .amount{font-size:26px;overflow-wrap:anywhere}
 body:is([data-role=admin],[data-role=superadmin]) .currency-totals strong{font-size:18px;overflow-wrap:anywhere}
 body:is([data-role=admin],[data-role=superadmin]) .table-wrap{overflow:visible}
 .admin-responsive-table,.admin-responsive-table tbody,.admin-responsive-table tr,.admin-responsive-table td{display:block;width:100%;min-width:0}
 .admin-responsive-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .admin-responsive-table tbody{display:grid;gap:14px}
 .admin-responsive-table tbody tr{border:1px solid var(--line);border-radius:12px;padding:4px 14px;background:#fff}
 .admin-responsive-table tbody td{padding:12px 0;border-bottom:1px solid var(--line);white-space:normal;overflow-wrap:anywhere;max-width:none;font-size:13px}
 .admin-responsive-table tbody td:last-child{border-bottom:0}
 .admin-responsive-table td[data-label]:not([data-label=""])::before{content:attr(data-label);display:block;font-size:10px;font-weight:700;color:var(--muted);letter-spacing:.6px;margin-bottom:7px}
 .admin-responsive-table td small{white-space:normal;overflow-wrap:anywhere;line-height:1.6}
 .admin-responsive-table td .btn,.admin-responsive-table td .link{width:100%;text-align:center}
 .admin-responsive-table td select{width:100%;max-width:100%}
 body:is([data-role=admin],[data-role=superadmin]) .filter{max-width:100%;width:100%;font-size:16px}
 body:is([data-role=admin],[data-role=superadmin]) .heading>.btn{width:100%}
 body:is([data-role=admin],[data-role=superadmin]) .balance-totals>div{min-width:0;width:100%}
 body:is([data-role=admin],[data-role=superadmin]) .currency-catalog{max-height:none;padding-right:0}
 body:is([data-role=admin],[data-role=superadmin]) .institution-summary{flex-wrap:wrap;gap:20px}
 body:is([data-role=admin],[data-role=superadmin]) .institution-card .row>.btn{min-width:100%}
 body:is([data-role=admin],[data-role=superadmin]) #toast{bottom:20px}
 .password-viewer{flex-wrap:wrap}.password-viewer>*{min-width:0;width:100%}
}
