.driver-profile-dialog { width:min(1100px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); border:1px solid var(--light-gray); border-radius:var(--radius-dialog); background:var(--canvas); color:var(--dark); padding:0; box-shadow:var(--dialog-shadow); -webkit-text-fill-color:currentColor; }
#journal-detail { width:min(740px,calc(100vw - 32px)); }
#journal-detail .profile-header { padding:17px 22px; }
#journal-detail .profile-content { padding:18px 22px; }
#journal-detail .business-form-grid { margin:0; padding:0; border:0; }
#journal-detail .profile-header h2 { font-size:21px; }
.profile-header { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:24px 28px; background:var(--surface); border-bottom:1px solid var(--light-gray); position:sticky; top:0; z-index:1; }
.profile-header h2 { font-size:24px; letter-spacing:-.7px; }
.profile-header p { font-size:12px; color:var(--muted); margin:4px 0 0; }
.profile-header .panel-kicker { color:var(--primary); font-size: 12px; font-weight:700; margin:0; }
.profile-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; margin-left:auto; }
.profile-content { padding:26px 28px; }
.profile-basic { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--space-4) var(--space-5); padding:var(--space-5); background:var(--surface); border:1px solid var(--light-gray); border-radius:var(--radius); margin:0 0 var(--space-4); box-shadow:var(--shadow); }
.profile-basic dt { color:var(--muted); font-size: 12px; }
.profile-basic dd { margin:4px 0 0; color:var(--dark); font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.profile-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-3); margin-bottom:var(--space-4); background:transparent; border:0; border-radius:0; }
.profile-summary>div { min-width:0; padding:var(--space-4); background:var(--surface); border:1px solid var(--light-gray); border-radius:var(--radius); box-shadow:var(--shadow); }
.profile-summary>div:not(:last-child) { border-right:1px solid var(--light-gray); }
.profile-summary span,.profile-summary small { display:block; color:var(--muted); font-size: 12px; }
.profile-summary strong { display:block; color:var(--dark); font-size:25px; letter-spacing:-.5px; font-variant-numeric:tabular-nums; margin:4px 0; overflow-wrap:anywhere; }
.profile-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-4); margin-top:var(--space-5); }
.profile-section { min-width:0; background:var(--surface); border:1px solid var(--light-gray); padding:var(--space-5); border-radius:var(--radius); box-shadow:var(--shadow); }
.profile-section-heading { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:12px; }
.profile-section h3 { font-size:17px; letter-spacing:-.3px; }
.profile-section-heading p,.profile-note { font-size: 12px; color:var(--muted); margin:4px 0; }
.profile-row { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; border:0; border-top:1px solid var(--line-subtle); background:transparent; text-align:left; padding:16px 0; color:var(--dark); }
.profile-row>span:first-child { min-width:0; }
.profile-row strong { display:block; font-size:14px; overflow-wrap:anywhere; }
.profile-row small { display:block; color:var(--muted); font-size: 12px; overflow-wrap:anywhere; margin-top:3px; }
button.profile-row:hover { background:var(--soft-blue); }
button.profile-row:hover strong { color:var(--primary); }
.profile-row-value { color:var(--primary); font-size: 12px; font-weight:600; text-align:right; min-width:55px; }
.profile-empty { font-size:13px; color:var(--muted); padding:20px 12px; text-align:center; border:1px dashed var(--light-gray); border-radius:10px; background:var(--surface); }
.profile-history { background:var(--surface); border:1px solid var(--light-gray); border-radius:var(--radius); padding:var(--space-4) var(--space-5); margin-top:var(--space-4); }
.profile-history[open] > summary { margin-bottom:10px; }
.driver-profile-dialog>.form-message { margin:20px 28px; }
.driver-scope { display:flex; align-items:center; gap:12px; padding:9px 12px; margin-bottom:14px; border-radius:10px; background:var(--soft-blue); color:var(--primary); font-size:12px; }
.driver-scope button { border:0; background:transparent; color:var(--primary); text-decoration:underline; font-size:12px; }
@media(max-width:900px) { .profile-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }.profile-header { align-items:flex-start; }.profile-header h2 { font-size:22px; } }
@media(max-width:600px) { .profile-header { position:static; padding:18px; flex-direction:column; gap:12px; }.profile-actions { justify-content:flex-end; width:100%; }.profile-content { padding:16px; }.profile-basic { grid-template-columns:repeat(2,minmax(0,1fr)); padding:16px; gap:14px; }.profile-sections { grid-template-columns:1fr; }.profile-summary>div { padding:12px; }.profile-summary strong { font-size:17px; }.profile-section { padding:16px; } }

@container driver-detail (max-width:840px) {
  #driver-profile-dialog .profile-header { padding:var(--space-4); gap:var(--space-3); align-items:flex-start; flex-wrap:wrap; }
  #driver-profile-dialog .profile-header > div:first-child { min-width:0; flex:1 1 100%; }
  #driver-profile-dialog .profile-header h2 { font-size:21px; }
  #driver-profile-dialog .profile-actions { width:100%; justify-content:flex-start; margin:0; }
  #driver-profile-dialog .profile-content { padding:var(--space-4); }
  #driver-profile-dialog .profile-basic { grid-template-columns:repeat(2,minmax(0,1fr)); padding:var(--space-4); gap:var(--space-3); }
  #driver-profile-dialog .profile-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #driver-profile-dialog .profile-summary strong { font-size:21px; }
  #driver-profile-dialog .profile-sections { grid-template-columns:minmax(0,1fr); }
  #driver-profile-dialog .profile-section { padding:var(--space-4); }
}
