/* Nabgol Workspace — Cursor-like side document (desktop) + sheet (mobile)
   Important: NEVER squeeze .chat-messages / .chat-input width when open.
   Panel is out-of-flow (fixed) and must keep in-flow width at 0. */

#splitPanel.nabgol-workspace-v2 {
  overscroll-behavior: contain;
  box-sizing: border-box;
  position: relative;
}

#splitPanel.nabgol-workspace-v2.nabgol-dragging {
  transition: none;
  touch-action: none;
  user-select: none;
}

.nabgol-workspace-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 1040;
  border: 0;
  padding: 0;
  margin: 0;
}

.nabgol-workspace-backdrop[hidden] {
  display: none !important;
}

.nabgol-workspace-title {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 16px;
  font-weight: 700;
  color: #ecfdf5;
  direction: rtl;
  text-align: right;
}

/* —— Cursor-like pipeline chrome —— */
.nabgol-pipeline {
  direction: rtl;
  text-align: right;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.35));
}

.nabgol-pipeline-kicker {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #6ee7b7;
  font-weight: 700;
  margin-bottom: 4px;
}

.nabgol-pipeline-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 4px;
}

.nabgol-pipeline-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.nabgol-process-chart {
  color: #e2e8f0;
  margin: 4px 0 12px;
  overflow: hidden;
}

.nabgol-process-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.nabgol-process-num,
.nabgol-process-label {
  fill: currentColor;
  font-family: inherit;
}

.nabgol-process-num {
  font-size: 11px;
  font-weight: 800;
}

.nabgol-process-label {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.92;
}

.nabgol-pipeline-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nabgol-pipeline-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  color: #cbd5e1;
  font-size: 13px;
}

.nabgol-pipeline-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  flex-shrink: 0;
}

.nabgol-pipeline-step.is-done {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #d1fae5;
}
.nabgol-pipeline-step.is-done .nabgol-pipeline-index {
  background: #059669;
  color: #fff;
}
.nabgol-pipeline-step.is-done .nabgol-pipeline-index::after {
  content: none;
}

.nabgol-pipeline-step.is-active {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.14);
  color: #e0f2fe;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15);
}
.nabgol-pipeline-step.is-active .nabgol-pipeline-index {
  background: #0284c7;
  color: #fff;
}

.nabgol-pipeline-step.is-pending {
  opacity: 0.72;
}

.nabgol-pipeline-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.5em;
  min-width: 0;
}

.nabgol-pipeline-status {
  opacity: 0.85;
  white-space: nowrap;
}

.nabgol-pipeline-doc {
  margin-top: 4px;
  padding-top: 4px;
}

.nabgol-pipeline-doc-head {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin: 0 0 10px;
  letter-spacing: 0.04em;
}

.nabgol-stage-card {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
}

.nabgol-stage-card.is-active {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(12, 74, 110, 0.22);
}

.nabgol-stage-card.is-done {
  border-color: rgba(74, 222, 128, 0.28);
}

.nabgol-stage-card-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
}

.nabgol-stage-card-body {
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
}

.nabgol-stage-card-body.is-empty {
  color: #64748b;
  font-style: italic;
}

/* —— Desktop: panel positioning owned by chat-desktop-shell.css —— */
body.desktop-chat #splitPanel.nabgol-workspace-v2 {
  overscroll-behavior: contain;
  box-sizing: border-box;
}

body.desktop-chat #splitPanel.nabgol-workspace-v2.open {
  width: var(--ops-map-width, 400px) !important;
  max-width: 72vw !important;
}

body.desktop-chat #splitPanel.nabgol-workspace-v2.nabgol-canvas-full.open,
body.desktop-chat.nabgol-workspace-full #splitPanel.nabgol-workspace-v2.open {
  width: 100% !important;
  max-width: none !important;
}

/* Stage column width/margins are owned by chat-desktop-shell.css */

body.desktop-chat #splitPanel.nabgol-workspace-v2 .split-header,
body.desktop-chat #splitPanel.nabgol-workspace-v2 .nabgol-workspace-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  direction: rtl;
  position: relative;
  z-index: 4;
}

body.desktop-chat #splitPanel.nabgol-workspace-v2 .nabgol-workspace-header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

body.desktop-chat #splitPanel.nabgol-workspace-v2 .nabgol-workspace-chrome-title,
body.desktop-chat #splitPanel.nabgol-workspace-v2 .split-header h4 {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
  text-align: right;
  direction: rtl;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.desktop-chat #splitPanel.nabgol-workspace-v2 .split-header > button,
body.desktop-chat #splitPanel.nabgol-workspace-v2 .nabgol-workspace-toolbar,
body.desktop-chat #splitPanel.nabgol-workspace-v2 .nabgol-chrome-close {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.nabgol-workspace-chrome-sub {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.3;
}

.nabgol-workspace-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Docked "ask the teacher" bar — normal document flow, sits just above the
   composer. Never position:fixed, never multi-line: a horizontal scroller
   caps the footprint so it can never push the composer's own height around. */
/* Desktop only (mobile uses #nabgolAskSheet). Row-wrap, not column: the action
   buttons claim a full line, then «کمکم کن» and «حالت والدین» — two short
   segmented controls that are set once and forgotten — share the next line
   instead of eating a stacked row each. Three stacked rows cost 141px of an
   800px window; sharing brings it back under 100 without hiding anything, and
   they still wrap to their own lines on a narrow window. */
/* 2026-09-04 — THEME. Every colour in this surface used to be a hardcoded dark
   value: a sky-cyan hairline, a teal wash, #94a3b8 labels, a near-black
   popover. In day mode that produced pale-cyan-on-white pills with a
   low-contrast slate label — the row the owner reported as unreadable — and even
   in night mode it was the only cyan object on a page whose accent is mint.
   Both problems have one cause and one fix: read the platform's own
   --nbgc-* tokens (declared for BOTH themes in chat-canvas.css, which every
   chat template loads) instead of re-deciding the palette here. No
   html[data-theme="light"] override block is needed for these rules, and none
   should be added — a second generation of rules for the same property is how
   this file would end up with a hybrid box neither theme describes. */
.nabgol-ask-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--nbgc-hairline, rgba(148, 168, 200, 0.16));
  background: var(--nbgc-surface, rgba(148, 168, 200, 0.07));
  color: var(--nbgc-ink, #e8eef6);
  flex-shrink: 0;
  box-sizing: border-box;
  direction: rtl;
}

.nabgol-ask-bar > .nabgol-ask-bar-row,
.nabgol-ask-bar > .nabgol-parent-mode-banner {
  flex: 1 1 100%;
  min-width: 0;
}

.nabgol-ask-bar > .nabgol-ask-prefs-row,
.nabgol-ask-bar > .nabgol-audience-row {
  flex: 0 1 auto;
  min-width: 0;
}

