.weight-page {
  --weight-ink: #17160f;
  --weight-muted: #595748;
  --weight-border: #e9dbb9;
  --weight-canvas: #f9f7ef;
  --weight-paper: #fff;
  --weight-cream: #fff8df;
  --weight-yellow: #ffdc00;
  --weight-error: #a12a1b;
  background: var(--weight-canvas);
  color: var(--weight-ink);
  padding: 32px 0 64px;
}

.weight-shell {
  display: grid;
  gap: 32px;
}

.weight-page :is(h1, h2, h3, p, dl, dd) { margin: 0; }
.weight-page :is(h1, h2, h3) { text-wrap: balance; }
.weight-page p { text-wrap: pretty; }
.weight-page h2 { font-size: 1.5rem; line-height: 2rem; font-weight: 750; letter-spacing: -.03em; }
.weight-page h3 { font-size: 1.125rem; line-height: 1.75rem; font-weight: 750; }
.weight-page [hidden] { display: none; }
.weight-page :is(input, select, button, a):focus-visible { outline: 3px solid #795a02; outline-offset: 3px; }

.weight-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .875rem;
  line-height: 1.25rem;
  color: var(--weight-muted);
}

.weight-breadcrumb a { color: inherit; }
.weight-breadcrumb span[aria-current] { font-weight: 700; color: var(--weight-ink); }

.weight-hero, .weight-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.weight-hero h1 {
  font-size: 3rem;
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: -.055em;
  max-width: 40rem;
}

.weight-hero mark {
  color: inherit;
  background: var(--weight-yellow);
  padding-inline: 8px;
  border-radius: 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.weight-hero p { max-width: 40rem; margin-top: 12px; font-size: 1.125rem; line-height: 1.75rem; color: var(--weight-muted); }
.weight-reference {
  display: grid;
  grid-template-columns: minmax(4rem, 6rem) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--weight-border);
  border-radius: 24px;
  background: var(--weight-cream);
  padding: 16px 24px;
}
.weight-reference img { width: 100%; height: auto; object-fit: contain; }
.weight-reference dl { display: grid; gap: 8px; }
.weight-reference dl > div + div { border-top: 1px solid var(--weight-border); padding-top: 8px; }
.weight-reference dt { font-size: .875rem; line-height: 1.25rem; color: var(--weight-muted); }
.weight-reference dd { font-size: 1.125rem; line-height: 1.75rem; font-weight: 750; }

