/* ============================================================
   AMLI — site styles
   Component + screen styles implementing the AMLI Site design.
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-page);
  font-family: var(--font-body);
  color: var(--text-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.spacer { flex: 1; }
.boot {
  min-height: 60vh; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}

/* ============ Header / footer ============ */
.site-header {
  background: var(--surface-inverse);
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 10;
}
.wordmark {
  background: var(--brand); color: var(--on-brand);
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: 0.06em; padding: 4px 12px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
a.wordmark:hover { color: var(--on-brand); text-decoration: none; }
.main-nav { display: flex; gap: 22px; align-items: center; }
.nav-link {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-on-inverse-muted); cursor: pointer;
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--text-on-inverse); text-decoration: none; }
.nav-link.active { font-weight: 700; color: var(--text-on-inverse); border-bottom-color: var(--brand-400); }
.header-phone {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-on-inverse); font-family: var(--font-mono); font-size: 15px;
  border: 1px solid var(--border-inverse); border-radius: var(--radius-sm);
  padding: 8px 14px;
  transition: border-color var(--dur) var(--ease-out);
  white-space: nowrap;
}
.header-phone:hover { border-color: var(--steel-500); color: var(--text-on-inverse); text-decoration: none; }
.header-phone--plain { border: none; padding: 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-on-inverse-muted);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
}
.back-link:hover { color: var(--text-on-inverse); text-decoration: none; }
.admin-tag {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--steel-900); background: var(--steel-300);
  padding: 3px 8px; border-radius: var(--radius-xs);
}
.header-link {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-on-inverse-muted); cursor: pointer;
}
.header-link:hover { color: var(--text-on-inverse); text-decoration: none; }

.site-footer {
  background: var(--surface-inverse);
  padding: 22px 32px;
  display: flex; align-items: center; gap: 16px;
}
.site-footer--bordered { border-top: 1px solid var(--border-inverse); }
.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; color: var(--text-on-inverse-muted); }
.footer-dot { font-size: 13px; color: var(--text-on-inverse-muted); }
.footer-phone { font-family: var(--font-mono); font-size: 13px; color: var(--text-on-inverse-muted); }
.staff-link { font-size: 12px; color: var(--steel-600); cursor: pointer; }
.staff-link:hover { color: var(--steel-400); text-decoration: none; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em;
  line-height: 1; text-transform: uppercase;
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  transition: filter var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out), background var(--dur) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--sm { font-size: 13px; height: 32px; padding: 7px 12px; gap: 6px; }
.btn--md { font-size: 15px; height: 42px; padding: 10px 18px; }
.btn--lg { font-size: 17px; height: 50px; padding: 13px 24px; }
.btn--primary { background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); }
.btn--primary:hover { filter: brightness(0.94); }
.btn--secondary { background: var(--surface-card); color: var(--text-strong); border: 1px solid var(--border-strong); }
.btn--secondary:hover { background: var(--steel-50); }
.btn--ghost { background: transparent; color: var(--text-strong); border: 1px solid transparent; }
.btn--ghost:hover { background: var(--surface-sunken); }
.btn--danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn--danger:hover { filter: brightness(0.94); }
.btn--block { width: 100%; }

/* ============ Form fields ============ */
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field-label { font-weight: 600; font-size: 13px; color: var(--text-strong); letter-spacing: 0.01em; }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field--error .input-box { border-color: var(--danger); }
.field--error .field-hint { color: var(--danger); }

.input-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 12px; height: 42px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.input-box:focus-within { border-color: var(--brand); box-shadow: var(--focus-ring); }
.field--error .input-box:focus-within { border-color: var(--danger); }
.input-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 15px; color: var(--text-strong);
  height: 100%; min-width: 0;
}
.input-box input::placeholder { color: var(--text-faint); }
.input-prefix { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); }

