/* NGM Library — frontend (inherits the theme's fonts; mobile-first) */
.ngmls { --nl-accent: var(--ngmls-brand, #1d4f91); --nl-accent-ink: var(--ngmls-brand-ink, #fff); --nl-line: rgba(127, 127, 127, .28); --nl-soft: var(--ngmls-brand-soft, rgba(29, 79, 145, .06)); --nl-muted: inherit; --nl-ok: #1a7f37; --nl-warn: #a35200; --nl-bad: #b32d2e; box-sizing: border-box; line-height: 1.5; }
.ngmls *, .ngmls *::before, .ngmls *::after { box-sizing: inherit; }
.ngmls a { color: var(--nl-accent); }
.ngmls .ngmls-meta, .ngmls small { opacity: .8; font-size: .92em; }
.ngmls-btn, .ngmls button[type=submit], .ngmls-search button, .ngmls-searchbox button { display: inline-block; background: var(--nl-accent); color: var(--nl-accent-ink) !important; border: 0; border-radius: 6px; padding: .55em 1.1em; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.ngmls-btn-sec { display: inline-block; background: transparent; color: var(--nl-accent) !important; border: 1px solid var(--nl-accent); border-radius: 6px; padding: .45em 1em; font: inherit; cursor: pointer; text-decoration: none; min-height: 40px; }
.ngmls-btn:hover, .ngmls-btn-sec:hover { filter: brightness(1.1); }
.ngmls input[type=text], .ngmls input[type=search], .ngmls input[type=email], .ngmls input[type=date], .ngmls input:not([type]), .ngmls select, .ngmls textarea, .ngmls-searchbox input { font: inherit; padding: .5em .7em; border: 1px solid var(--nl-line); border-radius: 6px; background: transparent; color: inherit; min-height: 44px; width: 100%; }
.ngmls :focus-visible { outline: 2px solid var(--nl-accent); outline-offset: 2px; }
.ngmls-msg { border-left: 4px solid var(--nl-accent); background: var(--nl-soft); padding: .7em 1em; margin: 0 0 1em; border-radius: 4px; }
.ngmls-msg-success { border-color: var(--nl-ok); }
.ngmls-msg-error { border-color: var(--nl-bad); }
.ngmls-empty { padding: 1em; border: 1px dashed var(--nl-line); border-radius: 6px; }
.ngmls-hp { position: absolute !important; left: -9999px !important; }
.ngmls-hidden { display: none; }
.ngmls-tag { display: inline-block; font-size: .8em; padding: .05em .6em; border: 1px solid var(--nl-line); border-radius: 999px; margin-right: .4em; }
.ngmls-table-wrap { overflow-x: auto; }
.ngmls-table { width: 100%; border-collapse: collapse; margin: .5em 0 1em; }
.ngmls-table th, .ngmls-table td { text-align: left; padding: .5em .6em; border-bottom: 1px solid var(--nl-line); vertical-align: top; }

/* Search */
.ngmls-search, .ngmls-searchbox { display: flex; gap: .5em; flex-wrap: wrap; margin: 0 0 1em; }
.ngmls-search select { width: auto; flex: 0 0 auto; }
.ngmls-search input[type=search], .ngmls-searchbox input { flex: 1 1 240px; width: auto; }

/* OPAC */
.ngmls-opac-body { display: grid; grid-template-columns: 220px 1fr; gap: 1.5em; }
.ngmls-facet { margin-bottom: 1.1em; }
.ngmls-facet h4 { margin: 0 0 .4em; font-size: .95em; text-transform: uppercase; letter-spacing: .03em; }
.ngmls-facet ul { list-style: none; margin: 0; padding: 0; }
.ngmls-facet li { display: flex; justify-content: space-between; gap: .5em; font-size: .93em; padding: .15em 0; }
.ngmls-facet li span { opacity: .7; font-variant-numeric: tabular-nums; }
.ngmls-facet li.on a { font-weight: 700; }
.ngmls-facet li.on a::after { content: " ✕"; font-weight: 400; }
.ngmls-results-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5em; font-size: .93em; margin-bottom: .6em; }
.ngmls-hit { display: flex; gap: 1em; padding: .9em 0; border-bottom: 1px solid var(--nl-line); }
.ngmls-hit h3 { margin: 0 0 .2em; font-size: 1.08em; line-height: 1.35; }
.ngmls-hit h3 a { text-decoration: none; }
.ngmls-hit p { margin: .15em 0; }
.ngmls-cover { flex: 0 0 64px; width: 64px; height: 90px; border-radius: 3px; overflow: hidden; background: var(--nl-soft); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.ngmls-cover img { width: 100%; height: 100%; object-fit: cover; }
.ngmls-cover span { font-size: 1.8em; font-weight: 700; color: var(--nl-accent); opacity: .5; }
.ngmls-avail { font-weight: 600; }
.ngmls-avail.yes { color: var(--nl-ok); }
.ngmls-avail.no { color: var(--nl-warn); }
.ngmls-pages { display: flex; gap: 1em; justify-content: center; align-items: center; margin: 1.2em 0; }
.ngmls-record-head { display: flex; gap: 1.5em; align-items: flex-start; }
.ngmls-cover-lg { width: 150px; max-width: 35%; border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.ngmls-dl { display: grid; grid-template-columns: max-content 1fr; gap: .25em 1em; margin: .8em 0; }
.ngmls-dl dt { font-weight: 600; }
.ngmls-dl dd { margin: 0; }
.ngmls-record .st-available { color: var(--nl-ok); font-weight: 600; }
.ngmls-record .st-issued, .ngmls-record .st-on_hold { color: var(--nl-warn); }
.ngmls-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1em; }
.ngmls-shelf-item { display: flex; flex-direction: column; gap: .3em; text-decoration: none; color: inherit !important; font-size: .9em; }
.ngmls-shelf-item img, .ngmls-shelf-item .ngmls-cover { width: 100%; height: 170px; object-fit: cover; border-radius: 4px; flex: none; }

/* Portal */
.ngmls-portal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; }
.ngmls-portal-head h2 { margin: 0; }
.ngmls-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6em; margin: 1em 0; }
.ngmls-stats div { border: 1px solid var(--nl-line); border-radius: 8px; padding: .7em; text-align: center; }
.ngmls-stats strong { display: block; font-size: 1.35em; font-variant-numeric: tabular-nums; }
.ngmls-stats span { font-size: .85em; opacity: .8; }
.ngmls-stats .warn { border-color: var(--nl-warn); }
.ngmls-stats .warn strong { color: var(--nl-warn); }
.ngmls-tabs { display: flex; gap: .2em; overflow-x: auto; border-bottom: 1px solid var(--nl-line); margin: 0 0 1em; -webkit-overflow-scrolling: touch; }
.ngmls-tabs a { padding: .6em .9em; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.ngmls-tabs a.on { border-bottom-color: var(--nl-accent); font-weight: 600; }
.ngmls-row { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: .8em 0; border-bottom: 1px solid var(--nl-line); }
.ngmls-row.overdue { border-left: 4px solid var(--nl-bad); padding-left: .8em; }
.ngmls-row form { flex: none; margin: 0; }
.ngmls .ok { color: var(--nl-ok); }
.ngmls .warn { color: var(--nl-warn); }
.ngmls .bad { color: var(--nl-bad); }
.ngmls-list { padding-left: 1.2em; }
.ngmls-idcard { max-width: 360px; border: 1px solid var(--nl-line); border-radius: 12px; padding: 1em; background: #fff; color: #111; }
.ngmls-idcard .hd { font-weight: 700; text-align: center; border-bottom: 1px solid #ccc; padding-bottom: .4em; margin-bottom: .6em; }
.ngmls-idcard .bd { display: flex; gap: .8em; }
.ngmls-idcard .bd img { width: 72px; height: 90px; object-fit: cover; border-radius: 4px; }
.ngmls-idcard .bc svg { width: 100%; height: auto; margin-top: .6em; }
.ngmls-idcard .qr { width: 110px; margin: .5em auto 0; }
.ngmls-idcard .qr svg { width: 100%; height: auto; }
.ngmls-login form p { margin: 0 0 .7em; }
.ngmls-or { text-align: center; opacity: .7; }

/* Forms */
.ngmls-form label { display: block; font-weight: 600; margin: 0 0 .8em; }
.ngmls-form label input, .ngmls-form label select, .ngmls-form label textarea { margin-top: .25em; font-weight: 400; }
.ngmls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1em; }

/* Resources, repository, researchers */
.ngmls-res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1em; margin-bottom: 1.5em; }
.ngmls-res { border: 1px solid var(--nl-line); border-radius: 8px; padding: 1em; display: flex; flex-direction: column; }
.ngmls-res h4 { margin: 0 0 .2em; }
.ngmls-res p:last-child { margin-top: auto; }
.ngmls-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1em; margin-top: 1em; }
.ngmls-person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2em; border: 1px solid var(--nl-line); border-radius: 8px; padding: 1em; text-decoration: none; color: inherit !important; }
.ngmls-person img, .ngmls-initial, .ngmls-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.ngmls-initial { display: flex; align-items: center; justify-content: center; background: var(--nl-soft); font-size: 2em; color: var(--nl-accent); }
.ngmls-ids a { margin-right: .8em; }
.ngmls-pubs li { margin-bottom: .5em; }
.ngmls-clearance { border-radius: 8px; padding: 1em; margin: .6em 0; border: 1px solid var(--nl-line); }
.ngmls-clearance.clear { border-color: var(--nl-ok); }
.ngmls-clearance.pending { border-color: var(--nl-warn); }
.ngmls-nodues section { margin-bottom: 1.5em; }

