/* QuickTools UI kit, core layer (hn.). QuickTools' own copy of the shared UI pieces, loaded after hn-tokens.css: icons,
   dialogs and the dark blurred smoke screen behind them, the wait card, the delete-confirmation dialog, notices, the photo preview,
   sortable and clickable tables, long-word handling and the accessibility helpers. Written against hn-tokens.css only: no hex
   colours except the constant backdrops below, no external font, no underline on hover or focus anywhere. Class prefix: hn-. */

:root {
  --hn-backdrop: rgb(4 5 7 / 78%);          /* behind dialogs: the smoke screen */
  --hn-wait-backdrop: rgb(10 12 15 / 58%);  /* behind the wait card */
  --hn-lightbox-backdrop: rgb(4 5 7 / 84%); /* behind a photo preview */
  --hn-dialog-shadow: 0 24px 64px rgb(0 0 0 / 55%);
  --hn-rule: 3px;                           /* the red rule on top of a card and the bar on a hovered row */
}

/* ---------------------------------------------------------------- Visual decision surfaces
   Opt-in components; no product data, fabricated trends or inline styles. Chart geometry is supplied by the product. */
.hn-insight-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; margin-block: 1rem; align-items: stretch; }
.hn-visual-panel { min-width: 0; margin: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.hn-visual-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-block-end: 1rem; }
.hn-visual-head h2, .hn-visual-head h3 { margin: 0; font-size: var(--fs-heading); color: var(--ink); }
.hn-visual-head p { margin-block: .35rem 0; color: var(--muted); font-size: var(--fs-meta); }
.hn-visual-caption { display: block; margin-block-start: 1rem; color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
.hn-chart-rows { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.hn-chart-row { display: grid; gap: .4rem; min-width: 0; }
.hn-chart-label { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; font-size: var(--fs-meta); color: var(--ink); }
.hn-chart-label strong { font-variant-numeric: tabular-nums; }
.hn-chart-bar { display: block; width: 100%; height: .75rem; overflow: visible; }
.hn-chart-track { fill: var(--neutral-bg); }
.hn-chart-fill { fill: var(--ink); animation: hn-chart-reveal .65s ease-out both; }
.hn-chart-fill.is-attention { fill: var(--danger); }
.hn-chart-zero { stroke: var(--field-line); stroke-width: 1; }
.hn-workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; padding: 0; list-style: none; counter-reset: hn-flow; }
.hn-workflow > li { position: relative; min-width: 0; counter-increment: hn-flow; }
.hn-workflow > li + li::before { content: ""; position: absolute; inset-inline-start: -.75rem; top: 1.7rem; width: .5rem; border-top: 2px solid var(--field-line); }
.hn-workflow-node { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; height: 100%; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.hn-workflow-node::before { content: counter(hn-flow, decimal-leading-zero); color: var(--muted); font-size: var(--fs-micro); font-weight: 700; font-variant-numeric: tabular-nums; }
.hn-workflow-node strong { color: var(--ink); font-size: var(--fs-body); }
.hn-workflow-node span { color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
a.hn-workflow-node:hover, a.hn-workflow-node:focus-visible { background: var(--tint-brand); color: var(--ink); box-shadow: inset var(--hn-rule) 0 var(--danger); }
.hn-workflow-node.is-complete { border-color: var(--success); }
.hn-workflow-node.is-complete::before { content: "\2713 " counter(hn-flow, decimal-leading-zero); color: var(--ink); }
.hn-priority-list { display: grid; margin: 0; padding: 0; list-style: none; }
.hn-priority-list > li + li { border-block-start: 1px solid var(--line); }
.hn-priority-link { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; min-height: 4.75rem; padding: .8rem .3rem; color: var(--ink); border-radius: var(--radius-sm); }
.hn-priority-link:hover, .hn-priority-link:focus-visible { background: var(--tint-brand); color: var(--ink); box-shadow: inset var(--hn-rule) 0 var(--danger); }
.hn-priority-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--tint); color: var(--ink); }
.hn-priority-link strong { display: block; font-size: var(--fs-body); }
.hn-priority-link small { display: block; margin-block-start: .3rem; font-size: var(--fs-meta); color: var(--muted); }
.hn-priority-count { padding: .4rem .6rem; border-radius: var(--radius-sm); background: var(--neutral-bg); color: var(--ink); font-size: var(--fs-meta); font-weight: 700; font-variant-numeric: tabular-nums; }
.hn-priority-link.is-attention .hn-priority-icon, .hn-priority-link.is-attention .hn-priority-count { background: var(--danger-bg); color: var(--danger); }
.hn-empty-visual { display: grid; grid-template-columns: minmax(5rem, 9rem) minmax(0, 1fr); gap: 1.5rem; align-items: center; padding: 1.5rem; border: 1px dashed var(--field-line); border-radius: var(--radius); background: var(--tint); color: var(--ink); }
.hn-empty-visual > svg { width: 100%; max-height: 8rem; }
.hn-empty-visual h2, .hn-empty-visual h3 { margin: 0 0 .5rem; color: var(--ink); font-size: var(--fs-heading); }
.hn-empty-visual p { margin: 0 0 1rem; color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
.hn-product-stage { min-width: 0; padding: 1.25rem; border: 1px solid var(--field-line); border-radius: var(--radius-lg); background: var(--tint); color: var(--ink); box-shadow: var(--shadow); }
.hn-product-stage .hn-visual-panel { border-radius: var(--radius); }
.hn-product-stage-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-block-end: 1rem; color: var(--muted); font-size: var(--fs-meta); }
.hn-progress { display: block; width: 100%; height: .65rem; appearance: none; border: 0; border-radius: var(--radius-pill); overflow: hidden; background: var(--neutral-bg); accent-color: var(--ink); }
.hn-progress::-webkit-progress-bar { background: var(--neutral-bg); }
.hn-progress::-webkit-progress-value { background: var(--ink); }
.hn-progress::-moz-progress-bar { background: var(--ink); }
.hn-progress:indeterminate { background: repeating-linear-gradient(110deg, var(--neutral-bg) 0 1rem, var(--ink) 1rem 2rem); background-size: 200% 100%; animation: hn-progress-running 1.6s linear infinite; }
.hn-progress:indeterminate::-webkit-progress-bar { background: transparent; }
.hn-notification-card { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.hn-notification-card h3 { margin: 0 0 .5rem; font-size: var(--fs-heading); color: var(--ink); }
.hn-notification-card p { margin: 0 0 .75rem; font-size: var(--fs-meta); line-height: 1.5; color: var(--muted); }
.hn-notification-card small { display: block; margin-block: .75rem 0; color: var(--muted); font-size: var(--fs-micro); }
.hn-notification-card .hn-priority-icon { background: var(--success-bg); color: var(--ink); }
.hn-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.hn-choice-grid > legend { margin-block-end: .75rem; color: var(--ink); font-size: var(--fs-body); font-weight: 700; }
.hn-choice-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .75rem; min-width: 0; min-height: 2.75rem; padding: 1rem; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.hn-choice-card input { flex: none; width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; accent-color: var(--brand); }
.hn-choice-card strong { display: block; color: var(--ink); font-size: var(--fs-body); }
.hn-choice-card small { display: block; margin-block-start: .35rem; color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
.hn-choice-card:hover { border-color: var(--accent); }
.hn-choice-card:has(input:checked) { border-color: var(--accent); background: var(--tint-brand); box-shadow: inset var(--hn-rule) 0 var(--brand); }
.hn-choice-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.hn-choice-card:has(input:disabled) { cursor: not-allowed; background: var(--tint); }
.hn-choice-card i { color: var(--accent); margin-inline-end: .5rem; }
.hn-usage-link { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; min-height: 2.75rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-meta); }
.hn-usage-link small { flex-basis: 100%; color: var(--muted); font-size: var(--fs-meta); }
.hn-usage-link:hover, .hn-usage-link:focus-visible { color: var(--ink); background: var(--tint-brand); box-shadow: inset var(--hn-rule) 0 var(--danger); }
@media (max-width: 767.98px) {
  .hn-insight-grid { grid-template-columns: minmax(0, 1fr); }
  .hn-workflow { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .hn-workflow > li + li::before { display: none; }
  .hn-workflow-node { gap: .4rem; }
  .hn-empty-visual { grid-template-columns: minmax(0, 1fr); }
  .hn-empty-visual > svg { max-width: 7rem; }
  .hn-visual-panel { padding: 1rem; }
}
@media (forced-colors: active) {
  .hn-chart-track { fill: Canvas; stroke: CanvasText; }
  .hn-chart-fill, .hn-chart-fill.is-attention { fill: CanvasText; }
  .hn-chart-zero { stroke: CanvasText; }
}

/* Shared notification fragment must fit product shells without depending on their reset. */
[data-hn-notifications], [data-hn-notifications] * { box-sizing: border-box; }
[data-hn-notifications] { overflow-wrap: anywhere; }
[data-hn-notifications] :is(section, form, fieldset, label, input, textarea, table) { min-inline-size: 0; max-inline-size: 100%; }
[data-hn-notifications] :is(header, h2, h3, p, fieldset, [data-preview-content], [data-campaigns] > article, [data-inbox] > article, [data-devices] > article) { margin-block-end: .85rem; }
[data-hn-notifications] :is([data-draft], [data-preview]) > label { margin-block-end: 1rem; }
[data-hn-notifications] > section + section { margin-block-start: 1rem; }
[data-hn-notifications] .button { min-height: 2.75rem; margin-inline-end: .35rem; margin-block: .25rem; white-space: normal; }
[data-hn-notifications] .hn-workflow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
[data-hn-notifications] .hn-notification-card > div { min-width: 0; }
[data-hn-notifications] .hn-notification-card > i { display: grid; place-items: center; align-self: start; width: 2.75rem; height: 2.75rem; border-radius: var(--radius); background: var(--tint-brand); color: var(--accent); }
[data-hn-notifications] table { width: 100%; table-layout: fixed; }
[data-hn-notifications] :is(th, td) { padding: .5rem; text-align: start; overflow-wrap: anywhere; }
[data-hn-notifications] td { width: 5rem; font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
  [data-hn-notifications] .hn-workflow { grid-template-columns: minmax(0, 1fr); }
  [data-hn-notifications] .hn-notification-card { grid-template-columns: 2rem minmax(0, 1fr); gap: .65rem; padding: .85rem; }
  [data-hn-notifications] .hn-notification-card > i { width: 2rem; height: 2rem; }
}

/* ---------------------------------------------------------------- Icons (Font Awesome 6 Free, self-hosted) */
.hn-ico { flex: 0 0 auto; margin-inline-end: .5em; }
:is(.button, .btn, .hn-btn, a.button)>.hn-ico { margin-inline-end: 0; }
:is(.button, .btn, .hn-btn)>.hn-ico:only-child { margin: 0; }
:is(h1, h2, h3, h4, dt, .panel-head, .card-title, .section-head h2, .record-subhead)>i.fa-solid:first-child { margin-inline-end: .5em; }
.hn-ico-accent { color: var(--accent); }

/* ---------------------------------------------------------------- Accessibility helpers */
.visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.skip-link, .skip-links a { position: fixed; top: -100px; left: 12px; z-index: 3000; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font-weight: 700; }
.skip-link:focus, .skip-links a:focus { top: 12px; color: var(--on-brand); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:where(input:not([type=checkbox], [type=radio]), select, textarea):focus-visible { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--accent) 25%, transparent); }
@media (forced-colors: active) { :focus-visible { outline: 3px solid Highlight; } }

/* ---------------------------------------------------------------- No underline on hover or focus: a colour change shows it */
a:hover, a:focus, a:focus-visible, a:active, button:hover, summary:hover, [role=button]:hover { text-decoration: none; }

/* ---------------------------------------------------------------- Dialogs and the smoke screen behind them */
dialog { overscroll-behavior: contain; }
html:has(dialog[open]), html.hn-locked { overflow: hidden; }
dialog.hn-dialog, dialog.app-dialog, dialog.record-dialog {
  width: min(34rem, calc(100vw - 32px)); max-height: 88dvh; padding: 0; border: 1px solid color-mix(in srgb, var(--line) 60%, var(--ink) 40%);
  border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--hn-dialog-shadow);
}
dialog.hn-dialog.is-wide { width: min(52rem, calc(100vw - 32px)); }
dialog.hn-dialog::backdrop, dialog.app-dialog::backdrop, dialog.record-dialog::backdrop, dialog.hn-lightbox::backdrop {
  background: var(--hn-backdrop); backdrop-filter: blur(5px) saturate(70%); -webkit-backdrop-filter: blur(5px) saturate(70%);
}
dialog.hn-lightbox::backdrop { background: var(--hn-lightbox-backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.hn-dialog[open], dialog.app-dialog[open], dialog.record-dialog[open] { display: flex; flex-direction: column; overflow: hidden; animation: hn-dialog-in .18s ease-out; }
dialog.hn-dialog[open]::backdrop, dialog.app-dialog[open]::backdrop, dialog.record-dialog[open]::backdrop { animation: hn-backdrop-in .18s ease-out; }
@keyframes hn-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes hn-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
dialog.hn-dialog>header, dialog.app-dialog>header, dialog.record-dialog>header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--tint); max-height: 44dvh; overflow-y: auto; overflow-wrap: anywhere; }
dialog.hn-dialog>header h2, dialog.app-dialog>header h2, dialog.record-dialog>header h2 { margin: 0; font-size: var(--fs-heading); }
dialog.hn-dialog>.hn-dialog__body, dialog.record-dialog>.record-dialog__body { padding: 1rem 1.2rem; overflow: auto; overflow-wrap: anywhere; min-height: 0; }
dialog.hn-dialog>form:only-child { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
dialog.hn-dialog>footer, dialog.app-dialog>footer, dialog.record-dialog>footer, dialog.hn-dialog form>footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; padding: .8rem 1.2rem; border-top: 1px solid var(--line); }
.hn-dialog__close, dialog>header>button[data-dialog-close], dialog>header>.btn-close { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; font-size: var(--fs-body); line-height: 1; }
.hn-dialog__close:hover, dialog>header>button[data-dialog-close]:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 599.98px) { dialog.hn-dialog, dialog.app-dialog, dialog.record-dialog { width: calc(100vw - 20px); } .hn-dialog__close { width: 2.75rem; height: 2.75rem; } }
@media (prefers-reduced-motion: reduce) { dialog.hn-dialog[open], dialog.hn-dialog[open]::backdrop, dialog.record-dialog[open], dialog.record-dialog[open]::backdrop { animation: none; } }

