/* Markets section: page-only styles on top of the shared style.css. */
.mk-head { align-items: end; }
/* desktop: the data note sits on the title's row, at the right, instead of a row of its own */
@media (min-width: 821px) {
  .mk-head.wrap.wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 40px; }
  .mk-head .mk-through { flex: none; padding-bottom: 6px; }
}
.mk-through { color: var(--muted); font-size: 0.9rem; justify-self: end; text-align: right; max-width: 30ch; }
.mk-through b { color: var(--ink); font-weight: 600; }
@media (max-width: 820px) { .mk-through { justify-self: start; text-align: left; max-width: none; margin-top: 4px; } }

.mk-nav { margin-top: 6px; }
.mk-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; margin-top: 10px; }
.mk-range-label { font-family: var(--font-display); font-size: 1rem; font-variant-numeric: lining-nums tabular-nums; }
.mk-brush { cursor: crosshair; touch-action: none; user-select: none; }
.mk-brush .mk-brush-line { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-opacity: 0.7; }
.mk-brush .mk-brush-win { fill: var(--gold-soft); fill-opacity: 0.75; cursor: grab; }
.mk-brush .mk-brush-edge { stroke: var(--gold); stroke-width: 2; }
.mk-brush .mk-brush-ax { font-size: 10.5px; }
.mk-brush-hint { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }

.mk-card { padding-top: 40px; border-top: 1px solid var(--line); margin-top: 34px; }
.mk-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 18px; }
.mk-card-head h2 { font-size: var(--step-2); }
.mk-sub { color: var(--muted); font-size: 0.92rem; margin-top: 4px; max-width: 60ch; }
.mk-toggles { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.mk-toggles .preset { padding: 6px 10px; font-size: 0.84rem; }
.mk-answer { margin-bottom: 8px; }
.mk-answer .answer-line { max-width: 70ch; }
.mk-note { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }

.mk-chart .mk-line { stroke-width: 2; }
.mk-chart .mk-bear { fill: var(--rust); fill-opacity: 0.1; }
.mk-chart .mk-bear-tag { fill: var(--rust); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-chart .mk-bear-year { fill: var(--muted); font-size: 10.5px; }
.mk-chart .mk-median { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; stroke-opacity: 0.7; }
.mk-chart .mk-median-tag { fill: var(--muted); font-size: 11.5px; }
.mk-sq-bear { background: var(--rust); opacity: 0.25; }
@media (max-width: 600px) {
  .mk-toggles { gap: 6px; }
  .mk-ranges .preset { padding: 6px 8px; font-size: 0.82rem; }
}
.mk-short { display: none; }
/* phones: the main chart and the strip under it run edge to edge */
@media (max-width: 600px) { .chart-box.mk-chart#chart-main, .chart-box.mk-brush { margin-inline: -16px; } }
@media (max-width: 600px) {
  .mk-ranges { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; gap: 4px; }
  .mk-ranges .preset { text-align: center; padding: 7px 0; }
  .mk-long { display: none; } .mk-short { display: inline; }
}

/* links in the eyebrow back to the hub */
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.mk-card-first { margin-top: 18px; }
.mk-card.mk-card-first { padding-top: 26px; }
@media (max-width: 600px) { .mk-card.mk-card-first { padding-top: 18px; margin-top: 12px; } }

/* extra marks */
.mk-chart .mk-clip-tag { fill: var(--muted); font-size: 11.5px; }
.mk-chart .mk-infl { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-opacity: 0.75; stroke-dasharray: 3 3; }
.mk-chart .mk-gap { fill: var(--rust); fill-opacity: 0.16; }
.mk-chip-med { border-top: 1.3px dashed var(--ink); }
.mk-chip-infl { border-top: 1.3px dashed var(--ink); opacity: 0.75; }
.mk-sq-gap { background: var(--rust); opacity: 0.3; }
.tip .t-note { color: var(--muted); font-size: 0.78rem; }

/* CAPE: what came next */
.mk-next-line { max-width: 70ch; margin-bottom: 10px; }
.mk-chart .mk-dot { fill: var(--muted); fill-opacity: 0.35; }
.mk-chart .mk-dot-hit { fill: var(--gold); fill-opacity: 0.9; }
.mk-chart .mk-now-band { fill: var(--gold-soft); fill-opacity: 0.6; }
.mk-chart .mk-now-line { stroke: var(--gold); stroke-width: 1.5; }
.mk-chart .mk-now-tag { fill: var(--gold); font-size: 12px; font-weight: 700; }
.mk-chart .mk-ax-title { font-size: 11.5px; }

/* world page */
.mk-pick { margin-bottom: 10px; }
.mk-countries { gap: 5px; }
.mk-countries .preset { padding: 5px 9px; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 6px; }
.mk-range-world { margin: 4px 0 6px; }
.mk-swatch { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 6px; background: currentColor; }
.mk-countries .preset .mk-swatch { margin-right: 0; }
.c0 .mk-swatch, .mk-swatch.c0 { background: var(--gold); }
.c1 .mk-swatch, .mk-swatch.c1 { background: var(--slate); }
.c2 .mk-swatch, .mk-swatch.c2 { background: var(--ink); }
.c3 .mk-swatch, .mk-swatch.c3 { background: var(--muted); }
.mk-chart .mk-wline { fill: none; stroke-width: 2; stroke-linejoin: round; }
.mk-chart .mk-wline.c0 { stroke: var(--gold); stroke-width: 2.4; }
.mk-chart .mk-wline.c1 { stroke: var(--slate); }
.mk-chart .mk-wline.c2 { stroke: var(--ink); stroke-width: 1.5; }
.mk-chart .mk-wline.c3 { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 3; }
.mk-chart .mk-wdot.c0 { fill: var(--gold); } .mk-chart .mk-wdot.c1 { fill: var(--slate); }
.mk-chart .mk-wdot.c2 { fill: var(--ink); } .mk-chart .mk-wdot.c3 { fill: var(--muted); }
.mk-chart .mk-wtag { font-size: 12px; font-weight: 700; }
.mk-chart .mk-wtag.c0 { fill: var(--gold); } .mk-chart .mk-wtag.c1 { fill: var(--slate); }
.mk-chart .mk-wtag.c2 { fill: var(--ink); } .mk-chart .mk-wtag.c3 { fill: var(--muted); }
.stats.mk-wstats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
.mk-wstats .label { display: flex; align-items: center; }
.mk-wstats .mk-neg { color: var(--rust); }
@media (max-width: 640px) { .stats.mk-wstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mk-waits .mk-wait { fill: var(--base-fill); }
.mk-waits .mk-wait.is-sel { fill: var(--gold-area); }
.mk-waits .mk-wait.is-open { fill: url(#hb-hatch-loss); stroke: var(--rust); stroke-width: 1; }
.mk-waits .mk-wait-name { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.mk-waits .mk-wait-val { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-waits .mk-wait-when { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* more charts, hub */
.mk-more .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .mk-more .related-grid { grid-template-columns: minmax(0, 1fr); } }
.mk-more-hub { margin-top: 14px; font-size: 0.92rem; }
.mk-hub-intro { max-width: 62ch; color: var(--muted); margin-top: 8px; }
.mk-hub-grid { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .mk-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mk-hub-grid { grid-template-columns: minmax(0, 1fr); } }
.mk-hub-grid li { border-bottom: 1px solid var(--line); }
.mk-hub-card { display: grid; gap: 6px; padding: 20px 18px 22px 0; color: var(--ink); text-decoration: none; height: 100%; }
.mk-hub-card:hover .mk-hub-name { color: var(--gold); text-decoration: underline; }
.mk-hub-name { font-family: var(--font-display); font-size: 1.3rem; }
.mk-hub-now { font-size: 0.88rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.mk-hub-spark { display: block; height: 56px; }
.mk-hub-spark svg { width: 100%; height: 56px; display: block; }
.mk-hub-spark .mk-spark { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.mk-hub-line { color: var(--muted); font-size: 0.9rem; }
@media (min-width: 901px) { .mk-hub-grid li:last-child:nth-child(3n + 1) { grid-column: 1 / -1; } .mk-hub-grid li:last-child:nth-child(3n + 1) .mk-hub-card { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 32px; } .mk-hub-grid li:last-child:nth-child(3n + 1) .mk-hub-spark { grid-column: 2; grid-row: 1 / span 3; height: 100%; } }
.mk-countries .preset[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.mk-countries .preset[aria-pressed="true"] .mk-swatch { width: 14px; height: 4px; }
.mk-chart .mk-median-tag, .mk-chart .mk-clip-tag, .mk-chart .mk-now-tag, .mk-chart .mk-wtag { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }

/* today: a faint level line and a labelled end point */
.mk-chart .mk-today { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 4; stroke-opacity: 0.7; }
.mk-chart .mk-end-dot { fill: var(--gold); stroke: var(--paper); stroke-width: 2; }
.mk-chart .mk-end-val { fill: var(--gold); font-family: var(--font-body); font-size: 13px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.mk-chart .mk-end-date { fill: var(--muted); font-size: 11px; font-weight: 400; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.mk-chart .mk-end { transition: opacity 0.12s; }
.mk-chart .mk-end.dim { opacity: 0.55; }
.mk-chart .mk-hover-level { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.45; }
.mk-chart .mk-hover-val { fill: var(--ink); font-family: var(--font-body); font-size: 13px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.mk-chart .mk-tag-bg { fill: var(--paper); fill-opacity: 0.92; }
.mk-start-note { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.mk-world-head .preset.is-short:not([aria-pressed="true"]), .preset.is-short:not([aria-pressed="true"]) { border-style: dashed; color: var(--muted); }

/* What the data shows: numbered findings, each with one big figure, some with small bars */
.mk-find-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mk-find { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 6px 28px; padding: 18px 0 20px; border-bottom: 1px solid var(--line); }
.mk-find-big { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.15; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.mk-find-text h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; margin: 0 0 4px; }
.mk-find-text p { max-width: 68ch; margin: 0; }
@media (max-width: 640px) { .mk-find { grid-template-columns: minmax(0, 1fr); } .mk-find-big { font-size: 1.6rem; } }
.mk-bars { display: grid; gap: 6px; margin-top: 12px; max-width: 620px; }
.mk-bar-row { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) minmax(0, 4.5rem); align-items: center; gap: 10px; font-size: 0.9rem; }
.mk-bar-l { color: var(--ink); }
.mk-bar-t { display: block; height: 12px; }
.mk-bar { display: block; height: 100%; background: var(--gold); }
.mk-bar.is-neg { background: var(--rust); }
.mk-bar-v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.mk-bar-n { display: block; color: var(--muted); font-weight: 400; font-size: 0.78rem; white-space: normal; }
.mk-bars-note, .mk-find-text .mk-bars-note { color: var(--muted); font-size: 0.82rem; margin-top: 10px; max-width: 68ch; }
@media (max-width: 640px) {
  .mk-find { padding: 16px 0 18px; gap: 2px; }
  .mk-find-big { font-size: 1.5rem; }
  .mk-find-text h3 { font-size: 1.08rem; margin-bottom: 6px; }
  .mk-find-text p { font-size: 0.95rem; }
  /* bars stack: label and value on one line, the bar full width under them */
  .mk-bars { gap: 10px; margin-top: 14px; }
  .mk-bar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; gap: 3px 12px; font-size: 0.86rem; }
  .mk-bar-l { grid-area: l; }
  .mk-bar-v { grid-area: v; }
  .mk-bar-t { grid-area: t; height: 8px; }
  .mk-bar-n { display: inline; font-size: 0.78rem; }
  .mk-bar-n::before { content: " \00b7  "; }
  .mk-find-text .mk-bars-note { margin-top: 12px; font-size: 0.8rem; }
}
.mk-hub-finds ol { padding-left: 1.3em; }
.mk-hub-finds li { margin: 0 0 8px; }

/* dividends and buybacks (dividend yield page) */
.mk-chart .mk-pay-div { fill: var(--gold); }
.mk-chart .mk-pay-buy { fill: var(--slate); fill-opacity: 0.75; }
.mk-chart .mk-pay-iss { fill: var(--rust); fill-opacity: 0.45; }
.mk-chart .mk-pay-hl { fill: var(--ink); fill-opacity: 0.08; }
.mk-sq-div { background: var(--gold); }
.mk-sq-buy { background: var(--slate); opacity: 0.75; }
.mk-sq-iss { background: var(--rust); opacity: 0.45; }

/* returns by holding period */
.hp-years { margin: 0 0 14px; }
.mk-chart .hp-zero { stroke: var(--ink); stroke-width: 1.2; }
.mk-chart .hp-pick { fill: var(--gold-soft); fill-opacity: 0.7; }
.mk-chart .hp-whisk { stroke: var(--ink); stroke-width: 1.1; stroke-opacity: 0.55; }
.mk-chart .hp-band { fill: var(--gold-area); fill-opacity: 0.28; }
.mk-chart .hp-box { fill: var(--gold); fill-opacity: 0.78; }
.mk-chart .hp-med { stroke: var(--paper); stroke-width: 2; }
.mk-chart .hp-clip { fill: var(--muted); font-size: 10.5px; }
.mk-chart .hp-ax-title { font-size: 11px; }
.mk-chart .hp-tick { stroke: var(--muted); stroke-width: 1; }
.mk-chart .hp-cell { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.hp-chip-whisk { display: inline-block; width: 2px; height: 12px; background: var(--ink); opacity: 0.55; vertical-align: middle; margin: 0 8px 0 4px; }
.hp-chip-med { display: inline-block; width: 14px; height: 3px; background: var(--gold); border-top: 1px solid var(--paper); vertical-align: middle; margin-right: 6px; }
.hp-sq-band { background: var(--gold-area); opacity: 0.35; }
.hp-sq-box { background: var(--gold); opacity: 0.8; }
.hp-key { display: grid; grid-template-columns: auto minmax(120px, 260px) auto; align-items: center; gap: 2px 10px; font-size: 0.8rem; color: var(--muted); position: relative; }
.hp-key-bar { height: 10px; display: block; }
.hp-key-z { grid-column: 2; text-align: center; font-size: 0.72rem; margin-left: -12%; }

/* investing at all-time highs */
.mk-chart .ah-high-band { fill: var(--gold-area); fill-opacity: 0.3; }
.mk-chart .ah-high-box { fill: var(--gold); fill-opacity: 0.85; }
.mk-chart .ah-other-band { fill: var(--slate); fill-opacity: 0.22; }
.mk-chart .ah-other-box { fill: var(--slate); fill-opacity: 0.8; }
.mk-chart .ah-up { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-chart .ah-high-t { fill: var(--gold); }
.mk-chart .ah-other-t { fill: var(--slate); }
.mk-chart .ah-cap { font-size: 11px; }
.mk-chart .ah-line { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-opacity: 0.8; }
.mk-chart .ah-dot { fill: var(--gold); }
.mk-chart .ah-tick { stroke: var(--gold); stroke-width: 1; stroke-opacity: 0.6; }
.ah-sq-high { background: var(--gold); opacity: 0.85; }
.ah-sq-other { background: var(--slate); opacity: 0.8; }
.ah-sq-dot { background: var(--gold); border-radius: 50%; width: 8px !important; height: 8px !important; }

/* stocks vs bonds vs cash */
.mk-chart .mk-bond { fill: none; stroke: var(--slate); stroke-width: 1.8; stroke-linejoin: round; }
.mk-chart .mk-cash { fill: none; stroke: var(--rust); stroke-width: 1.5; stroke-linejoin: round; stroke-dasharray: 5 3; }
.mk-chip-bond { border-top: 2px solid var(--slate); }
.mk-chip-cash { border-top: 2px dashed var(--rust); }
.stats.mk-astats { margin-top: 14px; }
.mk-astats .sub + .sub { margin-top: 2px; }
/* the hub: an odd last pair on desktop fills the row */
@media (min-width: 901px) { .mk-hub-grid li:last-child:nth-child(3n + 2) { grid-column: span 2; } .mk-hub-grid li:last-child:nth-child(3n + 2) .mk-hub-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; } .mk-hub-grid li:last-child:nth-child(3n + 2) .mk-hub-spark { grid-column: 2; grid-row: 1 / span 3; height: 100%; } }
/* hover outlines a button; only the picked one is filled, so the two never look alike */
.mk-ranges .preset:not([aria-pressed="true"]):hover, .mk-toggles .preset:not([aria-pressed="true"]):hover { background: transparent; color: var(--ink); border-color: var(--ink); }
@media (max-width: 600px) { .mk-ranges:has(.preset[hidden]) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* phones: the chart's toggles fit one row, each pair joined like a switch */
@media (max-width: 600px) {
  .mk-toggles { flex-wrap: nowrap; gap: 5px; width: 100%; }
  .mk-toggles .presets { flex-wrap: nowrap; gap: 0; flex: 0 1 auto; min-width: 0; }
  .mk-toggles .preset { padding: 7px 6px; font-size: clamp(0.66rem, 2.9vw, 0.75rem); white-space: nowrap; }
  .mk-toggles .presets .preset + .preset { margin-left: -1px; }
  .mk-toggles .presets .preset:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
  .mk-toggles .presets .preset:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
}
