/* Adams' Synchronological Chart viewer — gregggo.com/adams-chart
   Same type and accent as the main site; dark chrome so the paper colours of the chart stand out. */
:root {
  --ink: #0b0b0b;
  --chrome: #121212;
  --chrome-2: #1d1d1d;
  --line: #2c2c2c;
  --paper: #ffffff;
  --text: #0b0b0b;
  --mute: #6b6b6b;
  --on-dark: #f4f1ea;
  --on-dark-mute: #a19d95;
  --accent: #ff5b1f;
  --r: 10px;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --top-h: 60px;
  --panel-w: 380px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--chrome); color: var(--on-dark);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  overflow: hidden; overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { height: 100dvh; display: grid; grid-template-rows: var(--top-h) 1fr auto; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: var(--chrome); z-index: 5; min-width: 0;
}
.brand { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; transition: background .2s; }
.brand:hover { background: var(--chrome-2); }
.brand img { width: auto; height: 26px; }
.ttl { min-width: 0; flex: 1; }
.ttl h1 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttl p { font-size: 12.5px; color: var(--on-dark-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { display: flex; gap: 6px; flex: none; }
.tbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 999px; font-size: 14px; font-weight: 600; border: 1px solid var(--line);
  transition: background .2s, border-color .2s, color .2s;
}
.tbtn svg { width: 17px; height: 17px; }
.tbtn:hover { background: var(--chrome-2); }
.tbtn[aria-expanded="true"] { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }
#btn-tour svg path { fill: currentColor; stroke: none; }

/* ---------- stage ---------- */
.stage { position: relative; overflow: hidden; background: #262320; }
.osd { position: absolute; inset: 0; }
.osd .openseadragon-canvas:focus { outline: none; }

.year {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
  padding: 8px 18px 9px; border-radius: 14px; background: rgba(11, 11, 11, .78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: center;
  transition: left .45s var(--ease);
}
.year b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.year span { font-size: 11.5px; color: var(--on-dark-mute); letter-spacing: .02em; }
.stage.with-l .year { left: calc(50% + var(--panel-w) / 2 + 8px); }
.stage.with-r .year { left: calc(50% - var(--panel-w) / 2 - 8px); }

.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; z-index: 4; background: #262320; color: var(--on-dark-mute); text-align: center; padding: 24px; transition: opacity .5s; }
.loading.done { opacity: 0; pointer-events: none; }
.loading a { color: var(--on-dark); }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #3a3632; border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ctrls {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; flex-direction: column; gap: 2px; padding: 5px; border-radius: 14px;
  background: rgba(11, 11, 11, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: right .45s var(--ease);
}
.stage.with-r .ctrls { right: calc(var(--panel-w) + 28px); }
.ctrls button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--on-dark); transition: background .15s; }
.ctrls button:hover { background: rgba(255, 255, 255, .12); }

/* highlight boxes drawn on top of the chart */
.hl { border: 3px solid var(--accent); border-radius: 6px; box-shadow: 0 0 0 9999px rgba(11, 11, 11, .28); pointer-events: none; animation: hlin .6s var(--ease); }
.hl.hit { box-shadow: 0 0 0 4px rgba(255, 91, 31, .25); border-width: 3px; }
@keyframes hlin { from { opacity: 0; } }
.ymark { pointer-events: none; overflow: visible; }
.ymark i { position: absolute; left: -1px; top: 0; bottom: 0; width: 3px; background: var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.25); animation: hlin .4s var(--ease); }

