/* Results lane uses the existing v4 token/type vocabulary. */
[data-v31-root="results"] { display: grid; gap: var(--s-6); margin: var(--s-6) 0; color: var(--ink); font-family: var(--font-sans); scroll-margin-top: calc(var(--nav-h, 60px) + var(--s-4)); }
body[data-page="demo"] [data-v31-root="results"] { width: min(1120px, calc(100% - 48px)); margin: var(--s-6) auto; }

/* Header: example label is a pill, switch is a segmented control. */
.v31-result-head { display: flex; justify-content: space-between; gap: var(--s-6); align-items: flex-start; padding: var(--s-6) 0 var(--s-2); border-top: 1px solid var(--hairline-strong); }
.v31-result-head > div { max-width: 720px; min-width: 0; }
.v31-result-head h2 { margin: var(--s-3) 0 var(--s-2); }
.v31-result-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 600; }
.v31-example-pill { display: inline-flex; align-items: center; padding: 2px var(--s-3); border-radius: var(--r-pill); background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
.v31-result-meta { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); margin-top: var(--s-2); }
.v31-result-meta > * { white-space: nowrap; }
.v31-when { font: inherit; }
.v31-result-switch { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--sunken); }
.v31-result-switch .v31-action { min-height: 40px; border-color: transparent; background: transparent; justify-content: center; white-space: nowrap; }
.v31-result-switch .v31-action:hover { background: var(--hover-tint); }
.v31-result-switch .v31-action[aria-current] { background: var(--raised); border-color: var(--hairline-strong); color: var(--accent-ink); font-weight: 600; box-shadow: var(--e-0); }

/* Actions */
.v31-action { display: inline-flex; align-items: center; justify-content: flex-start; padding: var(--s-2) var(--s-3); min-height: 44px; min-width: 44px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--raised); color: var(--ink); text-decoration: none; font: inherit; font-size: var(--fs-ui); line-height: var(--lh-ui); overflow-wrap: anywhere; max-width: 100%; text-align: left; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.v31-action:hover { background: var(--hover-tint); border-color: var(--ink-2); }
.v31-action:active { background: var(--sunken); }
.v31-action[aria-current], .v31-action[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-ink); color: var(--accent-ink); }
.v31-action:focus-visible, [data-v31-root="results"] summary:focus-visible, .v31-jump:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.v31-nw { white-space: nowrap; }
.v31-result-actions { align-items: stretch; padding-bottom: var(--s-4); border-bottom: 1px solid var(--hairline); margin: 0; }
.v31-result-actions .btn { min-height: 44px; }
.v31-result-tally { margin-top: calc(var(--s-3) * -1); }
.v31-result-tally strong { color: var(--ink); font-weight: 600; }
.v31-jump { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s-2); color: var(--accent-ink); font-size: var(--fs-ui); line-height: var(--lh-ui); text-decoration: underline; text-underline-offset: 3px; }