select.select {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 42px; padding: 0 36px 0 12px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px; color: var(--text-strong);
  cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23626e78' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color var(--dur), box-shadow var(--dur);
}
select.select:focus { border-color: var(--brand); box-shadow: var(--focus-ring); }

textarea.textarea {
  width: 100%; padding: 10px 12px; resize: vertical;
  background: var(--surface-card);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  color: var(--text-strong); outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
textarea.textarea::placeholder { color: var(--text-faint); }
textarea.textarea:focus { border-color: var(--brand); box-shadow: var(--focus-ring); }

.checkbox {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 15px; color: var(--text-body); user-select: none;
}
.checkbox input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 0; flex-shrink: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-xs);
  background: var(--surface-card); cursor: inherit;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.checkbox input:checked {
  background-color: var(--brand); border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 13px; background-position: center; background-repeat: no-repeat;
}
.checkbox input:focus-visible { box-shadow: var(--focus-ring); }

/* ============ Badges / status ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600; font-size: 12px; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: var(--radius-xs); white-space: nowrap;
}
.badge--neutral { background: var(--surface-sunken); color: var(--text-body); }
.badge--accent { background: var(--accent-bg); color: var(--accent-fg); }
.badge--success { background: var(--status-available-bg); color: var(--status-available-fg); }

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 10px; border-radius: var(--radius-xs); white-space: nowrap;
}
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-chip--overlay { position: absolute; top: 10px; left: 10px; }

/* ============ Landing ============ */
.hero { background: var(--surface-card); border-bottom: 1px solid var(--border); }
.hero-inner {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px;
  align-items: center; padding: 64px 32px;
}
.hero-copy { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.hero-title {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 52px;
  line-height: 1.02; color: var(--text-strong); text-transform: uppercase;
  letter-spacing: 0.01em; text-wrap: pretty;
}
.hero-sub { margin: 0; font-size: 18px; line-height: 1.5; color: var(--text-muted); max-width: 480px; }
.hero-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-alt { font-size: 14px; color: var(--text-muted); }
.mono-link { font-family: var(--font-mono); }

.photo-ph {
  aspect-ratio: 4 / 3; background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  display: grid; place-items: center; color: var(--text-faint); overflow: hidden;
}
.ph-stack { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ph-note { font-size: 13px; }

.why { padding: 56px 32px; }
.why-inner { max-width: var(--container); margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.section-title {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 28px;
  text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-strong);
}
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.why-card {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.why-icon {
  display: inline-flex; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: var(--brand-100); color: var(--brand-600);
  border-radius: var(--radius-sm);
}
.why-card h3 {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-strong);
}
.why-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-body); }

.contact-strip { background: var(--surface-inverse); padding: 48px 32px; }
.contact-grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; align-items: start;
}
.contact-cell { display: flex; flex-direction: column; gap: 6px; }
.contact-label {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-on-inverse-muted);
}
.contact-value { font-size: 15px; color: var(--text-on-inverse); }
a.contact-map { text-decoration: underline; text-decoration-color: var(--text-on-inverse-muted); text-underline-offset: 3px; }
a.contact-tel { font-family: var(--font-mono); font-size: 18px; color: var(--text-on-inverse); }
a.contact-mail { font-family: var(--font-mono); font-size: 16px; color: var(--text-on-inverse); word-break: break-all; }

/* ============ Browse / inventory ============ */
.browse-head { background: var(--surface-card); border-bottom: 1px solid var(--border); padding: 40px 32px; }
.browse-head-inner { max-width: var(--container); margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.page-title {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 42px;
  line-height: 1.05; color: var(--text-strong); text-transform: uppercase; letter-spacing: 0.01em;
}
.page-sub { margin: 0; font-size: 17px; color: var(--text-muted); max-width: 560px; }
.browse-search { max-width: 460px; margin-top: 6px; }

.browse-layout {
  max-width: var(--container); margin: 0 auto; width: 100%;
  display: flex; gap: 28px; padding: 28px 32px 56px; align-items: flex-start; flex: 1;
}
.filter-rail { width: 240px; flex: none; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 96px; }
.filter-head { display: flex; align-items: baseline; justify-content: space-between; }
.filter-title {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-strong);
}
.link-btn {
  font-size: 12px; color: var(--link); cursor: pointer;
  background: none; border: 0; padding: 0; font-family: inherit;
}
.link-btn:hover { text-decoration: underline; color: var(--link-hover); }
.filter-group { display: flex; flex-direction: column; gap: 9px; }
.filter-group-label { font-weight: 600; font-size: 13px; color: var(--text-strong); }
.filter-group--sep { border-top: 1px solid var(--border); padding-top: 16px; }

