:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #1f3037;
  --muted: #627079;
  --line: #dce1df;
  --green: #17685d;
  --soft: #eaf2ef;
  --amber: #8b5917;
  --red: #9a3c39;
  --white: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.6 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid var(--green);
  border-radius: 7px;
  padding: 9px 15px;
  background: var(--green);
  color: white;
  font-weight: 600;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button:hover {
  filter: brightness(0.94);
}
:focus-visible {
  outline: 3px solid #dfa83b;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 20px 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
}
.mark {
  background: var(--green);
  color: white;
  width: 47px;
  height: 47px;
  border-radius: 11px;
  font-family: Georgia, serif;
  font-size: 34px;
  line-height: 47px;
  text-align: center;
}
.mark span {
  font-size: 17px;
}
.account {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  max-width: 1550px;
  margin: auto;
  min-height: 76vh;
}
aside {
  padding: 32px 20px;
  border-right: 1px solid var(--line);
}
nav {
  display: grid;
  gap: 6px;
}
.nav {
  background: transparent;
  color: var(--muted);
  border: 0;
  text-align: left;
  font-size: 13px;
  padding: 11px 13px;
}
.nav.active {
  background: var(--soft);
  color: var(--green);
}
.sidebar-note {
  margin: 40px 12px;
  color: var(--muted);
  font-size: 12px;
}
.sidebar-note strong {
  color: var(--ink);
}
.sidebar-note a {
  display: block;
  margin-top: 12px;
}
main {
  padding: 38px clamp(20px, 4vw, 60px);
  min-width: 0;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 750;
  color: var(--green);
  margin: 0 0 8px;
}
h1 {
  font:
    500 clamp(28px, 3vw, 40px)/1.2 Georgia,
    serif;
  letter-spacing: -0.7px;
  margin: 0 0 14px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.3px;
  margin: 0 0 12px;
}
h3 {
  font-size: 15px;
  margin: 0 0 6px;
}
.intro {
  max-width: 660px;
  color: var(--muted);
  margin-bottom: 26px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 25px 0;
}
input,
select,
textarea {
  border: 1px solid #bbc7c6;
  background: white;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  min-width: 0;
}
input[type="search"] {
  flex: 1;
  min-width: 190px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin: 15px 0 6px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 15px;
}
.card {
  overflow-wrap: anywhere;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px;
  min-width: 0;
}
.card button.link,
.link {
  background: none;
  border: 0;
  color: var(--green);
  padding: 0;
  text-align: left;
  font-weight: 650;
}
.card p {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 12px;
}
.card small {
  color: var(--muted);
}
.badge {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-block;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: var(--soft);
  color: var(--green);
  line-height: 1.4;
}
.badge.amber {
  background: #fbefda;
  color: var(--amber);
}
.badge.red {
  background: #f8e9e7;
  color: var(--red);
}
.badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.empty {
  border: 1px dashed #bdc8c4;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: #ffffff80;
}
.empty h2 {
  color: var(--ink);
}
.detail-grid {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 30px;
}
.article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: clamp(20px, 3vw, 40px);
  font:
    17px/1.8 Georgia,
    serif;
  overflow-wrap: anywhere;
}
.article h1 {
  font-size: 30px;
}
.article h2 {
  font-family: Georgia, serif;
  font-size: 25px;
  margin: 26px 0 12px;
}
.article h3 {
  font-family: Georgia, serif;
  font-size: 21px;
}
.article pre {
  font:
    12px/1.6 ui-monospace,
    monospace;
  background: var(--paper);
  padding: 15px;
  overflow: auto;
}
.article code {
  font:
    13px ui-monospace,
    monospace;
}
.article table {
  border-collapse: collapse;
  font: 13px/1.5 system-ui;
}
.article th,
.article td {
  border: 1px solid var(--line);
  padding: 7px;
}
.article blockquote {
  border-left: 3px solid var(--green);
  padding-left: 20px;
  color: var(--muted);
}
.media-note {
  font: 12px system-ui;
  color: var(--muted);
}
.inspector {
  font-size: 12px;
}
.inspector .card {
  margin-bottom: 15px;
}
dl {
  margin: 0;
}
dt {
  color: var(--muted);
  font-size: 11px;
  margin-top: 10px;
}
dd {
  margin: 2px 0;
  overflow-wrap: anywhere;
}
.hash {
  font:
    11px/1.7 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  user-select: all;
}
details {
  margin-top: 18px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
pre.raw {
  font:
    11px/1.65 ui-monospace,
    monospace;
  overflow: auto;
  max-height: 450px;
  white-space: pre-wrap;
  background: #eef0ec;
  padding: 18px;
  border-radius: 7px;
  overflow-wrap: anywhere;
}
section.trail {
  margin-top: 30px;
}
.stack {
  display: grid;
  gap: 12px;
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}
.actions button {
  font-size: 12px;
}
.back {
  margin-bottom: 25px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
#notice {
  border-left: 3px solid var(--green);
  background: var(--soft);
  padding: 12px 16px;
  margin-bottom: 25px;
  font-size: 13px;
}
#notice.error {
  border-color: var(--red);
  background: #f8e9e7;
}
.list-title {
  margin: 32px 0 14px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 480px;
  width: calc(100% - 32px);
  padding: 32px;
  box-shadow: 0 15px 80px #18362f33;
  color: var(--ink);
}
dialog::backdrop {
  background: #17383366;
}
dialog textarea {
  width: 100%;
  font-size: 12px;
}
.close {
  position: absolute;
  right: 15px;
  top: 12px;
  font-size: 20px;
  border: 0;
  padding: 3px 8px;
}
#login-error,
#action-error {
  color: var(--red);
  font-size: 12px;
}
.skip {
  position: absolute;
  left: 10px;
  top: -60px;
  background: white;
  padding: 10px;
  z-index: 5;
}
.skip:focus {
  top: 8px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 20px 4vw;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}
