/* ==================================================================
   Aussie Gateway Logistics: core stylesheet

   1.  Design tokens
   2.  Reset and base
   3.  Layout helpers
   4.  Logo
   5.  Buttons
   6.  Forms
   7.  Cards, badges, alerts
   8.  Header and navigation
   9.  Footer
   10. Homepage
   11. Track page (summary, stepper, timeline)
   12. Auth pages
   13. Dashboard
   14. Skeletons and empty states
   15. Toasts and dialogs
   16. Motion preferences
   ================================================================== */

/* ------------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------------ */
:root {
  /* Colour */
  --color-bg: #FFFFFF;
  --color-surface: #FAFAF9;
  --color-surface-strong: #F4F4F2;
  --color-border: #ECECEC;
  --color-border-strong: #DDDDDA;
  --color-text: #111111;
  --color-text-secondary: #6B6B6B;
  --color-text-tertiary: #9B9B98;
  --color-accent: #F26B1D;
  --color-accent-hover: #D9580F;
  --color-accent-tint: #FFF3EB;
  --color-accent-ring: rgba(242, 107, 29, 0.22);
  /* Buttons: solid charcoal, square corners */
  --color-ink: #17191C;
  --color-ink-hover: #33363B;

  --color-success: #1C7343;
  --color-success-tint: #EEF7F1;
  --color-warning: #8A6510;
  --color-warning-tint: #FBF6E8;
  --color-warning-border: #EFE0B8;
  --color-danger: #B42318;
  --color-danger-hover: #951D13;
  --color-danger-tint: #FEF3F2;

  /* Spacing (8px scale, with 4px and 12px half steps) */
  --space-0-5: 4px;
  --space-1: 8px;
  --space-1-5: 12px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;

  /* Shape and depth */
  --radius: 12px;
  --radius-control: 4px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.1);

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 200ms;
  --dur: 300ms;
  --dur-slow: 400ms;

  /* Layout */
  --container: 1120px;
  --header-h: 68px;
}

/* ------------------------------------------------------------------
   2. Reset and base
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-2));
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

p {
  margin: 0;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

::selection {
  background: var(--color-accent-tint);
  color: var(--color-text);
}

.icon {
  flex-shrink: 0;
  display: block;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 100;
  padding: var(--space-1) var(--space-2);
  background: var(--color-text);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-1);
}

/* ------------------------------------------------------------------
   3. Layout helpers
   ------------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

@media (min-width: 720px) {
  .container {
    padding: 0 var(--space-4);
  }
}

.section {
  padding: var(--space-6) 0;
}

@media (min-width: 900px) {
  .section {
    padding: 72px 0;
  }
}

.section-surface {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.section-head {
  max-width: 560px;
  margin-bottom: var(--space-4);
}

.section-head h2 {
  margin-top: var(--space-1-5);
  font-size: clamp(1.625rem, 3.5vw, 2.25rem);
  letter-spacing: -0.03em;
}

.section-head p {
  margin-top: var(--space-1-5);
  color: var(--color-text-secondary);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.tracking-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 600;
}

/* ------------------------------------------------------------------
   4. Logo
   ------------------------------------------------------------------ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
}

.logo-mark {
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.logo-sub {
  margin-top: 4px;
  font-size: 0.59rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* ------------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.btn-secondary {
  background: var(--color-bg);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #C9C9C6;
  background: var(--color-surface);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-strong);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-danger-hover);
}

.btn-danger-outline {
  background: var(--color-bg);
  border-color: #F1D0CD;
  color: var(--color-danger);
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--color-danger-tint);
}

.btn-sm {
  min-height: 36px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
}

.btn-lg {
  min-height: 52px;
  padding: 0 var(--space-4);
  font-size: var(--text-base);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.btn-icon:hover {
  background: var(--color-surface-strong);
  color: var(--color-text);
}

.btn-icon.is-copied {
  color: var(--color-accent);
}

.btn-google {
  background: var(--color-bg);
  border-color: var(--color-border-strong);
  color: var(--color-text);
  font-weight: 500;
}

.btn-google:hover:not(:disabled) {
  background: var(--color-surface);
  border-color: #C9C9C6;
}

/* Three small dots used while a button is busy. */
.btn-loading-dots {
  display: inline-flex;
  gap: 3px;
}

.btn-loading-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: dot-fade 900ms ease-in-out infinite;
}

