:root {
  --ink: #07162d;
  --ink-2: #17375f;
  --paper: #f4f1e8;
  --white: #fff;
  --gold: #ddb34f;
  --gold-soft: #fff2c8;
  --line: #d9dfe7;
  --muted: #6f7988;
  --green: #08795d;
  --blue: #176ba8;
  --red: #ae3e45;
  --orange: #a85c13;
  --violet: #6542ad;
  --shadow: 0 16px 45px rgba(7, 22, 45, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(7, 22, 45, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 22, 45, .045) 1px, transparent 1px);
  background-size: 72px 72px;
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.masthead {
  position: relative;
  z-index: 2;
  color: white;
  background: var(--ink);
  border-bottom: 5px solid var(--gold);
}
.masthead-inner {
  position: relative;
  width: min(1180px, 92%);
  min-height: 116px;
  margin: auto;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) auto 58px;
  gap: 24px;
  align-items: center;
}
.header-seal { position: absolute; z-index: 3; left: 0; bottom: -44px; display: block; width: 132px; height: 132px; }
.header-seal img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand {
  grid-column: 2;
  color: white;
  text-decoration: none;
  font: 700 clamp(24px, 3vw, 36px)/1 Georgia, "Times New Roman", serif;
  letter-spacing: -.7px;
}
.brand span { color: #b9c5d5; font-weight: 400; }
.system-status {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  border: 1px solid #334762;
  border-radius: 999px;
  color: #eef3fb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
}
.system-status i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #67e3bd;
  box-shadow: 0 0 0 6px rgba(103, 227, 189, .13);
}
.monogram {
  grid-column: 4;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--ink);
  background: var(--gold);
  border: 4px solid #f5d98a;
  border-radius: 50%;
  font: 800 17px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .4px;
}

