* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --bg: #f7f5f1;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5f6368;
  --accent: #e77b2a;
  --accent-dark: #b75d1d;
  --border: #e3e0da;
  --shadow: 0 20px 50px rgba(26, 26, 26, 0.12);
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  font: inherit;
  cursor: pointer;
}

input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  padding: 32px 6vw 64px;
  background: linear-gradient(135deg, #fef3e8 0%, #f7f5f1 60%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.brand-mark {
  background: var(--text);
  color: white;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: nowrap;
  min-width: 0;
  font-size: 0.95rem;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(26, 26, 26, 0.06);
}

.nav-cta {
  background: var(--text);
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
}

.nav-cta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.06);
  font-size: 0.9rem;
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
}

.nav-user button {
  background: transparent;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 999px;
}

.login-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
  min-width: 220px;
}

.login-panel-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 12px;
}

/* Author `display: flex` beats the default for `[hidden]` in some browsers */
.login-panel-loading[hidden] {
  display: none !important;
}

.login-panel-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: global-search-spin 0.7s linear infinite;
}

.login-panel-form {
  display: grid;
  gap: 8px;
}

.login-panel-form input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.login-panel-form button {
  background: var(--text);
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  width: 100%;
}

.login-panel-forgot {
  background: transparent;
  color: var(--accent-dark);
  padding: 6px 0 0;
  border-radius: 0;
  text-align: center;
}

.login-panel-error {
  color: #b91c1c;
  font-size: 0.85rem;
}

.nav-search {
  width: max-content;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  left: auto;
}

.global-search-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.global-search-form .search-input {
  position: relative;
}

.global-search-form .search-input input {
  width: 38.5ch;
  padding: 5px 8px 5px 12px;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: 10px;
}

.global-search-input {
  flex: 0 0 auto;
  width: 38.5ch;
  padding: 5px 8px 5px 12px;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
}

.global-search-with-map {
  display: grid;
  gap: 24px;
}

.global-search-with-map .map-placeholder iframe {
  min-height: 280px;
  height: min(42vh, 360px);
}

.global-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.global-results h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.global-results-section > h4 {
  color: var(--accent-dark);
  font-weight: 700;
}

.global-results-section {
  display: grid;
  gap: 8px;
}

.global-results-section + .global-results-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

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

.global-result-card {
  cursor: pointer;
}

.global-results-section .result-phone {
  font-size: 0.9rem;
  color: var(--accent-dark);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.global-results-section .result-location {
  font-size: 0.9rem;
  color: var(--muted);
}

.global-results-section .result-distance {
  font-size: calc(0.85rem * 0.7 * 1.05);
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
  display: block;
  width: 100%;
  text-align: left;
}

.global-results-section .result-place-lines {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-top: 4px;
  width: 100%;
}

.global-search-loading {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-height: 120px;
  justify-content: center;
}

.global-search-loading .loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: global-search-spin 0.7s linear infinite;
}

.global-search-loading .loading-skeleton {
  width: 100%;
  max-width: 320px;
  display: grid;
  gap: 12px;
}

.global-search-loading .skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--border) 0%,
    #ebe8e3 50%,
    var(--border) 100%
  );
  background-size: 200% 100%;
  animation: global-search-skeleton 1.2s ease-in-out infinite;
}

.global-search-loading .skeleton-line.short {
  max-width: 60%;
}

.global-search-loading .skeleton-line.medium {
  max-width: 85%;
}

@keyframes global-search-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes global-search-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.nav-cta:focus-visible,
.primary:focus-visible,
.secondary:focus-visible,
.card-action:focus-visible,
.join-form button:focus-visible,
.search-bar button:focus-visible,
.stop-card button:focus-visible,
.auth-form button:focus-visible,
.auth-status button:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}

.hero {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(1.45rem, 4vw, 2.65rem);
  margin: 12px 0 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent-dark);
  font-weight: 600;
}