.btn-loading-dots i:nth-child(2) { animation-delay: 150ms; }
.btn-loading-dots i:nth-child(3) { animation-delay: 300ms; }

@keyframes dot-fade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ------------------------------------------------------------------
   6. Forms
   ------------------------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.field-label .optional {
  font-weight: 400;
  color: var(--color-text-tertiary);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.textarea {
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}

.select {
  padding-right: 40px;
  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='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-tertiary);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #C9C9C6;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: var(--color-danger);
}

.input.is-invalid:focus,
.select.is-invalid:focus,
.textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15);
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.field-error {
  font-size: var(--text-sm);
  color: var(--color-danger);
}

.field-error:empty {
  display: none;
}

.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
}

.password-toggle:hover {
  color: var(--color-text);
}

.form-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.form-alert .icon {
  margin-top: 1px;
}

.form-alert-error {
  background: var(--color-danger-tint);
  color: var(--color-danger);
  border: 1px solid #F6D4D0;
}

.form-alert-success {
  background: var(--color-success-tint);
  color: var(--color-success);
  border: 1px solid #CFE8D8;
}

/* Large tracking input used on the homepage, track page and dashboard */
.track-form {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.track-form:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-ring), var(--shadow-md);
}

.track-form.has-error {
  border-color: var(--color-danger);
}

.track-form-icon {
  display: none;
  padding-left: 10px;
  color: var(--color-text-tertiary);
}

.track-form input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  /* Dark text even inside the white-text photo hero. */
  color: var(--color-text);
  caret-color: var(--color-accent);
}

.track-form input::placeholder {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text-tertiary);
}

.track-form input:focus {
  outline: none;
}

.track-form .btn {
  min-height: 48px;
  padding: 0 var(--space-4);
  border-radius: 3px;
}

.track-form-error {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-danger);
  min-height: 0;
}

.track-form-error:empty {
  display: none;
}

.track-form-compact {
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  padding: 4px;
}

.track-form-compact input {
  height: 42px;
}

.track-form-compact .btn {
  min-height: 42px;
}

@media (min-width: 560px) {
  .track-form-icon {
    display: block;
  }

  .track-form input {
    height: 56px;
    font-size: var(--text-lg);
  }

  .track-form .btn {
    min-height: 56px;
    padding: 0 var(--space-4);
  }

  .track-form-compact input {
    height: 44px;
    font-size: var(--text-base);
  }

  .track-form-compact .btn {
    min-height: 44px;
    padding: 0 var(--space-3);
  }
}

/* ------------------------------------------------------------------
   7. Cards, badges, alerts
   ------------------------------------------------------------------ */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: var(--space-3);
}

@media (min-width: 720px) {
  .card-pad {
    padding: var(--space-4);
  }
}

.card-title {
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-neutral {
  background: var(--color-surface-strong);
  color: #4A4A48;
}

.badge-progress {
  background: var(--color-accent-tint);
  color: var(--color-accent-hover);
}

.badge-success {
  background: var(--color-success-tint);
  color: var(--color-success);
}

.badge-hold {
  background: var(--color-warning-tint);
  color: var(--color-warning);
  box-shadow: inset 0 0 0 1px var(--color-warning-border);
}

.badge-lg {
  padding: 6px 14px;
  font-size: var(--text-sm);
}

.notice {
  display: flex;
  gap: var(--space-1-5);
  align-items: flex-start;
  padding: var(--space-2);
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.notice-hold {
  background: var(--color-warning-tint);
  border: 1px solid var(--color-warning-border);
  color: #5E4508;
}

.notice-hold .icon {
  color: var(--color-warning);
  margin-top: 1px;
}

.notice strong {
  display: block;
  color: var(--color-text);
  font-weight: 600;
}

/* ------------------------------------------------------------------
   8. Header and navigation
   ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out);
}

.site-header.is-scrolled,
.site-header.is-menu-open {
  border-bottom-color: var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
}

.site-nav {
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
  padding: var(--space-1) var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
}

.site-header.is-menu-open .site-nav {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.nav-group {
  display: none;
  flex-direction: column;
  gap: var(--space-0-5);
}

/* Show the right nav items once Firebase reports the auth state. */
.auth-guest .nav-group[data-when='guest'],
.auth-user .nav-group[data-when='user'] {
  display: flex;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-1-5);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.nav-link:hover,
.nav-link[aria-current='page'] {
  color: var(--color-text);
}

.nav-button {
  border: 0;
  background: transparent;
  text-align: left;
}

.site-nav .btn {
  margin-top: var(--space-1);
}

@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: var(--space-0-5);
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .nav-group {
    flex-direction: row;
    align-items: center;
    gap: var(--space-0-5);
  }

  .nav-link {
    min-height: 40px;
  }

  .nav-link:hover {
    background: var(--color-surface-strong);
  }

  .site-nav .btn {
    margin: 0 0 0 var(--space-1);
  }
}

/* ------------------------------------------------------------------
   9. Footer
   ------------------------------------------------------------------ */
.site-footer {
  margin-top: auto;
  padding: var(--space-8) 0 var(--space-4);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.footer-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1.4fr;
    gap: var(--space-6);
  }
}