.nabgol-ask-bar[hidden] { display: none !important; }

body.nabgol-control-surface-open #nabgolAskBar {
  /* Structural XOR: studio footer owns the composer chrome while host is open */
  display: none !important;
}

.nabgol-ask-bar-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.nabgol-ask-bar-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--nbgc-hairline-strong, rgba(148, 168, 200, 0.26));
  background: var(--nbgc-surface-2, rgba(148, 168, 200, 0.11));
  color: var(--nbgc-ink, inherit);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
}

.nabgol-ask-bar-btn:hover,
.nabgol-ask-bar-btn:focus-visible {
  border-color: var(--nbgc-accent-edge, rgba(52, 211, 153, 0.28));
  background: var(--nbgc-accent-wash, rgba(52, 211, 153, 0.10));
  outline: none;
}

.nabgol-ask-bar-btn:focus-visible {
  outline: 2px solid var(--nbgc-accent, #34d399);
  outline-offset: 2px;
}

.nabgol-ask-bar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nabgol-ask-bar-more {
  position: relative;
  flex: 0 0 auto;
}

.nabgol-ask-bar-more-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px dashed var(--nbgc-hairline-strong, rgba(148, 168, 200, 0.26));
  background: transparent;
  color: var(--nbgc-ink-soft, inherit);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.nabgol-ask-bar-more-btn[aria-expanded="true"] {
  border-color: var(--nbgc-accent-edge, rgba(52, 211, 153, 0.28));
  border-style: solid;
  color: var(--nbgc-accent-ink, #6ee7b7);
}

/* An OPAQUE face, not a translucent one: this panel sits over the message
   canvas, and --nbgc-sheet-face is the platform's own «a sheet, not a wash»
   colour (#0f172a night / #ffffff day) — the same one the mobile bottom sheets
   use. rgba(15,23,42,.97) was invisible-adjacent white text on white in day
   mode for the 0.03 that showed through. */
.nabgol-ask-bar-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  max-width: 300px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--nbgc-hairline-strong, rgba(148, 168, 200, 0.26));
  background: var(--nbgc-sheet-face, #0f172a);
  color: var(--nbgc-ink, #e8eef6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.nabgol-ask-bar-popover[hidden] { display: none !important; }

/* Inside «بیشتر…» there is width for the label+hint stack the mobile sheet
   already gives every action, so an unfamiliar tool explains itself without a
   tooltip a touch screen never shows. Declared on the button itself rather
   than behind :has() — the messenger webviews this platform is opened from
   (Eitaa/Telegram/Bale) are not all new enough for :has(), and every popover
   row is built with the stack anyway. */
.nabgol-ask-bar-popover .nabgol-ask-bar-btn {
  width: 100%;
  text-align: right;
  border-radius: 10px;
  white-space: normal;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.nabgol-ask-bar-btn-label {
  font-weight: 600;
}

.nabgol-ask-bar-btn-hint {
  font-size: 0.76rem;
  color: var(--nbgc-ink-soft, #94a3b6);
  line-height: 1.35;
}

.nabgol-ask-prefs-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* --nbgc-ink-soft, not ink-faint: this is a real label a parent reads to
   understand the control next to it, and it must clear 4.5:1 in BOTH themes
   (7.1:1 night / 6.4:1 day). The old literal #94a3b8 measured 2.6:1 on the
   day-mode canvas — the row the owner reported as unreadable. */
.nabgol-ask-prefs-label {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--nbgc-ink-soft, #94a3b6);
  white-space: nowrap;
}

.nabgol-ask-pref-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--nbgc-hairline-strong, rgba(148, 168, 200, 0.26));
  background: transparent;
  color: var(--nbgc-ink, inherit);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.nabgol-ask-pref-btn:hover {
  border-color: var(--nbgc-accent-edge, rgba(52, 211, 153, 0.28));
}

.nabgol-ask-pref-btn:focus-visible {
  outline: 2px solid var(--nbgc-accent, #34d399);
  outline-offset: 2px;
}

/* The selected state is the platform's accent, quiet on purpose: these two
   rows are set once and forgotten, so «which one is on» has to be legible at a
   glance without shouting over the answer above it. */
.nabgol-ask-pref-btn.is-active {
  border-color: var(--nbgc-accent-edge, rgba(52, 211, 153, 0.28));
  background: var(--nbgc-accent-wash, rgba(52, 211, 153, 0.10));
  color: var(--nbgc-accent-ink, #6ee7b7);
  font-weight: 600;
}

/* A shipped-but-not-yet-wired option. It gets the SAME chrome as the live
   button next to it — same border, same ink — and says «به‌زودی» in a chip.
   The first pass made it dashed and grey; on the real page that read as a
   half-drawn, broken control rather than a working button that is honest about
   its state, which is the opposite of the intent. The chip carries the
   message; the button carries no visual apology. */
.nabgol-ask-pref-btn.is-soon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* MEASURED, not chosen. This badge is the one label in the bar that does not
   sit directly on the bar: it carries its own wash, so its background is the
   bar's surface PLUS that wash, and --nbgc-ink-soft (6.4:1 on plain white)
   came out at 4.42:1 on it in day mode — and 4.23:1 once parent mode tinted the
   strip amber. Both were caught by test_ask_bar_theme_gate.js, which measures
   the composited pair rather than the declared one. #4b5563 restores the margin
   (5.71 / 5.47) and still reads as quiet grey next to the option's own label.
   Night keeps ink-soft, which measures 5.80 there. Re-run that gate if either
   value is touched. */
:root { --nbgw-quiet-ink: #94a3b6; }
html[data-theme="light"] { --nbgw-quiet-ink: #4b5563; }

.nabgol-ask-pref-soon {
  font-size: 0.66rem;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--nbgc-surface-2, rgba(148, 168, 200, 0.11));
  color: var(--nbgw-quiet-ink);
  white-space: nowrap;
}

/* Mobile-only: composer button that opens #nabgolAskSheet. Scoped purely by
   the element's presence — desktop.php never has this id. A plain [hidden]
   attribute is not enough here: .composer-action-btn sets display:inline-flex
   as an author rule, which otherwise beats the UA [hidden] rule. */
#nabgolAskSheetBtn[hidden] { display: none !important; }

body.nabgol-control-surface-open #nabgolAskSheetBtn {
  /* Same structural XOR as the desktop bar. */
  display: none !important;
}

/* Mobile-only: the ask_prefs segmented row reused inside #nabgolAskSheet.
   The sheet has real width, so it wraps instead of scrolling horizontally,
   and reads as a section under the sheet title rather than a toolbar row. */
.nabgol-ask-prefs-row.nabgol-ask-sheet-prefs {
  flex-wrap: wrap;
  overflow-x: visible;
  padding: 4px 18px 12px;
  border-bottom: 1px solid var(--nbgc-hairline, rgba(255, 255, 255, 0.06));
}

/* Mobile-only: ask_bar action rows inside #nabgolAskSheet — reuses .sheet-item
   chrome (min-height, padding, touch target) from the existing sheet system;
   only the label+hint stack below is new. */
.nabgol-ask-sheet-item-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.nabgol-ask-sheet-item-label {
  font-weight: 600;
}

.nabgol-ask-sheet-item-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: normal;
}

.nabgol-ask-sheet-item[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Wave 4c section E: the audience axis is a separate role="group" row, never
   mixed into .nabgol-ask-prefs-row — same layout rules, own selector so the two
   can diverge later without fighting each other. Renamed from
   .nabgol-parent-mode-row on 2026-09-04, when it stopped being one toggle and
   became the three-way reader choice (دانش‌آموز · والدین · معلم). */
.nabgol-audience-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.nabgol-audience-row.nabgol-ask-sheet-prefs {
  flex-wrap: wrap;
  overflow-x: visible;
  padding: 4px 18px 8px;
}

/* The one-line legend for the three readers, in the sheet only — see
   buildAudienceHelpLine() for why the desktop bar does not get it. It closes
   the row's own bottom rule, so the row above drops its border. */
.nabgol-audience-help {
  margin: 0;
  padding: 0 18px 12px;
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--nbgc-ink-soft, #94a3b6);
  border-bottom: 1px solid var(--nbgc-hairline, rgba(255, 255, 255, 0.06));
}

/* Wave 4c section F: no separate persistent banner (that cost ~84px on a
   390px phone — docs/CONTROL_SURFACE_LOCK.md). Desktop tints #nabgolAskBar
   itself and shows the sentence + off-switch inline; mobile only tints the
   composer button + shows the sentence inside #nabgolAskSheet (never outside). */
/* THE «A NON-DEFAULT MODE IS ON» AMBER. This is the one colour here that is
   deliberately NOT the platform accent: mint means «this control is selected»
   everywhere else in the chat, and the whole job of this tint is to say «the
   answers you are about to read are not written for the student». It needs its
   own two values, because amber is the classic colour that survives a theme
   flip by turning into unreadable pale yellow on white — #fde68a measures
   1.4:1 on the day canvas. Kept as tokens in this file rather than literals at
   four call sites so the pair can never drift apart again. */
:root {
  --nbgw-warn-wash: rgba(217, 119, 6, 0.16);
  --nbgw-warn-edge: rgba(251, 191, 36, 0.35);
  --nbgw-warn-ink: #fde68a;          /* 11.4:1 on the night canvas */
  --nbgw-warn-mark: #fbbf24;
}

html[data-theme="light"] {
  --nbgw-warn-wash: rgba(217, 119, 6, 0.12);
  --nbgw-warn-edge: rgba(180, 83, 9, 0.40);
  --nbgw-warn-ink: #7c4408;          /*  6.9:1 on #ffffff, and still amber */
  --nbgw-warn-mark: #b45309;         /*  4.8:1 — the icon has to pass too */
}

.nabgol-ask-bar.nabgol-ask-bar-parent-mode {
  background: var(--nbgw-warn-wash);
  border-bottom-color: var(--nbgw-warn-edge);
}

.nabgol-parent-mode-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 2px 0;
  font-size: 0.8rem;
  color: var(--nbgw-warn-ink);
}

.nabgol-parent-mode-banner-text {
  flex: 1 1 auto;
}

/* In the sheet the banner is a sibling of rows padded 18px in from the edge;
   with only the shared `padding: 2px 0` it started at the sheet's very edge
   while every row under it was indented. */
#nabgolAskSheet .nabgol-parent-mode-banner {
  padding: 6px 18px 10px;
  line-height: 1.6;
}

.nabgol-parent-mode-off-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--nbgw-warn-edge);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.nabgol-parent-mode-off-btn:focus-visible {
  outline: 2px solid var(--nbgw-warn-mark);
  outline-offset: 2px;
}

/* The audience row inside a tinted bar: its selected pill would otherwise be
   mint-on-amber, two accent languages in one strip. */
.nabgol-ask-bar.nabgol-ask-bar-parent-mode .nabgol-audience-row .nabgol-ask-pref-btn.is-active {
  border-color: var(--nbgw-warn-edge);
  background: var(--nbgw-warn-wash);
  color: var(--nbgw-warn-ink);
}

#nabgolAskSheetBtn.is-parent-mode {
  color: var(--nbgw-warn-mark);
}

.nabgol-teacher-grade-panel {
  margin: 8px 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.16), rgba(15, 23, 42, 0.55));
  color: #e2e8f0;
  direction: rtl;
}
.nabgol-teacher-grade-panel[hidden] { display: none !important; }
.nabgol-tg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.nabgol-tg-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  opacity: 0.9;
}
.nabgol-tg-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  margin-bottom: 8px;
}
.nabgol-tg-bar > i {
  display: block;
  height: 100%;
  background: #38bdf8;
  width: 0;
  transition: width 0.35s ease;
}
.nabgol-tg-meta { font-size: 0.8rem; opacity: 0.9; margin-bottom: 10px; }
.nabgol-tg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.nabgol-tg-btn {
  appearance: none;
  border: 1px solid rgba(125, 211, 252, 0.45);
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  min-height: 36px;
}
.nabgol-tg-btn--soft {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.04);
}
.nabgol-tg-hint { font-size: 0.75rem; opacity: 0.8; margin: 0; line-height: 1.5; }
.nabgol-tg-summary {
  white-space: pre-wrap;
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 0.82rem;
  max-height: 240px;
  overflow: auto;
  margin-top: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.nabgol-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

/* Colour tokens, not literals (2026-08-30): this whole chrome family was built
   once against the dark theme only — #cbd5e1/#a7f3d0/#ecfdf5 etc. all read fine
   on the dark canvas this file was authored against, but chat-workspace.css has
   no body.mobile-chat/body.desktop-chat scoping, and light theme never got its
   own pass. --nbgc-* already carries both themes (chat-canvas.css) and is the
   same trio chat-header.css uses for this exact ghost-icon-button shape, so it
   is theme-correct with no extra selector needed. Found by
   test_controls_always_reachable.js's "workspace" state — "گزارش‌ها" and "⋯"
   both measured 1.48:1 on the now-white split-header. */
.nabgol-chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--nbgc-ink-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.nabgol-chrome-btn:hover:not(:disabled):not(.is-disabled) {
  background: var(--nbgc-surface-2);
  border-color: var(--nbgc-hairline-strong);
  color: var(--nbgc-ink-strong);
}

.nabgol-chrome-btn:focus-visible {
  outline: 2px solid var(--nbgc-accent-edge);
  outline-offset: 2px;
}

.nabgol-chrome-btn.is-active {
  background: var(--nbgc-accent-wash);
  border-color: var(--nbgc-accent-edge);
  color: var(--nbgc-accent-ink);
}

.nabgol-chrome-btn.is-disabled,
.nabgol-chrome-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.nabgol-chrome-btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.nabgol-chrome-btn.is-success {
  background: var(--nbgc-accent-wash);
  border-color: var(--nbgc-accent-edge);
  color: var(--nbgc-accent-ink);
}

.nabgol-chrome-ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.nabgol-chrome-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* PDF keeps the app's own green identity: same accent trio as .is-active above,
   theme-correct for free. Word has no --nbgc-* equivalent (it is the only blue
   in this file, by design, so it never reads as "another success state") — dark
   values below are unchanged; light gets its own hand-picked pair further down,
   same reason .nabgol-chrome-to-chat did in chat-mobile-flagship.css: a light
   fill + a light pastel ink both calibrated for a near-black backdrop go
   pastel-on-pastel the moment that backdrop turns white. */
.nabgol-chrome-export-pdf {
  padding-inline: 10px;
  background: var(--nbgc-accent-wash);
  border-color: var(--nbgc-accent-edge);
  color: var(--nbgc-accent-ink);
}

.nabgol-chrome-export-pdf:hover:not(:disabled):not(.is-disabled) {
  background: var(--nbgc-accent-edge);
  border-color: var(--nbgc-accent);
  box-shadow: 0 0 0 1px var(--nbgc-accent-edge);
}

.nabgol-chrome-export-docx {
  padding-inline: 10px;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.42);
  color: #bfdbfe;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.nabgol-chrome-export-docx:hover:not(:disabled):not(.is-disabled) {
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(147, 197, 253, 0.55);
  color: #eff6ff;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.22), 0 4px 14px rgba(37, 99, 235, 0.22);
}

