/* The method library: a drawing sheet. An index with a filter rail and a grid of cards,
   and method pages with a title block and numbered sections. Grotesk text, mono labels,
   hairlines and one accent. Colors follow the system theme. */
:root {
  /* Surfaces */
  --paper: #f5f5f5;
  --wash: #ebebeb;
  --band: #ffffff;
  --field: #f5f5f5;
  --picture: #ececec;
  --picture-hover: #e2e2e2;

  /* Ink: four steps, all at least 4.5:1 on paper */
  --ink-strong: #2b2b2b;
  --ink: #333333;
  --ink-2: #555555;
  --ink-3: #6b6b6b;

  /* Lines */
  --line: rgba(43, 43, 43, 0.14);
  --line-strong: rgba(43, 43, 43, 0.34);

  /* Accent: --accent is for text and thin lines, --accent-fill for solid marks */
  --accent: #047857;
  --accent-fill: #10b981;
  --accent-wash: rgba(16, 185, 129, 0.12);

  /* Status */
  --danger: #b42318;

  /* Type */
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141414;
    --wash: #1d1d1d;
    --band: #1b1b1b;
    --field: #2e2e2e;
    --picture: #1f1f1f;
    --picture-hover: #272727;
    --ink-strong: #f5f5f5;
    --ink: #e6e6e6;
    --ink-2: #b8b8b8;
    --ink-3: #959595;
    --line: rgba(245, 245, 245, 0.14);
    --line-strong: rgba(245, 245, 245, 0.34);
    --accent: #34d399;
    --accent-fill: #10b981;
    --accent-wash: rgba(52, 211, 153, 0.14);
    --danger: #ff8a80;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

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

.muted {
  color: var(--ink-3);
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

/* Frame */
.lib-site {
  --pad: clamp(16px, 4vw, 48px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad) 64px;
}

/* Method pages are mostly running text, so they get a narrower frame. */
.lib-site:has(.lib-page) {
  max-width: 1080px;
}

.lib-head {
  position: relative;
  z-index: 1;
}

.lib-head::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band), 0 1px 0 100vmax var(--line-strong);
  clip-path: inset(0 -100vmax -1px);
}

.lib-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.lib-name {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-strong);
}

.lib-mark {
  display: block;
  width: auto;
  height: 36px;
}

.lib-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lib-icon-link {
  display: flex;
  align-items: center;
  color: var(--ink-2);
}

.lib-nav a {
  text-decoration: none;
}

.signed-in [data-signed-out] {
  display: none;
}

html:not(.signed-in) [data-signed-in] {
  display: none;
}

.lib-nav a:hover {
  color: var(--accent);
}

/* Index */
.lib-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  column-gap: 40px;
  row-gap: 0;
  padding-top: 28px;
}

.lib-layout > section {
  display: contents;
}

.lib-filter-toggle {
  display: none;
}

.lib-wrap,
.lib-empty {
  grid-column: 2;
  grid-row: 3;
}

.lib-rail {
  grid-column: 1;
  grid-row: 2 / span 2;
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 22px;
  font-size: 14px;
}

/* The headings are as tall as the sort bar, so the lines sit at the same height. */
.lib-rail h2 {
  display: flex;
  align-items: center;
  height: 40px;
  margin: 0 0 6px;
  padding: 0;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.lib-rail button {
  display: flex;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 3px 0;
  color: var(--ink-2);
  text-align: left;
}

.lib-rail button::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink-3);
  transform: translateY(0.5px);
}

.lib-rail button:hover {
  color: var(--ink);
}

.lib-rail button[aria-pressed="true"] {
  color: var(--ink);
}

.lib-rail button[aria-pressed="true"]::before {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
}

.lib-top {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-bottom: 36px;
}

