/* Shared chrome for the UPSC utility pages (Anchor and the Pattern Atlas).
   Tokens, navigation, footer and the notebook primitives live here so the two
   pages cannot drift apart, and so a third page costs no duplication.
   Page-specific rules stay in upsc.css and upsc-patterns.css. */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --blue: #0066cc;
  --text: #1d1d1f;
  /* A step darker than the sitewide #86868b: this page leans on secondary text
     for labels and guidance, and #86868b sits at 3.3:1 on the page surface. */
  --gray: #6e6e73;
  --bg: #f5f5f7;
  --white: #fff;
  --green: #1f7a3a;
  --red: #c32b23;
  --amber: #9a6b12;

  /* Page character: warm paper, hairline rules, one highlighter */
  --paper: #fffdf8;
  --paper-edge: #f1ede2;
  --rule: rgba(0, 0, 0, 0.09);
  --rule-strong: rgba(0, 0, 0, 0.16);
  --mark: rgba(226, 168, 48, 0.22);
  --mark-edge: rgba(180, 124, 20, 0.35);

  --card-line: rgba(0, 0, 0, 0.08);
  --input-bg: #fff;
  --input-line: rgba(0, 0, 0, 0.14);
  --panel-muted: #f2f2f4;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --max: 1240px;

  --fast: 140ms;
  --normal: 220ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

:root[data-theme="dark"] {
  --blue: #4c9cff;
  --text: #f2f2f7;
  --gray: #9a9aa2;
  --bg: #0d0d10;
  --white: #17171b;
  --green: #4cc26a;
  --red: #ff6b60;
  --amber: #e8c877;

  --paper: #16161a;
  --paper-edge: #24242a;
  --rule: rgba(255, 255, 255, 0.1);
  --rule-strong: rgba(255, 255, 255, 0.2);
  --mark: rgba(226, 168, 48, 0.16);
  --mark-edge: rgba(232, 200, 119, 0.32);

  --card-line: rgba(255, 255, 255, 0.1);
  --input-bg: #1f1f24;
  --input-line: rgba(255, 255, 255, 0.16);
  --panel-muted: #1c1c21;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
select,
input,
textarea,
.nav-links,
.nav-logo {
  font-family: var(--sans);
}

button,
select,
input,
textarea {
  font-size: 14px;
  color: inherit;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.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: absolute;
  left: 16px;
  top: -80px;
  z-index: 10000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-family: var(--sans);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- Nav (shared chrome, same tokens as the other Utilities pages) ---------- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 48px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  border-bottom: 1px solid var(--card-line);
  --nav-drop-bg: var(--white);
  --nav-drop-line: var(--card-line);
  --nav-drop-hover: rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] nav {
  --nav-drop-hover: rgba(255, 255, 255, 0.07);
}

.nav-c {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}

.nav-logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  opacity: 0.8;
  transition: opacity var(--fast) var(--ease), color var(--fast) var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  color: var(--blue);
}

.theme-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.theme-toggle:hover {
  background: var(--card-line);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root:not([data-theme="dark"]) .theme-toggle .moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 48px;
  left: 0;
  width: 100%;
  background: var(--white);
  padding: 20px;
  border-bottom: 1px solid var(--card-line);
  z-index: 9998;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid var(--card-line);
  font-family: var(--sans);
}

.mobile-menu a.active {
  color: var(--blue);
}

/* ---------- Shared label / button vocabulary ---------- */
.an-label {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gray);
}

.an-num {
  font-variant-numeric: tabular-nums;
}

.btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: #0055aa;
  border-color: #0055aa;
  color: #fff;
}

/* On the dark surface the accent is light, so the label has to go dark to keep
   contrast above 4.5:1. */
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover {
  color: #0d0d10;
}

:root[data-theme="dark"] .btn-primary:hover {
  background: #6cb0ff;
  border-color: #6cb0ff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-quiet {
  border-color: transparent;
  background: none;
  color: var(--gray);
  padding: 0 8px;
}

.btn-quiet:hover {
  color: var(--blue);
  border-color: transparent;
}