.nabgol-chrome-export-docx.is-success {
  background: rgba(37, 99, 235, 0.34);
  color: #fff;
}

/* Light theme only — dark block above is untouched. #1d4ed8 on this wash
   measures 7.4:1 (this file's own contrast() maths, same formula as
   test_controls_always_reachable.js): a saturated, still-clearly-blue ink that
   does not collapse into the app's green identity the way reusing
   --nbgc-accent-ink would. */
html[data-theme="light"] .nabgol-chrome-export-docx {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.30);
  color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .nabgol-chrome-export-docx:hover:not(:disabled):not(.is-disabled) {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.42);
  color: #1e40af;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .nabgol-chrome-export-docx.is-success {
  background: rgba(37, 99, 235, 0.85);
  color: #fff;
}

/* Markdown is the third sibling and is styled as one: every box property here
   is inherited from .nabgol-chrome-btn exactly as PDF and Word inherit it, and
   only the hue is new. Violet because the other two are already spoken for —
   green is the app's own accent (and therefore reads as "success"), blue is
   Word's, and a third button sharing either would make the trio a guessing
   game at a glance.

   Both themes are written out for the same reason the Word block above is:
   a fill + ink pair calibrated on a near-black backdrop goes pastel-on-pastel
   the moment that backdrop turns white. Ink is measured, not picked by eye —
   #5b21b6 on this wash is 8.6:1, and #ddd6fe on the dark wash is 9.9:1
   (contrast() maths of test_controls_always_reachable.js). */
