/* Alternative result layout. Existing chart controls and exports are shared. */
body:not(.dev) .views { display: inline-flex; flex: none; }
body:not(.dev) .views button:nth-child(n+5) { display: none; }
.research-view .nav .slot { justify-content: flex-start; }
.research-view #navSlot .search { width: min(100%, 620px); box-shadow: none; border-radius: 8px; }
.research-view #navSlot input { min-width: 0; padding: 8px 12px; font-size: .85rem; }
.research-view #navSlot .primary { padding: 0 14px; font-size: .8rem; }
.research-view .inner.v2 { padding: 0; max-width: 1180px; --chart-h: clamp(300px, 45vh, 510px); }
.research-context { padding: 28px 2px 23px; }
.research-context .context-category { color: var(--ink-2); font-size: .72rem; margin-bottom: 7px; }
.research-context h1 { font-size: clamp(1.35rem, 2vw, 1.8rem); letter-spacing: -.035em; line-height: 1.25; margin-bottom: 9px; }
.research-context p { color: var(--ink-2); font-size: .88rem; line-height: 1.75; max-width: 830px; }
.research-view .how, .research-view .refine { display: none; }
.research-related { margin-top: 30px; }
.research-related > h2 { font-size: 1.1rem; letter-spacing: -.02em; margin: 0 0 15px; }
.research-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.research-mini { display: flex; flex-direction: column; min-width: 0; padding: 17px 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; color: var(--ink); font: inherit; transition: border-color .15s; }
.research-mini:hover { border-color: var(--accent); }
.research-mini:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.research-mini h3 { font-size: .83rem; line-height: 1.4; font-weight: 600; margin-bottom: 5px; }
.research-mini .mini-period { font-size: .69rem; color: var(--ink-2); }
.research-mini .mini-canvas { position: relative; height: 130px; margin: 14px 0 10px; width: 100%; }
.research-mini .mini-source { margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.research-mini.loading { min-height: 240px; color: var(--ink-2); justify-content: center; align-items: center; }
.research-related .related-status { color: var(--ink-2); padding: 12px 0; font-size: .83rem; }
@media (max-width: 1100px) { .research-related-grid { gap: 12px; } .research-mini { padding: 13px; } }
@media (max-width: 800px) { .research-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .research-view .nav { flex-wrap: wrap; height: auto; min-height: 58px; padding-bottom: 9px; } .research-view #navSlot { order: 10; flex-basis: 100%; } .research-view #navSlot .search { width: 100%; } .research-context { padding-top: 22px; } }
@media (max-width: 520px) { .research-related-grid { grid-template-columns: 1fr; } .research-view .mainpane { padding-left: 14px; padding-right: 14px; } }

/* View 3: fewer labels, a shared alignment grid and controls on demand. */
.polished-view .nav { height: 72px; }
.polished-view .nav #navSlot { position: absolute; left: var(--research-search-left); width: min(var(--research-search-width), calc(100vw - var(--research-search-left) - 365px)); }
.polished-view #navSlot .search { width: 100%; border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); padding: 4px; }
.polished-view #navSlot input { padding: 10px 9px; font-size: .9rem; }
.polished-view #navSlot .primary { padding: 0 20px; }
.polished-view #views { margin-left: auto; }
.polished-view .nav .right { margin-left: 0; }
.polished-view .shell { min-height: calc(100vh - 72px); }
.polished-view .sb { top: 72px; height: calc(100vh - 72px); }
.polished-view .sb .nav-item:disabled { display: none; }

.polished-view .inner.v3 { max-width: 1180px; padding: 0; --chart-h: clamp(320px, 45vh, 510px); }
.polished-view .research-context { padding: 30px 0 24px; }
.polished-view .research-context h1 { font-size: 1.75rem; margin-bottom: 6px; }
.polished-view .context-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.polished-view .context-line > p { font-size: .83rem; }
.context-more { position: relative; font-size: .78rem; color: var(--accent); }
.context-more summary { cursor: pointer; list-style: none; white-space: nowrap; }
.context-more summary::after { content: ' ⌄'; }
.context-more > p { position: absolute; top: 28px; right: 0; z-index: 8; width: min(380px, 75vw); padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.polished-card { box-shadow: 0 3px 16px rgba(15,23,42,.035); }
.polished-card > .head { padding: 22px 24px 8px; }
.polished-card .titlerow h2 { font-size: 1.15rem; }
.polished-card .subtitle { font-size: .77rem; margin-top: 5px; }
.polished-card > .head .meta { display: none; }
.polished-card .toolbar { padding: 5px 24px 14px; }
.polished-card.table-mode .cv { display: none; }
.polished-card.table-mode .sidepane.open { width: 100%; max-width: none; border-left: 0; }
.polished-card .presentation-toggle { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.polished-card .presentation-toggle .ghost { border: 0; border-radius: 0; padding: 7px 12px; background: transparent; }
.polished-card .presentation-toggle .on { color: var(--accent); box-shadow: 0 2px 0 var(--accent); }
.chart-type-select { font: inherit; font-size: .76rem; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; background: var(--surface); color: var(--ink-2); }
.polished-card .share-btn { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.polished-card .foot { padding: 12px 24px; }
.polished-card .foot .src { display: flex; flex-wrap: wrap; gap: 8px 15px; align-items: center; }
.polished-card .foot .src a { color: var(--ink-2); font-size: .75rem; }
.polished-card .foot .src button { border: 0; background: transparent; font-size: .73rem; padding: 0; color: var(--muted); }
.download-menu { position: relative; font-size: .78rem; }
.download-menu summary { cursor: pointer; list-style: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--ink-2); }
.download-options { position: absolute; bottom: 38px; right: 0; width: 235px; z-index: 12; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.download-options button { text-align: left; border: 0; }
.polished-view .research-mini { padding: 18px 18px 8px; }
.polished-view .research-mini h3 { font-size: .88rem; min-height: 2.6em; }
.polished-view .research-mini .mini-canvas { height: 140px; }
@media (max-width: 1250px) and (min-width: 801px) { .polished-view .finlink { display: none; } .polished-view #navSlot { width: min(var(--research-search-width), calc(100vw - var(--research-search-left) - 175px)); } }
@media (max-width: 800px) { .polished-view .nav { height: auto; } .polished-view .nav #navSlot { position: static; width: 100%; } .polished-view .sb { top: 110px; height: calc(100vh - 110px); } .polished-view .research-context { padding-top: 22px; } .polished-card > .head, .polished-card .toolbar, .polished-card .foot { padding-left: 16px; padding-right: 16px; } }

/* View 4 keeps View 2's controls but leads with the chart. */
.chart-first-view .nav #navSlot { position: absolute; left: 50%; transform: translateX(-50%); width: min(680px, calc(100vw - 600px)); }
.chart-first-view #navSlot .search { width: 100%; }
.chart-first-view .inner.v4 { max-width: 1180px; padding: 20px 0 0; --chart-h: clamp(320px, 49vh, 560px); }
.chart-first-view .research-context { margin-top: 20px; padding: 22px 24px; border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--line)); border-radius: 12px; background: var(--accent-soft); }
.chart-first-view .research-context .context-category { display: none; }
.chart-first-view .research-context h1 { font-size: 1.05rem; letter-spacing: -.015em; margin-bottom: 6px; }
.chart-first-view .research-context p { font-size: .83rem; max-width: 950px; }
.chart-first-view .chart-first-card > .head { padding-top: 21px; padding-bottom: 5px; }
.chart-first-card .subtitle { margin-top: 5px; font-size: .78rem; }
.chart-first-card .toolbar { padding-top: 5px; }
.chart-first-card .foot .src { font-size: .75rem; }
.chart-first-card .foot .src a { color: var(--ink-2); }
.chart-first-card .smenu { max-height: min(65vh, 470px); overflow-y: auto; }
@media (max-width: 1000px) and (min-width: 801px) { .chart-first-view .nav #navSlot { width: calc(100vw - 480px); left: 54%; } .chart-first-view .finlink { display: none; } }
@media (max-width: 800px) { .chart-first-view .nav #navSlot { position: static; transform: none; width: 100%; } .chart-first-view .research-context { padding: 18px; } }

/* ======== Experimental "View 5" (?exp=chartpage): the entity chart page's header and related list inside the main page ======== */
body:not(.dev) .views button[data-exp][data-exp] { display: inline-block; width: auto; }
.chartpage-view .cp-head { display: flex; flex-direction: column; gap: 6px; padding: 22px 2px 16px; }
.chartpage-view .cp-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0 0 14px; padding: 0; font-size: .9375rem; color: var(--ink-2); }
.chartpage-view .cp-crumbs li + li::before { content: "\203A"; margin-right: 8px; color: var(--ink-2); }
.chartpage-view .cp-crumbs li:last-child { color: var(--ink); font-weight: 650; }
.chartpage-view .cp-crumbs a { color: var(--accent); font-weight: 600; text-decoration: none; }
.chartpage-view .cp-crumbs a:hover { text-decoration: underline; }
/* 18 Nov (polish 2): crumb links get a keyboard focus ring; the last crumb stays dark when it is a link (it opens the chart on the entity page) */
.chartpage-view .cp-crumbs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; text-decoration: underline; }
.chartpage-view .cp-crumbs li:last-child a { color: var(--ink); font-weight: 650; }
.chartpage-view .cp-ent { display: inline-flex; align-items: center; gap: 10px; width: fit-content; min-height: 44px; color: var(--ink); text-decoration: none; }
.chartpage-view a.cp-ent:hover .cp-ename { color: var(--accent); }
.chartpage-view .cp-logo { width: auto; min-width: 34px; max-width: 110px; height: 34px; object-fit: contain; border: 1px solid var(--line); border-radius: 9px; padding: 4px; background: #fff; box-sizing: content-box; }
.chartpage-view .cp-mono { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 750; font-size: .95rem; }
.chartpage-view .cp-ename { font-size: 1rem; font-weight: 650; }
.chartpage-view .cp-code { font-size: .75rem; font-weight: 700; letter-spacing: .05em; color: var(--ink-2); }
.chartpage-view .cp-kicker { margin: 4px 0 0; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.chartpage-view .cp-title { margin: 0; font-size: 2.25rem; line-height: 1.12; letter-spacing: -.02em; font-weight: 750; overflow-wrap: anywhere; }
.chartpage-view .cp-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 6px; }
.chartpage-view .cp-v { font-size: 2.75rem; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.chartpage-view .cp-chg { font-size: 1.0625rem; font-weight: 650; color: var(--ink); white-space: nowrap; }
.chartpage-view .cp-vs { font-weight: 500; color: var(--ink-2); }
.chartpage-view .cp-meta { font-size: .9375rem; color: var(--ink-2); }
.chartpage-card .titlerow { display: none; }   /* the title is in the header above */
/* EXP5 header + panel: one flat white column (same width and edges as the entity chart page), two-row header */
.chartpage-view .mainpane { padding: 0 28px; }
.chartpage-view .inner.v4 { max-width: 1180px; padding: 0 26px 48px; background: var(--surface); min-height: calc(100vh - 58px); }
.chartpage-view .cp-head { padding: 22px 0 10px; gap: 10px; }
.chartpage-view .cp-crumbs ol { margin: 0; }
.chartpage-view .cp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px; }
.chartpage-view .cp-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.chartpage-view .cp-logo { width: auto; min-width: 28px; max-width: 96px; height: 28px; }
.chartpage-view .cp-mono { width: 38px; height: 38px; }
.chartpage-view .cp-title { font-size: 2rem; }
.chartpage-view .cp-ent { display: inline-flex; align-items: baseline; gap: 8px; width: auto; min-height: 0; color: var(--ink-2); text-decoration: none; }
.chartpage-view a.cp-ent:hover .cp-ename { color: var(--accent); }
.chartpage-view .cp-ename { font-size: .9375rem; font-weight: 600; }
.chartpage-view .cp-stats { margin-top: 0; justify-content: flex-end; }
.chartpage-view .cp-v { font-size: 2.25rem; }
.chartpage-view .chartpage-card { border: 0; box-shadow: none; border-radius: 0; background: transparent; overflow: visible; }
.chartpage-view .chartpage-card > .head, .chartpage-view .chartpage-card > .toolbar, .chartpage-view .chartpage-card > .foot, .chartpage-view .chartpage-card > .notes,
.chartpage-view .chartpage-card > .understood, .chartpage-view .chartpage-card > .format-explanation { padding-left: 0; padding-right: 0; }
@media (max-width: 900px) { .chartpage-view .mainpane { padding: 0; } .chartpage-view .inner.v4 { padding: 0 16px 40px; } .chartpage-view .cp-stats { justify-content: flex-start; } }
/* related charts: styled by the "EXP5 related cards" block at the end of this file */
@media (max-width: 760px) {
  .chartpage-view .cp-title { font-size: 1.65rem; } .chartpage-view .cp-v { font-size: 2.2rem; }
}

/* EXP5 chart */
/* the fuller "About this subject" box below the chart is kept; the short description inside the card is hidden */
.chartpage-view .chartpage-card .registry-brief { display: none; }

/* EXP5 related cards */
:root { --rel-teal: #0d9488; --rel-neg: #dc2626; }
:root[data-theme="dark"] { --rel-teal: #2dd4bf; --rel-neg: #f87171; }
.chartpage-view .research-related { margin-top: 40px; }
.chartpage-view .research-related > h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 14px; font-size: 1.625rem; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.chartpage-view .research-related .rel-h { position: relative; padding-left: 14px; }
.chartpage-view .research-related .rel-h::before { content: ""; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 2px; background: var(--accent); }
.chartpage-view .research-related .rel-all { flex: none; font-size: .9375rem; font-weight: 600; letter-spacing: 0; color: var(--accent); text-decoration: none; white-space: nowrap; }
.chartpage-view .research-related .rel-all:hover { text-decoration: underline; text-underline-offset: 3px; }
.chartpage-view .research-related .research-related-grid { display: block; }
.chartpage-view .research-related .rel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chartpage-view .research-related .rel-grid:empty { display: none; }
.chartpage-view .research-related .rel-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 20px 26px 16px; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; }
.chartpage-view .research-related .rel-card:nth-child(3n+1) { padding-left: 0; }
.chartpage-view .research-related .rel-card:nth-child(3n) { padding-right: 0; }
.chartpage-view .research-related .rel-card:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); }
.chartpage-view .research-related .rel-card:nth-child(n+4) { border-top: 1px solid var(--line); }
.chartpage-view .research-related .rel-t { margin: 0; min-height: 2.7em; font-size: .9375rem; line-height: 1.35; font-weight: 650; letter-spacing: -.005em; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chartpage-view .research-related .rel-card:hover .rel-t { color: var(--accent); }
.chartpage-view .research-related .rel-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.chartpage-view .research-related .rel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; min-width: 0; }
.chartpage-view .research-related .rel-v { font-size: 1.625rem; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chartpage-view .research-related .rel-chg { font-size: .875rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chartpage-view .research-related .rel-chg > span { font-size: .65rem; }
.chartpage-view .research-related .rel-per { margin: 0; font-size: .8125rem; color: var(--muted); }
.chartpage-view .research-related .rel-chart { position: relative; flex: 1 1 auto; height: 130px; min-height: 130px; margin-top: 6px; min-width: 0; }
.chartpage-view .research-related .rel-chart canvas { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; max-width: none; }
.chartpage-view .research-related .rel-skel { cursor: default; pointer-events: none; }
.chartpage-view .research-related .rel-skel i { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: exp5relsk 1.4s linear infinite; }
.chartpage-view .research-related .rel-skel .sk-t { height: 14px; width: 70%; margin-bottom: 14px; }
.chartpage-view .research-related .rel-skel .sk-v { height: 26px; width: 42%; }
.chartpage-view .research-related .rel-skel .sk-p { height: 12px; width: 24%; }
.chartpage-view .research-related .rel-skel .sk-c { height: 130px; margin-top: 8px; }
@keyframes exp5relsk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .chartpage-view .research-related .rel-skel i { animation: none; } }
@media (max-width: 900px) {
  .chartpage-view .research-related .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chartpage-view .research-related .rel-card, .chartpage-view .research-related .rel-card:nth-child(3n+1), .chartpage-view .research-related .rel-card:nth-child(3n) { padding: 20px 22px 16px; border: 0; }
  .chartpage-view .research-related .rel-card:nth-child(2n+1) { padding-left: 0; border-left: 0; }
  .chartpage-view .research-related .rel-card:nth-child(2n) { padding-right: 0; border-left: 1px solid var(--line); }
  .chartpage-view .research-related .rel-card:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .chartpage-view .research-related > h2 { font-size: 1.35rem; }
  .chartpage-view .research-related .rel-grid { grid-template-columns: minmax(0, 1fr); }
  .chartpage-view .research-related .rel-t { min-height: 0; }
  .chartpage-view .research-related .rel-card, .chartpage-view .research-related .rel-card:nth-child(n) { padding: 18px 0 14px; border: 0; }
  .chartpage-view .research-related .rel-card:nth-child(n+2) { border-top: 1px solid var(--line); }
}

/* ======== Experimental "View 6" (?exp=chartpage2): lighter header, buttons on the title row, divider-style description ======== */
.chartpage2-view { --cp2-tools-w: 290px; }   /* width of the Data / Format / Customize / About buttons; research-view.js measures the real width and overwrites this on the card */
.chartpage2-view .cp-head2 { padding: 22px 0 0; }
.chartpage2-view .chartpage2-card { position: relative; }
/* 18 Nov: one vertical rhythm. The row now GROWS with a wrapped title (it used to be a fixed 28px high, so a two-line title ran over the subtitle).
   Breadcrumb to title is about 8px of visible space, title to subtitle about 10px (the title's own line-height adds about 6px on each side of the letters). */
.chartpage2-view .chartpage2-card .titlerow, .chartpage2-view .slot > .card:not(.chartpage2-card) .titlerow { display: flex; align-items: baseline; height: auto; min-height: 36px; }
.chartpage2-view .chartpage2-card .titlerow { padding-right: calc(var(--cp2-tools-w, 290px) + 12px); }   /* room for the buttons placed on the title row: their measured width plus a gap */
.chartpage2-view .chartpage2-card .titlerow h2 { font-size: 2rem; line-height: 1.12; letter-spacing: -.02em; font-weight: 750; overflow-wrap: anywhere; white-space: normal; text-overflow: clip; overflow: visible; }   /* a long title wraps instead of ending in an ellipsis */
.chartpage2-view .chartpage2-card > .head { padding-top: 2px; padding-bottom: 4px; }
.chartpage2-view .chartpage2-card .head-top { min-height: 0; align-items: flex-start; position: relative; }
/* Save / Share sit at the bottom right of the head, out of the flow, so they no longer narrow the title row (the title used to wrap at about 400px); only the subtitle line leaves room for them */
.chartpage2-view .chartpage2-card .head-top .head-actions { position: absolute; right: 0; bottom: 0; }
.chartpage2-view .chartpage2-card .head-top .tt .subtitle { padding-right: calc(var(--cp2-actions-w, 185px) + 14px); box-sizing: border-box; }
.chartpage2-view .chartpage2-card .subtitle, .chartpage2-view .slot > .card:not(.chartpage2-card) .subtitle { margin-top: 7px; font-size: .9375rem; color: var(--ink-2); height: auto; min-height: 20px; line-height: 20px; }
.chartpage2-view .chartpage2-card > .toolbar { position: absolute; top: 0; right: 0; padding: 0; z-index: 3; width: auto; }
.chartpage2-view .chartpage2-card .understood { display: none; }   /* the "Matched to: ..." line */
/* description: a quiet block between two divider lines, no box and no heading */
body.chartpage2-view .research-context { margin-top: 22px; padding: 18px 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
body.chartpage2-view .research-context h1 { display: none; }
body.chartpage2-view .research-context p { max-width: 960px; font-size: .9375rem; line-height: 1.7; color: var(--ink-2); }
/* View 6 (and 5) loading, "No match" and error states: the card the page shows BEFORE the real chart arrives must already look like the finished page (flat white panel, no bordered View 4 card).
   View 6 gets its own quiet skeleton: breadcrumb bar, title bar, subtitle bar, chart block, in the same places as the real content, so nothing moves when the chart arrives. */
.chartpage-view .slot > .card:not(.chartpage-card) { border: 0; box-shadow: none; border-radius: 0; background: transparent; overflow: visible; position: relative; }
.chartpage-view .slot > .card:not(.chartpage-card) > .head, .chartpage-view .slot > .card:not(.chartpage-card) > .toolbar, .chartpage-view .slot > .card:not(.chartpage-card) > .foot, .chartpage-view .slot > .card:not(.chartpage-card) > .notes { padding-left: 0; padding-right: 0; }
.chartpage-view .slot > .card:has(.overlay.skel) .titlerow h2 { color: transparent; }
.chartpage2-view .slot > .card:not(.chartpage2-card) { --cp2-bar: color-mix(in srgb, var(--ink) 9%, transparent); }
.chartpage2-view .slot > .card:not(.chartpage2-card) > .head { padding-top: 2px; padding-bottom: 4px; }
.chartpage2-view .slot > .card:not(.chartpage2-card) .head-top { min-height: 0; align-items: flex-start; }
.chartpage2-view .slot > .card:not(.chartpage2-card) .meta, .chartpage2-view .slot > .card:not(.chartpage2-card) .foot .actions { display: none; }   /* the finished View 6 card hides these too */
.chartpage2-view .slot > .card:not(.chartpage2-card) .titlerow h2 { font-size: 2rem; line-height: 1.12; letter-spacing: -.02em; font-weight: 750; overflow-wrap: anywhere; }
.chartpage2-view .slot > .card:not(.chartpage2-card) > .toolbar { position: absolute; top: 4px; right: 0; padding: 0; width: auto; }
.chartpage2-view .slot > .card:has(.overlay.skel) { animation: cp2pulse 1.5s ease-in-out infinite; }
.chartpage2-view .slot > .card:has(.overlay.skel)::before { content: ""; display: block; flex: none; width: 230px; height: 23px; margin: 22px 0 0; border-radius: 6px; background: var(--cp2-bar); }   /* the breadcrumb row (22px padding + 23px line, as .cp-head2) */
.chartpage2-view .slot > .card:has(.overlay.skel) .titlerow h2 { width: 280px; max-width: 70%; background: linear-gradient(var(--cp2-bar), var(--cp2-bar)) 0 4px / 100% 28px no-repeat; border-radius: 8px; }
.chartpage2-view .slot > .card:has(.overlay.skel) .subtitle { width: 52%; height: 20px; background: linear-gradient(var(--cp2-bar), var(--cp2-bar)) 0 3px / 100% 14px no-repeat; border-radius: 6px; }
.chartpage2-view .slot > .card:has(.overlay.skel) .cv { background: none; }
.chartpage2-view .slot > .card:has(.overlay.skel) .overlay.skel { color: transparent; background: var(--cp2-bar); border-radius: 10px; animation: none; opacity: .55; }
.chartpage2-view .slot > .card:not(.chartpage2-card):not(:has(.overlay.skel)) { padding-top: 22px; }   /* No match / error / clarification: the title stays, big, like the finished card */
@keyframes cp2pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .chartpage2-view .slot > .card:has(.overlay.skel) { animation: none; } }
@media (max-width: 560px) {   /* phone: the title takes the full row (it was squeezed to two short lines), Save / Share go under the subtitle */
  .chartpage2-view .chartpage2-card .head-top, .chartpage2-view .slot > .card:not(.chartpage2-card) .head-top { flex-wrap: wrap; min-height: 0; }
  .chartpage2-view .chartpage2-card .head-top .tt, .chartpage2-view .slot > .card:not(.chartpage2-card) .head-top .tt { flex: 1 1 100%; }
  .chartpage2-view .chartpage2-card .head-top .head-actions { position: static; align-self: auto; margin-top: 8px; }
  .chartpage2-view .chartpage2-card .head-top .tt .subtitle { padding-right: 0; }
}
@media (max-width: 1180px) {   /* with the sidebar open the card is about 300px narrower than the window: below this the buttons go under the title instead of squeezing it */
  .chartpage2-view .chartpage2-card .titlerow { padding-right: 0; }
  .chartpage2-view .chartpage2-card > .toolbar, .chartpage2-view .slot > .card:not(.chartpage2-card) > .toolbar { position: static; padding: 6px 0 0; }
}

/* 18 Nov 2026 (View 6): notes under the chart and the series description.
   Orange ("warn") only for a note that changes how to read the numbers; every other visible note is quiet grey; purely descriptive routing notes are not shown (they stay in About). */
.chartpage2-view .chartpage2-card > .notes { height: auto; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; padding: 0; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: .8125rem; }
.chartpage2-view .chartpage2-card > .notes:empty { display: none; }
.chartpage2-view .cp-note { margin: 0; max-width: 960px; }
.chartpage2-view .cp-note.quiet { color: var(--ink-2); }
.chartpage2-view .cp-note.warn { color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 6px 12px; width: fit-content; }
.chartpage2-view .chartpage2-card .cp2-desc { margin: 0; padding: 12px 0 4px; max-width: 960px; font-size: .9375rem; line-height: 1.65; color: var(--ink-2); }

/* ===== VIEW 7 (18 Nov 2026) ===== (?exp=chartpage3 = View 6 + body.chartpage3-view; View 4 and View 6 are untouched: every rule below starts with .chartpage3-view)
   1. Colours: the entity page's own tokens (entity.css "design pass 3": --page #edf3fa light, var(--bg) = #0a0c10 dark; --surface and --line are already the same literals as index.html).
   2. Centre column: the entity page's geometry (entity.css: --qc-col-max 1240px, --qc-col-pad 24px/16px, --qc-nav-h 52px, --qc-top 10px). The column is centred in the WINDOW (as on the entity and chart
      pages); the sidebar only pushes it right when there is not enough room beside it (--qc-side = sidebar width + 16px gap: 288px open, 76px as the 60px rail). */
body.chartpage3-view { --page: #edf3fa; --qc-col-max: 1240px; --qc-col-pad: 24px; --qc-nav-h: 52px; --qc-top: 10px; --qc-side: 0px; background: var(--page); }
:root[data-theme="dark"] body.chartpage3-view { --page: var(--bg); }
@media (max-width: 860px) { body.chartpage3-view { --qc-top: 20px; } }
@media (max-width: 700px) { body.chartpage3-view { --qc-top: 12px; } }
@media (max-width: 560px) { body.chartpage3-view { --qc-col-pad: 16px; } }
@media (min-width: 861px) {
  body.chartpage3-view .nav { height: var(--qc-nav-h); }
  body.chartpage3-view .sb { top: var(--qc-nav-h); }
  body.chartpage3-view .sbback { inset: var(--qc-nav-h) 0 0 0; }
}
@media (min-width: 1001px) {
  body.chartpage3-view .shell { grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - var(--qc-nav-h)); --qc-side: 288px; }
  body.chartpage3-view .shell.sb-off { --qc-side: 76px; }
  body.chartpage3-view .sb { grid-area: 1 / 1; justify-self: start; align-self: start; width: 272px; height: calc(100vh - var(--qc-nav-h)); z-index: 2; }
  body.chartpage3-view .shell.sb-off .sb { width: 60px; }
}
body.chartpage3-view .mainpane { grid-area: 1 / 1; padding: 0; display: grid; grid-template-columns: minmax(var(--qc-side), 1fr) minmax(0, var(--qc-col-max)) minmax(0, 1fr); align-content: start; }
body.chartpage3-view .inner.v4 { grid-column: 2; margin: 0; max-width: none; padding: 0 var(--qc-col-pad) 64px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: calc(100vh - var(--qc-nav-h)); }
@media (max-width: 1260px) { body.chartpage3-view .inner.v4 { border-left: 0; border-right: 0; } }
@media (max-width: 860px) { body.chartpage3-view .inner.v4 { min-height: calc(100vh - 58px); } }
body.chartpage3-view .cp-head2 { padding-top: var(--qc-top); }
body.chartpage3-view .slot > .card:has(.overlay.skel)::before { margin-top: var(--qc-top); }
body.chartpage3-view .slot > .card:not(.chartpage2-card):not(:has(.overlay.skel)) { padding-top: var(--qc-top); }

/* ===== VIEW 8 (18 Nov 2026) ===== (?exp=chartpage4 = View 7 + body.chartpage4-view; body keeps chartpage3-view too, so every View 7 rule applies first. View 4, 6 and 7 are untouched: every rule below starts with body.chartpage4-view.)
   1. Top space: --qc-top (the gap above the breadcrumb) 10px -> 38px (the entity page keeps its title row about 62px below the nav; View 7 had it at about 42px), and a calmer breadcrumb -> title -> subtitle -> chart rhythm.
   2. Description band: the description section (.research-context) is ONE light-blue band, full width of the main area (the box-shadow runs out to both window edges, clipped to the band's own height, behind the sidebar and nav), text kept in the centre column.
      Colour = View 7's own tokens: 16% of --accent in --surface (light #dce6fc, dark #1d273c). Text --ink on it: 14.3:1 light, 13.6:1 dark (AA needs 4.5:1).
   3. Icon buttons: research-view.js chartPageIcons() + statvon_chart/icons.js turn the Data / Format / Customize / About / Save / Share-Export buttons (and panel Close / CSV) into 32px icon buttons in one group at the right of the title row. */
body.chartpage4-view { --qc-top: 38px; --v8-band: color-mix(in srgb, var(--accent) 16%, var(--surface)); --v8-band-ink: var(--ink); }
@media (max-width: 860px) { body.chartpage4-view { --qc-top: 32px; } }
@media (max-width: 700px) { body.chartpage4-view { --qc-top: 26px; } }
/* rhythm */
body.chartpage4-view .cp-head2 .cp-crumbs { padding-bottom: 4px; }
body.chartpage4-view .chartpage2-card > .head { padding-top: 8px; padding-bottom: 10px; }
body.chartpage4-view .chartpage2-card .subtitle { margin-top: 9px; }
/* icon buttons: one group, on the title row at the right */
body.chartpage4-view .chartpage2-card > .toolbar { top: 10px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 14px; }
body.chartpage4-view .chartpage2-card > .toolbar .tools { width: auto; margin: 0; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
body.chartpage4-view .chartpage2-card > .toolbar .head-actions { position: relative; display: flex; align-items: center; gap: 6px; flex: none; margin: 0; }
body.chartpage4-view .chartpage2-card > .toolbar .head-actions::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
body.chartpage4-view .chartpage2-card .head-top .tt .subtitle { padding-right: 0; }
body.chartpage4-view .chartpage2-card .pane-head { min-height: 32px; }
body.chartpage4-view .chartpage2-card .dtools { align-items: center; }
@media (min-width: 701px) and (max-width: 1180px) {   /* the group is only about 250px wide: it stays on the title row down to a tablet (View 6 / 7 put the text buttons under the title here) */
  body.chartpage4-view .chartpage2-card .titlerow { padding-right: calc(var(--cp2-tools-w, 250px) + 12px); }
  body.chartpage4-view .chartpage2-card > .toolbar { position: absolute; top: 10px; right: 0; padding: 0; }
}
@media (max-width: 700px) { body.chartpage4-view .chartpage2-card > .toolbar { position: static; padding: 10px 0 0; justify-content: flex-start; } }
/* description band */
/* 18 Nov (view8_desc): the band spans the white centre panel only (border line to border line, the owner's request), no longer the whole window: negative side margin = the column padding, the text keeps the column padding so it lines up with the chart above. */
body.chartpage4-view .research-context { position: relative; box-sizing: border-box; margin: 40px calc(-1 * var(--qc-col-pad)) 0; padding: 32px var(--qc-col-pad); border: 0; border-radius: 0; background: var(--v8-band); }
body.chartpage4-view .research-context p { max-width: 960px; margin: 0; font-size: 1rem; line-height: 1.7; color: var(--v8-band-ink); }
body.chartpage4-view .research-related { margin-top: 48px; }
@media (max-width: 700px) { body.chartpage4-view .research-context { margin-top: 28px; padding: 24px var(--qc-col-pad); } body.chartpage4-view .research-related { margin-top: 36px; } }
/* description looks (Amazon only, click to cycle; research-view.js chartPageDescStyles). Looks 2 to 4 are set by data-v8d-style on the band; look 1 = the regular band above. */
body.chartpage4-view .research-context.v8d { cursor: pointer; transition: height .22s ease, opacity .11s ease; }
body.chartpage4-view .research-context.v8d[hidden] { display: none; }
body.chartpage4-view .research-context.v8d.v8d-out { opacity: 0; overflow: hidden; }
body.chartpage4-view .research-context.v8d:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
body.chartpage4-view .research-context.v8d p { order: 2; }
body.chartpage4-view .research-context .v8d-dots { position: absolute; right: var(--qc-col-pad); bottom: 10px; display: flex; gap: 5px; pointer-events: none; }
body.chartpage4-view .research-context .v8d-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 55%, transparent); }
body.chartpage4-view .research-context .v8d-dots i.on { background: var(--ink); }
body.chartpage4-view .research-context .v8d-logo { order: 1; flex: none; width: auto; min-width: 56px; max-width: 186px; height: 56px; padding: 8px; box-sizing: border-box; justify-self: start; border-radius: 12px; background: #fff; object-fit: contain; box-shadow: 0 0 0 1px color-mix(in srgb, #000 12%, transparent); }   /* white badge: the mark is black, so it reads in light and dark */
/* 2: logo left, text right */
body.chartpage4-view .research-context[data-v8d-style="2"] { display: flex; align-items: center; gap: 20px; }
body.chartpage4-view .research-context[data-v8d-style="2"] p { flex: 1 1 0; min-width: 0; }
/* 3: label, accent bar, link */
body.chartpage4-view .research-context[data-v8d-style="3"] { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding-left: calc(var(--qc-col-pad) + 20px); }
body.chartpage4-view .research-context[data-v8d-style="3"]::before { content: ""; position: absolute; left: var(--qc-col-pad); top: 32px; bottom: 32px; width: 4px; border-radius: 2px; background: var(--accent); }
body.chartpage4-view .research-context .v8d-kicker { order: 1; font-size: .8125rem; font-weight: 700; font-variant-caps: all-small-caps; letter-spacing: .1em; color: var(--ink); }
body.chartpage4-view .research-context .v8d-link { order: 3; justify-self: start; font-size: .9375rem; font-weight: 600; color: color-mix(in srgb, var(--accent) 70%, var(--ink)); text-decoration: underline; text-underline-offset: 3px; }
body.chartpage4-view .research-context .v8d-link:hover { text-decoration-thickness: 2px; }
/* N1 / N4 (version 2, 18 Nov): logo | (accent bar, N1 only) | About block. The right block reuses the N3 classes (.v8d-kicker, the band's <p>, .v8d-link: same font, weight, colour); only the vertical spacing is tightened so the three rows fit the compact band height of N2.
   Height rule: min-height = N2's band (logo 56 + 2 x the band padding, --v8d-pad); the content is centred in it, so with a one-line text N1 / N4 are exactly as tall as N2, and with a longer text the band grows (never clips). */
body.chartpage4-view .research-context[data-v8d-style="1"], body.chartpage4-view .research-context[data-v8d-style="4"] { --v8d-pad: 32px; display: grid; grid-template-columns: auto 4px minmax(0, 1fr); column-gap: 18px; align-content: center; align-items: center; box-sizing: border-box; min-height: calc(56px + 2 * var(--v8d-pad)); padding-top: 14px; padding-bottom: 14px; }
body.chartpage4-view .research-context[data-v8d-style="4"] { grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; }
body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-logo, body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-logo { grid-column: 1; grid-row: 1 / span 3; align-self: center; }
body.chartpage4-view .research-context .v8d-bar { grid-column: 2; grid-row: 1 / span 3; align-self: stretch; width: 4px; border-radius: 2px; background: var(--accent); }
body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-kicker, body.chartpage4-view .research-context[data-v8d-style="1"] p, body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-link { grid-column: 3; }
body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-kicker, body.chartpage4-view .research-context[data-v8d-style="4"] p, body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-link { grid-column: 2; }
body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-kicker, body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-kicker { grid-row: 1; line-height: 1.2; }
body.chartpage4-view .research-context[data-v8d-style="1"] p, body.chartpage4-view .research-context[data-v8d-style="4"] p { grid-row: 2; line-height: 1.5; margin: 2px 0; }
body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-link, body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-link { grid-row: 3; line-height: 1.3; }
@media (max-width: 700px) {   /* phones and small tablets */
  body.chartpage4-view .research-context[data-v8d-style="1"], body.chartpage4-view .research-context[data-v8d-style="4"] { --v8d-pad: 24px; }
  body.chartpage4-view .research-context[data-v8d-style="2"] { flex-direction: column; align-items: flex-start; gap: 14px; }
  body.chartpage4-view .research-context[data-v8d-style="3"] { padding-left: calc(var(--qc-col-pad) + 16px); }
  body.chartpage4-view .research-context[data-v8d-style="3"]::before { top: 24px; bottom: 24px; }
}
@media (max-width: 560px) {   /* N1 / N4 stack: logo on top, (a short horizontal accent bar in N1), then the About block */
  body.chartpage4-view .research-context[data-v8d-style="1"], body.chartpage4-view .research-context[data-v8d-style="4"] { grid-template-columns: minmax(0, 1fr); row-gap: 0; justify-items: start; min-height: 0; padding-top: 20px; padding-bottom: 24px; }
  body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-logo, body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-logo { grid-column: 1; grid-row: 1; margin-bottom: 14px; }
  body.chartpage4-view .research-context .v8d-bar { grid-column: 1; grid-row: 2; align-self: auto; width: 48px; height: 4px; margin-bottom: 12px; }
  body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-kicker, body.chartpage4-view .research-context[data-v8d-style="1"] p, body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-link { grid-column: 1; }
  body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-kicker, body.chartpage4-view .research-context[data-v8d-style="4"] p, body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-link { grid-column: 1; }
  body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-kicker { grid-row: 3; }
  body.chartpage4-view .research-context[data-v8d-style="1"] p { grid-row: 4; }
  body.chartpage4-view .research-context[data-v8d-style="1"] .v8d-link { grid-row: 5; }
  body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-kicker { grid-row: 2; }
  body.chartpage4-view .research-context[data-v8d-style="4"] p { grid-row: 3; }
  body.chartpage4-view .research-context[data-v8d-style="4"] .v8d-link { grid-row: 4; }
}
@media (prefers-reduced-motion: reduce) { body.chartpage4-view .research-context.v8d { transition: none; } }
/* N1 for every company that has a logo (18 Nov 2026 owner decision; research-view.js DESC_LOGOS): the same N1 layout as above, but a plain band: no click, no cycling, no dots, normal cursor. Only Amazon cycles. */
body.chartpage4-view .research-context.v8d.v8d-static { cursor: auto; }
/* Country band (V4, 18 Nov 2026; research-view.js descCountry / DESC_FLAGS): the same N1 layout, with the country FLAG (round Circle Flags SVG, the file the entity page uses) in place of the white logo badge, no padding or background.
   .v8d-pending = the "View <Country> page" link keeps its row but stays invisible (and out of the tab order) until the entity page is confirmed to exist. */
body.chartpage4-view .research-context .v8d-logo.v8d-flag { width: 56px; max-width: none; padding: 0; background: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
body.chartpage4-view .research-context .v8d-link.v8d-pending { visibility: hidden; }

/* QA 18 Nov 2026: in View 4/6/7/8 above 800 px the "Preview layout" dropdown and the Finance link sat under the centred search box (not clickable, but still tab stops).
   Same rule the old .polished-view had: the dropdown and Finance link go to the right, next to the theme button. 800 px and below is unchanged (dropdown visible; Finance stays hidden from 801 to 1000 px). */
@media (min-width: 801px) { .chart-first-view .nav #views { margin-left: auto; } .chart-first-view .nav .right { margin-left: 0; } }

/* COMPARE-CHROME 20 Nov 2026: "About this comparison" band for answers about 2+ entities (research-view.js compareBand). In View 8 it reuses the accent-bar band (data-v8d-style="3"):
   label, sentence, measure definition, then one row per entity (flag or logo + the entity's own one-line description + "View page" when the page exists). */
.research-context.cmp-band .cmp-s { color: var(--ink); }
.research-context.cmp-band .cmp-def { margin-top: 6px; }
.research-context.cmp-band .cmp-ents { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px 28px; max-width: 960px; }
.research-context.cmp-band .cmp-ent { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; align-items: start; font-size: .9375rem; line-height: 1.5; color: var(--v8-band-ink, var(--ink-2)); }
.research-context.cmp-band .cmp-ent.cmp-noimg { grid-template-columns: minmax(0, 1fr); }
.research-context.cmp-band .cmp-ent b { color: var(--ink); font-weight: 650; }
.research-context.cmp-band .cmp-flag { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; margin-top: 1px; }
.research-context.cmp-band .cmp-logo { width: 28px; height: 28px; padding: 3px; box-sizing: border-box; border-radius: 7px; background: #fff; object-fit: contain; box-shadow: 0 0 0 1px color-mix(in srgb, #000 12%, transparent); margin-top: 1px; }
.research-context.cmp-band .cmp-link { font-weight: 600; white-space: nowrap; color: color-mix(in srgb, var(--accent) 70%, var(--ink)); text-decoration: underline; text-underline-offset: 3px; }
body.chartpage4-view .research-context.cmp-band .cmp-ents { order: 4; }
body.chartpage4-view .research-context.cmp-band .cmp-s, body.chartpage4-view .research-context.cmp-band .cmp-def { order: 2; font-size: 1rem; line-height: 1.6; }
@media (max-width: 700px) { .research-context.cmp-band .cmp-ents { grid-template-columns: minmax(0, 1fr); } }
