/* Feature 2255 — HTML Docs, styled from the approved prototype.
   #176D89 carries text and state (5.9:1 on white, 5.2:1 on the page grey); amber #A14A0A means
   "waiting on you" and nothing else; ES blue (#3EB0D5) is decoration only (PBI 2266).
   Sharing Access uses the accountability chart's shades, hsl(196 54% L).

   Never write `font: <size> inherit`: inherit can't sit inside the font shorthand, so the browser
   drops the whole declaration and the control falls back to 16px. Set family, size and weight apart. */

:root {
    --hd-primary: #176D89;
    --hd-primary-hover: #135A71;
    --hd-on-primary: #FFFFFF;
    --hd-amber: #A14A0A;
    --hd-on-amber: #FFFFFF;
    --hd-amber-text: #7A3306;
    --hd-amber-bg: #FFF4E5;
    --hd-warn-bg: rgba(255,193,7,.16);
    --hd-warn-text: #5C4500;
    --hd-info-bg: rgba(23,162,184,.1);
    --hd-info-text: #0F6F7E;
    --hd-success: #3C763D;
    --hd-border: #D0D9E3;
    --hd-chip-border: #C0CCDA;
    --hd-input-border: #8FA4AD;
    --hd-grid-line: #E4E9F0;
    --hd-divider: #DDE4EC;
    --hd-muted: #55657A;
    --hd-secondary: #666666;
    --hd-surface: #FFFFFF;
    --hd-stripe: #F5F5F5;
    --hd-hover: #E8F6FA;
    --hd-press: rgba(0,0,0,.06);
    --hd-neutral-bg: rgba(0,0,0,.08);
    --hd-anchor-bg: #F0F3F8;
    --hd-text: #333333;
    --hd-error: #A94442;
    --hd-drop-bg: rgba(238,242,247,.92);
}

/* Dark: the app's own dark primary (#54C0E8, EasySongTheme), with dark text on every filled blue or
   amber, because white on a light blue or amber fails 4.5:1. */
:root[data-theme="dark"] {
    --hd-primary: #54C0E8;
    --hd-primary-hover: #7FD0EA;
    --hd-on-primary: #0E1B21;
    --hd-amber: #F0A35E;
    --hd-on-amber: #1A0F06;
    --hd-amber-text: #F6C18F;
    --hd-amber-bg: #3A2412;
    --hd-warn-bg: rgba(255,193,7,.12);
    --hd-warn-text: #FFE08A;
    --hd-info-bg: rgba(84,192,232,.12);
    --hd-info-text: #8FD3E0;
    --hd-success: #7CC47F;
    --hd-border: #2C3F49;
    --hd-chip-border: #3E5866;
    --hd-input-border: #5E7A87;
    --hd-grid-line: #22343E;
    --hd-divider: #2C3F49;
    --hd-muted: #A9B6C2;
    --hd-secondary: #B8C2CC;
    --hd-surface: #14242D;
    --hd-stripe: #172A34;
    --hd-hover: #1D3540;
    --hd-press: rgba(255,255,255,.08);
    --hd-neutral-bg: rgba(255,255,255,.08);
    --hd-anchor-bg: #1B2E38;
    --hd-text: #E6EDF2;
    --hd-error: #E08987;
    --hd-drop-bg: rgba(14,27,33,.92);
}

/* No gutter of its own: the content wrapper already has the app's, so the page lines up with Requests. */
.hd-page {
    position: relative;
    padding: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--hd-text);
    font-variant-numeric: lining-nums;
}

