/* Update 006: explicit directory styling, loaded separately to avoid stale table layouts. */
.directory { width:calc(100% - 64px); max-width:1480px; margin:42px auto; padding:0; }
.directory .lobby-title { gap:28px; margin-bottom:30px; }
.directory h1 { margin-bottom:10px; }
.directory p { line-height:1.55; }
.character-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr)); gap:24px; }
.character-card { min-width:0; border:1px solid #354b54; background:#192a31; border-radius:12px; padding:24px; display:flex; flex-direction:column; gap:20px; }
.character-identity { display:flex; align-items:center; gap:18px; min-width:0; }
.character-identity > div:last-child { min-width:0; }
.character-identity h2 { font-size:1.2rem; margin:0 0 7px; overflow-wrap:anywhere; }
.character-identity p { margin:0 0 4px; color:#c9d7dc; font-size:.875rem; }
.character-photo { width:76px; height:76px; border-radius:12px; object-fit:cover; flex-shrink:0; border:1px solid #49616b; }
.character-photo.placeholder { display:grid; place-items:center; background:#233b45; font-size:34px; color:#88b9cc; }
.character-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-block:1px solid #344a53; margin:0; padding:16px 0; gap:14px; }
.character-stats dt { color:#9eb6c0; font-size:.75rem; margin-bottom:6px; }
.character-stats dd { margin:0; font-size:1.1rem; font-weight:650; }
.character-card .party-label { margin:0; color:#a8d6c8; font-size:.875rem; }
.character-card .actions { gap:10px; margin-top:auto; }
.character-card button,.button-link { font-size:.8rem; padding:9px 12px; }
.button-link { display:inline-flex; align-items:center; border:1px solid #48626a; border-radius:6px; text-decoration:none; color:#e5eeeb; background:#22353c; }
.button-link.primary { background:#9ddcc7; color:#10271e; }
.party-section { padding:26px; margin-bottom:30px; border:1px solid #354b54; border-radius:14px; background:#122229; }
.party-section .campaign-head { margin-bottom:24px; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; }
.party-section .campaign-head h2 { margin-bottom:8px; }
.party-section .campaign-head p { margin:0; }
.party-section .campaign-head .actions { justify-self:end; }
.party-photo-header { display:grid; justify-items:center; gap:7px; text-align:center; }
.party-photo-header img,.party-photo-placeholder { width:140px; height:112px; object-fit:contain; border-radius:12px; border:2px solid #49616b; }
.party-photo-header.has-photo { grid-template-columns:auto auto; align-items:center; }
.party-photo-view { padding:0; border:0; background:transparent; cursor:zoom-in; }
.party-photo-header.has-photo img { width:400px; height:260px; background:#0d191e; }
.party-photo-placeholder { display:grid; place-items:center; padding:12px; background:#233b45; color:#9eb6c0; font-size:.8rem; }
.party-photo-header small { color:#9eb6c0; font-size:.72rem; max-width:150px; }
.party-photo-header .button-link { cursor:pointer; font-size:.75rem; padding:7px 10px; }
.party-photo-header .party-photo-edit { min-width:34px; font-size:1rem; line-height:1; }
.current-file { display:block; margin-top:6px; color:#a8d6c8; overflow-wrap:anywhere; }
.character-assignments { display:grid; gap:8px; margin:18px 0; padding:14px; border:1px solid #405962; border-radius:8px; }
.character-assignments legend { padding:0 6px; color:#dce8e6; }
.character-assignment { display:flex; align-items:center; gap:10px; margin:0; padding:8px; background:#15272f; border-radius:6px; }
.character-assignment input { width:auto; margin:0; }
.character-assignment small { display:block; color:#a4b9c2; margin-top:2px; }
.photo-dialog { width:min(1100px,calc(100vw - 30px)); padding:18px; }
.photo-dialog .dialog-head { margin-bottom:12px; }
.party-photo-full { display:block; width:100%; max-width:1024px; max-height:calc(90dvh - 105px); object-fit:contain; margin:auto; }
.table-scroll { overflow-x:auto; border:1px solid #354b54; border-radius:10px; margin-top:16px; }
.data-grid { width:100%; border-collapse:collapse; text-align:left; background:#192a31; font-size:.875rem; }
.data-grid th,.data-grid td { padding:22px 24px; border-bottom:1px solid #344a53; vertical-align:top; }
.data-grid th { background:#122229; color:#a6bec8; font-size:.75rem; font-weight:650; text-transform:uppercase; letter-spacing:.05em; white-space:nowrap; }
.data-grid small { display:block; color:#a4b9c2; margin-top:7px; line-height:1.45; }
.data-grid tr:last-child td { border-bottom:0; }
.users-grid { min-width:900px; }
.users-grid th:first-child,.users-grid td:first-child { padding-right:0; width:44px; }
.users-grid td:nth-child(2) { min-width:250px; }
.users-grid td:nth-child(3) { min-width:155px; }
.users-grid td:nth-child(4) { min-width:230px; }
.users-grid td:nth-child(5) { width:185px; }
.user-email { display:block; margin-top:9px; overflow-wrap:anywhere; }
.user-actions { display:flex; flex-direction:column; gap:10px; align-items:stretch; min-width:135px; }
.user-actions button { font-size:.8rem; padding:9px 12px; }
.linked-character + .linked-character { margin-top:16px; }
.role-badge { display:inline-block; padding:6px 9px; border-radius:5px; background:#28453d; color:#bce4d3; font-size:.75rem; white-space:nowrap; }
.bulk-toolbar { display:flex; align-items:center; gap:20px; flex-wrap:wrap; background:#15272f; padding:16px 20px; border-radius:8px; }
.bulk-toolbar label { margin:0; }
.bulk-toolbar input { margin:0 8px 0 0; }
.bulk-toolbar span { color:#a4b9c2; font-size:.875rem; }
.bulk-toolbar button { margin-left:auto; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
textarea { width:100%; margin-top:7px; padding:12px; background:#111e24; color:#edf5f4; border:1px solid #506168; border-radius:6px; font:inherit; resize:vertical; }
.top { height:auto; min-height:84px; gap:18px; padding:14px 24px; }
.top-actions { flex-wrap:wrap; justify-content:flex-end; }
.top-actions #admin { margin-left:14px; }
.campaign-head { flex-wrap:wrap; }
@media(max-width:740px) {
 .directory { width:calc(100% - 28px); margin:26px auto; }
 .directory .lobby-title,.party-section .campaign-head { align-items:flex-start; flex-direction:column; }
 .party-section .campaign-head { display:flex; }
 .party-section .campaign-head .actions { justify-self:auto; }
 .party-section,.character-card { padding:18px; }
 .character-grid { gap:16px; }
 .top { padding:12px 14px; }
 .top-actions { justify-content:flex-start; gap:6px; }
 .top-actions #admin { margin-left:0; }
 .top-actions button { padding:8px 10px; }
}
