/* Shared mobile layout. Desktop rules remain in app.css and each page. */
.mobile-row-toggle,.mobile-row-actions,.mobile-list-tools,.mobile-log-toggle{display:none}.mobile-checkbox-hit{display:contents}
@media(max-width:760px){
  :root{--mobile-surface:#091e2a;--mobile-border:rgba(117,193,215,.22)}
  html,body{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body{font-size:14px;line-height:1.45}body::before{opacity:.12}
  .page{width:100%;min-width:0!important;padding:4px!important}
  .page-head{display:flex!important;align-items:center;justify-content:space-between!important;flex-wrap:wrap;gap:4px!important;margin-bottom:6px!important}
  .page-head>div{min-width:0;max-width:100%}.page-title{font-size:18px!important;line-height:1.3;margin:2px 0!important}
  .page-subtitle{font-size:11px;line-height:1.4;margin:2px 0!important;color:var(--muted)}
  .page-actions,.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px!important;max-width:100%;box-sizing:border-box;padding:4px!important}
  .toolbar{width:100%!important;border-radius:8px!important;margin-bottom:4px!important;background:var(--mobile-surface)}
  .toolbar .spacer{display:none}.toolbar button,.toolbar select{flex:1 1 auto}
  button,.segment button,.toolbar select,.page-actions button{min-height:44px!important;padding:6px 10px;font-size:13px;line-height:1.2;box-sizing:border-box;touch-action:manipulation}
  input:not([type=checkbox]):not([type=radio]),select,textarea{min-height:44px!important;font-size:16px!important;max-width:100%;box-sizing:border-box}
  input[type=checkbox],input[type=radio]{width:22px;height:22px;min-height:0;accent-color:var(--cyan)}
  .toolbar input[type=search]{width:100%!important;min-width:0;flex:1 1 100%}.toolbar select{min-width:0;max-width:100%;flex-basis:110px}
  button:focus-visible,summary:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
  .mobile-toolbar-details{flex:1 1 100%;border-top:1px solid var(--mobile-border);margin-top:2px;min-width:0}
  .mobile-toolbar-details summary{display:flex;align-items:center;justify-content:space-between;min-height:40px;padding:6px;color:var(--muted);font-size:12px;cursor:pointer;list-style:none}
  .mobile-toolbar-details summary::after{content:'展开 ▾';color:var(--cyan)}.mobile-toolbar-details[open] summary::after{content:'收起 ▴'}
  .mobile-toolbar-content{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:2px 0 4px}.mobile-toolbar-content>*{max-width:100%;min-width:0}
  .panel,.table-wrap{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box;border-radius:8px!important}
  .panel:has(>.table-wrap){background:transparent;border:0}.table-wrap:has(>.mobile-card-table){overflow:visible!important;height:auto!important;max-height:none!important;border:0}
  .grid-stats,.batch-grid,.form-grid,.target-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important}
  .stat{padding:8px!important;min-height:74px;font-size:12px;border-radius:8px}.stat b{font-size:26px;line-height:1.3}
  .stat-slot-empty{display:none}.performance-panel{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important}
  .gauge-card{padding:8px!important;min-height:0!important}.gauge-title{font-size:12px}.gauge{max-width:100%;height:100px}.performance-panel .gauge-card:last-child:nth-child(odd){grid-column:1/-1}
  .section-title{font-size:15px;margin:10px 0 4px}
  .mobile-card-table{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important}
  .mobile-card-table colgroup,.mobile-card-table thead{display:none!important}.mobile-card-table tbody{display:block;width:100%}
  .mobile-card-table tbody>tr{position:relative;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px;margin:4px 0;padding:8px!important;border:1px solid var(--mobile-border);border-radius:8px;background:var(--mobile-surface)}
  .mobile-card-table tbody>tr>td,.mobile-card-table tbody>tr>th{display:block!important;width:auto!important;min-width:0!important;max-width:100%;height:auto!important;white-space:normal!important;overflow-wrap:anywhere;overflow:visible!important;text-overflow:clip!important;padding:0!important;border:0!important;font-size:13px;line-height:1.4;position:static!important}
  .mobile-card-table [data-mobile-label]::before{content:attr(data-mobile-label);display:block;color:var(--muted);font-size:10px;font-weight:400;line-height:1.4;margin-bottom:1px}
  .mobile-card-table .mobile-wide-cell{grid-column:1/-1}.mobile-card-table td[colspan]{grid-column:1/-1}
  .mobile-card-table .mobile-cell-heading{grid-column:1/-1;padding-right:96px!important;font-size:14px!important;font-weight:600;min-height:44px}
  .mobile-card-table tr[data-mobile-controls="0"] .mobile-cell-heading{padding-right:0!important;min-height:24px}.mobile-card-table tr[data-mobile-controls="1"] .mobile-cell-heading{padding-right:48px!important}
  .mobile-checkbox-hit{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;cursor:pointer;touch-action:none}
  .mobile-card-table .mobile-cell-heading::before,.mobile-card-table .mobile-cell-select::before{display:none}
  .mobile-card-table .mobile-cell-select{display:flex!important;align-items:center;gap:6px;min-height:32px!important;color:var(--muted)}
  .mobile-card-table .mobile-cell-select input{flex:0 0 22px;touch-action:none}
  .mobile-card-table .mobile-cell-state{display:flex!important;align-items:center;gap:4px;min-height:28px}.mobile-card-table .mobile-cell-state::before{display:none}
  .mobile-card-table tbody>tr:not(.mobile-expanded)>.mobile-cell-detail{display:none!important}
  .mobile-card-table tbody>tr.mobile-expanded>.mobile-cell-detail{padding-top:4px!important;border-top:1px solid var(--mobile-border)!important}
  .mobile-row-toggle,.mobile-row-actions{display:block;position:absolute;top:6px;right:6px;min-height:44px!important;padding:6px!important;font-size:11px!important;min-width:44px;background:rgba(32,76,94,.35);color:var(--cyan);border-color:var(--mobile-border)}
  .mobile-row-actions{right:54px}.mobile-card-table .status{font-size:12px;white-space:normal;gap:4px;padding:3px 6px}
  .mobile-card-table button:not(.mobile-row-toggle):not(.mobile-row-actions){min-width:44px;min-height:44px;padding:5px 8px}
  .mobile-card-table span,.mobile-card-table a{max-width:100%;white-space:normal!important;overflow-wrap:anywhere}
  .mobile-card-table .empty{padding:12px 4px!important;font-size:13px;min-height:0}.mobile-card-table td[colspan]::before{display:none}
  .mobile-list-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:4px 6px;font-size:12px;color:var(--muted)}
  .mobile-list-tools label{display:flex;align-items:center;gap:7px;min-height:40px;cursor:pointer}.mobile-list-tools input{touch-action:manipulation}
  dialog,.modal,.dialog,[role=dialog]{inset:auto 0 0;width:100%!important;max-width:100%!important;min-width:0!important;max-height:92dvh!important;margin:0!important;padding:8px!important;padding-bottom:calc(8px + env(safe-area-inset-bottom))!important;box-sizing:border-box;overflow-y:auto;border-radius:12px 12px 0 0!important;background:#091e2a}
  dialog::backdrop{background:rgba(0,7,13,.74)}dialog input,dialog select,dialog textarea{min-width:0!important;max-width:100%;width:100%}dialog input[type=checkbox],dialog input[type=radio]{width:22px}
  dialog form{padding:0!important}.dialog-head{position:sticky;top:-8px;z-index:4;background:#091e2a;gap:4px;padding:6px 0;margin-bottom:6px}.dialog-head h2{font-size:17px;margin:0}.dialog-head button{min-width:44px;flex-shrink:0}
  .form-grid,.batch-grid,.target-grid{grid-template-columns:1fr!important}.span-2,.span-3{grid-column:auto!important}.form-field,dialog label{min-width:0}
  .modal-actions,.dialog-actions,.form-actions{position:sticky;bottom:-8px;z-index:3;background:#091e2a;display:flex;flex-wrap:wrap;gap:4px;padding:6px 0}.dialog-actions>button,.form-actions>button{flex:1 1 auto}
  .multi-list{max-height:32dvh}.multi-option{min-height:44px!important;padding:6px!important}.multi-option input{flex-shrink:0}
  .account-title-line{gap:8px!important}.status-legend{gap:8px;font-size:11px}
  .account-workspace{display:flex!important;flex-direction:column;height:auto!important;min-height:0!important}.account-table-wrap{max-height:none!important;overflow:visible!important}.account-log-divider{display:none}
  .account-log-panel{height:auto!important;min-height:0!important;margin-top:6px}.mobile-log-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;border:0;border-bottom:1px solid var(--mobile-border);background:var(--mobile-surface);text-align:left;font-size:13px}
  .account-log-panel:not(.mobile-logs-open) .account-log-toolbar,.account-log-panel:not(.mobile-logs-open) .account-log-entries,.account-log-panel:not(.mobile-logs-open) .account-log-summary{display:none}
  .account-log-panel.mobile-logs-open .account-log-entries{height:34dvh;min-height:150px}.account-log-line{min-width:0!important;display:flex!important;flex-wrap:wrap;gap:4px!important}.account-log-message{flex-basis:100%;min-width:0;overflow-wrap:anywhere}.account-log-toolbar{flex-wrap:wrap}.account-log-entries{min-width:0}
  .notice{font-size:12px;line-height:1.45;margin:4px 0!important;overflow-wrap:anywhere}.notice:empty{display:none}
  .context-menu{position:fixed;max-width:calc(100vw - 16px);max-height:70dvh;overflow-y:auto;box-sizing:border-box;border-radius:8px}.context-menu button{min-height:44px;white-space:normal;text-align:left}
  .payment-qr-thumb{width:44px;height:44px}.payment-qr-thumb img{width:42px;height:42px}.success-text-panel textarea{height:60dvh;min-height:180px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
  @media(max-width:360px){.page-title{font-size:17px!important}.performance-panel{grid-template-columns:1fr!important}.mobile-card-table tbody>tr{gap:4px 6px;padding:6px!important}}
}
@media(min-width:761px){.mobile-toolbar-details,.mobile-toolbar-content{display:contents}.mobile-toolbar-details>summary{display:none}}
