/* ================================================================
   DAR Org Chart  –  org-chart.css  v2.5.2
   Layered on dabeng/OrgChart base styles (loaded separately from cdnjs).
   Renamed/rebuilt from uga-org-chart's org-chart.css v2.2.0 — same
   styling, droc- prefix throughout instead of ugaoc-, no ugaoc-*
   names reused anywhere.

   v2.5.2 changes:
     - Horizontal breathing room between sibling cards (--droc-sibling-gap,
       default 12px) via flex column-gap on the side-by-side rows. Because the
       connector lines are drawn inside each sibling's own box, a gap would
       break them, so the line rules from 2.5.1 now extend half a gap toward
       each neighbor (first sibling: card center to its right edge + half a
       gap; middle siblings: full box + half a gap on each side; last sibling:
       half a gap before its box to the card center). The extensions meet in
       the middle of each gap, so the horizontal line stays continuous and
       still starts and ends exactly at the first and last card's center.
       Stacked lists and the rotated orientation="vertical" layouts are
       untouched. Change the gap by editing one variable.

   v2.5.1 changes:
     - Fixed the long red connector lines that ran past (and did not attach to)
       any card. Root cause: dabeng draws each sibling's horizontal line as a
       fraction of that sibling's list item (50% for the first/last sibling),
       which assumes the card is CENTERED in its item. In this plugin the card
       sits at the item's LEFT edge (the library's demos get centering from
       their page wrapper, which we do not have), so any sibling whose
       reports spread wide put the line's end or start at the middle of
       empty space. The 2.3.3 override that measured from the card center was
       limited to people with stacked reports; it now covers every sibling in
       a normal (horizontal) row. Stacked lists are excluded (they use their
       own elbows) and so are the rotated orientation="vertical" layouts.

   v2.3.5 changes:
     - .droc-hint is no longer a toolbar item. It is a quiet caption in the
       strip between the toolbar and the chart (chart background, subdued
       text), so it scrolls away with the page instead of sitting in the
       sticky bar, and the search box is the first thing on the left again.
     - Tighter, evenly sized toolbar. One --droc-ctl-h (36px) now sets the
       height of the search box, the Chart/List radio group, and the Zoom /
       Options buttons, all vertically centered. Toolbar padding 14px -> 8px.
       Root cause of the mismatch: .droc-controls stretched its children, but
       the Zoom/Options buttons sit inside wrapper divs that stretched while
       the buttons themselves did not; the radio group also used different
       padding. Height/padding/font-size forced with !important on the
       triggers and radio spans (same theme-conflict pattern as elsewhere).

   v2.3.3 changes:
     - Stacked-branch connector line fixes. dabeng 5.0.0's connector CSS is
       hardcoded for its own 130px nodes and 10px indent; our 190px cards and
       50px indent left gaps and overshoots. Added --droc-card-w (card width,
       per size) and overrides for: (1) row-level horizontal line segments on
       li's that contain a stacked branch (they were measured from the li's
       center, but the card is left-aligned in a li that is wider than the
       card); (2) the first stacked child's top connector, which overshot the
       parent's center stub; (3) li margins/spacing inside stacked lists, which
       left gaps in the vertical trunk line. Cards now declare
       box-sizing:border-box so --droc-card-w is the true rendered width.

   v2.3.2 changes:
     - Stacked (hybrid / stack_threshold) branches indent further:
       .nodes.vertical and its nested .nodes use --droc-stack-indent
       (default 50px; dabeng's own step is 18px).

   v2.3.1 changes:
     - Removed the +/- corner indicator (.droc-toggle-indicator and its
       mini-size/reduced-motion references, .droc-card-collapsed).
     - .droc-hint is now a flex item INSIDE .droc-toolbar, to the left of
       the search box, instead of its own row beneath the toolbar.

   v2.3.0 changes:
     - Accessibility: --uga-dept variable (department text) darkened in the
       light theme to meet 4.5:1; tooltip also shows on :focus-visible and
       can be dismissed (.droc-tip-dismissed); cards get scroll-margin-top so
       the sticky toolbar doesn't cover a keyboard-focused card; collapsed
       mobile search input is visibility:hidden (no longer tab-reachable);
       List View region gets a focus ring.
     - No stacked-layout CSS yet: stack_threshold relies on dabeng's own
       hybrid styles. Our li.hierarchy margin override and fixed card
       widths may need a follow-up once the stacked markup is seen live.

   v2.2.0 changes:
     - .droc-toggle-indicator is now ALWAYS visible (was opacity:0 until
       hover, so invisible on touch devices and for first-time visitors).
       Shows "+" when the card's children are hidden and a minus sign
       when shown, driven by .droc-card-collapsed (toggled in JS by
       applyAriaSemantics). Hover just fills the badge red.
     - Added .droc-hint: one-line instruction under the toolbar.

   v2.1.0 changes:
     - Toolbar reorganized: search-wrap/search-icon-btn (mobile collapse
       below 900px), .droc-dropdown/.droc-dropdown-panel/.droc-dropdown-
       item/.droc-dropdown-heading/.droc-dropdown-checkbox/.droc-dropdown-
       divider (Zoom ▾ and Options ▾ menus).
     - Added .droc-dept-text (new department line on cards).
     - .droc-inner[data-tooltip]:hover::before: white-space normal ->
       pre-line, so an embedded newline in the tooltip (title + parsed
       department on separate lines) renders as a real line break.
     - Added .droc-filtered-dim (bridge-node dimming for the two new
       filters) — distinct class from .droc-dimmed (search's non-match
       dimming) so the two never fight if both are active at once.
     - Removed dead .droc-chart-buttons rule — no markup uses it anymore.

   v2.0.1 changes:
     - .droc-fit-wrapper: added display:inline-block — fixes the
       centering bug (see dar-org-chart.php's 2.0.1 changelog entry for
       the full root-cause explanation).
     - .droc-radio-label span: color forced directly on the span,
       !important — theme's global span-color rule was winning over
       color merely inherited from the ancestor .droc-radio-label.
       Same fix applied to .droc-zoom-label / .droc-zoom-readout.
     - .droc-search-input: flex-grow 1->0, min-width 180px->140px — lets
       it share the toolbar row with buttons instead of forcing its own
       line above them.

   v2.0.0 changes:
     - Moved position:sticky from .droc-toolbar to new .droc-sticky-header
       wrapper (covers toolbar + results panel together — fixes repeated
       search-result click bug).
     - .droc-search-input: added explicit height/box-sizing !important
       (mobile rendering bug fix, best-guess given no live theme access).
     - Added .droc-view-radio-group / .droc-fitmode-radio-group /
       .droc-radio-label — segmented-button-styled radio pairs, using
       :has() for active-state highlighting (see KNOWN LIMITATION in
       dar-org-chart.php's 2.0.0 changelog entry re: older browsers).
     - Added .droc-zoom-control / .droc-zoom-slider / .droc-zoom-readout
       for the new manual zoom slider.

   v1.9.0 changes:
     - Removed left/transform from .droc-chart .orgchart — that must
       stay exclusively dabeng's own property now, never a stylesheet
       default either. Added .droc-fit-wrapper (position: relative) —
       fit-to-view scaling and initial centering live here instead.

   v1.8.0 changes:
     - No new selectors needed — Reset View button sits directly in
       .droc-chart-buttons and inherits existing button styling.

   v1.7.0 changes:
     - Removed dead .ri-dept rule — search results no longer show email
       (data-email attribute no longer exists on cards at all).

   v1.6.0 changes:
     - Renamed .droc-inner[data-email]:hover::before selector to target
       data-tooltip instead (name+title content replaces email).
     - Tooltip now wraps (white-space: normal, max-width: 220px) rather
       than forcing single-line width — name+title runs longer than an
       email address typically did.

   v1.5.0 changes:
     - No CSS changes — both changes that round were JS-only.

   v1.4.0 changes:
     - No new selectors needed — Export List CSV button sits directly in
       .droc-controls and inherits existing button styling.

   v1.3.0 changes:
     - No new selectors needed — Export List PDF button sits directly in
       .droc-controls and inherits existing button styling; the
       expand/collapse timing fix was JS-only.

   v1.2.2 changes:
     - No CSS changes — fix was JS-only (ARIA/fit-to-view timing).

   v1.2.1 changes:
     - No CSS changes — fix was JS-only (zoom cap raised 2x -> 3x).

   v1.2.0 changes (companion to JS v1.2.0):
     - Added .droc-chart-buttons layout rule for the newly nested
       chart-only button group (Expand All / Collapse All / Fit to
       View / Export PDF), toggled as a unit alongside List View.

   v1.1.1 changes:
     - No CSS changes that round — fix was JS-only (initial-render fit).

   v1.1.0 changes:
     - Removed .droc-legend styles — legend removed from toolbar as
       redundant with the per-card report-count badge.
     - Added .droc-list-view styles — bounded, independently-scrollable
       nested <ul><li> alternative to the chart, same container pattern
       as .droc-chart.

   v1.0.1:
     - Added min-height to .droc-inner (normal size) — was previously
       only set for compact/mini, letting sibling rows with varying
       title lengths throw off dabeng's connector-line math.
     - .droc-chart overflow: hidden -> auto (scroll fallback instead of
       permanent clipping).

   v1.0.0:
     - Full rename: .ugaoc-* -> .droc-*
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Source+Sans+3:wght@400;500;600&display=swap');

/* ---- CSS variables (light theme) ------------------------------ */
.droc-wrap {
    --uga-red:        #BA0C2F;
    --uga-black:      #000000;
    --uga-silver:     #A7A9AC;
    --uga-dept:       #6B6E72; /* department line: 4.5:1+ on white */
    --uga-light:      #F5F5F5;
    --uga-border:     #D9D9D9;
    --uga-card-bg:    #FFFFFF;
    --uga-card-hover: #FFF8F9;
    --uga-text:       #1A1A1A;
    --uga-subtext:    #4A4A4A;
    --uga-toolbar-bg: #000000;
    --uga-chart-bg:   #F5F5F5;
    --uga-line:       #C8C8C8;
    --radius:         6px;
    --shadow:         0 2px 8px rgba(0,0,0,0.10);
    --shadow-hover:   0 4px 16px rgba(186,12,47,0.15);
    --transition:     0.2s ease;
    --droc-stack-indent: 50px; /* per-level indent for stacked (stack_threshold) branches */
    --droc-card-w: 190px;      /* rendered card width; connector math below depends on it */
    --droc-sibling-gap: 12px;  /* space between side-by-side cards; connector math below depends on it */
    --droc-ctl-h: 36px;        /* one height for every toolbar control */

    font-family: 'Source Sans 3', sans-serif;
    color: var(--uga-text);
    max-width: 100%;
}