.diff-added {
  background: #eaf2ef;
}
.diff-removed {
  background: #f8e9e7;
}
.diff-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.7 ui-monospace,
    monospace;
  padding: 2px 10px;
}
.progress {
  height: 4px;
  background: var(--line);
  margin-bottom: 24px;
}
.progress::before {
  content: "";
  display: block;
  width: 35%;
  height: 100%;
  background: var(--green);
  animation: loading 1s ease-in-out infinite alternate;
}
@keyframes loading {
  to {
    margin-left: 65%;
  }
}
.credential-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}
.credential-form > h2,
.credential-form > fieldset,
.credential-form > .error,
.credential-form > button {
  grid-column: 1 / -1;
}
.credential-field input,
.credential-field select {
  width: 100%;
}
.credential-form > button {
  justify-self: start;
}
.credential-grants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}
.credential-grant {
  display: flex;
  align-items: center;
  gap: 8px;
}
.credential-grant input {
  order: -1;
  width: auto;
  margin: 0;
}
.credential-grant label {
  margin: 0;
  font-weight: 500;
}
@media (max-width: 650px) {
  .credential-form {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .progress::before {
    animation: none;
  }
}
@media (max-width: 950px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .inspector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
  }
  .inspector .card {
    margin: 0;
  }
  .account span {
    display: none;
  }
}
@media (max-width: 650px) {
  header {
    padding: 15px 18px;
  }
  .brand small {
    font-size: 10px;
  }
  .shell {
    display: block;
  }
  aside {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 3px;
  }
  .nav {
    white-space: nowrap;
    font-size: 11px;
    padding: 8px 10px;
  }
  .sidebar-note {
    display: none;
  }
  main {
    padding: 25px 18px;
  }
  .card {
    padding: 17px;
  }
  .empty {
    padding: 25px;
  }
  .toolbar input {
    width: 100%;
  }
  footer span {
    display: none;
  }
  .row {
    flex-wrap: wrap;
  }
}

.inspector .card > .link {
  display: block;
  margin-top: 12px;
}
.card > button + button {
  margin-left: 10px;
}
.card > .quiet {
  margin-top: 8px;
}