.subhead {
  color: var(--muted);
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.primary {
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.secondary {
  background: white;
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.forum-header-actions .secondary,
.forum-header-actions .primary {
  padding: 9px 18px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  color: var(--muted);
}

.hero-stats strong {
  display: block;
  font-size: 1.2rem;
  color: var(--text);
}

.hero-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-badges {
  display: flex;
  gap: 12px;
}

.app-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f1ede6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.app-button {
  text-align: center;
}

.app-home-search-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.app-home-search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
}

.app-home-search-form button {
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
}

.app-home-search-form button.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.95;
}

.app-home-search-form button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: global-search-spin 0.7s linear infinite;
}


.card-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

.card-body ul {
  margin-top: 12px;
  list-style: disc;
  padding-left: 20px;
  color: var(--muted);
}

.card-action {
  align-self: flex-start;
  background: var(--text);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
}

.section {
  padding: 20px 6vw;
}

.section-copy {
  max-width: 640px;
  margin-bottom: 32px;
}

.section-copy h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 12px 0 14px;
}

.community {
  background: var(--surface);
}

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

.community-grid article,
.features-grid article {
  background: #f8f6f2;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
}

.forum-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.forum-grid.single-column {
  grid-template-columns: 1fr;
}

.forum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.forum-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.forum-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.forum-search-form input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  min-width: 140px;
}

.forum-search-form button {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}

.forum-items {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.forum-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 140px;
  margin-top: 16px;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.forum-loading[hidden] {
  display: none !important;
}

.forum-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: global-search-spin 0.7s linear infinite;
}

.forum-loading-text {
  text-align: center;
}

.forum-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.forum-page-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
  color: var(--text);
}

.forum-page-btn:hover {
  background: #ebe8e2;
}

.forum-page-info {
  font-size: 0.9rem;
  color: var(--muted);
}

.forum-item {
  padding: 0px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.forum-item.expanded {
  border-color: #d6d1c6;
  background: transparent;
}

.forum-item-header {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
}

.forum-item h4 {
  margin-bottom: 4px;
}

.forum-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

.forum-detail-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}

.forum-comments {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  padding-left: 20px;
}

.forum-verify-hint {
  margin-top: 14px;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.forum-comment-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-left: 20px;
  flex-wrap: wrap;
}

.comment-page-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}

.comment-page-btn:hover {
  background: #ebe8e2;
}

.forum-item-details {
  margin-top: 12px;
}

.forum-item-details p {
  margin-top: 8px;
}

.forum-description {
  margin-left: 10px;
  font-style: italic;
}

.forum-open-hint {
  margin: 8px 0 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--accent-dark);
  font-weight: 600;
  font-style: italic;
}

.forum-open-hint-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}

.forum-item.expanded .forum-open-hint {
  color: var(--muted);
}

.forum-item.expanded .forum-open-hint-icon {
  transform: rotate(180deg);
}

.forum-item-details .filter-note {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a4a4a;
  margin-left: 10px;
}

.forum-comment {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 0.95rem;
}

.forum-comment-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.forum-comment-meta {
  flex: 1;
  min-width: 0;
}

.forum-comment-date {
  margin: 4px 0 0;
  font-size: 0.85em;
  color: var(--muted);
  line-height: 1.3;
}

.forum-comment-date em {
  font-style: italic;
}

.forum-report {
  margin-left: auto;
  font-size: 0.7em;
  font-style: italic;
  color: var(--muted);
  background: transparent;
  padding: 0 5px 0 0;
}



.forum-form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.forum-form[hidden] {
  display: none !important;
}

.forum-form input,
.forum-form textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font: inherit;
}

.forum-form button {
  background: var(--text);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
}

.forum-comment-inline textarea,
.forum-comment-inline button {
  width: 30%;
  margin-left: auto;
  font-size: 0.7rem;
  padding: 6px 13px 6px 8px;
  padding-right: 13px;
  margin-right: 5px;
}

.forum-comment-inline button {
  width: 9%;
  margin-bottom: 5px;
}

.forum-header-actions .primary,
.forum-header-actions .secondary {
  font-size: 0.84rem;
  padding: 7px 10px;
  border-radius: 10px;
  height: auto;
}