input[type="text"],
input[type="search"],
input[type="date"],
select,
textarea {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  width: 100%;
}

textarea {
  min-height: 62px;
  padding: 8px 10px;
  line-height: 1.5;
  resize: vertical;
}

select {
  cursor: pointer;
}

/* ---------- Header ---------- */
.an-textbtn {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.an-textbtn:hover {
  color: var(--blue);
}

.an-namenote {
  max-width: 62ch;
  margin-top: 18px;
  padding-left: 14px;
  border-left: 1px solid var(--rule-strong);
  font-size: 15px;
  font-style: italic;
  color: var(--gray);
}

/* ---------- Command bar ---------- */
.an-command {
  position: sticky;
  top: 48px;
  z-index: 500;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-line);
  margin-top: 28px;
}

.an-command__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.an-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
}

.an-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent);
}

.an-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke: var(--gray);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.an-search input {
  border: 0;
  background: none;
  min-height: 42px;
  padding: 0;
}

.an-search input:focus {
  outline: none;
}

.an-search kbd {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--gray);
  border: 1px solid var(--input-line);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

.an-views {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
}

.an-views button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--gray);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.an-views button:hover {
  color: var(--text);
}

.an-views button[aria-selected="true"] {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.an-views .an-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  opacity: 0.65;
  margin-left: 5px;
}

/* ---------- Workspace ---------- */
.an-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 22px 96px;
}

.an-workspace {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 1000px) {
  .an-workspace {
    grid-template-columns: minmax(0, 1fr) 268px;
    gap: 48px;
  }
}

.an-view[hidden] {
  display: none;
}

.an-viewhead {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-strong);
}

.an-viewhead h2 {
  font-size: 24px;
}

.an-viewhead__meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}

.an-viewhead__meta strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.an-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
}

.an-segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
}

.an-segmented button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--gray);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.an-segmented button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.an-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.an-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-xs);
  background: none;
  color: var(--gray);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.an-chip:hover {
  color: var(--text);
}

.an-chip[aria-pressed="true"] {
  border-color: var(--text);
  color: var(--text);
}

.an-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--gray);
}

.an-check input {
  width: auto;
  min-height: 0;
  accent-color: var(--blue);
}

.an-toolbar__right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Notebook entries ---------- */
.an-entries {
  list-style: none;
}

.an-entry {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.an-entry:last-child {
  border-bottom: 0;
}

.an-entry__margin {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
  text-align: right;
  border-right: 1px solid var(--rule);
  padding-right: 12px;
}

.an-entry__score {
  font-variant-numeric: tabular-nums;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.an-entry[data-band="thin"] .an-entry__score,
.an-entry[data-band="log"] .an-entry__score {
  color: var(--gray);
  font-weight: 500;
}

.an-entry__band {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
}

.an-entry__title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.an-entry__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 7px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray);
}

.an-anchor {
  font-weight: 600;
  color: var(--text);
}

.an-anchor .an-label {
  margin-right: 3px;
  font-size: 9.5px;
}

/* Labels, not controls: the paper chips in the toolbar are the only bordered
   pills, so a code tag never reads as something you can press. */
.an-code {
  font-variant-numeric: tabular-nums;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--panel-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.an-verify {
  font-size: 11.5px;
  font-weight: 600;
}

.an-verify[data-verified="true"] {
  color: var(--green);
}

.an-verify[data-verified="false"] {
  color: var(--amber);
}

/* The one line that has to survive: highlighted like a topper's marker. */
.an-use {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  background: var(--mark);
  box-shadow: inset 2px 0 0 var(--mark-edge);
  font-size: 16px;
  line-height: 1.5;
}

.an-use .an-label {
  display: block;
  margin-bottom: 2px;
  color: color-mix(in srgb, var(--text) 60%, transparent);
}

.an-lines {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.an-line {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.an-line > .an-label {
  padding-top: 3px;
}

.an-line p {
  font-size: 15.5px;
  line-height: 1.5;
}

.an-entry__expand {
  margin-top: 12px;
  font-family: var(--sans);
}

.an-entry__expand > summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  padding: 4px 0;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.an-entry__expand > summary::-webkit-details-marker {
  display: none;
}

.an-entry__expand > summary::before {
  content: "+ ";
  margin-right: 4px;
}

.an-entry__expand[open] > summary::before {
  content: "− ";
}

.an-treatment {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--gray);
  line-height: 1.5;
}

.an-entry__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.an-entry__actions a {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  padding: 4px 0;
}

.an-entry__actions a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Clusters, discard log ---------- */
.an-block {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-strong);
}

.an-block h3 {
  font-size: 18px;
}

.an-block__intro {
  margin-top: 6px;
  max-width: 66ch;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray);
  line-height: 1.55;
}

