/* ============================================================================
   Norquest Knowledge Base
   Palette and typography lifted from norquestindustries.com (Avada theme
   variables --awb-color1..8 and --awb-typography1..5).
   ========================================================================== */

:root {
	color-scheme: light;

	/* Brand palette, straight from the site's theme variables */
	--nq-white:      #ffffff;
	--nq-surface:    #f1f1f1;   /* awb-color2 */
	--nq-line:       #e5e5e5;   /* awb-color3 */
	--nq-ink:        #222222;   /* awb-color4 — headings, nav */
	--nq-red:        #ee2d24;   /* awb-color5 — primary accent */
	--nq-gray:       #959ca2;   /* awb-color6 — muted UI text */
	--nq-olive:      #554f2d;   /* awb-color7 — body copy, footer */
	--nq-black:      #111111;   /* awb-color8 */

	/* Derived. --nq-red-dark matches the theme's own button hover (L - 8%). */
	--nq-red-dark:   #c81c14;
	--nq-red-wash:   #fdeceb;
	--nq-olive-soft: #8a8360;
	--nq-ink-soft:   #4a4a4a;

	/* Status colours — kept distinct from the brand red, which means "action" */
	--nq-amber:      #b8730a;
	--nq-amber-wash: #fdf3e2;
	--nq-green:      #2f7a48;
	--nq-green-wash: #eaf5ee;
	--nq-blue:       #2b5f8f;
	--nq-blue-wash:  #eaf1f8;

	--nq-font: 'Plus Jakarta Sans', Arial, Helvetica, sans-serif;

	--nq-shadow-sm: 0 1px 2px rgba(17, 17, 17, .06);
	--nq-shadow:    0 2px 10px rgba(17, 17, 17, .08);
	--nq-shadow-lg: 0 12px 32px rgba(17, 17, 17, .12);

	--nq-radius: 3px;         /* the site is squared off; keep corners tight */
	--nq-wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--nq-white);
	color: var(--nq-olive);
	font-family: var(--nq-font);
	font-size: 16px;
	font-weight: 300;         /* awb-typography4 */
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--nq-font);
	color: var(--nq-ink);
	font-weight: 700;         /* awb-typography1 */
	line-height: 1.2;
	margin: 0 0 .5em;
}
h1 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

a { color: var(--nq-red); text-decoration: none; }
a:hover { color: var(--nq-red-dark); text-decoration: underline; }

.wrap { width: 100%; max-width: var(--nq-wrap); margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--nq-gray); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* Small uppercase label, used above field groups and card sections */
.eyebrow {
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--nq-gray);
	margin: 0 0 .5rem;
}

/* ------------------------------------------------------------------ header */

/* Router-Sheet Header: one traveler line instead of a stacked topbar,
   masthead, and nav-tab bar. States only "you are here"; everything else
   waits one click behind Sections. See .impeccable/surfaces/ for the brief. */
.shell {
	background: var(--nq-white);
	border-bottom: 3px solid var(--nq-red);
}
.shell__row {
	display: flex; align-items: center; gap: 18px;
	min-height: 56px; padding-block: 10px;
	flex-wrap: wrap;
}

.shell__brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.shell__brand img { height: 30px; width: auto; display: block; }
.shell__wordmark { font-weight: 700; color: var(--nq-ink); font-size: .92rem; white-space: nowrap; }

.shell__stamp {
	/* --nq-gray reads ~2.8:1 on white — well under AA for body text, and this
	   is the signature "you are here" element, not a decorative label. */
	font-size: .82rem; font-weight: 600; color: var(--nq-ink-soft);
	white-space: nowrap; padding-left: 2px;
}

.shell__search { display: flex; flex: 1 1 220px; max-width: 460px; margin-left: 4px; }
.shell__search input { border-right: 0; border-radius: var(--nq-radius) 0 0 var(--nq-radius); }
.shell__search .btn { border-radius: 0 var(--nq-radius) var(--nq-radius) 0; }

/* Sections / account: native <details> disclosure — works with zero JS,
   keyboard- and screen-reader-accessible by default. */
.shell__menu { position: relative; flex: 0 0 auto; }
.shell__menu > summary {
	list-style: none; cursor: pointer;
	display: inline-flex; align-items: center; gap: 6px;
}
.shell__menu > summary::-webkit-details-marker { display: none; }
.shell__menu > summary::after {
	content: ''; width: 6px; height: 6px;
	border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px); opacity: .6;
}
.shell__menu[open] > summary { background: var(--nq-surface); }
.shell__menu-label { max-width: 100%; }