.btn-forum-size {
  font-size: 0.84rem;
  padding: 7px 10px;
  border-radius: 10px;
}

.forum-comment-inline button {
  font-size: 0.7rem;
  padding: 6px 8px;
}

.forum-create {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  background: #f8f6f2;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 15, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 20px;
}

.modal[hidden] {
  display: none !important;
}

.modal-content {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  width: min(540px, 100%);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
}

.truckstop-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  background: var(--surface);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.assistant-panel {
  margin-top: 18px;
  background: #fff3e7;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  display: grid;
  gap: 12px;
}

.assistant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.assistant-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
}

.assistant-form button {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
}

.assistant-result {
  color: var(--muted);
  font-size: 0.92rem;
}

.recommendations {
  margin-top: 24px;
}

.driver-auth-hint {
  margin: 18px 0;
  padding: 16px;
  background: #fff3e7;
  border-radius: 16px;
}

.driver-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.driver-card .driver-cv-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
}

.report-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.report-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.report-reason {
  font-size: 0.9rem;
  color: var(--text);
}

.panel-column h3 {
  margin-bottom: 12px;
}

.filter-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.search-bar {
  margin: 24px 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.driver-search-bar {
  margin: 24px 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tyre-search-bar {
  margin: 24px 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.spares-search-bar {
  margin: 0 0 24px 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  align-items: center;
  max-width: 50%;
}

.spares-search-bar .search-input {
  position: relative;
}

.spares-search-bar .search-input input {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: 10px;
}

.search-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
}

.search-autocomplete-option {
  padding: 10px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-autocomplete-option:last-child {
  border-bottom: none;
}

.search-autocomplete-option:hover,
.search-autocomplete-option:focus {
  background: #f5f3ef;
  outline: none;
}

.spares-search-bar button {
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 10px;
  max-width: 50%;
}

.search-input input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
}

.search-bar button {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
}

.driver-search-bar button {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
}

.tyre-search-bar button {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
}

.spares-search-bar button {
  background: var(--text);
  color: white;
}

.filter-tags {
  display: grid;
  gap: 10px;
}

.filter-tags label {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff3e7;
  color: var(--accent-dark);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-tags input {
  accent-color: var(--accent-dark);
}

.saved-list {
  list-style: none;
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.saved-list strong {
  display: block;
  color: var(--text);
}

.map-placeholder {
  border-radius: 16px;
  border: 1px dashed var(--border);
  padding: 18px;
  min-height: 140px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  background: #fbfaf7;
}

.map-placeholder iframe {
  width: 100%;
  height: 180px;
  border: 0;
  border-radius: 12px;
}

.map-caption {
  font-size: 0.9rem;
  color: var(--muted);
}

.results {
  margin-top: 32px;
}


.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.results-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.results-count-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  font-weight: 600;
}

.results-count-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(231, 123, 42, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: global-search-spin 0.7s linear infinite;
}

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

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

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

.results-empty {
  margin-top: 12px;
  color: var(--muted);
}

.results-paging {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.results-paging .paging-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.results-paging .paging-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.results-paging .paging-btn:hover:not(:disabled) {
  background: #f1ede6;
}

.results-paging .paging-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stop-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.stop-card h4,
.stop-card p,
.global-result-card h4,
.global-results-section .result-location {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stop-card h4,
.global-result-card h4 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-card > p {
  margin: 0;
}

/* Tighten address + km: grid row gap alone is enough without extra “blank” line */
.stop-card > p + .stop-distance {
  margin-top: -8px;
}

.stop-card a {
  color: var(--accent-dark);
  font-size: 0.9rem;
}

.stop-card > a {
  justify-self: end;
}

.stop-card.tyre-card > span,
.stop-card.spares-card > span,
.stop-card.mechanic-card > span {
  justify-self: end;
  text-align: right;
}

.stop-phone-link {
  font-weight: 500;
}

.stop-distance {
  font-size: calc(0.7em * 1.05);
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
  margin: 0;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.stop-card button {
  justify-self: start;
  background: #f1ede6;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
}

.stop-card.saved button {
  background: var(--accent);
  color: white;
}

.features {
  background: linear-gradient(180deg, #f7f5f1 0%, #ffffff 100%);
}

.account {
  background: var(--surface);
}

.auth-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.auth-card {
  background: #f8f6f2;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  display: grid;
  gap: 16px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form input,
.auth-form select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
}

.auth-form textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font: inherit;
  resize: vertical;
}

.auth-form button {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
}

#contact-team-form button[type="submit"][aria-busy="true"] {
  min-width: 9.5rem;
}

#contact-team-form .contact-send-btn-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#contact-team-form .contact-send-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: global-search-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.join-account .auth-grid {
  grid-template-columns: 1fr;
  max-width: 520px;
  margin-inline: auto;
}

.join-register-card {
  position: relative;
}

.register-form-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(3px);
  border-radius: 16px;
}

.register-form-loading[hidden] {
  display: none !important;
}

.register-form-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: global-search-spin 0.7s linear infinite;
}

.register-form-loading__text {
  margin: 0;
  max-width: 14rem;
  line-height: 1.35;
}

.join-account .auth-form button {
  justify-self: end;
}

.register-supplier-wrap {
  display: none;
  gap: 6px;
}

.register-supplier-wrap.visible {
  display: grid;
}

.register-supplier-wrap label {
  font-size: 0.9rem;
  color: var(--muted);
}

#register-supplier-focus-wrap {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.register-cv-wrap {
  display: none;
  gap: 6px;
}

.register-cv-wrap.visible {
  display: grid;
}

.register-cv-wrap label {
  font-size: 0.9rem;
  color: var(--muted);
}

.register-cv-wrap input[type="file"] {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font-size: 0.9rem;
}

.profile-card h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.profile-details {
  margin: 0;
}

.profile-details dt {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 12px;
}

.profile-details dt:first-child {
  margin-top: 0;
}

.profile-details dd {
  margin: 4px 0 0 0;
}

.profile-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.profile-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.profile-cv-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-cv-cell[hidden],
.profile-cv-upload[hidden] {
  display: none !important;
}

.profile-cv-cell .profile-cv-link {
  color: var(--accent);
  font-weight: 500;
}

.profile-cv-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.profile-cv-upload input[type="file"] {
  font-size: 0.9rem;
}

.profile-cv-upload button {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 500;
  cursor: pointer;
}

.profile-cv-error {
  color: var(--error, #c00);
  font-size: 0.85rem;
  width: 100%;
}

.profile-address-dd .profile-address-form {
  display: grid;
  gap: 8px;
  max-width: 100%;
}

.profile-address-dd .profile-address-form input[type="text"],
.profile-address-dd .profile-address-form select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-size: 0.95rem;
}

.profile-address-save {
  justify-self: start;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
}

.profile-address-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-status button {
  background: #f1ede6;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
}

.join {
  padding-bottom: 96px;
}

.join-card {
  background: var(--text);
  color: white;
  border-radius: 24px;
  padding: 32px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
}

.join-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.join-form input {
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  min-width: 240px;
}

.join-form button {
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
}

.site-footer {
  padding: 36px 6vw 48px;
  display: grid;
  gap: 16px;
  background: #11110f;
  color: #f7f5f1;
}

.site-footer .brand-mark {
  background: white;
  color: #11110f;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footnote {
  color: rgba(247, 245, 241, 0.7);
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 8px);
  background: var(--text);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.toast--centered {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -46%);
  max-width: min(90vw, 360px);
  text-align: center;
}

