:root {
  color-scheme: light;
  --ink: #162b30;
  --muted: #627476;
  --line: #d8e2df;
  --panel: #ffffff;
  --page: #f3f6f2;
  --teal: #0d655e;
  --teal-dark: #084c48;
  --mint: #e5f3ed;
  --gold: #c48b36;
  --danger: #9d352f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse at 86% 7%, rgba(202, 228, 214, .72), transparent 30rem),
    var(--page);
  color: var(--ink);
  line-height: 1.5;
}

button, input, select { font: inherit; }

.page-shell {
  width: min(100% - 36px, 760px);
  margin: 0 auto;
  padding: 26px 0 30px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-name {
  font-size: 36px;
  line-height: 42px;
  font-weight: 760;
  letter-spacing: -.02em;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

.hero { margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 9px;
  color: #668277;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(35px, 7vw, 51px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.08;
}

.admin-entry {
  display: inline;
  border: 0;
  margin: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  appearance: none;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  cursor: pointer;
}
.admin-entry:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 2px; }

.lede {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.panel {
  border: 1px solid rgba(205, 219, 214, .95);
  border-radius: 17px;
  padding: clamp(20px, 5vw, 30px);
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(32, 66, 58, .055);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  color: #326a5b;
  background: var(--mint);
  font-size: 13px;
  font-weight: 800;
}

h2 {
  margin: 1px 0 3px;
  font-size: 19px;
  letter-spacing: -.02em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 730;
}

.lookup-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.input-wrap { position: relative; flex: 1; min-width: 0; }

input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c8d5d1;
  border-radius: 9px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}

input::placeholder { color: #9aa8a6; }
input:focus, select:focus { border-color: #38877a; box-shadow: 0 0 0 3px rgba(38, 133, 118, .15); }
#serial-input { font-size: 17px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }

.form-title { margin: 0 0 13px; font-size: 15px; }
.card-search-heading { display: flex; align-items: center; gap: 10px; }
.card-search-heading .form-title { margin: 0; }
.photo-results { margin: 0 0 20px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.photo-results[hidden] { display: none; }
.photo-results h4 { margin: 0; font-size: 14px; }
.photo-results [data-kind="error"] { color: var(--danger); }
.photo-results-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.photo-results-list:empty { margin: 0; }
.photo-result[hidden] { display: none; }
.photo-results-toggle { margin-top: 12px; }
.photo-results-toggle[hidden] { display: none; }
.photo-match-group { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.photo-match-group legend { padding: 0; font-size: 13px; font-weight: 700; }
.photo-use-details { width: 100%; margin-top: 8px; }
.photo-result { display: grid; grid-template-columns: auto 72px minmax(0, 1fr); align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.photo-result-choice { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; cursor: pointer; }
.photo-result-choice input { width: 20px; min-width: 20px; min-height: 20px; margin: 0; padding: 0; accent-color: var(--teal); }
.photo-result img { width: 72px; height: 88px; flex: 0 0 auto; object-fit: contain; background: #f5f7f5; border-radius: 5px; }
.photo-result a { color: var(--teal); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.photo-result p { margin: 4px 0 0; font-size: 13px; }
.photo-item-details { margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbf9; }
.photo-item-details[hidden] { display: none; }
.photo-item-details h5 { margin: 0; font-size: 14px; }
.photo-item-details-list { display: grid; grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr); gap: 6px 12px; margin: 10px 0 13px; font-size: 13px; }
.photo-item-details-list:empty { display: none; }
.photo-item-details-list dt { color: var(--muted); }
.photo-item-details-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.card-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-field { min-width: 0; }
.form-field label span { color: var(--muted); font-weight: 500; }
select {
  appearance: auto;
  cursor: pointer;
}
.search-filters { margin-top: 22px; }
.search-filters h4 { margin: 0 0 10px; font-size: 14px; }
.filter-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
.filter-group {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
.filter-group legend { padding: 0 4px; font-size: 12px; font-weight: 740; }
.filter-group legend span { color: var(--muted); font-weight: 500; }
.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
}
.check-option input {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}
.form-actions { margin-top: 15px; }
.form-actions .field-help { margin-top: 9px; }

.field-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 17px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 730;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(38, 133, 118, .25); outline-offset: 2px; }
.button:disabled { cursor: wait; opacity: .58; }
.button-primary { color: #fff; background: var(--teal); }
.button-primary:hover:not(:disabled) { background: var(--teal-dark); }
.button-secondary { color: #145a53; border-color: #bed7ce; background: #f1f8f4; }
.button-secondary:hover:not(:disabled) { background: #e6f3ed; }

.suggestions {
  position: absolute;
  z-index: 5;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
  background: white;
  box-shadow: 0 12px 24px rgba(18, 48, 44, .12);
  list-style: none;
}

.suggestion-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: .08em;
}

.suggestion-option:hover, .suggestion-option[aria-selected="true"] { background: #eef6f2; }

.status-message {
  margin: 14px 0;
  border: 1px solid #d9e5df;
  border-radius: 10px;
  padding: 12px 14px;
  color: #315e50;
  background: #edf7f1;
  font-size: 13px;
}

.status-message[data-kind="error"] { border-color: #efd0cc; color: var(--danger); background: #fff3f1; }
.status-message[data-kind="warning"] { border-color: #e8d8b5; color: #795626; background: #fff8e9; }
.link-panel { margin-top: 16px; }
.card-search-panel { margin-top: 16px; }
.card-search-details { margin: 0; }
.link-panel[hidden], .status-message[hidden], .pending-notice[hidden] { display: none; }
.card-search-panel[hidden] { display: none; }
.link-panel .destination-details, .link-panel .link-details { margin-bottom: 0; }
.destination-details { margin-bottom: 24px; }
.destination-summary { align-items: center; margin-bottom: 0; cursor: pointer; list-style: none; }
.destination-summary::-webkit-details-marker { display: none; }
.destination-summary-label { min-width: 0; display: grid; gap: 3px; }
.destination-summary-title { color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.destination-summary-label #current-id { color: var(--muted); font-size: 13px; }
.destination-chevron { margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(45deg); transition: transform .15s ease; }
.destination-details[open] .destination-chevron, .card-search-details[open] .destination-chevron { transform: rotate(225deg); }
.destination-details[open] .destination-summary, .card-search-details[open] .destination-summary { margin-bottom: 22px; }
.destination-summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 5px; border-radius: 4px; }
.listings-panel { margin-top: 16px; }
.listings-panel[hidden], .listings-actions a[hidden], .listings-more[hidden], #listings-grade-note[hidden] { display: none; }
.listings-card-title { margin: 0 0 8px 42px; color: var(--muted); font-size: 13px; font-weight: 650; }
.listings-heading { align-items: flex-start; margin-bottom: 4px; }
.listings-heading-copy { min-width: 0; flex: 1; }
.listings-actions { display: flex; flex: 0 0 auto; gap: 7px; margin-left: auto; }
.photo-action-group { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.listings-actions .listings-icon { width: 40px; height: 40px; min-height: 40px; padding: 0; text-decoration: none; }
.listings-actions #card-photo-button[data-guided="true"] { border-color: #147458; color: #07533f; background: #dff5e9; box-shadow: 0 0 0 4px #b8e6ce; }
.photo-camera-guide { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; max-width: 100%; border: 1px solid #a6d9bf; border-radius: 8px; padding: 4px 8px; color: #07533f; background: #eaf8ef; font-size: 12px; line-height: 1.25; font-weight: 700; text-align: right; }
.photo-camera-guide[hidden] { display: none; }
.photo-camera-guide-arrow { flex: none; font-size: 18px; line-height: 1; }
.listings-icon svg { width: 19px; height: 19px; }
.listings-panel .photo-results { margin: 12px 0; }
#listings-status { margin-top: 0; }
.listings-list { list-style: none; display: grid; gap: 10px; padding: 0; margin: 16px 0 0; }
.listing-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 13px; min-height: 92px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfb; }
.listing-card img { width: 76px; height: 90px; object-fit: contain; border-radius: 5px; background: #f5f7f5; }
.listing-card a { color: var(--teal); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.listing-card p { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.listing-meta span { min-width: 0; border-radius: 5px; padding: 2px 5px; background: #eef4f0; overflow-wrap: anywhere; }
.listings-more { margin-top: 15px; }
.pending-notice {
  margin: 0 0 20px;
  border: 1px solid #e8d8b5;
  border-radius: 10px;
  padding: 12px 14px;
  color: #795626;
  background: #fff8e9;
  font-size: 13px;
}
.pending-notice strong { display: block; margin-bottom: 3px; }
.pending-notice p { margin: 0; }
.pending-notice code { font: inherit; font-weight: 700; }

.link-details { margin: 0 0 24px; }
.link-details > div { margin-bottom: 14px; }
dt { margin-bottom: 4px; color: #667b77; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
dd { margin: 0; font-size: 14px; }
dd a { color: var(--teal); font-weight: 700; overflow-wrap: anywhere; }
.url-text { overflow-wrap: anywhere; word-break: break-word; }
.copy-value { display: flex; align-items: flex-start; gap: 7px; }
.copy-value > a, .copy-value > .url-text { min-width: 0; }
.copy-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: -7px 0 -7px 1px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--teal);
  background: #fff;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.copy-button:hover { border-color: #9cbdb2; background: var(--mint); }
.copy-button:focus-visible { outline: 3px solid rgba(13, 101, 94, .24); outline-offset: 2px; }
.copy-button.is-copied { border-color: #a9d5c1; color: #24734c; background: #eff9f3; }
.copy-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy-button.is-copied svg { display: none; }
.copy-button.is-copied::before { content: "✓"; font-size: 18px; font-weight: 800; line-height: 1; }

h3 { margin: 0 0 3px; font-size: 15px; }

.page-footer {
  margin-top: 25px;
  color: #778784;
  font-size: 11px;
  text-align: center;
}
.page-footer p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 560px) {
  .page-shell { width: min(100% - 16px, 760px); padding-top: 12px; }
  .site-header { margin-bottom: 18px; }
  .brand { gap: 7px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 29px; line-height: 34px; }
  .hero { margin-bottom: 16px; }
  h1 { margin-bottom: 0; font-size: clamp(28px, 8vw, 34px); }
  .panel { padding: 15px; border-radius: 14px; }
  .section-heading { gap: 9px; margin-bottom: 12px; }
  .step-number { width: 26px; height: 26px; font-size: 12px; }
  h2, .destination-summary-title { font-size: 17px; }
  label { margin-bottom: 4px; }
  .lookup-row { align-items: stretch; flex-direction: row; gap: 8px; }
  .lookup-row input { min-height: 44px; }
  .lookup-row .button { flex: 0 0 auto; width: auto; min-height: 44px; padding: 0 11px; font-size: 12px; }
  #serial-input { padding: 0 9px; font-size: 16px; letter-spacing: .06em; }
  .field-help { margin-top: 6px; }
  .link-panel, .listings-panel, .card-search-panel { margin-top: 10px; }
  .listings-heading { margin-bottom: 4px; }
  .listings-heading.has-photo-guide { flex-wrap: wrap; }
  .listings-heading.has-photo-guide .listings-actions { flex: 1 0 100%; flex-wrap: wrap; justify-content: flex-end; margin-top: 5px; }
  .listings-heading.has-photo-guide .photo-camera-guide { font-size: 11px; }
  .listings-card-title { margin-left: 35px; font-size: 12px; }
  .listings-list { gap: 7px; margin-top: 10px; }
  .listing-card { grid-template-columns: 62px minmax(0, 1fr); gap: 9px; min-height: 0; padding: 8px; }
  .listing-card img { width: 62px; height: 75px; }
  .listing-card p { margin-top: 4px; font-size: 13px; }
  .listing-meta { gap: 3px 5px; margin-top: 5px; font-size: 11px; }
  .destination-details { margin-bottom: 14px; }
  .destination-details[open] .destination-summary { margin-bottom: 12px; }
  .link-details { margin-bottom: 14px; }
  .link-details > div { margin-bottom: 10px; }
  .card-search-grid { gap: 10px; }
  .listings-panel .photo-results { padding: 11px; }
  .search-filters { margin-top: 15px; }
  .filter-groups { gap: 8px; }
  .filter-group { padding: 8px 9px; }
  .check-option { margin-top: 6px; }
  .card-search-grid { grid-template-columns: 1fr; }
  .filter-groups { grid-template-columns: 1fr; }
  .button { width: 100%; }
}

@media (min-width: 360px) and (max-width: 560px) {
  .card-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-group:last-child { grid-column: 1 / -1; }
}

.suggestions[hidden] { display: none; }

.sold-price-fields { border: 1px solid var(--border, #d4dce4); border-radius: 12px; margin: 20px 0; padding: 16px; }
.sold-price-fields legend { font-weight: 650; padding: 0 6px; }
.form-field select { width: 100%; min-height: 44px; border: 1px solid #c7d3df; border-radius: 8px; padding: 10px; background: white; font: inherit; }