.nabgol-chrome-export-md {
  padding-inline: 10px;
  background: rgba(124, 58, 237, 0.16);
  border-color: rgba(167, 139, 250, 0.42);
  color: #ddd6fe;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.12);
}

.nabgol-chrome-export-md:hover:not(:disabled):not(.is-disabled) {
  background: rgba(124, 58, 237, 0.28);
  border-color: rgba(196, 181, 253, 0.55);
  color: #f5f3ff;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.22), 0 4px 14px rgba(124, 58, 237, 0.22);
}

.nabgol-chrome-export-md.is-success {
  background: rgba(124, 58, 237, 0.34);
  color: #fff;
}

html[data-theme="light"] .nabgol-chrome-export-md {
  background: rgba(124, 58, 237, 0.10);
  border-color: rgba(124, 58, 237, 0.30);
  color: #5b21b6;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.12);
}

html[data-theme="light"] .nabgol-chrome-export-md:hover:not(:disabled):not(.is-disabled) {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.42);
  color: #4c1d95;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.22);
}

html[data-theme="light"] .nabgol-chrome-export-md.is-success {
  background: rgba(124, 58, 237, 0.85);
  color: #fff;
}

/* «پیش‌نمایش MD» — full-screen sheet over the chat (2026-09-13, owner: the way
   back must always be in view, and closing must be effortless). Built by
   chat-bootstrap.js::mountMarkdownPreviewSheet. Header = back on the right
   (RTL start, where every messenger puts it), file actions on the left, the
   document's name under them. Every control is an icon + one short word and
   at least 44px. Night is the base, like the rest of this file; day is written
   out in full below. Ink is measured by test_markdown_preview_e2e.js. */
html.nabgol-mdp-locked,
html.nabgol-mdp-locked body {
  overflow: hidden !important;
}

.nabgol-mdp-sheet {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  direction: rtl;
  text-align: right;
  background: #0b1220;
  color: #f1f5f9;
  font-family: inherit;
  animation: nabgol-mdp-in 0.16s ease-out;
}

@keyframes nabgol-mdp-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nabgol-mdp-sheet { animation: none; }
}

.nabgol-mdp-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "back titles actions";
  align-items: center;
  gap: 10px 14px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.nabgol-mdp-back { grid-area: back; }
.nabgol-mdp-titles { grid-area: titles; min-width: 0; }
.nabgol-mdp-actions { grid-area: actions; display: flex; gap: 8px; justify-self: end; }

.nabgol-mdp-back,
.nabgol-mdp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.12);
  color: #f8fafc;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nabgol-mdp-back {
  padding-inline: 8px 14px;
  font-size: 15px;
}

.nabgol-mdp-back:hover,
.nabgol-mdp-btn:hover {
  background: rgba(148, 163, 184, 0.24);
}

.nabgol-mdp-btn.is-primary {
  background: #6d28d9;
  border-color: #6d28d9;
  color: #ffffff;
}

.nabgol-mdp-btn.is-primary:hover {
  background: #5b21b6;
  border-color: #5b21b6;
}

.nabgol-mdp-btn.is-done,
.nabgol-mdp-btn.is-primary.is-done {
  background: #047857;
  border-color: #047857;
  color: #ffffff;
}

.nabgol-mdp-back:focus-visible,
.nabgol-mdp-btn:focus-visible {
  outline: 3px solid #a78bfa;
  outline-offset: 2px;
}

.nabgol-mdp-back svg,
.nabgol-mdp-btn svg {
  flex: 0 0 auto;
}

.nabgol-mdp-kicker {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.5;
}

.nabgol-mdp-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nabgol-mdp-note {
  margin: 0;
  padding: 7px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
  background: #111a2e;
  border-bottom: 1px solid #1e293b;
}

