@font-face {
  font-family: Plex;
  src: url(/assets/fonts/ibm-plex-sans-latin-var.woff2) format('woff2');
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: PlexMono;
  src: url(/assets/fonts/ibm-plex-mono-latin-400.woff2) format('woff2');
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #14171c;
  --secondary: #434a54;
  --mute: #5c6470;
  --blue: #1e3f66;
  --pale: #e6edf5;
  --canvas: #f4f4f1;
  --line: #c9ccd0;
  --white: #fff;
  --error: #813416;
  font:
    16px/1.5 Plex,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}
a,
button,
input,
textarea,
select {
  touch-action: manipulation;
}
button,
.file {
  cursor: pointer;
  background: #fafaf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 14px;
  font-weight: 500;
}
button:hover,
.file:hover {
  background: #eaeae5;
}
button:disabled {
  opacity: 0.54;
  cursor: default;
}
.primary {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
  padding: 10px 20px;
}
.primary:hover {
  background: #152f4d;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
header.masthead,
body > footer,
main {
  width: min(calc(100% - 48px), 1184px);
  margin-inline: auto;
}
header.masthead,
body > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}
body > footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-block: 16px;
  color: var(--mute);
  flex-wrap: wrap;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
footer a {
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4,
p {
  margin: 0 0 0.7em;
}
h1,
h2,
h3 {
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 500;
}
h1 {
  font-size: clamp(2rem, 4.3vw, 3.5rem);
}
h2 {
  font-size: 1.65rem;
}
h3 {
  font-size: 1.25rem;
}
small,
.muted {
  color: var(--mute);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: clamp(22px, 4vw, 60px);
  padding: 40px 0 32px;
}
.hero-intro p {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--secondary);
  max-width: 46ch;
}
.sample-ticket {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  padding: 22px 26px 23px;
  border-radius: 6px 6px 14px 14px;
  box-shadow:
    0 1px 2px #15171c09,
    0 5px 16px #15171c08;
}
.sample-ticket h2 {
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  overflow-wrap: anywhere;
}
.sample-ticket p {
  font-size: 0.9rem;
  color: var(--mute);
  margin-bottom: 8px;
}
.metrics,
.ledger {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 14px 0 16px;
}
.metrics dt {
  font-size: 0.875rem;
  color: var(--secondary);
}
.metrics dd,
.ledger dd {
  font-family: PlexMono, ui-monospace, monospace;
  margin: 0;
}
.metrics dd {
  font-size: clamp(1.25rem, 2.6vw, 2.1rem);
  color: var(--blue);
  overflow-wrap: anywhere;
}
#bench {
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  overflow: clip;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  padding: 6px 14px 0;
  border-bottom: 1px solid var(--line);
  gap: 2px;
  background: #fafaf8;
}
.tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  border-radius: 0;
}
.tabs .current {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}
.toolstrip {
  padding: 4px 20px;
  border-bottom: 1px solid #e5e6e8;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.toolstrip button {
  background: transparent;
  font-size: 0.875rem;
  border: 0;
  padding: 4px 7px;
}
.backup-chip {
  margin-left: auto;
}
#panel,
.static-bench {
  padding: 24px;
}
.bar,
.actions,
.output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.bar h2,
.bar h3 {
  margin: 0;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(172px, 100%), 1fr));
  gap: 12px;
  margin: 12px 0;
}
.field {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  font-size: 0.92rem;
  color: var(--secondary);
}
.field > span {
  overflow-wrap: anywhere;
}
.field input,
.field textarea,
.field select,
select[data-pick],
#convert-item,
#convert-qty {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  background: white;
  color: var(--ink);
  border: 1px solid #a6adb6;
  border-radius: 6px;
  padding: 8px 9px;
  font-size: 1rem;
}
.field textarea {
  min-height: 74px;
  resize: vertical;
}
input[aria-invalid='true'] {
  outline: 2px solid var(--error);
}
.check {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 9px;
}
.check input {
  width: 1.2rem;
  min-height: 44px;
}
.recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.38fr);
  align-items: start;
  gap: 28px;
  margin-top: 10px;
}
.cost-panel {
  padding: 18px;
  background: #f5f7fa;
  border-top: 3px solid var(--blue);
  border-radius: 0 0 8px 8px;
  position: sticky;
  top: 8px;
}
.ledger > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #dce0e4;
}
.ledger dd {
  color: var(--blue);
}
.cost-panel .ledger > div:nth-child(5) {
  font-weight: 600;
  border-top: 1px solid var(--ink);
}
.cost-panel p {
  margin: 8px 0 0;
}
.cost-panel ul {
  padding-left: 20px;
}
details {
  border-top: 1px solid var(--line);
  margin: 14px 0;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 11px 0;
  font-weight: 500;
}
.fold {
  padding: 0 0 8px;
}
.recipe-line {
  display: grid;
  grid-template-columns: minmax(120px, 2.4fr) repeat(3, minmax(55px, 0.85fr)) auto;
  gap: 8px;
  align-items: end;
  padding: 7px 0;
  border-top: 1px solid #e5e6e8;
}
.recipe-line > .line-result {
  grid-column: 1/-1;
}
.recipe-line button {
  padding: 7px 9px;
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}
th,
td {
  text-align: start;
  padding: 8px 10px;
  border-bottom: 1px solid #dce0e4;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
th {
  font-weight: 500;
  background: #fafaf8;
}
td {
  font-variant-numeric: tabular-nums;
}
.entry-grid .field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.entry-grid td {
  padding: 4px;
}
.entry-grid input {
  min-width: 55px;
}
.entry-grid td:first-child {
  width: 28%;
}
.detail,
.impact,
.notice {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: var(--pale);
  margin-bottom: 14px;
}
.notice,
.impact {
  margin: 12px 18px;
}
.notice button {
  margin-left: 8px;
}
.notice.alert {
  border-left: 4px solid var(--error);
}
.actions,
.output-actions {
  margin: 12px 0;
}
.starter-list,
.guide-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.reading {
  margin: 26px auto;
  max-width: 70ch;
}
.reading h2 {
  margin-top: 1.35em;
}
.reading section {
  margin: 24px 0;
}
.reading li {
  margin: 8px 0;
}
.reading a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
.reading .guide-links {
  column-gap: 18px;
}
.standalone {
  padding: 22px 0 35px;
}
.plan-price {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--blue);
}
code {
  overflow-wrap: anywhere;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(640px, calc(100% - 30px));
  max-height: 86dvh;
  overflow: auto;
  padding: 24px;
  color: var(--ink);
  background: white;
}
dialog::backdrop {
  background: rgb(20 23 28 / 0.4);
}
dialog input,
dialog label {
  margin-bottom: 8px;
}
.file {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#sheets {
  user-select: none;
  -webkit-user-select: none;
  background: #eaeae5;
  display: grid;
  justify-items: center;
  gap: 15px;
  padding: 20px;
}
.paper {
  display: block;
  max-width: 100%;
  width: 600px;
  background: white;
  box-shadow: 0 2px 8px #0001;
}
#converter {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
#converter output {
  font-family: PlexMono, monospace;
}
#print-message,
#print-document,
#mobile-cost {
  display: none;
}
@media (max-width: 760px) {
  header.masthead,
  body > footer,
  main {
    width: calc(100% - 32px);
  }
  .hero,
  .recipe-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero {
    gap: 12px;
    padding: 17px 0;
  }
  .hero-intro p {
    font-size: 1rem;
    margin-bottom: 0;
  }
  .sample-ticket {
    padding: 14px 16px;
  }
  .metrics {
    padding: 8px 0 11px;
  }
  .metrics dd {
    font-size: 1.35rem;
  }
  #panel {
    padding: 14px;
  }
  .cost-panel {
    position: static;
  }
  .recipe-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .recipe-line .field:first-child {
    grid-column: 1/-1;
  }
  .tabs {
    padding-inline: 2px;
    flex-wrap: wrap;
  }
  .tabs button {
    padding-inline: 9px;
    font-size: 0.94rem;
  }
  .toolstrip {
    padding-inline: 8px;
  }
  .backup-chip {
    margin-left: 0;
  }
  .entry-grid table {
    min-width: 560px;
  }
  .bar {
    align-items: start;
  }
  .fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fields textarea {
    min-width: 0;
  }
  .paper {
    width: 100%;
  }
  #sheets {
    padding: 6px;
  }
  .entry-grid .table-wrap {
    overscroll-behavior-x: contain;
  }
  #mobile-cost:not(:empty) {
    display: block;
    position: sticky;
    bottom: 0;
    padding: 9px 14px;
    border-top: 1px solid var(--line);
    color: var(--blue);
    background: var(--pale);
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
  }
  header.masthead {
    min-height: 55px;
  }
}
@media print {
  @page {
    margin: 14mm;
  }
  body {
    background: white;
  }
  body > * {
    display: none !important;
  }
  body > main {
    display: block !important;
    margin: 0;
    width: auto;
  }
  main > * {
    display: none !important;
  }
  main > #print-message {
    display: block !important;
  }
  body.printing main > #print-message {
    display: none !important;
  }
  body.printing main > #print-document {
    display: block !important;
  }
  #print-document .paper {
    box-shadow: none;
    width: 100%;
    height: auto;
    break-inside: avoid;
    break-after: page;
  }
  #print-document .paper:last-child {
    break-after: auto;
  }
  dialog:modal,
  dialog::backdrop {
    display: none !important;
  }
}
