:root {
  --ink: #f2efe8;
  --muted: #9ba4a3;
  --surface: #0b0f10;
  --panel: rgba(15, 20, 21, .92);
  --line: rgba(242, 239, 232, .14);
  --accent: #e7aa57;
  --focus: #ffd79d;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, main { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--surface); color: var(--ink); font-family: var(--font); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}

#graph { position: fixed; z-index: 0; inset: 124px 24px 68px 320px; background: radial-gradient(circle at 54% 46%, #172022 0, #0b0f10 58%); }
#graph::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 52px 52px; mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.topbar {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: 112px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px 36px;
  border-bottom: 1px solid var(--line); background: linear-gradient(#0b0f10, rgba(11,15,16,.83));
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 25px; height: 25px; border: 1px solid var(--accent); border-radius: 50%; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.brand-mark::before { left: 3px; top: 5px; } .brand-mark::after { right: 2px; bottom: 4px; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; margin-top: 2px; }
.counts { white-space: nowrap; display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 12px; }
.counts b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.crawl-activity { position: absolute; left: 28px; right: 28px; bottom: 10px;
  color: var(--muted); font-size: 11px; line-height: 16px; min-height: 32px; }
.crawl-activity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crawl-activity span[hidden] { display: none; }
#crawlPrefetch { color: #7e8786; }
.crawl-state { display: flex; align-items: center; gap: 7px; }
.crawl-state i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #77817f; }
.crawl-state i.is-running { background: var(--accent); box-shadow: 0 0 0 5px rgba(231,170,87,.12); animation: pulse 2s infinite; }

.toolrail {
  position: fixed; z-index: 8; top: 136px; left: 28px; width: 265px;
  padding: 18px 0; color: var(--ink); animation: enter .45s ease-out both;
}
.search-label, .select-label { display: block; margin: 0 0 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }
.search-wrap { display: grid; grid-template-columns: 1fr 40px; border-bottom: 1px solid rgba(242,239,232,.32); }
.search-wrap input { min-width: 0; border: 0; padding: 10px 0; color: var(--ink); background: transparent; outline: none; }
.search-wrap input::placeholder { color: #6f7877; }
.search-wrap button { border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 19px; }
.domain-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 19px 0; }
.domain { --filter-color: #89918f; border: 1px solid color-mix(in srgb, var(--filter-color) 38%, transparent); border-radius: 999px; padding: 6px 9px; background: rgba(11,15,16,.5); color: #98a09f; cursor: pointer; font-size: 11px; transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.domain[data-domain="CULTURE"] { --filter-color: #f0ad5b; }
.domain[data-domain="POLITIQUE"] { --filter-color: #43d7cf; }
.domain[data-domain="MEDIA"] { --filter-color: #b49cff; }
.domain[data-domain="ECONOMIE"] { --filter-color: #8fd17f; }
.domain:hover { color: var(--ink); border-color: var(--filter-color); }
.domain.is-on { color: #071111; border-color: var(--filter-color); background: var(--filter-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--filter-color) 14%, transparent); }
.toolrail select { width: 100%; border: 0; border-bottom: 1px solid rgba(242,239,232,.32); border-radius: 0; padding: 9px 0; color: var(--ink); background: #0b0f10; }
.actions { display: flex; align-items: center; gap: 5px; margin-top: 18px; }
.actions button, .button-link, .share-actions button {
  border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; color: var(--ink);
  background: rgba(11,15,16,.68); text-decoration: none; cursor: pointer; font-size: 11px;
}
.actions button:hover, .button-link:hover, .share-actions button:hover { border-color: var(--accent); }

.inspector {
  position: fixed; z-index: 12; top: 112px; right: 0; bottom: 0; width: min(410px, 36vw);
  padding: 46px 34px 100px; overflow: auto; background: #0f1415; border-left: 1px solid var(--line);
  backdrop-filter: blur(18px); animation: slide-in .28s ease-out both;
}
.close { position: absolute; right: 18px; top: 15px; border: 0; color: var(--muted); background: transparent; font-size: 27px; cursor: pointer; }
.kicker { margin: 0 0 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; }
.inspector h1, dialog h2 { margin: 0 0 22px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(30px, 4vw, 50px); line-height: .98; }
.fact-list { margin: 0; }
.fact-list div { display: grid; grid-template-columns: 100px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.fact-list dt { color: var(--muted); font-size: 11px; }.fact-list dd { margin: 0; font-size: 13px; line-height: 1.45; }
.fact-list a, .proof a, dialog a { color: var(--accent); }
.person-summary, .relation-statement { margin: 0 0 22px; color: #e5e2db; font: 17px/1.5 Georgia, serif; }
.relation-statement { padding-left: 14px; border-left: 2px solid var(--accent); }
.relation-definition { margin: -10px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.relation-facts strong { color: var(--accent); font-weight: 600; }
.proof-title { margin: 30px 0 4px; color: var(--ink); font: 400 19px/1.2 Georgia, serif; }
.proof { border-top: 1px solid var(--line); padding: 16px 0; }
.proof blockquote { margin: 8px 0; color: #d8d8d2; font: 14px/1.55 Georgia, serif; }
.proof small { color: var(--muted); }
.share-actions { display: flex; gap: 7px; margin-top: 24px; }

footer {
  position: fixed; z-index: 7; left: 28px; right: 28px; bottom: 18px; display: flex;
  justify-content: space-between; align-items: end; gap: 24px; pointer-events: none;
}
footer p { max-width: 680px; margin: 0; color: #7e8786; font-size: 10px; line-height: 1.45; }
footer button { pointer-events: auto; white-space: nowrap; border: 0; border-bottom: 1px solid var(--line); padding: 4px 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }

dialog { position: fixed; max-width: 620px; border: 1px solid var(--line); padding: 42px; color: var(--ink); background: #111718; }
dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }
dialog h2 { font-size: 36px; }
dialog p { color: #b7bfbd; line-height: 1.6; }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 64px; transform: translate(-50%, 10px); opacity: 0; padding: 9px 13px; color: #141718; background: var(--ink); border-radius: 3px; font-size: 12px; pointer-events: none; transition: .2s ease; }
#toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(231,170,87,0); } }

@media (max-width: 760px) {
  #graph { inset: 245px 12px 175px; }
  .topbar { height: 100px; padding: 0 15px 36px; }
  .crawl-activity { left: 15px; right: 15px; font-size: 10px; }
  .brand strong { font-size: 19px; }.brand small { display: none; }
  .counts { gap: 7px; font-size: 8px; }.counts b { font-size: 10px; }.crawl-state span { display: none; }
  .toolrail { animation: none; top: 113px; left: 15px; right: 15px; width: auto; padding: 0; }
  .domain-filters { margin: 12px 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .select-label { display: none; }.toolrail select { display: block; width: 64%; font-size: 11px; }
  .actions { position: fixed; right: 14px; bottom: 68px; flex-direction: column; align-items: stretch; }
  .actions button, .button-link { background: rgba(11,15,16,.9); text-align: center; }
  .inspector { top: auto; left: 0; width: 100%; height: min(70svh, 590px); max-height: 70svh; padding: 38px 22px 48px; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; animation-name: sheet-in; }
  .inspector h1 { font-size: 36px; }
  footer { left: 15px; right: 15px; bottom: 12px; } footer p { max-width: 72%; font-size: 8px; }
  dialog { margin: auto 14px; padding: 34px 24px; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(22px); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Discovery is a temporary accent, never a domain/category colour. */
.discovery-trigger { min-height: 44px; border: 1px solid var(--line); border-radius: 4px; background: rgba(11,15,16,.88); color: var(--muted); cursor: pointer; }
.discovery-trigger:hover { color: #78baff; border-color: #78baff; }
.discovery-trigger:disabled { opacity: .45; cursor: default; }
.desktop-discovery { margin-top: 10px; padding: 8px 12px; font-size: 11px; }
.mobile-graph-tools .discovery-trigger { display: none; }
.discovery-card { position: fixed; z-index: 11; left: max(330px, calc(50% - 210px)); bottom: 82px; width: min(420px, calc(100% - 350px)); padding: 15px 44px 12px 16px; border: 1px solid rgba(120,186,255,.35); border-radius: 6px; background: rgba(15,20,21,.96); box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.discovery-card[hidden] { display: none; }
.discovery-card p { margin: 0; line-height: 1.35; }
#discoveryTitle { color: #78baff; font-size: 11px; letter-spacing: .025em; }
#discoverySubtitle { margin-top: 5px; color: var(--ink); font: 14px/1.4 Georgia, serif; }
#discoveryTip { margin-top: 8px; color: var(--muted); font: 11px/1.4 var(--font); }
#discoveryClose { position: absolute; right: 7px; top: 3px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }
.discovery-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; }
#discoveryAnother { min-height: 44px; padding: 7px 10px; border: 1px solid rgba(120,186,255,.65); border-radius: 4px; background: rgba(120,186,255,.13); color: #c4e2ff; font: 11px var(--font); cursor: pointer; }
#discoveryAnother:hover { border-color: #78baff; background: rgba(120,186,255,.22); }
#discoveryRelation { min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: #78baff; font-size: 11px; cursor: pointer; }
#discoveryRelation[hidden] { display: none; }
.discovery-halo { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; }
@media (max-width: 760px) {
  .mobile-graph-tools .discovery-trigger { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-color: rgba(120,186,255,.46); color: #78baff; font-size: 20px; }
  .discovery-card { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; max-height: 30svh; overflow: auto; padding: 11px 42px 8px 14px; border-radius: 8px; }
  #discoverySubtitle { font-size: 13px; }
}

/* A secondary, compact control surface; the graph remains the main workspace. */
.layout-controls { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 12px; }
.layout-controls summary { color: var(--ink); font-size: 12px; cursor: pointer; }
.layout-controls summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
.layout-mode { margin: 14px 0; color: var(--muted); font-size: 10px; }
.layout-control { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; margin: 0 0 13px; }
.layout-control label, .layout-control output { font-size: 11px; }
.layout-control output { color: var(--accent); font-variant-numeric: tabular-nums; }
.layout-control input { grid-column: 1 / -1; width: 100%; margin: 0; height: 22px; accent-color: var(--accent); cursor: pointer; }
.layout-control small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.35; }
.layout-settings-footer { display: flex; align-items: center; gap: 12px; }
.layout-settings-footer button { border: 1px solid var(--line); border-radius: 3px; padding: 7px 9px; font-size: 10px; color: var(--ink); background: transparent; cursor: pointer; }
.layout-settings-footer span { font-size: 10px; line-height: 1.4; color: var(--muted); }
@media (min-width: 761px) {
  .toolrail { max-height: calc(100svh - 216px); overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 760px) {
  #graph { top: 316px; }
  .layout-controls { position: relative; margin-top: 12px; padding-top: 10px; }
  .layout-controls summary { min-height: 24px; }
  .layout-controls-body { position: absolute; top: 100%; left: 0; right: 0; z-index: 9; padding: 0 16px 16px;
    background: #0f1415; border: 1px solid var(--line); max-height: min(380px, calc(100svh - 520px)); overflow-y: auto; }
}

#graph.is-node-dragging { cursor: grabbing !important; user-select: none; }

@media (max-width: 430px) {
  .topbar { height: 128px; display: grid; align-content: start; justify-content: stretch; gap: 9px; padding: 10px 15px 42px; }
  .counts { justify-content: space-between; }
  .toolrail { top: 141px; }
  #graph { top: 344px; }
}

/* A quiet global action, available without selecting a person first. */
.share-view-button { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: transparent;
  color: var(--ink); font-size: 11px; cursor: pointer; }
.share-view-button svg { color: var(--accent); flex-shrink: 0; }
.share-view-button:hover { border-color: var(--accent); }
#shareDialog { width: min(480px, calc(100% - 28px)); max-height: calc(100svh - 28px); margin: auto; overflow: auto; }
#shareDialog h2 { font-size: 31px; margin-bottom: 14px; }
#shareDescription { font-size: 13px; margin: 0 0 24px; }
.share-copy-row { display: flex; border: 1px solid var(--line); border-radius: 3px; }
#shareUrl { min-width: 0; flex: 1; width: 100%; padding: 11px; border: 0; color: var(--muted); background: transparent; font-size: 12px; }
#shareCopyButton { padding: 10px 14px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--accent); cursor: pointer; font-size: 12px; }
#shareFeedback { min-height: 20px; margin: 6px 0 15px; font-size: 11px; color: var(--accent); }
#shareNetworks { display: flex; flex-wrap: wrap; gap: 10px 24px; }
#shareNetworks a { font-size: 13px; color: var(--ink); text-decoration: none; padding: 8px 0; border-bottom: 1px solid var(--line); }
#shareNetworks a:hover { color: var(--accent); border-color: var(--accent); }
#nativeShareButton { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 14px 0 0; cursor: pointer; }
#shareDialog .share-note { border-top: 1px solid var(--line); margin: 24px 0 0; padding-top: 14px; font-size: 11px; line-height: 1.5; color: var(--muted); }
@media (max-width: 760px) {
  .share-view-button { position: absolute; right: 0; bottom: 0; margin: 0; padding: 7px 8px; gap: 6px; z-index: 1; }
  .layout-controls summary { max-width: calc(100% - 130px); font-size: 11px; }
}

.share-view-button:disabled { opacity: .5; cursor: wait; }

/* The header separates sharing (action), counts (status), and the interaction hint. */
.topbar { height: 128px; gap: 24px; }
.header-tools { display: flex; align-items: center; gap: 36px; margin-left: auto; min-width: 0; }
.header-info { min-width: 0; }
.header-info .counts { justify-content: flex-end; }
#headerShare { flex-shrink: 0; }
#headerShare .share-view-button { margin: 0; white-space: nowrap; }
#mobileShare:empty { display: none; }
.relation-hint { margin: 8px 0 0; max-width: 580px; color: var(--ink); font-size: 12px; line-height: 1.5; }
#graph { top: 140px; }
.toolrail { top: 152px; }
.inspector { top: 128px; }
@media (min-width: 761px) {
  .toolrail { max-height: calc(100svh - 232px); }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .topbar { gap: 18px; padding-left: 20px; padding-right: 20px; }
  .header-tools { gap: 24px; }
  .brand small { display: none; }
  .brand strong { font-size: 20px; }
  .counts { gap: 10px; font-size: 10px; }
  .counts b { font-size: 12px; }
  .crawl-state span { display: none; }
}
@media (max-width: 760px) {
  .topbar { height: 174px; display: grid; align-content: start; justify-content: stretch; gap: 9px; padding: 10px 15px 42px; }
  .header-tools { display: block; margin: 0; }
  #headerShare { display: none; }
  .header-info .counts { justify-content: space-between; }
  .relation-hint { font-size: 11px; line-height: 16px; margin-top: 8px; max-width: none; }
  .toolrail { top: 187px; }
  #graph { top: 390px; }
  .inspector { top: auto; }
  .layout-controls-body { max-height: min(380px, calc(100svh - 566px)); }
}
.mobile-welcome { position: fixed; z-index: 25; bottom: 22px; left: 15px; right: 15px;
  width: min(360px, calc(100% - 30px)); margin: 0 auto; padding: 14px 42px 14px 16px;
  border: 1px solid var(--line); border-radius: 4px; background: #172022; color: var(--ink); }
.mobile-welcome p { margin: 0; font-size: 13px; line-height: 1.5; }
.mobile-welcome button { position: absolute; right: 3px; top: 3px; width: 36px; height: 36px;
  color: var(--muted); background: transparent; border: 0; font-size: 23px; cursor: pointer; }
.mobile-welcome[hidden] { display: none; }

/* Linked people are a secondary index below identity, not another headline. */
.person-connections { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.person-connections h2 { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 500; }
.person-connections h2 span { margin-left: 6px; font-variant-numeric: tabular-nums; }
.person-connections ul { list-style: none; padding: 0; margin: 0; }
.person-connections li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; padding: 6px 0; line-height: 1.4; }
.person-connections a { color: #c5cdca; font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.person-connections a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.person-connections li span, .person-connections p { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.person-connections p { margin: 0; }

/* Minimal mobile workspace: chrome overlays the canvas, never squeezes it. */
.brand { border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.mobile-graph-tools, .share-short-label, .mobile-counter-label { display: none; }
.quiet-action { padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
#filterDialog { width: min(340px, calc(100% - 24px)); padding: 26px 20px 18px; margin: auto; }
#filterDialog h2 { padding-right: 28px; font-size: 24px; margin-bottom: 12px; }
#filterDialog p { font-size: 12px; margin: 0; }
#filterDialog .domain-filters { flex-wrap: wrap; overflow: visible; gap: 10px; margin: 20px 0 12px; }
#filterDialog .domain { min-height: 44px; padding: 9px 14px; font-size: 12px; }
#filterDialog::backdrop { background: rgba(0,0,0,.25); backdrop-filter: none; }
#aboutDialog { width: min(480px, calc(100% - 24px)); margin: auto; max-height: calc(100dvh - 32px); overflow: auto; }
#aboutDialog h2 { font-size: 30px; }
#aboutDialog p { font-size: 13px; }
.project-credits { padding-top: 14px; border-top: 1px solid var(--line); }
.project-method { font-size: 12px; color: var(--muted); }
.project-method summary { cursor: pointer; padding: 10px 0; }
@media (max-width: 760px) { dialog[open] { animation: enter .18s ease-out; } }
@media (max-width: 760px) {
  #graph { inset: 0; background: #0b0f10; }
  #graph::after { display: none; }
  .topbar { height: auto; min-height: 72px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    display: flex; align-items: flex-start; gap: 8px; border: 0; backdrop-filter: none;
    background: linear-gradient(#0b0f10 65%, rgba(11,15,16,0)); pointer-events: none; }
  .brand, #headerShare { pointer-events: auto; }
  .brand { min-height: 44px; gap: 0; align-items: center; }
  .brand strong { font-size: 19px; }
  .brand-mark, .brand small, .relation-hint, .crawl-activity,
  .counts > span:nth-child(3), .toolrail, footer, .desktop-counter-label, .share-full-label { display: none; }
  .header-tools { margin-left: auto; display: block; }
  #headerShare { display: block; }
  #headerShare .share-view-button { position: static; min-height: 44px; padding: 8px 0 8px 12px; border: 0; gap: 6px; font-size: 11px; }
  .share-short-label, .mobile-counter-label { display: inline; }
  .header-info { position: absolute; left: 14px; top: calc(48px + env(safe-area-inset-top)); }
  .header-info .counts { justify-content: flex-start; gap: 7px; font-size: 10px; line-height: 14px; }
  .counts b { font-size: 10px; font-weight: 500; color: #bdc6c3; }
  .counts > span:nth-child(2)::before { content: "·"; margin-right: 7px; }
  .crawl-state { margin-left: 2px; }
  .crawl-state i { width: 6px; height: 6px; }
  .crawl-state i.is-running { animation: crawl-micro-pulse 1.6s ease-in-out infinite; box-shadow: none; }
  .crawl-state > span { display: block; position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-graph-tools { display: flex; gap: 6px; position: fixed; z-index: 10; left: 14px; top: calc(76px + env(safe-area-inset-top)); }
  .mobile-filter-button, .mobile-search-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 4px; background: rgba(11,15,16,.86); color: var(--muted); font-size: 11px; cursor: pointer; }
  .inspector { top: auto; right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto; height: auto; max-height: min(38dvh, 320px); padding: 20px 18px;
    border: 1px solid var(--line); border-radius: 8px; background: rgba(15,20,21,.97); overscroll-behavior: contain; }
  .inspector h1 { margin: 0 32px 12px 0; font-size: 20px; line-height: 1.1; }
  .inspector .kicker { margin: 0 32px 8px 0; font-size: 9px; }
  .close { top: 4px; right: 4px; width: 44px; height: 44px; font-size: 24px; }
  .person-summary, .relation-statement { font-size: 14px; margin-bottom: 14px; }
  .fact-list div { padding: 8px 0; grid-template-columns: 82px 1fr; }
  .fact-list dd { font-size: 12px; overflow-wrap: anywhere; }
  .person-connections { margin-top: 16px; padding-top: 12px; }
  .person-connections a { padding: 8px 0; }
  .share-actions { margin-top: 16px; }
  .share-actions button { min-height: 44px; }
  #aboutDialog { padding: 28px 22px; }
  #aboutDialog h2, #filterDialog h2 { font-size: 21px; }
  #toast { max-width: calc(100% - 28px); bottom: calc(16px + env(safe-area-inset-bottom)); }
  @keyframes crawl-micro-pulse { 0%, 100% { opacity: .55; box-shadow: 0 0 0 0 rgba(231,170,87,0); } 50% { opacity: 1; box-shadow: 0 0 0 5px rgba(231,170,87,.38); } }
}

/* Search costs one small icon when closed, never a permanent input row. */
#searchDialog { top: calc(72px + env(safe-area-inset-top)); bottom: auto; margin: 0 auto;
  width: min(360px, calc(100% - 24px)); max-height: calc(100dvh - 96px - env(safe-area-inset-top));
  padding: 20px 18px 12px; overflow: auto; border-radius: 8px; overscroll-behavior: contain; }
#searchDialog::backdrop { background: rgba(0,0,0,.25); backdrop-filter: none; }
#searchTitle { margin: 0 32px 16px 0; font-size: 20px; }
#mobilePersonSearch { width: 100%; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent; color: var(--ink); font-size: 16px; }
#mobileSearchFeedback { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
#mobileSearchFeedback:empty { display: none; }
#mobileSearchResults { margin: 8px 0 0; padding: 0; list-style: none; }
#mobileSearchResults:empty { display: none; }
#mobileSearchResults button { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px;
  padding: 11px 0; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; }
#mobileSearchResults button:hover { color: var(--accent); }
#mobileSearchResults button span { overflow-wrap: anywhere; }
#mobileSearchResults button small { flex-shrink: 0; color: var(--muted); font-size: 10px; }

/* Paths reuse the existing mobile toolbar footprint; all detail is on demand. */
.path-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; min-width: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: rgba(11,15,16,.86); color: var(--muted); font-size: 11px; cursor: pointer; }
.path-trigger.is-active { color: var(--accent); border-color: var(--accent); }
#desktopPathButton { width: 100%; justify-content: flex-start; margin-bottom: 16px; }
#pathDialog { width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px 20px 18px; border-radius: 8px; overflow: auto; overscroll-behavior: contain; }
#pathTitle { font-size: 22px; margin: 0 30px 12px 0; }
#pathDialog p { font-size: 12px; line-height: 1.5; }
#pathDialog .path-note { font-size: 11px; color: var(--muted); margin: 12px 0; }
#pathSelected, #pathResults, #pathSummary { list-style: none; padding: 0; margin: 10px 0; }
#pathSelected:empty, #pathResults:empty, #pathSummary:empty { display: none; }
#pathSelected button, #pathResults button { width: 100%; min-height: 44px; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; text-align: left; font-size: 12px; cursor: pointer; overflow-wrap: anywhere; }
#pathSelected button { color: var(--accent); }
#pathPersonSearch { width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font-size: 16px; }
#pathFeedback { color: var(--muted); }
#pathSummary li { font-size: 12px; line-height: 1.5; padding: 5px 0; overflow-wrap: anywhere; }
#pathSummary i { display: inline-block; width: 16px; height: 3px; vertical-align: middle; margin-right: 7px; }
.path-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.path-actions button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; }
.path-trigger:disabled, .path-actions button:disabled, #pathPersonSearch:disabled, .domain:disabled, #relationFilter:disabled { opacity: .45; cursor: default; }
@media (max-width: 760px) {
  #pathDialog { top: calc(72px + env(safe-area-inset-top)); bottom: auto; max-height: calc(100dvh - 96px - env(safe-area-inset-top)); margin: 0 auto; padding: 20px 18px 12px; }
  #pathTitle { font-size: 20px; }
  #pathDialog::backdrop { background: rgba(0,0,0,.25); backdrop-filter: none; }
}

.path-curves { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.path-notice { position: absolute; z-index: 9; bottom: 68px; left: max(330px, calc(50% - 220px)); width: min(440px, calc(100% - 350px)); padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; background: rgba(15,20,21,.97); }
.path-notice p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink); }
.path-notice > div { display: flex; gap: 16px; }
.path-notice button { background: transparent; border: 0; padding: 8px 0; min-height: 44px; font-size: 11px; color: var(--accent); cursor: pointer; }
@media (max-width: 760px) {
  .path-notice { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; padding: 10px 14px 2px; }
  .path-notice p { font-size: 11px; }
}

/* Visible from the initial HTML; overlays the graph without reserving space. */
.graph-loading { position: fixed; z-index: 5; inset: 140px 24px 68px 320px; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; pointer-events: none; text-align: center; }
.graph-loading[hidden] { display: none; }
.graph-loading p { max-width: 290px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.graph-loading-spinner { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: graph-loading-spin 1s linear infinite; }
.graph-loading[data-phase="error"] .graph-loading-spinner { animation: none; border-color: var(--muted); }
@keyframes graph-loading-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .graph-loading { inset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .graph-loading-spinner { animation: none; }
}

.graph-loading progress { width: min(240px, 65vw); height: 6px; border: 0; border-radius: 3px; accent-color: var(--accent); }
.graph-loading progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.graph-loading progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.graph-loading progress::-moz-progress-bar { background: var(--accent); }
.graph-loading[data-phase="preparing"] .graph-loading-spinner, .graph-loading[data-phase="arranging"] .graph-loading-spinner { display: none; }
.component-view-note { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0 0 12px; }