.nabgol-mdp-status {
  padding: 6px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #e2e8f0;
  background: #111a2e;
}

.nabgol-mdp-status:empty {
  display: none;
}

.nabgol-mdp-manual {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 32px);
  margin: 8px 16px;
  min-height: 9em;
  max-height: 30vh;
  padding: 10px;
  direction: rtl;
  unicode-bidi: plaintext;
  font: 13px/1.7 monospace;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 10px;
}

.nabgol-mdp-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #e8ece9;
}

.nabgol-mdp-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

/* Phone: the name gets a line of its own, so back and the two actions never
   squeeze it to a few letters. Back stays at the top right. */
@media (max-width: 640px) {
  .nabgol-mdp-head {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "back actions"
      "titles titles";
    gap: 8px 10px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
  }

  .nabgol-mdp-note {
    padding: 6px 12px;
    font-size: 12.5px;
  }

  .nabgol-mdp-status {
    padding: 6px 12px;
  }
}

html[data-theme="light"] .nabgol-mdp-sheet {
  background: #f1f5f9;
  color: #0f172a;
}

html[data-theme="light"] .nabgol-mdp-head {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .nabgol-mdp-back,
html[data-theme="light"] .nabgol-mdp-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .nabgol-mdp-back:hover,
html[data-theme="light"] .nabgol-mdp-btn:hover {
  background: #eef2f7;
}

html[data-theme="light"] .nabgol-mdp-btn.is-primary {
  background: #5b21b6;
  border-color: #5b21b6;
  color: #ffffff;
}

html[data-theme="light"] .nabgol-mdp-btn.is-primary:hover {
  background: #4c1d95;
  border-color: #4c1d95;
}

html[data-theme="light"] .nabgol-mdp-btn.is-done,
html[data-theme="light"] .nabgol-mdp-btn.is-primary.is-done {
  background: #047857;
  border-color: #047857;
  color: #ffffff;
}

html[data-theme="light"] .nabgol-mdp-back:focus-visible,
html[data-theme="light"] .nabgol-mdp-btn:focus-visible {
  outline-color: #7c3aed;
}

html[data-theme="light"] .nabgol-mdp-kicker {
  color: #475569;
}

html[data-theme="light"] .nabgol-mdp-title {
  color: #0f172a;
}

html[data-theme="light"] .nabgol-mdp-note,
html[data-theme="light"] .nabgol-mdp-status {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .nabgol-mdp-status {
  color: #1e293b;
}

.nabgol-chrome-archive.is-open {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.35);
  color: #e0f2fe;
}

.nabgol-chrome-close {
  color: #94a3b8;
  margin-inline-start: 2px;
  border-inline-start: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0 9px 9px 0;
  padding-inline-start: 10px;
}

.nabgol-chrome-close:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.nabgol-chrome-archive .nabgol-archive-count {
  position: absolute;
  top: -4px;
  inset-inline-start: -4px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #38bdf8;
  color: #0b1220;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.95);
}

.nabgol-workspace-header .nabgol-archive-wrap {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 12px;
  z-index: 40;
  min-width: 240px;
  max-width: min(320px, 92vw);
  max-height: min(320px, 50vh);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  padding: 8px;
}

/* Wave 4c section 1A: reports (mutate_doc/share_out) move here from the quest
   widget — same popover chrome as .nabgol-archive-wrap, own selector. */
.nabgol-workspace-header .nabgol-reports-wrap {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  max-width: min(280px, 92vw);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  padding: 6px;
}

/* This is the actual "no way to close" bug: unlike .nabgol-archive-wrap (a
   plain block, so the UA's [hidden] { display: none } already wins), this
   popover needs display:flex for its column layout — and a class selector
   beats an attribute selector on specificity alone, so `display: flex` above
   was winning over [hidden] the whole time. toggleReportsDropdown() flips
   wrap.hidden correctly on every tap; the browser was simply never told to
   care. The dropdown was rendering open the instant the workspace panel
   opened, with the JS toggle having zero visual effect either way — found by
   screenshotting the "workspace" state with no click at all and seeing all
   four items already on screen. */
.nabgol-workspace-header .nabgol-reports-wrap[hidden] {
  display: none;
}

.nabgol-reports-item {
  appearance: none;
  border: none;
  background: transparent;
  /* Fixed, not inherit (2026-08-30): .nabgol-reports-wrap is a permanently-dark
     popover in both themes (same chrome as .nabgol-archive-item, which already
     used a fixed colour here) — `inherit` climbed past it to the theme-reactive
     body text colour, landing near-black-on-near-black in light mode. */
  color: #e2e8f0;
  text-align: right;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.nabgol-reports-item:hover,
.nabgol-reports-item:focus-visible {
  background: rgba(125, 211, 252, 0.14);
  outline: none;
}

/* ══ §12-1 · «not yet», SAID THE SAME WAY IN EVERY DOOR ════════════════════
   The workbench tile and this row are the same capability in two places, and
   until now they said its «not ready» state in two different languages: the
   tile drew a dashed ghost, this row drew nothing but the browser's default
   dimming for `disabled` — which also meant the press never arrived and the
   reader was told nothing. Both doors now use aria-disabled, so the press
   reaches runLearnerDossierAction and it answers with the reason; and both
   draw the same sign — a real face and a dash. This popover is dark in both
   themes (see the fixed colour above), so these two values are fixed too. */
.nabgol-reports-item[aria-disabled="true"],
.nabgol-reports-item[aria-disabled="true"]:hover,
.nabgol-reports-item[aria-disabled="true"]:focus-visible {
  background: rgba(148, 168, 200, 0.10);
  border: 1px dashed rgba(226, 232, 240, 0.32);
  /* The padding keeps the row on the same baseline as its live neighbours
     once a 1px edge appears on it. */
  padding: 7px 9px;
  color: #e2e8f0;
  cursor: default;
}

.nabgol-chrome-reports[aria-expanded="true"] {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.35);
  color: #e0f2fe;
}

/* Light theme (2026-08-31): the sky-blue-on-dark trio above never had a day
   variant — same class of bug .nabgol-chrome-to-chat had in
   chat-mobile-flagship.css, found the same way (test_controls_always_reachable.js's
   new "reportsMenu" state opened this button for the first time). #e0f2fe on
   the near-white .split-header background measured 1.03:1. Same
   --nbgc-accent-wash/-ink/-edge trio chat-header.css already uses for this
   exact shape of pill; dark theme above is untouched. */
html[data-theme="light"] .nabgol-chrome-reports[aria-expanded="true"] {
  background: var(--nbgc-accent-wash);
  border-color: var(--nbgc-accent-edge);
  color: var(--nbgc-accent-ink);
}

body.mobile-chat #splitPanel.nabgol-workspace-v2 .nabgol-chrome-label {
  display: none;
}

