/* Shared sizing first: flex children must be allowed to fit their container. */
main,.view,.card,.row>*{min-width:0}
main{width:100%}
a.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;text-decoration:none;line-height:1.4;text-align:center;max-width:100%;white-space:normal}
.view>p:has(>.btn){display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.view>a.btn{margin-bottom:16px}
.view>p{margin-bottom:14px;line-height:1.5}
a.btn:not(.p){color:var(--ink);border:1px solid var(--line);background:var(--card)}
.card,.muted,.guide{overflow-wrap:anywhere}
input,select,textarea{max-width:100%}
.badge{white-space:nowrap}
.mobile-nav{display:none}
[hidden]{display:none!important}
@media(max-width:820px){
  .mobile-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:var(--ink);color:var(--paper);position:sticky;top:0;z-index:51}
  .mobile-nav .brand{font-size:18px}
  .mobile-nav button{background:transparent;color:inherit;border:1px solid #9fb3a4;border-radius:10px;padding:10px 14px;font:inherit;min-height:44px}
  #admin-nav{display:none;position:static;width:100%;overflow:visible;padding:16px;}
  #admin-nav.open{display:block}
  #admin-nav .brand{display:none}
  #admin-nav .navgroup{margin:14px 0 6px;padding:0;border:0;font-size:11px}
  #admin-nav button{width:100%;text-align:left;white-space:normal;border-radius:10px;min-height:44px;padding:12px;margin:2px 0}
  #admin-nav .foot{display:block;margin:20px 0 0;border-top:1px solid #526658;padding-top:12px}
  #admin-nav .foot #who{display:block}
  main{padding:20px 16px;max-width:none}
  h1{line-height:1.25}h2{line-height:1.4}
  .row{align-items:stretch}
  .row>input,.row>select,.row>div:has(input),.row>div:has(select){flex:1 1 100%!important;min-width:0!important;width:100%!important}
  .row>div>input,.row>div>select{width:100%!important}
  input,select,textarea{min-height:44px}
  .btn{min-height:44px;white-space:normal;max-width:100%;line-height:1.4}
  .row>.btn,.view>p>.btn{flex:1 1 auto}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stat .v{font-size:clamp(16px,4.7vw,24px);overflow-wrap:anywhere}
  table{min-width:0;width:100%}
  table.mobile-records,table.mobile-records tbody,table.mobile-records tr{display:block;width:100%}
  table.mobile-records thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  table.mobile-records tbody tr{padding:12px 0;border-bottom:2px solid var(--line)}
  table.mobile-records td{display:block;border:0;padding:6px 4px;white-space:normal!important;overflow-wrap:anywhere;min-width:0}
  table.mobile-records td[data-label]:not([data-label=''])::before{content:attr(data-label);display:block;font-size:11px;letter-spacing:.4px;text-transform:uppercase;color:#5c6b5e;font-weight:600;margin-bottom:3px}
  table.mobile-records td:empty{display:none}
  #edit{scroll-margin-top:90px}
  #desktop-butler a[href^='cloverbutler:']{display:none}
  .desktop-help{display:none}
  table.mobile-records tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px}
  table.mobile-records td:first-child,table.mobile-records td[colspan],#tbl td:nth-child(3),#tbl td:last-child{grid-column:1 / -1}
}
