/* door-host.css — the shell's modes as panes of the door (LMX-430 slices 3–4).
 *
 * The shell's chrome the Path mode leans on, lifted into the door's panes
 * (#studypane for Study, #visitpane for Visit): the tokens path.css and
 * trove.css read that the door never defined, the two columns side by side
 * (a fixed split; the shell's resizer is not carried), the Trove drawer as a
 * bottom sheet, and the phone layout. Values are app.html's (threshold dark,
 * then its parchment block) so the panes read as they do on the shell.
 * path.css itself is loaded beside this file, untouched. */

/* --- tokens the mode reads and the door lacks (app.html :root) --- */
:root{
  --panel:#141618; --panel-soft:rgba(255,255,255,0.03); --grey:#aeb3b6; --tan:#9aa0a3;
  --crimson-deep:#9e1f2a; --crimson-wash:rgba(204,47,61,0.28);
  --forest:#1c5a41; --forest-bright:#3f8f6e; --forest-deep:#12382a;
  --trove:var(--forest-bright); --trove-deep:var(--forest); --trove-soft:rgba(28,90,65,0.15);
  --font-body:var(--font-display);
  --shadow-pop:0 6px 24px rgba(0,0,0,0.22); --shadow-sheet:0 -14px 50px rgba(0,0,0,0.5);
  --scrim:rgba(8,9,10,0.62);
}
html[data-theme="parchment"]{
  --panel:#f7f3ea; --panel-soft:rgba(60,50,40,0.04); --grey:#4e463d; --tan:#857b6e;
  --trove:var(--forest); --trove-deep:var(--forest-deep);
  --shadow-pop:0 6px 20px rgba(60,50,40,0.18); --shadow-sheet:0 -12px 40px rgba(60,50,40,0.22);
  --scrim:rgba(60,50,40,0.42);
}
/* path.css aliases its text and surface tokens at :root (--text-body:var(--ink)
   and so on). A custom property resolves where it is DEFINED, and the door
   sets its parchment palette on <body>, not <html> (the shell sets it on
   <html>), so on parchment those aliases kept the dark values: pale text on
   a light ground, a dark composer. Restated on the same element the door
   themes, they re-resolve against the parchment palette. */
html[data-theme="parchment"] body{
  --surface-page:var(--bg); --surface-lift:var(--bg-lift);
  --text-heading:var(--bright); --text-body:var(--ink); --text-secondary:var(--warm);
  --text-muted:var(--muted); --text-meta:var(--tan); --text-faint:var(--faint);
  --accent:var(--crimson); --accent-hover:var(--crimson-bright); --accent-press:var(--crimson-bright);
  --link:var(--crimson-bright);
}

/* --- the panes: children of .main after the dialogue and the library, one
       shown by body.<kind>-open. The tab row (Ask | Read | Study | Visit)
       lives at the head of the dialogue column, so that column stays as a
       top row holding the tabs alone, and the open pane takes the rest of
       the height beneath it; the library closes. --- */
.modepane{min-width:0;min-height:0;display:none}
body.study-open #studypane,body.visit-open #visitpane{display:block}
body.mode-open .main{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
body.mode-open .thread-col > :not(.sidetabs){display:none !important}   /* #samples et al. are id-styled */
body.mode-open .libpane{display:none}
body.mode-open .libword{display:none}

/* --- the shell's skeleton (app.html main · #chat-col · #sources · drawer).
       One class + one id, deliberately: path.css's phone flip
       (:is(html.mode-study) :is(body,.modepane):not(.path-chat-open) > main #chat-col{display:none})
       must outrank these, as it outranks the shell's own. --- */
.modemain{display:flex;height:100%;overflow:hidden}
.modepane #chat-col{display:flex;flex-direction:column;flex:0 0 42%;min-width:0;min-height:0;background:var(--bg)}
.modepane #sources{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:0;
  background:var(--r-bg);color:var(--r-ink);border-left:1px solid var(--line)}
@media (max-width:820px){
  .modemain{flex-direction:column}
  .modepane #chat-col{width:100% !important;flex:1}
  .modepane #sources{border-left:none}
}
/* the mode toggles its rows with the hidden attribute (the shell has a
   page-wide rule; the door has none) */
.modepane [hidden],#trove [hidden]{display:none !important}
.mode-missing{padding:24px 20px;color:var(--muted);font-style:italic}

#scrim{position:fixed;inset:0;background:var(--scrim);opacity:0;pointer-events:none;transition:opacity .26s ease;z-index:40}
body.trove-open #scrim{opacity:1;pointer-events:auto}
#trove{position:fixed;inset:auto 0 0 0;max-width:680px;margin:0 auto;max-height:82dvh;background:var(--r-bg);color:var(--r-ink);
  border-top:1px solid var(--r-line);border-radius:8px 8px 0 0;box-shadow:var(--shadow-sheet);transform:translateY(101%);
  transition:transform .3s ease;z-index:41;display:flex;flex-direction:column}
body.trove-open #trove{transform:translateY(0)}