.results { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.result-count { font-size: 14px; color: var(--text-muted); }
.result-count b { font-family: var(--font-mono); font-weight: 500; color: var(--text-strong); }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 24px; }

.unit-card {
  display: flex; flex-direction: column;
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.unit-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.unit-media {
  position: relative; aspect-ratio: 4 / 3; background: var(--surface-sunken);
  display: grid; place-items: center; color: var(--text-faint); overflow: hidden;
}
.unit-media img { width: 100%; height: 100%; object-fit: cover; }
.unit-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.unit-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.1; color: var(--text-strong); }
.unit-sub { margin-top: 3px; font-size: 13px; color: var(--text-muted); }
.unit-specs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: auto; font-size: 13px; }
.spec-k { color: var(--text-faint); }
.spec-v { font-family: var(--font-mono); font-weight: 500; color: var(--text-strong); }
.unit-price-row { display: flex; align-items: baseline; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.unit-price { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--text-strong); }
.unit-price-note { font-size: 12px; color: var(--text-muted); }

.empty-box {
  background: var(--surface-card); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md); padding: 40px; text-align: center; color: var(--text-muted);
}

/* ============ Detail ============ */
.detail-layout {
  max-width: var(--container); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px;
  padding: 32px; align-items: start; flex: 1;
}
.gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-main {
  aspect-ratio: 4 / 3; background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  display: grid; place-items: center; color: var(--text-faint); overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumb-row { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
  width: 92px; aspect-ratio: 4 / 3; background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; padding: 0;
}
.thumb.active { border-color: var(--border-strong); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-card {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px; margin-top: 8px;
}
.about-card h3 {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-strong);
}
.about-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-body); }

.info-rail { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 96px; }
.chip-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.detail-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1.05; color: var(--text-strong); }
.detail-note {
  margin-top: 8px; font-size: 14px; color: var(--blue-600);
  background: var(--blue-100); border-radius: var(--radius-xs); padding: 8px 12px;
}
.price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.detail-price { font-family: var(--font-display); font-weight: 800; font-size: 34px; color: var(--text-strong); }
.detail-price-note { font-size: 13px; color: var(--text-muted); }

.speclist { display: grid; grid-template-columns: 1fr; margin: 0; }
.speclist > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.speclist dt { font-size: 14px; color: var(--text-muted); }
.speclist dd { margin: 0; font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text-strong); text-align: right; }

.quote-card {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.quote-card h3 {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 16px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-strong);
}
.intent-row { display: flex; gap: 18px; flex-wrap: wrap; }
/* Anti-spam honeypot: parked far off-screen (display:none would tip off
   smarter bots), never focusable or read by screen readers. */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; overflow: hidden; }
.quote-alt { text-align: center; font-size: 13px; color: var(--text-muted); }
.quote-alt .stock { font-family: var(--font-mono); color: var(--text-strong); }

.success-box {
  background: var(--status-available-bg); border: 1px solid var(--green-500);
  border-radius: var(--radius-md); padding: 24px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.success-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--status-available-fg);
}
.success-box p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--status-available-fg); }
.success-box a { font-family: var(--font-mono); color: var(--status-available-fg); text-decoration: underline; }

