/* UI-DIALOG-01 / EX-DIALOG-02: one bottom overlay beside the navigation at every width. */
[data-ui="v2"] .v2-help-aside.v2-help-bottom {
  position: fixed; top: auto; bottom: var(--v2-bottom-tabs-h, 40px); left: var(--rail-w); right: 0; width: auto; max-width: none;
  height: min(360px, 42dvh); max-height: 42dvh; min-height: 0;
  margin: 0; padding: 10px var(--content-pad) var(--sp-4);
  border: 0; border-top: 1px solid var(--line-2); border-radius: 0;
  --help-strip-bg: color-mix(in srgb, var(--info-soft) 72%, var(--surface));
  background: var(--help-strip-bg); box-shadow: var(--shadow);
  z-index: 24;
  display: flex; flex-direction: column; overflow: visible;
  transition: height .25s ease;
}
[data-ui="v2"] .v2-shell[data-rail="pinned"] .v2-help-aside.v2-help-bottom { left: var(--rail-w-expanded); }
[data-ui="v2"] .v2-help-aside.v2-help-bottom[hidden] { display: none; }
[data-ui="v2"] .v2-help-bottom.is-hidden { display: none; }
[data-ui="v2"] .v2-shell { --v2-bottom-tabs-h: 40px; --v2-bottom-fog-rise: 48px; }
/* Review already has its own panel scrolling (or page scrolling under tabs).
   Reserve the actual bottom tabs only; decoration must not shrink the editor. */