body.mobile-chat #splitPanel.nabgol-workspace-v2 .nabgol-chrome-export-pdf,
body.mobile-chat #splitPanel.nabgol-workspace-v2 .nabgol-chrome-export-docx,
body.mobile-chat #splitPanel.nabgol-workspace-v2 .nabgol-chrome-export-md {
  padding-inline: 8px;
}

body.mobile-chat #splitPanel.nabgol-workspace-v2 .split-header,
body.mobile-chat #splitPanel.nabgol-workspace-v2 .nabgol-workspace-header {
  padding: 10px 12px 8px;
}

body.desktop-chat #splitPanel.nabgol-workspace-v2 #splitContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 18px 20px 40px !important;
  direction: rtl;
  text-align: right;
  -webkit-overflow-scrolling: touch;
}

body.desktop-chat #splitPanel.nabgol-workspace-v2 .nabgol-drag-handle {
  display: none;
}

/* —— Document typography (Cursor-like readable doc) —— */
#splitPanel .nabgol-markdown-body,
.nabgol-inline-doc .nabgol-markdown-body {
  direction: rtl;
  text-align: right;
  color: #e7eef7;
  font-size: 14px;
  line-height: 1.85;
  white-space: normal;
  word-break: break-word;
}

#splitPanel .nabgol-markdown-body h1,
#splitPanel .nabgol-markdown-body h2,
#splitPanel .nabgol-markdown-body h3,
#splitPanel .nabgol-markdown-body h4,
.nabgol-inline-doc .nabgol-markdown-body h1,
.nabgol-inline-doc .nabgol-markdown-body h2,
.nabgol-inline-doc .nabgol-markdown-body h3,
.nabgol-inline-doc .nabgol-markdown-body h4 {
  margin: 1.15em 0 0.45em;
  color: #f8fafc;
  font-weight: 700;
  line-height: 1.35;
}

#splitPanel .nabgol-markdown-body h1,
.nabgol-inline-doc .nabgol-markdown-body h1 { font-size: 1.35rem; }
#splitPanel .nabgol-markdown-body h2,
.nabgol-inline-doc .nabgol-markdown-body h2 { font-size: 1.18rem; color: #a7f3d0; }
#splitPanel .nabgol-markdown-body h3,
.nabgol-inline-doc .nabgol-markdown-body h3 { font-size: 1.05rem; color: #6ee7b7; }

#splitPanel .nabgol-markdown-body p,
.nabgol-inline-doc .nabgol-markdown-body p {
  margin: 0 0 0.9em;
  line-height: 1.85;
}

#splitPanel .nabgol-markdown-body ul,
#splitPanel .nabgol-markdown-body ol,
.nabgol-inline-doc .nabgol-markdown-body ul,
.nabgol-inline-doc .nabgol-markdown-body ol {
  margin: 0.45em 0 0.8em;
  padding-inline-start: 1.35em;
  padding-inline-end: 0;
}

#splitPanel .nabgol-markdown-body li,
.nabgol-inline-doc .nabgol-markdown-body li {
  margin: 0.28em 0;
}

#splitPanel .nabgol-markdown-body blockquote,
.nabgol-inline-doc .nabgol-markdown-body blockquote {
  margin: 0.8em 0;
  padding: 10px 14px;
  border-inline-start: 3px solid #34d399;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 0 10px 10px 0;
  color: #d1fae5;
}

#splitPanel .nabgol-markdown-body hr,
.nabgol-inline-doc .nabgol-markdown-body hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 1.2em 0;
}

#splitPanel .nabgol-markdown-body code,
.nabgol-inline-doc .nabgol-markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

#splitPanel .nabgol-markdown-body pre,
.nabgol-inline-doc .nabgol-markdown-body pre {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 12px;
  overflow-x: auto;
}

#splitPanel .nabgol-markdown-body table,
.nabgol-inline-doc .nabgol-markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
  font-size: 13px;
}

#splitPanel .nabgol-markdown-body th,
#splitPanel .nabgol-markdown-body td,
.nabgol-inline-doc .nabgol-markdown-body th,
.nabgol-inline-doc .nabgol-markdown-body td {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 8px 10px;
  text-align: right;
}

.nabgol-drag-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  margin: 0 auto 8px;
  cursor: grab;
  touch-action: none;
}

#splitPanel.nabgol-dragging .nabgol-drag-handle {
  cursor: grabbing;
}

/* Legacy expand — replaced by .nabgol-chrome-expand */
.nabgol-expand-btn { display: none !important; }

.nabgol-panel-badge {
  display: block;
  width: calc(100% - 24px);
  margin: 0 auto 8px;
  padding: 10px 14px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(16, 185, 129, 0.08));
  color: #ecfdf5;
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.18);
  animation: nabgol-badge-pulse 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .nabgol-panel-badge { animation: none; }
}

.nabgol-panel-badge[hidden] {
  display: none !important;
  animation: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

@keyframes nabgol-badge-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(16, 185, 129, 0.18); }
  50% { box-shadow: 0 8px 28px rgba(16, 185, 129, 0.34); }
}

/* —— Mobile sheet: peek above composer; full only on expand —— */
body.mobile-chat #splitPanel.nabgol-workspace-v2.open {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: none !important;
  z-index: 1100 !important;
  background: #0b1220 !important;
}

body.mobile-chat #splitPanel.nabgol-workspace-v2.nabgol-canvas-half.open,
body.mobile-chat.nabgol-workspace-open:not(.nabgol-workspace-full) #splitPanel.nabgol-workspace-v2.open {
  top: auto !important;
  bottom: var(--nabgol-composer-offset, 76px) !important;
  height: min(46dvh, 390px) !important;
  max-height: min(46dvh, 390px) !important;
  border-radius: 20px 20px 0 0 !important;
}

body.mobile-chat #splitPanel.nabgol-workspace-v2.nabgol-canvas-full.open,
body.mobile-chat.nabgol-workspace-full #splitPanel.nabgol-workspace-v2.open {
  inset: 0 !important;
  height: 100svh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  z-index: 1400 !important;
}

body.mobile-chat #splitPanel.nabgol-workspace-v2 .split-header {
  position: sticky;
  top: 0;
  z-index: 2;
  direction: rtl;
}

body.mobile-chat #splitPanel .nabgol-workspace-chrome-title {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: min(52vw, 220px) !important;
}

body.mobile-chat #splitPanel.nabgol-workspace-v2 #splitContent {
  direction: rtl;
  text-align: right;
  padding: 12px 14px 22px;
  overflow-y: auto;
}