.footer-tagline {
  margin-top: var(--space-2);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.015em;
}

.footer-small {
  margin-top: var(--space-1);
  max-width: 300px;
}

.footer-heading {
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
}

.footer-links,
.footer-contact {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5);
}

.footer-links a,
.footer-contact a {
  transition: color var(--dur-fast) var(--ease-out);
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--color-text);
}

.footer-contact li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

.footer-contact .icon {
  margin-top: 2px;
  color: var(--color-text-tertiary);
}

.footer-contact a {
  word-break: break-word;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
}

@media (min-width: 720px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ------------------------------------------------------------------
   10. Homepage
   ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding: var(--space-8) 0 var(--space-10);
  text-align: center;
  overflow: hidden;
}

@media (min-width: 900px) {
  .hero {
    padding: var(--space-12) 0 120px;
  }
}

/* A faint, fading line grid that hints at a route network. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--color-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 10%, transparent 70%);
  opacity: 0.6;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-tint);
}

.hero h1 {
  max-width: 780px;
  margin: var(--space-3) auto 0;
  font-size: clamp(2.25rem, 7.5vw, 4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero-lead {
  max-width: 520px;
  margin: var(--space-2) auto 0;
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
}

.hero-form {
  max-width: 640px;
  margin: var(--space-5) auto 0;
  text-align: left;
}

.hero-hint {
  margin-top: var(--space-1-5);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  text-align: center;
}

/* Photo hero: full-width image with a dark overlay for legibility. */
.hero-photo {
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 440px;
  padding: var(--space-6) 0;
  color: #fff;
  background: #0B2A3F;
}

@media (min-width: 900px) {
  .hero-photo {
    min-height: 470px;
    padding: var(--space-8) 0;
  }
}

.hero-photo::before {
  display: none;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  animation: hero-settle 1200ms var(--ease-out) both;
}

/* Darker at the top and bottom, lighter through the middle. */
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 45%, rgba(6, 18, 28, 0.55) 0%, rgba(6, 18, 28, 0) 100%),
    linear-gradient(180deg, rgba(6, 18, 28, 0.5) 0%, rgba(6, 18, 28, 0.3) 50%, rgba(6, 18, 28, 0.78) 100%);
}

@keyframes hero-settle {
  from { transform: scale(1.04); opacity: 0.6; }
  to { transform: scale(1); opacity: 1; }
}

.hero-photo .container {
  position: relative;
}

.hero-photo h1 {
  margin-top: var(--space-2);
  max-width: 680px;
  font-size: clamp(2.125rem, 6vw, 3.5rem);
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.hero-photo .hero-lead {
  margin-top: var(--space-1-5);
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* Phones: the ship sits behind the text, so deepen the overlay. */
@media (max-width: 719px) {
  .hero-media::after {
    background: linear-gradient(180deg, rgba(6, 18, 28, 0.55) 0%, rgba(6, 18, 28, 0.62) 50%, rgba(6, 18, 28, 0.78) 100%);
  }
}

.hero-photo .hero-form {
  margin-top: var(--space-4);
}



.hero-photo .track-form {
  border-color: transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 20px 48px rgba(0, 0, 0, 0.28);
}

.hero-photo .track-form:focus-within {
  box-shadow: 0 0 0 4px rgba(242, 107, 29, 0.45), 0 20px 48px rgba(0, 0, 0, 0.28);
}

.hero-photo .track-form-error {
  color: #FFC2B8;
  text-align: center;
}

.hero-photo .hero-hint {
  color: rgba(255, 255, 255, 0.7);
}

.hero-photo .hero-hint {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}



/* How it works: a plain grid, no boxes, lines or icons */
.steps {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: var(--space-1);
  align-items: start;
  align-content: start;
}

.step-num {
  grid-row: span 2;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
}

.step-item h3 {
  font-size: var(--text-lg);
}

.step-item p {
  margin-top: var(--space-1);
  max-width: 340px;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

@media (min-width: 820px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }

  .step-item {
    grid-template-columns: 64px 1fr;
  }

  .step-num {
    font-size: 2.25rem;
  }
}

/* Photo row: three captioned photos, no icons */
.section-tight {
  padding-top: 0;
}

.section-head-row {
  max-width: none;
}

@media (min-width: 900px) {
  .section-head-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: end;
  }

  .section-head-row p {
    margin-top: 0;
  }
}

.journey {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .journey {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
  }
}

.journey figure {
  margin: 0;
}

.journey-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-surface-strong);
}