.shell__panel {
	position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
	display: flex; flex-direction: column; gap: 1px;
	min-width: 210px; padding: 6px;
	background: var(--nq-white); border: 1px solid var(--nq-line);
	border-radius: var(--nq-radius); box-shadow: var(--nq-shadow);
}
.shell__panel a, .shell__panel .linklike {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 9px 10px; border-radius: 2px;
	font-size: .88rem; font-weight: 600; color: var(--nq-ink);
	text-decoration: none; text-align: left; width: 100%; background: none; border: none;
}
.shell__panel a:hover, .shell__panel .linklike:hover { background: var(--nq-surface); color: var(--nq-red); text-decoration: none; }
.shell__panel a.is-active { color: var(--nq-red); background: var(--nq-red-wash); }
.shell__panel form { margin: 0; }
.shell__panel-meta {
	padding: 6px 10px 8px; margin-bottom: 4px;
	border-bottom: 1px solid var(--nq-line);
	font-size: .78rem; color: var(--nq-gray);
}

.badge-count {
	display: inline-block; min-width: 20px; padding: 1px 6px;
	background: var(--nq-red); color: #fff;
	font-size: .72rem; font-weight: 700; line-height: 18px;
	border-radius: 999px; text-align: center;
}

/* ----------------------------------------------------------------- buttons */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 20px;
	font-family: inherit; font-size: .9rem; font-weight: 600;
	text-transform: capitalize;
	border: 1px solid transparent; border-radius: var(--nq-radius);
	background: var(--nq-red); color: #fff;
	cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
	text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--nq-red-dark); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: 3px solid rgba(238, 45, 36, .35); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }

.btn--ghost { background: transparent; color: var(--nq-ink); border-color: var(--nq-line); }
.btn--ghost:hover { background: var(--nq-surface); color: var(--nq-ink); border-color: var(--nq-gray); }
.btn--dark { background: var(--nq-ink); }
.btn--dark:hover { background: var(--nq-black); }
.btn--approve { background: var(--nq-green); }
.btn--approve:hover { background: #24603a; }
.btn--danger { background: transparent; color: var(--nq-red); border-color: var(--nq-red); }
.btn--danger:hover { background: var(--nq-red); color: #fff; }
.btn--sm { padding: 7px 13px; font-size: .82rem; }
.btn--block { width: 100%; }

/* ------------------------------------------------------------------- forms */

label, .label { display: block; font-weight: 600; color: var(--nq-ink); font-size: .88rem; margin-bottom: 6px; }
.hint { font-size: .82rem; color: var(--nq-gray); margin: 4px 0 0; font-weight: 300; }

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], select, textarea {
	width: 100%; padding: 11px 13px;
	font-family: inherit; font-size: .95rem; font-weight: 300; color: var(--nq-ink);
	background: var(--nq-white);
	border: 1px solid var(--nq-line); border-radius: var(--nq-radius);
	transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
	outline: none; border-color: var(--nq-red);
	box-shadow: 0 0 0 3px rgba(238, 45, 36, .12);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--nq-gray) 50%), linear-gradient(135deg, var(--nq-gray) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

.search-field { position: relative; display: flex; }
.search-field input { border-right: 0; border-radius: var(--nq-radius) 0 0 var(--nq-radius); }
.search-field .btn { border-radius: 0 var(--nq-radius) var(--nq-radius) 0; padding-inline: 18px; }

/* Checkbox grid for department pickers */
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.checkgrid label {
	display: flex; align-items: flex-start; gap: 9px;
	padding: 10px 12px; margin: 0;
	border: 1px solid var(--nq-line); border-radius: var(--nq-radius);
	font-weight: 400; font-size: .88rem; color: var(--nq-ink);
	cursor: pointer; background: var(--nq-white);
	transition: border-color .15s ease, background .15s ease;
}
.checkgrid label:hover { border-color: var(--nq-gray); }
.checkgrid input { margin: 3px 0 0; accent-color: var(--nq-red); flex: 0 0 auto; }
.checkgrid input:checked + span { font-weight: 600; }
.checkgrid label:has(input:checked) { border-color: var(--nq-red); background: var(--nq-red-wash); }

/* --------------------------------------------------------------- surfaces */

.card {
	background: var(--nq-white);
	border: 1px solid var(--nq-line);
	border-radius: var(--nq-radius);
	box-shadow: var(--nq-shadow-sm);
}
.card__body { padding: 22px; }
.card__head {
	padding: 16px 22px; border-bottom: 1px solid var(--nq-line);
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__head h2, .card__head h3 { margin: 0; }

.panel { background: var(--nq-surface); border-radius: var(--nq-radius); padding: 20px; }

.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.layout-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .layout-sidebar { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- pills */

.pill {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 3px 10px; border-radius: 999px;
	font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
	border: 1px solid transparent; white-space: nowrap;
}
.pill--live     { background: var(--nq-green-wash); color: var(--nq-green); border-color: #cfe6d8; }
.pill--pending  { background: var(--nq-amber-wash); color: var(--nq-amber); border-color: #f3e0bd; }
.pill--rejected { background: var(--nq-red-wash);   color: var(--nq-red-dark); border-color: #f7cfcd; }
.pill--draft    { background: var(--nq-surface);    color: var(--nq-ink-soft); border-color: var(--nq-line); }
.pill--kind     { background: var(--nq-blue-wash);  color: var(--nq-blue); border-color: #d3e2ef; }
/* Olive rather than red: "private" is a property of the entry, not a warning,
   and red is already spoken for by rejected and by the department marker. */
.pill--private  { background: #f1f0e7;              color: var(--nq-olive); border-color: #ddd9c4; }
.pill--private::before { content: '🔒'; font-size: .8em; margin-right: 4px; }

/* Department + tag chips */
.chip {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 3px 10px; border-radius: var(--nq-radius);
	font-size: .78rem; font-weight: 600;
	background: var(--nq-surface); color: var(--nq-ink-soft);
	border: 1px solid var(--nq-line);
}
a.chip:hover { border-color: var(--nq-red); color: var(--nq-red); text-decoration: none; background: var(--nq-red-wash); }
a.chip.is-active { border-color: var(--nq-red); color: var(--nq-red); background: var(--nq-red-wash); }
.chip--dept { border-left: 3px solid var(--nq-red); }
.chip--tag::before { content: '#'; color: var(--nq-gray); font-weight: 400; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------------ flash */

.flash {
	display: flex; gap: 10px; align-items: flex-start;
	padding: 13px 18px; margin: 20px 0 24px;
	border-radius: var(--nq-radius); border-left: 4px solid;
	font-size: .92rem;
}
.flash--success { background: var(--nq-green-wash); border-color: var(--nq-green); color: #1f5733; }
.flash--error   { background: var(--nq-red-wash);   border-color: var(--nq-red);   color: #8f1913; }
.flash--info    { background: var(--nq-blue-wash);  border-color: var(--nq-blue);  color: #234e75; }

/* ------------------------------------------------------------------- page */

main { padding: 34px 0 72px; min-height: 60vh; }

.page-head { margin-bottom: 26px; }
.page-head h1 { margin-bottom: 6px; }
.page-head p { margin: 0; color: var(--nq-gray); }
.page-head__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.breadcrumb { font-size: .82rem; color: var(--nq-gray); margin-bottom: 10px; }
.breadcrumb a { color: var(--nq-gray); }
.breadcrumb a:hover { color: var(--nq-red); }
.breadcrumb span { margin: 0 7px; opacity: .6; }

/* --------------------------------------------------------------- hero/home */

.hero {
	background: var(--nq-ink);
	background-image: linear-gradient(115deg, #1a1a1a 0%, #2b2b2b 55%, #332f1f 100%);
	color: #fff; padding: 52px 0 56px; position: relative; overflow: hidden;
}
.hero::after {
	content: ''; position: absolute; right: -80px; top: -60px;
	width: 340px; height: 340px; transform: rotate(45deg);
	background: rgba(238, 45, 36, .14);
}
.hero h1 { color: #fff; margin-bottom: 10px; }
.hero p { color: rgba(255, 255, 255, .72); max-width: 60ch; margin: 0 0 26px; font-size: 1.02rem; }
.hero .search-field { max-width: 640px; position: relative; z-index: 1; }
.hero .search-field input { border-color: transparent; padding: 15px 18px; font-size: 1rem; }
.hero .search-field .btn { padding-inline: 26px; }
.hero__meta { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero__stat strong { display: block; font-size: 1.5rem; color: #fff; font-weight: 700; line-height: 1.1; }
.hero__stat span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); }

/* Department cards */
.dept-card {
	display: block; padding: 20px; height: 100%;
	background: var(--nq-white); border: 1px solid var(--nq-line);
	border-top: 3px solid var(--nq-red); border-radius: var(--nq-radius);
	transition: box-shadow .18s ease, transform .18s ease;
}
.dept-card:hover { box-shadow: var(--nq-shadow); text-decoration: none; transform: translateY(-2px); }
.dept-card h3 { margin-bottom: 5px; font-size: 1.02rem; }
.dept-card p { margin: 0 0 12px; font-size: .86rem; color: var(--nq-gray); line-height: 1.55; }
.dept-card .count { font-size: .78rem; font-weight: 700; color: var(--nq-red); text-transform: uppercase; letter-spacing: .06em; }

/* Entry result cards */
.entry-card {
	display: block; padding: 20px 22px;
	border: 1px solid var(--nq-line); border-radius: var(--nq-radius);
	background: var(--nq-white); border-left: 3px solid var(--nq-line);
	transition: border-left-color .18s ease, box-shadow .18s ease;
}
.entry-card:hover { border-left-color: var(--nq-red); box-shadow: var(--nq-shadow-sm); text-decoration: none; }
.entry-card h3 { margin-bottom: 6px; font-size: 1.05rem; }
.entry-card h3 a { color: var(--nq-ink); }
.entry-card:hover h3 a { color: var(--nq-red); }
.entry-card p { margin: 0 0 12px; font-size: .9rem; color: var(--nq-olive); line-height: 1.6; }
.entry-card__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--nq-gray); }

.result-list { display: flex; flex-direction: column; gap: 12px; }

/* --------------------------------------------------------------- article */

.article { max-width: 78ch; }
.article__body { font-size: 1.02rem; line-height: 1.8; color: var(--nq-olive); }
.article__body > *:first-child { margin-top: 0; }
.article__body h1, .article__body h2, .article__body h3, .article__body h4 { margin-top: 1.9em; margin-bottom: .55em; }
.article__body h2 { padding-bottom: .3em; border-bottom: 1px solid var(--nq-line); }
.article__body p { margin: 0 0 1.15em; }
.article__body ul, .article__body ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.article__body li { margin-bottom: .45em; }
.article__body img { max-width: 100%; height: auto; border-radius: var(--nq-radius); border: 1px solid var(--nq-line); }
.article__body iframe, .article__body video {
	max-width: 100%; width: 100%; aspect-ratio: 16 / 9; height: auto;
	border: 0; border-radius: var(--nq-radius); background: var(--nq-ink);
	display: block; margin: 1.5em 0;
}
.article__body blockquote {
	margin: 1.5em 0; padding: 4px 0 4px 20px;
	border-left: 3px solid var(--nq-red); color: var(--nq-ink-soft); font-style: normal;
}
.article__body code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .88em; background: var(--nq-surface); padding: 2px 6px; border-radius: 2px; color: var(--nq-ink);
}
.article__body pre, .article__body .ql-syntax {
	background: var(--nq-ink); color: #f4f4f4; padding: 16px 18px;
	border-radius: var(--nq-radius); overflow-x: auto; font-size: .88rem; line-height: 1.6;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.article__body pre code, .article__body .ql-syntax code { background: none; padding: 0; color: inherit; }
.article__body table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .92rem; }
.article__body th, .article__body td { border: 1px solid var(--nq-line); padding: 9px 12px; text-align: left; }
.article__body th { background: var(--nq-surface); font-weight: 600; color: var(--nq-ink); }
.article__body .ql-align-center { text-align: center; }
.article__body .ql-align-right  { text-align: right; }
.article__body .ql-align-justify{ text-align: justify; }
.article__body .ql-indent-1 { padding-left: 3em; }
.article__body .ql-indent-2 { padding-left: 6em; }
.article__body .ql-indent-3 { padding-left: 9em; }

/* Wide content must scroll inside itself, never the page */
.scroll-x { overflow-x: auto; }

.article-meta {
	display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
	padding: 14px 0; margin-bottom: 24px;
	border-top: 1px solid var(--nq-line); border-bottom: 1px solid var(--nq-line);
	font-size: .84rem; color: var(--nq-gray);
}

/* ------------------------------------------------------------ attachments */

.attachment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attachment {
	display: flex; align-items: center; gap: 13px;
	padding: 12px 14px; background: var(--nq-white);
	border: 1px solid var(--nq-line); border-radius: var(--nq-radius);
}
.attachment:hover { border-color: var(--nq-gray); }
.attachment__icon {
	flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--nq-radius);
	display: grid; place-items: center;
	font-size: .62rem; font-weight: 700; letter-spacing: .03em;
	background: var(--nq-surface); color: var(--nq-ink-soft); text-transform: uppercase;
}
.attachment__icon--sheet { background: var(--nq-green-wash); color: var(--nq-green); }
.attachment__icon--doc   { background: var(--nq-blue-wash);  color: var(--nq-blue); }
.attachment__icon--pdf   { background: var(--nq-red-wash);   color: var(--nq-red-dark); }
.attachment__icon--cad   { background: #efeaf7; color: #5b3f9e; }
.attachment__body { min-width: 0; flex: 1; }
.attachment__name { display: block; font-weight: 600; color: var(--nq-ink); font-size: .9rem; word-break: break-word; }
.attachment__meta { font-size: .78rem; color: var(--nq-gray); }

/* ---------------------------------------------------------------- tables */

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
	text-align: left; padding: 11px 14px;
	font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
	color: var(--nq-gray); border-bottom: 2px solid var(--nq-line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--nq-line); vertical-align: top; color: var(--nq-ink); }
.table tbody tr:hover { background: #fafafa; }
.table td strong { font-weight: 600; }

/* ------------------------------------------------------- review side-by-side */

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }
.compare__col { min-width: 0; }
.compare__label {
	font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	padding: 8px 12px; border-radius: var(--nq-radius) var(--nq-radius) 0 0; color: #fff;
}
.compare__label--live { background: var(--nq-gray); }
.compare__label--new  { background: var(--nq-red); }
.compare__pane {
	border: 1px solid var(--nq-line); border-top: 0;
	border-radius: 0 0 var(--nq-radius) var(--nq-radius);
	padding: 20px; max-height: 620px; overflow: auto; background: var(--nq-white);
}

.decision-bar {
	position: sticky; bottom: 0; z-index: 20;
	background: var(--nq-white); border-top: 2px solid var(--nq-line);
	padding: 16px 0; margin-top: 30px; box-shadow: 0 -6px 18px rgba(17,17,17,.06);
}
.decision-bar .wrap { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.decision-bar .field { flex: 1 1 320px; margin: 0; }

/* -------------------------------------------------------------- timeline */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
	position: relative; padding: 0 0 20px 26px;
	border-left: 1px solid var(--nq-line); margin-left: 5px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
	content: ''; position: absolute; left: -5px; top: 5px;
	width: 9px; height: 9px; border-radius: 50%;
	background: var(--nq-white); border: 2px solid var(--nq-gray);
}
.timeline li.is-current::before { border-color: var(--nq-red); background: var(--nq-red); }
.timeline__title { font-weight: 600; color: var(--nq-ink); font-size: .93rem; }
.timeline__meta { font-size: .8rem; color: var(--nq-gray); }

/* ---------------------------------------------------------------- editor */

.editor-shell { border: 1px solid var(--nq-line); border-radius: var(--nq-radius); background: var(--nq-white); }
.editor-shell .ql-toolbar {
	border: 0 !important; border-bottom: 1px solid var(--nq-line) !important;
	background: var(--nq-surface); border-radius: var(--nq-radius) var(--nq-radius) 0 0;
	position: sticky; top: 0; z-index: 5;
}
.editor-shell .ql-container {
	border: 0 !important; font-family: var(--nq-font) !important;
	font-size: 1rem; font-weight: 300;
}
.editor-shell .ql-editor { min-height: 420px; line-height: 1.75; color: var(--nq-olive); padding: 20px; }
.editor-shell .ql-editor.ql-blank::before { color: var(--nq-gray); font-style: normal; left: 20px; }
.editor-shell .ql-snow .ql-stroke { stroke: var(--nq-ink); }
.editor-shell .ql-snow .ql-fill { fill: var(--nq-ink); }
.editor-shell .ql-snow .ql-picker { color: var(--nq-ink); }
.editor-shell .ql-snow .ql-active .ql-stroke { stroke: var(--nq-red) !important; }
.editor-shell .ql-snow .ql-active .ql-fill { fill: var(--nq-red) !important; }
.editor-shell .ql-snow button:hover .ql-stroke { stroke: var(--nq-red) !important; }
.editor-shell .ql-snow button:hover .ql-fill { fill: var(--nq-red) !important; }
.editor-shell .ql-editor img { max-width: 100%; height: auto; }
.editor-shell .ql-editor iframe { max-width: 100%; aspect-ratio: 16/9; width: 100%; }

.editor-status { font-size: .8rem; color: var(--nq-gray); padding: 8px 14px; border-top: 1px solid var(--nq-line); background: var(--nq-surface); }

/* Attachment staging list in the form */
.file-drop {
	border: 2px dashed var(--nq-line); border-radius: var(--nq-radius);
	padding: 26px; text-align: center; background: var(--nq-surface);
	transition: border-color .15s ease, background .15s ease;
}
.file-drop.is-over { border-color: var(--nq-red); background: var(--nq-red-wash); }
.file-drop p { margin: 0 0 4px; color: var(--nq-ink); font-weight: 600; font-size: .92rem; }

/* --------------------------------------------------------------- sidebar */

.sidebar { position: sticky; top: 18px; }
.sidebar__section + .sidebar__section { margin-top: 26px; }
.sidebar h4 {
	font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
	color: var(--nq-gray); margin-bottom: 11px; font-weight: 700;
}
.sidebar__list { list-style: none; margin: 0; padding: 0; }
.sidebar__list li + li { margin-top: 2px; }
.sidebar__list a {
	display: flex; justify-content: space-between; gap: 8px; align-items: center;
	padding: 7px 10px; border-radius: var(--nq-radius);
	color: var(--nq-ink); font-size: .88rem;
}
.sidebar__list a:hover { background: var(--nq-surface); text-decoration: none; color: var(--nq-red); }
.sidebar__list a.is-active { background: var(--nq-red-wash); color: var(--nq-red); font-weight: 600; }
.sidebar__list .n { font-size: .76rem; color: var(--nq-gray); }

/* ------------------------------------------------------------ empty state */

.empty { text-align: center; padding: 56px 24px; border: 1px dashed var(--nq-line); border-radius: var(--nq-radius); background: var(--nq-surface); }
.empty h3 { margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 46ch; color: var(--nq-gray); }

/* ---------------------------------------------------------------- footer */

.site-footer {
	background: var(--nq-olive); color: rgba(255, 255, 255, .78);
	padding: 34px 0; font-size: .86rem; margin-top: auto;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer strong { color: #fff; font-weight: 600; }

/* ------------------------------------------------------------------ auth */

.auth-screen { min-height: 100vh; display: grid; place-items: center; background: var(--nq-surface); padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--nq-white); border: 1px solid var(--nq-line); border-top: 4px solid var(--nq-red); border-radius: var(--nq-radius); padding: 34px; box-shadow: var(--nq-shadow-lg); }
.auth-card img { height: 42px; margin-bottom: 22px; }

/* -------------------------------------------------------------- utilities */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 18px; }
.wrap-flex { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 22px; } .mt-5 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 22px; }
.text-right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* The full desktop row (brand + wordmark + stamp + search-at-min-width +
   Sections + Account) needs roughly 820px to lay out without wrapping.
   Compact it well before that point rather than waiting for a natural,
   unplanned wrap to hit first. */
@media (max-width: 920px) {
	.shell__row { gap: 10px 14px; }
	.shell__wordmark { display: none; }
	/* Brand, stamp, Sections, and Account stay on one line — truncated
	   rather than wrapped — so the shell collapses to two rows (chrome,
	   then search), not the three-row stack it was built to replace. */
	.shell__stamp { max-width: 100px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
	.shell__menu-label { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
	.shell__search { order: 5; flex-basis: 100%; max-width: none; margin-left: 0; }
	/* Sections and Account stay clustered on the right of the chrome row at
	   every supported width, so the default right-anchored panel (below)
	   already keeps its full width on-screen — no override needed here. */
}

@media (max-width: 720px) {
	.hero { padding: 36px 0 40px; }
	.decision-bar .wrap { flex-direction: column; align-items: stretch; }
}

@media print {
	.shell, .site-footer,
	.decision-bar, .btn { display: none !important; }
	body { color: #000; }
	.article { max-width: none; }
}

/* reCAPTCHA widget — the iframe is a fixed 304px, so allow it to scale down
   inside the auth card on a narrow phone rather than overflowing it. */
.g-recaptcha { display: flex; justify-content: center; }
@media (max-width: 380px) {
	.g-recaptcha { transform: scale(.88); transform-origin: center; }
}

/* Customer chips read as a distinct facet from departments and tags. */
.chip--customer { border-left: 3px solid var(--nq-blue); }
.chip--customer::before { content: '◆'; color: var(--nq-blue); font-size: .7em; }

/* Native multi-select: give it room so several options are visible at once. */
select[multiple] {
	padding: 6px;
	min-height: 110px;
	background-image: none;
}
select[multiple] option {
	padding: 6px 8px;
	border-radius: 2px;
}
select[multiple] option:checked {
	background: var(--nq-red-wash);
	color: var(--nq-red-dark);
	font-weight: 600;
}
kbd {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .85em; background: var(--nq-surface); border: 1px solid var(--nq-line);
	border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; color: var(--nq-ink);
}

/* ------------------------------------------------------------- comments */

.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment {
	padding: 14px 16px;
	background: var(--nq-white);
	border: 1px solid var(--nq-line);
	border-left: 3px solid var(--nq-gray);
	border-radius: var(--nq-radius);
}
.comment--removed { background: var(--nq-surface); border-left-color: var(--nq-line); }
.comment__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.comment__author { font-weight: 600; color: var(--nq-ink); font-size: .92rem; }
.comment__meta { font-size: .78rem; color: var(--nq-gray); }
.comment__remove { margin-left: auto; }
/* The body is escaped plain text, so newlines are preserved with CSS rather
   than by turning the content into markup. */
.comment__body { white-space: pre-wrap; font-size: .95rem; line-height: 1.65; color: var(--nq-olive); word-break: break-word; }
.comment__removed { font-size: .88rem; color: var(--nq-gray); font-style: italic; }

.linklike {
	background: none; border: 0; padding: 0; cursor: pointer;
	font: inherit; font-size: .78rem; color: var(--nq-gray); text-decoration: underline;
}
.linklike:hover { color: var(--nq-red); }

/* ==========================================================================
   Dense search — design-exploration branch
   ========================================================================== */

/* Counts, dates and part numbers line up column-to-column. */
.row, .table, .searchbar__status, .sidebar__list .n {
	font-variant-numeric: tabular-nums;
}

.searchbar { display: flex; gap: 0; margin-bottom: 10px; }
.searchbar input[type="search"] {
	border-right: 0;
	border-radius: var(--nq-radius) 0 0 var(--nq-radius);
	font-size: 1rem;
	padding: 12px 14px;
}
.searchbar .btn { border-radius: 0 var(--nq-radius) var(--nq-radius) 0; }

.searchbar__status {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 12px; flex-wrap: wrap;
	font-size: .8rem; color: var(--nq-gray);
	padding: 0 2px 10px;
	border-bottom: 1px solid var(--nq-line);
	margin-bottom: 2px;
}
.searchbar__keys { display: flex; align-items: center; gap: 4px; }
.searchbar__keys kbd { font-size: .72rem; padding: 0 4px; }

/* --- the result row ----------------------------------------------------- */
/* A grid rather than flex, so the type, title and meta columns line up down
   the whole list instead of drifting with content width. */
.result-list { display: flex; flex-direction: column; gap: 0; }

.row {
	display: grid;
	/* Entry types are admin-editable, so the label column has to cope with a
	   name nobody has written yet. It wraps rather than truncating. */
	grid-template-columns: 104px minmax(0, 1fr) auto;
	align-items: baseline;
	gap: 14px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--nq-line);
	border-left: 2px solid transparent;
	text-decoration: none;
	/* Colour and transform only — both cheap to animate. */
	transition: background .12s ease, border-left-color .12s ease;
}
.row:hover,
.row.is-cursor {
	background: var(--nq-surface);
	border-left-color: var(--nq-red);
	text-decoration: none;
}
.row.is-cursor { outline: none; box-shadow: inset 0 0 0 1px var(--nq-line); }
.row:active { background: var(--nq-line); }
.row:focus-visible { outline: 2px solid var(--nq-red); outline-offset: -2px; }

.row__kind {
	font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
	color: var(--nq-blue);
	line-height: 1.3;
	/* Wrap a long type name onto a second line instead of cutting it off — a
	   truncated label is worse than a taller row when the name is the thing
	   you are scanning for. */
	overflow-wrap: anywhere;
}
.row__main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row__title {
	font-weight: 600; color: var(--nq-ink); font-size: .95rem; line-height: 1.35;
	text-wrap: pretty;
}
.row:hover .row__title, .row.is-cursor .row__title { color: var(--nq-red); }
.row__summary {
	font-size: .82rem; color: var(--nq-gray); line-height: 1.4;
	/* One line: the point of a dense list is scanning, not reading. */
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row__meta {
	display: flex; align-items: baseline; gap: 10px;
	font-size: .76rem; color: var(--nq-gray); white-space: nowrap;
}
.row__dept { color: var(--nq-ink-soft); }
.row__dept::before { content: '▌'; color: var(--nq-red); margin-right: 3px; }
.row__cust::before { content: '◆ '; color: var(--nq-blue); }
/* Draft count in the nav. Olive rather than red: unfinished work of your own
   is a reminder, not the demand on your attention that a review queue is. */
.badge-count--draft { background: var(--nq-olive); }

/* Administrator's show-everything switch, next to the result count. */
.scope-toggle { display: inline-flex; margin: 0; }
.scope-toggle__btn {
	background: none; border: 0; padding: 0; cursor: pointer;
	font: inherit; font-size: .76rem; font-weight: 600;
	color: var(--nq-olive); text-decoration: underline; text-underline-offset: 3px;
}
.scope-toggle__btn:hover { color: var(--nq-red); }
.scope-toggle__btn[aria-pressed='true'] { color: var(--nq-red); }

.row__private {
	color: var(--nq-olive); font-weight: 700;
	font-size: .7rem; letter-spacing: .04em; text-transform: uppercase;
}
.row__private::before { content: '🔒'; margin-right: 3px; }
.row__when { min-width: 72px; text-align: right; }

/* Skeletons are the same height as a row, so results landing do not shift the
   page — the usual cause of a mis-click on a fast connection. */
.row--skeleton { min-height: 46px; display: block; border-left-color: transparent; }
.row--skeleton::after {
	content: ''; display: block; height: 12px; margin: 6px 0;
	width: min(52%, 420px);
	border-radius: 2px;
	background: linear-gradient(90deg, var(--nq-surface) 25%, var(--nq-line) 37%, var(--nq-surface) 63%);
	background-size: 400% 100%;
	animation: nq-shimmer 1.3s ease-in-out infinite;
}
.row--skeleton:nth-child(2)::after { width: min(66%, 520px); }
.row--skeleton:nth-child(3)::after { width: min(44%, 360px); }
.row--skeleton:nth-child(4)::after { width: min(58%, 470px); }

@keyframes nq-shimmer {
	0%   { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.row--skeleton::after { animation: none; }
	* { scroll-behavior: auto !important; }
}

@media (max-width: 700px) {
	.row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
	.row__kind { font-size: .62rem; }
	.row__meta { justify-content: flex-start; }
	.row__when { text-align: left; min-width: 0; }
}

/* --- audit fixes -------------------------------------------------------- */

html { scroll-behavior: smooth; }

/* A visible focus ring everywhere, not just where it was remembered. */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
	outline: 2px solid var(--nq-red);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Pressed feedback — the interface felt dead on click without it. */
.btn:active { transform: translateY(1px); }

/* Shadows tinted with the brand's ink rather than neutral black. */
:root {
	--nq-shadow-sm: 0 1px 2px rgba(34, 33, 25, .07);
	--nq-shadow:    0 2px 10px rgba(34, 33, 25, .09);
}

h1, h2, h3 { text-wrap: balance; }
p, .row__title { text-wrap: pretty; }

/* Keyboard users should not have to tab the whole nav to reach content. */
.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	background: var(--nq-ink); color: #fff; padding: 10px 16px;
	font-weight: 600; font-size: .9rem;
}
.skip-link:focus { left: 0; text-decoration: none; color: #fff; }

/* ------------------------------------------------------------- entry links */

/* Related entries, in the main column of an entry. */
.related-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--nq-line); }
.related-list__item { padding: 12px 0; border-bottom: 1px solid var(--nq-line); }
.related-list__link { font-weight: 700; color: var(--nq-ink); }
.related-list__link:hover { color: var(--nq-red); }
.related-list__meta { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle; }
.related-list__summary { margin: 4px 0 0; color: var(--nq-ink-soft); font-size: .9rem; }

/* "Referenced by", in the sidebar. */
.backlinks { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.backlinks li { padding: 5px 0; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }

/* Links to other entries inside a body read as internal: no new-tab arrow,
   a solid underline rather than the external-link treatment. */
.article__body a[href^="/entries/"] {
	text-decoration-style: solid; text-decoration-thickness: 1px;
	text-underline-offset: 3px; font-weight: 600;
}

.chip--related { background: var(--nq-white); border: 1px solid var(--nq-line); }

/* The related-entries picker on the form. */
.related-picker { border: 1px solid var(--nq-line); border-radius: var(--nq-radius); padding: 8px; }
.related-picker__picked { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.related-picker__empty { color: var(--nq-gray); font-size: .85rem; }
.related-picker__chip {
	display: flex; align-items: center; gap: 6px;
	background: var(--nq-surface); border-radius: var(--nq-radius);
	padding: 4px 4px 4px 8px; font-size: .85rem;
}
.related-picker__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-picker__tag {
	font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	color: var(--nq-olive); white-space: nowrap;
}
.related-picker__remove {
	border: 0; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1;
	padding: 2px 6px; color: var(--nq-ink-soft); border-radius: var(--nq-radius);
}
.related-picker__remove:hover, .related-picker__remove:focus-visible { color: var(--nq-red); background: var(--nq-white); }
.related-picker__search { position: relative; }
.related-picker__search input { width: 100%; }

/* Shared by the picker results and the editor's entry linker. */
.related-picker__results, .entry-linker__results {
	list-style: none; margin: 4px 0 0; padding: 4px 0;
	background: var(--nq-white); border: 1px solid var(--nq-line);
	border-radius: var(--nq-radius); box-shadow: var(--nq-shadow);
	max-height: 260px; overflow-y: auto;
}
.related-picker__results { position: absolute; left: 0; right: 0; z-index: 20; }
.related-picker__result, .entry-linker__item {
	display: flex; justify-content: space-between; gap: 8px;
	padding: 7px 10px; cursor: pointer; font-size: .88rem;
}
.related-picker__result.is-active, .related-picker__result:hover,
.entry-linker__item.is-active, .entry-linker__item:hover { background: var(--nq-surface); }

/* The "link to an entry" search box that opens above the editor. */
.entry-linker {
	border: 1px solid var(--nq-line); border-bottom: 0;
	background: var(--nq-surface); padding: 10px;
}
.entry-linker__input { width: 100%; }
.entry-linker__title { font-weight: 600; }
.entry-linker__kind {
	font-size: .7rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: .04em; color: var(--nq-gray); white-space: nowrap;
}
.entry-linker__hint { margin: 6px 0 0; font-size: .78rem; color: var(--nq-ink-soft); }
.entry-linker__results:empty { display: none; }

/* --- People: search, filters and scroll loading ---------------------------- */
.people-filters .searchbar { margin-bottom: 12px; }
.people-filters__row {
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
	font-size: .85rem;
}
.people-filters__row label { display: flex; flex-direction: column; gap: 4px; }
.people-filters__row select { min-width: 11rem; }
.people-filters__row a { padding-bottom: 8px; }
.people-empty { padding: 16px 20px; margin: 0; }
.people-more { display: flex; justify-content: center; padding: 14px; }
.people-more.is-loading a { opacity: .5; pointer-events: none; }

/* --- Copy link on an entry ------------------------------------------------- */
[data-copy-link].is-copied { border-color: var(--nq-green); color: #1f5733; }
.copy-link__status:empty { display: none; }
.copy-link__status { overflow-wrap: anywhere; }

/* --- Entry numbers (NQW-0012) ---------------------------------------------- */
.entry-number {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .8rem; font-weight: 600; letter-spacing: .02em;
	color: var(--nq-ink);
	padding: 2px 8px; border: 1px solid var(--nq-line); border-radius: var(--nq-radius);
}
.row__num {
	display: block; margin-top: 2px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .7rem; font-weight: 500; letter-spacing: 0; text-transform: none;
	color: var(--nq-gray);
}