/* Student mobile dashboard */
@media (max-width: 760px) {
	.ngmls-opac-body { grid-template-columns: 1fr; }
	.ngmls-facets { order: 2; display: flex; flex-wrap: wrap; gap: 1em; }
	.ngmls-facet { flex: 1 1 140px; }
	.ngmls-stats { grid-template-columns: repeat(2, 1fr); }
	.ngmls-record-head { flex-direction: column; }
	.ngmls-cover-lg { max-width: 140px; }
	.ngmls-dl { grid-template-columns: 1fr; }
	.ngmls-dl dt { margin-top: .4em; }
	.ngmls-table thead { display: none; }
	.ngmls-table tr { display: block; border-bottom: 1px solid var(--nl-line); padding: .4em 0; }
	.ngmls-table td { display: block; border: 0; padding: .15em 0; }
	.ngmls-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; }
	.ngmls-row { flex-direction: column; align-items: stretch; }
	.ngmls-row form button { width: 100%; }
}

/* Staff dashboard */
.ngmls-staff-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; flex-wrap: wrap; }
.ngmls-staff-head h2 { margin: 0; }
.ngmls-staff-links { display: flex; gap: .8em; align-items: center; }
.ngmls-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6em; margin: 0 0 1em; }
.ngmls-kpis > a, .ngmls-kpis > div { display: flex; flex-direction: column; border: 1px solid var(--nl-line); border-left: 4px solid var(--nl-accent); border-radius: 8px; padding: .7em .8em; text-decoration: none; color: inherit !important; }
.ngmls-kpis strong { font-size: 1.4em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ngmls-kpis span { font-size: .85em; opacity: .8; }
.ngmls-staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1em; }
.ngmls-card-box { border: 1px solid var(--nl-line); border-radius: 8px; padding: 1em; margin-bottom: 1em; }
.ngmls-card-box h3 { margin: 0 0 .6em; font-size: 1.05em; }
.ngmls-card-box h3 small { font-weight: 400; opacity: .7; }
.ngmls-card-box textarea { min-height: 5em; }
.ngmls-member-mini { display: flex; gap: .8em; align-items: center; background: var(--nl-soft); border-radius: 8px; padding: .7em; margin: .6em 0 1em; }
.ngmls-member-mini img { width: 56px; height: 70px; object-fit: cover; border-radius: 4px; }
.ngmls-staff tr.is-overdue td { background: rgba(179, 45, 46, .06); }
.ngmls-staff .ngmls-inline { display: flex; flex-wrap: wrap; gap: .6em; align-items: flex-end; }
.ngmls-staff .ngmls-inline label { margin: 0; }
.ngmls-huge { font-size: 1.4em !important; }
.ngmls-gatebox { text-align: left; }
.ngmls-chart { width: 100%; height: auto; display: block; }
.ngmls-chart .grid { stroke: var(--nl-line); stroke-width: 1; }
.ngmls-chart .base { stroke: currentColor; stroke-opacity: .5; stroke-width: 1; }
.ngmls-chart .axis { fill: currentColor; fill-opacity: .7; font-size: 10px; }
.ngmls-chart .bar path { fill: #2f6db5; }
.ngmls-chart .bar .hit { fill: transparent; }
.ngmls-chart .bar:hover path { fill: var(--nl-accent); }

/* v2.2 — type-ahead suggestions */
.ngmls-sg-wrap { position: relative; display: block; flex: 1 1 240px; min-width: 0; }
.ngmls-sg-wrap input { width: 100% !important; }
.ngmls-sg { position: absolute; z-index: 50; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none; background: Canvas; color: CanvasText; border: 1px solid var(--nl-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); max-height: 60vh; overflow: auto; }
.ngmls-sg[hidden] { display: none; }
.ngmls-sg li { margin: 0; }
.ngmls-sg a { display: flex; flex-direction: column; padding: .5em .9em; text-decoration: none; color: inherit; }
.ngmls-sg li.on a, .ngmls-sg a:hover { background: var(--nl-soft); outline: 0; }
.ngmls-sg li.on a { box-shadow: inset 3px 0 0 var(--nl-accent); }
.ngmls-sg-t { font-weight: 600; }
.ngmls-sg-s { opacity: .7; }

/* v2.2 — installable app */
.ngmls-install { display: flex; flex-wrap: wrap; align-items: center; gap: .6em; margin: 0 0 1em; padding: .6em .8em; border: 1px dashed var(--nl-accent); border-radius: 8px; background: var(--nl-soft); }
.ngmls-install[hidden], .ngmls-push[hidden], .ngmls-offline-card [hidden] { display: none !important; }
.ngmls-push { margin-top: 1.5em; padding-top: 1em; border-top: 1px solid var(--nl-line); }
.ngmls-offline-card { margin-top: .8em; }

/* v2.2 — camera button (matches the secondary button style; overrides theme/submit button rules) */
.ngmls button.ngmls-cam-btn, .ngmls-searchbox button.ngmls-cam-btn { display: inline-flex; align-items: center; gap: .4em; background: transparent !important; color: var(--nl-accent, #1d4f91) !important; border: 1px solid var(--nl-accent, #1d4f91) !important; border-radius: 6px; padding: .45em .9em; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; }
.ngmls button.ngmls-cam-btn:hover { background: var(--nl-soft, rgba(29, 79, 145, .08)) !important; }

/* ---- Library App home + Messages (2.4) ---- */
.ngmls-app { max-width: 720px; margin-inline: auto; }
.ngmls-app-hero { background: var(--nl-accent); color: var(--nl-accent-ink); border-radius: 18px; padding: 1.1em 1.1em 1.2em; margin: 0 0 1em; }
.ngmls-app-hero h2 { margin: .1em 0 0; font-size: 1.6em; line-height: 1.2; color: inherit; }
.ngmls-app-eyebrow { margin: 0; font-size: .78em; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.ngmls-app-lib { margin: .1em 0 .9em; opacity: .92; }
.ngmls-app-hero .ngmls-searchbox { display: flex; gap: .4em; margin: 0; }
.ngmls-app-hero .ngmls-searchbox input { background: #fff; color: #111; border-color: transparent; }
.ngmls-app-hero .ngmls-searchbox button { background: rgba(0, 0, 0, .28); }
.ngmls-app-hero .ngmls-searchbox button.ngmls-cam-btn { background: #fff !important; color: var(--nl-accent) !important; border: 0 !important; border-radius: 6px; }
.ngmls-app-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6em; margin: 0 0 1em; }
.ngmls-app-sum a { display: flex; flex-direction: column; gap: .1em; padding: .7em .8em; border: 1px solid var(--nl-line); border-radius: 14px; text-decoration: none; color: inherit; }
.ngmls-app-sum strong { font-size: 1.5em; line-height: 1.1; }
.ngmls-app-sum span { font-size: .82em; opacity: .8; }
.ngmls-app-sum .warn strong { color: var(--nl-warn); } .ngmls-app-sum .bad strong { color: var(--nl-bad); } .ngmls-app-sum .ok strong { color: var(--nl-ok); }
.ngmls-app-sec { margin: 0 0 1.4em; }
.ngmls-app-sec h3 { margin: 0 0 .5em; font-size: 1.05em; }
.ngmls-app-due, .ngmls-app-news { list-style: none; margin: 0; padding: 0; }
.ngmls-app-due li, .ngmls-app-news li { display: flex; justify-content: space-between; gap: 1em; padding: .55em 0; border-bottom: 1px solid var(--nl-line); }
.ngmls-app-due li.bad b { color: var(--nl-bad); }
.ngmls-app-due b, .ngmls-app-news time { white-space: nowrap; font-size: .88em; }
.ngmls-app-news time { opacity: .7; }
.ngmls-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6em; }
.ngmls-app-grid a { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .35em; padding: .8em .4em; border: 1px solid var(--nl-line); border-radius: 14px; text-align: center; text-decoration: none; color: inherit; font-size: .82em; line-height: 1.25; min-height: 84px; }
.ngmls-app-grid a svg { width: 28px; height: 28px; fill: none; stroke: var(--nl-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ngmls-app-grid a:hover, .ngmls-app-sum a:hover { background: var(--nl-soft); }
.ngmls-app-sign { padding: 1em; border: 1px dashed var(--nl-line); border-radius: 14px; margin: 0 0 1.4em; }
.ngmls-app-info dl { display: grid; grid-template-columns: max-content 1fr; gap: .3em 1em; margin: 0; }
.ngmls-app-info dt { opacity: .7; } .ngmls-app-info dd { margin: 0; }
.ngmls-inbox { list-style: none; margin: 0; padding: 0; }
.ngmls-inbox li { padding: .8em 0; border-bottom: 1px solid var(--nl-line); }
.ngmls-inbox-head { display: flex; justify-content: space-between; gap: 1em; }
.ngmls-inbox-head time { font-size: .85em; opacity: .7; white-space: nowrap; }
.ngmls-inbox p { margin: .3em 0 0; }