/* Cards and panels */
.v31-result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s-4); align-items: start; }
.v31-result-grid--values { grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); }
.v31-result-card, .v31-result-panel { min-width: 0; padding: var(--s-5); background: var(--raised); border: 1px solid var(--hairline-strong); border-radius: var(--r-lg); }
.v31-result-card h3 { margin: var(--s-2) 0 var(--s-4); }
.v31-card-top { display: flex; align-items: center; gap: var(--s-3); color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }
.v31-card-id { display: inline-flex; align-items: center; padding: 1px var(--s-2); border-radius: var(--r-xs); background: var(--sunken); color: var(--ink); font-family: var(--font-mono); font-size: var(--fs-mono); line-height: var(--lh-mono); letter-spacing: .04em; font-weight: 600; }
.v31-result-panel > h3 { margin-bottom: var(--s-4); }
.v31-result-panel > p, .v31-result-panel > h4 { margin-top: var(--s-3); }
.v31-result-panel > .v31-result-grid { margin-top: var(--s-4); }
[data-v31-root="results"] details { margin-top: var(--s-4); }
[data-v31-root="results"] summary { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: var(--s-2) 0; cursor: pointer; color: var(--accent-ink); font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 500; list-style: none; }
[data-v31-root="results"] summary::-webkit-details-marker { display: none; }
[data-v31-root="results"] summary::before { content: ""; flex: none; width: 7px; height: 7px; margin: 0 var(--s-1) 0 var(--s-1); border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .12s ease; }
[data-v31-root="results"] details[open] > summary::before { transform: rotate(45deg); }
[data-v31-root="results"] details[open] > summary { margin-bottom: var(--s-3); border-bottom: 1px solid var(--hairline); }
.v31-result-links { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: var(--s-3) 0; }
.v31-result-links > * { max-width: 100%; }
.v31-result-value { min-width: 0; padding: var(--s-4); border: 1px solid var(--hairline); border-left: 3px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--sunken); }
.v31-result-value > * + * { margin-top: var(--s-2); }
.v31-result-value .v31-effect-ci { font-size: var(--fs-row); font-weight: 600; }
.v31-result-value .v31-study-type { padding-left: 0; background: transparent; }
.v31-stance { display: inline-flex; padding: 0 var(--s-2); border-radius: var(--r-xs); background: var(--raised); border: 1px solid var(--hairline); color: var(--ink); }
.v31-stance--supports { border-color: var(--success-line); color: var(--success); }
.v31-stance--refutes { border-color: var(--danger-line); color: var(--danger); }
.v31-check:not(:empty) { padding: var(--s-3); border-radius: var(--r-sm); background: var(--success-tint); color: var(--ink); }
.v31-integrity { margin-top: var(--s-4); padding: var(--s-4); background: var(--danger-tint); border: 1px solid var(--danger-line); border-radius: var(--r-md); }
.v31-integrity > * + * { margin-top: var(--s-3); }
.v31-private-source { padding: var(--s-3); color: var(--ink-2); background: var(--sunken); font-size: var(--fs-small); line-height: var(--lh-small); border-radius: var(--r-sm); }
.v31-unavailable .v31-result-links { margin: var(--s-5) 0 var(--s-3); }
.v31-unavailable .v31-result-eyebrow { margin-bottom: var(--s-3); }

/* Notifications */
.v31-notice-list { display: grid; gap: 0; }
.v31-notice { margin-top: 0 !important; border-top: 1px solid var(--hairline); }
.v31-notice > summary { display: grid; grid-template-columns: var(--s-5) minmax(0,1fr); column-gap: var(--s-2); row-gap: var(--s-1); align-items: start; padding: var(--s-3) var(--s-2); color: var(--ink); font-weight: 400; }
.v31-notice > summary::before { grid-row: 1 / span 2; margin: var(--s-2) 0 0 var(--s-1); color: var(--ink-2); }
.v31-notice > summary:hover { background: var(--hover-tint); }
.v31-notice[open] > summary { border-bottom: 0; margin-bottom: 0; }
.v31-notice-meta { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }
.v31-notice-message { grid-column: 2; font-size: var(--fs-row); line-height: var(--lh-row); font-weight: 500; overflow-wrap: anywhere; }
.v31-type { padding: 0 var(--s-2); border-radius: var(--r-xs); background: var(--sunken); color: var(--ink); font-weight: 600; }
.v31-type--integrity { background: var(--danger-tint); color: var(--danger); }
.v31-type--gap { background: var(--warning-tint); color: var(--warning); }
.v31-type--receipt, .v31-type--operator { background: var(--accent-tint); color: var(--accent-ink); }
.v31-notice-state { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); font-weight: 600; }
.v31-notice-state::before { content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }
.v31-notice-state.is-read { color: var(--ink-2); font-weight: 400; }
.v31-notice-state.is-read::before { background: transparent; border: 1px solid var(--ink-2); }
.v31-notice > :not(summary) { margin-left: var(--s-7); padding-bottom: var(--s-3); }
.v31-notice > .v31-result-links { margin-top: 0; }
[data-v31-root="results"] [hidden] { display: none !important; }

@media (max-width: 700px) {
  .v31-result-grid, .v31-result-grid--values { grid-template-columns: minmax(0,1fr); }
  .v31-result-head { flex-direction: column; gap: var(--s-4); padding-top: var(--s-5); }
  .v31-result-switch { display: flex; width: 100%; }
  .v31-result-switch .v31-action { flex: 1 1 0; min-height: 44px; }
  .v31-result-card, .v31-result-panel { padding: var(--s-4); }
  .v31-result-actions .btn { flex: 1 1 100%; justify-content: center; }
  .v31-result-actions .v31-action:not(.btn) { flex: 1 1 calc(50% - var(--s-2)); }
  body[data-page="demo"] [data-v31-root="results"] { width: calc(100% - 40px); }
  [data-v31-root="results"] { gap: var(--s-4); }
}

/* Explicitly remove closed disclosure descendants from layout measurements. */
[data-v31-root="results"] details:not([open]) > :not(summary) { display: none; }
body[data-page="home"] .job-q { color: var(--ink-2); }
