:root {
  color-scheme: light;
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --ink: #171a1f;
  --muted: #65706f;
  --line: rgba(33, 41, 43, .14);
  --teal: #2d7971;
  --violet: #665f83;
  --rust: #9b5f45;
  --shadow: 0 14px 34px rgba(28, 36, 38, .06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 244, .94);
  backdrop-filter: blur(14px);
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  font-weight: 850;
}

.mark,
.ao-home {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mark {
  color: var(--teal);
  font-weight: 950;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

nav a:hover,
.actions a:hover,
.revision-row a:hover {
  color: var(--ink);
}

.ao-home img {
  width: 21px;
  height: 21px;
}

main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 26px 20px 58px;
}

.calm-shell {
  max-width: 860px;
}

.hero {
  padding: 18px 0 20px;
}

.eyebrow,
.row-label span,
.section-head span,
.details-grid span,
.detail-block span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 6px 0 8px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 620px;
  margin: 0;
  color: #3f4748;
  font-size: 17px;
  line-height: 1.44;
  font-weight: 640;
}

.actions,
.paper-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.actions a,
.paper-actions a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #303839;
  font-size: 13px;
  font-weight: 820;
}

.current-card,
.analysis-card,
.revision-section,
.details-panel,
.paper-doc {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.current-card,
.analysis-card,
.revision-section,
.details-panel {
  margin-top: 12px;
  padding: 20px;
  max-width: 100%;
  overflow: hidden;
}

.current-card {
  border-left: 4px solid var(--teal);
}

.analysis-card {
  background: var(--surface-2);
}

.row-label,
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.row-label strong,
.section-head strong {
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

h2 {
  margin: 0 0 8px;
  font-size: clamp(23px, 4vw, 32px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.current-card p,
.analysis-card p,
.detail-block p,
.revision-row p,
.paper-doc p {
  margin: 0;
  color: #3f4748;
  font-size: 15px;
  line-height: 1.48;
  font-weight: 590;
  overflow-wrap: anywhere;
}

.revision-list {
  border-top: 1px solid var(--line);
}

.revision-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.revision-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.history-disclosure {
  border-bottom: 1px solid var(--line);
}

.history-disclosure summary {
  cursor: pointer;
  padding: 15px 0;
  color: var(--teal);
  font-size: 14px;
  font-weight: 850;
}

.history-list {
  border-top: 1px solid var(--line);
}

.revision-meta {
  display: grid;
  gap: 8px;
  align-content: start;
}

.revision-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.revision-row a {
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
}

.revision-row h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.details-panel {
  color: #3f4748;
}

.details-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.details-grid div {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.details-grid strong,
code {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.detail-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-block p,
.detail-block ul {
  margin-top: 8px;
}

.detail-block ul {
  margin-bottom: 0;
  padding-left: 18px;
  color: #3f4748;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 590;
}

.paper-main {
  max-width: 900px;
}

.paper-doc {
  padding: 30px;
}

.paper-doc h1 {
  max-width: 760px;
  font-size: clamp(32px, 5vw, 50px);
}

.paper-doc h2 {
  margin: 26px 0 8px;
  font-size: 23px;
  line-height: 1.15;
}

.paper-actions.inline {
  margin-top: 24px;
}

@media (max-width: 720px) {
  .topbar {
    min-height: 58px;
    padding: 0 14px;
    gap: 10px;
    overflow: hidden;
  }

  .brand span:last-child {
    display: none;
  }

  nav {
    min-width: 0;
    margin-left: auto;
    gap: 8px;
  }

  nav a:not(.ao-home) {
    font-size: 13px;
  }

  nav a:not(.ao-home) {
    display: none;
  }

  main,
  .calm-shell {
    width: 100%;
    max-width: 360px;
    margin-left: 0;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 18px;
  }

  .hero {
    padding-top: 10px;
  }

  h1 {
    font-size: 36px;
  }

  .lead {
    font-size: 16px;
  }

  .current-card,
  .analysis-card,
  .revision-section,
  .details-panel,
  .paper-doc {
    padding: 16px;
  }

  .row-label,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .row-label strong,
  .section-head strong {
    text-align: left;
  }

  h2 {
    font-size: 24px;
  }

  .revision-row,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .revision-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 34px;
  }
}