/* Mobile dossier: one composition — less chrome, no triple step counters */
body.mobile-chat .nabgol-dossier-hero.is-mobile-compact {
  margin: 0 0 10px;
  padding: 10px 12px 10px;
  border-radius: 12px;
}
body.mobile-chat .nabgol-dossier-hero.is-mobile-compact .nabgol-dossier-hero-top {
  margin-bottom: 6px;
}
body.mobile-chat .nabgol-dossier-hero.is-mobile-compact .nabgol-dossier-hero-title {
  font-size: 1.05rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 8px;
}
body.mobile-chat .nabgol-dossier-hero.is-mobile-compact .nabgol-dossier-cmds {
  gap: 6px;
}
body.mobile-chat .nabgol-dossier-hero.is-mobile-compact .nabgol-dossier-cmd {
  padding: 7px 10px;
  font-size: 12px;
}
body.mobile-chat .nabgol-pipeline.is-mobile-compact {
  margin: 0 0 12px;
  padding: 10px 10px 8px;
}
body.mobile-chat .nabgol-pipeline.is-mobile-compact .nabgol-pipeline-head {
  margin-bottom: 8px;
}
body.mobile-chat .nabgol-pipeline.is-mobile-compact .nabgol-pipeline-status {
  display: none;
}
body.mobile-chat .nabgol-pipeline.is-mobile-compact .nabgol-pipeline-step {
  padding: 6px 8px;
  gap: 8px;
}
body.mobile-chat .nabgol-pipeline.is-mobile-compact .nabgol-pipeline-label {
  font-size: 13px;
  line-height: 1.35;
}
body.mobile-chat .nabgol-process-chart,
body.mobile-chat .nabgol-pipeline-chart,
body.mobile-chat .nabgol-flow-chart {
  display: none !important;
}
body.mobile-chat .nabgol-stage-card {
  padding: 10px 12px;
  margin-bottom: 8px;
}
body.mobile-chat .nabgol-stage-card-title {
  font-size: 13px;
}
body.mobile-chat .nabgol-archive-bar {
  margin-bottom: 10px;
}
body.mobile-chat .nabgol-archive-bar-toggle {
  padding: 8px 10px;
}

body.mobile-chat.nabgol-workspace-open::before {
  content: none;
  display: none;
}

/* U10 mobile — dossier sheet owns focus; hide empty welcome behind it */
body.mobile-chat.nabgol-workspace-open #emptyState,
body.mobile-chat.nabgol-workspace-open .chat-messages > .empty {
  display: none !important;
}

/* U2 mobile — history drawer above workspace would be two sheets; JS closes one.
   Keep overlay above workspace when history is the active layer. */
body.mobile-chat.nabgol-chats-open .sidebar {
  z-index: 1200 !important;
}
body.mobile-chat.nabgol-chats-open .sidebar-overlay.show {
  z-index: 1190 !important;
}

body.mobile-chat.nabgol-workspace-open .tts-player.tts-floating {
  z-index: 1100 !important;
}

.nabgol-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

/* Root-cause fix (2026-08-18): same gap as chat-components.css — this wrapper never had
   table/th/td rules of its own, so a panel table renders with correct rows/columns but no
   visible grid lines. */
.nabgol-table-scroll table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.nabgol-table-scroll th,
.nabgol-table-scroll td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 9px 12px;
  text-align: right;
}

.nabgol-table-scroll thead th {
  background: rgba(52, 211, 153, 0.14);
  border-bottom: 2px solid rgba(52, 211, 153, 0.55);
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.nabgol-table-scroll tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

.nabgol-table-scroll tbody tr:hover {
  background: rgba(52, 211, 153, 0.07);
}

.nabgol-table-scroll .nabgol-table-num {
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nabgol-table-scroll.nabgol-table-tall {
  max-height: 420px;
  overflow-y: auto;
}

.nabgol-table-scroll.nabgol-table-tall thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #14313a;
}

@media (max-width: 520px) {
  .nabgol-table-scroll th,
  .nabgol-table-scroll td {
    padding: 7px 9px;
    font-size: 0.92em;
  }
}

.nabgol-code-block {
  position: relative;
}

.nabgol-copy-code {
  position: absolute;
  top: 8px;
  left: 8px;
  border: 0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

/* —— Active dossier identity (panel hero) —— */
.nabgol-dossier-hero {
  margin: 0 0 14px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background:
    linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(15, 23, 42, 0.55) 55%, rgba(15, 23, 42, 0.2));
}

.nabgol-dossier-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.nabgol-dossier-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 999px;
  padding: 3px 10px;
}

.nabgol-dossier-meta {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.nabgol-dossier-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nabgol-dossier-grade {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.45);
}

.nabgol-dossier-grade[data-level="complete"] {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.16);
}

.nabgol-dossier-grade[data-level="usable"] {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.14);
}

.nabgol-dossier-grade[data-level="incomplete"] {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(239, 68, 68, 0.14);
}

.nabgol-dossier-hero-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 800;
  color: #f8fafc;
  text-align: right;
}

.nabgol-dossier-hero-hint {
  display: none;
}

.nabgol-dossier-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.nabgol-dossier-cmd {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 7px 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.nabgol-dossier-cmd:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
}

.nabgol-dossier-cmd:active {
  transform: translateY(1px);
}

.nabgol-dossier-cmd.is-primary {
  color: #052e1c;
  background: linear-gradient(135deg, #34d399, #10b981);
  border-color: rgba(52, 211, 153, 0.65);
}

.nabgol-dossier-cmd.is-primary:hover {
  background: linear-gradient(135deg, #6ee7b7, #34d399);
}

.nabgol-dossier-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(12px);
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #ecfdf5;
  background: rgba(6, 78, 59, 0.94);
  border: 1px solid rgba(52, 211, 153, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(90%, 320px);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* THE NUMBER HERE IS ONLY THE FIRST FRAME'S. §33-5ب: showDossierToast()
   measures the live bottom stack (the work band + the composer) and writes the
   real lift onto this element, because 92px is the composer's height alone and
   knows nothing about the tool band that now sits on top of it — measured, the
   toast landed square on a chip. This declaration is what paints before that
   runs and what stands if the measurement returns nothing. */
.nabgol-dossier-toast.is-body {
  position: fixed;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 1600;
}

/* §36-4 — WHILE «میزِ کار» IS OPEN THE TOAST IS A ROW, NOT AN OVERLAY.
   Measured at 390×844: the lifted body toast sat at y=684..706 and the
   «کارِ امروز» tile at y=660..705 — the toast covered the panel's first row
   for the two seconds the reader had just opened the panel to read it. There
   is no room above the panel either (the mode bar ends at 128px and the panel
   starts at 152px), so the answer is to stop floating. As the last in-flow
   child of the panel's flex column it pushes the scrollport up by exactly its
   own height instead of painting over it, and `display:none` while it is off
   means the panel is the height it always was the rest of the time.
   `position: static` is what undoes the translate the base rule centres with.
   The generic `.is-on` further down re-states `translateX(-50%)`, so the pair
   below restates it too — and wins on specificity (two classes against one),
   not on source order, because this block is above it in the file. */
.nabgol-dossier-toast.is-sheet-foot {
  position: static;
  transform: none;
  flex: 0 0 auto;
  align-self: stretch;
  z-index: auto;
  max-width: none;
  margin: 0 6px 8px;
}

.nabgol-dossier-toast.is-sheet-foot:not(.is-on) {
  display: none;
}

.nabgol-dossier-toast.is-sheet-foot.is-on {
  opacity: 1;
  transform: none;
}

.nabgol-dossier-toast-act {
  appearance: none;
  border: 1px solid rgba(167, 243, 208, 0.55);
  background: rgba(16, 185, 129, 0.28);
  color: #ecfdf5;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nabgol-dossier-toast-act:active {
  transform: scale(0.97);
}

.nabgol-dossier-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nabgol-open-dossier-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 4px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.42);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(6, 95, 70, 0.28));
  color: #bbf7d0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nabgol-open-dossier-cta:active {
  transform: scale(0.98);
}

