/* DOCS-HUB-1 Documents screen. Classic look first (plain cards on the app's own tokens); the Hologram
   look adds the glass, glow and gold arcs under :root[data-theme-style="holo"]. Black, gold and silver
   only; ring arcs are clean (no ticks). Layout: head, hero, then tree | list | preview. When the screen box is under 1040 px
   the preview is a side sheet; under 760 px the tree turns into a chip row and the list loses columns. */
.dhb{--dh-gold:var(--gold2,#d9b85f);--dh-silver:#c9ced6;--dh-warn:var(--warn,#e0ac55);--dh-good:var(--good,#63c08e)}
.dhb-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.dhb-crumb{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.dhb-h{margin:2px 0 0}
.dhb-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.dhb-q{min-width:200px;width:auto;margin:0;padding:6px 10px;border-radius:16px}
.dhb .btn.sm{width:auto;margin:0}
.dhb-up{cursor:pointer;display:inline-flex;align-items:center}
.dhb-pri{background:var(--gold);color:#1a1406;border-color:transparent;font-weight:600}
.dhb-hero{display:grid;grid-template-columns:minmax(150px,1fr) auto minmax(220px,1.3fr);gap:14px;align-items:center;padding:10px 14px;margin-bottom:10px}
.dhb-big{font-size:28px;font-weight:300;line-height:1}
.dhb-eyebrow{font-size:10px;letter-spacing:.2em;text-transform:uppercase;color:var(--gold2,#d9b85f);margin-bottom:2px}
.dhb-stamp{font-size:10px;letter-spacing:.06em;color:var(--dim);margin-top:4px;font-variant-numeric:tabular-nums}
.dhb-rings{display:flex;gap:14px}
.dhb-ring{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;color:var(--muted);width:84px;text-align:center}
.dhb-ring svg{width:68px;height:68px}
.dhb-ring-bg{fill:none;stroke:var(--line2);stroke-width:5}
.dhb-arc{fill:none;stroke-width:5;stroke-linecap:round}
.dhb-arc.gold{stroke:var(--dh-gold)}.dhb-arc.warn{stroke:var(--dh-warn)}.dhb-arc.silver{stroke:var(--dh-silver)}
.dhb-dot{fill:#fff}
.dhb-ring-v{fill:var(--ink);font-size:15px;text-anchor:middle}
.dhb-drop{border:1px dashed var(--line2);border-radius:8px;padding:10px 12px;text-align:center;font-size:13px}
.dhb-drop.on{border-color:var(--gold);background:rgba(196,155,62,.08)}
.dhb-upmsg{font-size:12px;margin-top:4px}
.dhb-lib{display:grid;grid-template-columns:190px minmax(0,1fr);gap:10px;align-items:start}
/* Three panes only when the screen box is wide enough (docs_hub.js sets .dhb-wide from the box width, so
   the app's sidebar or a narrow main column never squeezes the list); otherwise the preview is a side sheet. */
.dhb.dhb-wide .dhb-lib{grid-template-columns:190px minmax(0,1fr) 280px}
.dhb:not(.dhb-wide) .dhb-pv{display:none;position:fixed;top:0;right:0;bottom:0;width:min(360px,92vw);z-index:60;overflow:auto;border-radius:0;background:var(--panel);box-shadow:-10px 0 30px rgba(0,0,0,.5)}
.dhb:not(.dhb-wide) .dhb-pv.open{display:block}
.dhb:not(.dhb-wide) .dhb-pv-x{display:block}
.dhb:not(.dhb-wide) .dhb-scrim.open{display:block;position:fixed;inset:0;z-index:59;background:rgba(0,0,0,.45)}
.dhb-tree{display:flex;flex-direction:column;gap:1px;max-height:72vh;overflow:auto;position:sticky;top:8px}
.dhb-node{display:flex;justify-content:space-between;gap:6px;align-items:center;background:transparent;border:0;border-left:2px solid transparent;
  color:var(--ink);text-align:left;padding:5px 8px;font:inherit;font-size:13px;cursor:pointer;border-radius:4px;width:100%;margin:0}
.dhb-node:hover{background:rgba(255,255,255,.04)}
.dhb-node.on{border-left-color:var(--gold);background:rgba(196,155,62,.10)}
.dhb-node.d1{padding-left:18px}.dhb-node.d2{padding-left:28px;font-size:12px}.dhb-node.d3{padding-left:38px;font-size:12px}
.dhb-nolink{cursor:default;color:var(--muted)}
.dhb-fold{width:12px;flex:0 0 12px;color:var(--muted);font-size:10px}
.dhb-node .dhb-nl{flex:1}
.dhb-nl{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.dhb-nc{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.dhb-list{min-width:0;padding:8px 10px}
.dhb-chips{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:6px;padding-bottom:2px}
.dhb-chip{flex:0 0 auto}
.dhb-chip{background:transparent;border:1px solid var(--line2);color:var(--muted);border-radius:14px;padding:2px 10px;font:inherit;font-size:12px;cursor:pointer;width:auto;margin:0}
.dhb-chip.on{border-color:var(--gold);color:var(--ink);background:rgba(196,155,62,.12)}
.dhb-chip span{opacity:.7;margin-left:3px}
.dhb-export{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin:0 0 6px}
.dhb-pick{width:16px;height:16px;margin:0;accent-color:var(--gold)}
.dhb #dhbGrid td:first-child:has(.dhb-pick){width:22px}
.dhb-empty,.dhb-more{padding:10px 4px;font-size:13px}
.dhb .dg-row{cursor:pointer}
.dhb .dg-row.dhb-sel td:first-child{box-shadow:inset 3px 0 0 var(--gold)}
.dhb-name{display:inline-block;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
.dhb-under{display:inline-block;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
.dhb-gname{max-width:220px}
.dhb-tchip{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;background:var(--dh-silver);vertical-align:middle}
.dhb-tchip.m{background:var(--dh-gold)}.dhb-tchip.j{background:var(--dh-good)}
.dhb-tchip-l{display:inline-block;font-size:11px;border:1px solid var(--line2);border-radius:10px;padding:1px 8px;color:var(--muted)}
.dhb-tchip-l.m{border-color:var(--dh-gold);color:var(--dh-gold)}
.dhb-pill{display:inline-block;font-size:11px;border-radius:10px;padding:1px 8px;border:1px solid}
.dhb-pill.filed{color:var(--dh-good);border-color:var(--dh-good)}
.dhb-pill.needs{color:var(--dh-warn);border-color:var(--dh-warn)}
.dhb-pill.read{color:var(--dh-silver);border-color:var(--line2)}
.dhb-pv{position:sticky;top:8px;padding:10px 12px;min-height:200px}
.dhb-pv-x{display:none;position:absolute;right:6px;top:4px;background:transparent;border:0;color:var(--muted);font-size:20px;cursor:pointer;width:auto;margin:0}
.dhb-pv-empty{padding:30px 6px;text-align:center;font-size:13px}
.dhb-thumb{height:150px;border:1px solid var(--line);border-radius:6px;display:flex;align-items:center;justify-content:center;overflow:hidden;margin-bottom:8px;background:var(--panel2)}
.dhb-thumb img{width:100%;height:100%;object-fit:cover}
.dhb-sub{font-size:11px;margin-top:1px;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dhb .dhb-ghost{background:transparent;color:var(--ink);border:1px solid var(--line2)}
.dhb .dhb-ghost:hover{border-color:var(--gold)}
.dhb-scrim{display:none}
.dhb-thumb span{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.1em}
.dhb-pv-name{font-weight:600;word-break:break-word;margin-bottom:4px}
.dhb-pv-chips{display:flex;gap:4px;flex-wrap:wrap;margin-bottom:6px}
.dhb-filed{font-size:13px;margin:4px 0}.dhb-filed.needs b{color:var(--dh-warn)}
.dhb-sure{color:var(--dh-gold);white-space:nowrap}
.dhb.dhb-narrow .dhb-under{max-width:130px}
.dhb.dhb-narrow .dhb-gname{max-width:180px}
.dhb #dhbGrid td.r{font-family:var(--mono,"JetBrains Mono",ui-monospace,Menlo,monospace);font-size:12px}
.dhb-hero-t .muted{max-width:36ch}
.dhb-doc{display:flex;flex-direction:column;align-items:center;gap:3px;width:64px;margin-bottom:8px}
.dhb-doc svg{width:40px;height:50px}
.dhb-doc svg path{fill:none;stroke:var(--dh-silver);stroke-width:1.5;stroke-linejoin:round}
.dhb-doc.m svg path{stroke:var(--dh-gold)}.dhb-doc.j svg path{stroke:var(--dh-good)}
.dhb-doc span{font-family:var(--mono,"JetBrains Mono",ui-monospace,Menlo,monospace);font-size:10px;letter-spacing:.06em;color:var(--muted);text-transform:uppercase;text-align:center}
.dhb-reason,.dhb-note{font-size:12px}
.dhb-fields{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px;margin:8px 0}
.dhb-fields dt{color:var(--muted)}.dhb-fields dd{margin:0;word-break:break-word}
.dhb-acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px;align-items:center}
.dhb-undo{font-size:12px;margin-top:6px;padding:6px 8px;border:1px solid var(--line2);border-radius:6px}
.dhb-pk-h{font-weight:600;margin:6px 0}
.dhb-pk-q{width:100%;margin:0 0 6px;padding:6px 10px}
.dhb-pk ul{list-style:none;margin:0 0 8px;padding:0;max-height:320px;overflow:auto}
.dhb-pk li button{display:block;width:100%;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line);color:var(--ink);padding:6px 4px;font:inherit;font-size:13px;cursor:pointer;margin:0}
.dhb-pk li button:hover{background:rgba(196,155,62,.08)}
.dhb-batch{margin-bottom:10px}.dhb-batch ul{list-style:none;padding:0;margin:6px 0;max-height:260px;overflow:auto}
.dhb-batch li{display:flex;justify-content:space-between;gap:8px;padding:3px 0;border-bottom:1px solid var(--line);font-size:13px}
/* This screen uses the wide wrap on a computer, like the sidebar layout does (UI review fix 4). */
@media (min-width:1024px){#view.wrap:has(> #dhb),main:has(#dhb) .backbar.wrap{max-width:1560px;padding:0 28px}}
/* field (crew / lead) phone screen */
.dhb-field{max-width:520px}
.dhb-cam{display:block;text-align:center;padding:14px;font-size:16px;margin:10px 0;border-radius:10px;cursor:pointer}
.dhb-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:10px 0}
.dhb-tile{background:var(--panel);border:1px solid var(--line2);border-radius:10px;padding:12px 6px;color:var(--ink);font:inherit;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:2px;margin:0;width:auto}
.dhb-tile b{font-size:22px;font-weight:400}.dhb-tile span{font-size:13px;color:var(--muted)}
.dhb-tile.on{border-color:var(--gold);box-shadow:inset 0 0 0 1px var(--gold)}
.dhb-field .dhb-q{width:100%;margin:6px 0}
.dhb-flist{list-style:none;padding:0;margin:8px 0}
.dhb-flist li a{display:flex;flex-direction:column;padding:10px 4px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none;font-size:15px}
.dhb-flist li a .muted{font-size:12px}
@media (max-width:760px){
  .dhb-hero{grid-template-columns:1fr;gap:8px}
  .dhb-hero .dhb-hero-t{display:grid;grid-template-columns:auto 1fr;column-gap:10px;align-items:center}
  .dhb-hero .dhb-eyebrow,.dhb-hero .dhb-stamp{grid-column:1 / -1}
  .dhb-rings{justify-content:space-around}
  .dhb-drop{display:none}
  .dhb-lib{grid-template-columns:1fr}
  .dhb-tree{flex-direction:row;overflow-x:auto;position:static;max-height:none;gap:4px;padding-bottom:2px}
  .dhb-node,.dhb-node.d1,.dhb-node.d2,.dhb-node.d3{width:auto;flex:0 0 auto;padding:4px 10px;border:1px solid var(--line2);border-radius:14px;font-size:12px}
  .dhb-node.on{border-color:var(--gold)}
  .dhb-nolink{display:none}
  .dhb-q{min-width:0;flex:1}
  .dhb-tools{width:100%}
  .dhb-name{max-width:170px}

  .dhb-tools .btn,.dhb-tools .dhb-q{min-height:44px}
  .dhb-node,.dhb-node.d1,.dhb-node.d2,.dhb-node.d3{min-height:40px}
  .dhb-chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}
  .dhb-chip{min-height:36px;padding:2px 12px}
  .dhb .dg-row td{height:auto;padding-top:7px;padding-bottom:7px}
  /* the preview is a bottom sheet over a scrim, actions pinned at the bottom (UI review fix 5) */
  .dhb:not(.dhb-wide) .dhb-pv{top:auto;left:0;right:0;bottom:0;width:100vw;max-height:82vh;border-radius:14px 14px 0 0;
    padding:14px 16px 0;box-shadow:0 -10px 30px rgba(0,0,0,.55)}
  .dhb .dhb-pv .dhb-acts{position:sticky;bottom:0;background:var(--panel);padding:10px 0 calc(12px + env(safe-area-inset-bottom,0px));margin-top:10px;border-top:1px solid var(--line)}
  .dhb .dhb-pv .dhb-acts .btn{min-height:44px;flex:1 1 auto;justify-content:center}
  .dhb-pv-x{min-width:44px;min-height:44px}
  body:has(.dhb-scrim.open) .bottomnav{visibility:hidden}
  .dhb-tile{min-height:72px}
  .dhb-flist li a{min-height:48px}
}
/* Hologram look */
:root[data-theme-style="holo"] .dhb .card,:root[data-theme-style="holo"] .dhb-hero{background:linear-gradient(180deg,rgba(201,206,214,.07),rgba(14,15,17,.6));border-color:rgba(255,255,255,.08);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
:root[data-theme-style="holo"] .dhb-arc.gold{filter:drop-shadow(0 0 4px rgba(224,189,106,.55))}
:root[data-theme-style="holo"] .dhb-dot{filter:drop-shadow(0 0 4px rgba(224,189,106,.8))}
:root[data-theme-style="holo"] .dhb-ring-bg{stroke:rgba(255,255,255,.06)}
:root[data-theme-style="holo"] .dhb-pri{background:linear-gradient(90deg,rgba(224,189,106,.92),rgba(241,215,154,.92))}
:root[data-theme-style="holo"] .dhb-node.on{background:rgba(224,189,106,.10)}
@media (prefers-reduced-motion:reduce){.dhb *{transition:none!important;animation:none!important}}
