html{-webkit-text-size-adjust:100%}body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
@media(max-width:760px){
  input,select,textarea{font-size:16px!important}
  .topbar{height:64px;padding:0 14px;gap:10px}.brand{gap:9px}.brand-mark{width:36px;height:36px}.brand small{display:none}.account{gap:6px}.account #addEntryTop,.account #logout,.account span{display:none}.view-toggle{padding:8px 10px;font-size:11px}
  main{width:calc(100% - 20px);padding:14px 0 calc(72px + env(safe-area-inset-bottom))}.hero{min-height:0;padding:22px 18px;border-radius:16px}.hero h1{font-size:29px}.hero .lede{font-size:14px}.hero-note{display:none}
  .summary-grid{grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.summary-card{padding:15px 13px;border-radius:12px}.summary-card span{font-size:9px}.summary-card strong{font-size:21px;margin:6px 0 0}.summary-card small{display:none}
  .panel{border-radius:14px}.panel-head{padding:18px 15px;gap:14px}.panel-head h2{font-size:23px}.actions{display:grid;grid-template-columns:1fr auto;width:100%;gap:8px}.search{grid-column:1/-1}.actions select{min-width:0}.actions #exportCsv{display:none}.actions #addEntry{display:block}.quick-filters{padding:11px 14px;gap:7px;scrollbar-width:none}.quick-filters::-webkit-scrollbar{display:none}.filter-chip{min-height:38px;padding:8px 13px}
  .table-wrap{padding:10px;background:#f4f6f9;overflow:visible}table{min-width:0;display:block}thead{display:none}tbody{display:block}tbody tr{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 8px;background:#fff;border:1px solid var(--line);border-radius:13px;padding:14px;margin-bottom:10px;box-shadow:0 4px 14px rgba(24,53,99,.05)}tbody tr:hover{background:#fff}td{display:flex;flex-direction:column;gap:4px;min-width:0;padding:0;border:0;font-size:13px;text-align:left!important}td::before{content:attr(data-label);color:#7a8493;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}td:nth-child(1){grid-column:1/3;padding-right:24px}td:nth-child(2){grid-column:3;text-align:right!important;align-items:flex-end}td:nth-child(3),td:nth-child(4){grid-column:1/-1}td:nth-child(3){font-size:15px;font-weight:750}td:nth-child(4){color:#667085}td:nth-child(5),td:nth-child(6),td:nth-child(7){padding-top:8px;border-top:1px solid #edf0f4}td:nth-child(8){grid-column:1/3;padding-top:8px;border-top:1px solid #edf0f4}td:nth-child(9){grid-column:3;padding-top:8px;border-top:1px solid #edf0f4;align-items:flex-end}td:nth-child(10){position:absolute;right:7px;top:7px}td:nth-child(10)::before{display:none}.row-action{min-width:36px;min-height:36px}.panel-foot{padding:11px 15px}.panel-foot span:last-child{display:none}
  dialog{width:100%;max-width:none;margin:auto 0 0;border-radius:20px 20px 0 0;max-height:92dvh}dialog form{padding:22px 18px calc(20px + env(safe-area-inset-bottom))}.form-grid{grid-template-columns:1fr;gap:13px}.form-grid .wide{grid-column:auto}.dialog-actions{position:sticky;bottom:0;background:#fff;padding-top:10px}.dialog-actions .button{min-height:44px}
}
@media(max-width:380px){.hero h1{font-size:25px}.summary-card strong{font-size:18px}.summary-card{padding:13px 10px}.filter-chip{font-size:11px}}
@media(max-width:520px){body:has(.login-card){padding:0}.login-card{border-radius:18px;padding:28px 22px;margin-top:env(safe-area-inset-top);width:calc(100% - 20px)}.login-card h1{font-size:30px}.login-card input,.login-card select,.login-card button{min-height:48px}}

/* Give phone users a dependable wide ledger when they explicitly request it. */
@media(max-width:760px){
  body.desktop-view{min-width:1180px;padding:0}
  body.desktop-view .topbar{height:76px;padding:0 40px}
  body.desktop-view .brand small,body.desktop-view .account span,body.desktop-view .account #addEntryTop,body.desktop-view .account #logout{display:block}
  body.desktop-view main{width:calc(100% - 40px);padding:42px 0 64px}
  body.desktop-view .hero{padding:38px 42px;border-radius:22px;min-height:0}
  body.desktop-view .hero h1{font-size:46px}
  body.desktop-view .hero .lede{font-size:16px}
  body.desktop-view .hero-note{display:flex}
  body.desktop-view .summary-grid{grid-template-columns:repeat(2,1fr);gap:16px;margin:20px 0}
  body.desktop-view .summary-card{padding:22px 24px;border-radius:16px}
  body.desktop-view .summary-card span{font-size:12px}
  body.desktop-view .summary-card strong{font-size:30px;margin:9px 0 5px}
  body.desktop-view .summary-card small{display:block}
  body.desktop-view .panel-head{padding:24px 26px;flex-direction:row;align-items:center}
  body.desktop-view .panel-head h2{font-size:25px}
  body.desktop-view .actions{display:flex;width:auto}
  body.desktop-view .search{grid-column:auto}
  body.desktop-view .actions #exportCsv{display:inline-block}
  body.desktop-view .actions #addEntry{display:none}
  body.desktop-view .quick-filters{padding:14px 26px}
  body.desktop-view .table-wrap{padding:0;background:#fff;overflow-x:auto}
  body.desktop-view table{display:table;min-width:1120px}
  body.desktop-view thead{display:table-header-group}
  body.desktop-view tbody{display:table-row-group}
  body.desktop-view tbody tr{display:table-row;background:transparent;border:0;border-radius:0;padding:0;margin:0;box-shadow:none}
  body.desktop-view td{display:table-cell;padding:13px 15px;border-bottom:1px solid #e8ebef;font-size:13px}
  body.desktop-view td::before{display:none}
  body.desktop-view td:nth-child(n){position:static;text-align:inherit!important;border-top:0}
  body.desktop-view td.num{text-align:right!important}
  body.desktop-view .panel-foot{padding:15px 26px}
  body.desktop-view .panel-foot span:last-child{display:inline}
}
