:root {
  --ink: #20252b; --ink-soft: #5e6872; --paper: #fff; --wash: #f7f9fb;
  --blue: #1772b6; --blue-dark: #0f588f; --blue-pale: #eaf3fa;
  --rose: #bd7488; --rose-pale: #f7eaee; --line: #dfe5ea; --line-dark: #cad2d9;
  --display: "Google Sans", "Noto Sans", Arial, sans-serif;
  --serif: "Castoro", "Times New Roman", Times, serif;
  --sans: "Noto Sans", Arial, sans-serif;
  --mono: "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, textarea, input { font: inherit; }
a { color: var(--blue); }
img { max-width: 100%; }
figure { margin: 0; }
.paper-width { width: min(960px, calc(100% - 48px)); margin-inline: auto; }
.prose-width { width: min(780px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -60px; padding: 9px 14px; color: #fff; background: var(--ink); border-radius: 6px; }
.skip-link:focus { top: 16px; }

.paper-header { width: min(960px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 28px; text-align: center; }
.venue-line { margin: 0 0 18px; color: var(--ink-soft); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .11em; text-transform: uppercase; }
.venue-line span { margin: 0 6px; color: var(--rose); }
.paper-header h1 { max-width: 940px; margin: 0 auto 20px; font-family: var(--display); font-size: clamp(38px, 4.4vw, 48px); font-weight: 600; line-height: 1.12; letter-spacing: -.022em; }
.authors { color: var(--blue); font-family: var(--display); font-size: 20px; font-weight: 400; }
.affiliation { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.resource-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 24px 0 30px; }
.resource-button { width: 112px; min-height: 68px; padding: 10px 8px; display: grid; grid-template-columns: 25px 1fr; grid-template-rows: auto auto; column-gap: 5px; align-items: center; color: #fff; background: #30363d; border: 1px solid #30363d; border-radius: 9px; text-align: left; text-decoration: none; transition: transform .18s ease, background .18s ease; }
.resource-button:hover { transform: translateY(-2px); background: #20252b; }
.resource-button i { grid-row: 1 / 3; align-self: center; font-size: 20px; font-style: normal; text-align: center; }
.resource-button strong { align-self: end; font-size: 13px; line-height: 1.2; }
.resource-button small { align-self: start; color: rgba(255,255,255,.68); font-size: 9px; line-height: 1.3; }
.resource-button.unavailable { cursor: default; background: #7c848c; border-color: #7c848c; opacity: .68; }
.one-liner { max-width: 860px; margin: 0 auto; padding: 0 12px; color: #363636; background: transparent; font-family: var(--display); font-size: clamp(23px, 2.6vw, 32px); font-weight: 400; line-height: 1.28; }
.one-liner strong { color: #8f4e61; font-weight: 600; }

.teaser { padding: 18px 0 48px; }
.teaser img { width: 100%; height: auto; display: block; }
figcaption { color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.teaser figcaption { max-width: 920px; margin: 16px auto 0; text-align: center; }
figcaption strong { color: var(--ink); }

.paper-section { padding: 48px 0; }
.paper-section + .paper-section { border-top: 1px solid var(--line); }
.paper-section h2 { margin: 0 0 22px; font-family: var(--display); font-size: clamp(30px, 3.4vw, 40px); font-weight: 500; line-height: 1.2; letter-spacing: -.018em; text-align: center; }
.paper-section p { color: #46515b; }
.paper-section > p { font-size: 17px; }
.section-intro { margin-bottom: 32px; text-align: center; }
.section-intro p:not(.section-kicker) { max-width: 680px; margin: 0 auto; }
.section-kicker, .tool-kicker, .figure-label { margin: 0 0 9px; color: var(--blue) !important; font-family: var(--mono); font-size: 10px !important; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }

.method-flow { display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr 30px 1fr; align-items: stretch; gap: 0; }
.method-flow article { position: relative; min-width: 0; padding: 20px 17px 22px; background: var(--wash); border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.method-flow article > span { position: absolute; top: 10px; left: 12px; color: #99a4ae; font-family: var(--mono); font-size: 9px; }
.method-flow h3 { margin: 12px 0 5px; font-size: 14px; }
.method-flow p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.flow-arrow { display: grid; place-items: center; color: #aab3bb; font-size: 20px; }
.method-icon { width: 54px; height: 54px; margin: 4px auto 0; display: grid; place-items: center; color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 50%; font-family: var(--serif); font-size: 25px; }
.nodes-icon { position: relative; }
.nodes-icon i { position: absolute; width: 8px; height: 8px; background: var(--blue); border-radius: 50%; }
.nodes-icon i:nth-child(1) { left: 13px; top: 15px; }
.nodes-icon i:nth-child(2) { right: 12px; top: 11px; background: var(--rose); }
.nodes-icon i:nth-child(3) { bottom: 11px; left: 25px; }
.nodes-icon b { width: 32px; height: 30px; background: linear-gradient(34deg, transparent 47%, #9fb1be 48%, #9fb1be 52%, transparent 53%), linear-gradient(-42deg, transparent 47%, #9fb1be 48%, #9fb1be 52%, transparent 53%); }
.ripple-icon { position: relative; }
.ripple-icon i { position: absolute; border: 1.5px solid var(--rose); border-radius: 50%; }
.ripple-icon i:nth-child(1) { inset: 21px; background: var(--rose); }
.ripple-icon i:nth-child(2) { inset: 13px; opacity: .7; }
.ripple-icon i:nth-child(3) { inset: 5px; opacity: .32; }
.anchor-icon { color: var(--rose); }
.dataset-stats { margin-top: 24px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.dataset-stats div { padding: 18px 12px; text-align: center; background: #fff; border-right: 1px solid var(--line); }
.dataset-stats div:last-child { border-right: 0; }
.dataset-stats strong { display: block; color: #28333c; font-family: var(--display); font-size: 27px; line-height: 1.1; }
.dataset-stats span { color: var(--ink-soft); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.technical-note { margin-top: 18px; color: var(--ink-soft) !important; font-size: 12px !important; text-align: center; }

.results-section { padding-bottom: 76px; }
.result-figure { position: relative; padding: 20px; background: var(--wash); border: 1px solid var(--line); border-radius: 9px; }
.result-figure img { width: 100%; height: auto; display: block; margin: 3px auto 14px; object-fit: contain; background: #fff; }
.result-figure figcaption { min-height: 42px; }
.result-wide { max-width: 780px; margin: 0 auto 26px; }
.result-wide img { max-height: 540px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.result-grid .result-figure img { height: 430px; }
.control-finding { margin-top: 26px; display: grid; grid-template-columns: 130px 130px 1fr; gap: 20px; align-items: center; padding: 21px 24px; border-left: 4px solid var(--rose); background: var(--rose-pale); }
.control-finding span { color: #845363; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.control-finding strong { font-family: var(--display); font-size: 31px; }
.control-finding p { margin: 0; font-size: 12px; }

.explorer-section { width: 100%; background: var(--wash); }
.analyzer-shell { padding: clamp(22px, 4vw, 40px); background: #fff; border: 1px solid var(--line-dark); border-radius: 9px; box-shadow: 0 14px 40px rgba(36,48,58,.08); }
.analyzer-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.analyzer-shell h3 { margin: 4px 0 0; font-family: var(--display); font-size: 30px; font-weight: 500; line-height: 1.2; }
.index-status { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.index-status i { width: 7px; height: 7px; border-radius: 50%; background: #d6a654; box-shadow: 0 0 0 3px rgba(214,166,84,.13); }
.index-status.ready i { background: #4e9874; box-shadow: 0 0 0 3px rgba(78,152,116,.14); }
.index-status.error i { background: #bd586a; }
.metric-explainer { margin: 16px 0 0; padding: 10px 12px; color: var(--ink-soft) !important; background: var(--wash); border-left: 3px solid var(--blue); font-size: 11px !important; }
.metric-explainer strong { color: var(--ink); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 25px 0 23px; border-bottom: 1px solid var(--line); }
.tab { margin-bottom: -1px; padding: 11px; color: var(--ink-soft); background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-size: 12px; font-weight: 600; }
.tab.active { color: var(--ink); border-color: var(--blue); }
.tab-panel label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
textarea { width: 100%; min-height: 92px; padding: 14px 15px; resize: vertical; color: var(--ink); background: #fff; border: 1px solid var(--line-dark); border-radius: 6px; outline: none; font-size: 13px; }
textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,114,182,.11); }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0 17px; }
.examples span { color: var(--ink-soft); font-size: 10px; }
.examples button { padding: 4px 9px; color: var(--blue-dark); background: var(--blue-pale); border: 0; border-radius: 99px; cursor: pointer; font-size: 10px; }
.analyze-button { width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: #30363d; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.analyze-button:disabled { cursor: wait; opacity: .45; }
.results { margin-top: 20px; }
.result-message { margin: 0 0 12px; padding: 10px 12px; color: var(--ink-soft) !important; background: var(--blue-pale); border-radius: 5px; font-size: 11px !important; }
.result-message.error { color: #8a394d !important; background: var(--rose-pale); }
.empty-state { min-height: 100px; display: flex; align-items: center; justify-content: center; gap: 20px; color: var(--ink-soft); border: 1px dashed var(--line-dark); border-radius: 6px; text-align: center; }
.empty-state p { max-width: 430px; margin: 0; font-size: 11px; }
.empty-orbit { position: relative; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--blue); border-radius: 50%; }
.empty-orbit::after { content: ""; position: absolute; inset: 8px; border: 1px solid var(--rose); border-radius: 50%; }
.entity-list { display: grid; gap: 8px; }
.ambiguity-block { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-dark); }
.ambiguity-title { margin: 0 0 9px; color: var(--ink-soft) !important; font-size: 10px !important; }
.ambiguity-title strong { color: #8a5a26; }
.alternative-list { opacity: .78; }
.entity-result { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; padding: 12px; background: var(--wash); border: 1px solid var(--line); border-radius: 6px; }
.degree-ring { --score: 20%; position: relative; width: 44px; height: 44px; display: grid; place-items: center; background: conic-gradient(var(--rose) var(--score), #e6ebef 0); border-radius: 50%; }
.degree-ring::before { content: ""; position: absolute; width: 34px; height: 34px; background: #fff; border-radius: 50%; }
.degree-ring span { position: relative; z-index: 1; font-family: var(--mono); font-size: 8px; }
.entity-name { display: block; margin-bottom: 3px; font-size: 13px; }
.entity-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 9px; }
.entity-meta a { text-decoration: none; }
.tier { padding: 2px 7px; border-radius: 99px; font-weight: 600; }
.tier-super-hub { color: #8d3f55; background: #f4dce3; }
.tier-hub { color: #855f1b; background: #f5e9cb; }
.tier-connected { color: #346a56; background: #dceee7; }
.tier-tail { color: #586b79; background: #e4eaf0; }
.entity-degree { text-align: right; }
.entity-degree strong { display: block; font-family: var(--display); font-size: 21px; line-height: 1; }
.entity-degree span { color: var(--ink-soft); font-size: 8px; text-transform: uppercase; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suggestions button, #download-results { padding: 5px 9px; color: var(--blue-dark); background: #fff; border: 1px solid var(--line-dark); border-radius: 4px; cursor: pointer; font-size: 9px; }
.drop-zone { width: 100%; min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--ink-soft); background: var(--wash); border: 1px dashed #aeb9c2; border-radius: 7px; cursor: pointer; }
.drop-zone strong { color: var(--ink); font-size: 14px; }
.drop-zone span { font-size: 10px; }
.drop-zone.dragging { color: var(--blue); background: var(--blue-pale); border-color: var(--blue); }
.upload-icon { font-size: 28px !important; color: var(--blue); }
.privacy-note { margin: 10px 0 0; color: var(--ink-soft) !important; font-size: 9px !important; text-align: center; }
.privacy-note span { color: #4e9874; }
.dataset-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 5px; }
.dataset-summary div { padding: 12px; text-align: center; border-right: 1px solid var(--line); }
.dataset-summary div:last-child { border: 0; }
.dataset-summary strong { display: block; font-family: var(--display); font-size: 21px; }
.dataset-summary span { color: var(--ink-soft); font-size: 8px; text-transform: uppercase; }
.dataset-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dataset-actions p { margin: 0; font-size: 10px; }

.citation-section p { text-align: center; }
.bibtex-wrap { position: relative; margin-top: 24px; }
.bibtex-wrap pre { margin: 0; padding: 25px; overflow-x: auto; color: #e7edf2; background: #292f35; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.7; text-align: left; }
#copy-bibtex { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 6px 9px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 4px; cursor: pointer; font-size: 9px; }
#copy-bibtex:hover { background: rgba(255,255,255,.18); }
.paper-footer { width: min(960px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 52px; border-top: 1px solid var(--line); text-align: center; }
.paper-footer p { margin: 3px 0; color: var(--ink-soft); font-size: 10px; }
.paper-footer a { text-decoration: none; }

@media (max-width: 860px) {
  .method-flow { grid-template-columns: 1fr 1fr; gap: 12px; }
  .flow-arrow { display: none; }
  .result-grid { grid-template-columns: 1fr; }
  .result-grid .result-figure img { height: auto; max-height: 550px; }
}
@media (max-width: 620px) {
  .paper-width, .prose-width, .paper-header, .paper-footer { width: min(100% - 26px, 960px); }
  .paper-header { padding-top: 44px; }
  .paper-header h1 { font-size: clamp(34px, 10vw, 44px); }
  .authors { font-size: 16px; }
  .resource-nav { gap: 8px; }
  .resource-button { width: calc(50% - 5px); max-width: 128px; }
  .one-liner { padding: 0 4px; font-size: 22px; }
  .teaser { padding-bottom: 45px; }
  .paper-section { padding: 44px 0; }
  .method-flow { grid-template-columns: 1fr; }
  .dataset-stats { grid-template-columns: 1fr 1fr; }
  .dataset-stats div { border-bottom: 1px solid var(--line); }
  .dataset-stats div:nth-child(2) { border-right: 0; }
  .dataset-stats div:nth-child(3), .dataset-stats div:nth-child(4) { border-bottom: 0; }
  .control-finding { grid-template-columns: 1fr; gap: 5px; }
  .analyzer-topline { display: block; }
  .index-status { margin-top: 13px; }
  .entity-result { grid-template-columns: 44px 1fr; }
  .entity-degree { grid-column: 2; display: flex; align-items: baseline; gap: 5px; text-align: left; }
  .dataset-summary { grid-template-columns: 1fr; }
  .dataset-summary div { border-right: 0; border-bottom: 1px solid var(--line); }
  .dataset-actions { align-items: flex-start; flex-direction: column; }
  .bibtex-wrap pre { padding: 50px 16px 18px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

#semantic-panel { font-size: 14px; line-height: 1.65; }
#semantic-panel p { font-size: 14px; }
#semantic-panel textarea { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line-dark); border-radius: 6px; }
#semantic-panel label { display: block; margin: 14px 0 8px; }
#semantic-panel input[type="checkbox"] { width: auto; margin-right: 8px; }
#semantic-status { color: var(--ink-soft); }
.semantic-row { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 10px; overflow-wrap: anywhere; }
.semantic-mention { background: var(--wash); border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin: 12px 0; }
.semantic-mention button, #cancel-semantic { font: inherit; cursor: pointer; padding: 4px 9px; margin: 5px; }
.tabs { flex-wrap: wrap; }
