/* ============================================================
   The investor-facing shell.

   Structure follows assets/crm.css, which already proves this layout
   works: a fixed dark top bar, a fixed-width pane, and a scrolling
   main. Below 860px the pane becomes an overlay drawer with a scrim.
   ============================================================ */

.dr-body { height: 100dvh; overflow: hidden; }

.dr-app { display: flex; flex-direction: column; height: 100dvh; }

/* ---------- top bar ---------- */

.dr-top {
  height: var(--dr-top-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255,255,255,0.09);
  color: #fff;
}

.dr-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
/* The pre-whitened asset, not brightness(0) invert(1) on the source logo:
   Logo_long.png carries a soft drop shadow in its alpha channel, and
   inverting turns that shadow into a pale halo around the mark. */
.dr-brand img { height: 17px; width: auto; }
.dr-home { padding: 6px 11px; }
.dr-badge {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-light);
  border: 1px solid rgba(74,184,224,0.35);
  border-radius: 20px;
  padding: 3px 8px;
}

.dr-top-spacer { flex: 1; }

.dr-viewer-id {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.62);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dr-top .dr-icon-btn { color: rgba(255,255,255,0.6); }
.dr-top .dr-icon-btn:hover { color: #fff; background: rgba(255,255,255,0.08); border-color: transparent; }

.dr-back-admin {
  color: var(--blue-light);
  border-color: rgba(74,184,224,0.35);
  padding: 6px 11px;
  font-size: 0.76rem;
}
.dr-back-admin:hover { background: rgba(74,184,224,0.12); border-color: rgba(74,184,224,0.5); }
.dr-back-admin svg { flex-shrink: 0; }

.dr-burger { display: none; }

/* ---------- shell ---------- */

.dr-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--dr-tree-w) 1fr;
  position: relative;
}

/* ---------- tree ---------- */

.dr-tree {
  border-right: 1px solid var(--rule);
  background: var(--bg-off);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.dr-tree-search {
  position: relative;
  padding: 12px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.dr-tree-search input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 7px 10px 7px 30px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
}
.dr-tree-search input:focus { border-color: var(--blue); outline: none; }
.dr-tree-search-icon {
  position: absolute;
  left: 21px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}

.dr-tree-list { padding: 8px 0 32px; }
.dr-tree-empty { padding: 24px 16px; font-size: 0.82rem; color: var(--ink-faint); text-align: center; }

.dr-tree-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 6px 12px 6px calc(10px + var(--depth, 0) * 13px);
  border: none;
  border-left: 2px solid transparent;
  background: none;
  font-family: var(--font);
  font-size: 0.83rem;
  color: var(--ink-mid);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s var(--ease);
}
.dr-tree-item:hover { background: rgba(0,0,0,0.035); color: var(--ink); }
.dr-tree-item.is-active {
  background: #fff;
  border-left-color: var(--blue);
  color: var(--ink);
  font-weight: 500;
}

.dr-tree-chevron { flex-shrink: 0; color: var(--ink-faint); transition: transform 0.16s var(--ease); }
.dr-tree-chevron.is-open { transform: rotate(90deg); }
.dr-tree-spacer { width: 13px; flex-shrink: 0; }
.dr-tree-glyph { flex-shrink: 0; color: var(--ink-faint); }
.dr-tree-item.is-active .dr-tree-glyph { color: var(--blue); }
.dr-tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-tree-count {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.dr-scrim { display: none; }

/* ---------- main ---------- */

.dr-main-wrap { display: flex; flex-direction: column; min-height: 0; min-width: 0; }

.dr-crumbs {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 20px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
  font-family: var(--mono);
  font-size: 0.70rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow-x: auto;
  white-space: nowrap;
}
.dr-crumb { color: var(--ink-faint); text-decoration: none; }
.dr-crumb:hover { color: var(--blue); }
.dr-crumb.is-current { color: var(--ink); }
.dr-crumb-sep { color: var(--rule); }

.dr-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg);
}

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

.dr-page { --dr-page-pad: 48px; }

