.bp{background:var(--bg)}
.bp-profile-open{display:flex;align-items:center;gap:8px;min-width:0}
.bp-profile-avatar{width:46px;height:46px;flex:none;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);place-items:center;padding:0;border:2px solid #93c5fd;border-radius:50%;background:linear-gradient(145deg,#eff6ff,#bfdbfe);color:#17448d;font-weight:800;box-shadow:0 0 0 3px #2563eb12,0 3px 8px #10243f16;overflow:hidden}
/* Account pictures fill their circles; stored uploads and tool images are not cropped. */
.bp-profile-avatar img{display:block;width:100%;height:100%;min-width:0;min-height:0;border-radius:50%;object-fit:cover;object-position:center}
.bp-profile-dialog{width:min(460px,calc(100vw - 28px));max-height:85vh;max-height:85dvh;padding:0;border:0;border-radius:16px;color:var(--ink);overflow-y:auto;box-shadow:0 20px 70px #0005}
.bp-profile-dialog::backdrop{background:#06152c9c}
.bp-profile-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px;border-bottom:1px solid var(--line)}
.bp-profile-heading h2{margin:0;font-size:20px}
.bp-profile-body{display:grid;gap:12px;padding:18px;min-width:0}
.bp-profile-body p{margin:0;overflow-wrap:anywhere}
.bp-profile-body input{max-width:100%;min-width:0}
.bp-profile-preview{width:min(240px,100%);height:auto;aspect-ratio:1;justify-self:center;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);place-items:center;padding:0;border:6px solid #fff;border-radius:50%;background:radial-gradient(circle at 30% 25%,#eff6ff,#c7ddff);box-shadow:0 0 0 2px #93b8f2,0 12px 28px #1d4ed81c;min-width:0;overflow:hidden;margin:10px 0}
.bp-profile-preview img{display:block;width:100%;height:100%;min-height:0;min-width:0;border-radius:50%;object-fit:cover;object-position:center}
.bp-profile-preview>span{max-width:70%;text-align:center;font-size:13px;line-height:1.6;color:#305589;overflow-wrap:anywhere}
.bp-profile-actions{display:flex;gap:10px;flex-wrap:wrap}
.bp .login-card input{margin-bottom:13px}
.bp .login-card select{width:100%;min-height:46px;padding:12px 14px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font:inherit;margin-bottom:8px}
.bp-boot{text-align:center}.bp-boot .logo-block{margin:0 auto 16px}.bp-boot p{margin:0}
.bp-center{display:block;margin:18px auto 0}
.bp-top{background:var(--nav);color:#e5edf8;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px clamp(16px,3vw,40px)}
.bp-top .brand{padding:0}
.bp-who{display:flex;align-items:center;gap:12px;font-size:13px;color:#b9c9dd;min-width:0}
.bp-who span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bp-who .ghost{background:transparent;color:#fff;border-color:#2d435e}.bp-who .ghost:hover{background:#1d3a5d}
.bp-main{max-width:1240px;margin:auto;padding:34px clamp(14px,3vw,40px) 60px}
.bp-intro{margin-bottom:26px;max-width:640px}
.bp-intro .eyebrow{font-size:10px;color:#2563eb;font-weight:850;letter-spacing:.13em}
.bp-intro h1{font-size:clamp(26px,4vw,38px);line-height:1.1;margin:6px 0 10px}
.bp-intro p{color:var(--muted)}
.bp-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr);gap:22px;align-items:start}
.bp-catalog .search-input{max-width:none;margin-bottom:12px}
.bp-tools{display:grid;gap:8px;max-height:62vh;overflow-y:auto;padding-right:2px}
.bp-tool{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:center;width:100%;text-align:left;padding:13px 14px;border:1px solid var(--line);background:#fff;border-radius:11px}
.bp-tool:hover{border-color:#9dc3ff}
.bp-tool[aria-pressed="true"]{border-color:#2563eb;background:#f7faff;box-shadow:inset 3px 0 #2563eb}
.bp-tool-id{font:700 11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#e5eef9;color:#28547d;border-radius:7px;padding:8px 9px;white-space:nowrap}
.bp-tool strong{display:block}
.bp-tool-photo{width:96px;height:auto;min-height:64px;display:grid;place-items:center;background:linear-gradient(145deg,#fff,#e6f0ff);border:1px solid #bfd6fb;border-radius:12px;box-shadow:0 4px 12px #1d4ed812;overflow:hidden;text-align:center;color:var(--muted);font-size:12px}
.bp-tool-photo,.bp-selected-image{min-width:0;padding:4px;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.bp-tool-photo img,.bp-selected-image img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;object-position:center}
.bp-tool-photo img{max-height:150px}
.bp-tool .bp-tool-id{display:inline-block;margin-bottom:6px;white-space:normal;overflow-wrap:anywhere}
.bp-selected-photo{border:1px solid var(--line);border-radius:10px;padding:12px;display:grid;gap:8px}
.bp-selected-image{display:grid;place-items:center;height:auto;min-height:100px;background:radial-gradient(ellipse at 25% 15%,#fff,#e4efff);border:1px solid #bfd6fb;box-shadow:inset 0 1px 0 #fff,0 8px 22px #1d4ed812;overflow:hidden;border-radius:14px;color:var(--muted)}
.bp-selected-image img{max-height:min(52dvh,480px)}
.bp-selected-photo small{color:var(--muted)}
.bp-request-holders{min-width:0;padding:12px;border:1px solid var(--line);border-radius:8px;background:#f0f7ff;display:grid;gap:8px;overflow-wrap:anywhere}
.bp-request-holders ul{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.bp-request-holders li{display:grid;gap:3px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.bp-request-holders li span{font-size:13px;color:var(--muted)}
.bp-tool-photo .hidden,.bp-selected-image .hidden,.bp-selected-photo.hidden{display:none}
.bp-tool small{display:block;color:var(--muted);margin-top:2px;overflow-wrap:anywhere}
.bp-set-fields{border:1px solid var(--line);border-radius:10px;padding:14px;display:grid;gap:10px;min-width:0}
.bp-set-fields legend{font-weight:700;font-size:13px;padding:0 5px}
.bp-set-fields p{font-size:12px;line-height:1.6;margin:0}
.bp-set-fields.hidden,.bp-set-fields .hidden{display:none}
.bp-sub{margin:4px 0 18px;font-size:13px}
#bpReqForm{display:grid;gap:14px}
.bp-ack{text-align:center;padding:18px 4px}
.bp-ack:focus{outline:0}
.bp-ack-mark{width:60px;height:60px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;background:#dcfce7;color:#166534;font-size:28px;font-weight:800;animation:bpPop .35s ease-out}
.bp-ack h2{margin-bottom:6px}.bp-ack p{margin-bottom:10px}.bp-ack .primary{margin-top:10px}
@keyframes bpPop{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
.bp-skel{height:58px;border-radius:11px;background:linear-gradient(90deg,#e8eef6 25%,#f4f7fb 50%,#e8eef6 75%);background-size:200% 100%;animation:bpShim 1.3s infinite linear}
@keyframes bpShim{to{background-position:-200% 0}}
.bp-err{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;border-radius:10px;padding:12px 14px;font-size:13px}
@media(max-width:900px){.bp-grid{grid-template-columns:1fr}.bp-entry{position:static}.bp-tools{max-height:none}}
@media(max-width:520px){.bp-who>#bpWho{display:none}.bp-main{padding-top:22px}}
.bp-entry{position:sticky;top:20px;display:grid;gap:12px}
@media(max-width:900px){.bp-entry{position:static}}
.bp-entry .eyebrow{font-size:10px;color:#2563eb;font-weight:850;letter-spacing:.13em}
.bp-entry-tool{border:1px dashed #c7d5e8;border-radius:10px;padding:12px 14px;font-size:13px;color:var(--muted);background:#f8fafc}
.bp-entry-tool.chosen{border-style:solid;border-color:#9dc3ff;background:#f7faff;color:var(--ink)}
.bp-entry-tool small{display:block;color:var(--muted);margin-top:2px}
body.bp-req-open{overflow:hidden}
.bp-req-dialog{--bp-vvh:100dvh;width:min(560px,calc(100vw - 24px));height:auto;max-height:calc(var(--bp-vvh) - 24px);border:0;border-radius:18px;padding:0;margin:auto;background:#fff;color:var(--ink);box-shadow:0 24px 90px #071a3d50;overflow:hidden;flex-direction:column}
.bp-req-dialog[open]{display:flex}
#bpAddToolForm{display:flex;flex-direction:column;min-height:0;overflow:hidden}
#bpAddToolDialog{width:min(780px,calc(100vw - 24px))}
#bpAddToolDialog .dialog-fields{padding:18px 0 0;overflow:visible}
#bpAddToolDialog .field{margin-bottom:0}
@media(max-width:640px){
 #bpAddToolDialog{width:100vw}
 #bpAddToolDialog .dialog-fields{grid-template-columns:1fr}
}
#bpAddToolDialog input,#bpAddToolDialog select,#bpAddToolDialog textarea{width:100%;min-width:0;box-sizing:border-box;font:inherit;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--card,#fff);color:var(--ink)}
#bpAddToolDialog label{display:block;margin-bottom:6px}
#bpCatalog .section-title{flex-wrap:wrap}
.bp-request-item{padding:12px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}
.bp-request-item p{margin:6px 0;font-size:13px}
#bpRequestList{margin-top:14px;min-width:0}
#bpAddToRequest{margin-top:8px}
.bp-req-dialog::backdrop{background:#06152cb0}
.bp-req-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line);flex:none}
.bp-req-head small{font-size:10px;letter-spacing:.13em;font-weight:850;color:#2563eb}
.bp-req-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:18px 20px}
#bpTargetDialog .bp-req-body{flex:0 1 auto}
.bp-req-foot{flex:none;border-top:1px solid var(--line);padding:12px 20px calc(12px + env(safe-area-inset-bottom,0px));background:#fff;display:grid;gap:8px}
.bp-req-foot .form-error{margin:0}.bp-req-foot .form-error:empty{display:none}
.bp-req-actions{display:flex;gap:10px;justify-content:flex-end}
.bp-req-actions .primary{flex:1;max-width:260px;display:flex;justify-content:space-between}
.bp-req-actions .primary[hidden]{display:none}
.bp-req-dialog .bp-selected-image{height:auto}
.bp-borrowing-reminders{max-width:1180px;margin:18px auto 0;padding:0 24px;display:grid;gap:12px;color:var(--ink)}
.bp-borrowing-reminders[hidden]{display:none}
.bp-late-total{display:grid;gap:5px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px 18px}
.bp-late-total strong{font-size:17px}.bp-late-total strong span{font-size:23px}
.bp-late-total small,.bp-reminder-footnote{font-size:12px;line-height:1.5;color:var(--muted)}
.bp-reminder{display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,190px);gap:16px;align-items:start;background:#fffbeb;border:1px solid #f3d18a;border-radius:12px;padding:18px;overflow-wrap:anywhere}
.bp-reminder-late{background:#fff1f2;border-color:#fecdd3}
.bp-reminder h2{font-size:17px;margin:0 0 8px}.bp-reminder p{margin:0 0 10px;font-size:14px;line-height:1.6}
.bp-reminder small{font-size:12px;line-height:1.5}.bp-reminder>.ghost{min-width:0}
.bp-reminder .ho-actions{flex-wrap:wrap}.bp-reminder .ho-actions>button{min-width:0;max-width:100%}
.bp-reminder-footnote{margin:0}
@media(max-width:600px){.bp-borrowing-reminders{padding:0 16px}.bp-reminder{grid-template-columns:1fr;gap:12px}.bp-reminder>.ghost{justify-self:start;max-width:100%}}
@media(max-width:600px){.bp-req-dialog{width:100vw;max-width:100vw;max-height:var(--bp-vvh);margin:auto 0 0;border-radius:16px 16px 0 0}.bp-req-dialog .bp-selected-image{height:auto}.bp-req-actions .primary{max-width:none}}

/* ---- Responsive usability pass ---- */
.bp-top{flex-wrap:wrap;padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
.bp-who{flex-wrap:wrap;justify-content:flex-end}
.bp-who a.ghost{text-decoration:none;display:inline-flex;align-items:center}
.bp-tool{grid-template-columns:auto minmax(0,1fr)}
.bp-tool>*{min-width:0}
.bp-req-actions{flex-wrap:wrap}
.bp-profile-dialog{max-height:85dvh}
.bp-reminder .ho-actions>button{white-space:normal}
@media(max-width:720px){
 .bp-top{padding-top:10px;padding-bottom:10px}
 .bp-who{width:100%;justify-content:flex-start;gap:8px}
 .bp-who>.ghost,.bp-who>a.ghost{flex:1 1 auto;justify-content:center;min-height:44px}
 .bp-main{padding-bottom:calc(48px + env(safe-area-inset-bottom))}
 .bp-tool-photo{width:76px;height:auto}
 .bp-selected-image{height:auto}
 .bp-profile-preview{width:min(200px,100%);height:auto}
 .bp-borrowing-reminders{padding:0 14px}
}
@media(max-width:400px){
 .bp-tool{grid-template-columns:64px minmax(0,1fr);gap:10px;padding:11px}
 .bp-tool-photo{width:64px;height:auto}
 .bp-req-head,.bp-req-body{padding-left:14px;padding-right:14px}
 .bp-req-foot{padding-left:14px;padding-right:14px}
 .bp-req-actions>button{flex:1 1 120px}
}
@media(max-height:520px) and (orientation:landscape){
 .bp-req-dialog .bp-selected-image{height:auto;min-height:70px}
 .bp-selected-image img{max-height:45dvh}
 .bp-tools{max-height:none}
 .bp-entry{position:static}
}
@media(hover:hover) and (prefers-reduced-motion:no-preference){
 .bp-tool-photo{transition:box-shadow .18s,border-color .18s}
 .bp-tool:hover .bp-tool-photo{border-color:#729fee;box-shadow:0 6px 18px #1d4ed825}
}