.signal-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 1rem;
  font-size: 0.9rem;
}
.signal-panel th,
.signal-panel td {
  padding: 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.signal-panel textarea {
  width: 100%;
}

.lineage-panel,
.resolution-panel {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Repository exploration and reviewer workspace */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0;
  margin: 14px 0;
  border-block: 1px solid var(--line);
  font-size: 13px;
}
.record-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.record-links:empty {
  display: none;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.metric {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: white;
  text-decoration: none;
  color: var(--ink);
}
.metric strong {
  display: block;
  font-size: 32px;
  line-height: 1.2;
  color: var(--green);
  margin-bottom: 8px;
}
.metric:hover {
  border-color: var(--green);
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.overview-grid > .card {
  margin: 0;
}
.compact-record {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
}
.compact-record small {
  display: block;
  flex-basis: 100%;
  color: var(--muted);
}
.queue-filters {
  align-items: end;
}
.filter-field {
  margin: 0;
  min-width: 130px;
}
.filter-field select,
.filter-field input {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.lineage-node {
  border-left: 3px solid var(--line);
  padding: 18px;
  margin: 14px 0;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.selected-revision {
  border-color: var(--green);
  background: var(--soft);
}
.lineage-node > .link {
  display: inline-block;
  margin-right: 16px;
}
.edge {
  margin: 8px 0;
  font-size: 13px;
}
.compare-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin: 22px 0;
}
.compare-controls label {
  margin: 0;
  min-width: 0;
}
.compare-controls input {
  display: block;
  width: 100%;
  font:
    12px/1.6 ui-monospace,
    monospace;
  margin: 6px 0;
}
.compare-controls small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.compare-controls .actions {
  grid-column: 1/-1;
}
.compare-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.compare-split > section {
  min-width: 0;
}
.compare-split > section + section {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}
[aria-pressed="true"] {
  background: var(--green);
  color: white;
}
.comparison-output {
  margin-top: 18px;
}
.markdown-comparison ins,
.comparison-legend ins {
  background: #d8f2e4;
  color: #12533c;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.markdown-comparison del,
.comparison-legend del {
  background: #fbe2df;
  color: #882f2b;
  text-decoration: line-through;
}
.markdown-comparison .diff-added,
.markdown-comparison .diff-removed {
  border-left: 3px solid;
  padding-left: 8px;
}
.markdown-comparison .diff-added {
  border-color: #28724e;
}
.markdown-comparison .diff-removed {
  border-color: #a04740;
}
.source-diff .diff-line {
  display: grid;
  grid-template-columns: 38px 38px minmax(0, 1fr);
  gap: 8px;
}
.line-number {
  color: var(--muted);
  text-align: right;
  user-select: none;
  font-size: 10px;
  border-right: 1px solid var(--line);
  padding-right: 5px;
}
.article table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}
.article th,
.article td {
  border: 1px solid var(--line);
  padding: 8px;
}
.article pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.article,
.card,
.stack,
.trail {
  min-width: 0;
}
#article-history,
#article-lineage,
#article-references,
#article-review,
#article-relations {
  scroll-margin-top: 18px;
}
@media (max-width: 1000px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .compare-controls,
  .compare-split {
    grid-template-columns: 1fr;
  }
  .compare-split > section + section {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
  .metric {
    padding: 12px;
    font-size: 12px;
  }
  .metric strong {
    font-size: 26px;
  }
  .source-diff .diff-line {
    padding-inline: 2px;
    grid-template-columns: 25px 25px minmax(0, 1fr);
    gap: 4px;
  }
}
.identifier {
  font:
    12px/1.6 ui-monospace,
    monospace;
  cursor: help;
}
.revision-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.revision-pair small {
  display: block;
  margin-top: 8px;
}
.comparison-output > .article {
  border: 0;
  padding: 10px;
}
.comparison-output .article p,
.comparison-output .article li {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.8;
}
.reader-observations > .signal-panel {
  border: 0;
  padding: 18px 0 0;
}
@media (max-width: 650px) {
  .revision-pair {
    grid-template-columns: 1fr;
  }
}