/* ============ Login ============ */
.login-screen { min-height: 100vh; display: grid; place-items: center; background: var(--surface-page); padding: 20px; }
.login-card {
  width: 380px; max-width: 100%;
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 32px; display: flex; flex-direction: column; gap: 16px;
}
.login-head { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.login-title {
  margin: 8px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-strong);
}
.login-sub { margin: 0; font-size: 13px; color: var(--text-muted); }
.login-back { font-size: 13px; color: var(--link); cursor: pointer; text-align: center; }
.login-error { margin: 0; font-size: 13px; color: var(--danger); }

/* ============ Admin ============ */
.admin-main {
  max-width: var(--container); margin: 0 auto; width: 100%;
  padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 20px; flex: 1;
}
.tab-bar { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--border); }
.tab {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 10px 2px; cursor: pointer; color: var(--text-muted);
  background: none; border: 0; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab.active { color: var(--text-strong); border-bottom-color: var(--brand); }
.tab .count { font-family: var(--font-mono); font-size: 13px; }
.new-pill {
  background: var(--brand); color: var(--on-brand);
  font-family: var(--font-mono); font-size: 12px;
  padding: 1px 7px; border-radius: var(--radius-xs);
}
.view-toggle { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 32px; cursor: pointer;
  background: var(--surface-card); color: var(--text-muted); border: 0; padding: 0;
}
.view-toggle button + button { border-left: 1px solid var(--border-strong); }
.view-toggle button.active { background: var(--brand); color: var(--on-brand); }

.admin-panel {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden;
}
.listing-grid-head, .listing-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 70px 90px 100px 130px 170px 90px;
  gap: 12px; align-items: center; padding: 10px 16px;
}
.listing-grid-head {
  background: var(--surface-sunken); border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted);
}
.listing-row { border-bottom: 1px solid var(--border); }
.listing-row:last-child { border-bottom: 0; }
.dim { opacity: 0.55; }
.unit-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mini-thumb {
  width: 56px; height: 42px; flex: none;
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-xs); display: grid; place-items: center;
  color: var(--text-faint); overflow: hidden;
}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.unit-cell-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unit-cell-stock { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.cell-mono { font-family: var(--font-mono); font-size: 14px; color: var(--text-strong); }
.cell-price { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text-strong); }
.price-hidden-note { font-size: 11px; color: var(--text-faint); }
.helper-note { font-size: 13px; color: var(--text-muted); }
.helper-note .mono { font-family: var(--font-mono); }

.admin-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.admin-card {
  display: flex; flex-direction: column;
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.admin-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.admin-card-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text-strong); }
.admin-card-sub { font-size: 13px; color: var(--text-muted); }
.admin-card-price { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text-strong); margin-top: 2px; }
.admin-card-price .hidden-note { font-family: var(--font-body); font-size: 11px; font-weight: 400; color: var(--text-faint); }
.admin-card-foot {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-sunken);
}
.admin-card-foot .select-wrap { flex: 1; min-width: 0; }

.quote-row { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.quote-row:last-child { border-bottom: 0; }
.quote-row.dim { opacity: 0.6; }
.quote-main { flex: 1; min-width: 0; }
.quote-who { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.quote-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text-strong); }
.quote-contact { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.quote-re { font-size: 14px; color: var(--text-body); margin-top: 3px; }
.quote-re b { font-weight: 600; color: var(--text-strong); }
.quote-msg { font-size: 14px; color: var(--text-muted); margin-top: 4px; font-style: italic; }
.quote-time { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.quote-actions { display: flex; gap: 8px; align-items: center; }
.badge-btn { background: none; border: 0; padding: 0; cursor: pointer; }

/* ============ Add / edit unit ============ */
.edit-main {
  max-width: 760px; margin: 0 auto; width: 100%;
  padding: 32px; display: flex; flex-direction: column; gap: 24px; flex: 1;
}
.edit-title {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 28px;
  text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-strong);
}
.photo-block { display: flex; flex-direction: column; gap: 8px; }
.photo-strip { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-tile {
  width: 140px; aspect-ratio: 4 / 3;
  background: var(--surface-sunken); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); display: grid; place-items: center;
  color: var(--text-faint); position: relative; overflow: hidden;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
  border-radius: var(--radius-xs); background: rgba(20, 24, 29, 0.65);
  color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 14px; line-height: 1;
}
.photo-remove:hover { background: rgba(20, 24, 29, 0.85); }
.photo-add {
  width: 140px; aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--text-muted);
  font-size: 13px; cursor: pointer; background: none; font-family: inherit;
  transition: border-color var(--dur), color var(--dur);
}
.photo-add:hover { border-color: var(--brand); color: var(--brand); }
.cover-note { font-size: 12px; color: var(--text-muted); }