.dr-cover {
  position: relative;
  height: 230px;
  overflow: hidden;
  background: var(--bg-dark);
}
.dr-cover-img { width: 100%; height: 100%; object-fit: cover; }
.dr-cover-scrim {
  position: absolute;
  inset: 0;
  background:
    var(--dots-dark),
    linear-gradient(to bottom, rgba(11,20,34,0.25), rgba(11,20,34,0.72));
  background-size: var(--dots-size), auto;
}

.dr-page-head {
  padding: 44px var(--dr-page-pad) 26px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
}
.dr-page-head.has-cover { margin-top: -68px; position: relative; background: transparent; border-bottom: none; }
.dr-page-head.has-cover .dr-page-title,
.dr-page-head.has-cover .dr-page-sub { color: #fff; }
.dr-page-head.has-cover .dr-page-eyebrow { color: var(--blue-light); }

.dr-page-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}
.dr-page-title {
  font-size: 2.2rem;
  font-weight: 200;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}
.dr-page-title strong { font-weight: 800; }
.dr-page-sub {
  margin-top: 10px;
  font-size: 0.98rem;
  font-weight: 300;
  color: var(--ink-mid);
  max-width: 60ch;
}

.dr-page-body {
  padding: 34px var(--dr-page-pad) 96px;
  max-width: 900px;
}

/* ---------- file pane ---------- */