.journey-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.journey-item:hover .journey-media img {
  transform: scale(1.03);
}

/* Keep faces and the van in frame when cropped to 4:3 */
.journey-item:nth-child(1) img { object-position: 40% 30%; }
.journey-item:nth-child(2) img { object-position: 60% 50%; }
.journey-item:nth-child(3) img { object-position: 50% 35%; }

.journey figcaption {
  margin-top: var(--space-2);
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.journey-step {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

/* Network: van photo beside the hub and gateway lists */
.network {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 900px) {
  .network {
    grid-template-columns: 5fr 6fr;
    gap: var(--space-6);
    align-items: stretch;
  }
}

.van-feature {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 3;
  background: var(--color-surface-strong);
}

/* Desktop: the photo matches the height of the text column. */
@media (min-width: 900px) {
  .van-feature {
    aspect-ratio: auto;
    min-height: 420px;
  }
}

.van-feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 56%;
}

.network-body .section-head {
  margin-bottom: var(--space-4);
}

/* Service lines: text-only rows with a hairline between each */
.service-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--color-text);
}

.service-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 560px) {
  .service-list li {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-3);
    align-items: baseline;
  }
}

.service-list h3 {
  font-size: var(--text-base);
  letter-spacing: -0.015em;
}

.service-list p {
  margin-top: 4px;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

@media (min-width: 560px) {
  .service-list p {
    margin-top: 0;
  }
}

.service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1-5);
  margin-top: var(--space-4);
}

/* ------------------------------------------------------------------
   11. Track page
   ------------------------------------------------------------------ */
.page-top {
  padding: var(--space-4) 0 var(--space-8);
}

@media (min-width: 720px) {
  .page-top {
    padding: var(--space-6) 0 var(--space-10);
  }
}

.track-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

