:root {
  --black: #111111;
  --gold: #c9a227;
  --paper: #fffdf7;
  --surface: #f4f2ec;
  --line: #d8d1bd;
  --muted: #706b60;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--black);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 3vw, 34px);
  background: var(--black);
  color: var(--white);
  border-bottom: 4px solid var(--gold);
}

.brand {
  display: grid;
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
}

.brand span {
  color: #f0df9a;
  font-size: 0.76rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  font-size: 0.9rem;
  font-weight: 800;
}

nav a,
.phone {
  text-decoration: none;
}

.page-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0;
}

.page-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

.notice,
.request-form,
.faq-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.notice {
  margin-bottom: 18px;
  padding: 16px;
  font-weight: 750;
}

.request-form {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.field-note {
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.85;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9c0aa;
  border-radius: 6px;
  background: #fffefb;
  color: var(--black);
  font: inherit;
  font-weight: 650;
  padding: 10px;
}

input[type="file"] {
  min-height: auto;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

textarea {
  resize: vertical;
}

.cf-turnstile {
  margin: 2px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--gold);
  color: var(--black);
  font-weight: 900;
  text-decoration: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.request-form-result {
  padding: 14px;
  border-radius: 7px;
  font-weight: 850;
}

.request-form-result[hidden] {
  display: none;
}

.request-form-result.pending {
  border: 1px solid rgba(201, 162, 39, 0.7);
  background: #fff8df;
  color: var(--black);
}

.request-form-result.success {
  border: 1px solid rgba(23, 122, 61, 0.5);
  background: #e9f7ee;
  color: #14532d;
}

.request-form-result.error {
  border: 1px solid rgba(180, 35, 24, 0.5);
  background: #fee4e2;
  color: #b42318;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-list article {
  padding: 18px;
}

.faq-list h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.site-footer {
  display: grid;
  gap: 4px;
  padding: 22px clamp(16px, 3vw, 34px);
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer strong {
  color: var(--black);
}

/* Public inventory widget (rendered by website-inventory-widget.js into
   [data-adarms-inventory]). Keep photos strictly contained inside their own
   fixed-ratio box so a very tall/wide/oddly-cropped photo can never push into
   or overlap the card's text or the "Ask About This Item" button. */
[data-adarms-inventory] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.inventory-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.inventory-card.is-unavailable {
  opacity: 0.65;
}

.inventory-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.inventory-status {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--black);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inventory-card h2 {
  margin: 0;
  font-size: 1.08rem;
  word-break: break-word;
}

.inventory-price {
  margin: 0;
  font-weight: 900;
  color: var(--black);
}

.inventory-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-word;
}

.inventory-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  margin: 0;
  font-size: 0.8rem;
}

.inventory-card dt {
  color: var(--muted);
  font-weight: 800;
}

.inventory-card dd {
  margin: 0;
  color: var(--black);
  font-weight: 650;
  word-break: break-word;
}

.inventory-card > a {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--gold);
  color: var(--black);
  font-weight: 900;
  text-decoration: none;
}

.admin-shell {
  width: min(1100px, calc(100% - 32px));
}

.admin-role-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.admin-session-controls {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin-left: auto;
}

.admin-logout-link,
.footer-admin-link {
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-logout-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.admin-logout-link:hover,
.footer-admin-link:hover {
  text-decoration: underline;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.admin-action,
.admin-panel,
.receipt-paper {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.admin-action {
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 18px;
  text-decoration: none;
}

.admin-action strong {
  font-size: 1.2rem;
}

.admin-action span,
.admin-panel p {
  color: var(--muted);
  font-weight: 700;
}

.admin-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: clamp(16px, 3vw, 24px);
}

.admin-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-panel h2,
.receipt-section h2 {
  margin: 0;
  font-size: 1.1rem;
}

.firearm-config-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.admin-form {
  padding: 0;
  border: 0;
}

.button.secondary {
  border-color: var(--line);
  background: var(--white);
}

.photo-placeholders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed #b9af99;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.photo-placeholder img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-photo-thumb {
  width: 96px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.admin-preview-card {
  max-width: 360px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff8df;
  color: var(--black);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.success {
  background: #e7f1eb;
  color: var(--green);
}

.status-pill.pending {
  background: #fff4df;
  color: #7a4b00;
}

.status-pill.warning {
  background: #fde8e8;
  color: #9b1c1c;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.report-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.report-grid strong {
  color: var(--green);
  font-size: 1.4rem;
}

.report-grid span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.compliance-source-record {
  align-items: stretch;
}

.compliance-source-actions {
  align-content: start;
  justify-content: flex-end;
  min-width: min(100%, 340px);
}

.source-note {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.receipt-list,
.line-item-table {
  display: grid;
  gap: 8px;
}

.receipt-row,
.line-item-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.receipt-row {
  grid-template-columns: 1fr 1.3fr 1fr 0.8fr 0.8fr;
}

.line-item-row {
  grid-template-columns: minmax(180px, 2fr) 70px 100px 100px 100px 100px;
}

.receipt-head,
.line-item-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-paper {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 3vw, 28px);
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.receipt-header > div {
  display: grid;
  gap: 3px;
}

.receipt-header strong {
  font-size: 1.4rem;
}

.receipt-meta {
  min-width: min(280px, 100%);
}

.receipt-section {
  margin-bottom: 0;
}

.receipt-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.demo-summary {
  margin-top: 18px;
}

.demo-summary p {
  margin: 0;
}

.demo-record-list {
  display: grid;
  gap: 10px;
}

.demo-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.demo-record div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.demo-record strong,
.demo-record span,
.demo-record small {
  overflow-wrap: anywhere;
}

.demo-record small {
  color: var(--muted);
  font-weight: 700;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.role-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.role-grid span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .admin-session-controls {
    margin-left: 0;
  }

  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .receipt-row,
  .line-item-row {
    grid-template-columns: 1fr;
  }

  .receipt-head,
  .line-item-head {
    display: none;
  }

  .demo-record {
    align-items: stretch;
    flex-direction: column;
  }
}