.dr-file-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
}
.dr-file-title {
  font-size: 1.28rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.dr-file-sub { margin-top: 5px; font-size: 0.85rem; color: var(--ink-mid); }

.dr-file-stage { padding: 0; }

/* ---------- pdf ---------- */

.dr-pdf-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  background: rgba(249,249,247,0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.dr-pdf-status {
  font-family: var(--mono);
  font-size: 0.70rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex: 1;
}
.dr-pdf-dl { font-size: 0.76rem; padding: 5px 10px; }

/* The PDF owns its scrolling (see filepane's is-pdf note): the pane stops
   scrolling, the toolbar is pinned, and .dr-pdf-scroll becomes the
   viewport whose height fit-to-page measures against. */
.dr-main.is-pdf { overflow: hidden; display: flex; flex-direction: column; }
.dr-main.is-pdf .dr-file-head { flex-shrink: 0; }
.dr-main.is-pdf .dr-file-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dr-main.is-pdf .dr-pdf-toolbar { position: static; flex-shrink: 0; }
.dr-main.is-pdf .dr-pdf-scroll { flex: 1; min-height: 0; overflow: auto; }

.dr-pdf-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 12px;
  border-right: 1px solid var(--rule);
}
.dr-pdf-group:last-of-type { border-right: none; }
.dr-pdf-spacer { flex: 1; }

.dr-pdf-pageno {
  width: 3.4em;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 4px 2px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
}
.dr-pdf-pageno:focus { outline: none; border-color: var(--blue); }
.dr-pdf-of,
.dr-pdf-pct {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  white-space: nowrap;
}
.dr-pdf-pct { min-width: 4em; text-align: center; }

.dr-pdf-fit {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  color: var(--ink-faint);
  cursor: pointer;
}
.dr-pdf-fit:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
.dr-pdf-fit.is-active {
  color: var(--blue);
  border-color: rgba(21,80,143,0.35);
  background: rgba(21,80,143,0.07);
}

.dr-pdf-scroll {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* `safe` matters once a page is zoomed wider than the scroller: plain
     centring overflows equally in both directions and the left edge
     becomes unreachable, because scrollLeft cannot go negative. Browsers
     that do not parse `safe center` keep the declaration above it. */
  align-items: center;
  align-items: safe center;
}
.dr-pdf-page {
  position: relative;
  width: 100%;
  max-width: 980px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dr-pdf-canvas { display: block; width: 100%; height: auto; }
.dr-pdf-num {
  position: absolute;
  bottom: -17px; right: 2px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
}
.dr-pdf-err { padding: 40px; text-align: center; color: var(--ink-faint); font-size: 0.84rem; }

/* ---------- media ---------- */

.dr-media-frame {
  position: relative;
  padding: 24px;
  display: flex;
  justify-content: center;
}
.dr-media-loading { padding: 60px; color: var(--ink-faint); font-size: 0.85rem; }

.dr-image-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: #fff;
}

.dr-video { width: 100%; max-width: 1100px; background: #000; display: block; }

/* The video mark is a DOM overlay and is weaker than the canvas
   approach used for PDFs and images. pointer-events:none keeps it from
   eating clicks on the player controls. */
.dr-wm-overlay {
  position: absolute;
  inset: 24px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  overflow: hidden;
  mix-blend-mode: overlay;
}
.dr-wm-line {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: rgba(255,255,255,0.32);
  white-space: nowrap;
  text-align: center;
  transform: rotate(-18deg);
}

/* ---------- fallback ---------- */

.dr-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 70px 24px;
  text-align: center;
  color: var(--ink-faint);
}
.dr-fallback-title { font-size: 1.02rem; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.dr-fallback-meta {
  font-family: var(--mono);
  font-size: 0.70rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dr-fallback-note { font-size: 0.86rem; max-width: 42ch; line-height: 1.6; }

/* ---------- gate ---------- */

.dr-gate {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg-dark);
  background-image: var(--dots-dark);
  background-size: var(--dots-size);
}
.dr-gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-mid);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 40px 36px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.dr-gate-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(74,184,224,0.4);
  border-radius: 2px;
  color: var(--blue-light);
  margin-bottom: 22px;
}
.dr-gate-logo {
  display: block;
  width: 144px;
  height: auto;
  margin-bottom: 16px;
}
.dr-gate-eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 10px;
}
.dr-gate-title {
  font-size: 1.9rem;
  font-weight: 200;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.05;
}
.dr-gate-title strong { font-weight: 800; }
.dr-gate-sub {
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}
.dr-gate-form { margin-top: 26px; }
.dr-gate-input {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  padding: 11px 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--r);
  color: #fff;
}
.dr-gate-input::placeholder { color: rgba(255,255,255,0.3); }
.dr-gate-input:focus { border-color: var(--blue-light); outline: none; background: rgba(255,255,255,0.08); }
.dr-gate-submit { width: 100%; margin-top: 12px; padding: 11px; }
.dr-gate-error {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #ff9b9b;
  line-height: 1.5;
}
.dr-gate-note { margin-top: 12px; font-size: 0.8rem; color: rgba(255,255,255,0.5); }
.dr-gate-admin {
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.03);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.dr-gate-admin:hover,
.dr-gate-admin:focus-visible {
  color: var(--blue-light);
  border-color: rgba(74,184,224,0.45);
  background: rgba(74,184,224,0.08);
  outline: none;
}
.dr-gate-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  line-height: 1.7;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .dr-shell { grid-template-columns: 1fr; }

  .dr-burger { display: inline-flex; }

  .dr-tree {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.22s var(--ease);
    box-shadow: 4px 0 20px rgba(0,0,0,0.12);
  }
  .dr-shell.tree-open .dr-tree { transform: none; }

  .dr-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--ease);
  }
  .dr-shell.tree-open .dr-scrim { opacity: 1; pointer-events: auto; }

  .dr-page { --dr-page-pad: 20px; }
  .dr-cover { height: 150px; }
  .dr-page-head { padding-top: 28px; }
  .dr-page-head.has-cover { margin-top: -54px; }
  .dr-page-title { font-size: 1.6rem; }
  .dr-page-body { padding-bottom: 64px; }
  .dr-pdf-scroll { padding: 12px; }
  .dr-media-frame { padding: 12px; }
  .dr-viewer-id { max-width: 120px; }
}

/* Printing a composed page should still carry attribution. */
@media print {
  .dr-top, .dr-tree, .dr-crumbs, .dr-scrim { display: none !important; }
  .dr-body, .dr-app, .dr-main { height: auto; overflow: visible; }
  body::after {
    content: var(--dr-wm-print, '');
    position: fixed;
    bottom: 8mm; left: 0; right: 0;
    text-align: center;
    font-family: var(--mono);
    font-size: 8pt;
    color: #999;
  }
}