.toast.toast--centered.show {
  transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stats {
    gap: 16px;
  }

  .join-card {
    text-align: left;
  }

  .results-header {
    align-items: flex-start;
  }
}

/* Native shell: hide old login chip; use slide-out menu + Sign in / Log out instead */
.native-app #nav-user {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.native-app .native-app-menu-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.06);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.native-app .native-app-menu-bars {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
}

.native-app .native-app-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(26, 26, 26, 0.45);
}

/* `display:flex` above would beat the HTML `hidden` attribute; force closed state */
.native-app .native-app-menu-backdrop[hidden],
.native-app .native-app-menu-panel[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.native-app .native-app-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(340px, 92vw);
  height: 100%;
  max-height: 100dvh;
  background: var(--surface);
  box-shadow: -8px 0 32px rgba(26, 26, 26, 0.15);
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px
    calc(18px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  border-left: 1px solid var(--border);
}

.native-app .native-app-menu-links-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.native-app .native-app-menu-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.native-app .native-app-menu-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.native-app .native-app-menu-close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.06);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text);
}

.native-app .native-app-menu-linklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
  padding: 0;
}

.native-app .native-app-menu-linklist a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid transparent;
}

.native-app .native-app-menu-linklist a:hover,
.native-app .native-app-menu-linklist a:focus-visible {
  background: rgba(26, 26, 26, 0.05);
  border-color: var(--border);
}

