/* Page frame: base type, header, navigation, sub-tabs, page heading, columns, sign-in. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 var(--text-base)/1.55 var(--body-font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--title-font); font-weight: 400; line-height: 1.08; text-wrap: balance; margin: 0; }
h1 { font-size: var(--title-page); letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: .2em; transition: opacity var(--ease); }
a:hover { color: var(--navy); }
::selection { background: var(--sky); color: var(--ink); }
button, input, select { font: inherit; border-radius: var(--radius); color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; transition: box-shadow var(--ease), transform var(--ease); }
button:hover { box-shadow: inset 0 0 0 999px var(--hover-wash); }
button:active { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .55; box-shadow: none; transform: none; }
input::placeholder { color: var(--placeholder); }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -5rem; left: var(--space-4); padding: var(--space-3); background: var(--paper); z-index: 10; }
.skip-link:focus { top: var(--space-2); }

/* Header */
.app-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-8);
  min-height: var(--header-height); padding: 0 var(--gutter); background: var(--ink); color: var(--paper); }
.brand { display: flex; align-items: center; min-height: var(--control-height); }
.brand img { display: block; width: var(--logo-width); height: var(--logo-height); }
.primary-nav { display: flex; flex-wrap: wrap; gap: 0 28px; flex: 1 1 auto; }
.primary-nav a { display: flex; align-items: center; height: var(--header-height); color: var(--sky); text-decoration: none;
  font-size: var(--text-base); font-weight: 500; border-bottom: 2px solid transparent; }
.primary-nav a:hover { color: var(--paper); }
.primary-nav a[aria-current] { color: var(--paper); border-bottom-color: var(--sky); }
.app-header :focus-visible { outline-color: var(--sky); }
.session { display: flex; align-items: center; gap: 18px; padding: 10px 0; }
.access-badge, .qonnector-link { display: flex; align-items: center; height: 26px; padding: 0 10px; white-space: nowrap;
  font-size: var(--text-sm); font-weight: 600; letter-spacing: .04em; }
.access-badge { background: var(--paper); color: var(--ink); }
.qonnector-link { border: 1px solid var(--sky); color: var(--paper); text-decoration: none; }
.qonnector-link:hover { color: var(--paper); box-shadow: inset 0 0 0 999px var(--hover-wash); }
.qonnector-link[aria-current] { background: var(--sky); color: var(--ink); }
.sign-out { background: transparent; border: 0; padding: 0; min-height: 26px; color: var(--sky); font-size: var(--text-md);
  text-decoration: underline; text-underline-offset: .2em; }
.sign-out:hover { box-shadow: none; color: var(--paper); }
.account { position: relative; display: flex; }
.account-toggle { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 34px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 50%; color: var(--sky); }
.account-toggle:hover, .account-toggle[aria-expanded="true"] { color: var(--paper); border-color: var(--on-dark-line); box-shadow: none; }
.account-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; display: flex; flex-direction: column; align-items: stretch;
  min-width: 220px; padding: var(--space-3) 0; background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-menu); }
.account-menu[hidden] { display: none; }
.account-name { margin: 0; padding: 2px var(--space-4) var(--space-2); font: 600 var(--text-base)/1.4 var(--body-font); overflow-wrap: anywhere; }
.account-menu .access-badge { align-self: flex-start; margin: 0 var(--space-4) var(--space-3); background: var(--mist); color: var(--navy); }
.account-item, .account-menu .sign-out { display: block; width: 100%; min-height: 36px; padding: 8px var(--space-4); border: 0; border-top: 1px solid var(--line-soft);
  background: transparent; color: var(--ink); font: 500 var(--text-base)/1.4 var(--body-font); text-align: left; text-decoration: none; }