[data-ui="v2"] body.v2-review .v2-shell { --v2-bottom-fog-rise: 0px; }
/* The archive has a fixed workspace with inner scrolling as well. */
@media (min-width: 1281px) {
  [data-ui="v2"] .v2-shell:has(#v2-archive-root) { --v2-bottom-fog-rise: 0px; }
  /* Focusing a row or the height handle must scroll only the inner panel.
     An overflow-hidden grid can otherwise be scrolled by browser focus. */
  [data-ui="v2"] body.v2-review .rv-wrap.rv-rows-wide-open { overflow: clip; }
}
/* A permanent scroll reserve lets the last actions reach above the tabs.
   Opening the help overlay does not change this reserve or table/chart geometry. */
[data-ui="v2"] .v2-shell:has(> .v2-bottom-tabs:not([hidden])) .v2-main { padding-bottom: calc(var(--v2-bottom-tabs-h) + var(--v2-bottom-fog-rise)); }
[data-ui="v2"] .v2-bottom-tabs {
  position: fixed; left: var(--rail-w); right: 0; bottom: 0; height: var(--v2-bottom-tabs-h);
  padding: 0 var(--content-pad); z-index: 25; isolation: isolate; pointer-events: none;
}
/* Shared across all agendas and ERP adapters, including drafts without help.
   Opaque behind the tabs; fades upward without intercepting the page. */
[data-ui="v2"] .v2-bottom-tabs::before {
  content: ''; position: absolute; inset: auto 0 0; z-index: 0;
  height: calc(var(--v2-bottom-tabs-h) + var(--v2-bottom-fog-rise)); pointer-events: none;
  background: linear-gradient(to top, var(--bg-2) 0, var(--bg-2) var(--v2-bottom-tabs-h),
    color-mix(in srgb, var(--bg-2) 85%, transparent) calc(var(--v2-bottom-tabs-h) + 16px), transparent 100%);
}
[data-ui="v2"] .v2-shell[data-rail="pinned"] .v2-bottom-tabs { left: var(--rail-w-expanded); }
[data-ui="v2"] .v2-bottom-tabs[hidden] { display: none; }
[data-ui="v2"] .v2-bottom-tabs-group {
  position: absolute; bottom: 0; z-index: 1; display: flex; align-items: stretch; gap: var(--sp-1);
  width: max-content; min-width: 0; height: var(--v2-bottom-tabs-h); pointer-events: none;
}
[data-ui="v2"] .v2-bottom-drafts {
  display: flex; gap: var(--sp-1); min-width: 0; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; scrollbar-width: none; pointer-events: auto; touch-action: pan-x;
}
[data-ui="v2"] .v2-bottom-drafts[hidden] { display: none; }
[data-ui="v2"] .v2-bottom-drafts::-webkit-scrollbar { display: none; }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-row {
  display: flex; align-items: stretch; flex: 0 0 auto; width: min(228px, var(--v2-draft-tab-max-width, 228px)); min-width: 0; margin: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden;
}
[data-ui="v2"] .v2-bottom-drafts .v2-draft-row:has([aria-current="page"]) { background: var(--info-soft); border-color: var(--info); }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-row.is-waiting { border-style: dashed; }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-item {
  display: flex; align-items: center; gap: var(--sp-2); flex: 1; min-width: 0;
  padding: 0 var(--sp-3); height: var(--v2-bottom-tabs-h); border: 0; border-radius: 0;
  color: var(--ink); background: transparent; text-align: left; cursor: pointer;
}
[data-ui="v2"] .v2-bottom-drafts .v2-draft-item .icon { font-size: 18px; flex: none; }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-item .lbl { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-name { font-size: 12px; font-weight: 700; }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-meta { font-size: 10px; color: var(--ink-3); }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-name,
[data-ui="v2"] .v2-bottom-drafts .v2-draft-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-close {
  display: grid; place-items: center; position: static; flex: 0 0 32px; width: 32px; height: auto;
  padding: 0; color: var(--ink-2); background: transparent; border: 0; border-radius: 0; cursor: pointer;
  top: auto; right: auto; transform: none;
}
[data-ui="v2"] .v2-bottom-drafts .v2-draft-close:hover,
[data-ui="v2"] .v2-bottom-drafts .v2-draft-item:hover { background: var(--surface-2); }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-row:has([aria-current="page"]) .v2-draft-item:hover,
[data-ui="v2"] .v2-bottom-drafts .v2-draft-row:has([aria-current="page"]) .v2-draft-close:hover { background: var(--info-soft); }
[data-ui="v2"] .v2-bottom-drafts button:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
[data-ui="v2"] .v2-bottom-drafts .v2-draft-more { flex: 0 0 180px; border: 1px solid var(--line-2); border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); }
[data-ui="v2"] .v2-bottom-tabs .v2-help-strip-handle {
  display: flex; position: static; flex: none; pointer-events: auto; transform: none; flex-direction: row; gap: var(--sp-2);
  height: 40px; min-height: 40px; padding: 0 var(--sp-5);
  touch-action: none; user-select: none; cursor: grab;
  color: var(--info); background: var(--info-soft); border: 1px solid var(--info);
  border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
}
[data-ui="v2"] .v2-bottom-tabs .v2-help-strip-handle.is-dragging { cursor: grabbing; }
[data-ui="v2"] .v2-help-position-grip { font-size: 17px; line-height: 1; opacity: .7; }
[data-ui="v2"] .v2-bottom-tabs .v2-help-strip-handle .icon { transform: none; }
[data-ui="v2"] .v2-bottom-tabs .v2-help-strip-handle-label {
  writing-mode: horizontal-tb; text-orientation: mixed; font-size: 13px; font-weight: 700; white-space: nowrap;
}
[data-ui="v2"] .v2-help-wave-letter {
  display: inline-block; transform-origin: center;
  animation: v2-help-letter-wave 7s ease-in-out infinite;
  animation-delay: calc(2s + var(--help-letter-index) * 120ms);
}
[data-ui="v2"] .v2-help-strip-handle:is(.is-expanded, .is-dragging, :hover, :focus-visible) .v2-help-wave-letter {
  animation: none; transform: none;
}
[data-ui="v2"] .v2-bottom-tabs .v2-help-strip-handle:hover,
[data-ui="v2"] .v2-bottom-tabs .v2-help-strip-handle:focus-visible {
  outline: 2px solid var(--focus); outline-offset: -3px;
}
@keyframes v2-help-letter-wave {
  0%, 3.4%, 100% { transform: scale(1); }
  1.7% { transform: scale(1.22); }
}
[data-ui="v2"] .v2-help-bottom .v2-help-panel-head { align-items: center; flex-wrap: nowrap; padding-bottom: 5px; }
[data-ui="v2"] .v2-help-bottom .v2-help-panel-title { flex: 0 0 auto; }
[data-ui="v2"] .v2-help-scroll-hint { font-size: 12px; color: var(--ink-3); flex: 1; min-width: 0; }
[data-ui="v2"] .v2-help-boundary-toggle {
  position: absolute; left: 50%; top: -16px; transform: translateX(-50%);
  display: grid; place-items: center; width: 56px; height: 32px;
  border: 1px solid var(--info); border-radius: var(--r-lg);
  color: var(--info); background: var(--info-soft); cursor: pointer; z-index: 2;
}
[data-ui="v2"] .v2-help-boundary-toggle .icon { font-size: 20px; }
[data-ui="v2"] .v2-help-bottom [data-help-collapse] {
  color: var(--info); background: var(--info-soft); border-color: var(--info);
}
[data-ui="v2"] .v2-help-bottom [data-help-collapse]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[data-ui="v2"] .v2-help-bottom .v2-help-width-handle { display: none; }
[data-ui="v2"] .v2-help-bottom .v2-help-panel-body {
  overflow-x: auto; overflow-y: hidden; flex-direction: row; gap: var(--sp-4);
  overscroll-behavior: contain; touch-action: pan-x; padding-block: 2px 0; scrollbar-width: none; height: 100%;
}
[data-ui="v2"] .v2-help-bottom .v2-help-panel-body:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
[data-ui="v2"] .v2-help-bottom .v2-help-list {
  display: flex; flex: 0 0 auto; flex-wrap: nowrap; flex-direction: row;
  align-items: stretch; gap: var(--sp-4); margin: 0; padding: 0; min-height: 0;
}
[data-ui="v2"] .v2-help-bottom .v2-help-list-item { min-width: 0; flex: 0 0 280px; width: 280px; display: flex; }
[data-ui="v2"] .v2-help-bottom .v2-help-card { flex: 1; min-height: 0; min-width: 0; cursor: pointer; }
[data-ui="v2"] .v2-help-bottom .v2-help-card-toprow,
[data-ui="v2"] .v2-help-bottom .v2-help-card:has(.v2-help-card-topright) .v2-help-card-toprow {
  flex: 0 0 26px; min-height: 26px; flex-direction: row; flex-wrap: nowrap;
  align-items: flex-start; padding-right: 78px;
}
[data-ui="v2"] .v2-help-bottom .v2-help-card-toprow .v2-help-badge { flex: none; }
[data-ui="v2"] .v2-help-bottom .v2-help-card-title { flex: 0 0 42px; height: 42px; overflow: hidden; }
[data-ui="v2"] .v2-help-card-open {
  font: inherit; color: inherit; text-align: left; background: transparent;
  border: 0; padding: 0; width: 100%; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-ui="v2"] .v2-help-card-open:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-md); }

