@font-face { font-family: "Plex"; src: url("fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #0a0c14; --glass: rgba(18, 22, 36, 0.72); --line: rgba(255, 255, 255, 0.08); --ink: #eceae0; --ink-2: #a5aabb; --ink-3: #6d7389;
  --mark: #f4dc4a; --teal: #4fd1bd; --coral: #ff8a6b; --amber: #f2b84b; --blue: #8fa3ff; --violet: #b69cff;
  --sans: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif; --serif: "Newsreader", Georgia, serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#g { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#g.drag { cursor: grabbing; }

.top { position: fixed; top: 14px; left: 14px; right: 14px; display: flex; gap: 10px; align-items: center; z-index: 5; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand, .seg, .search { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 14px; }
.brand { padding: 9px 14px; text-decoration: none; color: var(--ink); font-weight: 500; }
.seg { display: flex; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 10px; color: var(--ink-2); }
.seg button[aria-selected="true"] { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.search { margin-left: auto; padding: 0 12px; }
.search input { background: transparent; border: 0; outline: 0; color: var(--ink); font: inherit; padding: 9px 0; width: 240px; }

.legend { position: fixed; left: 14px; top: 72px; width: 250px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; z-index: 4; }
.lg-title { margin: 0; font-weight: 600; font-size: 13px; }
.lg-title.small { margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.lg-sub { margin: 4px 0 10px; color: var(--ink-3); font-size: 12.5px; }
.legend ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.legend li { display: flex; gap: 9px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.sw { width: 14px; height: 14px; flex: none; display: inline-block; }
.sw.ln { height: 0; border-top: 2px solid; width: 22px; }
.sw.ln.dash { border-top-style: dashed; }
.lg-count { margin: 12px 0 0; font-size: 11.5px; color: var(--ink-3); }

.panel { position: fixed; right: 14px; top: 72px; bottom: 80px; width: 360px; background: rgba(16, 20, 33, 0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 20px; overflow: auto; z-index: 6; animation: slide 320ms var(--ease); }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.x { position: absolute; right: 10px; top: 8px; border: 0; background: transparent; font-size: 22px; color: var(--ink-3); }
.p-kind { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.p-title { margin: 6px 0 10px; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.c-current { color: var(--teal); background: rgba(79, 209, 189, 0.12); }
.c-superseded { color: var(--coral); background: rgba(255, 138, 107, 0.12); }
.c-proposed, .c-preliminary, .c-discussed, .c-requested, .c-internal-target { color: var(--amber); background: rgba(242, 184, 75, 0.12); }
.c-approved, .c-agreed, .c-final, .c-amended { color: var(--teal); background: rgba(79, 209, 189, 0.12); }
.quote { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(244, 220, 74, 0.08); border: 1px dashed rgba(244, 220, 74, 0.4); font-family: var(--serif); font-size: 16px; line-height: 1.45; color: #f3efd9; }
.quote small { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); margin-bottom: 4px; }
.p-sec { margin: 16px 0 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.links button { width: 100%; text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); border-radius: 10px; padding: 7px 10px; display: flex; justify-content: space-between; gap: 10px; color: var(--ink); }
.links button:hover { border-color: rgba(255, 255, 255, 0.25); }
.links em { font-style: normal; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.ask-link { display: inline-block; margin-top: 16px; color: var(--bg); background: var(--mark); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; }

.dock { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 16px; z-index: 5; }
.dock button { border: 0; background: rgba(255, 255, 255, 0.06); border-radius: 10px; min-width: 36px; height: 36px; padding: 0 12px; }
.dock button:hover { background: rgba(255, 255, 255, 0.12); }
.dock .play { background: var(--mark); color: #14161f; font-weight: 600; }
.story-cap { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); margin: 0; max-width: min(640px, 92vw); text-align: center; font-family: var(--serif); font-size: 22px; line-height: 1.3; color: var(--ink); text-shadow: 0 2px 20px #000; z-index: 5; pointer-events: none; transition: opacity 300ms; }

@media (max-width: 760px) {
  .legend { display: none; }
  .search input { width: 120px; }
  .panel { left: 10px; right: 10px; width: auto; top: auto; bottom: 70px; max-height: 55vh; }
  .top { flex-wrap: wrap; }
  .story-cap { font-size: 17px; bottom: 66px; }
  .dock .play { font-size: 12.5px; }
}
