:root {
  color-scheme: light;
  --page: #f2f4ef;
  --paper: #fff;
  --ink: #18261f;
  --muted: #506158;
  --line: #d5dfd7;
  --green: #205b49;
  --nav: #142d23;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.55; }
a { color: var(--green); }
:focus-visible { outline: 3px solid #8f4f03; outline-offset: 3px; }
.wrap { width: min(calc(100% - 2rem), 68rem); margin-inline: auto; }
.skip { position: absolute; z-index: 1; inset: .5rem auto auto .5rem; background: white; padding: .5rem; }
.skip:not(:focus) { transform: translateY(-200%); }

.topbar { background: var(--nav); color: #f6fff9; }
.topbar-inner, .page-heading, .card-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar-inner { min-height: 4.25rem; flex-wrap: wrap; }
.brand { color: inherit; text-decoration: none; font-weight: 750; letter-spacing: -.015em; }
.topbar nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.topbar nav a { color: #e4f3e8; padding: .55rem .7rem; border-radius: .45rem; text-decoration: none; }
.topbar nav a:hover, .topbar nav a[aria-current] { background: #315247; }

.main { padding-block: 2.5rem 4rem; }
.page-heading { margin-bottom: 1.5rem; }
h1, h2, p, dl { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.14; letter-spacing: -.045em; }
h2 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
.page-heading p, .card-heading p { margin-top: .45rem; }
.muted, .helptext { color: var(--muted); }
.helptext { font-size: .9rem; }

.surface { background: var(--paper); border: 1px solid var(--line); border-radius: .8rem; }
.card { padding: clamp(1rem, 4vw, 1.6rem); }
.order-contact { margin-bottom: 1rem; overflow-wrap: anywhere; }
.order-contact p { margin-top: .4rem; }
.stack { display: grid; gap: 1rem; }
.card[id] { scroll-margin-top: 1rem; }
.card:target { border-color: var(--green); }
.note, .notice { padding: .8rem 1rem; border-radius: .5rem; background: #e1eee6; margin-bottom: 1rem; }
.notice.error, .errorlist { color: #8e2722; }
.notice.error { background: #ffebe6; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem;
  padding: .52rem .85rem; color: var(--green); background: var(--paper);
  border: 1px solid var(--line); border-radius: .48rem; text-decoration: none;
  font: inherit; font-weight: 650; text-align: center; cursor: pointer;
}
.button:hover { background: #eff6f1; }
.button.primary { background: var(--green); border-color: var(--green); color: white; }
.button.primary:hover { background: #164938; }
.button:disabled { opacity: .6; cursor: default; }
.button[hidden] { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.card > .actions:not(:empty) { margin-block: .8rem; }

.filters, .totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1.25rem; }
.filters a, .totals > div { display: grid; align-content: start; gap: .25rem; padding: .75rem .85rem; }
.filters a { background: var(--paper); border: 1px solid var(--line); border-radius: .65rem; text-decoration: none; }
.filters a[aria-current] { color: #153c2f; background: #e1eee6; border-color: #749987; }
.filters a:hover { border-color: var(--green); }
.filters strong, .totals dd { font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.filters span, .totals dt { font-size: .92rem; }
.deadline-heading { margin: 0 0 .65rem; }
.filters.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.deadline-scope { margin-bottom: 1rem; }
.deadline-reminders { margin-bottom: 1.25rem; }
.deadline-reminders .card-heading { margin-bottom: .6rem; }
.quote-reminder .button { margin-top: .45rem; }

.requests, .quotes, .history { padding: 0; margin: 0; list-style: none; }
.request-row { display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: .8rem; padding: .85rem 1rem; align-items: start; }
.request-row + .request-row, .quotes li + li { border-top: 1px solid var(--line); }
.request-row > div, .request-row li, .card-heading > div { overflow-wrap: anywhere; }
.row-title { font-weight: 700; text-underline-offset: .17rem; }
.pill { justify-self: start; display: inline-block; width: fit-content; padding: .25rem .56rem; border-radius: 2rem; font-size: .875rem; font-weight: 620; background: #e7eee9; }
.pill.quoted { color: #713a05; background: #faecd7; }
.pill.accepted, .pill.ordered { color: #19513d; background: #dcf0e5; }
.pill.declined { color: #793531; background: #f9e8e5; }
.customer-line-status { display: flex; flex-wrap: wrap; gap: .35rem; }
.profile-positions-heading, .profile-results { margin-top: 1.15rem; }
.profile-positions-heading { margin-bottom: .75rem; }
.profile-chat-url { overflow-wrap: anywhere; }
.empty { padding: 1.25rem 1rem; color: var(--muted); }
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }

.facts { display: flex; flex-wrap: wrap; gap: .65rem 1.75rem; padding: .75rem 0; }
.facts dt { color: var(--muted); font-size: .9rem; }
dd { margin: 0; font-weight: 650; }
summary { cursor: pointer; color: var(--green); font-weight: 650; }
.card > details { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .6rem; }
.quotes li, .history li { padding-block: .4rem; }
.reply { margin: .2rem 0; overflow-wrap: anywhere; }

.form-panel { max-width: 43rem; }
.form-panel > div:not(.actions), .allocation > div { margin-bottom: .8rem; }
.form-panel label { display: block; font-weight: 640; margin-bottom: .2rem; }
.form-panel input:not([type='checkbox'], [type='hidden']), .form-panel select, .form-panel textarea, .catalog-search input {
  width: 100%; min-height: 2.7rem; background: var(--paper); border: 1px solid #9baa9a;
  border-radius: .4rem; padding: .45rem .55rem; color: var(--ink); font: inherit;
}
.form-panel input[type='checkbox'] { width: 1.1rem; height: 1.1rem; accent-color: var(--green); }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .65rem; margin: 1rem 0; padding: .9rem; }
legend { padding-inline: .35rem; font-weight: 700; }
.allocation { margin: .55rem 0; padding: .7rem; border-radius: .45rem; background: #f0f5f1; }

.catalog-back, .catalog-search { margin-bottom: 1rem; }
.catalog-search { max-width: 34rem; }
.catalog-search label { display: block; margin-bottom: .25rem; font-weight: 640; }
.catalog-search input { width: auto; min-width: 10rem; flex: 1; }
.catalog-prices { width: 100%; border-collapse: collapse; text-align: left; overflow-wrap: anywhere; }
.catalog-prices th, .catalog-prices td { padding: .8rem 1rem; vertical-align: top; }
.catalog-prices tbody tr { border-top: 1px solid var(--line); }
.catalog-prices .catalog-facts { display: block; font-weight: 400; font-size: .875rem; }
.catalog-prices td { font-variant-numeric: tabular-nums; }
.catalog-prices td > span { display: none; }
@media (max-width: 720px) {
  .catalog-prices, .catalog-prices tbody { display: block; }
  .catalog-prices thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .catalog-prices tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .75rem 1rem; gap: .5rem; }
  .catalog-prices tbody tr:first-child { border-top: 0; }
  .catalog-prices tbody th { grid-column: 1 / -1; }
  .catalog-prices th, .catalog-prices td { padding: 0; }
  .catalog-prices td > span { display: block; color: var(--muted); font-size: .8rem; }
}
.catalog-description { margin-top: 1rem; overflow-wrap: anywhere; }
.catalog-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .65rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.catalog-gallery img { display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: .45rem; object-fit: contain; background: var(--page); }
.photo-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 26rem; }
.photo-comparison li { min-width: 0; }
.photo-match-details { margin-top: .55rem; overflow-wrap: anywhere; }
.storefront-filters { margin: 1rem 0; }
.storefront-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(10rem, 100%), 1fr)); gap: .75rem; margin: 1rem 0; padding: 0; list-style: none; }
.storefront-tile { min-width: 0; }
.storefront-tile a { display: block; color: inherit; text-decoration: none; }
.storefront-tile a:hover h2 { text-decoration: underline; }
.storefront-tile h2 { padding: .7rem; overflow-wrap: anywhere; }
.storefront-tile img, .storefront-detail img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; background: var(--page); border-radius: .45rem; }
.storefront-detail { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.25rem; overflow-wrap: anywhere; }
.storefront-select-form { margin-top: 1.2rem; }
.storefront-checkout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.storefront-selection-row { padding: 1rem; overflow-wrap: anywhere; }
.storefront-selection-row + .storefront-selection-row { border-top: 1px solid var(--line); }
.storefront-quantity { margin-top: .65rem; }
.storefront-quantity input[type='number'] { width: 4.5rem; }
.storefront-request-form > p { margin: .45rem 0 1rem; }
.reply-form { margin-top: 1rem; }
.reply-form .button, #inquiry-message { margin-top: .55rem; }

@media (max-width: 44rem) {
  .storefront-detail, .storefront-checkout { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { padding-block: .65rem; gap: .25rem; }
  .main { padding-top: 1.5rem; }
  .filters, .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-row { grid-template-columns: 1fr; gap: .35rem; }
  .page-heading, .card-heading { align-items: flex-start; flex-wrap: wrap; }
}