.hd-h1 { font-size: 1.125rem; font-weight: 600; margin: 0; line-height: 1.4; }
/* Focused by FocusOnNavigate for screen readers, which needs no visible ring. */
.hd-h1:focus, .hd-h1:focus-visible { outline: none; }
.hd-h6 { font-size: 1rem; font-weight: 600; margin: 0 0 8px; }
.hd-caption { font-size: .75rem; color: var(--hd-secondary); font-variant-numeric: tabular-nums lining-nums; }
.hd-muted { color: var(--hd-secondary); }
.hd-spacer { flex: 1 1 auto; }
.hd-nowrap { white-space: nowrap; }
.hd-tnum { font-variant-numeric: tabular-nums lining-nums; }
.hd-amber-text { color: var(--hd-amber) !important; }
.hd-hidden-input { position: absolute !important; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.hd-empty { padding: 24px; text-align: center; color: var(--hd-secondary); margin: 0; }
.hd-hint { margin: 4px 0 0; }

.hd-text-btn.mud-button-root { color: var(--hd-primary); }
.hd-text-btn.hd-pinned.mud-button-root { color: var(--hd-primary); font-weight: 600; }
.hd-danger-text.mud-button-root { color: var(--hd-error); }
.hd-icon-muted { color: var(--hd-muted) !important; }
.hd-icon-on { color: var(--hd-primary) !important; }

/* ---- header row, counts, banner ---- */
.hd-header-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hd-counts { display: flex; align-items: center; background: var(--hd-surface); border: 1px solid var(--hd-border); border-radius: 8px; padding: 6px 4px; }
.hd-counts > div { display: flex; align-items: baseline; gap: 4px; padding: 0 10px; font-variant-numeric: tabular-nums lining-nums; }
.hd-counts > div + div { border-left: 1px solid var(--hd-divider); }

.hd-banner { display: flex; align-items: center; gap: 12px; background: var(--hd-amber-bg); color: var(--hd-amber-text); border-radius: 8px; padding: 6px 16px; }
.hd-banner span { flex: 1 1 auto; }
.hd-amber-btn { background: var(--hd-amber); color: var(--hd-on-amber); border: 0; border-radius: 8px; padding: 4px 12px; font-family: inherit; font-size: .8125rem; font-weight: 500; line-height: 1.75; cursor: pointer; }
.hd-amber-btn:hover { filter: brightness(1.08); }
.hd-amber-btn:focus-visible { outline: 2px solid var(--hd-amber); outline-offset: 2px; }

/* ---- toolbar and chips ---- */
.hd-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--hd-surface); border: 1px solid var(--hd-border); border-radius: 8px; padding: 8px; }
.hd-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hd-chip { height: 32px; border-radius: 16px; border: 1px solid var(--hd-chip-border); background: var(--hd-surface); color: var(--hd-text); font-family: inherit; font-size: .8125rem; font-weight: 600; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.hd-chip:hover { background: var(--hd-press); }
.hd-chip:focus-visible { outline: 2px solid var(--hd-primary); outline-offset: 2px; }
/* Bug 2294 — Raleway's figures sat a pixel high in a 20px circle. Measured on screen at 100%, 125% and
   150%, a 21px circle with a 1 line-height and a 1px top pad leaves the same space above and below. */
.hd-chip-count { min-width: 21px; height: 21px; box-sizing: border-box; border-radius: 11px; background: var(--hd-neutral-bg); font-size: .75rem; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 1px 6px 0; font-variant-numeric: tabular-nums lining-nums; }
.hd-chip-on, .hd-chip-on:hover { background: var(--hd-primary); border-color: var(--hd-primary); color: var(--hd-on-primary); }
.hd-chip-on .hd-chip-count { background: var(--hd-on-primary); color: var(--hd-primary); }
.hd-chip-amber-on, .hd-chip-amber-on:hover { background: var(--hd-amber); border-color: var(--hd-amber); color: var(--hd-on-amber); }
.hd-chip-amber-on .hd-chip-count { background: var(--hd-on-amber); color: var(--hd-amber); }
.hd-chip-hot { border-color: var(--hd-amber); color: var(--hd-amber-text); }
.hd-chip-hot .hd-chip-count { background: var(--hd-amber); color: var(--hd-on-amber); }
.hd-chip-static { display: inline-block; border-radius: 12px; background: var(--hd-neutral-bg); padding: 1px 8px; font-size: .75rem; }
.hd-tag { display: inline-block; border-radius: 12px; border: 1px solid var(--hd-chip-border); padding: 0 8px; font-size: .75rem; }

/* ---- Sharing Access (PBI 2259): the chart's shades; every pairing is 4.5:1 or better ---- */
.hd-access { display: inline-flex; align-items: center; gap: 4px; border-radius: 12px; padding: 1px 8px; font-size: .75rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.hd-access-1 { background: hsl(196 54% 94%); color: hsl(196 54% 12%); border-color: hsl(196 54% 80%); }
.hd-access-2 { background: hsl(196 54% 72%); color: hsl(196 54% 12%); border-color: hsl(196 54% 72%); }
.hd-access-3 { background: hsl(196 54% 34%); color: #FFFFFF; border-color: hsl(196 54% 34%); }
.hd-access-4 { background: hsl(196 54% 20%); color: #FFFFFF; border-color: hsl(196 54% 20%); }
/* Dark: Team+ stays the lightest step, as an outline, instead of a bright pill. */
:root[data-theme="dark"] .hd-access-1 { background: transparent; color: hsl(196 54% 86%); border-color: hsl(196 54% 60%); }
:root[data-theme="dark"] .hd-access-3,
:root[data-theme="dark"] .hd-access-4 { border-color: hsl(196 54% 50%); }

/* ---- docs table ---- */
.hd-grid-wrap { position: relative; border: 1px solid var(--hd-border); border-radius: 8px; overflow-x: auto; background: var(--hd-surface); }
.hd-grid { width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.hd-grid th, .hd-grid td { padding: 4px 8px; height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; border-bottom: 1px solid var(--hd-grid-line); border-right: 1px solid var(--hd-grid-line); text-align: left; font-variant-numeric: tabular-nums lining-nums; }
.hd-grid th:last-child, .hd-grid td:last-child { border-right: 0; }
.hd-grid th { position: sticky; top: 0; background: var(--hd-surface); font-weight: 500; z-index: 2; }
.hd-grid tbody tr { cursor: pointer; }
.hd-grid tbody tr:nth-child(odd) td { background: var(--hd-stripe); }
.hd-grid tbody tr:nth-child(even) td { background: var(--hd-surface); }
.hd-grid tbody tr:hover td { background: var(--hd-hover); }
.hd-grid td .hd-status { margin: 0 0 0 6px; }
.hd-grid .hd-sticky { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--hd-grid-line); max-width: 340px; }
.hd-grid th.hd-sticky { z-index: 3; }
.hd-grid tbody tr.hd-flash td { animation: hd-flash 2.5s ease-out; }
@keyframes hd-flash { from { background: rgba(62,176,213,.45); } }
.hd-actions-col { width: 150px; }
.hd-row-actions { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.hd-num-col { width: 40px; }
.hd-comment-cell { max-width: 420px !important; }
.hd-sort-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.hd-sort-btn:focus-visible { outline: 2px solid var(--hd-primary); outline-offset: 2px; }
.hd-doc-link { color: var(--hd-primary); font-weight: 600; text-decoration: none; }
.hd-doc-link:hover { text-decoration: underline; }
.hd-doc-cell { display: table-cell; }
.hd-pin-chip { display: inline-flex; align-items: center; gap: 2px; height: 20px; border-radius: 10px; padding: 0 6px; font-size: .6875rem; font-weight: 600; margin-right: 6px; vertical-align: middle; }
.hd-pin-team { background: var(--hd-primary); color: var(--hd-on-primary); border: 1px solid var(--hd-primary); }
.hd-pin-me { background: var(--hd-surface); color: var(--hd-muted); border: 1px solid var(--hd-muted); }
.hd-open-count { font-weight: 600; color: var(--hd-error); }
.hd-resolved-count { font-weight: 600; color: var(--hd-secondary); }
.hd-grid-footer { display: flex; justify-content: flex-end; align-items: center; gap: 24px; height: 52px; padding: 0 12px; font-size: .875rem; }

/* ---- drop overlay ---- */
.hd-drop-overlay { display: none; position: absolute; inset: 8px; border: 2px dashed var(--hd-primary); border-radius: 8px; background: var(--hd-drop-bg); z-index: 20; align-items: center; justify-content: center; font-size: 1.125rem; font-weight: 600; color: var(--hd-text); pointer-events: none; }
.html-docs-dropping > .hd-drop-overlay { display: flex; }

/* ---- status chips ---- */
.hd-status { display: inline-block; border-radius: 12px; padding: 3px 10px; font-size: .75rem; font-weight: 500; line-height: 1.3; margin: 2px 4px 2px 0; }
.hd-status.hd-mini { font-size: .6875rem; padding: 1px 8px; }
.hd-status-amber { background: var(--hd-amber); color: var(--hd-on-amber); }
.hd-status-queued { border: 1px solid var(--hd-primary); color: var(--hd-primary); }
.hd-status-working { background: var(--hd-primary); color: var(--hd-on-primary); }
.hd-status-addressed { border: 1px solid var(--hd-success); color: var(--hd-success); }
.hd-status-wait { background: #FFC107; color: #0E1B21; }

/* ---- menus ---- */
.hd-menu-heading { font-size: .75rem; font-weight: 600; padding: 8px 16px 4px; color: var(--hd-text); }
.hd-menu-note { font-size: .75rem; color: var(--hd-secondary); padding: 4px 16px 8px; max-width: 260px; white-space: normal; }
.hd-menu-current .mud-menu-item-text { font-weight: 600; }

/* ---- doc page ---- */
.hd-doc-page.app-fixed-page { padding-bottom: 0; }
.hd-doc-header { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.hd-doc-row1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hd-doc-titles { flex: 1 1 320px; min-width: 0; }
.hd-doc-row2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* MudSelect's outer box grows by default, which left a dead gap after each field. */
.hd-doc-row2 .mud-select { flex: 0 0 auto; }
.hd-doc-row2 .mud-input-control { margin: 0; }
.hd-doc-row2 .mud-input { font-size: .875rem; }
.hd-select { width: 220px; flex: 0 0 220px; }
.hd-select.hd-access-select .mud-select-input { font-weight: 600; }
.hd-watch { display: inline-flex; align-items: center; gap: 6px; border-radius: 16px; padding: 4px 12px; font-size: .8125rem; background: var(--hd-neutral-bg); border: 1px solid transparent; }
.hd-watch-icon.mud-icon-root { font-size: 16px; }
.hd-watch-on { background: transparent; border-color: var(--hd-primary); color: var(--hd-primary); }
.hd-watch-off { background: #FFC107; color: #0E1B21; }
.hd-old-version { display: flex; align-items: center; gap: 12px; background: var(--hd-warn-bg); color: var(--hd-warn-text); border-radius: 8px; padding: 6px 16px; flex: 0 0 auto; }
.hd-old-version span { flex: 1 1 auto; }
.hd-old-version-btn.mud-button-root { color: var(--hd-warn-text); }

/* The doc and the comment panel fill what is left under the header, and each scrolls on its own.
   The stage leaves room at the bottom for the floating comment mode bar. */
.hd-shell { position: relative; }
.hd-doc-page .hd-shell:not(.fs) { flex: 1 1 auto; min-height: 0; }
.hd-body { display: flex; flex-wrap: nowrap; gap: 16px; align-items: stretch; height: 100%; }
.hd-stage { flex: 999 1 560px; min-width: 0; height: 100%; box-sizing: border-box; padding-bottom: 64px; }
.hd-frame { display: block; width: 100%; height: 100%; min-height: 320px; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.hd-side { flex: 1 1 340px; max-width: 460px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }

/* Narrow screens: app.css hands the scroll back to the document, so stack the panel under the doc. */
@media (max-width: 960px) {
    .hd-body { flex-wrap: wrap; height: auto; }
    .hd-stage { height: auto; padding-bottom: 16px; }
    .hd-frame { height: 70vh; min-height: 480px; }
    .hd-side { max-width: none; max-height: none; overflow: visible; }
    .hd-side .hd-whole-doc { position: static; }
}

/* Full screen (PBI 2257): only the doc, and the comment panel docked beside it, never over it. */
.hd-shell.fs { background: #EEF2F7; width: 100vw; height: 100vh; padding: 0; overflow: hidden; }
:root[data-theme="dark"] .hd-shell.fs { background: #0E1B21; }
.hd-shell.fs .hd-body { display: block; height: 100%; }
.hd-shell.fs .hd-stage { position: absolute; inset: 0; padding: 0; height: auto; }
.hd-shell.fs .hd-frame { height: 100vh; min-height: 0; border-radius: 0; box-shadow: none; }
.hd-shell.fs.panel-open .hd-stage { right: 412px; }
.hd-shell.fs .hd-side { position: fixed; top: 64px; right: 16px; width: 380px; max-width: 380px; max-height: calc(100vh - 88px); overflow-y: auto; z-index: 1400; box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12); }
.hd-fs-hint { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #616161; color: #fff; font-size: .8125rem; font-weight: 500; border-radius: 8px; padding: 6px 12px; z-index: 1500; animation: hd-fade 4s forwards; }
@keyframes hd-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.hd-fs-exit { position: fixed; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--hd-press); cursor: pointer; z-index: 1500; display: inline-flex; align-items: center; justify-content: center; color: var(--hd-text); }
.hd-fs-exit:focus-visible { outline: 2px solid var(--hd-primary); outline-offset: 2px; }
.hd-fs-toggle.mud-button-root { position: fixed; top: 14px; right: 64px; z-index: 1500; background: var(--hd-surface); color: var(--hd-primary); }

/* ---- comment mode bar (PBI 2260) ---- */
.hd-mode-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--hd-surface); border-radius: 20px; padding: 4px 4px 4px 12px; display: flex; align-items: center; gap: 8px; z-index: 1250; box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12); }
.hd-shell.fs .hd-mode-bar { z-index: 1475; }
.hd-mode-label { font-size: .75rem; font-weight: 600; color: var(--hd-muted); display: inline-flex; align-items: center; gap: 4px; }
.hd-segmented { display: inline-flex; border: 1px solid var(--hd-primary); border-radius: 16px; overflow: hidden; }
.hd-segmented button { border: 0; background: transparent; color: var(--hd-primary); font-family: inherit; font-size: .8125rem; font-weight: 600; padding: 3px 10px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; transition: background-color .12s ease; }
.hd-segmented button:hover { background: var(--hd-press); }
.hd-segmented button + button { border-left: 1px solid var(--hd-primary); }
.hd-segmented button.on, .hd-segmented button.on:hover { background: var(--hd-primary); color: var(--hd-on-primary); }
.hd-segmented button:focus-visible { outline: 2px solid var(--hd-primary); outline-offset: -3px; }
.hd-seg-icon.mud-icon-root { font-size: 16px; }

.hd-add-comment { position: fixed; z-index: 1300; }
.hd-popover { position: fixed; z-index: 1300; width: 320px; background: var(--hd-surface); border-radius: 8px; padding: 12px; box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12); }
.hd-shell.fs .hd-popover, .hd-shell.fs .hd-add-comment { z-index: 1500; }

/* ---- comment panel ---- */
.hd-panel { background: var(--hd-surface); border: 1px solid var(--hd-border); border-radius: 8px; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; font-size: .875rem; line-height: 1.5; }
.hd-panel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-card { border: 1px solid var(--hd-border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.hd-card.active { border-color: var(--hd-primary); background: #F5FBFD; }
:root[data-theme="dark"] .hd-card.active { background: #183440; }
.hd-card-head { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hd-card-head:focus-visible { outline: 2px solid var(--hd-primary); outline-offset: 2px; border-radius: 4px; }
.hd-card > .hd-status { align-self: flex-start; margin: 0; }
.hd-num-badge { width: 22px; height: 22px; border-radius: 11px 11px 11px 2px; background: var(--hd-primary); color: var(--hd-on-primary); font-size: .6875rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.hd-anchor-strip { background: var(--hd-anchor-bg); border-radius: 6px; font-size: .75rem; color: var(--hd-secondary); padding: 4px 8px; overflow-wrap: anywhere; }
.hd-card-body, .hd-comment-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.hd-deleted { font-style: italic; color: var(--hd-secondary); margin: 0; }
.hd-outdated { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hd-reply { margin-left: 8px; border-left: 2px solid var(--hd-divider); padding-left: 10px; }
.hd-reply-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hd-reply-actions { margin-left: auto; display: inline-flex; }
.hd-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
/* Optimistic updates. A resolved, reopened or deleted card folds away (height animates from auto where
   the browser supports interpolate-size, and simply fades where it doesn't); a new comment or reply
   fades in and stays dimmed while it is sending; one that failed keeps its text with Retry. */
.hd-card.hd-leaving { interpolate-size: allow-keywords; overflow: hidden; pointer-events: none; animation: hd-leave .22s ease-in forwards; }
@keyframes hd-leave {
    from { height: auto; opacity: 1; }
    to { height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-width: 0; margin-bottom: -8px; }
}
.hd-card.hd-sending, .hd-reply.hd-sending { animation: hd-enter .18s ease-out; opacity: .7; }
@keyframes hd-enter { from { opacity: 0; transform: translateY(4px); } }
.hd-card.hd-failed { border-color: var(--hd-error); }
.hd-failed-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--hd-error); font-size: .8125rem; }
.hd-failed-icon.mud-icon-root { font-size: 16px; }
.hd-grid tbody tr.hd-row-leaving td { animation: hd-fade-out .22s ease-in forwards; pointer-events: none; }
@keyframes hd-fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .hd-card.hd-leaving, .hd-card.hd-sending, .hd-reply.hd-sending, .hd-grid tbody tr.hd-row-leaving td { animation-duration: 1ms; }
}
/* MudButton's 64px minimum width stacked the small text actions; these are links in all but name. */
.hd-card-actions .mud-button-root, .hd-reply-actions .mud-button-root { min-width: 0; padding: 2px 6px; }
/* The whole-doc box stays in reach at the foot of the panel however many threads there are. */
.hd-whole-doc { position: sticky; bottom: 0; background: var(--hd-surface); border-top: 1px solid var(--hd-divider); padding: 12px 0 4px; margin-top: 4px; z-index: 1; }
.hd-mention { color: var(--hd-primary); font-weight: 600; }
.hd-comment-text a { color: var(--hd-primary); }
.hd-doc-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; border-radius: 11px; border: 1px solid var(--hd-primary); color: var(--hd-primary); background: transparent; font-family: inherit; font-size: .75rem; font-weight: 500; padding: 0 8px; cursor: pointer; vertical-align: middle; }
.hd-doc-chip:hover { background: var(--hd-press); }
.hd-doc-chip:focus-visible { outline: 2px solid var(--hd-primary); outline-offset: 2px; }

/* ---- composer and @ picker (PBI 2261) ---- */
.hd-composer { position: relative; display: flex; flex-direction: column; gap: 4px; }
.hd-composer-label { font-size: .75rem; color: var(--hd-muted); }
.hd-textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--hd-input-border); border-radius: 8px; padding: 8px; font: inherit; font-size: .875rem; color: var(--hd-text); background: var(--hd-surface); resize: vertical; }
.hd-textarea:focus { outline: 2px solid var(--hd-primary); outline-offset: 0; border-color: var(--hd-primary); }
.hd-composer-help { margin: 0; }
.hd-composer-actions { display: flex; justify-content: flex-end; gap: 4px; }
.hd-mention-list { list-style: none; margin: 0; padding: 4px 0; border: 1px solid var(--hd-border); border-radius: 8px; background: var(--hd-surface); max-height: 240px; overflow-y: auto; z-index: 5; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.hd-mention-option { display: flex; align-items: center; gap: 8px; padding: 4px 10px; cursor: pointer; }
.hd-mention-option.active, .hd-mention-option:hover { background: var(--hd-hover); }
.hd-mention-option-text { display: flex; flex-direction: column; }
.hd-mention-option-name { font-weight: 600; font-size: .875rem; }
.hd-avatar { width: 24px; height: 24px; border-radius: 50%; background: #2B7590; color: #fff; font-size: .75rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.hd-avatar-claude { background: #A24E1C; }

/* ---- Claude key dialog (PBI 2262) ---- */
.hd-key-intro { margin-top: 0; }
.hd-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--hd-divider); margin-bottom: 12px; }
.hd-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0; font-family: inherit; font-size: .875rem; font-weight: 500; color: var(--hd-text); cursor: pointer; }
.hd-tab:hover { color: var(--hd-primary); }
.hd-tab.on { color: var(--hd-primary); border-bottom-color: var(--hd-primary); }
.hd-key-once { background: var(--hd-info-bg); color: var(--hd-info-text); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.hd-key-secret-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.hd-key-secret { flex: 1 1 auto; background: var(--hd-surface); color: var(--hd-text); border: 1px solid var(--hd-border); border-radius: 6px; padding: 6px 8px; font-family: Consolas, monospace; overflow-wrap: anywhere; }
.hd-key-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; border: 1px solid var(--hd-border); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.hd-key-expiry { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.hd-key-expiry .mud-select { flex: 0 0 260px; }
.hd-key-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hd-key-safe { background: var(--hd-warn-bg); color: var(--hd-warn-text); border-radius: 8px; padding: 12px 16px; margin-top: 16px; }
.hd-key-safe ol { margin: 4px 0 0; padding-left: 20px; }
.hd-simple-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.hd-simple-table th, .hd-simple-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--hd-grid-line); }

/* ---- nav badge (PBI 2261) ---- */
.nav-title-with-badge { display: inline-flex; align-items: center; gap: 8px; }
.nav-waiting-badge { min-width: 20px; height: 20px; border-radius: 10px; background: #A14A0A; color: #FFFFFF; font-size: .75rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; font-variant-numeric: tabular-nums lining-nums; }