.lib-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lib-about {
  max-width: 46rem;
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.lib-count {
  margin: 0 0 0 auto;
}

.lib-count:empty {
  display: none;
}

.lib-bar-search {
  position: relative;
  margin: 0;
}

.lib-search-icon {
  position: absolute;
  top: 50%;
  left: 9px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.lib-bar-search:focus-within .lib-search-icon {
  color: var(--accent);
}

.lib-search {
  display: block;
  box-sizing: border-box;
  width: 12rem;
  height: 28px;
  padding: 0 10px 0 28px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lib-search::placeholder {
  color: var(--ink-3);
}

.lib-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.lib-search:hover {
  border-color: var(--ink-3);
}

.lib-search:focus-visible {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 1px var(--accent);
}

.lib-search-toggle,
.lib-search-close {
  display: none;
}

.lib-suggest {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 4;
  width: 24rem;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 4px 0;
  border: 1px solid var(--line-strong);
  background: var(--band);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  list-style: none;
}

.lib-suggest[hidden] {
  display: none;
}

.lib-suggest a {
  display: block;
  padding: 8px 14px;
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: normal;
  text-transform: none;
}

.lib-suggest strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.lib-suggest span {
  display: block;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-suggest [aria-selected="true"] a,
.lib-suggest a:hover {
  background: var(--accent-wash);
}

.lib-sortbar {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  align-items: center;
  box-sizing: border-box;
  min-height: 40px;
  padding: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}

.lib-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lib-sort:hover,
.lib-sort[aria-pressed="true"] {
  color: var(--ink);
}

.lib-sort:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.lib-sort-mark {
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
  border-left: 4px solid transparent;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.lib-sort:hover .lib-sort-mark {
  opacity: 0.5;
}

.lib-sort[aria-pressed="true"] .lib-sort-mark {
  color: var(--accent);
  opacity: 1;
}

.lib-sort[data-direction="desc"] .lib-sort-mark {
  border-top: 5px solid currentColor;
  border-bottom: 0;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 44px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lib-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lib-card[hidden] {
  display: none;
}

/* The drawings carry their own dark mode colors, so the picture ground follows the theme. */
.lib-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 6 / 5;
  background: var(--picture);
  object-fit: contain;
  transition: background 0.18s ease;
}

.lib-card:hover .lib-card-image {
  background: var(--picture-hover);
}

.lib-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: 12px;
}

.lib-card-purpose {
  margin: 0 0 4px;
}

.lib-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lib-card-title a {
  color: var(--ink);
  text-decoration: none;
}

.lib-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.lib-card:hover .lib-card-title a {
  color: var(--accent);
}

.lib-card-summary {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.lib-card-facts {
  margin: auto 0 0;
  padding-top: 8px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-card-facts:empty {
  display: none;
}

.lib-empty {
  padding: 48px 0;
  color: var(--ink-2);
}

.lib-empty[hidden] {
  display: none;
}

.lib-empty button {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Method page */
.lib-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  padding: 28px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.lib-crumb a:hover {
  color: var(--accent);
}

.lib-title {
  margin: 24px 0 8px;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: var(--ink-strong);
}

.lib-lead {
  max-width: 56rem;
  margin: 0 0 32px;
  text-wrap: balance;
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink-2);
}

.lib-block {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.9fr 1.1fr 1.7fr;
  gap: 0 28px;
  margin: 0;
  padding-bottom: 12px;
}

.lib-block > div {
  min-width: 0;
  padding: 14px 0 16px;
}

.lib-block dt {
  margin-bottom: 4px;
}

.lib-block dd {
  margin: 0;
  font-size: 14px;
}

.lib-block dd a {
  text-decoration: none;
}

.lib-block dd a:hover {
  color: var(--accent);
}

.lib-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 40px;
}

.lib-main {
  min-width: 0;
}

.lib-intro {
  min-width: 0;
  margin-bottom: 40px;
}

.lib-sec,
.lib-more {
  scroll-margin-top: 24px;
}

.lib-sec {
  margin-bottom: 48px;
}

.lib-sec > h2 {
  position: relative;
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

.lib-sec > h2 .num {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
}

.lib-sec > h2 .num:empty {
  display: none;
}

/* The section number hangs in the left margin when the page has room for it. */
@media (min-width: 1100px) {
  .lib-sec > h2 .num {
    position: absolute;
    right: 100%;
    margin: 0 20px 0 0;
    padding-top: 6px;
    white-space: nowrap;
  }
}

.lib-more {
  margin-top: 8px;
}

.lib-more > summary {
  cursor: pointer;
  font-weight: 500;
}

.lib-more[open] > summary {
  margin-bottom: 24px;
}

.lib-more .lib-sec > h2 {
  font-size: 20px;
}

/* Content from markdown */
.lib-doc p,
.lib-doc li {
  max-width: 62ch;
}

.lib-doc p {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.lib-doc h3 {
  margin: 36px 0 10px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}

.lib-doc h2 + h3 {
  margin-top: 8px;
}

.lib-tablist {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 16px 0 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-strong);
  scrollbar-width: none;
}

.lib-tablist:not(.is-end) {
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}

.lib-tablist::-webkit-scrollbar {
  display: none;
}

.lib-tablist[hidden] {
  display: none;
}

.lib-tablist button {
  flex: none;
  margin-bottom: -1px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
}

.lib-tablist button:hover {
  color: var(--ink-strong);
}

.lib-tablist button[aria-selected="true"] {
  border-bottom-color: var(--accent-fill);
  color: var(--ink-strong);
  font-weight: 500;
}

.lib-tabs.is-on .lib-panel > h3:first-child {
  display: none;
}

.lib-panel.is-off {
  display: none;
}

@media print {
  .lib-tablist {
    display: none;
  }

  .lib-panel.is-off {
    display: block;
  }

  .lib-tabs.is-on .lib-panel > h3:first-child {
    display: block;
  }
}

.lib-doc ul,
.lib-doc ol {
  margin: 0 0 14px;
  padding-left: 1.2em;
}

.lib-doc li {
  margin-bottom: 6px;
  padding-left: 4px;
  overflow-wrap: anywhere;
}

.lib-doc ul {
  list-style-type: disc;
}

.lib-doc ul li::marker {
  color: var(--accent);
}

.lib-doc ol {
  padding-left: 0;
  list-style: none;
}

.lib-doc ol > li {
  position: relative;
  padding-left: 2rem;
}

.lib-doc ol > li::before {
  content: counter(list-item) ".";
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: 0.85em;
  line-height: inherit;
  color: var(--accent);
}

.lib-doc li > ul,
.lib-doc li > ol {
  margin: 10px 0 4px;
}

.lib-doc a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.lib-doc img,
.lib-intro img {
  max-width: 100%;
  height: auto;
}

.lib-doc code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.lib-tablewrap {
  overflow-x: auto;
  margin: 4px 0 16px;
}

.lib-doc table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}

.lib-doc th {
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.lib-doc td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.lib-doc td:first-child {
  font-weight: 500;
}

@media (max-width: 860px) {
  .lib-layout {
    display: flex;
    flex-direction: column;
  }

  .lib-layout > section {
    display: contents;
  }

  .lib-top {
    order: 1;
    padding-bottom: 24px;
  }

  .lib-filter-toggle {
    order: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 16px;
    padding: 0 0 8px;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    background: none;
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .lib-filter-toggle::after {
    content: "+";
    font-size: 14px;
  }

  .lib-filter-toggle[aria-expanded="true"]::after {
    content: "\2212";
  }

  .lib-rail {
    order: 4;
    padding-top: 0;
    margin-bottom: 16px;
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
  }

  .lib-rail:not(.is-open) {
    display: none;
  }

  .lib-sortbar {
    order: 5;
    margin-bottom: 16px;
  }

  .lib-wrap,
  .lib-empty {
    order: 6;
  }

  .lib-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0;
    border-bottom: 0;
  }

  .lib-block > div {
    padding-right: 16px;
    border-bottom: 1px solid var(--line);
  }

  .lib-block > div:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }
}

@media (max-width: 700px) {
  .lib-about {
    font-size: 15px;
    letter-spacing: 0;
  }

  .lib-sec > h2 .num {
    display: none;
  }

  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 16px;
  }

  .lib-card-title {
    font-size: 16px;
  }

  .lib-card-summary {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .lib-card-facts {
    display: none;
  }

  .lib-bar-search .lib-search,
  .lib-bar-search .lib-search-icon {
    display: none;
  }

  .lib-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--ink-2);
  }

  .lib-search-toggle svg {
    width: 18px;
    height: 18px;
  }

  .lib-bar-search.has-value .lib-search-toggle {
    color: var(--accent);
  }

  .lib-bar-search.is-open {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--band);
  }

  .lib-bar-search.is-open .lib-search-toggle {
    display: none;
  }

  .lib-bar-search.is-open .lib-search,
  .lib-bar-search.is-open .lib-search-icon {
    display: block;
  }

  .lib-bar-search.is-open .lib-search {
    flex: 1;
    width: auto;
    height: 40px;
    padding-left: 34px;
    font-size: 16px;
  }

  .lib-bar-search.is-open .lib-search-icon {
    left: 12px;
  }

  .lib-bar-search.is-open .lib-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
    color: var(--ink-2);
  }

  .lib-suggest {
    right: 0;
    left: 0;
    width: auto;
    max-width: none;
  }

  .lib-doc table {
    min-width: 0;
  }

  .lib-doc table,
  .lib-doc tbody {
    display: block;
  }

  .lib-doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .lib-doc tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .lib-doc td {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 12px;
    padding: 3px 0;
    border-bottom: 0;
  }

  .lib-doc td::before {
    content: attr(data-label);
    padding-top: 3px;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
  }

  .lib-doc td:first-child {
    display: block;
    padding-bottom: 6px;
    font-size: 15px;
  }

  .lib-doc td:first-child::before {
    display: none;
  }

  .lib-doc td:empty {
    display: none;
  }
}

/* A table with one row is stacked as a card at any width. */
.lib-doc table.lib-stack {
  min-width: 0;
}

.lib-doc table.lib-stack,
.lib-doc table.lib-stack tbody {
  display: block;
}

.lib-doc table.lib-stack thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.lib-doc table.lib-stack tr {
  display: block;
  padding: 12px 0;
  border-bottom: 0;
}

.lib-doc table.lib-stack td {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 12px;
  padding: 3px 0;
  border-bottom: 0;
}

.lib-doc table.lib-stack td::before {
  content: attr(data-label);
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.lib-doc table.lib-stack td:first-child {
  display: block;
  padding-bottom: 6px;
  font-size: 15px;
}

.lib-doc table.lib-stack td:first-child::before {
  display: none;
}

.lib-doc table.lib-stack td:empty {
  display: none;
}

/* Sign-in and editor */
.lib-form-page {
  max-width: 28rem;
  padding: 56px 0 80px;
}

.lib-form-page--wide {
  max-width: 52rem;
}

.lib-form-title {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
}

.lib-form-note {
  min-height: 1.55em;
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 14px;
}

.lib-form {
  display: grid;
  gap: 16px;
}

.lib-field {
  display: grid;
  gap: 6px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lib-field input,
.lib-textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

.lib-field input {
  height: 44px;
  padding: 0 12px;
}

.lib-textarea {
  padding: 12px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.lib-field input:focus-visible,
.lib-textarea:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.lib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lib-button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.lib-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lib-button--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.lib-button--primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}

.lib-button--danger {
  margin-left: auto;
  color: var(--danger);
}

.lib-button--quiet {
  border-color: transparent;
  color: var(--ink-3);
}

.lib-button:disabled {
  opacity: 0.5;
  cursor: default;
}

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