/* Keep the portal's palette and typography; change only navigation and density. */
#appShell{display:grid;grid-template-columns:224px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
#appShell>.topbar{grid-column:1/-1}
#appShell>.portal-navigation{grid-column:1;grid-row:2;overflow:auto;margin:0;border-right:1px solid var(--border,#d9dfe6);padding:12px 8px}
#appShell>.content{grid-column:2;grid-row:2;min-width:0}
.portal-sections{display:flex;flex-direction:column;gap:3px}
.portal-sections>.section-btn{width:100%;text-align:left;min-height:38px}
.portal-navigation .portal-subsections{flex-direction:column;align-items:stretch;padding:0 0 8px 12px;border:0;gap:2px}
.portal-navigation .tab-btn{text-align:left;padding:6px 10px;white-space:normal}
.portal-navigation [hidden]{display:none!important}
.v13-menu-toggle{width:100%;margin-bottom:10px}
#appShell.v13-menu-collapsed{grid-template-columns:72px minmax(0,1fr)}
.v13-menu-collapsed .section-btn{font-size:0;text-align:center;padding:10px 0}
.v13-menu-collapsed .section-btn::before{content:attr(data-short);font-size:14px}
.v13-menu-collapsed .portal-subsections{display:none!important}
.v13-menu-collapsed .v13-menu-toggle{padding:6px 0;font-size:12px}
/* Dense lists, including tables in dialogs. Text remains >=12px.
   Editing textareas are not clipped; multi-line user content may increase height. */
body table tbody td{padding:2px 8px!important;line-height:16px;font-size:12px;vertical-align:middle}
body table tbody tr{height:27.5px}
body table .btn,body table button{padding:1px 5px!important;min-height:20px;line-height:16px;font-size:12px}
body table .priority-badge,body table .btn-icon{height:20px;min-height:20px;width:20px;min-width:20px;line-height:16px}
body table .row-actions{gap:3px;flex-wrap:nowrap}
body table td input:not([type=checkbox]):not([type=radio]),body table td select{padding:1px 4px!important;min-height:20px;line-height:16px;font-size:12px}
body table td .hint,body table td p{margin-block:0;line-height:16px}
body table td .badge{padding-block:1px;line-height:16px}
/* A list row is one line; full cell text remains selectable and in a native tooltip.
   Editable cells retain their controls and multiline inputs. */
body table tbody td:not(:has(input,textarea,select,button,.btn)){
  white-space:nowrap;max-width:320px;overflow:hidden;text-overflow:ellipsis;
}
body table tbody td:not(:has(input,textarea,select)) br{display:none}
body table tbody td:not(:has(input,textarea,select)) br::after{content:" · "}
body table tbody td:not(:has(input,textarea,select))>p,
body table tbody td:not(:has(input,textarea,select))>div:not(.row-actions){display:inline}
body table tbody td:has(.row-actions){white-space:nowrap}
[data-registry-table] td{white-space:nowrap}
[data-registry-query]{width:min(100%,380px);padding:6px;border:1px solid var(--border,#d9dfe6);border-radius:5px}
[data-history]{padding:12px}
[data-registry-table]{max-height:60vh;overflow:auto}
[data-registry-table] thead th{position:sticky;top:0;z-index:1;background:var(--bg,#f5f7fa)}
.v14-history-details{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;font-size:12px;background:var(--bg,#f5f7fa);padding:8px}
.v13-smart-search{min-width:220px;flex:1 1 280px}
.v13-smart-search label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted,#64748b)}
.v13-smart-search input{width:100%;box-sizing:border-box;border:1px solid var(--border,#d9dfe6);border-radius:6px;background:#fff;padding:8px 10px;font:inherit;color:inherit}
.v13-smart-search [data-results]:not(:empty){border:1px solid var(--border,#d9dfe6);padding:8px;max-height:260px;overflow:auto}
.v13-smart-search [data-results] button{display:block;width:100%;text-align:left;margin:3px 0}
.v13-tree details{border:1px solid var(--border,#d9dfe6);border-radius:6px;margin:7px 0;padding:10px}
.v13-tree details details{margin-left:14px}
.v13-tree summary{cursor:pointer;font-weight:600}
.v13-tree-lead{display:block;width:100%;text-align:left;margin-top:5px;white-space:normal}
.v13-tree-lead span{font-variant-numeric:tabular-nums;margin-right:8px}
.v13-dialog{width:min(1000px,94vw);max-height:90vh;overflow:auto}
.v13-dialog [data-error]{color:#b42318;white-space:pre-wrap}
.v13-dialog textarea{width:100%;font:inherit}
.v13-dialog label,#tab-products>label{display:flex;flex-direction:column;gap:5px;margin:8px 0}
.v13-dialog input,.v13-dialog select,.v13-dialog textarea,#tab-products>label input{box-sizing:border-box;max-width:100%;padding:8px 10px;border:1px solid var(--border,#d9dfe6);border-radius:6px;background:#fff;font:inherit;color:inherit}
.v13-dialog input:not([type=checkbox]),.v13-dialog select{width:100%}
#tab-products>label input{width:min(600px,100%)}
.v13-dialog input[type=checkbox]{width:auto}
.v13-dialog li{margin:6px 0}
@media(max-width:720px){
  #appShell{grid-template-columns:156px minmax(0,1fr)}
  #appShell>.content{padding:10px}
  .portal-navigation .tab-btn{font-size:12px;padding:6px 3px}
  .v13-dialog .lead-grid{grid-template-columns:1fr}
}