/* ---- Dark theme ----------------------------------------------- */
.droc-wrap.droc-theme-dark {
    --uga-light:      #1A1A1A;
    --uga-dept:       #A7A9AC;
    --uga-border:     #3A3A3A;
    --uga-card-bg:    #2C2C2C;
    --uga-card-hover: #3A1018;
    --uga-line:       #444444;
    --uga-text:       #F0F0F0;
    --uga-subtext:    #AAAAAA;
    --uga-toolbar-bg: #111111;
    --uga-chart-bg:   #1A1A1A;
}

/* Card width per size; keep in sync with the .droc-inner width rules below. */
.droc-wrap.droc-size-compact { --droc-card-w: 150px; }
.droc-wrap.droc-size-mini    { --droc-card-w: 115px; }

/* ---- Chart title ----------------------------------------------- */
.droc-chart-title {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    color: var(--uga-red);
    margin: 0;
    padding: 16px 18px 0;
    background: var(--uga-toolbar-bg);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ---- Toolbar --------------------------------------------------- */
/* Wraps .droc-toolbar + .droc-search-results as a single sticky unit.
   Previously only .droc-toolbar was sticky — the results panel below it
   scrolled away normally, so clicking a result (which scrolls the page
   to reveal that card) could shift the results panel out from under a
   second click. Both now move together, staying anchored on screen. */
.droc-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.droc-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 18px;
    background: var(--uga-toolbar-bg);
    border-radius: var(--radius) var(--radius) 0 0;
}
.droc-chart-title + .droc-toolbar {
    border-radius: 0;
    padding-top: 10px;
}

