/* Shared reference-image presentation for the final WWW interface.
   Source JS owns every open/file/upload/error/ready/reschedule state. */
body.nd-ui-v174 .bg-ref-upload-box { margin:12px 0; padding:16px; border:1px solid var(--nd-line); border-radius:var(--nd-radius-md); background:var(--nd-surface-muted); color:var(--nd-text); box-shadow:none; min-width:0; }
body.nd-ui-v174 .bg-ref-upload-box.bg-ref-compact { display:block; position:relative; inset:auto; transform:none; z-index:1; width:100%; margin:0; padding:0; border:0; background:transparent; box-shadow:none; overflow:visible; }
body.nd-ui-v174 .bg-ref-upload-head { display:flex; align-items:flex-start; gap:12px; min-width:0; }
body.nd-ui-v174 .bg-ref-icon { display:flex; align-items:center; justify-content:center; flex:0 0 38px; width:38px; height:38px; border-radius:var(--nd-radius-sm); background:var(--nd-accent-soft); color:var(--nd-accent-hover); font-size:19px; }
body.nd-ui-v174 .bg-ref-upload-head strong { display:block; margin-bottom:4px; color:var(--nd-text); font-size:15px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-upload-head p { margin:0; color:var(--nd-muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-upload-toggle { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:48px; padding:10px 12px; border:1px dashed var(--nd-line-strong); border-radius:var(--nd-radius-sm); background:var(--nd-surface); color:var(--nd-text); font:inherit; text-align:left; cursor:pointer; }
body.nd-ui-v174 .bg-ref-upload-toggle > span:not(.bg-ref-icon) { display:grid; flex:1; min-width:0; gap:4px; }
body.nd-ui-v174 .bg-ref-upload-toggle strong { color:var(--nd-text); font-size:13px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-upload-toggle small { color:var(--nd-muted); font-size:12px; font-weight:400; line-height:1.5; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-upload-toggle i { display:grid; place-items:center; flex:0 0 28px; height:28px; border-radius:var(--nd-radius-sm); background:var(--nd-accent-soft); color:var(--nd-accent-hover); font-style:normal; }
body.nd-ui-v174 .bg-ref-upload-box.is-open .bg-ref-upload-toggle i { transform:rotate(45deg); }
body.nd-ui-v174 .bg-ref-upload-body { display:none; margin-top:10px; padding:12px; border:1px solid var(--nd-line); border-radius:var(--nd-radius-md); background:var(--nd-surface-muted); box-shadow:none; }
body.nd-ui-v174 .bg-ref-upload-box.is-open .bg-ref-upload-body,
body.nd-ui-v174 .bg-ref-upload-box.has-file .bg-ref-upload-body { display:grid; gap:8px; }
body.nd-ui-v174 .bg-ref-upload-body .bg-ref-upload-head { display:none; }
body.nd-ui-v174 .bg-ref-file-label { position:relative; display:flex; align-items:center; justify-content:center; width:100%; min-height:44px; margin:12px 0 0; padding:0; border:1px dashed var(--nd-line-strong); border-radius:var(--nd-radius-sm); background:var(--nd-surface); color:var(--nd-accent-hover); font-weight:500; text-align:center; cursor:pointer; }
body.nd-ui-v174 .bg-ref-upload-body .bg-ref-file-label { margin:0; }
body.nd-ui-v174 :is(.bg-ref-file-label,.bg-ref-mini-file) input { position:absolute; width:1px; height:1px; min-height:0; margin:0; padding:0; border:0; overflow:hidden; opacity:0; pointer-events:none; }
body.nd-ui-v174 :is(.bg-ref-file-label,.bg-ref-mini-file):focus-within { outline:3px solid var(--nd-focus); outline-offset:3px; }
body.nd-ui-v174 .bg-ref-file-label span { display:flex; align-items:center; justify-content:center; gap:8px; padding:12px; font-size:13px; font-weight:500; line-height:1.5; white-space:normal; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-file-label span::before { content:'+'; font-size:18px; font-weight:600; line-height:1; }
body.nd-ui-v174 .bg-ref-file-name { min-height:16px; margin-top:8px; color:var(--nd-text); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-hint { margin:4px 0 0; color:var(--nd-muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-upload-box.has-file { border-color:var(--nd-success-line); background:var(--nd-success-soft); }
body.nd-ui-v174 .bg-ref-upload-box.bg-ref-compact.has-file { border:0; background:transparent; }
body.nd-ui-v174 .bg-ref-upload-box.is-uploading { opacity:.7; pointer-events:none; }
body.nd-ui-v174 .bg-ref-upload-box.is-uploading .bg-ref-file-label span::before { content:'↻'; }
body.nd-ui-v174 :is(.bg-ref-upload-error,.bg-ref-upload-ok) { display:none; margin:0; padding:10px 12px; border-radius:var(--nd-radius-sm); font-size:13px; font-weight:500; line-height:1.6; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-upload-error { background:var(--nd-danger-soft); color:var(--nd-danger); }
body.nd-ui-v174 .bg-ref-upload-ok { background:var(--nd-success-soft); color:var(--nd-success); }
body.nd-ui-v174 .bg-ref-upload-box.has-error .bg-ref-upload-error,
body.nd-ui-v174 .bg-ref-upload-box.is-ready .bg-ref-upload-ok { display:block; }
body.nd-ui-v174.client-v27-reschedule-mode .bg-ref-upload-box[data-bg-ref-main] { display:none; }
body.nd-ui-v174 .bg-ref-card-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; margin-top:12px; padding:12px; border:1px solid var(--nd-line); border-radius:var(--nd-radius-md); background:var(--nd-surface-muted); }
body.nd-ui-v174 :is(.bg-ref-view-link,.bg-ref-card-actions button,.bg-ref-mini-file span) { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; max-width:100%; padding:10px 12px; border:1px solid var(--nd-line-strong); border-radius:var(--nd-radius-sm); font:inherit; font-size:13px; font-weight:500; line-height:1.5; text-align:center; text-decoration:none; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-view-link { border-color:var(--nd-graphite); background:var(--nd-graphite); color:#fff; }
body.nd-ui-v174 .bg-ref-inline-form { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; margin:0; }
body.nd-ui-v174 .bg-ref-mini-file { display:inline-flex; width:auto; margin:0; cursor:pointer; }
body.nd-ui-v174 .bg-ref-mini-file span { border-style:dashed; background:var(--nd-surface); color:var(--nd-accent-hover); }
body.nd-ui-v174 .bg-ref-card-actions button { background:var(--nd-surface); color:var(--nd-text); cursor:pointer; }
body.nd-ui-v174 .bg-ref-card-actions .bg-ref-remove-form button { border-color:var(--nd-danger-line); background:var(--nd-danger-soft); color:var(--nd-danger); }
body.nd-ui-v174 .bg-ref-empty-note { color:var(--nd-muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-owner-badge { display:inline-flex; align-items:center; gap:6px; width:max-content; max-width:100%; margin-top:8px; padding:6px 9px; border:1px solid var(--nd-line); border-radius:var(--nd-radius-pill); background:var(--nd-surface-muted); color:var(--nd-muted); font-size:12px; font-weight:500; line-height:1.5; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-owner-sheet-box { border-color:var(--nd-line); background:var(--nd-surface-muted); }
body.nd-ui-v174 .bg-ref-owner-sheet-box .booking-reference-preview { display:flex; align-items:center; gap:12px; margin-top:10px; color:var(--nd-text); text-decoration:none; }
body.nd-ui-v174 .bg-ref-owner-sheet-box .booking-reference-preview img { flex:0 0 80px; width:80px; height:80px; border:1px solid var(--nd-line); border-radius:var(--nd-radius-sm); background:var(--nd-surface); object-fit:cover; }
body.nd-ui-v174 .bg-ref-owner-sheet-box .booking-reference-preview strong { display:block; color:var(--nd-text); font-size:13px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-owner-sheet-box :is(.booking-reference-preview small,.booking-reference-caption small) { display:block; margin-top:4px; color:var(--nd-muted); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
body.nd-ui-v174 .bg-ref-owner-sheet-box .booking-reference-caption { min-width:0; }
@media(max-width:850px) {
    body.nd-ui-v174 :is(.bg-ref-card-actions,.bg-ref-inline-form) { display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; }
    body.nd-ui-v174 :is(.bg-ref-view-link,.bg-ref-card-actions button,.bg-ref-mini-file,.bg-ref-mini-file span) { width:100%; }
}
@media(max-width:640px) {
    body.nd-ui-v174 .bg-ref-owner-sheet-box .booking-reference-preview { align-items:flex-start; }
    body.nd-ui-v174 .bg-ref-owner-sheet-box .booking-reference-preview img { flex-basis:68px; width:68px; height:68px; }
}