@media (min-width: 820px) {
  .track-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .track-toolbar .track-search {
    width: 420px;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}

.back-link:hover {
  color: var(--color-text);
}

.track-layout {
  display: grid;
  gap: var(--space-2);
}

@media (min-width: 720px) {
  .track-layout {
    gap: var(--space-3);
  }
}

/* Summary card */
.summary {
  display: grid;
  overflow: hidden;
}

@media (min-width: 900px) {
  .summary {
    grid-template-columns: 1fr 300px;
  }
}

.summary-main {
  padding: var(--space-3);
}

@media (min-width: 720px) {
  .summary-main {
    padding: var(--space-4);
  }
}

.summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.id-row {
  display: flex;
  align-items: center;
  gap: var(--space-0-5);
  margin-top: 4px;
}

.id-row .tracking-number {
  font-size: clamp(1.25rem, 4.5vw, 1.625rem);
  letter-spacing: -0.005em;
}

.route {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.route-point {
  flex: 1;
  min-width: 0;
}

.route-point:last-child {
  text-align: right;
}

.route-place {
  display: block;
  margin-top: 2px;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-line {
  flex: 0 1 140px;
  display: flex;
  align-items: center;
  color: var(--color-accent);
}

.route-line::before {
  content: '';
  flex: 1;
  height: 0;
  border-top: 2px dashed var(--color-border-strong);
  margin-right: 6px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-2);
  margin: var(--space-3) 0 0;
}

@media (min-width: 720px) {
  .meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.meta-grid dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.meta-grid dd {
  margin: 4px 0 0;
  font-weight: 500;
  word-break: break-word;
}

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

.summary-hold {
  margin-top: var(--space-3);
}

.summary-media {
  position: relative;
  min-height: 200px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

@media (min-width: 900px) {
  .summary-media {
    border-top: 0;
    border-left: 1px solid var(--color-border);
  }
}

.summary-media img {
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: cover;
}

@media (min-width: 900px) {
  .summary-media img {
    position: absolute;
    inset: 0;
    max-height: none;
  }
}

.media-placeholder {
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

/* Progress stepper (vertical on mobile, horizontal from 720px) */
.stepper {
  --steps: 6;
  --dot: 40px;
  --row: 64px;
  --progress: 0;
  position: relative;
}

.stepper-track {
  position: absolute;
  left: calc(var(--dot) / 2 - 1px);
  top: calc(var(--dot) / 2);
  bottom: calc(var(--row) - var(--dot) / 2);
  width: 2px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.stepper-fill {
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  transform: scaleY(var(--progress));
  transform-origin: top;
  transition: transform var(--dur) var(--ease-out);
}

.stepper-list {
  position: relative;
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  gap: var(--space-2);
  height: var(--row);
}

.step-dot {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  color: #B8B8B5;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.step-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  pointer-events: none;
}

.step-text {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  min-width: 0;
}

.step-label {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text-tertiary);
  transition: color var(--dur) var(--ease-out);
}

.step-date {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  line-height: 1.5;
}

.step.is-complete .step-dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.step.is-complete .step-label {
  color: var(--color-text);
}

.step.is-current .step-dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.step.is-current .step-label {
  color: var(--color-text);
  font-weight: 600;
}

.step.is-current .step-dot::after {
  animation: step-pulse 2.4s var(--ease-out) infinite;
}

@keyframes step-pulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 107, 29, 0.35); }
  70% { box-shadow: 0 0 0 10px rgba(242, 107, 29, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 107, 29, 0); }
}

/* Final stage reached: no pulse, it is done. */
.step.is-current.is-final .step-dot::after {
  animation: none;
}

/* On Hold: the stage it paused at shows a muted warning ring. */
.step.is-hold .step-dot {
  background: var(--color-warning-tint);
  border-color: #D9B860;
  color: var(--color-warning);
}

.step.is-hold .step-dot::after {
  animation: none;
  box-shadow: 0 0 0 4px var(--color-warning-tint);
}

.step.is-hold .step-label {
  color: var(--color-text);
  font-weight: 600;
}

.step-hold-tag {
  margin-top: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-warning);
}

@media (min-width: 720px) {
  .stepper-track {
    left: calc(100% / (var(--steps) * 2));
    right: calc(100% / (var(--steps) * 2));
    top: calc(var(--dot) / 2 - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
  }

  .stepper-fill {
    transform: scaleX(var(--progress));
    transform-origin: left;
  }

  .stepper-list {
    grid-template-columns: repeat(var(--steps), minmax(0, 1fr));
  }

  .step {
    height: auto;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1-5);
    text-align: center;
    padding: 0 4px;
  }

  .step-text {
    padding-top: 0;
    align-items: center;
  }

  .step-label {
    font-size: var(--text-sm);
  }
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.live-indicator .live-dot {
  animation: live-blink 2.4s ease-in-out infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Timeline */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Connecting line between markers */
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 2px;
  width: 2px;
  background: var(--color-border);
}

.timeline-marker {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-border-strong);
}

.timeline-item.is-latest .timeline-marker {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
  background: var(--color-accent);
}

.timeline-item.is-hold .timeline-marker {
  border-color: #D9B860;
  background: var(--color-warning-tint);
  box-shadow: none;
}

.timeline-item.is-new {
  animation: fade-up var(--dur-slow) var(--ease-out);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.timeline-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px var(--space-2);
}

.timeline-status {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.timeline-item.is-hold .timeline-status {
  color: var(--color-warning);
}

.timeline-time {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.timeline-location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.timeline-note {
  margin-top: var(--space-1);
  padding: 10px 12px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: #3A3A38;
}

/* Status-change flash on the summary badge */
.badge.is-changed {
  animation: badge-pop var(--dur-slow) var(--ease-out);
}

@keyframes badge-pop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ------------------------------------------------------------------
   12. Auth pages
   ------------------------------------------------------------------ */
.auth-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-5) var(--space-2) var(--space-8);
  background: var(--color-surface);
}

@media (min-width: 720px) {
  .auth-main {
    padding: var(--space-10) var(--space-2);
  }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-4) var(--space-3);
}

@media (min-width: 560px) {
  .auth-card {
    padding: var(--space-5);
  }
}

.auth-card h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.03em;
}