.weight-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(0, 1fr);
  gap: 16px;
  margin: 0;
}
.weight-panel, .weight-section, .weight-example {
  padding: 24px;
  background: var(--weight-paper);
  border: 1px solid var(--weight-border);
  border-radius: 24px;
}
.weight-panel { display: grid; align-content: start; gap: 16px; min-width: 0; }
.weight-panel > div > p:not(.weight-error) { color: var(--weight-muted); }
.weight-lot h2 + p, .weight-section h2 + p, .weight-example h2 + p { margin-top: 8px; }
.weight-field { min-width: 0; display: grid; gap: 8px; align-content: start; }
.weight-field label, .weight-label { font-size: .875rem; line-height: 1.25rem; font-weight: 750; }
.weight-field :is(input, select) {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #c9bea2;
  border-radius: 12px;
  background: #fffefa;
  color: var(--weight-ink);
  font: inherit;
  font-size: 1rem;
}
#weight { font-size: 1.25rem; font-weight: 700; line-height: 1.75rem; }
.weight-field :is(input, select)[aria-invalid="true"] { border-color: var(--weight-error); }
.weight-error, .weight-input-hint { font-size: .875rem; line-height: 1.25rem; }
.weight-error { color: var(--weight-error); }
.weight-error:empty { display: none; }
.weight-unit-row, .weight-lot-fields { display: grid; align-items: end; gap: 12px; }
.weight-unit-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.weight-lot-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.weight-page button { cursor: pointer; font-family: inherit; }
.weight-page button:disabled { opacity: .56; cursor: default; }
.weight-swap, .weight-chips button, .weight-button {
  min-height: 44px;
  border: 1px solid var(--weight-border);
  border-radius: 12px;
  background: var(--weight-paper);
  color: var(--weight-ink);
  padding: 8px 12px;
  font-weight: 750;
  transition: background-color .25s cubic-bezier(.22, 1, .36, 1), transform .25s cubic-bezier(.22, 1, .36, 1);
}
.weight-swap { width: 48px; height: 48px; padding: 0; font-size: 1.5rem; line-height: 2rem; }
.weight-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.weight-chips button { min-height: 36px; padding: 4px 12px; background: #fcf8ea; font-size: .875rem; line-height: 1.25rem; }
.weight-page :is(.weight-swap, .weight-chips button, .weight-button):hover:not(:disabled) { background: #fff0b4; }
.weight-page :is(.weight-swap, .weight-chips button, .weight-button):active:not(:disabled) { transform: translateY(1px); }

.weight-conversion {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: end;
  justify-content: space-between;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--weight-border);
  background: var(--weight-cream);
}
.weight-conversion > div { min-width: 0; }
.weight-conversion output {
  display: block;
  margin: 4px 0;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 780;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.weight-page :is(output, input, .weight-reference dd, .weight-lot-results dd, .weight-formulas dd, table) { font-variant-numeric: tabular-nums; }
#conversion-rate, #share-status { color: var(--weight-muted); font-size: .875rem; line-height: 1.25rem; }
.weight-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.weight-link-button {
  padding: 0;
  min-height: 32px;
  border: 0;
  color: #604400;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: .875rem;
  font-weight: 750;
}

.weight-lot { background: #fffdf6; }
.weight-lot-results { display: grid; gap: 8px; }
.weight-lot-results > div, .weight-formulas > div {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--weight-border);
  border-radius: 12px;
  background: var(--weight-paper);
}
.weight-lot-results > div:last-child { background: var(--weight-cream); }
.weight-lot-results dt, .weight-formulas dt { font-size: .875rem; line-height: 1.25rem; color: var(--weight-muted); font-weight: 650; }
.weight-lot-results dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; overflow-wrap: anywhere; }
.weight-lot-results dd span:first-child { font-size: 1.25rem; line-height: 1.75rem; font-weight: 750; }
.weight-lot-results dd span:last-child { font-size: .875rem; line-height: 1.25rem; color: var(--weight-muted); }

.weight-guide { align-items: start; }
.weight-page :is(.weight-guide, .weight-example, .weight-faq) p { color: var(--weight-muted); }
.weight-page .weight-formulas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.weight-formulas > div { background: #fcf8ea; }
.weight-formulas dd { font-weight: 750; overflow-wrap: anywhere; }
.weight-page p.weight-source { margin-top: 12px; font-size: .875rem; line-height: 1.25rem; }

.weight-chart table { width: 100%; border-collapse: collapse; }
.weight-chart caption { font-size: 1.125rem; line-height: 1.75rem; font-weight: 750; text-align: left; padding-bottom: 12px; }
.weight-chart tr { border-bottom: 1px solid var(--weight-border); }
.weight-chart td, .weight-chart th { padding: 8px 12px; text-align: right; }
.weight-chart :is(td, th):first-child { text-align: left; }
.weight-chart thead, .weight-chart-key { background: #fcf8ea; }
.weight-chart tbody th { font-weight: 650; }
.weight-chart-key td { font-weight: 750; }

.weight-example { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; background: var(--weight-cream); }
.weight-example p { max-width: 47rem; }
.weight-example .weight-button { flex-shrink: 0; }
.weight-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; margin-top: 16px; }
.weight-faq article { border-top: 1px solid var(--weight-border); padding-top: 12px; }
.weight-faq p { margin-top: 4px; }
.weight-related > div { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.weight-related a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: #604400; font-weight: 750; }
.weight-page .weight-notice { padding: 12px 16px; color: var(--weight-muted); background: var(--weight-cream); border-radius: 12px; }

@media (max-width: 56rem) {
  .weight-shell { gap: 24px; }
  .weight-hero, .weight-workbench, .weight-guide { grid-template-columns: 1fr; gap: 16px; }
  .weight-reference { max-width: 34rem; }
  .weight-hero h1 { font-size: 2.25rem; line-height: 2.5rem; }
  .weight-example { flex-wrap: wrap; }
}

@media (max-width: 34rem) {
  .weight-page { padding-top: 24px; }
  .weight-panel, .weight-section, .weight-example { padding: 16px; border-radius: 16px; }
  .weight-reference { padding: 12px 16px; }
  .weight-faq, .weight-page .weight-formulas { grid-template-columns: 1fr; }
  .weight-unit-row, .weight-lot-fields { gap: 8px; }
  .weight-field select { padding-inline: 8px; }
  .weight-chips button { padding-inline: 8px; }
  .weight-swap { width: 44px; }
  .weight-conversion output { font-size: 1.875rem; line-height: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .weight-page button { transition: none; }
}