main { width: min(1180px, 92%); margin: auto; }
.hero { padding: 68px 0 34px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 2.6px;
}
h1 {
  max-width: 760px;
  margin: 0;
  font: 700 clamp(58px, 8vw, 106px)/.87 Georgia, "Times New Roman", serif;
  letter-spacing: -5px;
}
.intro {
  margin: 26px 0 36px;
  color: #5f6978;
  font: italic clamp(25px, 3vw, 38px)/1.2 Georgia, serif;
}
.executive-summary {
  position: relative;
  max-width: 820px;
  padding: 28px 34px 28px 42px;
  overflow: hidden;
  background: #fffbf2;
  border: 1px solid #e6ce8a;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(77, 58, 16, .09);
}
.executive-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: var(--gold);
}
.executive-summary span,
.metrics span,
.group-heading h2,
.section-heading h3,
.source h3 {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 2.3px;
}
.executive-summary span { color: #8a7137; }
.executive-summary strong {
  display: block;
  margin: 9px 0 2px;
  font: 700 clamp(27px, 4vw, 40px)/1.15 Georgia, serif;
}
.executive-summary p { margin: 0; color: #817966; font-size: 17px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 30px 0 52px;
}
.metrics > div {
  min-height: 160px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-top: 8px solid #9ca8b8;
  border-radius: 14px;
  box-shadow: 0 7px 16px rgba(7, 22, 45, .08);
}
.metrics > div:first-child { border-top-color: var(--gold); }
.metrics > div:last-child { border-top-color: var(--green); }
.metrics span { color: #697486; }
.metrics strong {
  display: block;
  margin: 8px 0 1px;
  font: 700 52px/1 Georgia, serif;
}
.metrics small { color: var(--green); font-size: 14px; font-weight: 750; }

.workspace {
  margin-bottom: 28px;
  overflow: hidden;
  background: white;
  border: 1px solid #cfd7e1;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 6px; margin-right: auto; }
.tabs button, .tabs a, select {
  min-height: 42px;
  padding: 10px 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.tabs a { display: inline-flex; align-items: center; text-decoration: none; }
.tabs a:hover { background: var(--gold-soft); }
.tabs button.active { color: white; background: var(--ink); border-color: var(--ink); }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.search span { font-size: 22px; }
.search input { width: 210px; min-width: 0; padding: 9px 0; color: var(--ink); background: transparent; border: 0; }

.issue-group + .issue-group { border-top: 14px solid #f0f3f6; }
.group-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
}
.group-heading h2 { margin: 0; color: var(--ink-2); text-transform: uppercase; }
.group-heading span { color: #99a3b1; font-weight: 800; }
.issue-row {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(250px, auto) 28px;
  gap: 20px;
  align-items: center;
  min-height: 142px;
  padding: 24px 28px 24px 24px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background .15s ease, transform .15s ease;
}
.issue-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--blue);
}
.issue-row.proposal::before { background: var(--orange); }
.issue-row.court::before { background: var(--red); }
.issue-row:hover { background: #fbfcff; }
.issue-number {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: var(--ink);
  background: var(--gold-soft);
  border: 2px solid #efd694;
  border-radius: 15px;
  font: 700 23px/1 Georgia, serif;
}
.issue-number.historical { font: 800 11px/1.1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .7px; text-align: center; }
.issue-copy h3 { margin: 0; font-size: 20px; line-height: 1.25; }
.issue-copy p { margin: 8px 0 0; color: #7a8594; font-size: 15px; }
.issue-meta { display: flex; gap: 14px; align-items: center; justify-content: flex-start; }
.owner-token, .timeline-token {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  color: white;
  background: #d4911d;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .5px;
}
.badge {
  display: inline-block;
  width: fit-content;
  padding: 8px 12px;
  color: var(--green);
  background: #e7f5f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.badge.proposal { color: var(--orange); background: #fff0dc; }
.badge.court { color: var(--red); background: #fae8e9; }
.row-arrow { color: #a0a8b3; font-size: 38px; font-weight: 300; }
.issue-row.stub { min-height: 96px; cursor: default; }
.issue-row.stub::before { background: #8b96a5; }
.issue-row.stub .issue-number { height: 50px; width: 50px; border-radius: 12px; font-size: 18px; }
.issue-row.stub:hover { background: white; }

#empty { margin: 0; padding: 50px; text-align: center; }
#empty button { color: white; background: var(--ink); border: 0; border-radius: 6px; padding: 8px 12px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 30px 4px 45px; color: #697486; font-size: 13px; }

dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(780px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  color: var(--ink);
  background: #f6f8fa;
  border: 0;
  box-shadow: -20px 0 80px rgba(0, 0, 0, .28);
}
dialog::backdrop { background: rgba(7, 22, 45, .72); backdrop-filter: blur(4px); }
.drawer-top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 105px;
  padding: 23px 36px 23px 132px;
  color: white;
  background: var(--ink);
  border-bottom: 5px solid var(--gold);
}
.drawer-seal { position: absolute; z-index: 5; left: 30px; bottom: -26px; width: 78px; height: 78px; object-fit: contain; }
.drawer-labels { display: flex; flex-direction: column; gap: 4px; }
#item-topic { font-size: 13px; letter-spacing: 2.2px; }
#item-id { color: #b9c5d5; font-size: 13px; }
.drawer-actions { display: flex; gap: 10px; }
.drawer-actions button {
  width: 48px;
  height: 48px;
  color: white;
  background: #172b47;
  border: 1px solid #516078;
  border-radius: 10px;
  font-size: 24px;
}
.detail-lead { display: grid; grid-template-columns: 94px 1fr; gap: 26px 24px; padding: 54px 36px 34px; background: white; border-bottom: 1px solid var(--line); }
.detail-number { display: grid; place-items: center; width: 88px; height: 88px; color: var(--ink); background: var(--gold-soft); border: 2px solid #efd694; border-radius: 18px; font: 700 31px/1 Georgia, serif; }
.detail-number.historical { font: 800 14px/1.15 ui-sans-serif, system-ui, sans-serif; letter-spacing: 1px; text-align: center; }
#detail h2 { margin: 8px 0 0; font: 700 clamp(39px, 6vw, 62px)/.98 Georgia, serif; letter-spacing: -2.4px; }
.description { grid-column: 1 / -1; margin: 0; color: #667183; font: 400 24px/1.45 Georgia, serif; }
.stream-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.stream-tag { padding: 7px 11px; color: #73530f; background: #fff5d6; border: 1px solid #e6c66d; border-radius: 999px; font-size: 12px; font-weight: 800; }
.stream-tag:hover { background: #f7e6ab; }
.facts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.facts div { min-height: 116px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div:nth-child(2n) { border-right: 0; }
.facts div:nth-last-child(-n+2) { border-bottom: 0; }
dt { color: #8b96a5; font-size: 12px; font-weight: 850; letter-spacing: 1.6px; text-transform: uppercase; }
dd { margin: 8px 0 0; color: #39465a; font-size: 17px; font-weight: 750; }
.activity-section { padding: 34px 36px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-heading h3 { margin: 0; }
.section-heading span { color: #96a1b0; font-size: 13px; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 23px; width: 2px; background: #d8dee6; }
.timeline-event { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 18px; align-items: start; margin-bottom: 22px; }
.timeline-token { position: relative; z-index: 1; }
.timeline-token.secondary { background: #326a9c; }
.event-card { padding: 21px 22px; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 4px 13px rgba(7, 22, 45, .05); }
.event-meta { display: flex; justify-content: space-between; gap: 15px; color: #3b4658; }
.event-meta time { color: #99a3af; font-size: 13px; }
.event-card p { margin: 9px 0 0; color: #657184; font-size: 17px; }
.next-step { margin: 30px 36px 0; padding: 22px 25px; border-left: 8px solid var(--gold); background: #fff9e9; }
.next-step h3 { margin: 0 0 7px; color: #86632d; font-size: 12px; letter-spacing: 2px; }
.next-step p { margin: 0; font: 700 22px/1.35 Georgia, serif; }
.source { display: grid; grid-template-columns: 48px 1fr; gap: 20px; margin: 34px 36px; padding: 25px; background: #eaf5ff; border: 1px solid #9dcaee; border-radius: 14px; }
.source-icon { display: grid; place-items: center; width: 44px; height: 44px; color: white; background: #2473af; border-radius: 50%; font: 700 25px/1 Georgia, serif; }
.source h3 { margin: 3px 0 10px; color: #1f5f8e; }
.source p { margin: 0 0 16px; color: #365d79; }
.source a { display: block; margin-top: 8px; color: #145b8f; font-weight: 800; }
.drawer-nav { display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); }
.drawer-nav button { min-height: 105px; padding: 22px 30px; color: white; text-align: left; background: transparent; border: 0; border-right: 1px solid #34465e; }
.drawer-nav button:last-child { border: 0; text-align: right; }
.drawer-nav span { display: block; margin-bottom: 6px; color: #b9c5d5; font-size: 11px; font-weight: 800; letter-spacing: 1.3px; }
.drawer-nav strong { display: block; overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.drawer-bottom { display: flex; align-items: center; gap: 16px; padding: 18px 36px; background: white; }
#back { padding: 9px 14px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 7px; }
#feedback { color: var(--green); font-size: 13px; }
body:has(dialog[open]) { overflow: hidden; }

@media (max-width: 820px) {
  body { background-size: 54px 54px; }
  .masthead-inner { width: 100%; min-height: 108px; padding: 14px 20px; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; }
  .header-seal { left: 20px; bottom: -31px; width: 92px; height: 92px; }
  .brand { font-size: 24px; }
  .brand span { display: none; }
  .system-status { display: none; }
  .monogram { display: grid; grid-column: 3; width: 46px; height: 46px; font-size: 14px; }
  main { width: 100%; }
  .hero { padding: 42px 20px 26px; }
  .eyebrow { font-size: 11px; line-height: 1.5; letter-spacing: 2px; }
  h1 { font-size: clamp(52px, 17vw, 78px); letter-spacing: -3.6px; }
  .intro { margin: 22px 0 28px; font-size: 27px; }
  .executive-summary { padding: 25px 24px 25px 32px; }
  .executive-summary strong { font-size: 28px; }
  .executive-summary p { font-size: 16px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 20px 36px; }
  .metrics > div { min-height: 145px; padding: 19px; }
  .metrics strong { font-size: 43px; }
  .workspace { margin: 0; border-right: 0; border-left: 0; border-radius: 0; }
  .toolbar { flex-wrap: wrap; padding: 16px 20px; }
  .tabs { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  select { max-width: 180px; flex: 1 1 142px; }
  .group-heading { padding: 19px 20px; }
  .issue-row { grid-template-columns: 54px 1fr 20px; gap: 14px; min-height: 172px; padding: 24px 18px 23px 20px; }
  .issue-number { width: 50px; height: 50px; border-radius: 13px; font-size: 18px; }
  .issue-copy h3 { font-size: 18px; }
  .issue-copy p { font-size: 14px; }
  .issue-meta { grid-column: 2 / 4; flex-wrap: wrap; }
  .owner-token { width: 42px; height: 42px; }
  .row-arrow { grid-column: 3; grid-row: 1; }
  footer { padding: 28px 20px 40px; flex-direction: column; gap: 4px; }
  dialog { width: 100%; }
  .drawer-top { min-height: 96px; padding: 18px 20px 18px 94px; }
  .drawer-seal { left: 18px; bottom: -22px; width: 66px; height: 66px; }
  .detail-lead { grid-template-columns: 74px 1fr; gap: 22px 18px; padding: 44px 20px 32px; }
  .detail-number { width: 70px; height: 70px; border-radius: 15px; font-size: 24px; }
  #detail h2 { font-size: 43px; letter-spacing: -1.8px; }
  .description { font-size: 22px; }
  .facts div { min-height: 110px; padding: 18px; }
  dd { font-size: 15px; }
  .activity-section { padding: 30px 20px; }
  .timeline-event { gap: 14px; }
  .event-card { padding: 18px; }
  .event-card p { font-size: 16px; }
  .source { margin: 28px 20px; padding: 21px; }
  .next-step { margin: 24px 20px 0; padding: 20px; }
  .next-step p { font-size: 19px; }
  .drawer-bottom { padding: 16px 20px; }
}

@media (max-width: 460px) {
  .metrics > div { min-height: 132px; }
  .metrics span { font-size: 10px; letter-spacing: 1.5px; }
  .metrics strong { font-size: 39px; }
  .metrics small { font-size: 12px; }
  .facts { grid-template-columns: 1fr; }
  .facts div, .facts div:nth-child(2n), .facts div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .facts div:last-child { border-bottom: 0; }
  .source { grid-template-columns: 1fr; }
  .drawer-actions button { width: 43px; height: 43px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