[data-ui="v2"] .v2-help-bottom .v2-help-card-foot { margin-top: auto; flex: 0 0 32px; flex-wrap: nowrap; }
[data-ui="v2"] .v2-help-bottom .v2-help-media { flex: 1 1 150px; min-height: 0; max-height: 150px; aspect-ratio: auto; }
[data-ui="v2"] .v2-help-bottom .v2-help-media :is(img, video) { max-height: 150px; object-fit: contain; }
[data-ui="v2"] .v2-help-bottom .v2-help-pager,
[data-ui="v2"] .v2-help-bottom .v2-help-panel-foot { flex: 0 0 200px; align-self: center; }
[data-ui="v2"] .v2-help-bottom .v2-help-panel-search {
  margin: 0; width: 0; overflow: hidden; opacity: 0; visibility: hidden;
  transition: width .2s ease, opacity .2s ease;
}
[data-ui="v2"] .v2-help-bottom.is-search-wide .v2-help-panel-search { width: 150px; opacity: 1; visibility: visible; }
[data-ui="v2"] .v2-help-bottom .v2-help-panel-search-field { padding-inline: var(--sp-2); }
[data-ui="v2"] .v2-help-bottom .v2-help-panel-search-field input { height: 36px; }

/* Shared modal chrome; the tip occupies page height while keeping a bounded width. */
[data-ui="v2"] .v2-dlg-modal.v2-help-tip-overlay { padding: 0; align-items: stretch; justify-content: flex-end; }
[data-ui="v2"] .v2-dlg-modal.v2-help-tip-overlay .v2-modal-card {
  width: min(640px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh;
  border-radius: var(--r-xl) 0 0 var(--r-xl); display: flex; flex-direction: column;
}
[data-ui="v2"] .v2-help-tip-overlay .v2-modal-head { flex: none; }
[data-ui="v2"] .v2-help-tip-overlay .v2-modal-body {
  flex: 1; min-height: 0; overflow: hidden; display: flex; padding: var(--sp-5);
}
[data-ui="v2"] .v2-help-tip-overlay .v2-help-tip-detail { flex: 1; min-height: 0; display: flex; }
[data-ui="v2"] .v2-help-tip-overlay .v2-help-card {
  flex: 1; min-height: 0; padding: 0; border: 0; box-shadow: none; background: transparent;
}
[data-ui="v2"] .v2-help-tip-overlay .v2-help-card-toprow { flex: none; order: 1; }
[data-ui="v2"] .v2-help-tip-overlay .v2-help-media { order: 2; flex: 1 1 320px; min-height: 0; max-height: none; aspect-ratio: auto; }
[data-ui="v2"] .v2-help-tip-overlay .v2-help-steps-full,
[data-ui="v2"] .v2-help-tip-overlay .v2-help-body { order: 3; flex: none; }
[data-ui="v2"] .v2-help-tip-overlay .v2-help-vote-row { order: 4; flex: none; }
[data-ui="v2"] .v2-help-tip-overlay .v2-help-card-foot { order: 5; flex: none; }
[data-ui="v2"] .v2-help-tip-overlay .v2-help-steps { list-style: none; padding: 0; counter-reset: help-step; gap: var(--sp-2); }
[data-ui="v2"] .v2-help-tip-overlay .v2-help-steps > li {
  counter-increment: help-step; display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: var(--sp-3);
}
[data-ui="v2"] .v2-help-tip-overlay .v2-help-steps > li::before {
  content: counter(help-step); display: grid; place-items: center; flex: 0 0 28px; height: 28px;
  color: var(--info); background: var(--info-soft); border-radius: var(--r-md); font-weight: 700;
}
[data-ui="v2"] .v2-help-tip-overlay.has-many-steps .v2-help-steps-full { flex: 0 1 auto; min-height: 0; max-height: 50dvh; overflow-y: auto; overscroll-behavior: contain; }
/* EX-DIALOG-02: nonmodal reading workspace above the retained tip carousel. */
[data-ui="v2"] .v2-help-tip-workspace {
  position: fixed; inset: 0 0 40px; z-index: 100; display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); min-height: 0;
}
[data-ui="v2"] .v2-help-tip-workspace .v2-modal-head { padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); }
[data-ui="v2"] .v2-help-tip-workspace .v2-modal-head h2 { flex: 1; min-width: 0; margin: 0; font: 700 16px/1.35 var(--font-sans); }
[data-ui="v2"] .v2-help-tip-workspace .v2-modal-head .v2-iconbtn { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; }
[data-ui="v2"] .v2-help-tip-workspace .v2-modal-body { padding: var(--sp-3) var(--sp-5); overflow: auto; overscroll-behavior: contain; }
[data-ui="v2"] .v2-help-tip-workspace .v2-help-card { gap: var(--sp-2); }
[data-ui="v2"] .v2-help-tip-workspace .v2-help-media { flex: 1 1 auto; min-height: 120px; background: transparent; border-radius: 0; }
[data-ui="v2"] .v2-help-tip-workspace .v2-help-media img,
[data-ui="v2"] .v2-help-tip-workspace .v2-help-video { width: 100%; height: 100%; object-fit: contain; }
[data-ui="v2"] .v2-help-tip-workspace .v2-help-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
[data-ui="v2"] .v2-help-step-copy { min-width: 0; overflow-wrap: anywhere; }
[data-ui="v2"] .v2-help-step-key { color: var(--accent-text); font-weight: 700; }
[data-ui="v2"] .v2-help-tip-workspace .v2-help-card-foot { flex-wrap: wrap; gap: var(--sp-2); }
[data-ui="v2"] .v2-help-tip-workspace .v2-help-vote-row { margin: 0 auto 0 0; }
@media (max-width: 700px) {
  [data-ui="v2"] .v2-help-tip-workspace .v2-modal-head { padding: var(--sp-2) var(--sp-3); }
  [data-ui="v2"] .v2-help-tip-workspace .v2-modal-body { padding: var(--sp-2) var(--sp-3); }
  [data-ui="v2"] .v2-help-tip-workspace .v2-help-steps { grid-template-columns: minmax(0, 1fr); }
  [data-ui="v2"] .v2-help-tip-workspace .v2-help-steps > li { padding: var(--sp-2); }
  [data-ui="v2"] .v2-help-tip-workspace .v2-modal-head .v2-iconbtn { width: 40px; height: 40px; }
}
@media print { [data-ui="v2"] .v2-help-tip-workspace { display: none; } }
@media (max-width: 600px) {
  [data-ui="v2"] .v2-help-aside.v2-help-bottom { height: 40dvh; max-height: 40dvh; padding-inline: var(--sp-5); }
  [data-ui="v2"] .v2-shell { --v2-bottom-tabs-h: 44px; }
  [data-ui="v2"] .v2-bottom-tabs { padding-inline: var(--sp-5); }
  [data-ui="v2"] .v2-bottom-drafts .v2-draft-close { flex-basis: 40px; width: 40px; }
  [data-ui="v2"] .v2-bottom-tabs .v2-help-strip-handle { min-height: 44px; }
  [data-ui="v2"] .v2-help-bottom .v2-help-panel-title { font-size: 12px; white-space: normal; }
  [data-ui="v2"] .v2-help-bottom .v2-help-panel-goto { max-width: 140px; white-space: normal; font-size: 11px; }
  [data-ui="v2"] .v2-help-bottom .v2-help-panel-head-actions { gap: var(--sp-1); }
  [data-ui="v2"] .v2-help-bottom.is-search-wide .v2-help-panel-title { display: none; }
  [data-ui="v2"] .v2-help-bottom.is-search-wide .v2-help-panel-head-actions { width: 100%; min-width: 0; }
  [data-ui="v2"] .v2-help-bottom.is-search-wide .v2-help-panel-goto { flex: 1; min-width: 0; max-width: 100px; }
  [data-ui="v2"] .v2-help-bottom .v2-help-list-item { flex-basis: 260px; width: 260px; }
  [data-ui="v2"] .v2-help-tip-overlay .v2-modal-card { border-radius: 0; }
  [data-ui="v2"] .v2-help-tip-overlay .v2-help-steps { font-size: 13px; line-height: 1.4; }
  [data-ui="v2"] .v2-help-bottom .v2-iconbtn { min-height: 40px; height: 40px; }
}
@media (max-height: 700px) {
  [data-ui="v2"] .v2-help-bottom .v2-help-card { padding: var(--sp-3); gap: var(--sp-1); }
  [data-ui="v2"] .v2-help-bottom .v2-help-card-toprow,
  [data-ui="v2"] .v2-help-bottom .v2-help-card:has(.v2-help-card-topright) .v2-help-card-toprow { flex-basis: 28px; min-height: 28px; overflow: hidden; }
  [data-ui="v2"] .v2-help-bottom .v2-help-card-title { flex-basis: 36px; height: 36px; font-size: 13px; line-height: 18px; }
  [data-ui="v2"] .v2-help-bottom .v2-help-card-topright { top: var(--sp-3); right: var(--sp-3); }
}
@media (prefers-reduced-motion: reduce) {
  [data-ui="v2"] .v2-help-aside.v2-help-bottom { transition: none; }
  [data-ui="v2"] .v2-help-bottom .v2-help-panel-search { transition: none; }
  [data-ui="v2"] .v2-help-wave-letter { animation: none; transform: none; }
}
@media print {
  [data-ui="v2"] .v2-help-bottom, [data-ui="v2"] .v2-bottom-tabs { display: none !important; }
  [data-ui="v2"] .v2-shell:has(> .v2-bottom-tabs) .v2-main { padding-bottom: 0; }
}