.auth-sub {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.auth-form .btn-primary {
  margin-top: var(--space-1);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-footer {
  margin-top: var(--space-3);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.text-link {
  font-weight: 600;
  color: var(--color-accent-hover);
  transition: color var(--dur-fast) var(--ease-out);
}

.text-link:hover {
  color: var(--color-text);
}

.text-link-quiet {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: 0;
  padding: 0;
}

.text-link-quiet:hover {
  color: var(--color-text);
}

.auth-note {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-align: center;
}

/* ------------------------------------------------------------------
   13. Dashboard
   ------------------------------------------------------------------ */
.dash-head {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

@media (min-width: 900px) {
  .dash-head {
    grid-template-columns: 1fr 460px;
    align-items: end;
  }
}

.dash-head h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  letter-spacing: -0.035em;
}

.dash-head p {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.section-label h2 {
  font-size: var(--text-lg);
}

.shipment-grid {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .shipment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .shipment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.shipment-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-3);
  transition: box-shadow var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.shipment-tile:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.shipment-tile.is-removing {
  opacity: 0;
  transform: scale(0.98);
}

/* Stretched link makes the whole card clickable. */
.tile-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.tile-link:focus-visible {
  outline: none;
}

.tile-link:focus-visible::after {
  box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-1);
}

.tile-remove {
  position: relative;
  z-index: 1;
  margin: -6px -8px 0 0;
}

.tile-dest {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.tile-dest .icon {
  color: var(--color-text-tertiary);
}

.tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.tile-meta .icon {
  color: var(--color-text-tertiary);
}

.tile-missing {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ------------------------------------------------------------------
   14. Skeletons and empty states
   ------------------------------------------------------------------ */
.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #F1F1EF 0%, #F8F8F7 45%, #F1F1EF 90%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  from { background-position: 110% 0; }
  to { background-position: -110% 0; }
}

.sk-line { height: 14px; }
.sk-title { height: 26px; }
.sk-badge { height: 26px; width: 110px; border-radius: var(--radius-pill); }
.sk-dot { width: 40px; height: 40px; border-radius: 50%; }
.sk-media { min-height: 200px; height: 100%; border-radius: 0; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-3);
}

.empty-state .icon-tile {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--color-surface-strong);
  color: var(--color-text-secondary);
}

.empty-state h2 {
  margin-top: 0;
  font-size: var(--text-xl);
  letter-spacing: -0.025em;
}

.empty-state p {
  max-width: 420px;
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
}

.empty-state .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.empty-state .track-form {
  width: 100%;
  max-width: 480px;
  margin-top: var(--space-3);
  text-align: left;
}

.fade-in {
  animation: fade-up var(--dur-slow) var(--ease-out);
}

/* ------------------------------------------------------------------
   15. Toasts and dialogs
   ------------------------------------------------------------------ */
.toast-region {
  position: fixed;
  z-index: 1000;
  left: var(--space-2);
  right: var(--space-2);
  bottom: var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  pointer-events: none;
}

@media (min-width: 720px) {
  .toast-region {
    left: auto;
    right: var(--space-3);
    bottom: var(--space-3);
    align-items: flex-end;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  width: 100%;
  padding: 12px 14px 12px 12px;
  background: var(--color-text);
  color: #fff;
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

@media (min-width: 720px) {
  .toast {
    width: auto;
  }
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(4px);
}

.toast-icon {
  display: inline-flex;
  color: var(--color-accent);
}

.toast-error .toast-icon {
  color: #FF9B8F;
}

.toast-message {
  flex: 1;
}

.toast-action {
  margin-left: var(--space-1);
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
}

.toast-action:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dialog {
  width: calc(100% - 32px);
  max-width: 480px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
}

.dialog-sm {
  max-width: 420px;
}

.dialog[open] {
  animation: dialog-in var(--dur) var(--ease-out);
}

.dialog::backdrop {
  background: rgba(17, 17, 17, 0.36);
  animation: backdrop-in var(--dur) var(--ease-out);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body:has(dialog[open]) {
  overflow: hidden;
}

.dialog-body {
  padding: var(--space-3) var(--space-3) var(--space-2);
}

.dialog-title {
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.dialog-text {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-3);
}

/* ------------------------------------------------------------------
   16. Motion preferences
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .skeleton {
    animation: none;
    background: #F1F1EF;
  }

  .step.is-current .step-dot::after {
    animation: none;
    box-shadow: 0 0 0 4px var(--color-accent-tint);
  }
}
