/* Herbie Hub shell: home, reports, products, login and logout. Scoped to .hub-page.
   Colours, type and radii come from console.tokens.css (--hc-*); every token carries its light value as a
   fallback so the page still reads if the tokens are missing. Components come from console.css (hc- classes);
   the top navigation comes from hub-nav.css (shared with every console page). This file owns the rest of the
   shell: breadcrumb bar, page header, card grids, record list, login card. Element resets use :where() so they
   never outrank hc- classes. No external assets. */
.hub-page { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--hc-bg, #f7f9fa); color: var(--hc-fg, #1a2735); font: 400 14px/1.5 var(--hc-font-sans, "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.hub-page *, .hub-page *::before, .hub-page *::after { box-sizing: border-box; }
.hub-page [hidden] { display: none !important; }
:where(.hub-page) a { color: var(--hc-primary, #0273bc); text-decoration: none; }
:where(.hub-page) a:hover { text-decoration: underline; text-underline-offset: 3px; }
:where(.hub-page) :is(button, input) { font: inherit; }
:where(.hub-page) button { cursor: pointer; }
:where(.hub-page) :is(a, button, input) { -webkit-tap-highlight-color: transparent; }
:where(.hub-page) :is(p, h1, h2, h3, ul) { margin: 0; }
:where(.hub-page) :is(h1, h2, h3) { font-weight: 600; line-height: 1.2; text-wrap: balance; }
:where(.hub-page) img { display: block; max-width: 100%; }
:where(.hub-page) svg { display: block; }
.hub-page :is(a, button, [tabindex]):focus-visible { outline: 3px solid var(--hc-ring, #0273bc); outline-offset: 2px; }
.hub-page .hc-check input:focus-visible { outline: 3px solid var(--hc-ring, #0273bc); outline-offset: 2px; }
.hub-page .hub-main:focus-visible, .hub-page .hub-login-shell:focus-visible { outline: none; box-shadow: none; }
.hub-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.hub-page .hub-skip { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 8px 14px; border: 1px solid var(--hc-border-strong, #b8c6d3); border-radius: var(--hc-radius, 6px); background: var(--hc-surface, #fff); color: var(--hc-fg, #1a2735); font-weight: 500; box-shadow: var(--hc-shadow-md, 0 4px 16px rgba(15,26,34,.10)); transform: translateY(-200%); }
.hub-page .hub-skip:focus { transform: none; }
.hub-page .hub-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hub-page .hub-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Shell: the top navigation (hub-nav.css) sits above a slim breadcrumb bar, then the content. */
.hub-page .hub-brand { display: flex; align-items: center; gap: 10px; width: fit-content; padding: 4px 8px; border-radius: var(--hc-radius, 6px); }
.hub-page .hub-brand img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.hub-page .hub-brand-text { display: flex; flex-direction: column; min-width: 0; }
.hub-page .hub-brand-word { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.hub-page .hub-brand-sub { display: block; margin-top: 4px; font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--hc-sidebar-muted, #9fb3c0); }
.hub-page .hub-crumbbar { display: flex; align-items: center; min-height: 44px; padding: 0 clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--hc-border, #d9e1e8); background: var(--hc-surface, #fff); }
.hub-page .hub-breadcrumb { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 1280px; margin-inline: auto; min-width: 0; flex-wrap: wrap; font-size: 13px; color: var(--hc-fg-3, #5f7389); }
.hub-page .hub-breadcrumb a { display: inline-flex; align-items: center; min-height: 36px; color: var(--hc-fg-3, #5f7389); }
.hub-page .hub-breadcrumb a:hover { color: var(--hc-fg, #1a2735); text-decoration: none; }
.hub-page .hub-crumb-current { color: var(--hc-fg, #1a2735); font-weight: 500; }

/* Content: max 1280px, page header, sections 32px apart. */
.hub-page .hub-main { width: 100%; max-width: 1280px; margin-inline: auto; padding: clamp(28px, 4vw, 44px) clamp(16px, 3vw, 40px) 28px; outline: none; }
.hub-page .hub-page-heading { display: flex; flex-direction: column; gap: 8px; max-width: 72ch; margin-bottom: 32px; }
.hub-page .hub-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hc-fg-3, #5f7389); }
.hub-page .hub-page-heading h1 { font-size: clamp(28px, 1.6vw + 20px, 36px); line-height: 1.15; letter-spacing: -0.02em; }
.hub-page .hub-lede { max-width: 62ch; font-size: 14.5px; line-height: 1.55; color: var(--hc-fg-2, #4a6078); }
.hub-page .hub-section { margin-bottom: 32px; scroll-margin-top: 72px; }
.hub-page .hub-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hub-page .hub-section-heading h2 { font-size: 22px; line-height: 1.25; letter-spacing: -0.012em; }
.hub-page .hub-section-heading p { font-size: 13px; line-height: 1.45; color: var(--hc-fg-3, #5f7389); text-align: right; }

/* Cards: one recipe, radius 8, 1px border, hover border plus a small shadow. */
.hub-page .hub-tool-grid, .hub-page .hub-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hub-page .hub-doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hub-page .hub-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px; background: var(--hc-surface, #fff); border: 1px solid var(--hc-border, #d9e1e8); border-radius: var(--hc-radius-md, 8px); color: inherit; transition: border-color .12s, box-shadow .12s; }
.hub-page .hub-card:hover { border-color: var(--hc-border-strong, #b8c6d3); box-shadow: var(--hc-shadow-sm, 0 1px 2px rgba(15,26,34,.06)); text-decoration: none; }
.hub-page .hub-card-kind { margin-bottom: 10px; }
.hub-page .hub-card h3 { font-size: 17px; line-height: 1.3; margin-bottom: 6px; color: var(--hc-fg, #1a2735); }
.hub-page .hub-card p { font-size: 13.5px; line-height: 1.55; color: var(--hc-fg-2, #4a6078); }
.hub-page .hub-card-action { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 14px; font-size: 13px; font-weight: 500; color: var(--hc-primary, #0273bc); }
.hub-page .hub-card:hover .hub-card-action { text-decoration: underline; text-underline-offset: 3px; }
.hub-page .hub-arrow { position: absolute; top: 16px; right: 16px; color: var(--hc-fg-3, #5f7389); }
.hub-page .hub-tool-card { padding: 24px; }
.hub-page .hub-tool-card h3 { font-size: 20px; letter-spacing: -0.01em; }
.hub-page .hub-card-badge { vertical-align: middle; margin-left: 8px; font-size: 12px; font-weight: 500; letter-spacing: 0; white-space: normal; height: auto; min-height: 22px; padding-block: 3px; line-height: 1.2; }
.hub-page .hub-tool-card p { max-width: 52ch; }
.hub-page .hub-report-card { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hub-page .hub-report-card .hub-arrow { position: static; margin-top: 2px; }
.hub-page .hub-report-body { display: flex; flex-direction: column; min-width: 0; }
.hub-page .hub-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--hc-border, #d9e1e8); font-size: 12px; line-height: 1.4; color: var(--hc-fg-3, #5f7389); }
.hub-page .hub-footer > span { font-weight: 500; white-space: nowrap; }
.hub-page .hub-footer p { max-width: 46ch; text-align: right; text-wrap: balance; }

/* Notices mirror .hc-notice so login and logout read even without console.css. */
.hub-page .hub-notice { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border: 1px solid var(--hc-border, #d9e1e8); border-radius: var(--hc-radius-md, 8px); background: var(--hc-surface, #fff); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.hub-page .hub-notice .hub-ico { width: 18px; height: 18px; margin-top: 1px; }
.hub-page .hub-notice b { display: block; margin-bottom: 2px; font-weight: 600; }
.hub-page .hub-notice.info { background: var(--hc-info-soft, #e6f2fb); border-color: var(--hc-info, #0273bc); color: var(--hc-info-fg, #025f9b); }
.hub-page .hub-notice.danger { background: var(--hc-danger-soft, #fde8eb); border-color: var(--hc-danger, #be1c2e); color: var(--hc-danger-fg, #a5192a); }
.hub-page .hub-notice a { color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* Reports page. */
.hub-page .hub-reading-note { max-width: 72ch; margin-bottom: 32px; }
.hub-page .hub-record-list { list-style: none; margin: 0; padding: 0; overflow: hidden; background: var(--hc-surface, #fff); border: 1px solid var(--hc-border, #d9e1e8); border-radius: var(--hc-radius-md, 8px); }
.hub-page .hub-record-list li + li { border-top: 1px solid var(--hc-border, #d9e1e8); }
.hub-page .hub-record-link { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 18px; color: inherit; overflow-wrap: anywhere; }
.hub-page .hub-record-link:hover { background: var(--hc-surface-2, #eff3f6); text-decoration: none; }
.hub-page .hub-record-link h3 { margin-bottom: 4px; font-size: 15px; line-height: 1.35; }
.hub-page .hub-record-link p { max-width: 72ch; font-size: 13px; line-height: 1.5; color: var(--hc-fg-2, #4a6078); }
.hub-page .hub-record-badge { margin-top: 8px; }
.hub-page .hub-record-open {display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 500; color: var(--hc-primary, #0273bc); }
.hub-page .hub-record-link:hover .hub-record-open { text-decoration: underline; text-underline-offset: 3px; }
.hub-page .hub-empty { padding: 28px 20px; text-align: center; border: 1px dashed var(--hc-border-strong, #b8c6d3); border-radius: var(--hc-radius-md, 8px); background: transparent; color: var(--hc-fg-2, #4a6078); }
.hub-page .hub-empty h3 { margin-bottom: 4px; font-size: 15px; line-height: 1.35; color: var(--hc-fg, #1a2735); }
.hub-page .hub-empty p { max-width: 48ch; margin: 0 auto 14px; font-size: 13px; line-height: 1.5; }

/* Buttons and fields mirror .hc-btn, .hc-input and .hc-check (36px, radius 6) with token fallbacks,
   and settle the cascade for links styled as buttons. */
.hub-page .hc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--hc-border-strong, #b8c6d3); border-radius: var(--hc-radius, 6px); background: var(--hc-surface, #fff); color: var(--hc-fg, #1a2735); font: 500 13.5px/1 var(--hc-font-sans, "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.hub-page .hc-btn:hover { background: var(--hc-surface-2, #eff3f6); text-decoration: none; }
.hub-page .hc-btn.primary { background: var(--hc-primary, #0273bc); border-color: var(--hc-primary, #0273bc); color: var(--hc-primary-fg, #fff); }
.hub-page .hc-btn.primary:hover { background: var(--hc-primary-hover, #015a96); border-color: var(--hc-primary-hover, #015a96); }
.hub-page .hc-btn.ghost { background: transparent; border-color: transparent; color: var(--hc-fg-2, #4a6078); }
.hub-page .hc-btn.ghost:hover { background: var(--hc-surface-2, #eff3f6); color: var(--hc-fg, #1a2735); }
.hub-page .hc-btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.hub-page .hub-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hub-page .hub-field > label { font-size: 13px; font-weight: 500; color: var(--hc-fg, #1a2735); }
.hub-page .hc-input { appearance: none; width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--hc-border-strong, #b8c6d3); border-radius: var(--hc-radius, 6px); background: var(--hc-surface, #fff); color: var(--hc-fg, #1a2735); font: 400 13.5px var(--hc-font-sans, "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif); }
.hub-page .hc-input:focus { outline: none; border-color: var(--hc-ring, #0273bc); box-shadow: 0 0 0 3px var(--hc-primary-soft, #e6f2fb); }
.hub-page .hub-password-wrap { position: relative; }
.hub-page .hub-password-wrap:has(.hub-password-toggle:not([hidden])) .hc-input { padding-right: 72px; }
.hub-page .hub-password-toggle { position: absolute; top: 50%; right: 3px; min-width: 56px; transform: translateY(-50%); }
.hub-page .hub-remember { display: flex; align-items: flex-start; gap: 10px; padding: 2px 0; font-size: 13px; line-height: 1.45; cursor: pointer; }
.hub-page .hub-remember input { width: 16px; height: 16px; flex: none; margin: 2px 0 0; accent-color: var(--hc-primary, #0273bc); }
.hub-page .hub-remember small { display: block; margin-top: 2px; font-size: 12px; color: var(--hc-fg-3, #5f7389); }

/* Sign in and sign out: one centred card. */
.hub-page.hub-login-page { display: flex; flex-direction: column; }
.hub-page .hub-login-shell { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: clamp(24px, 6vh, 64px) 16px; outline: none; }
.hub-page .hub-login-card { width: 100%; max-width: 400px; padding: 28px 24px 24px; background: var(--hc-surface, #fff); border: 1px solid var(--hc-border, #d9e1e8); border-radius: var(--hc-radius-lg, 12px); }
.hub-page .hub-login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.hub-page .hub-login-brand .hub-brand-text { align-items: center; }
.hub-page .hub-login-brand .hub-brand-word { font-size: 20px; color: var(--hc-fg, #1a2735); }
.hub-page .hub-login-brand .hub-brand-sub { color: var(--hc-fg-3, #5f7389); }
.hub-page .hub-login-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--hc-radius-md, 8px); background: var(--hc-sidebar, #152b36); }
.hub-page .hub-login-mark img { width: 28px; height: 28px; object-fit: contain; }
.hub-page .hub-login-card h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.012em; }
.hub-page .hub-login-description { margin: 6px 0 20px; font-size: 13.5px; line-height: 1.55; color: var(--hc-fg-2, #4a6078); overflow-wrap: anywhere; }
.hub-page .hub-login-form { display: flex; flex-direction: column; gap: 16px; }
.hub-page .hub-button { width: 100%; }
.hub-page .hub-form-error { margin-bottom: 16px; }
.hub-page .hub-manage-form { margin-top: 8px; }
.hub-page .hub-login-help { margin-top: 18px; font-size: 12px; line-height: 1.5; color: var(--hc-fg-3, #5f7389); }
.hub-page .hub-login-signature { font-size: 12px; color: var(--hc-fg-3, #5f7389); text-align: center; }

/* Progressive colour mixing: translucent top bar, soft rings, tinted notice borders. */
@supports (color: color-mix(in srgb, red 50%, transparent)) {
  .hub-page :is(a, button, [tabindex]):focus-visible, .hub-page .hc-check input:focus-visible { outline-color: color-mix(in srgb, var(--hc-ring, #0273bc) 40%, transparent); box-shadow: 0 0 0 1px var(--hc-ring, #0273bc); }
  .hub-page .hub-main:focus-visible, .hub-page .hub-login-shell:focus-visible { box-shadow: none; }
  .hub-page .hc-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hc-ring, #0273bc) 25%, transparent); }
  .hub-page .hub-notice.info { border-color: color-mix(in srgb, var(--hc-info, #0273bc) 30%, transparent); }
  .hub-page .hub-notice.danger { border-color: color-mix(in srgb, var(--hc-danger, #be1c2e) 35%, transparent); }
}

@media (max-width: 899.98px) {
  .hub-page .hub-main { padding: 24px 16px; }
  .hub-page .hub-crumbbar { min-height: 40px; padding: 0 16px; }
  .hub-page .hub-doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hub-page .hub-tool-grid, .hub-page .hub-report-grid, .hub-page .hub-doc-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hub-page .hub-tool-card { padding: 20px; }
  .hub-page .hub-section-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hub-page .hub-section-heading p { text-align: left; }
  .hub-page .hub-footer { flex-direction: column; gap: 6px; }
  .hub-page .hub-footer p { text-align: left; }
  .hub-page .hub-record-link { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .hub-page .hub-login-card { padding: 24px 20px 20px; }
  .hub-page .hub-login-form .hc-input { height: 44px; font-size: 16px; }
  .hub-page .hub-button { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-page *, .hub-page *::before, .hub-page *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .hub-page .hub-crumbbar, .hub-page .hub-skip { display: none; }
  .hub-page { background: #fff; color: #000; }
  .hub-page .hub-main { padding: 0; }
  .hub-page .hub-card, .hub-page .hub-record-link { break-inside: avoid; }
}
