/* ─── File detail panel ───
   Was previously a 820px right-side overlay drawer; now occupies the entire
   main content area (right of the sidebar) as a focused full-area view. The
   underlying file list / tree stays mounted in the DOM behind the panel — we
   simply hide it visually with z-index and a solid panel background. */
.of-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  left: var(--lc-sidebar-width);
  z-index: 100;
  display: none;
}
.of-drawer.is-open { display: block; }
/* Sidebar collapsed → main area shifts to 52px; mirror that here. */
body:has(.df-sidebar.is-collapsed) .of-drawer { left: 52px; }
/* App shell full-screen mode hides sidebar entirely. */
.df-app--fullscreen .of-drawer { left: 0; }
/* No backdrop — the panel fills the area opaque. */
.of-drawer__backdrop { display: none; }
.of-drawer__panel {
  /* Match modal pattern: pure-white surfaces inside, cool gray elevations. */
  --lc-bg-base: #ffffff;
  --lc-bg-surface: #ffffff;
  --lc-bg-elevated: #f5f5f5;
  --lc-bg-hover: #efefef;
  position: absolute; inset: 0;
  background: #ffffff;
  display: flex; flex-direction: column;
  opacity: 0; transition: opacity 160ms ease;
}
.of-drawer.is-open .of-drawer__panel { opacity: 1; }
.of-drawer__header {
  display: flex; align-items: center; gap: 12px;
  height: var(--lc-topbar-height);
  padding: 0 20px; border-bottom: 1px solid var(--lc-border);
  flex-shrink: 0;
}
.of-drawer__icon { font-size: 1.125rem; color: var(--lc-text-secondary); flex-shrink: 0; }
.of-drawer__crumb {
  display: flex; align-items: baseline; gap: 8px;
  flex: 1; min-width: 0;
}
.of-drawer__context {
  font-size: 0.8125rem; color: var(--lc-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 40%; flex-shrink: 0;
}
.of-drawer__crumb-sep {
  color: var(--lc-text-muted); font-size: 0.8125rem; flex-shrink: 0;
}
.of-drawer__title {
  flex: 1; margin: 0; font-size: 0.9375rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--lc-text-primary); min-width: 0;
}
.of-drawer__close {
  background: none; border: 0; cursor: pointer;
  color: var(--lc-text-muted); font-size: 1rem; padding: 4px 8px;
}
.of-drawer__close:hover { color: var(--lc-text-primary); }
.of-drawer__search {
  position: relative;
  flex: 0 0 220px; min-width: 0;
  margin-right: 4px;
}
.of-drawer__search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--lc-text-muted); font-size: 0.75rem; pointer-events: none;
}
.of-drawer__search-input {
  width: 100%; box-sizing: border-box;
  background: var(--lc-bg-surface);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius, 6px);
  padding: 5px 28px 5px 26px;
  font-size: 0.8125rem; font-family: inherit;
  color: var(--lc-text-primary); outline: none;
  transition: border-color var(--lc-duration-fast, 0.15s);
}
.of-drawer__search-input:focus { border-color: var(--lc-accent); }
.of-drawer__search-input::placeholder { color: var(--lc-text-muted); }
.of-drawer__search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 200;
  background: var(--lc-bg-base);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius-md, 6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  max-height: 320px; overflow-y: auto;
  padding: 4px 0;
}
.of-drawer__search-item {
  padding: 6px 12px;
  font-size: 0.8125rem; color: var(--lc-text-primary);
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.of-drawer__search-item:hover,
.of-drawer__search-item.is-active { background: var(--lc-bg-hover); }
.of-drawer__search-empty {
  padding: 8px 12px; font-size: 0.8125rem;
  color: var(--lc-text-muted); font-style: italic;
}
.of-drawer__nav {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0; margin-right: 4px;
}
.of-drawer__nav-btn {
  background: none; border: 0; cursor: pointer;
  color: var(--lc-text-secondary); font-size: 0.875rem;
  padding: 4px 8px; border-radius: var(--lc-radius-sm, 4px);
}
.of-drawer__nav-btn:hover { background: var(--lc-bg-hover); color: var(--lc-text-primary); }
.of-drawer__nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.of-drawer__nav-btn:disabled:hover { background: transparent; color: var(--lc-text-secondary); }
.of-drawer__nav-pos {
  font-size: 0.75rem; color: var(--lc-text-secondary);
  font-variant-numeric: tabular-nums; min-width: 50px; text-align: center;
}
.of-drawer__body { flex: 1; overflow-y: auto; padding: 20px; }
.of-drawer__loading { color: var(--lc-text-secondary); font-size: 0.875rem; }
.of-section { margin-bottom: 22px; border-radius: 6px; transition: background-color 0.6s ease; }
.of-section--flash { background-color: var(--lc-bg-elevated); }
.of-section__title {
  font-size: 0.8125rem; font-weight: 700;
  color: var(--lc-text-primary);
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--lc-border-light);
}
.of-list { display: flex; flex-direction: column; gap: 8px; }
.of-list__item { display: flex; gap: 6px; align-items: flex-start; }
.of-list__index { flex: 0 0 auto; font-size: 0.6875rem; color: var(--lc-text-muted); font-weight: 600; padding-top: 2px; }
.of-list__body { flex: 1; min-width: 0; }
.of-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin-top: 2px; border: 1px solid var(--lc-border-light); }
.of-table th, .of-table td { padding: 6px 10px; text-align: left; border: 1px solid var(--lc-border-light); vertical-align: top; overflow-wrap: anywhere; color: var(--lc-text-primary); }
.of-table th { font-weight: 600; color: var(--lc-text-tertiary); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--lc-bg-elevated); white-space: nowrap; }
/* Multi-column variant (non-kv): keep each cell on one line so person names
   like "William H. Jaco, III" don't wrap. The kv variant keeps wrapping
   because its value column legitimately holds long prose. */
.of-table:not(.of-table--kv) td { white-space: nowrap; }
.of-section { overflow-x: auto; }
/* Two-column key/value variant (no thead, left column is the field name).
   width:1% + nowrap shrinks the field column to its content; min-width keeps
   a sensible floor so single-word labels still feel aligned. */
.of-table--kv th { width: 1%; min-width: 130px; font-size: 0.75rem; text-transform: none; letter-spacing: 0; font-weight: 500; background: var(--lc-bg-elevated); }
.of-table--sub { font-size: 0.75rem; }
.of-table--sub th { min-width: 110px; }
.of-chip {
  display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0;
  border-radius: 10px; background: var(--lc-bg-elevated);
  font-size: 0.75rem; color: var(--lc-text-secondary);
}
.of-chip--primary::before { content: '\2605 '; }
.of-usage-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--lc-border-light); font-size: 0.8125rem;
}
.of-usage-item:last-child { border-bottom: 0; }
.of-usage-item__name { flex: 1; color: var(--lc-text-primary); cursor: pointer; }
.of-usage-item__name:hover { text-decoration: underline; }
.of-usage-item__time { color: var(--lc-text-tertiary); font-size: 0.75rem; }
.of-empty { color: var(--lc-text-secondary); font-style: italic; font-size: 0.8125rem; }
.of-error { color: var(--lc-red); font-size: 0.8125rem; padding: 12px; }
.of-uploader { display: flex; align-items: center; gap: 8px; }
.of-uploader__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 600; color: #fff;
  background: var(--lc-accent);
}
.of-uploader__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