/* Instruction caption (2.3.5). Sits in the strip between the toolbar and
   the chart rather than in the sticky bar, so it scrolls away and doesn't
   compete with the controls. Same background/side borders as the chart so
   the two read as one panel. Color forced, !important, per theme conflicts. */
.droc-hint {
    background: var(--uga-chart-bg);
    border: 1px solid var(--uga-border);
    border-top: none;
    border-bottom: none;
    padding: 8px 20px 0;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--uga-subtext) !important;
}
.droc-hint + .droc-chart {
    padding-top: 8px; /* the caption supplies the strip's top spacing */
}

.droc-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.droc-search-icon-btn {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
}
.droc-search-icon-btn:hover { background: rgba(255,255,255,0.12); }
.droc-search-icon-btn { height: var(--droc-ctl-h); }

.droc-search-input {
    /* flex-grow:0 (was 1) — previously grew to fill available space,
       which pushed the whole control row below it onto its own line
       any time the combined width didn't fit. Letting it shrink instead
       of grow means it shares one row with the buttons far more often. */
    flex: 0 1 200px;
    min-width: 140px;
    /* Explicit height + box-sizing, !important: on at least one
       reported mobile site this input rendered enormous (square,
       ~500px tall) — almost certainly a theme/global input style
       bleeding in (same class of conflict as the li.hierarchy margin
       override below), not anything in our own layout. Forcing this
       explicitly is the same defensive pattern already used elsewhere
       in this file for exactly this kind of theme collision. */
    height: var(--droc-ctl-h) !important;
    box-sizing: border-box !important;
    padding: 8px 14px;
    border: 2px solid transparent;
    border-radius: 4px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition), background var(--transition),
                width var(--transition), opacity var(--transition);
}
.droc-search-input::placeholder { color: rgba(255,255,255,0.5); }