/* Side fades and direction buttons share the strip colour in both themes. */
[data-ui="v2"] .v2-help-scroll-frame { position: relative; flex: 1; min-height: 0; min-width: 0; }
[data-ui="v2"] .v2-help-bottom .v2-help-panel-body::-webkit-scrollbar { display: none; }
[data-ui="v2"] .v2-help-scroll-frame::before, [data-ui="v2"] .v2-help-scroll-frame::after { content: ''; position: absolute; top: 0; bottom: 0; width: 64px; z-index: 2; pointer-events: none; opacity: 0; }
[data-ui="v2"] .v2-help-scroll-frame::before { left: 0; background: linear-gradient(to right, var(--help-strip-bg), transparent); }
[data-ui="v2"] .v2-help-scroll-frame::after { right: 0; background: linear-gradient(to left, var(--help-strip-bg), transparent); }
[data-ui="v2"] .v2-help-scroll-frame.can-scroll-left::before, [data-ui="v2"] .v2-help-scroll-frame.can-scroll-right::after { opacity: 1; }
[data-ui="v2"] .v2-help-scroll-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; height: 56px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-lg); color: var(--info); background: var(--help-strip-bg); box-shadow: var(--shadow-sm); cursor: pointer; }
[data-ui="v2"] .v2-help-scroll-arrow[hidden] { display: none; }
[data-ui="v2"] .v2-help-scroll-arrow.to-left { left: 0; }
[data-ui="v2"] .v2-help-scroll-arrow.to-right { right: 0; }
[data-ui="v2"] .v2-help-scroll-arrow .icon { font-size: 32px; }
[data-ui="v2"] .v2-help-scroll-arrow:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[data-ui="v2"] .v2-help-card-foot .v2-help-tag, [data-ui="v2"] .v2-help-tile-copyrow .v2-help-tag { min-width: 0; max-width: calc(100% - 36px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-ui="v2"] .v2-help-tile-copyrow { justify-content: space-between; }
@media (max-width: 800px) { [data-ui="v2"] .v2-help-scroll-hint { display: none; } }
