:root {
  color-scheme: light;
  --ink: #171915;
  --muted: #565a51;
  --paper: #f4f3ed;
  --line: #dadbd2;
  --white: #fff;
  --focus: #345213;
  --accent: #d3e7a2;
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.1; letter-spacing: -.035em; }
h1 { margin-bottom: .75rem; font-size: clamp(2rem, 6vw, 3rem); }
h2 { margin-bottom: .85rem; font-size: 1.35rem; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.site-header, .site-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem 1.125rem;
  padding: .8rem clamp(1rem, 5vw, 2.25rem);
}
.site-header { border-bottom: 1px solid var(--line); }
.site-footer { color: var(--muted); font-size: .83rem; border-top: 1px solid var(--line); }
.wordmark { font-size: 1.45rem; font-weight: 800; letter-spacing: -.075em; }
.muted { color: var(--muted); }
.page-shell { padding: clamp(.75rem, 5vw, 2.25rem); min-height: 62vh; }
.wrapper-shell { max-width: 50rem; margin-inline: auto; padding: clamp(.75rem, 3vw, 1.5rem); }
.wrapper-shell h1 { font-size: 1.55rem; }
.order-card {
  width: min(100%, 35rem);
  margin-inline: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: clamp(1rem, 4.5vw, 2rem);
}
.cart-row, .order-items > li, .order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--line);
  padding-block: .8rem;
}
.cart-row input {
  width: 4.35rem;
  min-height: 2.75rem;
  border: 1px solid #92958a;
  border-radius: .45rem;
  padding-inline: .5rem;
  background: var(--white);
  color: var(--ink);
}
#cart .button { margin-top: 1.5rem; }
.order-items { list-style: none; margin: 0; padding: 0; }
.order-total { border-bottom: 0; }
.button-group { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .55rem .9rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}
.button-primary { background: var(--accent); }
.button-secondary, .icon-button { background: var(--white); border-color: #92958a; }
.icon-button { min-width: 2.75rem; flex-shrink: 0; padding: 0; font-size: 1.5rem; line-height: 1; }
.text-link { text-decoration: underline; text-underline-offset: 3px; }
.text-button { min-height: 2rem; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.feedback { margin: .55rem 0 0; }

.checkout-dialog, .confirm-dialog {
  max-inline-size: calc(100% - 1rem);
  max-block-size: calc(100% - 1rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0;
  color: var(--ink);
  background: var(--white);
}
.checkout-dialog { inline-size: min(52rem, calc(100% - 1rem)); }
.confirm-dialog { inline-size: min(29rem, calc(100% - 1rem)); }
dialog::backdrop { background: rgb(17 22 13 / 64%); }
html:has(dialog[open]) { overflow: hidden; }
.modal-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  block-size: min(50rem, calc(100vh - 1rem));
  block-size: min(50rem, calc(100dvh - 1rem));
}
.modal-header, .modal-footer { padding: .55rem .85rem; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; }
.modal-footer { border-top: 1px solid var(--line); min-height: 2.85rem; }
.frame-shell { min-block-size: 0; position: relative; background: var(--paper); }
.frame-feedback {
  position: absolute; inset: auto 0 0; z-index: 1;
  padding: .6rem; margin: 0; color: var(--ink); background: var(--paper);
}
.frame-feedback:empty { display: none; }
[data-checkout-frame] { display: block; width: 100%; height: 100%; border: 0; }
.frame-shell > .skeleton { position: absolute; z-index: 1; inset: 0; max-width: none; padding: 1.25rem; background: var(--paper); }
.skeleton { display: grid; align-content: start; gap: .7rem; max-width: 55rem; }
.skeleton span {
  width: 100%;
  min-height: 2.7rem;
  border-radius: .45rem;
  background: #e4e5da;
  animation: skeleton 1.4s ease-in-out infinite alternate;
}
.skeleton span:first-child { width: 48%; }
.skeleton span:last-child { width: 70%; }
@keyframes skeleton { to { opacity: .45; } }
.confirm-content { padding: 1.25rem; }
@media (max-width: 33rem) {
  .checkout-dialog { inline-size: 100%; max-inline-size: 100%; max-block-size: 100%; border: 0; border-radius: 0; margin: 0; }
  .modal-layout { block-size: 100vh; block-size: 100dvh; }
  .modal-footer { padding-bottom: max(.55rem, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton span { animation: none; }
}
