/* Error handling, offline banner, toasts, fallbacks */
.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 10000;
}
.skip-link:focus {
  left: 12px;
}
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #7c2d12;
  color: #fff;
  padding: 10px 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  animation: toastIn .22s ease-out;
  font-weight: 600;
  line-height: 1.45;
}
.toast button {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.18);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
  flex: 0 0 auto;
}
.toast-error { background: #b42318; }
.toast-warning { background: #b45309; }
.toast-success { background: #067647; }
.toast-info { background: var(--primary); }
.toast-hide { opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.image-fallback-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px dashed var(--primary-light);
  background:
    repeating-linear-gradient(45deg, rgba(0,119,182,.08) 0 8px, rgba(144,224,239,.14) 8px 16px),
    linear-gradient(135deg, #f7fafc, #fdf8f1);
  color: var(--primary-dark);
  text-align: center;
  padding: 24px;
  font-weight: 800;
}
.image-fallback-placeholder small {
  color: var(--text-muted);
  font-weight: 600;
}
.error-hero {
  overflow: hidden;
}
.error-layout {
  display: grid !important;
  grid-template-columns: .7fr 1.3fr;
  align-items: center;
  gap: 32px;
}
.error-code {
  font-family: 'Fraunces', serif;
  font-size: clamp(5rem, 18vw, 12rem);
  font-weight: 900;
  line-height: .9;
  color: rgba(0,119,182,.12);
  text-shadow: 0 16px 50px rgba(0,119,182,.08);
}
.error-copy p {
  max-width: 720px;
}
.error-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.error-search-card {
  max-width: 760px;
  margin: 0 auto;
}
.error-search-card p {
  color: var(--text-muted);
  margin-bottom: 18px;
}
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.quick-link-card {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.quick-link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
  color: var(--text);
}
.quick-link-card strong {
  color: var(--primary-dark);
}
.quick-link-card span {
  color: var(--text-muted);
  font-size: .92rem;
}
.api-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  margin-bottom: 22px;
}
.api-alert svg,
.api-alert i {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: #b45309;
  margin-top: 2px;
}
.api-alert strong {
  display: block;
  margin-bottom: 4px;
}
.py-lg {
  padding-top: 64px;
  padding-bottom: 64px;
}
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 100px;
  padding: 12px 20px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
@media (max-width: 760px) {
  .error-layout {
    grid-template-columns: 1fr;
  }
  .error-code {
    font-size: 5rem;
  }
  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}