.an-clusters {
  list-style: none;
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.an-cluster {
  padding-left: 14px;
  border-left: 1px solid var(--rule-strong);
}

.an-cluster h4 {
  font-size: 16px;
}

.an-cluster p {
  margin-top: 4px;
  font-size: 15.5px;
  line-height: 1.5;
}




/* ---------- States ---------- */
.an-state {
  padding: 34px 0 8px;
  max-width: 60ch;
}

.an-state h3 {
  font-size: 19px;
}

.an-state p {
  margin-top: 8px;
  color: var(--gray);
  font-size: 15.5px;
  line-height: 1.6;
}

.an-state .btn {
  margin-top: 16px;
}

.an-skeleton {
  list-style: none;
  padding-top: 8px;
}

.an-skeleton li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.an-skeleton span {
  display: block;
  height: 12px;
  border-radius: 3px;
  background: var(--panel-muted);
  animation: an-pulse 1.4s var(--ease) infinite;
}

.an-skeleton div {
  display: grid;
  gap: 10px;
}

.an-skeleton span:nth-child(2) {
  width: 72%;
}

.an-skeleton span:nth-child(3) {
  width: 46%;
}

@keyframes an-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- Lookup result ---------- */
.an-lookup {
  padding-top: 22px;
}

.an-lookup__head h3 {
  font-size: 26px;
  letter-spacing: -0.025em;
}

.an-lookup__oneliner {
  margin-top: 10px;
  max-width: 66ch;
  font-size: 17px;
  line-height: 1.55;
}

.an-points {
  counter-reset: point;
  list-style: none;
  margin-top: 8px;
}

.an-points li {
  counter-increment: point;
  position: relative;
  padding: 10px 0 10px 34px;
  border-bottom: 1px solid var(--rule);
  font-size: 16.5px;
  line-height: 1.5;
}

.an-points li::before {
  content: counter(point);
  position: absolute;
  left: 0;
  top: 12px;
  width: 22px;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  text-align: right;
}

.an-valueadds {
  list-style: none;
  margin-top: 8px;
}

.an-valueadds li {
  display: grid;
  gap: 2px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 620px) {
  .an-valueadds li {
    grid-template-columns: 108px minmax(0, 1fr);
    align-items: baseline;
  }
}

.an-valueadds strong {
  font-size: 15.5px;
  font-weight: 600;
}

.an-valueadds p {
  font-size: 15px;
  color: var(--gray);
  line-height: 1.5;
}

.an-two {
  display: grid;
  gap: 24px;
  margin-top: 8px;
}

@media (min-width: 720px) {
  .an-two {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

.an-list {
  list-style: none;
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.an-list li {
  padding-left: 14px;
  position: relative;
  font-size: 15.5px;
  line-height: 1.5;
}

.an-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gray);
}

.an-stems {
  list-style: none;
  margin-top: 8px;
  display: grid;
  gap: 14px;
}

.an-stem {
  padding: 14px 16px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.an-stem p {
  font-size: 16.5px;
  line-height: 1.45;
}

.an-stem__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--gray);
}

.an-stem__verb {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.an-trap {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--mark-edge);
  border-radius: var(--radius-sm);
  background: var(--mark);
}

.an-trap .an-label {
  color: color-mix(in srgb, var(--text) 60%, transparent);
}

.an-trap p {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.5;
}

.an-sources {
  list-style: none;
  margin-top: 8px;
  display: grid;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
}

.an-sources a {
  color: var(--blue);
  text-decoration: none;
}

.an-sources a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.an-sources span {
  color: var(--gray);
  font-size: 12px;
}

/* ---------- Revision ---------- */
.an-revise {
  padding-top: 22px;
}

.an-card {
  padding: 28px 24px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: var(--paper);
}

.an-revise__progress {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
}

.an-revise__title {
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.an-revise__prompt {
  margin-top: 14px;
  max-width: 56ch;
  color: var(--gray);
  font-size: 15.5px;
  line-height: 1.6;
}

.an-revise__reveal {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.an-revise__reveal[hidden] {
  display: none;
}

.an-revise__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.an-revise__legend {
  margin-top: 20px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--gray);
  line-height: 1.55;
  max-width: 64ch;
}

/* ---------- Rail ---------- */
.an-rail {
  display: grid;
  gap: 22px;
  align-content: start;
}

@media (min-width: 1000px) {
  .an-rail {
    position: sticky;
    top: 116px;
  }
}

.an-railblock {
  padding: 16px 18px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: var(--paper);
}

.an-railblock h3 {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gray);
}

.an-stats {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.an-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray);
}