.native-app .native-app-menu-auth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.native-app .native-app-menu-auth .primary,
.native-app .native-app-menu-auth .secondary {
  width: auto;
  max-width: 100%;
  align-self: flex-start;
  box-sizing: border-box;
}

.native-app .native-app-menu-user {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  padding: 4px 2px 0;
}

.native-app .native-app-login-slot {
  flex-shrink: 0;
}

.native-app .native-app-login-slot .login-panel,
.native-app .login-panel.login-panel--native-menu {
  position: static !important;
  right: auto !important;
  top: auto !important;
  margin-top: 4px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-shadow: none;
  border: 1px solid var(--border);
}

body.native-app-menu-open {
  overflow: hidden;
}

.native-app .site-header {
  box-sizing: border-box;
  padding-top: max(28px, calc(env(safe-area-inset-top, 0px) + 16px));
  padding-left: max(5vw, calc(env(safe-area-inset-left, 0px) + 12px));
  padding-right: max(5vw, calc(env(safe-area-inset-right, 0px) + 12px));
}

.native-app .nav {
  /* Override mobile `.nav { flex-direction: column }` so brand + menu stay one row on every native screen */
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: max(6px, env(safe-area-inset-top, 0px));
  z-index: 30;
  background: #f7f5f1;
  padding: 8px 10px;
  border-radius: 14px;
}

/* Wide fixed `ch` input + `right:0` max-content box overflows left on narrow WebViews (e.g. global search). */
.native-app .nav-search {
  left: 0;
  right: 0;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.native-app .global-search-form {
  width: 100%;
  max-width: 100%;
  justify-content: stretch;
}

.native-app .global-search-form .search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.native-app .global-search-form .search-input input,
.native-app .global-search-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.native-app .brand {
  min-width: 0;
}

.native-app .brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-app .nav-links {
  display: none !important;
}

.native-app .site-footer {
  display: none !important;
}

/* Native: make forum controls breathe instead of squeezing into one line. */
.native-app .forum-header {
  flex-direction: column;
  align-items: stretch;
}

.native-app .forum-header-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.native-app .forum-search-form {
  flex: 1 1 100%;
  width: 100%;
}

.native-app .forum-search-form input {
  width: 100%;
  min-width: 0;
}

.native-app .forum-native-search-btn,
.native-app .forum-header-actions .secondary,
.native-app .forum-header-actions .primary {
  flex: 0 0 auto;
}

.native-app .forum-native-search-btn {
  min-width: 84px;
  order: 3;
  margin-left: auto;
}

.native-app .forum-header-actions #open-forum-modal {
  order: 2;
  margin-left: 0;
}

.native-app .forum-comment-inline textarea {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  font-size: 0.88rem;
}

.native-app .forum-comment-inline button {
  width: auto;
  min-width: 72px;
  margin-left: auto;
  margin-right: 0;
  font-size: 0.85rem;
  padding: 8px 12px;
}