.account-item:hover, .account-menu .sign-out:hover { background: var(--row-wash); color: var(--ink); box-shadow: none; }
.account-item[aria-current] { color: var(--blue); }
.account-menu :focus-visible { outline-color: var(--blue); }
.account-name-button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: inherit; cursor: pointer; }
.account-name-button:hover, .account-name-button[aria-expanded="true"] { color: var(--blue); box-shadow: none; }
.account-interests { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); max-height: 60vh; overflow-y: auto; }
.account-interests[hidden] { display: none; }
.account-interests-title { margin: 0; padding: var(--space-2) var(--space-4) 0; font-size: var(--text-sm); font-weight: 600; color: var(--muted); }
.account-interests-note { margin: 0; padding: var(--space-1) var(--space-4) var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.account-interests-note:empty { display: none; }
.account-interests-form { display: flex; flex-direction: column; }
.account-interest { display: flex; align-items: center; gap: var(--space-2); padding: 4px var(--space-4); font-size: var(--text-md); cursor: pointer; }
.account-interest.depth-1 { padding-left: calc(var(--space-4) + 20px); }
.account-interest.depth-2 { padding-left: calc(var(--space-4) + 40px); color: var(--muted); }

/* Sub-tabs */
.subnav { display: flex; flex-wrap: wrap; gap: 0 var(--space-7); padding: 0 var(--gutter); background: var(--surface);
  border-bottom: var(--border); }
.subnav a { display: flex; align-items: center; height: var(--subnav-height); color: var(--muted); text-decoration: none;
  font-size: var(--text-base); font-weight: 500; border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

/* Page */
main { display: flex; flex-direction: column; gap: var(--space-7); min-width: 0;
  padding: var(--main-top) var(--gutter) var(--space-9); animation: qi-fade .18s ease backwards; }
main:focus { outline: none; }
.page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-6); }
.page-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-title h1:focus { outline: none; }
.eyebrow { font-size: var(--text-sm); letter-spacing: var(--eyebrow-spacing); text-transform: uppercase; color: var(--blue); font-weight: 500; }
.page-aside { font-size: var(--text-md); color: var(--muted); }
.columns { display: flex; flex-wrap: wrap; gap: var(--space-7) var(--space-8); align-items: flex-start; min-width: 0; }
.columns > .column-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.columns > .column-side { flex: 1 1 340px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Sign in (Main.dc.html): dark brand half, form half; no header. */
body:has(.login) .app-header { display: none; }
main:has(> .login) { padding: 0; }
.login { min-height: 100vh; display: flex; flex-wrap: wrap; margin: calc(-1 * var(--main-top)) 0 0; }
main:has(> .login) .login { margin: 0; }
.login-brand { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-9);
  padding: clamp(28px, 5vw, 72px); background: var(--ink); color: var(--paper); }
.login-brand img { display: block; width: var(--login-logo-width); height: var(--login-logo-height); }
.login-claim { display: flex; flex-direction: column; gap: var(--space-5); max-width: 560px; }
.login-claim .eyebrow { color: var(--sky); }
.login-display { font-family: var(--title-font); font-size: var(--title-display); line-height: 1.06; letter-spacing: -.02em; text-wrap: balance; }
.login-panel { flex: 1 1 420px; min-width: 0; display: flex; justify-content: center; align-items: center; padding: clamp(28px, 5vw, 72px); }
.login-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.login-form h1 { font-weight: 500; font-size: var(--title-xl); letter-spacing: -.01em; }
.login-intro { display: flex; flex-direction: column; gap: var(--space-2); }
.login-intro p { color: var(--muted); }
.field-label { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); letter-spacing: var(--label-spacing);
  text-transform: uppercase; font-weight: 500; color: var(--muted); }
.field-label input { height: var(--field-height); padding: 0 14px; border: 1px solid var(--field); background: var(--paper);
  color: var(--ink); font-size: var(--text-lg); letter-spacing: 0; text-transform: none; width: 100%; }
.field-label input:focus { outline: 2px solid var(--bright); outline-offset: 1px; }
.submit-bar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-5); border: 0;
  background: var(--ink); color: var(--paper); font-size: var(--text-base); font-weight: 500; text-align: left; }
.submit-bar svg { flex-shrink: 0; }
.divider { display: flex; align-items: center; gap: 14px; font-size: var(--text-sm); color: var(--muted); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.login-later { font-size: var(--text-md); color: var(--muted); margin: 0; }
.login-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-md); }

@media (max-width: 760px) {
  .app-header { padding-block: var(--space-3); gap: var(--space-3) var(--space-4); }
  .primary-nav { order: 3; flex-basis: 100%; gap: 0 var(--space-5); overflow-x: auto; flex-wrap: nowrap; }
  .primary-nav a { height: var(--control-height); flex-shrink: 0; }
  .session { margin-left: auto; padding: 0; gap: var(--space-3); }
  .subnav { gap: 0 var(--space-5); }
  .login { min-height: auto; }
}

@keyframes qi-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes qi-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Lot 6 (30/11/2026): the same list asked again stays on screen while the new answer comes; dimmed only past 200 ms,
   so a quick answer does not blink. */
main[aria-busy="true"] { opacity: .6; transition: opacity .15s ease .2s; }
@media (prefers-reduced-motion: reduce) { main[aria-busy="true"] { transition: none; } }
