/* Directory (Beta) - all rules scoped to .dirb-* (this file loads on every page). */
.dirb-app { --dirb-accent: #2563eb; --dirb-line: #d1d5db; --dirb-soft: #f3f7fa; color: #1f2937; }
.dirb-beta-note { font-size: .88rem; color: #4b5563; background: #fff8e1; border: 1px solid #f3d27a; border-radius: 6px; padding: 6px 10px; margin: 0 0 12px; }
.dirb-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 4px 5px 10px; }
.dirb-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.dirb-rev { color: #6b7280; font-size: .9rem; }
.dirb-searchbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.dirb-qwrap { position: relative; flex: 1 1 320px; min-width: 0; }
.dirb-q { width: 100%; padding: 9px 36px 9px 12px; border: 1px solid #9ca3af; border-radius: 8px; font-size: 1rem; background: #fff; }
.dirb-q:focus { outline: 2px solid var(--dirb-accent); outline-offset: 0; border-color: var(--dirb-accent); }
.dirb-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1rem; color: #6b7280; padding: 4px 6px; cursor: pointer; }
.dirb-jump { flex: 0 1 240px; min-width: 0; padding: 8px; border: 1px solid #9ca3af; border-radius: 8px; background: #fff; max-width: 100%; }
.dirb-units { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.dirb-chip, .dirb-jchip { border: 1px solid #9ca3af; background: #fff; border-radius: 999px; padding: 4px 11px; font-size: .88rem; cursor: pointer; color: #1f2937; }
.dirb-chip:hover, .dirb-jchip:hover { border-color: var(--dirb-accent); color: var(--dirb-accent); }
.dirb-chip.active { background: var(--dirb-accent); border-color: var(--dirb-accent); color: #fff; }
.dirb-results:empty { display: none; }
.dirb-results { background: #eef4ff; border: 1px solid #c7d7fb; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.dirb-count { font-weight: 600; margin-bottom: 4px; }
.dirb-jumpchips { display: flex; flex-wrap: wrap; gap: 6px; }
.dirb-jchip { font-size: .82rem; padding: 3px 9px; }
.dirb-section { background: #fff; border: 1px solid var(--dirb-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; scroll-margin-top: 70px; }
.dirb-shead { font-size: 1.2rem; font-weight: 700; margin: 0 0 8px; color: #111827; text-align: center; }
.dirb-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: #6b7280; color: #fff; font-size: .72rem; font-weight: 600; vertical-align: middle; }
.dirb-badge-live { background: #16a34a; }
.dirb-block { margin: 10px 0; }
.dirb-btitle { font-size: 1rem; font-weight: 700; margin: 12px 0 6px; text-align: center; }
.dirb-rt p { margin: 0 0 .6em; }
.dirb-rt h3, .dirb-rt h4 { font-size: 1rem; font-weight: 700; margin: .8em 0 .4em; }
.dirb-rt ul, .dirb-rt ol { margin: 0 0 .6em 1.4em; padding-left: 1em; }
.dirb-rt ul { list-style: disc; } .dirb-rt ol { list-style: decimal; } .dirb-rt ol ol { list-style: lower-alpha; } .dirb-rt ul ul { list-style: circle; }
.dirb-rt blockquote { margin: 0 0 .4em 2em; padding: 0; border: 0; }
.dirb-rt a, .dirb-contact a { color: #1d4ed8; overflow-wrap: anywhere; }
.dirb-table-wrap { overflow-x: auto; }
.dirb-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.dirb-table th, .dirb-table td { border: 1px solid var(--dirb-line); padding: 5px 8px; vertical-align: top; text-align: left; }
.dirb-table thead th, .dirb-table .dirb-hrow th { background: #eef2f5; font-weight: 700; }
.dirb-table .dirb-grow th { background: #e5edf3; text-align: left; font-weight: 700; }
.dirb-table .dirb-rowhead { background: #f7f9fb; font-weight: 600; white-space: nowrap; }
.dirb-matrix td, .dirb-matrix th { text-align: center; }
.dirb-matrix .dirb-rowhead { text-align: left; }
.dirb-table .dirb-dup { display: none; }
.dirb-matrix.dirb-filtered tr:not(.dirb-rowhit) td:not(.dirb-cellhit):not(.dirb-rowhead) { color: #9ca3af; }
.dirb-table td.dirb-cellhit { background: #fff7cc; box-shadow: inset 0 0 0 2px #f2c94c; }
.dirb-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.dirb-contact { border: 1px solid var(--dirb-line); border-left: 4px solid #a2c3d3; border-radius: 8px; padding: 9px 12px; background: #fcfdfe; }
.dirb-c-label { font-weight: 700; }
.dirb-c-name { font-weight: 600; }
.dirb-c-label + .dirb-c-name { font-weight: 400; }
.dirb-c-calling, .dirb-c-unit, .dirb-c-note { color: #4b5563; font-size: .9rem; }
.dirb-c-lines { margin-top: 4px; font-size: .95rem; }
.dirb-c-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.dirb-ico { color: #6b7280; }
.dirb-sms { font-size: .8rem; border: 1px solid #c7d2fe; border-radius: 10px; padding: 0 7px; text-decoration: none; }
.dirb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dirb-card { border: 1px solid var(--dirb-line); border-top: 4px solid #a2c3d3; border-radius: 8px; padding: 9px 12px; background: #fcfdfe; }
.dirb-card-name { font-weight: 700; }
.dirb-card-role { color: #4b5563; font-size: .9rem; }
.dirb-card-list { margin: 6px 0 0; padding-left: 1.1em; list-style: disc; font-size: .92rem; }
.dirb-card-list li { margin: 2px 0; }
mark.dirb-hit { background: #ffe066; color: inherit; padding: 0 1px; border-radius: 2px; }
.dirb-hide, .dirb-rt .dirb-fold { display: none !important; }
.dirb-unfold .dirb-rt .dirb-fold { display: revert !important; }
.dirb-unfold .dirb-fullbtn { display: none; }
.dirb-linkbtn { background: none; border: 0; padding: 0; color: #1d4ed8; text-decoration: underline; cursor: pointer; font-size: .9rem; }
.dirb-wholebtn { display: block; margin: 6px auto 0; }
.dirb-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: flex-end; margin: 0 0 10px; }
.dirb-btn { border: 1px solid #9ca3af; background: #fff; color: #1f2937; border-radius: 7px; padding: 6px 12px; cursor: pointer; font-size: .92rem; }
.dirb-btn:hover { border-color: var(--dirb-accent); color: var(--dirb-accent); }
.dirb-btn:disabled { opacity: .5; cursor: default; }
.dirb-btn-primary { background: var(--dirb-accent); border-color: var(--dirb-accent); color: #fff; }
.dirb-btn-primary:hover { background: #1d4ed8; color: #fff; }
.dirb-btn-quiet { border-color: transparent; background: transparent; }
.dirb-feedback { font-size: .9rem; color: #1d4ed8; }
.dirb-q::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.dirb-empty-doc, .dirb-loading { color: #6b7280; padding: 20px; text-align: center; }

/* phones: tables become stacked cards */
@media (max-width: 640px) {
	.dirb-section { padding: 10px; }
	.dirb-title { font-size: 1.25rem; }
	.dirb-jump { flex: 1 1 100%; }
	.dirb-table-wrap { overflow: visible; }
	.dirb-table, .dirb-table tbody, .dirb-table tr, .dirb-table td, .dirb-table th { display: block; width: auto; }
	.dirb-table thead, .dirb-table .dirb-hrow { display: none; }
	.dirb-table tr.dirb-row { border: 1px solid var(--dirb-line); border-radius: 8px; margin: 0 0 8px; padding: 6px 10px; background: #fcfdfe; }
	.dirb-table td, .dirb-table th { border: 0; padding: 2px 0; text-align: left !important; white-space: normal; }
	.dirb-table td.dirb-empty { display: none; }
	.dirb-table td[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; font-weight: 600; color: #4b5563; }
	.dirb-table .dirb-dup { display: block; }
	.dirb-table .dirb-rowhead { background: none; font-size: 1rem; font-weight: 700; border-bottom: 1px solid #e5e7eb; margin-bottom: 3px; padding-bottom: 3px; }
	.dirb-table .dirb-rowhead::before { content: none !important; }
	.dirb-table .dirb-grow th { background: none; border: 0; padding: 8px 0 4px; font-size: 1rem; }
	.dirb-table td.dirb-cellhit { padding: 2px 4px; border-radius: 4px; }
	.dirb-contacts, .dirb-cards { grid-template-columns: 1fr; }
}

/* ---------- editor ---------- */
.dirb-editor { padding-bottom: 30px; }
.dirb-ed-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #f8fafc; border: 1px solid var(--dirb-line); border-radius: 8px; padding: 8px; margin-bottom: 12px; }
.dirb-ed-status { font-weight: 600; font-size: .88rem; margin-right: auto; padding: 3px 8px; border-radius: 6px; }
.dirb-ed-status.dirty { background: #fee2e2; color: #991b1b; }
.dirb-ed-status.pending { background: #fef3c7; color: #92400e; }
.dirb-ed-status.ok { background: #dcfce7; color: #166534; }
.dirb-ed-es { font-size: .88rem; display: inline-flex; align-items: center; gap: 4px; }
.dirb-ed-settings, .dirb-hist { background: #fff; border: 1px solid var(--dirb-line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.dirb-ed-settings h3, .dirb-hist h3, .dirb-ed-listhead h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; }
.dirb-ed-listhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dirb-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 12px; }
.dirb-grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 10px; }
.dirb-field { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; min-width: 0; }
.dirb-flabel { font-weight: 600; color: #374151; }
.dirb-in { border: 1px solid #9ca3af; border-radius: 6px; padding: 5px 8px; font-size: .95rem; background: #fff; min-width: 0; width: 100%; box-sizing: border-box; }
textarea.dirb-in { resize: vertical; font-family: inherit; }
.dirb-ed-sec { border: 1px solid var(--dirb-line); border-radius: 10px; background: #fff; margin-bottom: 8px; }
.dirb-ed-sec.open { border-color: #93b4d6; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.dirb-ed-sechead, .dirb-ed-blockhead { display: flex; align-items: center; gap: 6px; padding: 6px 8px; flex-wrap: wrap; }
.dirb-ed-heading { flex: 1 1 200px; font-weight: 600; }
.dirb-ed-secnum { color: #6b7280; font-weight: 600; }
.dirb-ed-count, .dirb-bsum { color: #6b7280; font-size: .82rem; }
.dirb-bsum { flex: 1 1 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirb-btype { font-weight: 700; font-size: .85rem; background: #e0ecf5; border-radius: 5px; padding: 1px 7px; }
.dirb-ed-secbody { padding: 4px 12px 12px; border-top: 1px solid #e5e7eb; }
.dirb-ed-blocks { margin-top: 10px; }
.dirb-ed-block { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; background: #fbfcfd; }
.dirb-ed-blockbody { padding: 6px 10px 10px; border-top: 1px solid #eef0f2; }
.dirb-ctl { display: inline-flex; gap: 3px; margin-left: auto; }
.dirb-ibtn { border: 1px solid #cbd5e1; background: #fff; border-radius: 5px; min-width: 28px; height: 28px; cursor: pointer; font-size: .9rem; line-height: 1; }
.dirb-ibtn:disabled { opacity: .35; cursor: default; }
.dirb-ibtn.dirb-del { color: #b91c1c; }
.dirb-toggle { border: 0; background: transparent; }
.dirb-drag { cursor: grab; color: #9ca3af; font-size: 1.1rem; padding: 0 2px; user-select: none; }
.dirb-dragging { opacity: .5; }
.dirb-dropover { outline: 2px dashed var(--dirb-accent); }
.dirb-ed-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.dirb-addsel { width: auto; }
.dirb-addsec { margin-top: 6px; }
.dirb-rte { margin-top: 8px; }
.dirb-rte-tb { display: flex; flex-wrap: wrap; gap: 3px; margin: 2px 0 4px; }
.dirb-rte-tb button { border: 1px solid #cbd5e1; background: #fff; border-radius: 5px; padding: 3px 8px; font-size: .85rem; cursor: pointer; }
.dirb-rte-area { min-height: 90px; border: 1px solid #9ca3af; border-radius: 6px; padding: 8px 10px; background: #fff; }
.dirb-rte-area:focus { outline: 2px solid var(--dirb-accent); }
.dirb-te-opt { font-size: .88rem; display: block; margin: 8px 0 4px; }
.dirb-te-scroll { overflow-x: auto; }
.dirb-te { border-collapse: collapse; min-width: 100%; }
.dirb-te th, .dirb-te td { border: 1px solid #e5e7eb; padding: 3px; vertical-align: top; min-width: 120px; }
.dirb-te .dirb-te-ctl { min-width: 150px; background: #f8fafc; font-size: .8rem; }
.dirb-te-ctl .dirb-ctl { margin: 3px 0 0; }
.dirb-te-merge { display: block; font-size: .78rem; margin-top: 2px; }
.dirb-te-colctl { display: flex; gap: 3px; margin-top: 3px; }
.dirb-te-header td { background: #eef2f5; }
.dirb-te-group td { background: #e5edf3; }
.dirb-cellin { min-height: 32px; }
.dirb-te-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.dirb-ce-item { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; margin-bottom: 8px; background: #fff; }
.dirb-ce-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dirb-preview-banner { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-weight: 600; }
.dirb-preview { border: 2px dashed #f59e0b; border-radius: 10px; padding: 10px; }
.dirb-hist-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid #e5e7eb; padding: 8px 0; }
.dirb-hist-actions { margin: 6px 0 10px; }
.dirb-help { color: #6b7280; font-size: .85rem; }
.dirb-flash { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 10000; font-size: .92rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* ---------- print (only when the beta tab is printed: html.dirb-print) ---------- */
@media print {
	html.dirb-print *:not(:has(#dirb-app)):not(#dirb-app):not(#dirb-app *) { display: none !important; }
	html.dirb-print, html.dirb-print body { background: #fff !important; overflow: visible !important; height: auto !important; }
	html.dirb-print body * { box-shadow: none !important; }
	html.dirb-print .container, html.dirb-print .tab-content, html.dirb-print #beta { margin: 0 !important; padding: 0 !important; max-width: none !important; background: none !important; border: 0 !important; overflow: visible !important; height: auto !important; }
	html.dirb-print .dirb-noprint, html.dirb-print .dirb-results { display: none !important; }
	html.dirb-print .dirb-section { border: 0; padding: 0; margin: 0 0 14px; break-inside: auto; }
	html.dirb-print .dirb-shead, html.dirb-print .dirb-btitle { break-after: avoid; }
	html.dirb-print .dirb-card, html.dirb-print .dirb-contact, html.dirb-print .dirb-table tr { break-inside: avoid; }
	html.dirb-print .dirb-title { text-align: center; width: 100%; }
	html.dirb-print .dirb-head { display: block; text-align: center; margin-bottom: 10px; }
	html.dirb-print .dirb-head .dirb-rev { display: block; text-align: center; font-size: 10pt; color: #444; }
	html.dirb-print .dirb-cards, html.dirb-print .dirb-contacts { grid-template-columns: repeat(2, 1fr); }
	html.dirb-print mark.dirb-hit { background: none; }
	html.dirb-print a { color: #000; text-decoration: none; }
	html.dirb-print .dirb-sms { display: none; }
}
/* the repeating "title · Rev." page footer is an @page margin box added by dirbeta.js only while printing */
/* editor checkboxes: keep them inline with their labels (site-wide input styles make them block) */
.dirb-editor input[type="checkbox"] { display: inline-block !important; width: auto !important; min-width: 16px; height: 16px; margin: 0 !important; flex: 0 0 auto; vertical-align: middle; }
.dirb-te-opt, .dirb-te-merge, .dirb-ed-es { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.dirb-te-opt { margin: 6px 0 8px; }
.dirb-te-merge { font-size: 12px; margin: 4px 0; }