.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.col-span { grid-column: 1 / -1; }
.price-stack { display: flex; flex-direction: column; gap: 8px; }
.offered-group { display: flex; flex-direction: column; gap: 10px; justify-content: flex-end; padding-bottom: 4px; }
.edit-actions { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--border); padding-top: 20px; }

/* ============ Responsive ============ */
/* Shown under the header while the backend is unreachable. */
.offline-banner {
  background: var(--status-hold-bg); color: var(--status-hold-fg);
  border-bottom: 1px solid var(--warning);
  padding: 12px 24px; text-align: center; font-size: 14px; font-weight: 500;
}
.offline-banner a { color: inherit; font-weight: 700; }

/* Mobile-only detail headline and quote CTA bar (hidden on desktop). */
.detail-headline--mobile { display: none; }
.quote-cta-bar { display: none; }
/* Mobile-only filter toggle (hidden on desktop, where the rail is always shown). */
.filter-toggle { display: none; }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; padding: 48px 24px; }
  .hero-title { font-size: 42px; }
  .why-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .browse-layout { flex-direction: column; padding: 24px 24px 48px; }
  .filter-rail { width: 100%; position: static; }
  .detail-layout { grid-template-columns: 1fr; padding: 24px; }
  .info-rail { position: static; }
  .listing-wrap { overflow-x: auto; }
  .listing-wrap .admin-panel { min-width: 900px; }

  /* Collapse the filter rail behind a toggle so results come first. */
  .filter-rail { display: none; }
  .filter-rail.open { display: block; }
  .filter-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 12px 16px;
    background: var(--surface-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    font: inherit; font-weight: 600; color: var(--text-strong);
  }
  .filter-toggle-caret { color: var(--text-muted); }

  /* Title + price move above the gallery; hide the desktop copy. */
  .detail-headline--mobile { display: block; }
  .detail-headline--desktop { display: none; }

  /* Sticky quote CTA pinned to the bottom of the viewport. */
  .quote-cta-bar {
    display: flex; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-card); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(20, 24, 29, 0.08);
  }
  .quote-cta-bar .btn--primary { flex: 1; }
  /* Keep page content clear of the fixed bar. */
  .detail-layout { padding-bottom: 96px; }
}

@media (max-width: 640px) {
  .site-header { padding: 0 16px; gap: 16px; }
  .header-phone { padding: 6px 10px; font-size: 13px; }
  .hero-title { font-size: 34px; }
  .page-title { font-size: 32px; }
  .contact-strip, .why { padding-left: 20px; padding-right: 20px; }
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }
  .edit-grid { grid-template-columns: 1fr; }
  .admin-main, .edit-main { padding: 20px 16px 40px; }
  .site-footer { padding: 18px 16px; flex-wrap: wrap; }
  .header-link { white-space: nowrap; }
}

/* Phone-width header: keep everything on one line. The phone number and
   "Back to inventory" label give way to their icons. */
@media (max-width: 480px) {
  .site-header { gap: 10px; }
  .header-phone-num { display: none; }
  .header-phone { padding: 8px; }
  .back-label { display: none; }
  .admin-tag { display: none; }
  .header-link { font-size: 12px; }
}
