/* Item reader (item #3465). The drawer behavior stays shared with the portal,
   while this sheet owns My Maestro's presentation boundary. The navigation
   snapshot below intentionally mirrors the portal reader as of the tabbed,
   single-canvas redesign; keeping it here lets My Maestro retain (and evolve)
   its own header treatment without silently drifting when portal CSS changes.
   Loaded after chat.css/mission.css so these rules use My Maestro's palette.
   The reader's actions ("Open in portal", "Pop out") ride the drawer's own
   ⋯ menu, so there is no host bar to style. */

/* -- synced reader navigation -------------------------------------------- */
/* Progress is quiet context; the underline tabs are the only row that reads
   as interactive. Exactly one tab owns the canvas at every width. */
.drawer-reader-nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 10px 0;
}
.drawer-progress[hidden] { display: none; }
.drawer-tabs {
  display: flex;
  gap: 20px;
  width: 100%;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-tab {
  flex: none;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 2px 8px;
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
}
.drawer-tab:hover { color: var(--text); background: transparent; }
.drawer-tab.on {
  color: var(--text);
  background: transparent;
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.drawer-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* The workflow rail is deliberately flatter than the tabs beneath it. */
.brief-stages { display: flex; align-items: flex-start; }
.brief-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  min-width: 0;
}
.brief-stage-bar { width: 100%; height: 3px; background: var(--panel-2); }
.brief-stage:first-child .brief-stage-bar { border-radius: 2px 0 0 2px; }
.brief-stage:last-child .brief-stage-bar { border-radius: 0 2px 2px 0; }
.brief-stage.done .brief-stage-bar {
  background: color-mix(in srgb, var(--ok) 72%, var(--panel-2));
}
.brief-stage-lab {
  max-width: 100%;
  overflow: hidden;
  padding: 0 3px;
  color: var(--text-dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brief-stage.current .brief-stage-bar {
  height: 4px;
  margin-top: -.5px;
  border-radius: 2px;
}
.brief-stage.current .brief-stage-lab { font-size: 10.5px; font-weight: 600; }
.brief-stage.current.ch-accent .brief-stage-bar { background: var(--accent); }
.brief-stage.current.ch-accent .brief-stage-lab { color: var(--accent-ink); }
.brief-stage.current.ch-warn .brief-stage-bar { background: var(--warn); }
.brief-stage.current.ch-warn .brief-stage-lab { color: var(--warn); }
.brief-stage.current.ch-review .brief-stage-bar { background: var(--review); }
.brief-stage.current.ch-review .brief-stage-lab { color: var(--review); }
.brief-stage.current.ch-ok .brief-stage-bar { background: var(--ok); }
.brief-stage.current.ch-ok .brief-stage-lab { color: var(--ok); }

/* Expanded means more room, not a different information architecture. */
.drawer-col { display: contents; }
.drawer.expanded .drawer-body { display: block; overflow: hidden; padding: 0; }
.drawer.expanded .drawer-col { display: block; overflow-y: auto; padding: 18px 22px; }
.drawer.expanded .drawer-primary {
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.drawer.expanded .drawer-secondary,
.drawer .drawer-secondary { display: none; }
.drawer .drawer-primary { display: block; min-width: 0; }

/* The id card (wp-drawer.css .drawer-idcard) is a panel-toned box in the
   portal; here the header sits flat on the drawer — no fill, no border, no
   inset — and the head keeps only the drawer's own padding. */
.drawer .drawer-idcard { background: none; border: 0; border-radius: 0; padding: 0; }

/* Under the desktop shell the 38px titlebar (chat.css #mm-top) is the
   window's drag surface: the reader layer, its veil and the side drawer
   start below it so the window still drags with a drawer open. The
   expanded dialog is centered by its own transform and needs no offset. */
:root[data-shell="my-maestro"] .drawer-layer,
:root[data-shell="my-maestro"] .drawer-veil,
:root[data-shell="my-maestro"] .drawer:not(.expanded) { top: 38px; }

@media (max-width: 720px) {
  .drawer .drawer-tabs { gap: 16px; }
}

@media (max-width: 480px) {
  .drawer .drawer-tabs { gap: 12px; scrollbar-width: none; }
  .drawer .drawer-tabs::-webkit-scrollbar { display: none; }
  .drawer .drawer-tab { font-size: 12px; }
}
