/* ============================================================
   Map, Tree, Contact timeline, Connections network and case pages (map-contact-cases).
   ============================================================ */

/* ---------- Tree: the pinned lineage ---------- */
.t2-n.pinned .t2-halo { opacity: .7; }
.t2-n.pinned .t2-c { stroke-width: 3.6; }
.t2-n.pinned .t2-l { fill: var(--gold, #d4af37); }
/* the page covers the right of the screen on wide windows: the zoom buttons move beside it */
@media (min-width: 761px) {
  body:has(#scrim.show) .t2-ctl { right: calc(min(560px, 100%) + 14px); }
}

/* ---------- Map: the dark basemap stays sharp while zooming ----------
   The night look inverts the street map. A filter on the whole tile layer makes the browser paint the
   layer as one picture and stretch it during a zoom, so it stayed blurry; filtering each tile keeps them crisp. */
#map .bm-dark { filter: none; }
#map .bm-dark .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.75); }
html[data-theme=light] #map .bm-dark .leaflet-tile { filter: none; }

/* ---------- The Layers drawer: pinned "On now" and ready-made maps, Simple / All, sections as tabs ---------- */
@media (min-width: 900px) { .ld { width: min(720px, calc(100% - 24px)); } }
.ld-pin { padding: 0 16px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ld-lab { flex: 1 1 100%; font: 700 10.5px Manrope, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.ld-onrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ld-onchip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; border: 1px solid color-mix(in srgb, var(--c, #c9a24b) 55%, transparent); background: color-mix(in srgb, var(--c, #c9a24b) 14%, transparent); color: var(--ink-text); border-radius: 999px; padding: 4px 6px 4px 11px; font: 600 12px Manrope, system-ui, sans-serif; cursor: pointer; }
.ld-onchip .axi { color: var(--c, var(--gold)); }
.ld-onchip i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; opacity: .7; }
.ld-onchip:hover i, .ld-onchip:focus-visible i { opacity: 1; background: rgba(255,255,255,.1); }
.ld-pin .ld-presets { padding: 0; margin: 0; border: 0; }
.ld-views { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; background: rgba(255,255,255,.03); }
.ld-view { border: 0; background: transparent; color: var(--ink-dim); border-radius: 999px; padding: 7px 16px; min-height: 34px; font: 600 12.5px Manrope, system-ui, sans-serif; cursor: pointer; }
.ld-view em { font-style: normal; opacity: .6; margin-left: 3px; }
.ld-view.on { background: var(--gold); color: #1a1206; }
.ld-view:focus-visible, .ld-tab:focus-visible, .ld-onchip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ld-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px 2px; }
.ld-tabs::-webkit-scrollbar { display: none; }
.ld-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-dim); border-radius: 8px 8px 0 0; padding: 8px 10px; min-height: 38px; font: 600 12.5px Manrope, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.ld-tab .axi { color: var(--gold); opacity: .75; }
.ld-tab em { font-style: normal; font-size: 10.5px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--gold); color: #0b0e15; text-align: center; padding: 0 4px; }
.ld-tab:hover { color: var(--ink-text); }
.ld-tab.on { color: var(--ink-text); border-bottom-color: var(--gold); background: rgba(201,162,75,.08); }
.ld-body { padding: 8px 12px 14px; }
.ld-rows { display: grid; grid-template-columns: 1fr; gap: 2px 8px; }
@media (min-width: 900px) { .ld-rows { grid-template-columns: 1fr 1fr; } }
.ld-row { min-height: 52px; margin: 0; }
.ld-intro { margin: 2px 4px 8px; font-size: 12px; color: var(--ink-faint); }
.ld-link { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ld-sh2 { display: flex; align-items: center; gap: 6px; font: 700 10.5px Manrope, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 10px 4px 6px; }
.ld-none { color: var(--ink-faint); font-size: 13px; padding: 10px 4px; }
.ld .ld-sh { position: static; padding: 4px 4px 10px; background: none; }
@media (max-width: 760px) {
  .ld-pin { padding: 0 12px 8px; gap: 8px; }
  .ld-body { padding: 6px 8px 14px; }
  .ld-row { min-height: 56px; padding: 8px 8px; }
  .ld-onrow, .ld-pin .ld-presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ld-onrow .ld-lab, .ld-pin .ld-presets .ld-lab { flex: none; align-self: center; margin-right: 2px; }
  .ld-pre, .ld-onchip { flex: none; }
}
html[data-theme=light] .ld-tab.on { background: rgba(201,162,75,.14); }

/* ---------- Case pages: one clean action bar ---------- */
.tb-bar { position: relative; }
.tb-prim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tb-prim .tb-co { display: contents; }
.tb-prim .tb-pe, .tb-prim .co-btn { min-height: 34px; font-weight: 600; }
.tb-prim .tb-pe .axi { color: var(--gold); }
.tb-morebtn { display: inline-flex !important; align-items: center; gap: 6px; min-height: 34px; margin-left: auto; padding: 4px 12px !important; }
.tb-morebtn[hidden] { display: none !important; }
.tb-morebtn .axi { color: var(--gold); }
.tb-morebtn.open, .tb-morebtn:hover { border-color: var(--gold) !important; color: var(--ink-text) !important; }
.tb-morebtn.open .tb-car2 { display: inline-block; transform: rotate(180deg); }
.tb-menu { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.tb-menu[hidden] { display: none; }
.tb-grp[hidden] { display: none; }
.tb-gh { font: 700 10.5px Manrope, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.tb-menu .tb-main, .tb-menu .tb-more { display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex-wrap: nowrap; overflow: visible; padding: 0; border: 0; flex-basis: auto; }
.tb-menu .tb-a { justify-content: flex-start; text-align: left; width: 100%; min-height: 34px; white-space: normal; }
@media (max-width: 560px) {
  .tb-menu { grid-template-columns: 1fr; }
  .tb-morebtn { margin-left: 0; }
}

/* ---------- Contact: subcategories, grouping and sorting ---------- */
.cx-subh { border-top: 1px solid var(--line); padding-top: 12px; font: 700 12px Manrope, system-ui, sans-serif; color: var(--ink-text); }
.cx-subh span { display: block; font-weight: 500; font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); margin-top: 3px; }
.cx-subload { font-size: 12px; color: var(--ink-faint); margin: 0; }
.cx-chip.cx-unk { border-style: dashed; }
.cx-ctype { width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--ink-text); border-radius: 9px; padding: 7px 9px; font: 500 13px Manrope, system-ui, sans-serif; }
.cx-rh { flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; }
.cx-rtools { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-gsel { display: inline-flex; align-items: center; gap: 6px; font: 600 11px Manrope, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.cx-gsel select { background: var(--panel); border: 1px solid var(--line); color: var(--ink-text); border-radius: 9px; padding: 6px 8px; min-height: 34px; font: 500 13px Manrope, system-ui, sans-serif; letter-spacing: 0; text-transform: none; max-width: 210px; }
.cx-gsel .cx-sort { width: auto; }
.cx-grp { margin: 4px 0 22px; }
.cx-gh { font: 600 18px 'Fraunces', Georgia, serif; color: var(--ink-text); margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; }
.cx-gh em { font: 600 12px Manrope, system-ui, sans-serif; font-style: normal; color: var(--ink-faint); }
.cx-grp .cx-more { margin: 10px 0 0; }
.cx-na { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Contact: the zoomable timeline ---------- */
.cx-tlhost { margin-bottom: 10px; }
.ctl { position: relative; }
.ctl-stage { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0d111b; }
.ctl-c { display: block; width: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.ctl-c.grabbing { cursor: grabbing; }
.ctl-c:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.ctl-tip { position: absolute; z-index: 3; pointer-events: none; max-width: 260px; background: rgba(10,13,23,.96); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.ctl-tip b { display: block; font: 600 13px 'Fraunces', Georgia, serif; color: var(--ink-text); }
.ctl-tip span { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.ctl-ctl { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; z-index: 2; }
.ctl-ctl button { min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(13,17,27,.92); color: var(--ink-text); font: 600 18px Manrope, system-ui, sans-serif; cursor: pointer; }
.ctl-ctl .ctl-fit { font-size: 12px; padding: 0 10px; }
.ctl-ctl button:hover, .ctl-ctl button:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; }
.ctl-ov { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.02); }
.ctl-oc { display: block; width: 100%; touch-action: none; cursor: ew-resize; }
.ctl-hint { margin: 6px 2px 0; font-size: 11.5px; color: var(--ink-faint); }
.cx-hollow { background: transparent !important; border: 1.5px solid var(--ink-dim); border-radius: 50% !important; }
.cx-tlb .cx-key { margin-top: 4px; }
.cx-tlnote { font-size: 12px; color: var(--ink-faint); margin: 4px 0 0; }
html[data-theme=light] .ctl-stage { background: #fbf8f1; }
html[data-theme=light] .ctl-ctl button, html[data-theme=light] .ctl-tip { background: rgba(255,252,244,.96); }
@media (max-width: 640px) { .ctl-hint { display: none; } .ctl-ctl { right: 6px; bottom: 6px; } }

/* ---------- Case pages: subcategories ---------- */
.cf-note { font-size: 12.5px; color: var(--ink-faint); margin: 0 0 10px; line-height: 1.5; }
.cf-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cf-r { display: flex; gap: 10px; align-items: baseline; }
.cf-k { flex: none; width: 150px; font: 700 10.5px Manrope, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.cf-v { display: flex; flex-wrap: wrap; gap: 5px; } .cf-v em { font-size: 12.5px; color: var(--ink-faint); }
.cf-chip { background: transparent; border: 1px solid var(--line); color: var(--ink-text); border-radius: 999px; padding: 4px 10px; min-height: 30px; font: 500 12.5px Manrope, system-ui, sans-serif; cursor: pointer; }
.cf-chip:hover, .cf-chip:focus-visible { border-color: var(--gold); outline: none; }
@media (max-width: 560px) { .cf-r { flex-direction: column; gap: 3px; } .cf-k { width: auto; } }
.cf-k small { display: block; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-faint); font-size: 10.5px; }