.an-stat strong {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.an-stat[data-warn="true"] strong {
  color: var(--amber);
}

.an-tests {
  counter-reset: test;
  list-style: none;
  margin-top: 12px;
  display: grid;
  gap: 9px;
}

.an-tests li {
  counter-increment: test;
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.45;
}

.an-tests li::before {
  content: counter(test);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
}

.an-tests em {
  color: var(--gray);
  font-size: 13px;
}

.an-railnote {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}

/* ---------- How to use ---------- */
.an-how {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px 20px;
}

.an-how__inner {
  padding-top: 34px;
  border-top: 1px solid var(--rule-strong);
}

.an-how h2 {
  font-size: 26px;
  letter-spacing: -0.025em;
}

.an-how__intro {
  margin-top: 10px;
  max-width: 66ch;
  color: var(--gray);
  font-size: 16px;
  line-height: 1.6;
}

.an-steps {
  counter-reset: step;
  list-style: none;
  margin-top: 26px;
  display: grid;
  gap: 24px;
}

@media (min-width: 760px) {
  .an-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 40px;
  }
}

.an-steps li {
  counter-increment: step;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.an-steps h3 {
  font-size: 17px;
}

.an-steps h3::before {
  content: counter(step) " · ";
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  letter-spacing: 0.06em;
}

.an-steps p {
  margin-top: 6px;
  color: var(--gray);
  font-size: 15px;
  line-height: 1.6;
}

.an-honesty {
  margin-top: 34px;
  padding: 18px 20px;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: var(--paper);
  max-width: 76ch;
}

.an-honesty h3 {
  font-size: 16px;
}

.an-honesty ul {
  margin: 10px 0 0 18px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--gray);
  line-height: 1.6;
}

.an-honesty li + li {
  margin-top: 6px;
}

.an-honesty a {
  color: var(--blue);
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--card-line);
  padding: 28px 22px 48px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray);
}

.attribution {
  text-align: right;
  line-height: 1.45;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 719px) {
  .an-command__inner {
    padding: 10px 16px;
  }

  .an-search kbd {
    display: none;
  }

  .an-views {
    width: 100%;
    overflow-x: auto;
  }

  .an-views button {
    flex: 1 0 auto;
    min-height: 44px;
  }

  .an-chip,
  .an-segmented button {
    min-height: 38px;
  }

  .an-main {
    padding: 24px 16px 80px;
  }

  .an-position {
    padding: 8px 16px 0;
  }

  .an-how {
    padding: 0 16px 20px;
  }

  .an-entry {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .an-entry__margin {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    text-align: left;
    border-right: 0;
    padding-right: 0;
  }

  .an-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .an-skeleton li {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ---------- Shared feedback ---------- */
.an-counter {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
}

.an-counter[data-over="true"] {
  color: var(--red);
  font-weight: 600;
}

.an-status {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--green);
}

.an-status[data-tone="error"] {
  color: var(--red);
}

.an-status[hidden] {
  display: none;
}