/* —— Phase 2 remediation (2026-08-19): download PDF/Word of the chat answer
   itself, independent of the (now mostly dormant) dossier panel. Reuses the
   same .nabgol-chrome-btn / export-pdf / export-docx look as the panel
   toolbar for a consistent, already-proven "shiny" identity. —— */
.nabgol-chat-export-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}

.nabgol-chat-export-actions .nabgol-chrome-btn {
  height: 36px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* —— In-session dossier archive —— */
.nabgol-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 5px 8px 5px 7px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.nabgol-archive-btn:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.4);
}

.nabgol-archive-btn-label {
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
}

.nabgol-archive-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.95;
}

.nabgol-archive-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #38bdf8;
  color: #0b1220;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.nabgol-archive-bar {
  margin: 0 0 14px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.55);
}

.nabgol-archive-bar.is-empty {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.35);
}

.nabgol-archive-bar-empty {
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: #cbd5e1;
  text-align: right;
  direction: rtl;
}

.nabgol-archive-btn.is-empty {
  opacity: 0.78;
}

.nabgol-archive-item.is-muted {
  cursor: default;
  opacity: 0.75;
  color: #94a3b8;
}

.nabgol-archive-bar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #e0f2fe;
  font: inherit;
  text-align: right;
  direction: rtl;
  padding: 10px 12px;
  cursor: pointer;
}

.nabgol-archive-bar-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.nabgol-archive-bar-label {
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
}

.nabgol-archive-bar-sub {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.nabgol-archive-bar-toggle.is-open {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.nabgol-archive-bar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  max-height: min(40vh, 280px);
  overflow: auto;
  scrollbar-width: thin;
}

.nabgol-archive-bar-list[hidden] {
  display: none !important;
}

.nabgol-archive-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  text-align: right;
  direction: rtl;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nabgol-archive-card.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(12, 74, 110, 0.28);
  cursor: default;
}

.nabgol-archive-card.is-archived:hover {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.85);
}

.nabgol-archive-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.nabgol-archive-card.is-active .nabgol-archive-led {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
}

.nabgol-archive-card.is-archived .nabgol-archive-led {
  background: #94a3b8;
  opacity: 0.9;
}

.nabgol-archive-card.is-archived.is-done .nabgol-archive-led {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.45);
  opacity: 1;
}

.nabgol-archive-card.is-open-copy {
  opacity: 0.95;
  cursor: default;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(12, 74, 110, 0.18);
}

.nabgol-archive-card.is-open-copy:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(12, 74, 110, 0.18);
}

.nabgol-archive-card.is-open-copy .nabgol-archive-led {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.45);
  opacity: 1;
}

.nabgol-archive-card.is-open-copy .nabgol-archive-card-meta {
  color: #7dd3fc;
}

.nabgol-archive-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.nabgol-archive-card-title {
  font-size: 12px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.45;
}

.nabgol-archive-card-meta {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

.nabgol-archive-card.is-active .nabgol-archive-card-meta {
  color: #86efac;
}

.nabgol-archive-wrap {
  position: absolute;
  top: 52px;
  inset-inline-end: 12px;
  z-index: 30;
  min-width: 220px;
  max-width: min(340px, 92%);
  max-height: min(52vh, 360px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, 0.45) transparent;
}

.nabgol-archive-bar-list {
  max-height: min(40vh, 280px);
  overflow: auto;
  scrollbar-width: thin;
}

.nabgol-archive-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nabgol-archive-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  text-align: right;
  direction: rtl;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}

.nabgol-archive-item:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* —— In-panel PDF / print preview sheet —— */
#splitPanel.nabgol-print-preview-open {
  position: relative;
}

.nabgol-print-sheet {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: #0b1220;
  animation: nabgol-print-in 0.18s ease;
}

@keyframes nabgol-print-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.nabgol-print-sheet-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(11, 18, 32, 0.98);
  direction: rtl;
}

.nabgol-print-tip {
  margin: 0;
  flex-shrink: 0;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.35);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  direction: rtl;
  text-align: right;
}

.nabgol-print-sheet-title {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  padding-inline: 4px;
}

.nabgol-print-back-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(52, 211, 153, 0.42);
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.2);
  color: #ecfdf5;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.12);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nabgol-print-back-primary:hover {
  background: rgba(16, 185, 129, 0.32);
  border-color: rgba(52, 211, 153, 0.55);
}

.nabgol-print-back-label {
  letter-spacing: 0.01em;
}

.nabgol-print-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.nabgol-print-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nabgol-print-act:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

.nabgol-print-act.is-ok {
  background: rgba(52, 211, 153, 0.2);
  color: #a7f3d0;
}

.nabgol-print-act .nabgol-chrome-ico {
  width: 15px;
  height: 15px;
}

.nabgol-print-act-label {
  font-size: 10px;
  font-weight: 800;
}

body.mobile-chat .nabgol-print-act-label,
body.mobile-chat .nabgol-print-back-label {
  display: none;
}

body.mobile-chat .nabgol-print-back-primary,
body.mobile-chat .nabgol-print-act {
  padding-inline: 8px;
}

.nabgol-print-sheet-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #e9eee9;
  min-height: 0;
}

body.desktop-chat.nabgol-workspace-full .nabgol-width-handle {
  opacity: 0.35;
}

/* docs/PARENT_REPORT_AUDIT.md rows 20/22 — kind:'report': a read-only page,
   text from the top; no subtitle. The one-line ellipsis title is the panel
   header (.nabgol-workspace-chrome-title); the page H1 wraps so the date shows. */
.nabgol-report-doc {
  direction: rtl;
  text-align: right;
  padding: 4px 2px 12px;
}
.nabgol-report-doc .nabgol-markdown-body > h1:first-child,
.nabgol-report-doc h1:first-of-type {
  margin: 0 0 12px;
  font-size: 1.15rem;
  line-height: 1.6;
}