/* Below ~900px the toolbar's row layout gets tight enough that search
   was the thing forced to wrap onto its own line. Collapsing it to an
   icon that expands on tap protects it from ever wrapping, at the cost
   of an extra tap to search on narrower screens. 900px is a starting
   estimate, not a measured value — may need adjusting once tested live. */
@media (max-width: 900px) {
    .droc-search-icon-btn { display: inline-flex; align-items: center; justify-content: center; }
    .droc-search-input {
        width: 0;
        min-width: 0;
        padding: 0;
        border: 0;
        opacity: 0;
        position: absolute;
        pointer-events: none;
        visibility: hidden; /* removes it from tab order while collapsed */
    }
    .droc-search-wrap.droc-search-open {
        flex: 1 1 auto;
    }
    .droc-search-wrap.droc-search-open .droc-search-input {
        width: 100%;
        min-width: 140px;
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        position: relative;
        padding: 8px 14px;
        border: 2px solid transparent;
    }
}
.droc-search-input:focus {
    border-color: var(--uga-red);
    background: rgba(255,255,255,0.18);
}

.droc-controls {
    display: flex;
    align-items: center; /* was stretch: wrapper divs grew, buttons inside did not */
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

/* ---- Radio-styled toggle groups (view switch, fit mode) --------
   Visually a segmented button pair, but semantically real radio
   inputs — native mutually-exclusive + current-selection semantics,
   rather than a single button whose label describes the OTHER state
   you'd switch TO (ambiguous about which state you're currently in). */
.droc-view-radio-group,
.droc-fitmode-radio-group {
    display: flex;
    box-sizing: border-box;
    height: var(--droc-ctl-h);
    border-radius: 4px;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.3);
}
.droc-radio-label {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background var(--transition);
}
/* Reported as gray-on-black / hard to read — direct color rules on an
   element always beat color merely inherited from an ancestor, so a
   theme with any global rule styling bare <span> elements (this site's
   theme clearly has an extensive custom design system, per its computed
   styles) would silently win over the color set on .droc-radio-label
   above, even though that rule is more specific. Setting color directly
   on the span itself, !important, removes that fight entirely. */
