/* ---------- Tokens ---------- */
:root {
  --ink: #131314;
  --black: #0A0A0B;
  --black-soft: #17181A;
  --paper: #F7F7F5;
  --white: #FFFFFF;
  --red: #C6161B;
  --red-dark: #9E1115;
  --grey: #6B6E72;
  --grey-light: #9A9C9F;
  --line: #E4E3DF;
  --line-dark: #2A2B2D;

  --font-display: 'Barlow Condensed', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max: 1200px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.05;
  margin: 0;
  color: var(--black);
}

p { margin: 0; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border-radius: 2px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--red-dark);
  text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--black);
  border-bottom: 3px solid var(--red);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 24px;
}
.brand { display: flex; align-items: center; }
.brand-logo {
  height: 48px;
  width: auto;
  display: block;
}
.main-nav {
  display: flex;
  gap: 30px;
}
.main-nav a {
  color: #C9CBCD;
  font-size: 15px;
  font-weight: 500;
}
.main-nav a:hover { color: var(--white); text-decoration: none; }
.nav-cta { flex-shrink: 0; }

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.account-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #C9CBCD;
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.account-chip:hover,
.account-chip.is-signed-in {
  color: var(--white);
  border-color: #4C4D50;
  background: var(--black-soft);
}
.saved-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0 6px;
  color: var(--white);
  background: var(--red);
  border-radius: 999px;
  font-size: 12px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--black-soft);
  flex-shrink: 0;
}
.language-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #C9CBCD;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}
.language-option:hover {
  color: var(--white);
}
.language-option.is-active {
  background: var(--white);
  color: var(--black);
}
.flag {
  display: inline-block;
  position: relative;
  width: 22px;
  height: 15px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .22);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
  flex-shrink: 0;
}
.flag-pt {
  background: linear-gradient(90deg, #046A38 0 42%, #DA291C 42% 100%);
}
.flag-pt::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 6px;
  height: 6px;
  border: 1px solid #FFCD00;
  border-radius: 50%;
  background: rgba(255, 205, 0, .3);
}
.flag-gb {
  background:
    linear-gradient(90deg, transparent 42%, #C8102E 42% 58%, transparent 58%),
    linear-gradient(0deg, transparent 38%, #C8102E 38% 62%, transparent 62%),
    linear-gradient(27deg, transparent 44%, #FFFFFF 44% 52%, #C8102E 52% 56%, #FFFFFF 56% 64%, transparent 64%),
    linear-gradient(153deg, transparent 44%, #FFFFFF 44% 52%, #C8102E 52% 56%, #FFFFFF 56% 64%, transparent 64%),
    linear-gradient(90deg, transparent 35%, #FFFFFF 35% 65%, transparent 65%),
    linear-gradient(0deg, transparent 30%, #FFFFFF 30% 70%, transparent 70%),
    #012169;
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .header-inner { flex-wrap: wrap; }
  .account-actions { margin-left: auto; }
}

@media (max-width: 520px) {
  .brand-logo { height: 42px; }
  .account-chip { min-height: 38px; padding: 8px 10px; }
  .language-switch { order: 4; width: 100%; }
  .language-option { flex: 1; min-height: 36px; }
  .nav-cta { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 56px 0 72px;
}
.hero-inner {
  max-width: 780px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-light);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  color: var(--white);
  margin-bottom: 18px;
}
.hero-lede {
  display: block;
  font-size: 17px;
  color: #C9CBCD;
  max-width: 52ch;
  margin-bottom: 36px;
}

.search-panel {
  background: var(--black-soft);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  padding: 8px;
  max-width: 620px;
}
.search-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}
.search-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--grey-light);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.search-tab.is-active {
  background: var(--white);
  color: var(--black);
}
.search-tab:not(.is-active):hover {
  color: var(--white);
}

.search-form {
  display: flex;
  gap: 8px;
}
.search-form input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: .03em;
  padding: 14px 16px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: var(--black);
  color: var(--white);
}
.search-form input::placeholder { color: #55585C; }
.search-form input:focus {
  outline: none;
  border-color: var(--red);
}
.search-btn { flex-shrink: 0; }

@media (max-width: 520px) {
  .search-form { flex-direction: column; }
}

/* ---------- Section head ---------- */
.section-head {
  margin-bottom: 28px;
  max-width: 60ch;
}
.section-head h2 {
  font-size: 32px;
  margin-bottom: 8px;
}
.section-head p {
  color: var(--grey);
  font-size: 15.5px;
  font-family: var(--font-body);
  text-transform: none;
}

/* ---------- Filter bar ---------- */
.inventory {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-bar select {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
}
.filter-reset {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 6px;
}
.filter-reset:hover { color: var(--red); }

/* ---------- Stock grid ---------- */
.stock-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1020px) {
  .stock-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .stock-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stock-grid { grid-template-columns: 1fr; }
}

.stock-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: border-color .15s ease;
}
.stock-card:hover { border-color: #C7C6C1; }
.stock-card:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.card-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  position: relative;
  aspect-ratio: 4 / 3;
  background: #EDECE8;
  overflow: hidden;
  cursor: pointer;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(19, 19, 20, .14);
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.favorite-btn::before {
  content: "\2661";
  display: block;
  color: var(--black);
  font-size: 21px;
  line-height: 1;
}
.favorite-btn:hover {
  transform: translateY(-1px);
  background: var(--white);
  border-color: rgba(198, 22, 27, .35);
}
.favorite-btn.is-saved::before {
  content: "\2665";
  color: var(--red);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--grey);
  letter-spacing: .02em;
}
.card-fits {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--black);
  line-height: 1.3;
}
.card-compatible {
  font-size: 13.5px;
  color: var(--grey);
  line-height: 1.35;
}
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--grey);
  margin-top: 2px;
}
.card-condition {
  font-size: 13px;
  color: var(--grey);
  margin-top: 2px;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}