/* iOS WebView zooms focused fields smaller than 16px. */
.native-app input,
.native-app textarea,
.native-app select {
  font-size: 16px !important;
}

/* Hide install/download prompts when already inside native app shells. */
.native-app .app-badges,
.native-app .app-badge,
.native-app .app-button {
  display: none !important;
}

/* Native WebView: avoid double-tap zoom while keeping normal scrolling/taps. */
.native-app,
.native-app body,
.native-app .site-header {
  touch-action: manipulation;
}

.native-app main {
  touch-action: manipulation;
  max-width: 100%;
  box-sizing: border-box;
}

/* Hero grid min column (280px) can exceed narrow WebView widths and cause horizontal scroll. */
.native-app .hero {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
}

.native-app .hero-copy {
  min-width: 0;
  max-width: 100%;
}

/* Native join/register: keep the form and address field within the viewport. */
.native-app .join-account {
  padding-left: max(16px, calc(env(safe-area-inset-left, 0px) + 12px));
  padding-right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  box-sizing: border-box;
  max-width: 100%;
}

.native-app .join-account .auth-grid {
  max-width: min(520px, 100%);
}

.native-app .join-register-card,
.native-app .join-account .auth-form {
  min-width: 0;
}

.native-app .join-account .auth-form input,
.native-app .join-account .auth-form select,
.native-app .join-account .auth-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.native-app .join-account .search-input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.native-app .join-account .register-cv-wrap input[type="file"] {
  max-width: 100%;
  box-sizing: border-box;
}

/* Google Places dropdown is on body; prevent it from widening the scroll width. */
body.native-app .pac-container {
  max-width: calc(
    100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 24px
  );
  box-sizing: border-box;
}

.native-app .hero-card {
  display: none;
}

.native-app.home-page .site-header {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.native-app.home-page main {
  display: none;
}

.native-app.home-page .hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  gap: 0;
}

.native-app.home-page .hero-copy,
.native-app.home-page .hero-card {
  display: none;
}

.native-app.home-page .app-home-native-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: min(640px, 100%);
}

.native-app.home-page .app-home-center-brand {
  display: flex;
  justify-content: center;
}

.native-app.home-page .app-home-hero-truck {
  width: min(340px, 90vw);
  max-height: min(240px, 38vh);
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 14px 28px rgba(26, 26, 26, 0.12));
}

.native-app.home-page .app-home-search {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 8px;
  box-shadow: none;
  padding: 10px 6px;
}

.native-app.home-page .app-home-search .eyebrow {
  text-align: center;
}

.native-app.home-page .app-home-search h1 {
  margin: 10px 0 0;
  font-size: clamp(1.4rem, 5vw, 2rem);
}

@media (max-width: 768px) {
  .native-app.home-page .site-header {
    padding-top: max(24px, calc(env(safe-area-inset-top, 0px) + 14px));
    padding-left: max(14px, calc(env(safe-area-inset-left, 0px) + 10px));
    padding-right: max(14px, calc(env(safe-area-inset-right, 0px) + 10px));
    padding-bottom: 22px;
  }

  .native-app.home-page .nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .native-app.home-page .nav-search {
    display: none !important;
  }

  .native-app.home-page .nav-cta-stack {
    width: auto;
  }

  .native-app.home-page .app-home-hero-truck {
    width: min(360px, 92vw);
    max-height: min(260px, 40vh);
  }

  .native-app.home-page .app-home-native-root {
    gap: 18px;
  }

  .native-app.home-page .app-home-search {
    padding: 8px 4px;
    border-radius: 6px;
  }

  .native-app.home-page .app-home-search-form {
    flex-direction: column;
  }

  .native-app.home-page .app-home-search-form button {
    width: 50%;
    align-self: center;
    box-sizing: border-box;
  }
}

#mechanics-search {
  width: 100%;
}

.spares-search-bar #mechanics-search {
  width: 100%;
}

/* Native directory pages: make search input ~30% wider than current split. */
.native-app .spares-search-bar {
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  max-width: none;
}

.native-app .spares-search-bar button {
  max-width: none;
}

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