/* Bootstrap modals get the same smoke screen. */
.modal-backdrop { --bs-backdrop-bg: #040507; background: var(--hn-backdrop) !important; opacity: 1 !important; backdrop-filter: blur(5px) saturate(70%); }
.modal-content { border-radius: var(--radius-dialog); border: 1px solid color-mix(in srgb, var(--line) 60%, var(--ink) 40%); box-shadow: var(--hn-dialog-shadow); }

/* ---------------------------------------------------------------- Confirmation dialog (deletions and other consequential actions) */
dialog.hn-confirm { width: min(28rem, calc(100vw - 32px)); }
dialog.hn-confirm .hn-dialog__body p { margin: 0; color: var(--ink); font-size: var(--fs-body); line-height: 1.5; overflow-wrap: anywhere; }
dialog.hn-confirm[data-tone="danger"]>header { background: var(--danger-bg); }
dialog.hn-confirm[data-tone="danger"]>header h2 { color: var(--danger); }
dialog.hn-confirm [data-confirm-accept].is-danger { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
dialog.hn-confirm [data-confirm-accept].is-danger:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* ---------------------------------------------------------------- Wait card: the smoke screen shown while the user waits */
.hn-wait[hidden] { display: none; }
.hn-wait { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 1rem; background: var(--hn-wait-backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hn-wait::backdrop { background: transparent; }
.hn-wait__card { display: flex; align-items: center; gap: 1rem; width: min(28rem, 92vw); padding: 1.2rem 1.3rem; border: 1px solid #454c55; border-left: 4px solid var(--brand); border-radius: var(--radius-dialog); background: var(--panel); color: var(--panel-ink); box-shadow: 0 1rem 3rem rgb(0 0 0 / 32%); }
.hn-wait__spinner { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border: 3px solid var(--panel-muted); border-top-color: var(--logo-dot); border-radius: 50%; animation: hn-spin .75s linear infinite; }
.hn-wait__text { flex: 1; min-width: 0; }
.hn-wait__text strong, .hn-wait__text small { display: block; }
.hn-wait__text strong { font-size: var(--fs-body); font-weight: 700; color: #fff; }
.hn-wait__text small { margin-top: .4rem; color: var(--panel-muted); font-size: var(--fs-meta); line-height: 1.5; }
.hn-wait__text small:empty { display: none; }
.hn-wait__progress { display: block; width: 100%; height: .5rem; margin-block: 1rem .4rem; appearance: none; border: 0; border-radius: var(--radius-pill); overflow: hidden; background: var(--panel-muted); accent-color: var(--logo-dot); }
.hn-wait__progress::-webkit-progress-bar { background: var(--panel-muted); }
.hn-wait__progress::-webkit-progress-value { background: var(--logo-dot); }
.hn-wait__progress::-moz-progress-bar { background: var(--logo-dot); }
.hn-wait__progress:indeterminate { background: repeating-linear-gradient(110deg, var(--panel-muted) 0 1rem, var(--logo-dot) 1rem 2rem); background-size: 200% 100%; animation: hn-progress-running 1.6s linear infinite; }
.hn-wait__progress:indeterminate::-webkit-progress-bar { background: transparent; }
.hn-wait__measure { display: block; color: var(--panel-ink); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.hn-wait__measure[hidden] { display: none; }
.hn-wait__hide { display: none; min-height: 2.75rem; margin-top: .7rem; padding: .3rem .8rem; border: 1px solid var(--panel-muted); border-radius: var(--radius-sm); background: transparent; color: var(--panel-ink); font: inherit; font-size: var(--fs-meta); font-weight: 600; cursor: pointer; }
.hn-wait__hide:hover, .hn-wait__hide:focus-visible { border-color: #ff7378; color: #fff; }
.hn-wait.is-download .hn-wait__hide, .hn-wait.is-long .hn-wait__hide { display: inline-flex; }
@keyframes hn-spin { to { transform: rotate(360deg); } }
@keyframes hn-progress-running { to { background-position: -200% 0; } }
@keyframes hn-chart-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@media (prefers-reduced-motion: reduce) { .hn-wait__spinner, .hn-wait__progress:indeterminate, .hn-progress:indeterminate, .hn-chart-fill { animation: none; } }
/* A form that is being sent cannot be sent twice. */
form[aria-busy="true"] :is(button[type=submit], input[type=submit], .button[type=submit]) { pointer-events: none; opacity: .7; }

/* ---------------------------------------------------------------- Notices: the server's result as a centred dialog with an animated icon */
.hn-notice-host[hidden] { display: none; }
.hn-notice-host { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 1rem; background: var(--hn-wait-backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hn-notice { position: relative; display: grid; justify-items: center; gap: .6rem; width: min(26rem, 92vw); max-height: 88dvh; overflow: auto; padding: 1.8rem 1.5rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); text-align: center; box-shadow: var(--hn-dialog-shadow); animation: hn-dialog-in .2s ease-out; }
.hn-notice__icon { display: grid; place-items: center; width: 4rem; height: 4rem; border: .25rem solid currentColor; border-radius: 50%; font-size: 1.6rem; animation: hn-pop .35s ease-out; }
.hn-notice[data-tone="success"] .hn-notice__icon { color: var(--success); }
.hn-notice[data-tone="error"] .hn-notice__icon { color: var(--danger); }
.hn-notice[data-tone="warning"] .hn-notice__icon { color: var(--warning); }
.hn-notice[data-tone="info"] .hn-notice__icon { color: var(--info); }
.hn-notice__title { margin: 0; font-size: var(--fs-heading); font-weight: 700; }
.hn-notice__text { margin: 0; color: var(--muted); font-size: var(--fs-body); line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.hn-notice__list { margin: .2rem 0 0; padding-left: 1.2rem; text-align: left; font-size: var(--fs-body); line-height: 1.45; }
.hn-notice__list li+li { margin-top: .35rem; }
.hn-notice__ok { margin-top: .5rem; min-width: 6rem; }
.hn-notice__close { position: absolute; top: .6rem; right: .6rem; display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; font-size: var(--fs-body); }
.hn-notice__close:hover, .hn-notice__close:focus-visible { color: var(--accent); }
.hn-notice__timer { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; border-radius: 0 0 var(--radius-dialog) var(--radius-dialog); background: var(--brand); transform-origin: left; animation: hn-timer linear forwards; }
@keyframes hn-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes hn-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .hn-notice, .hn-notice__icon { animation: none; } .hn-notice__timer { display: none; } }
/* The in-page copy of a flash message stays as the no-script fallback and is hidden once the script shows it as a notice. */
[data-flash].hn-flash-shown { display: none !important; }

/* ---------------------------------------------------------------- Photo preview (a modal over the smoke screen, never a new tab) */
dialog.hn-lightbox { width: min(72rem, calc(100vw - 48px)); max-width: none; max-height: 92dvh; padding: 0; border: 0; border-radius: var(--radius-dialog); background: transparent; color: #fff; overflow: visible; }
dialog.hn-lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .6rem; }
.hn-lightbox__stage { display: grid; place-items: center; min-height: 0; }
.hn-lightbox__img { max-width: 100%; max-height: calc(92dvh - 5rem); border-radius: var(--radius); box-shadow: var(--hn-dialog-shadow); background: #fff; object-fit: contain; }
.hn-lightbox__bar { display: flex; align-items: center; justify-content: center; gap: 1rem; font-size: var(--fs-meta); color: #e9ecef; text-align: center; }
.hn-lightbox__btn { position: absolute; top: 50%; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid rgb(255 255 255 / 30%); border-radius: var(--radius-pill); background: rgb(24 25 27 / 80%); color: #fff; cursor: pointer; font-size: 1.1rem; transform: translateY(-50%); }
.hn-lightbox__btn:hover, .hn-lightbox__btn:focus-visible { border-color: #ff7378; color: #ff7378; }
.hn-lightbox__btn[data-dir="-1"] { left: -1.4rem; } .hn-lightbox__btn[data-dir="1"] { right: -1.4rem; }
.hn-lightbox__close { position: absolute; top: -1.2rem; right: -1.2rem; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid rgb(255 255 255 / 30%); border-radius: var(--radius-pill); background: rgb(24 25 27 / 85%); color: #fff; cursor: pointer; }
.hn-lightbox__close:hover, .hn-lightbox__close:focus-visible { border-color: #ff7378; color: #ff7378; }
[data-lightbox], [data-image-preview] { cursor: zoom-in; }
@media (max-width: 599.98px) { dialog.hn-lightbox { width: 100vw; max-height: 100dvh; } .hn-lightbox__btn[data-dir="-1"] { left: .4rem; } .hn-lightbox__btn[data-dir="1"] { right: .4rem; } .hn-lightbox__close { top: .4rem; right: .4rem; } }

/* ---------------------------------------------------------------- Tables: sortable headings, clickable rows, stacked cards */
.hn-sort { display: inline-flex; align-items: center; gap: .4em; max-width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; text-align: inherit; }
.hn-sort::after { content: "\f0dc"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .8em; opacity: .35; }
th[aria-sort="ascending"] .hn-sort::after { content: "\f0de"; opacity: 1; color: var(--accent); }
th[aria-sort="descending"] .hn-sort::after { content: "\f0dd"; opacity: 1; color: var(--accent); }
.hn-sort:hover, .hn-sort:focus-visible { color: var(--accent); }

/* A row is clickable: the light red shade of the brand with a bar at the far left; nothing is ever underlined. */
:where(table.hn-rows, .table, .table-wrap table, table.hn-clickable) > tbody > tr:is(:hover, [data-dialog-open]:focus-visible, tr.is-clickable:focus-visible) > * { box-shadow: inset 0 0 0 9999px var(--tint-brand); }
:where(table.hn-rows, .table, .table-wrap table, table.hn-clickable) > tbody > tr:is(:hover, [data-dialog-open]:focus-visible, tr.is-clickable:focus-visible) > :first-child { box-shadow: inset var(--hn-rule) 0 0 var(--danger), inset 0 0 0 9999px var(--tint-brand); }
tr.is-clickable, tr[data-dialog-open], [data-dialog-open] { cursor: pointer; }
tr.is-clickable:hover :is(a:not(.button, .btn), .hn-row-title), tr[data-dialog-open]:hover .hn-row-title { color: var(--accent); }
tr.is-clickable:focus-visible { outline: 0; }
:is(.hn-row-link, .news-item.is-clickable, .record-card.is-clickable, li.is-clickable, article.is-clickable):is(:hover, :focus-within) { background: var(--tint-brand); box-shadow: inset var(--hn-rule) 0 0 var(--danger); }
.hn-row-link { position: relative; cursor: pointer; }
.hn-stretch-link::after { content: ""; position: absolute; inset: 0; }
tr.is-clickable :is(button, form, .button, .btn, input, select, textarea, label, .hn-actions) { position: relative; z-index: 2; }

/* Tables never scroll the page sideways: a table too wide for its container stacks into labelled rows. */
.table-wrap, .table-responsive, .card-body:has(> table.is-stackable) { container-type: inline-size; }
/* A positioned ancestor keeps visually hidden text inside a scrolling table from widening the page. */
.table-wrap, .table-scroll, .table-responsive { position: relative; }
table.is-tight :is(th, td) { white-space: normal !important; min-width: 0 !important; overflow-wrap: break-word; }
@container (max-width: 36rem) {
  table.is-stackable, table.is-stackable tbody, table.is-stackable tr, table.is-stackable td { display: block; width: 100%; }
  table.is-stackable { min-width: 0 !important; }
  table.is-stackable thead { display: none; }
  table.is-stackable tr { padding: .55rem .85rem; border-bottom: 1px solid var(--line); }
  table.is-stackable tbody tr:last-child { border-bottom: 0; }
  table.is-stackable td { padding: .3rem 0 !important; border: 0 !important; background: transparent !important; overflow-wrap: anywhere; box-shadow: none !important; }
  table.is-stackable td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; margin-bottom: .1rem; color: var(--muted); font-size: var(--fs-micro); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  table.is-stackable td .badge { width: auto; max-width: 100%; }
}
table.is-stacked thead { display: none; }
table.is-stacked, table.is-stacked tbody { display: block; width: 100%; }
table.is-stacked tr { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
table.is-stacked td { display: block; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; overflow-wrap: anywhere; }
table.is-stacked td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; color: var(--muted); font-size: var(--fs-micro); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
table.is-stacked tr:is(:hover, :focus-within) { background: var(--tint-brand); box-shadow: inset var(--hn-rule) 0 0 var(--danger); }
table.is-stacked td .badge { width: auto; max-width: 100%; }
td.hn-select, th.hn-select { width: 2.4rem; }

/* ---------------------------------------------------------------- Long words and one-line truncation */
.hn-long-word { overflow-wrap: anywhere; word-break: normal; }
:where(.badge, .chip, .pill, .nav-link, .breadcrumb, .tabs a) { max-width: 100%; }
.hn-clip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Counts beside a heading or a name: a number in an outlined circle */
.module-count, .hn-count { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 1.95em; height: 1.95em; padding: 0 .5em; margin-inline-start: .3em; border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent); border-radius: var(--radius-pill); background: transparent; color: var(--muted); font-size: var(--fs-micro); font-weight: 700; line-height: 1; vertical-align: .12em; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Pictures: person pictures are rounded squares, never circles */
.hn-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-weight: 700; object-fit: cover; overflow: hidden; }
.hn-avatar.is-sm { width: 2rem; height: 2rem; border-radius: 6px; font-size: var(--fs-meta); }
.hn-avatar.is-lg { width: 4.75rem; height: 4.75rem; border-radius: 12px; font-size: var(--fs-number); }
.hn-avatar.is-xl { width: 8rem; height: 8rem; border-radius: 16px; font-size: var(--fs-jumbo); }

/* ---------------------------------------------------------------- Dropdown lists follow the theme; customisable selects get a branded list */
select { color-scheme: inherit; }
@supports (appearance: base-select) {
  select, select::picker(select) { appearance: base-select; }
  select { display: inline-flex; align-items: center; justify-content: space-between; gap: .5rem; }
  select::picker-icon { margin-inline-start: auto; color: var(--muted); transition: rotate .2s; }
  select:open::picker-icon { rotate: 180deg; }
  select::picker(select) { padding: .35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
  select option { padding: .5rem .7rem; border-radius: var(--radius-xs); }
  select option:hover { background: var(--tint); }
  select option:checked { background: var(--tint-brand); color: var(--accent); font-weight: 650; }
  select option::checkmark { color: var(--accent); }
}

/* ---------------------------------------------------------------- Tick boxes are one size and one colour */
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
table input[type=checkbox] { width: 1.1rem; height: 1.1rem; vertical-align: middle; }
@media (pointer: coarse) { table input[type=checkbox] { width: 1.5rem; height: 1.5rem; } }

/* ---------------------------------------------------------------- Password peek: one Show/Hide control inside each password field */
.hn-password { position: relative; display: block; width: 100%; }
.input-group > .hn-password { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .hn-password > input { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group > .hn-password:first-child:last-child > input { border-radius: var(--radius-sm); }
.hn-password > input { width: 100%; box-sizing: border-box; padding-inline-end: 3rem; }
.hn-password > input::-ms-reveal, .hn-password > input::-ms-clear { display: none; }
.hn-peek { position: absolute; inset-block: 0; inset-inline-end: .2rem; display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; margin: auto 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.hn-peek:hover { color: var(--ink); background: var(--tint); }
.hn-peek[aria-pressed="true"] { color: var(--accent); }
.hn-peek:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
@media (pointer: coarse) { .hn-peek { width: 2.75rem; min-height: 2.75rem; } .hn-password > input { padding-inline-end: 3.1rem; } }
input[autocomplete="one-time-code"] { font-variant-numeric: tabular-nums; letter-spacing: .12em; }

/* ---------------------------------------------------------------- Resend availability: data-hn-available-in (HnUi.fields) */
.hn-available-label { font-variant-numeric: tabular-nums; }
[data-hn-available-in].is-waiting, [data-hn-available-in][aria-disabled="true"] { cursor: not-allowed; }
a[data-hn-available-in][aria-disabled="true"] { color: var(--muted); }

/* ---------------------------------------------------------------- Phones: fields are 16 px so iOS Safari never zooms the page, and nothing locks scrolling */
@media (max-width: 991.98px) {
  input:not([type=checkbox], [type=radio], [type=range], [type=file], [type=color], [type=hidden], [type=image]), select, textarea { font-size: var(--fs-body); }
}

/* ---------------------------------------------------------------- Logo: the ink lockup on light surfaces, the white lockup on dark ones.
   Render both images and let the theme choose; the file is swapped, a CSS filter is never applied to a logo. */
img.hn-logo-dark { display: none; }
[data-theme="dark"] img.hn-logo-light, [data-bs-theme="dark"] img.hn-logo-light { display: none; }
[data-theme="dark"] img.hn-logo-dark, [data-bs-theme="dark"] img.hn-logo-dark { display: block; }
@media (prefers-color-scheme: dark) { [data-theme="system"] img.hn-logo-light { display: none; } [data-theme="system"] img.hn-logo-dark { display: block; } }

/* Page footer. A page or a layout's main column is a full-height column (.hn-page): a short page
   keeps the footer at the bottom of the viewport, a long page lets it follow the content to the end. Never fixed or sticky. */
.hn-page { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; }
.hn-page > .hn-footer { margin-top: auto; }
.hn-footer { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1.5rem; min-width: 0; margin-top: auto; padding: .5rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-meta); line-height: 1.5; }
.hn-footer__line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .75rem; margin: 0; }
.hn-footer__nav { min-width: 0; }
.hn-footer__links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; padding: 0; list-style: none; }
.hn-footer__links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.hn-footer__links a:hover { color: var(--accent-hover); text-decoration: none; }
.hn-footer__links a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
@media (max-width: 575.98px) { .hn-footer { padding-inline: 1rem; justify-content: flex-start; } }