/* ---------- panels ---------- */
.panel {
  position: absolute; top: 12px; bottom: 12px; width: var(--panel-w); z-index: 4;
  display: flex; flex-direction: column; background: var(--paper); color: var(--text);
  border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); overflow: hidden;
  animation: pin .35s var(--ease);
}
.panel-l { left: 12px; }
.panel-r { right: 12px; }
@keyframes pin { from { opacity: 0; transform: translateY(8px); } }
.p-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 0 22px; flex: none; }
.p-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.x { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--mute); transition: background .15s, color .15s; }
.x:hover { background: #f0f0f0; color: var(--text); }
.p-body { padding: 8px 22px 18px; overflow-y: auto; flex: 1; }
.t-when { font-size: 14px; color: var(--mute); font-weight: 600; }
.p-body h2 { font-size: 27px; line-height: 1.08; letter-spacing: -.025em; font-weight: 800; margin: 2px 0 14px; }
#t-text p { margin-bottom: 12px; font-size: 15.5px; line-height: 1.55; }
.t-look { margin-top: 4px; padding: 12px 14px; border-radius: 10px; background: #fff3ed; font-size: 14.5px; line-height: 1.5; }
.t-look::before { content: "Look for  "; font-weight: 700; color: var(--accent); }
.p-foot { flex: none; padding: 12px 22px 18px; border-top: 1px solid #eee; display: grid; gap: 12px; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dots button { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; }
.dots button::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d6d6d6; transition: background .2s, transform .2s; }
.dots button:hover::after { background: #9a9a9a; }
.dots button[aria-selected="true"]::after { background: var(--accent); transform: scale(1.35); }
.t-nav { display: flex; gap: 8px; justify-content: space-between; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 20px;
  border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .2s var(--ease), background .2s;
}
.pill:hover { transform: translateY(-1px); }
.pill.ghost { background: #efefef; color: var(--text); }
.pill:disabled { opacity: .35; pointer-events: none; }
#t-next { flex: 1; background: var(--accent); }

/* search */
.s-form { padding: 10px 22px 0; flex: none; }
.s-form input {
  width: 100%; height: 46px; padding: 0 16px; border-radius: 12px; border: 1.5px solid #dcdcdc;
  background: #fafafa; color: var(--text); font-size: 16px; outline: none; transition: border-color .15s, background .15s;
}
.s-form input:focus { border-color: var(--ink); background: #fff; }
.s-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 22px 0; flex: none; }
.s-chips button { height: 30px; padding: 0 12px; border-radius: 999px; background: #f0f0f0; font-size: 13.5px; font-weight: 500; color: var(--text); }
.s-chips button:hover { background: #e4e4e4; }
.s-meta { padding: 12px 22px 8px; font-size: 13px; color: var(--mute); flex: none; }
.s-list { list-style: none; overflow-y: auto; flex: 1; padding: 0 10px 14px; }
.s-list li button {
  width: 100%; display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: baseline; text-align: left;
  padding: 9px 12px; border-radius: 10px; color: var(--text); transition: background .12s;
}
.s-list li button:hover, .s-list li button.on { background: #f3f3f3; }
.s-list .yr { font-size: 13px; font-weight: 700; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-list .tx { font-size: 14px; line-height: 1.4; word-break: break-word; }
.s-list mark { background: #ffd9c7; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- bottom: timeline + credit ---------- */
.bottom { border-top: 1px solid var(--line); background: var(--chrome); padding: 10px 16px 10px; display: grid; gap: 8px; z-index: 5; }
.tl-wrap { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 3px; align-items: center; }
.goto { grid-row: 1; display: flex; align-items: center; gap: 6px; }
.goto label { font-size: 12px; font-weight: 600; color: var(--on-dark-mute); white-space: nowrap; }
.goto input { width: 112px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--chrome-2); font-size: 14px; outline: none; }
.goto input:focus { border-color: var(--on-dark-mute); }
.goto input.bad { border-color: var(--accent); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.goto button { width: 34px; height: 34px; border-radius: 9px; background: var(--on-dark); color: var(--ink); font-weight: 700; }
.tl {
  grid-row: 1; grid-column: 2; position: relative; height: 46px; border-radius: 8px; overflow: hidden;
  background: #3a342c; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
}
.tl-img { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; opacity: .92; }
.tl-win {
  position: absolute; top: 0; bottom: 0; min-width: 4px; border: 2px solid var(--accent); border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(11, 11, 11, .5); pointer-events: none;
}
.tl-stops { position: absolute; inset: 0; pointer-events: none; }
.tl-stops i { position: absolute; bottom: 3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.55); }
.tl-ticks { grid-row: 2; grid-column: 2; position: relative; height: 15px; font-size: 11px; color: var(--on-dark-mute); font-variant-numeric: tabular-nums; }
.tl-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }
.credit { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; line-height: 1.45; color: var(--on-dark-mute); }
.credit b { color: var(--on-dark); font-weight: 600; }
.credit a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255,255,255,.3); }
.credit a:hover { color: var(--on-dark); }
.credit .nc { color: var(--on-dark); }

/* ---------- welcome + about ---------- */
.welcome { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(11, 11, 11, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .4s; }
@keyframes fade { from { opacity: 0; } }
.w-card { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--paper); color: var(--text); border-radius: 20px; padding: 28px 28px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: pin .5s var(--ease); }
.w-card h2 { font-size: clamp(28px, 6vw, 36px); line-height: 1.02; letter-spacing: -.03em; font-weight: 800; margin: 6px 0 14px; }
.w-card > p { font-size: 16px; line-height: 1.55; }
.w-tips { list-style: none; display: grid; gap: 8px; margin: 16px 0 20px; padding: 14px 16px; background: #f5f5f5; border-radius: 12px; font-size: 14.5px; }
.w-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.w-btns .pill { flex: 1 1 180px; height: 48px; font-size: 16px; }
#w-tour { background: var(--accent); }
.w-credit { margin-top: 16px; font-size: 12.5px; color: var(--mute); line-height: 1.5; }

.about { border: 0; padding: 0; margin: auto; width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border-radius: 20px; background: var(--paper); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.about::backdrop { background: rgba(11, 11, 11, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.about[open] { animation: pin .4s var(--ease); }
.a-in { position: relative; padding: 28px 28px 24px; }
.a-in > .x { position: absolute; top: 14px; right: 14px; }
.a-in h2 { font-size: 28px; line-height: 1.05; letter-spacing: -.025em; font-weight: 800; margin: 6px 40px 18px 0; }
.a-in h3 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 24px 0 10px; }
.a-in p { font-size: 15px; line-height: 1.55; margin-bottom: 10px; }
.a-in p a:not(.pill), .a-cite a, .a-small a { text-decoration: underline; text-underline-offset: 2px; }
.a-note { padding: 14px 16px; border-radius: 12px; background: #fff3ed; font-size: 14.5px; line-height: 1.55; }
.a-note b { display: block; color: var(--accent); margin-bottom: 2px; }
.a-meta { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 14.5px; line-height: 1.5; }
.a-meta dt { color: var(--mute); font-weight: 600; }
.a-keys { list-style: none; display: grid; gap: 8px; font-size: 14px; color: #333; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px; border-radius: 6px; border: 1px solid #d5d5d5; border-bottom-width: 2px; font: 600 12.5px/1.5 var(--font); text-align: center; background: #fafafa; }
.a-small { margin-top: 18px; font-size: 13px !important; color: var(--mute); }

.toast { position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 20px); z-index: 30; padding: 10px 16px; border-radius: 999px; background: var(--on-dark); color: var(--ink); font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.nojs { position: fixed; inset: auto 16px 16px; padding: 14px; border-radius: 12px; background: #fff; color: #000; z-index: 50; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  :root { --top-h: 54px; }
  .top { gap: 10px; padding: 0 10px 0 12px; }
  .ttl h1 { font-size: 15px; }
  .ttl p { font-size: 11.5px; }
  .tbtn { width: 38px; padding: 0; justify-content: center; }
  .tbtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .year { top: 10px; padding: 6px 14px 7px; }
  .year b { font-size: 20px; }
  .stage.with-l .year, .stage.with-r .year { left: 50%; }
  .ctrls { top: auto; bottom: 12px; right: 10px; transform: none; flex-direction: row; }
  .ctrls button { width: 38px; height: 38px; }
  .stage.with-r .ctrls { right: 10px; }
  .stage.with-l .ctrls, .stage.with-r .ctrls { opacity: 0; pointer-events: none; }
  .panel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; height: 56%; border-radius: 16px; }
  .dots { display: none; }
  .p-head { padding-top: 8px; }
  .p-body { padding-top: 2px; }
  .pill { height: 40px; }
  .panel-r { top: 8px; height: auto; }
  .p-body h2 { font-size: 23px; }
  #t-text p { font-size: 15px; }
  .p-foot { padding: 10px 16px 14px; }
  .p-body, .s-form, .s-chips, .s-meta { padding-left: 16px; padding-right: 16px; }
  .p-head { padding-left: 16px; }
  .bottom { padding: 8px 10px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); gap: 6px; }
  .tl-wrap { grid-template-columns: 1fr; }
  .goto { grid-row: 3; justify-content: flex-start; margin-top: 4px; }
  .goto input { flex: 1; max-width: 200px; }
  .tl { grid-column: 1; grid-row: 1; height: 40px; }
  .tl-ticks { grid-column: 1; grid-row: 2; }
  .tl-ticks span.opt { display: none; }
  .credit { font-size: 10.5px; gap: 0 8px; }
  .credit span:first-child { display: none; }
  .w-card { padding: 22px 20px 18px; }
  .a-in { padding: 22px 20px 20px; }
  .a-meta { grid-template-columns: 1fr; gap: 0; }
  .a-meta dd { margin-bottom: 8px; }
  .toast { bottom: 150px; }
}
@media (pointer: coarse) {
  #z-in, #z-out { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   Original / Modern toggle
   ===================================================================== */
.seg { display: inline-flex; flex: none; padding: 3px; border-radius: 999px; background: var(--chrome-2); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--on-dark-mute); transition: background .2s, color .2s; white-space: nowrap; }
.seg button:hover { color: var(--on-dark); }
.seg button[aria-pressed="true"] { background: var(--on-dark); color: var(--ink); }
.app.modern .osd { visibility: hidden; }
.app.modern .loading { display: none; }
.app.modern .stage { background: #fff; }
.app.modern .year { background: rgba(11, 11, 11, .88); }

/* =====================================================================
   Modern view — the chart redrawn in the Gregggo style
   ===================================================================== */
.mv { position: absolute; inset: 0; z-index: 2; background: #fff; color: var(--text); --grid: #efefef; }
.mv-axis { position: absolute; left: 0; right: 0; top: 0; height: 40px; z-index: 3; background: rgba(255,255,255,.94); border-bottom: 1px solid #ececec; overflow: hidden; pointer-events: none; }
.mv-tick { position: absolute; top: 0; bottom: 0; left: 0; padding: 13px 0 0 6px; border-left: 1px solid #e3e3e3; font-size: 12px; font-weight: 600; color: #9a9a9a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mv-tick.major { color: var(--ink); border-left-color: #c9c9c9; }
.mv-scroll { position: absolute; left: 0; right: 0; top: 40px; bottom: 0; overflow-x: hidden; overflow-y: auto; cursor: grab; touch-action: pan-y; overscroll-behavior: contain; }
.mv-scroll.drag { cursor: grabbing; }
.mv-scroll.drag * { pointer-events: none; }
.mv-content { position: relative; min-height: 100%; background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px); background-repeat: repeat; }
.mv-head {
  position: absolute; left: 0; right: 0; height: 34px; padding: 12px 16px 0;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
  border-top: 1px solid #ededed; pointer-events: none; background: linear-gradient(#fff 70%, rgba(255,255,255,0));
}
.mv-head::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--hue, var(--accent)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); vertical-align: 1px; }
.mv-head-p::before { background: var(--ink); }
.mv-bar, .mv-person {
  position: absolute; left: 0; height: 36px; border-radius: 8px; overflow: hidden; text-align: left;
  background: var(--hue); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); transition: box-shadow .15s, filter .15s;
}
.mv-bar:hover, .mv-person:hover { box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.35); }
.mv-lab { position: absolute; left: 0; top: 0; z-index: 2; padding: 0 8px; line-height: 22px; white-space: nowrap; will-change: transform; }
.mv-seg { position: absolute; top: 0; bottom: 0; border-left: 2px solid rgba(255,255,255,.85); overflow: hidden; }
.mv-seg em { position: absolute; left: 8px; max-width: calc(100% - 12px); bottom: 3px; will-change: transform; font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--ink); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-seg.tight em { display: none; }
.mv-bar .mv-seg:first-child { border-left-color: transparent; }
.mv-person { height: 20px; border-radius: 999px; background: #f1f1f1; font-size: 12px; font-weight: 600; box-shadow: inset 0 0 0 1px #e2e2e2; }
.mv-person .mv-lab { line-height: 20px; }
.mv-person.chart { background: #fff; box-shadow: inset 0 0 0 1px #c9c9c9; border: 1px dashed #b5b5b5; }
.mv-person.on { background: var(--accent); color: #fff; box-shadow: none; border-color: transparent; z-index: 2; }
.mv-person.on.b { background: var(--ink); }
.mv-ev { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 0; border-radius: 999px; font-size: 12px; color: #333; white-space: nowrap; background: rgba(255,255,255,.9); }
.mv-ev i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #fff; flex: none; }
.mv-ev.chart i { background: #fff; box-shadow: 0 0 0 3px #fff, inset 0 0 0 2px var(--accent); }
.mv-ev b { font-weight: 700; color: var(--ink); }
.mv-ev:hover { color: var(--ink); }
.mv-foot { position: absolute; left: 16px; right: 16px; font-size: 12.5px; color: var(--mute); max-width: 72ch; }
.mv-bands { position: absolute; left: 0; right: 0; top: 40px; bottom: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.mv-mark { position: absolute; top: 0; bottom: 0; left: -1px; width: 3px; background: var(--accent); }
.mv-band { position: absolute; top: 0; bottom: 0; background: rgba(255, 91, 31, .1); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.mv-band.b { background: rgba(11, 11, 11, .06); border-color: var(--ink); }
.mv-band span, .life span {
  position: absolute; left: 6px; top: 8px; padding: 4px 9px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.mv-band.b span { top: 38px; background: var(--ink); }
.mv-band small, .life small { font-weight: 500; opacity: .85; margin-left: 4px; }
.mv-tip { position: absolute; left: 0; top: 0; z-index: 5; display: grid; gap: 1px; min-width: 160px; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none; }
.mv-tip b { font-size: 14px; }
.mv-tip span { color: #bdbdbd; }
.mv-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 2px 12px rgba(0,0,0,.08); font-size: 12.5px; color: var(--mute); white-space: nowrap; pointer-events: none; animation: hintout 1s 6s forwards; }
@keyframes hintout { to { opacity: 0; } }
.stage.with-r .mv-hint { left: calc(50% - var(--panel-w) / 2); }

/* lifespans drawn over the original */
.life { pointer-events: none; background: rgba(255, 91, 31, .16); border-left: 3px solid var(--accent); border-right: 3px solid var(--accent); animation: hlin .5s var(--ease); }
.life.b { background: rgba(11, 11, 11, .14); border-color: var(--ink); }
.life.b span { top: 42px; background: var(--ink); }
.life span { top: 10px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* =====================================================================
   Search & compare panel
   ===================================================================== */
.tabs { display: flex; gap: 4px; padding: 10px 18px 2px; flex: none; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--mute); white-space: nowrap; transition: background .15s, color .15s; }
.tabs button:hover { background: #f2f2f2; color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.pane > .s-list { overflow: visible; flex: none; }
.p-list .tx { display: grid; }
.p-list .tx b { font-weight: 650; }
.p-list .tx small { font-size: 12.5px; color: var(--mute); }
.p-detail { padding: 6px 22px 22px; }
.back { font-size: 13.5px; font-weight: 600; color: var(--mute); padding: 6px 0; }
.back:hover { color: var(--text); }
.p-detail h3 { font-size: 28px; line-height: 1.05; letter-spacing: -.025em; font-weight: 800; margin: 2px 0 8px; }
.p-detail h4, .yr-out h4 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 22px 0 6px; }
.pd-role { font-size: 15px; }
.muted { color: var(--mute); }
.pd-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff3ed; font-size: 13.5px; line-height: 1.45; }
.pd-note.soft { background: #f5f5f5; color: #444; }
.pd-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pd-btns .pill { height: 40px; font-size: 14.5px; padding: 0 16px; }
.pd-btns .pill:not(.ghost) { background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 30px; padding: 4px 12px; border-radius: 999px; background: #f0f0f0; font-size: 13.5px; font-weight: 500; color: var(--text); text-align: left; }
.chips button:hover { background: #e4e4e4; }
.chips small { color: var(--accent); font-weight: 700; margin-left: 2px; }

.cmp-form { display: grid; grid-template-columns: 1fr 36px; gap: 8px; padding: 12px 22px 0; flex: none; align-items: center; }
.cmp-q { grid-column: 1 / -1; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 4px; }
.cmp-form input { grid-column: 1; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #dcdcdc; background: #fafafa; color: var(--text); font-size: 16px; outline: none; }
.cmp-form input:focus { border-color: var(--ink); background: #fff; }
.cmp-form #c-a { grid-row: 2; }
.cmp-form #c-b { grid-row: 3; }
.cmp-swap { grid-column: 2; grid-row: 2 / 4; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--mute); }
.cmp-swap:hover { background: #f0f0f0; color: var(--text); }
.cmp-form .pill { grid-column: 1 / -1; background: var(--accent); margin-top: 2px; }
.cmp-out { padding: 6px 22px 0; }
.cmp-out > p { font-size: 15px; line-height: 1.5; margin-top: 8px; }
.cmp-verdict { font-size: 19px !important; line-height: 1.3 !important; margin-top: 14px !important; }
.cmp-verdict b { font-weight: 800; }
.cmp-verdict .yes { color: #138a52; }
.cmp-verdict .no { color: var(--accent); }
.cmp-miss { margin-top: 12px; font-size: 14.5px; color: var(--accent); }
.cmp-ex { padding: 16px 22px 22px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.cmp-ex .s-meta { width: 100%; padding: 0 0 2px; }
.cmp-ex button { height: 30px; padding: 0 12px; border-radius: 999px; background: #f0f0f0; font-size: 13px; font-weight: 500; color: var(--text); }
.cmp-ex button:hover { background: #e4e4e4; }

/* mini timeline in Compare */
.mt { position: relative; margin: 14px 0 6px; padding: 10px 12px 4px; border-radius: 12px; background: #f7f7f7; }
.mt-row { display: grid; gap: 4px; margin-bottom: 10px; }
.mt-name { font-size: 12.5px; font-weight: 700; }
.mt-name small { font-weight: 500; color: var(--mute); margin-left: 4px; }
.mt-track { position: relative; height: 10px; border-radius: 999px; background: #ececec; }
.mt-track i { position: absolute; top: 0; bottom: 0; min-width: 6px; border-radius: 999px; background: var(--accent); }
.mt-track i.b { background: var(--ink); }
.mt-track i.ov { top: -3px; bottom: -3px; border-radius: 4px; background: rgba(19, 138, 82, .22); min-width: 2px; }
.mt-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); border-top: 1px solid #e5e5e5; padding-top: 3px; }

.yr-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.yr-form .pill { height: 46px; background: var(--accent); }
.yr-out { padding: 4px 22px 22px; }
.yr-out .s-meta { padding: 6px 0; }
.yr-h { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 10px; }
.realms { list-style: none; display: grid; gap: 4px; font-size: 14px; }
.realms li { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f0f0f0; }
.realms li span { color: var(--mute); font-size: 12.5px; padding-top: 1px; }

@media (max-width: 1000px) {
  .seg span { display: none; }
}
@media (max-width: 760px) {
  .top { flex-wrap: nowrap; }
  .ttl p { display: none; }
  .seg button { height: 30px; padding: 0 10px; font-size: 12.5px; }
  .mv-hint { bottom: 64px; font-size: 11.5px; white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; }
  .tabs { padding-left: 12px; padding-right: 12px; }
  .p-detail, .cmp-out, .cmp-ex, .yr-out { padding-left: 16px; padding-right: 16px; }
  .cmp-form { padding-left: 16px; padding-right: 16px; }
  .panel-r { top: 8px; height: auto; }
  .realms li { grid-template-columns: 96px 1fr; }
}
@media (max-width: 420px) {
  .ttl { display: none; }
}