.droc-radio-label span {
    color: #fff !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
}
.droc-radio-label + .droc-radio-label {
    border-left: 1.5px solid rgba(255,255,255,0.3);
}
.droc-radio-label input[type="radio"] {
    /* Visually hidden, not display:none — stays in the accessibility
       tree and keyboard-focusable. */
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.droc-radio-label input[type="radio"]:checked ~ span {
    font-weight: 700;
}
.droc-radio-label:has(input[type="radio"]:checked) {
    background: var(--uga-red);
}
.droc-radio-label:has(input[type="radio"]:focus-visible) {
    outline: 2px solid #fff;
    outline-offset: -2px;
}
.droc-radio-label:hover {
    background: rgba(255,255,255,0.12);
}
.droc-radio-label:has(input[type="radio"]:checked):hover {
    background: var(--uga-red);
}

/* ---- Zoom slider -------------------------------------------------- */
.droc-zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
}
.droc-zoom-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75) !important;
    font-weight: 600;
}
.droc-zoom-slider {
    width: 100px;
    accent-color: var(--uga-red);
}
.droc-zoom-readout {
    font-size: 0.78rem;
    color: #fff !important;
    font-weight: 600;
    min-width: 38px;
}

.droc-controls button {
    padding: 6px 14px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: transparent;
    color: #fff;
    transition: background var(--transition), border-color var(--transition);
}
.droc-controls button:hover {
    background: var(--uga-red);
    border-color: var(--uga-red);
}
.droc-controls button:disabled {
    opacity: 0.6;
    cursor: wait;
}
/* Zoom / Options triggers: same height as the radio group and search box. */
.droc-controls .droc-dropdown-trigger {
    box-sizing: border-box !important;
    height: var(--droc-ctl-h) !important;
    margin: 0 !important;
    padding: 0 14px !important;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
}

/* ---- Dropdown menus (Zoom, Options) ----------------------------- */
.droc-dropdown {
    position: relative;
}
.droc-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--uga-toolbar-bg);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 12px;
    min-width: 230px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.droc-dropdown-panel[hidden] {
    display: none;
}
.droc-dropdown-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.55) !important;
    margin: 4px 6px 6px;
}
.droc-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #fff !important;
    padding: 8px 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
}
.droc-dropdown-item:hover {
    background: var(--uga-red);
}
.droc-dropdown-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    font-size: 0.85rem;
    padding: 6px;
    cursor: pointer;
}
.droc-dropdown-divider {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 8px 0;
}
.droc-dropdown .droc-fitmode-radio-group,
.droc-dropdown .droc-zoom-control {
    margin-bottom: 10px;
}
.droc-dropdown .droc-fitmode-radio-group {
    display: flex;
}

/* ---- Search results -------------------------------------------- */
.droc-search-results {
    background: var(--uga-card-bg);
    border: 1px solid var(--uga-border);
    border-top: 3px solid var(--uga-red);
    padding: 12px 18px;
    max-height: 280px;
    overflow-y: auto;
    color: var(--uga-text);
}
.droc-search-results h4 {
    margin: 0 0 10px;
    font-family: 'Merriweather', serif;
    font-size: 0.85rem;
    color: var(--uga-red);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.droc-result-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--uga-border);
    cursor: pointer;
}
.droc-result-item:last-child { border-bottom: none; }
.droc-result-item:hover { background: var(--uga-light); }
.droc-result-item .ri-name  { font-weight: 600; font-size: 0.9rem; }
.droc-result-item .ri-title { font-size: 0.8rem; color: var(--uga-subtext); }

