/* Personal profile. Header and dialog changes are local to pw-* components. */
.topbar:has(.pw-profile){position:relative;min-height:64px;height:auto;padding-top:8px;padding-bottom:8px;overflow:visible}
.topbar:has(.pw-profile)>.crumb{min-width:0}
.topbar:has(.pw-profile) .global-search{min-width:150px;margin-right:0}
.topbar .profile.pw-profile{position:relative;display:flex;align-items:center;align-self:center;flex:0 1 240px;width:auto;max-width:260px;min-width:0;gap:0}
.pw-profile-trigger{display:flex;align-items:center;gap:10px;width:100%;min-width:0;min-height:44px;padding:4px 8px;border:1px solid transparent;border-radius:8px;background:transparent;color:#17324d;font:inherit;text-align:left;cursor:pointer}
.pw-profile-trigger:hover,.pw-profile-trigger[aria-expanded="true"]{background:#eef6fd;border-color:#d4e5f3}
.pw-avatar{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;margin:0;overflow:hidden;border:1px solid #d9e8f5;border-radius:50%;background:#e9f3ff;color:#1871bb;font-size:12px;font-weight:700;line-height:1;object-fit:cover}
.pw-avatar>img{display:block;width:100%;height:100%;object-fit:cover}
.pw-profile-copy{display:grid;gap:2px;flex:1;min-width:0;line-height:1.25}
.pw-profile-copy>strong,.pw-profile-copy>small{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.pw-profile-copy>strong{font-size:13px;font-weight:650;color:#17324d}
.topbar .pw-profile-copy>small{font-size:10px;color:#607b92}
.pw-profile-chevron{flex:none;color:#648198;font-size:14px;line-height:1}
.topbar .pw-profile>.pw-profile-menu,.pw-profile-menu{position:absolute;right:0;top:calc(100% + 7px);z-index:80;width:300px;min-width:0;max-width:calc(100vw - 24px);max-height:calc(100dvh - 88px);margin:0;padding:8px;background:#fff;border:1px solid #d8e4ee;border-radius:10px;box-shadow:0 12px 35px #12365226;overflow:auto;overscroll-behavior:contain}
.pw-profile-menu:not([hidden]){display:grid;gap:3px}
.pw-profile-menu button,.pw-profile-menu>a{display:flex;align-items:center;gap:9px;justify-content:flex-start;min-height:40px;width:100%;margin:0;padding:9px 12px;border:0;border-radius:6px;background:transparent;color:#174b75;font:inherit;font-size:13px;line-height:1.4;text-align:left;text-decoration:none;white-space:normal;cursor:pointer}
.pw-profile-menu button:hover,.pw-profile-menu>a:hover{background:#eef6fd}
.pw-profile-menu button:disabled{opacity:.6;cursor:wait}
.pw-profile-menu .pw-profile-meta{margin:2px 4px 6px;padding:8px 7px 12px;border-bottom:1px solid #e4ecf3;font-size:12px}
.pw-profile-menu .pw-profile-meta strong{display:block;color:#17324d;font-size:13px}
.pw-profile-menu .pw-profile-meta small{display:block;color:#607b92;font-size:11px}
.pw-profile-trigger:focus-visible,.pw-profile-menu button:focus-visible,.pw-profile-menu>a:focus-visible,.pw-profile-dialog :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #4f9dde;outline-offset:3px}
.pw-profile [hidden],.pw-profile-dialog [hidden],.pw-profile-menu[hidden]{display:none!important}

/* A separate native dialog keeps personal details outside shipment forms. */
.pw-profile-dialog{width:min(850px,calc(100vw - 32px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid #d6e3ef;border-radius:12px;background:#fff;color:#17324d;box-shadow:0 18px 65px #102d4b40;overflow:auto;overscroll-behavior:contain}
.pw-profile-dialog::backdrop{background:#0d233c80;backdrop-filter:blur(2px)}
.pw-profile-dialog>header,.pw-profile-header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0;padding:18px 22px;border-bottom:1px solid #e0eaf2;background:#fff}
.pw-profile-dialog>header h2,.pw-profile-header h2{margin:0;font-size:22px;font-weight:650;line-height:1.3;color:#17324d}
.pw-profile-dialog>header .button,.pw-profile-header .button{flex:none;min-height:40px}
.pw-profile-layout{display:grid;grid-template-columns:minmax(0,215px) minmax(0,1fr);align-items:start;gap:24px;padding:22px}
.pw-profile-aside{min-width:0;margin:0;padding:16px;background:#f5f9fd;border:1px solid #e0eaf2;border-radius:9px}
.pw-profile-photo{display:grid;justify-items:center;gap:12px;min-width:0;text-align:center}
.pw-profile-photo>.pw-avatar,.pw-profile-photo>img,.pw-profile-photo>.pw-avatar>img{width:120px;height:120px;max-width:100%;border-radius:50%;object-fit:cover}
.pw-profile-photo>.pw-avatar{font-size:34px;flex-basis:120px;border-width:2px}
.pw-profile-photo input[type="file"]{display:block;width:100%;max-width:100%;min-height:40px;padding:7px 5px;color:#355974;font:inherit;font-size:11px}
.pw-profile-photo input[type="file"]::file-selector-button{min-height:30px;margin-right:6px;padding:5px 7px;border:1px solid #c6d9e9;border-radius:5px;background:#fff;color:#23547a;font:inherit;cursor:pointer}
.pw-profile-photo>.button,.pw-profile-photo>.link{max-width:100%;min-height:36px;white-space:normal}
.pw-profile-photo .help{margin:0;font-size:11px;line-height:1.5;text-align:left}
.pw-profile-meta{display:grid;gap:5px;min-width:0;margin-top:16px;color:#56728a;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.pw-profile-meta strong{color:#17324d;font-weight:600}
.pw-profile-meta dl,.pw-profile-meta dd{margin:0}
.pw-profile-meta dt{font-size:11px;color:#6b8297}
.pw-profile-form{min-width:0;margin:0;padding:0;border:0}
.pw-profile-form>fieldset{min-width:0;margin:0;padding:0;border:0}
.pw-profile-meta>dd{margin:0}
.pw-profile-compare-photo:is(img){display:block;width:48px;height:48px;max-width:48px;border-radius:50%;object-fit:cover}
.pw-profile-density:has(>select){display:grid;gap:6px;color:#214865;font-size:12px;font-weight:600}
.pw-profile-density>select{width:100%;min-width:0;min-height:44px;padding:9px 11px;border:1px solid #c4d8e8;border-radius:6px;background:#fff;color:#17324d;font:inherit;font-size:13px;font-weight:400}
.pw-demo-switch{display:grid;gap:2px;min-width:0;max-width:165px;font-size:10px;color:#607b92}
.pw-demo-switch select{min-width:0;max-width:100%;min-height:34px;border:1px solid #d8e4ee;border-radius:6px;background:#fff;color:#17324d}
.pw-profile-form>h3{margin:0 0 12px;font-size:17px;font-weight:600}
.pw-profile-field{display:grid;gap:5px;min-width:0;margin:0 0 14px;color:#214865;font-size:12px;font-weight:600}
.pw-profile-field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,textarea){display:block;width:100%;max-width:100%;min-width:0;min-height:44px;padding:9px 11px;border:1px solid #c4d8e8;border-radius:6px;background:#fff;color:#17324d;font:inherit;font-size:13px;font-weight:400;line-height:1.5}
.pw-profile-field textarea{min-height:90px;resize:vertical}
.pw-profile-field>small,.pw-profile-field>.help{margin:0;color:#688097;font-size:11px;font-weight:400;line-height:1.5}
.pw-profile-form input:disabled,.pw-profile-form select:disabled{background:#f1f5f9;color:#688097;opacity:1}
.pw-profile-density{min-width:0;margin:18px 0;padding:0;border:0}
.pw-profile-density>legend,.pw-profile-density>h3{margin:0 0 9px;padding:0;color:#214865;font-size:13px;font-weight:600}
.pw-profile-density>label{display:flex;align-items:flex-start;gap:9px;min-height:44px;margin:7px 0;padding:10px 12px;border:1px solid #d5e3ee;border-radius:7px;color:#214865;cursor:pointer}
.pw-profile-density>label:has(input:checked){border-color:#5298cb;background:#f0f7fd}
.pw-profile-density input[type="radio"],.pw-profile-density input[type="checkbox"]{flex:none;width:18px;height:18px;min-height:18px;margin:2px 0 0;accent-color:#0878d5}
.pw-profile-density small{display:block;margin-top:3px;color:#658097;font-size:11px;font-weight:400;line-height:1.5}
.pw-profile-alert,.pw-profile-conflict,.pw-profile-dirty-close{margin:12px 0;padding:12px 14px;border:1px solid #e3c38e;border-radius:7px;background:#fff8e9;color:#7a531b;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.pw-profile-alert:empty,.pw-profile-conflict:empty,.pw-profile-status:empty,.pw-profile-saved:empty{display:none}
.pw-profile-alert.error,.pw-profile-alert[role="alert"]{border-color:#e7b5ad;background:#fff3ef;color:#913f34}
.pw-profile-conflict>strong,.pw-profile-dirty-close>strong{display:block;margin-bottom:5px}
.pw-profile-alert p,.pw-profile-conflict p,.pw-profile-dirty-close p{margin:5px 0}
.pw-profile-conflict .button,.pw-profile-dirty-close .button{min-height:40px;margin:7px 7px 0 0;white-space:normal;text-align:center}
.pw-profile-compare{margin:10px 0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.pw-profile-compare:not(table){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
table.pw-profile-compare{display:table;width:100%;table-layout:fixed;border-collapse:collapse}
.pw-profile-compare>div,.pw-profile-compare>section{min-width:0;padding:10px;background:#fff;border:1px solid #e2d9c9;border-radius:6px}
.pw-profile-compare h3,.pw-profile-compare h4{margin:0 0 7px;font-size:12px;color:#5b4829}
.pw-profile-compare dl,.pw-profile-compare dd{margin:0}
.pw-profile-compare dt{margin-top:6px;color:#73634b;font-size:11px}
.pw-profile-compare table{width:100%;table-layout:fixed;font-size:12px}
.pw-profile-compare th,.pw-profile-compare td{padding:7px;border-bottom:1px solid #e6dfd2;text-align:left;white-space:normal;overflow-wrap:anywhere}
.pw-profile-compare-photo img{display:block;width:48px;height:48px;max-width:48px;border-radius:50%;object-fit:cover}
.pw-profile-status,.pw-profile-saved{margin:10px 0;color:#58768d;font-size:12px;line-height:1.5}
.pw-profile-saved{padding:9px 12px;border:1px solid #bee2d3;border-radius:6px;background:#eff9f4;color:#22684e}
.pw-profile-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px;flex-wrap:wrap;margin:18px 0 0;padding:14px 0 0;border-top:1px solid #e2ebf2}
.pw-profile-actions>.button,.pw-profile-actions>button{min-height:44px;white-space:normal;text-align:center}
.pw-profile-actions>.help{margin-right:auto;font-size:11px}

/* Comfortable is the existing journal/form density. Compact is an explicit preference. */
@media(min-width:901px){
 body[data-workspace-density="compact"] .content{padding:14px 20px 24px}
 body[data-workspace-density="compact"] .journal-workspace>.journal-heading{gap:10px;margin-bottom:6px}
 body[data-workspace-density="compact"] .journal-workspace>.journal-heading h1{margin:0;font-size:22px;line-height:1.3}
 body[data-workspace-density="compact"] .journal-workspace>.journal-heading .help{font-size:11px}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces{gap:8px;margin:8px 0}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces>button:not(.link){flex:0 1 auto;min-width:155px;min-height:44px;padding:7px 12px;border-radius:8px}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces strong{font-size:14px;line-height:1.35}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces small{margin-top:1px;font-size:11px;line-height:1.35}
 body[data-workspace-density="compact"] .journal-workspace>.journal-topline{gap:8px;margin-bottom:8px}
 body[data-workspace-density="compact"] .journal-workspace>.journal-topline .tab{min-height:38px;padding:7px 10px}
 body[data-workspace-density="compact"] .journal-workspace .journal-signals{gap:6px}
 body[data-workspace-density="compact"] .journal-workspace .journal-view-toolbar{gap:8px;margin:5px 0;align-items:center}
 body[data-workspace-density="compact"] .journal-workspace .journal-view-toolbar>.field{display:flex;flex-direction:row;align-items:center;gap:8px;min-width:230px;margin:0}
 body[data-workspace-density="compact"] .journal-workspace .journal-view-toolbar>.field select{flex:1;min-width:0;width:auto}
 body[data-workspace-density="compact"] .journal-workspace .journal-view-toolbar .link{padding:5px 0}
 body[data-workspace-density="compact"] .journal-workspace .journal-filters{padding:9px 10px;gap:3px 12px}
 body[data-workspace-density="compact"] .journal-workspace .journal-filter-main{gap:8px}
 body[data-workspace-density="compact"] .journal-workspace .journal-periods{gap:9px;min-height:22px}
 body[data-workspace-density="compact"] .journal-workspace .journal-summary{gap:8px 16px;padding:7px 0 5px}
 body[data-workspace-density="compact"] .journal-workspace .journal-table-tools{gap:10px;margin-bottom:5px}
}

@media(min-width:761px) and (max-width:1100px){
 .topbar:has(.pw-profile){gap:10px;padding-left:16px;padding-right:16px}
 .topbar .profile.pw-profile{flex-basis:210px;max-width:230px}
 .topbar:has(.pw-profile) .global-search{flex:1 1 180px;min-width:140px}
}
@media(max-width:760px){
 .topbar:has(.pw-profile){gap:8px;padding:8px 12px}
 .topbar .profile.pw-profile{flex:0 1 auto;justify-content:initial;width:auto;max-width:calc(100vw - 24px);margin-left:auto}
 .pw-profile-trigger{gap:9px;min-height:44px;padding:4px 7px}
 .pw-profile-copy{max-width:180px}
 .pw-profile-menu button,.pw-profile-menu>a{min-height:44px}
 .pw-profile-dialog{width:calc(100vw - 20px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 20px);border-radius:10px}
 .pw-profile-dialog>header,.pw-profile-header{gap:12px;padding:14px 16px}
 .pw-profile-dialog>header h2,.pw-profile-header h2{font-size:20px}
 .pw-profile-dialog>header .button,.pw-profile-header .button{min-height:44px}
 .pw-profile-layout{grid-template-columns:minmax(0,1fr);gap:18px;padding:16px}
 .pw-profile-aside{display:grid;grid-template-columns:96px minmax(0,1fr);gap:10px 12px;align-items:start;padding:14px}
 .pw-profile-photo{display:contents}
 .pw-profile-photo>.pw-avatar{grid-column:1;grid-row:1 / span 3;align-self:start}
 .pw-profile-photo>.pw-profile-field{grid-column:2;grid-row:1;margin:0}
 .pw-profile-photo>small{grid-column:2;grid-row:2;margin:0;line-height:1.4;text-align:left}
 .pw-profile-photo>button{grid-column:2;grid-row:3;justify-self:start}
 .pw-profile-aside>.pw-profile-meta{grid-column:1 / -1;display:grid;grid-template-columns:76px minmax(0,1fr);gap:3px 8px;margin-top:2px;align-items:baseline}
 .pw-profile-aside>.pw-profile-meta :is(dt,dd){min-width:0;margin:0}
 .pw-profile-photo>.pw-avatar,.pw-profile-photo>img,.pw-profile-photo>.pw-avatar>img{width:96px;height:96px}
 .pw-profile-photo>.pw-avatar{flex-basis:96px;font-size:28px}
 .pw-profile-photo input[type="file"]{min-height:44px;font-size:12px}
 .pw-profile-photo input[type="file"]::file-selector-button{min-height:36px}
 .pw-profile-photo>.button,.pw-profile-photo>.link{min-height:44px}
 .pw-profile-conflict .button,.pw-profile-dirty-close .button{min-height:44px}
 .pw-profile-compare{grid-template-columns:minmax(0,1fr)}
 .pw-profile-actions{gap:8px;margin-top:16px}
 .pw-profile-actions>.button,.pw-profile-actions>button{flex:1 1 140px;min-height:44px}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces{gap:8px;margin:10px 0}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces>button:not(.link){min-width:140px;min-height:44px;padding:9px 12px}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces strong{font-size:16px}
 body[data-workspace-density="compact"] .journal-workspace>.transport-workspaces small{font-size:11px;margin-top:2px}
}
@media(prefers-reduced-motion:reduce){
 .pw-profile-trigger,.pw-profile-menu,.pw-profile-menu button,.pw-profile-dialog,.pw-profile-dialog::backdrop,.pw-profile-dialog *{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