.card-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  color: var(--black);
}
.card-price span {
  display: block;
  margin-top: 2px;
  color: var(--grey);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
}
.card-cta {
  font-size: 13.5px;
  font-weight: 600;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.purchase-link {
  padding: 0;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.purchase-link:hover {
  color: var(--red-dark);
  text-decoration: underline;
}
.detail-link {
  padding: 0;
  color: var(--black);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.detail-link:hover {
  color: var(--red);
  text-decoration: underline;
}

.no-results {
  padding: 40px 0;
  text-align: center;
  color: var(--grey);
  font-size: 15px;
}

.inventory-alert {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 5px;
  background: var(--white);
  color: var(--grey);
}
.inventory-alert strong {
  color: var(--black);
}
.inventory-alert span {
  font-size: 14px;
}

.table-note {
  margin-top: 28px;
  font-size: 14.5px;
  color: var(--grey);
}

/* ---------- How it works ---------- */
.how {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}
.how-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
.how-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.how-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  background: var(--black);
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-list h3 {
  font-size: 19px;
  margin-bottom: 6px;
}
.how-list p {
  font-size: 14.5px;
  color: var(--grey);
  font-family: var(--font-body);
  text-transform: none;
}

@media (max-width: 860px) {
  .how-list { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */
.contact {
  padding: 64px 0 84px;
}
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.contact h2 {
  font-size: 30px;
  margin-bottom: 14px;
  max-width: 18ch;
}
.contact > div > p {
  color: var(--grey);
  font-size: 15px;
  max-width: 42ch;
  margin-bottom: 28px;
  font-family: var(--font-body);
}
.contact-details {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.contact-details li {
  display: flex;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.contact-details span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--grey);
  width: 70px;
  min-width: 70px;
  padding-top: 2px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px;
}
.contact-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  margin-top: 12px;
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  background: var(--white);
}
.contact-form button {
  margin-top: 18px;
}
.hidden-field {
  display: none !important;
}
.form-note {
  font-size: 13.5px;
  color: var(--grey);
  margin-top: 10px;
  min-height: 18px;
}
.form-note.success { color: #2C6B41; }

@media (max-width: 860px) {
  .contact-inner { grid-template-columns: 1fr; }
}

/* ---------- Account dialogs ---------- */
body.modal-open {
  overflow: hidden;
}

.modal[hidden] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(10, 10, 11, .66);
  cursor: pointer;
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
  padding: 26px;
}
.modal-panel-wide {
  width: min(100%, 920px);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.modal-head h2 {
  font-size: 28px;
}
.modal-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--grey);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  cursor: pointer;
}
.close-button::before {
  content: "\00d7";
  color: var(--black);
  font-size: 24px;
  line-height: 1;
}
.icon-button:hover {
  border-color: #C7C6C1;
  background: var(--white);
}

.engine-panel {
  width: min(100%, 1060px);
}
.engine-detail-layout {
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(0, 1.05fr);
  gap: 30px;
  align-items: start;
}
.engine-detail-media {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.engine-detail-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.engine-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.engine-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: var(--paper);
  overflow: hidden;
  cursor: pointer;
}
.engine-thumb img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
}
.engine-thumb.is-active {
  border-color: var(--red);
}
.engine-detail-copy {
  display: grid;
  gap: 20px;
}
.engine-detail-fits {
  color: var(--grey);
  font-size: 14px;
}
.engine-price-block {
  display: grid;
  gap: 3px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.engine-price-block span {
  color: var(--grey);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}
.engine-price-block strong {
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 28px;
}
.engine-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-section {
  display: grid;
  gap: 12px;
}
.detail-section h3 {
  color: var(--red);
  font-size: 21px;
}
.detail-section h3::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  margin-top: 8px;
  background: var(--black);
}
.detail-table {
  display: grid;
  border-top: 1px solid var(--line);
}
.detail-table div {
  display: grid;
  grid-template-columns: minmax(120px, .75fr) minmax(0, 1.25fr);
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.detail-table span {
  color: var(--grey);
  font-size: 12.5px;
  font-weight: 700;
}
.detail-table strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.inspection-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}
.inspection-list li {
  position: relative;
  padding-left: 18px;
  color: var(--grey);
  font-size: 13.5px;
}
.inspection-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .65em;
  width: 7px;
  height: 7px;
  background: var(--red);
}
.detail-section p {
  color: var(--grey);
  font-size: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-bottom: 18px;
}
.auth-tab {
  border: none;
  background: transparent;
  color: var(--grey);
  border-radius: 3px;
  padding: 11px 10px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
}
.auth-tab.is-active {
  background: var(--black);
  color: var(--white);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  margin-top: 12px;
}
.auth-form input,
.auth-form textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.auth-form input:focus,
.auth-form textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  background: var(--white);
}
.auth-form input[readonly] {
  color: var(--grey);
  background: #EFEFEB;
}
.auth-form button[type="submit"] {
  margin-top: 18px;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.account-summary div {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 5px;
  padding: 12px;
}
.account-summary span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grey);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.account-summary strong {
  display: block;
  color: var(--black);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.inline-action {
  display: inline-flex;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--red);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.inline-action:hover {
  color: var(--red-dark);
  text-decoration: underline;
}
.inline-action:disabled {
  color: var(--grey);
  cursor: default;
  text-decoration: none;
}
.account-panel-grid {
  display: grid;
  gap: 18px;
}
.panel-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.panel-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.panel-section h3 {
  font-size: 20px;
}
.panel-section h4 {
  color: var(--grey);
  font-size: 13px;
  margin-bottom: 10px;
}
.saved-list,
.admin-list {
  display: grid;
  gap: 10px;
}
.saved-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  background: var(--white);
}
.saved-item img {
  width: 72px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--paper);
}
.saved-item strong,
.saved-item span {
  display: block;
}
.saved-item strong {
  color: var(--black);
  font-size: 14px;
  line-height: 1.3;
}
.saved-item span {
  color: var(--grey);
  font-size: 12.5px;
}
.saved-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.secondary-button:hover {
  border-color: var(--red);
  color: var(--red);
}
.secondary-button.compact {
  min-height: 34px;
  padding: 7px 10px;
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-row {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  font-size: 13px;
}
.admin-row strong {
  color: var(--black);
}
.admin-row span {
  color: var(--grey);
  overflow-wrap: anywhere;
}
.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}
.empty-state {
  border: 1px dashed #C7C6C1;
  border-radius: 5px;
  padding: 18px;
  color: var(--grey);
  font-size: 14px;
  background: var(--paper);
}

@media (max-width: 760px) {
  .modal {
    align-items: end;
    padding: 12px;
  }
  .modal-panel {
    max-height: calc(100vh - 24px);
    padding: 22px;
  }
  .engine-detail-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .detail-table div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .account-summary,
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .saved-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .saved-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: #9DA0A3;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  padding: 52px 0 36px;
}
.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 16px;
}
.footer-brand p {
  font-size: 13.5px;
  color: #8B8E91;
  max-width: 40ch;
  line-height: 1.6;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col h4 {
  font-size: 13px;
  color: #6B6E72;
  margin-bottom: 4px;
}
.footer-col a, .footer-col span {
  font-size: 14px;
  color: #C9CBCD;
  font-family: var(--font-body);
}
.footer-col a:hover { color: var(--white); }

.footer-legal {
  border-top: 1px solid var(--line-dark);
  padding: 18px 0;
  font-size: 13px;
  color: #6B6E72;
}

@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}