/* ---- Chart container ------------------------------------------- */
.droc-chart {
    background: var(--uga-chart-bg);
    border: 1px solid var(--uga-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 20px;
    overflow: auto;
    position: relative;
}

/* ---- Override dabeng base node styles ------------------------- */
.droc-chart .orgchart {
    background: var(--uga-chart-bg);
}

/* Fit-to-view scaling and initial centering live HERE, never on
   .orgchart directly — dabeng's own pan/zoom writes to .orgchart's
   transform for its internal zoom tracking, and if fit-to-view wrote
   to the same property, each fit-to-view call would silently overwrite
   dabeng's zoom, leaving its internal state stale relative to the DOM
   (confirmed cause of "can't zoom in after expanding" in testing). */
.droc-fit-wrapper {
    position: relative;
    /* MUST shrink-to-fit its content, not stretch full-width — the
       left:50% + translateX(-50%) centering trick only works on an
       element sized to its own content. .orgchart apparently relied on
       exactly this (it's how centering worked in every version before
       this wrapper was introduced in 1.9.0); this plain div defaults to
       block (full-width), silently making that centering a no-op ever
       since — confirmed bug: chart loads left-aligned, and neither Fit
       to View nor Reset View can correct it, since both just reapply
       the same (non-functional-on-a-full-width-element) centering math. */
    display: inline-block;
}

.droc-chart .orgchart .node {
    width: auto;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    cursor: default;
}

/* ---- Our inner card -------------------------------------------- */
.droc-inner {
    background: var(--uga-card-bg);
    border: 1.5px solid var(--uga-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    min-width: 150px;
    max-width: 190px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), border-color var(--transition),
                background var(--transition), transform var(--transition);
    position: relative;
    scroll-margin-top: 160px; /* keep keyboard-focused cards clear of the sticky toolbar */
}
.droc-inner:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--uga-red);
    background: var(--uga-card-hover);
    transform: translateY(-2px);
}
.droc-inner.droc-has-children-card {
    cursor: pointer;
}

/* Root node */
.droc-chart .node.droc-root-node .droc-inner {
    border-top: 4px solid var(--uga-red);
}

/* Card hover tooltip — full name + untruncated title, for cases where
   the visible title got cut off (mini's word limit, or normal/compact's
   2-line clamp). Longer than an email address, so unlike the tooltip
   this replaced, this one wraps rather than forcing single-line width. */
.droc-inner[data-tooltip]:hover::before,
.droc-inner[data-tooltip]:focus-visible::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: pre-line;
    width: max-content;
    max-width: 220px;
    text-align: center;
    z-index: 300;
    pointer-events: none;
}

/* Escape dismisses the tooltip without moving focus (WCAG 1.4.13). */
.droc-inner.droc-tip-dismissed::before {
    display: none !important;
}

/* Avatar */
.droc-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--uga-red);
    color: #fff;
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 7px;
}

.droc-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
    margin-bottom: 3px;
    color: var(--uga-text);
    word-break: break-word;
}
.droc-title-text {
    font-size: 0.73rem;
    color: var(--uga-subtext);
    line-height: 1.35;
    margin-bottom: 3px;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.droc-dept-text {
    font-size: 0.66rem;
    color: var(--uga-dept);
    line-height: 1.3;
    margin-bottom: 3px;
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.droc-badge {
    display: inline-block;
    background: var(--uga-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    margin-top: 4px;
    letter-spacing: 0.04em;
}

/* ---- Override dabeng connector line colour -------------------- */
.droc-chart .orgchart .lines .downLine,
.droc-chart .orgchart .lines .topLine,
.droc-chart .orgchart .lines .rightLine,
.droc-chart .orgchart .lines .leftLine {
    border-color: var(--uga-line) !important;
    background-color: var(--uga-line) !important;
}

/* ---- Override dabeng expand/collapse edge button --------------- */
.droc-chart .orgchart .node .edge {
    border-color: var(--uga-red) !important;
    color: var(--uga-red) !important;
    font-size: 0.8rem;
    width: 20px; height: 20px;
    line-height: 17px;
    z-index: 5;
}
.droc-chart .orgchart .node .edge:hover {
    background: var(--uga-red) !important;
    color: #fff !important;
}

/* ---- Search state overrides on dabeng .node -------------------- */
.droc-chart .node.droc-match .droc-inner {
    border-color: var(--uga-red);
    background: var(--uga-card-hover);
    box-shadow: 0 0 0 3px rgba(186,12,47,0.2);
}
.droc-chart .node.droc-dimmed .droc-inner {
    opacity: 0.3;
}
/* Bridge nodes: excluded by a filter (student worker / SCUD-funded)
   but kept in the tree because a visible descendant sits below them —
   removing them would disconnect that descendant from the chart.
   Distinct class from .droc-dimmed (search's non-match dimming) so the
   two never fight if both are active on the same node simultaneously. */
.droc-chart .node.droc-filtered-dim .droc-inner {
    opacity: 0.55;
    filter: grayscale(70%);
}
.droc-chart .node.droc-highlight .droc-inner {
    outline: 3px solid var(--uga-red);
    outline-offset: 2px;
}

/* ---- SIZE: compact -------------------------------------------- */
.droc-chart .node.droc-node-compact .droc-inner {
    min-width: 115px;
    max-width: 150px;
    padding: 8px 10px;
    min-height: 88px;
}
.droc-chart .node.droc-node-compact .droc-avatar {
    width: 28px; height: 28px;
    font-size: 0.72rem;
    margin-bottom: 5px;
}
.droc-chart .node.droc-node-compact .droc-name  { font-size: 0.75rem; }
.droc-chart .node.droc-node-compact .droc-title-text { font-size: 0.65rem; }
.droc-chart .node.droc-node-compact .droc-badge { font-size: 0.6rem; padding: 1px 5px; }

/* ---- SIZE: mini ----------------------------------------------- */
.droc-chart .node.droc-node-mini .droc-inner {
    min-width: 85px;
    max-width: 115px;
    padding: 5px 7px;
    border-radius: 4px;
    min-height: 68px;
}
.droc-chart .node.droc-node-mini .droc-avatar {
    width: 20px; height: 20px;
    font-size: 0.58rem;
    margin-bottom: 3px;
}
.droc-chart .node.droc-node-mini .droc-name  { font-size: 0.65rem; line-height: 1.2; }
.droc-chart .node.droc-node-mini .droc-title-text { font-size: 0.57rem; line-height: 1.2; }

/* Hide the library's own export button — we proxy it from our toolbar */
.droc-chart .oc-export-btn,
.droc-lib-export-btn {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ---- Empty state ---------------------------------------------- */
.droc-empty {
    text-align: center;
    padding: 40px;
    color: var(--uga-subtext);
    font-size: 0.95rem;
}

/* ---- List view (accessible alternative to the chart) ----------- */
/* Same bounded-and-scrollable pattern as .droc-chart, so switching
   views doesn't change how the wrapper behaves on the page. Plain
   nested <ul><li> — no ARIA tree roles needed, native list semantics
   already convey structure and are keyboard-navigable by default. */
.droc-list-view {
    background: var(--uga-chart-bg);
    border: 1px solid var(--uga-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 20px 24px;
    max-height: 70vh;
    overflow-y: auto;
    color: var(--uga-text);
}
.droc-list-view ul {
    list-style: none;
    margin: 0;
    padding-left: 22px;
    border-left: 1.5px solid var(--uga-border);
}
.droc-list-view > ul {
    padding-left: 0;
    border-left: none;
}
.droc-list-view li {
    margin: 10px 0;
}
.droc-list-person {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--uga-text);
}
.droc-list-title {
    font-size: 0.8rem;
    color: var(--uga-subtext);
}

/* List View is a focusable scroll region so keyboard users can scroll it. */
.droc-list-view:focus-visible {
    outline: 3px solid var(--uga-red);
    outline-offset: -3px;
}

/* ---- Responsive ----------------------------------------------- */
@media (max-width: 640px) {
    .droc-toolbar  { flex-direction: column; align-items: stretch; }
    .droc-controls { margin-left: 0; }
}

/* ---- Focus ring on keyboard-focused cards ---------------------- */
.droc-chart .node .droc-inner:focus {
    outline: none;
}
.droc-chart .node .droc-inner:focus-visible {
    outline: 3px solid var(--uga-red);
    outline-offset: 3px;
    box-shadow: 0 0 0 1px var(--uga-card-bg) inset, var(--shadow-hover);
    z-index: 4;
}
.droc-result-item:focus-visible {
    outline: 2px solid var(--uga-red);
    outline-offset: 2px;
}

/* ---- Hidden live region for screen readers --------------------- */
.droc-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Theme conflict: some themes set margin-left on all li ---- */
.droc-chart .orgchart li.hierarchy {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ---- Stacked (vertical/hybrid) branches: wider indent ----------
   dabeng indents each stacked level by a fixed 18px. The connector
   lines are anchored to each li, so they shift with the cards when this
   padding grows. Tune --droc-stack-indent at the top of this file. */
.droc-chart .orgchart .nodes.vertical,
.droc-chart .orgchart .nodes.vertical .nodes {
    padding-left: var(--droc-stack-indent);
}

/* ---- Stacked branches: connector line fixes (2.3.3) ------------
   dabeng's connector CSS assumes its own default 130px nodes and 10px
   indent. With 190px cards and a wider indent, three things drift: */

/* (1) Row-level horizontal line, for EVERY sibling in a normal row (2.5.1),
   now also bridging the gap between siblings (2.5.2).
   dabeng draws a sibling's line as a fraction of its list item: the first
   sibling's from 50% to the right edge, the last sibling's from the left edge
   to 50%. That is the card's center only if the card is centered in the item,
   but here it sits at the item's left edge. Whenever a sibling's reports
   spread wider than its own card, the item is much wider than the card and
   "50%" lands in empty space: the long lines that attach to nothing. Measure
   from the card's center instead.
   Siblings are separated by --droc-sibling-gap (flex column-gap). The line is
   drawn inside each sibling's own box, so each piece reaches half a gap toward
   its neighbor; the pieces meet in the middle of the gap and the line stays
   continuous. Skipped: stacked lists (own elbows) and the rotated l2r/r2l
   layouts (the library centers those). */
.droc-chart .orgchart:not(.l2r):not(.r2l) .nodes {
    column-gap: var(--droc-sibling-gap);
}
.droc-chart .orgchart:not(.l2r):not(.r2l) li.hierarchy:not(.nodes.vertical *):first-child:not(:only-child)::before {
    left: calc(var(--droc-card-w) / 2 - 1px);
    width: calc(100% - var(--droc-card-w) / 2 + 1px + var(--droc-sibling-gap) / 2);
}
.droc-chart .orgchart:not(.l2r):not(.r2l) li.hierarchy:not(.nodes.vertical *):not(:first-child):not(:last-child)::before {
    left: calc(var(--droc-sibling-gap) / -2);
    width: calc(100% + var(--droc-sibling-gap));
}
.droc-chart .orgchart:not(.l2r):not(.r2l) li.hierarchy:not(.nodes.vertical *):last-child:not(:only-child)::before {
    left: calc(var(--droc-sibling-gap) / -2);
    width: calc(var(--droc-card-w) / 2 + 1px + var(--droc-sibling-gap) / 2);
}

/* (2) The first stacked child's top connector runs left-to-right from its
   trunk to the PARENT card's center stub. It was 50% of the child li (not
   the parent's center), so it overshot once the indent grew. Parent center
   is card-w/2 from the parent's left; the child li starts one indent in. */
.droc-chart .orgchart .nodes.vertical > .hierarchy:first-child::before {
    width: max(12px, calc(var(--droc-card-w) / 2 - var(--droc-stack-indent) + 8px));
}

/* (3) Gaps in the vertical trunk between stacked siblings: the trunk is
   drawn inside each li, so any margin between li's leaves a gap. Remove
   vertical margins here (only inside stacked lists, so horizontal layouts
   are unaffected) and create the spacing with padding instead, which the
   trunk line does cover. */
.droc-chart .orgchart .nodes.vertical .hierarchy {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 12px;
}

/* ---- Fixed card widths so dabeng connector lines stay aligned -- */
.droc-chart .orgchart .node .droc-inner {
    width: 190px;
    box-sizing: border-box; /* makes --droc-card-w the true rendered width */
}
.droc-chart .orgchart .node.droc-node-compact .droc-inner {
    width: 150px;
}
.droc-chart .orgchart .node.droc-node-mini .droc-inner {
    width: 115px;
}

/* ---- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .droc-inner,
    .droc-chart .node {
        transition: none !important;
    }
    .droc-inner:hover {
        transform: none;
    }
}
