/* DSP portal — GoMobile tokens + shop motion language */

/* Lean invoice UI — hide leftover station chrome if any still in markup */
.radio-chatter,
.chase-strip,
.week-heat,
.day-progress,
.shift-chip,
.ops-ticker,
.sound-toggle,
.search-chips,
.dsp-crest,
.welcome-flavor,
.manifest-stamp,
.ticket-no {
  display: none !important;
}
body.gallery-open .photo-gal-head h2::before {
  content: none !important;
}

:root {
  --gold: #ffcc00;
  --gold-dim: #c9a000;
  --gold-soft: rgba(255, 204, 0, 0.14);
  --red: #ff2a2a;
  --navy: #1b2a4a;
  --bg: #0c0c0e;
  --panel: #1c1c1e;
  --panel2: #2c2c2e;
  --ink: #f5f5f7;
  --mute: #a1a1aa;
  --line: #3a3a42;
  --ok: #34c759;
  /*
   * Type stack — readable, not the usual Inter/DM Sans/JetBrains trio.
   * Lexend: designed for legibility (shop tablets / dark UI).
   * Sora: display/brand without Syne’s tight geometric squeeze.
   * IBM Plex Mono: clear plates / VINs / job #s, less “IDE default”.
   * Avoid non-standard weights (e.g. 650) — browsers faux-bold and look pixelated.
   */
  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  --font-brand: 'Sora', 'Lexend', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Menlo,
    Consolas, monospace;
  --r: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.25, 0.64, 1);
  --ease-bounce: cubic-bezier(0.34, 1.45, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  /* Type scale — prefer sizes that land on whole CSS pixels at 100% zoom */
  --text-xs: 0.75rem; /* 12px */
  --text-sm: 0.8125rem; /* 13px */
  --text-md: 0.9375rem; /* 15px */
  --text-base: 1rem; /* 16px */
  --text-lg: 1.125rem; /* 18px */
  --text-xl: 1.375rem; /* 22px */
  --leading: 1.5;
  --leading-tight: 1.3;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  /* Stop mobile browsers from “helpfully” inflating text into mush */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Hint: geometric precision for UI, not artistic blur */
  text-rendering: optimizeLegibility;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: var(--leading);
  /* Lexend reads cleaner with neutral tracking (DM Sans liked slight negative) */
  letter-spacing: 0.005em;
  font-optical-sizing: auto;
  font-synthesis: none; /* no faux bold/italic — looks pixelated */
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  /*
   * Dark UI: greyscale AA is correct. Subpixel on dark often looks dirty.
   * (Windows ClearType + scale transforms was the main “shitty” look.)
   */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* Soft top glow only — bottom-right ellipse was painting a hard “solid band”
     above Beeps On when background-position animated */
  background:
    radial-gradient(ellipse 80% 55% at 50% -12%, rgba(255, 204, 0, 0.1), transparent 58%),
    var(--bg);
  background-attachment: fixed;
}

/* Readable mono (invoice / VIN / plate) — tabular figures */
.mono,
.slip-meta.mono,
.vin-cell {
  font-family: var(--mono);
  font-feature-settings: 'tnum' 1, 'zero' 0, 'liga' 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  transition: color 0.15s var(--ease-smooth), opacity 0.15s ease;
}

a:hover {
  color: #ffe066;
}

.app {
  /* Use the screen — was a narrow 920px island with empty side gutters */
  --app-max: 1480px;
  max-width: var(--app-max);
  width: 100%;
  margin: 0 auto;
  padding: 20px clamp(16px, 2.5vw, 40px) calc(48px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 2;
  /* Opacity-only entrance — transform on text roots causes permanent blur on Windows */
  animation: app-in 0.45s var(--ease-out) both;
}

@media (min-width: 1600px) {
  .app {
    --app-max: 1600px;
  }
}

/* Auth cards stay readable — don't stretch login across the whole monitor */
#view-login.card,
#view-forgot.card,
#view-reset.card,
#view-register.card {
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

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

.mast {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
  animation: mast-in 0.65s var(--ease-spring) both;
}

.mast-titles {
  flex: 0 1 auto;
  min-width: 0;
}

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

/*
 * Gold pill + transparent logo (white/black bg already knocked out of the PNG).
 * Motion: calm settle-in · soft hover lift · click = simple press + gold flash.
 */
.mast-logo {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  min-width: 132px;
  padding: 3px 10px 3px 9px;
  border-radius: 999px;
  background: linear-gradient(
    165deg,
    #ffe566 0%,
    #ffcc00 42%,
    #e6a800 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 230, 120, 0.45),
    0 0 22px rgba(255, 204, 0, 0.28),
    0 6px 18px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 6px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.32s var(--ease-spring),
    box-shadow 0.35s ease;
  animation: logo-settle-in 0.7s var(--ease-spring) both;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transform-origin: 50% 50%;
  isolation: isolate;
  overflow: hidden; /* sheen stays inside the pill */
}

.mast-logo:focus-visible {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--gold),
    0 0 22px rgba(255, 204, 0, 0.35),
    0 6px 18px rgba(0, 0, 0, 0.4);
}

/* Hover: gentle lift + glow — no tilt / logo spin */
@media (hover: hover) and (pointer: fine) {
  .mast-logo:hover:not(.is-popping) {
    transform: translateY(-1px) scale(1.03);
    box-shadow:
      0 0 0 1px rgba(255, 236, 140, 0.6),
      0 0 28px rgba(255, 204, 0, 0.42),
      0 10px 24px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }

  .mast-logo:hover:not(.is-popping) img {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) brightness(1.03);
  }
}

@keyframes logo-settle-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.mast-logo img {
  position: relative;
  z-index: 2;
  height: 44px;
  width: auto;
  max-width: 128px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
  transition:
    transform 0.35s var(--ease-spring),
    filter 0.35s ease;
  transform-origin: 50% 50%;
}

/* Liquid sheen band (idle hidden) */
.mast-logo::before {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 42%;
  border-radius: 0;
  border: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.55) 48%,
    rgba(255, 248, 200, 0.35) 58%,
    transparent 78%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transform: translateX(-140%) skewX(-16deg);
}

/* Soft outer glow ring on click */
.mast-logo::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 230, 140, 0.55);
  background: transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transform: scale(0.96);
  box-shadow: 0 0 18px rgba(255, 204, 0, 0.25);
}

/* —— Click: simple press + gold flash + sheen —— */
.mast-logo.is-popping {
  overflow: hidden;
  animation: logo-click-pulse 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow:
    0 0 0 1px rgba(255, 240, 160, 0.75),
    0 0 28px rgba(255, 204, 0, 0.48),
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.mast-logo.is-popping > img {
  animation: logo-click-img 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mast-logo.is-popping::before {
  animation: logo-sheen 0.4s ease-out both;
}

.mast-logo.is-popping::after {
  animation: logo-click-ring 0.42s ease-out both;
}

/* Hide legacy donut / spark markup if any left in DOM */
.mast-logo .logo-donut,
.mast-logo .logo-sparks {
  display: none !important;
}

@keyframes logo-click-pulse {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.96);
  }
  65% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes logo-click-img {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.97);
  }
  65% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes logo-sheen {
  0% {
    opacity: 0;
    transform: translateX(-140%) skewX(-16deg);
  }
  25% {
    opacity: 0.65;
  }
  100% {
    opacity: 0;
    transform: translateX(220%) skewX(-16deg);
  }
}

@keyframes logo-click-ring {
  0% {
    opacity: 0.55;
    transform: scale(0.96);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mast-logo {
    animation: none;
  }
  .mast-logo.is-popping {
    animation: logo-click-soft 0.25s ease both;
  }
  .mast-logo.is-popping > img {
    animation: none;
  }
  .mast-logo.is-popping::before,
  .mast-logo.is-popping::after {
    animation: none;
  }
}

@keyframes logo-click-soft {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

/* —— Admin Recent activity (plain language, Winnipeg times) —— */
.activity-intro {
  margin: 0 0 12px;
  font-size: 0.85rem;
}
.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.activity-head h2 {
  margin: 0;
}
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(70vh, 640px);
  overflow: auto;
}
.activity-item {
  display: grid;
  grid-template-columns: minmax(7.5rem, 9.5rem) 1fr;
  gap: 10px 14px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  align-items: start;
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-when {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mute, #9aa6b8);
  line-height: 1.35;
  padding-top: 2px;
}
.activity-body {
  min-width: 0;
}
.activity-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #e8eef7);
  line-height: 1.35;
}
.activity-detail {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--mute, #9aa6b8);
  line-height: 1.35;
  word-break: break-word;
}
.activity-fleet,
.activity-user {
  display: inline-block;
  margin-top: 6px;
  margin-right: 6px;
  font-size: 0.68rem;
}
.activity-empty {
  margin: 8px 0 0;
}
.activity-item.kind-login .activity-title {
  color: #86efac;
}
.activity-item.kind-login-fail .activity-title {
  color: #fca5a5;
}
.activity-item.kind-email .activity-title {
  color: #93c5fd;
}
.activity-item.kind-download .activity-title {
  color: #fde68a;
}
.activity-item.kind-photos .activity-title {
  color: #c4b5fd;
}
.activity-item.kind-browse .activity-title {
  color: #a5b4fc;
}

/* DSP habit cards */
.habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.habit-card {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(15, 22, 36, 0.55);
}
.habit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.habit-prefer {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fde68a;
}
.habit-last {
  font-size: 0.75rem;
  color: var(--mute, #9aa6b8);
  margin-bottom: 8px;
}
.habit-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text, #e8eef7);
}
.habit-stats li {
  margin: 2px 0;
}
.habit-stats strong {
  color: #ffd633;
  font-variant-numeric: tabular-nums;
}
.habit-users {
  color: var(--mute, #9aa6b8);
  font-size: 0.75rem;
  margin-top: 4px;
}
@media (max-width: 560px) {
  .activity-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.mast h1 {
  font-family: var(--font-brand);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
  margin: 0;
  /* Solid gold — clipped gradient text rasterizes soft/pixelated on many GPUs */
  color: #ffd633;
  text-shadow: 0 0 24px rgba(255, 204, 0, 0.18);
}

.mast .sub {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--mute);
  margin-top: 3px;
  letter-spacing: 0.01em;
  line-height: var(--leading-tight);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  transition:
    border-color 0.25s var(--ease-smooth),
    box-shadow 0.3s var(--ease-out),
    transform 0.25s var(--ease-out);
  border-radius: var(--r);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: var(--leading-tight);
}

.muted {
  color: var(--mute);
  font-size: var(--text-sm);
  line-height: 1.5;
  font-weight: 400;
}

label {
  display: block;
  font-size: var(--text-xs);
  color: var(--mute);
  margin-bottom: 5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
}

input,
select,
button {
  font-family: inherit;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
select {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-size: 0.95rem;
  margin-bottom: 12px;
  min-height: 42px;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  min-height: 42px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(165deg, #ffe566 0%, #ffcc00 45%, #e6a800 100%);
  color: #0e0e0e;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s var(--ease-spring),
    box-shadow 0.22s var(--ease-out),
    filter 0.15s ease,
    border-color 0.15s ease,
    background 0.2s ease;
  box-shadow: 0 2px 10px rgba(255, 204, 0, 0.18);
}

button::after,
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: none;
  pointer-events: none;
}

button:hover:not(:disabled)::after,
.btn:hover:not(:disabled)::after {
  animation: btn-shimmer 0.65s var(--ease-smooth);
}

@keyframes btn-shimmer {
  to {
    transform: translateX(120%);
  }
}

/*
 * No scale() on text buttons — fractional scale rasterizes glyphs to mush.
 * Lift with shadow only (or 1px translate).
 */
button:hover:not(:disabled),
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 6px 18px rgba(255, 204, 0, 0.32);
}

button:active:not(:disabled),
.btn:active:not(:disabled) {
  transform: none;
  filter: brightness(0.98);
}

button.secondary,
.btn.secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(255, 204, 0, 0.4);
  box-shadow: none;
}

button.secondary:hover:not(:disabled),
.btn.secondary:hover:not(:disabled) {
  background: rgba(255, 204, 0, 0.1);
  border-color: rgba(255, 204, 0, 0.65);
  box-shadow: 0 4px 14px rgba(255, 204, 0, 0.12);
}

button.danger {
  background: rgba(255, 42, 42, 0.2);
  color: #ff8a8a;
  border: 1px solid rgba(255, 42, 42, 0.4);
  box-shadow: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

input,
select {
  transition:
    border-color 0.2s var(--ease-smooth),
    box-shadow 0.2s var(--ease-smooth),
    background 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(255, 204, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.row > * {
  flex: 1 1 auto;
}

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(255, 204, 0, 0.35);
}

.chip.amp {
  background: rgba(52, 199, 89, 0.12);
  color: #8ef0b0;
  border-color: rgba(52, 199, 89, 0.4);
}

.chip.off {
  background: rgba(255, 255, 255, 0.06);
  color: var(--mute);
  border-color: var(--line);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table th {
  text-align: left;
  color: var(--mute);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(58, 58, 66, 0.6);
  vertical-align: middle;
}

.table tr:hover td {
  background: rgba(255, 204, 0, 0.04);
}

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.err {
  color: #ff8a8a;
  font-size: 0.85rem;
  margin: 8px 0;
}

.ok {
  color: #8ef0b0;
  font-size: 0.85rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.toolbar .field {
  flex: 1 1 140px;
  min-width: 120px;
  margin: 0;
}

.toolbar .field label {
  margin-bottom: 6px;
}

.toolbar .field input,
.toolbar .field select {
  margin-bottom: 0;
}

.toolbar .field.grow {
  flex: 2 1 200px;
}

.toolbar .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  flex: 0 0 auto;
  padding-bottom: 0;
}

.toolbar .actions button {
  flex: 0 0 auto;
}

/* Loading overlay while PDF generates */
.pdf-busy {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pdf-busy.hidden {
  display: none !important;
}

.pdf-busy-card {
  background: var(--panel);
  border: 1px solid rgba(255, 204, 0, 0.35);
  border-radius: 16px;
  padding: 22px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 280px;
}

.pdf-busy-card .spin {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid rgba(255, 204, 0, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: portal-spin 0.7s linear infinite;
}

.pdf-busy-card .title {
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

/* Success beat before browser download starts */
.pdf-busy.is-ready .pdf-busy-card {
  border-color: rgba(52, 199, 89, 0.5);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(52, 199, 89, 0.18);
  animation: busy-ready-pop 0.45s var(--ease-spring) both;
}

.pdf-busy.is-ready .pdf-busy-card .spin {
  animation: none;
  border: none;
  background: linear-gradient(165deg, #34c759, #248a3d);
  position: relative;
  box-shadow: 0 0 20px rgba(52, 199, 89, 0.45);
}

.pdf-busy.is-ready .pdf-busy-card .spin::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 36px;
}

.pdf-busy.is-ready .pdf-busy-card .title {
  color: #8ef0b0;
}

.pdf-busy.is-ready .pdf-busy-card .muted {
  color: rgba(245, 245, 247, 0.75);
}

@keyframes busy-ready-pop {
  from {
    opacity: 0.85;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Confetti above the busy overlay so the win moment is visible */
.confetti-host {
  z-index: 10050 !important;
}

.toast-host {
  z-index: 10060 !important;
}

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

.admin-row-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: var(--panel2);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.admin-row-edit input {
  margin-bottom: 0;
  flex: 1 1 120px;
  min-width: 100px;
}

.hidden {
  display: none !important;
}

.invite-box {
  background: var(--panel2);
  border: 1px dashed rgba(255, 204, 0, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--gold);
  margin: 8px 0 12px;
}

.invite-message {
  width: 100%;
  min-height: 280px;
  margin: 6px 0 0;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 204, 0, 0.35);
  background: #12141a;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  white-space: pre-wrap;
}

.footer {
  margin-top: 28px;
  text-align: center;
  color: var(--mute);
  font-size: 0.72rem;
}

.vin-cell {
  font-size: 0.7rem;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(90deg, #3d2e00, #1b2a4a);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.preview-banner-inner {
  max-width: var(--app-max, 1480px);
  margin: 0 auto;
  padding: 10px clamp(16px, 2.5vw, 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.preview-banner-inner .secondary {
  margin: 0;
  padding: 8px 14px;
  font-size: 0.8rem;
}

.preview-card {
  border: 1px solid rgba(255, 204, 0, 0.35);
}

.welcome-card {
  border: 1px solid rgba(255, 204, 0, 0.22);
}

/* One row: greeting left, Settings + Log out side-by-side on the right */
.welcome-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

/* Override global .row > * { flex: 1 1 auto } which was stacking buttons */
.welcome-row > .welcome-text {
  flex: 1 1 auto;
  min-width: 0;
}

.welcome-row > .welcome-actions {
  flex: 0 0 auto;
}

.welcome-text h2 {
  font-family: var(--font-brand), var(--font), system-ui, sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
  color: var(--ink);
}

.welcome-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.welcome-actions button {
  margin: 0 !important;
  width: auto !important;
  min-width: 0;
  flex: 0 0 auto;
  padding: 10px 14px !important;
  font-size: 0.85rem !important;
}

@media (max-width: 520px) {
  .welcome-row {
    flex-wrap: wrap;
  }
  .welcome-row > .welcome-actions {
    width: 100%;
    justify-content: stretch;
  }
  .welcome-actions button {
    flex: 1 1 0;
  }
}

.slips-toolbar {
  align-items: center;
  margin-bottom: 12px;
}

#settings-panel label {
  margin-top: 10px;
}

/* —— Admin —— match DSP stretch layout (was capped at 980px island) —— */
.app-admin {
  max-width: var(--app-max, 1480px);
  width: 100%;
}
@media (min-width: 1600px) {
  .app-admin {
    max-width: 1600px;
  }
}
/* Login stays a readable card, not full-bleed */
#admin-login.card {
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-tab {
  margin: 0 !important;
  width: auto !important;
  min-width: 0;
  flex: 1 1 auto;
  padding: 10px 12px !important;
  font-size: 0.82rem !important;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--mute) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}

.admin-tab:hover {
  color: var(--ink) !important;
  background: var(--panel2) !important;
}

.admin-tab.on {
  background: linear-gradient(165deg, #ffe566 0%, #ffcc00 50%, #e6a800 100%) !important;
  color: #1a1a1c !important;
  border-color: rgba(255, 230, 120, 0.5) !important;
}

.admin-panel.hidden {
  display: none !important;
}

.admin-topbar {
  margin-bottom: 12px;
}

/* —— DSP board: filters, cards, bulk —— */
.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chip-btn {
  margin: 0 !important;
  width: auto !important;
  min-width: 0;
  padding: 8px 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700;
  border-radius: 999px !important;
  background: var(--panel2) !important;
  color: var(--mute) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-spring),
    background 0.2s ease,
    color 0.15s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease !important;
}

.chip-btn:hover {
  color: var(--ink) !important;
  border-color: rgba(255, 204, 0, 0.35) !important;
  transform: translateY(-1px) !important;
}

.chip-btn.on {
  background: linear-gradient(165deg, #ffe566, #ffcc00 50%, #e6a800) !important;
  color: #1a1a1c !important;
  border-color: rgba(255, 230, 120, 0.5) !important;
  box-shadow: 0 2px 12px rgba(255, 204, 0, 0.28) !important;
  animation: chip-pop 0.35s var(--ease-bounce) both;
}

@keyframes chip-pop {
  0% {
    transform: scale(0.92);
  }
  55% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.slips-filters {
  align-items: flex-end;
  margin-bottom: 10px;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.bulk-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}

.bulk-check input {
  width: auto;
  margin: 0;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.bulk-actions button {
  margin: 0 !important;
  width: auto !important;
  min-width: 0;
  padding: 8px 12px !important;
  font-size: 0.78rem !important;
}

.slips-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.slip-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 12px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  contain: layout style;
  transition:
    border-color 0.2s var(--ease-smooth),
    background 0.2s ease,
    box-shadow 0.25s var(--ease-out),
    transform 0.22s var(--ease-spring),
    opacity 0.2s ease;
}

.slip-card.slip-enter {
  animation: slip-rise 0.45s var(--ease-spring) both;
  animation-delay: calc(min(var(--i, 0), 12) * 0.04s);
}

@keyframes slip-rise {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slip-card:hover {
  border-color: rgba(255, 204, 0, 0.35);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  /* No transform on cards — keeps van labels / invoice text sharp */
  transform: none;
}

.slip-card.is-selected {
  border-color: rgba(255, 204, 0, 0.55);
  background: rgba(255, 204, 0, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 204, 0, 0.2);
}

.slip-card.is-downloaded {
  opacity: 0.78;
}

.slip-card.is-downloaded .dl-chip {
  animation: chip-ok 0.5s var(--ease-spring) both;
}

@keyframes chip-ok {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.slip-chk {
  width: auto !important;
  margin: 4px 0 0 !important;
  accent-color: #ffcc00;
}

.slip-main {
  min-width: 0;
}

.slip-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.slip-van {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.dl-chip {
  font-size: 0.65rem;
  background: rgba(52, 199, 89, 0.18);
  color: #34c759;
  border: 1px solid rgba(52, 199, 89, 0.35);
}

.stage-chip {
  font-size: 0.65rem;
  background: rgba(255, 204, 0, 0.14);
  color: var(--gold);
  border: 1px solid rgba(255, 204, 0, 0.4);
}

.slip-meta {
  font-size: 0.78rem;
  color: var(--mute);
  line-height: 1.35;
}

/* Icon row: Download · Camera · Email — label expands on hover only */
.slip-acts {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  align-self: center;
}

.slip-acts .act-icon-btn {
  margin: 0 !important;
  width: auto !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 11px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  /* 1.0 clips descenders; keep room in the pill */
  line-height: 1.25 !important;
  flex-shrink: 0;
  /* visible so label descenders aren’t chopped; clip only the label width */
  overflow: visible !important;
  white-space: nowrap;
  transition:
    background 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    filter 0.15s ease,
    transform 0.18s var(--ease-spring) !important;
}

.slip-acts .act-icon-btn .act-svg {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.slip-acts .act-icon-btn .act-label {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  margin-left: 0;
  /* room for g / y / p descenders inside the width reveal */
  line-height: 1.3;
  padding: 2px 0 3px;
  vertical-align: middle;
  transition:
    max-width 0.28s var(--ease-out),
    opacity 0.18s ease,
    margin-left 0.22s var(--ease-out);
}

.slip-acts .act-icon-btn:hover:not(:disabled) .act-label,
.slip-acts .act-icon-btn:focus-visible:not(:disabled) .act-label {
  /* “Download” needs more than 5.5rem at 0.78rem weight 650 */
  max-width: 7.25rem;
  opacity: 1;
  margin-left: 7px;
}

/* Touch / no-hover: always show labels (no hover to expand) */
@media (hover: none) {
  .slip-acts .act-icon-btn .act-label {
    max-width: 7.25rem;
    opacity: 1;
    margin-left: 7px;
  }
}

/* Primary download — gold disc, quiet until hover expands */
.slip-acts .act-dl {
  background: linear-gradient(165deg, #ffe566 0%, #ffcc00 45%, #e6a800 100%) !important;
  color: #0e0e0e !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(255, 204, 0, 0.2) !important;
}
.slip-acts .act-dl:hover:not(:disabled),
.slip-acts .act-dl:focus-visible:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 4px 14px rgba(255, 204, 0, 0.35) !important;
}

/* Camera / email — ghost icons matching gold line */
.slip-acts .act-cam,
.slip-acts .act-mail {
  background: rgba(255, 204, 0, 0.08) !important;
  color: var(--gold) !important;
  border: 1px solid rgba(255, 204, 0, 0.28) !important;
  box-shadow: none !important;
}
.slip-acts .act-cam:hover:not(:disabled),
.slip-acts .act-mail:hover:not(:disabled),
.slip-acts .act-cam:focus-visible:not(:disabled),
.slip-acts .act-mail:focus-visible:not(:disabled) {
  background: rgba(255, 204, 0, 0.16) !important;
  border-color: rgba(255, 204, 0, 0.5) !important;
  filter: none !important;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.12) !important;
}

.slip-acts .act-icon-btn:active:not(:disabled) {
  transform: scale(0.96) !important;
}

.slip-acts .act-icon-btn::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

/* legacy class if any remain */
.photo-icon-btn {
  /* absorbed into .act-icon-btn.act-cam */
}

.empty-state {
  text-align: center;
  padding: 28px 12px;
}

@media (max-width: 640px) {
  .bulk-actions {
    width: 100%;
    margin-left: 0;
  }
  .bulk-actions button {
    flex: 1 1 40%;
  }
  .slip-card {
    grid-template-columns: auto 1fr;
  }
  .slip-acts {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
  }
  .slip-acts .act-icon-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .table .hide-sm,
  .slip-card .hide-sm,
  .hide-sm {
    display: none !important;
  }
  .mast h1 {
    font-size: 1.25rem;
  }
}

/* —— View / panel entrances —— */
.view-enter {
  animation: view-rise 0.4s var(--ease-out) both;
}

@keyframes view-rise {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.welcome-card {
  animation: welcome-in 0.55s var(--ease-spring) 0.08s both;
}

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

.slips-card {
  animation: welcome-in 0.5s var(--ease-out) 0.14s both;
}

.settings-open {
  animation: settings-drop 0.35s var(--ease-spring) both;
}

@keyframes settings-drop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* PDF busy — tire spin vibe */
.pdf-busy:not(.hidden) {
  animation: busy-fade 0.25s var(--ease-out) both;
}

@keyframes busy-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pdf-busy-card {
  animation: busy-pop 0.4s var(--ease-spring) both;
}

@keyframes busy-pop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pdf-busy-card .spin {
  animation: portal-spin 0.7s linear infinite;
  border: 3px solid rgba(255, 204, 0, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
}

/* Admin tabs spring */
.admin-tab {
  transition:
    transform 0.18s var(--ease-spring),
    background 0.2s ease,
    color 0.15s ease,
    border-color 0.2s ease !important;
}

.admin-tab.on {
  animation: chip-pop 0.35s var(--ease-bounce) both;
}

.admin-panel:not(.hidden) {
  animation: view-rise 0.35s var(--ease-out) both;
}

/* Gold success flash on toast-like messages */
.ok {
  animation: ok-flash 0.45s var(--ease-out) both;
}

@keyframes ok-flash {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/*
 * Header van strip — LOUD busy Amazon night stage.
 * Geometry: host = scene 96px + ribbon 16px (van-runner SCENE_H / RIBBON_H).
 * Canvas box is set 1:1 by van-runner.js — NEVER width/height: 100% stretch.
 */
.van-runner.mast-van {
  --van-scene-h: 96px;
  --van-ribbon-h: 16px;
  position: relative;
  flex: 1 1 240px;
  min-width: 180px;
  max-width: none;
  width: auto;
  height: calc(var(--van-scene-h) + var(--van-ribbon-h));
  margin-left: 8px;
  margin-right: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(
      165deg,
      rgba(36, 44, 64, 0.75) 0%,
      rgba(12, 14, 22, 0.95) 55%,
      rgba(8, 10, 16, 0.98) 100%
    ),
    linear-gradient(180deg, rgba(255, 153, 0, 0.08) 0%, transparent 45%);
  border: 1px solid rgba(255, 204, 0, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 153, 0, 0.16),
    0 0 22px rgba(255, 153, 0, 0.2),
    0 0 40px rgba(255, 204, 0, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 230, 160, 0.12),
    inset 0 0 36px rgba(0, 0, 0, 0.4);
  align-self: center;
  display: flex;
  flex-direction: column;
  z-index: 2;
  animation: van-stage-loud 3.2s ease-in-out infinite;
}

/* Stage chrome follows Winnipeg sky period (set on #van-runner[data-sky]). */
.van-runner.mast-van[data-sky='day'] {
  background:
    linear-gradient(
      165deg,
      rgba(110, 170, 220, 0.55) 0%,
      rgba(160, 200, 235, 0.45) 45%,
      rgba(40, 55, 75, 0.85) 100%
    ),
    linear-gradient(180deg, rgba(255, 220, 120, 0.12) 0%, transparent 50%);
  border-color: rgba(255, 200, 80, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 180, 60, 0.14),
    0 0 18px rgba(120, 180, 255, 0.16),
    0 8px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 28px rgba(80, 140, 200, 0.12);
  animation: none;
}
.van-runner.mast-van[data-sky='dawn'],
.van-runner.mast-van[data-sky='dusk'] {
  background:
    linear-gradient(
      165deg,
      rgba(90, 50, 70, 0.65) 0%,
      rgba(40, 30, 55, 0.9) 50%,
      rgba(12, 14, 28, 0.98) 100%
    ),
    linear-gradient(180deg, rgba(255, 140, 60, 0.16) 0%, transparent 48%);
  /* Soft static chrome — loud neon pulse is night-only */
  animation: none;
  border-color: rgba(255, 160, 80, 0.4);
  box-shadow:
    0 0 0 1px rgba(255, 120, 50, 0.14),
    0 0 20px rgba(255, 120, 60, 0.16),
    0 8px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 200, 140, 0.12),
    inset 0 0 32px rgba(0, 0, 0, 0.35);
}

@keyframes van-stage-loud {
  0%,
  100% {
    border-color: rgba(255, 204, 0, 0.34);
    box-shadow:
      0 0 0 1px rgba(255, 153, 0, 0.14),
      0 0 18px rgba(255, 153, 0, 0.16),
      0 0 34px rgba(255, 204, 0, 0.1),
      0 8px 28px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 230, 160, 0.1),
      inset 0 0 36px rgba(0, 0, 0, 0.4);
  }
  50% {
    border-color: rgba(255, 220, 80, 0.55);
    box-shadow:
      0 0 0 1px rgba(255, 153, 0, 0.24),
      0 0 28px rgba(255, 153, 0, 0.28),
      0 0 48px rgba(255, 204, 0, 0.18),
      0 8px 28px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 240, 180, 0.16),
      inset 0 0 36px rgba(0, 0, 0, 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .van-runner.mast-van {
    animation: none !important;
  }
}
body.motion-chill .van-runner.mast-van,
body.quiet-mode .van-runner.mast-van {
  animation: none !important;
}

.van-runner.hidden {
  display: none !important;
}

#van-runner-canvas {
  display: block !important;
  flex: 0 0 var(--van-scene-h, 96px);
  height: var(--van-scene-h, 96px) !important;
  max-height: var(--van-scene-h, 96px) !important;
  min-height: var(--van-scene-h, 96px) !important;
  /* Width set inline by van-runner (1:1 paint box). Do not force 100% —
     that stretched the bitmap vs scroll/ribbon math. */
  max-width: 100%;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Tablets + phones: full-width strip — mid widths were squeezing houses/ribbon */
@media (max-width: 900px) {
  .mast {
    align-items: flex-start;
  }
  .van-runner.mast-van {
    display: flex !important;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-top: 6px;
    order: 5;
  }
}

/* ============================================================
   Premium product polish — depth, glass, micro-motion, toasts
   ============================================================ */

/* Soft floating orbs behind the app (paid SaaS vibe) */
.ambient {
  position: fixed;
  /* Extend past viewport so blurred orbs aren’t cut into a hard edge */
  inset: -80px;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
  will-change: transform;
}

.ambient-orb.orb-a {
  width: min(52vw, 420px);
  height: min(52vw, 420px);
  top: -4%;
  left: 18%;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.28), transparent 68%);
  animation: orb-drift-a 18s ease-in-out infinite alternate;
}

.ambient-orb.orb-b {
  width: min(56vw, 460px);
  height: min(56vw, 460px);
  /* Soft corner wash only — no hard top edge above Beeps On */
  bottom: -12%;
  right: -10%;
  background: radial-gradient(
    circle at 55% 55%,
    rgba(40, 55, 90, 0.35) 0%,
    rgba(27, 42, 74, 0.12) 45%,
    transparent 70%
  );
  filter: blur(80px);
  opacity: 0.7;
  animation: orb-drift-b 22s ease-in-out infinite alternate;
}

.ambient-orb.orb-c {
  width: min(36vw, 280px);
  height: min(36vw, 280px);
  top: 42%;
  left: -8%;
  background: radial-gradient(circle, rgba(255, 42, 42, 0.08), transparent 70%);
  animation: orb-drift-c 26s ease-in-out infinite alternate;
}

@keyframes orb-drift-a {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(40px, 30px) scale(1.08);
  }
}

@keyframes orb-drift-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    /* Gentle drift — keep fully soft, never a rectangular slice */
    transform: translate(-18px, -12px) scale(1.06);
  }
}

@keyframes orb-drift-c {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(50px, -40px);
  }
}

/* Fine film grain so it doesn’t look flat/webapp-default */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Glass elevation on panels */
.card {
  background: linear-gradient(
    165deg,
    rgba(36, 36, 40, 0.96) 0%,
    rgba(28, 28, 30, 0.94) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

/* Soft gold sweep across card on enter */
.card.view-enter::after,
.card.card-auth::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 204, 0, 0.06) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: card-sheen 1.1s var(--ease-out) 0.2s both;
  pointer-events: none;
}

@keyframes card-sheen {
  to {
    transform: translateX(120%);
  }
}

.card:hover {
  border-color: rgba(255, 204, 0, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 16px 48px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 204, 0, 0.06);
}

/* Auth / login polish */
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.22);
  animation: chip-pop 0.5s var(--ease-bounce) 0.15s both;
}

.auth-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.8);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.85);
  }
}

.card-auth h2 {
  font-family: var(--font-brand);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 8px !important;
  background: linear-gradient(105deg, #fff 0%, #ffe566 45%, #ffcc00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* —— Auth hero (login / forgot / register) —— */
.auth-hero {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding: 28px 24px 22px !important;
  overflow: hidden;
  position: relative;
}

.auth-glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.18), transparent 70%);
  pointer-events: none;
  animation: auth-glow-pulse 4.5s ease-in-out infinite alternate;
}

@keyframes auth-glow-pulse {
  from {
    opacity: 0.55;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.12) translate(-10px, 12px);
  }
}

.auth-lead {
  margin: 0 0 22px !important;
  font-size: 0.9rem !important;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-wrap {
  margin-bottom: 4px;
}

.field-wrap label {
  margin-bottom: 6px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.input-shell .input-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mute);
  display: flex;
  pointer-events: none;
  z-index: 1;
  opacity: 0.75;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.input-shell:focus-within .input-ico {
  color: var(--gold);
  opacity: 1;
}

.input-shell input {
  margin-bottom: 0 !important;
  padding-left: 42px !important;
  padding-right: 64px !important;
  min-height: 48px !important;
  border-radius: 12px !important;
  background: rgba(20, 20, 24, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-size: 0.98rem !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    background 0.2s ease !important;
}

.input-shell input:focus {
  border-color: rgba(255, 204, 0, 0.55) !important;
  box-shadow:
    0 0 0 3px rgba(255, 204, 0, 0.14),
    0 0 24px rgba(255, 204, 0, 0.1) !important;
  background: rgba(28, 28, 32, 0.95) !important;
}

.input-shell input::placeholder {
  color: rgba(154, 154, 162, 0.55);
}

/* no icon: less left padding */
.input-shell:not(:has(.input-ico)) input {
  padding-left: 14px !important;
}

.pw-toggle {
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 32px !important;
  padding: 4px 10px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 204, 0, 0.1) !important;
  color: var(--gold) !important;
  border: 1px solid rgba(255, 204, 0, 0.25) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  z-index: 2;
}

.pw-toggle:hover:not(:disabled) {
  background: rgba(255, 204, 0, 0.18) !important;
  transform: translateY(-50%) !important;
  filter: none !important;
}

.pw-toggle::after {
  display: none !important;
}

.auth-submit {
  width: 100% !important;
  min-height: 48px !important;
  margin-top: 8px !important;
  border-radius: 12px !important;
  font-size: 0.98rem !important;
  letter-spacing: 0.02em;
  gap: 10px !important;
}

.auth-submit.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.auth-submit .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: #1a1a1c;
  border-radius: 50%;
  animation: portal-spin 0.65s linear infinite;
}

.auth-submit.is-loading .btn-spinner {
  display: block;
}

.auth-links {
  margin-top: 16px;
  text-align: center;
}

.auth-links a {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 204, 0, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.auth-links a:hover {
  border-bottom-color: var(--gold);
}

.auth-back {
  width: 100% !important;
  margin-top: 12px !important;
}

.auth-trust {
  list-style: none;
  margin: 22px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
}

.auth-trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: 0.02em;
}

.auth-trust .trust-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.6);
  flex-shrink: 0;
}

/* Friendly error banner (not raw API codes) */
.auth-err {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: #ffc9c9;
  background: linear-gradient(165deg, rgba(255, 42, 42, 0.16), rgba(80, 20, 20, 0.35));
  border: 1px solid rgba(255, 80, 80, 0.4);
  box-shadow: 0 4px 16px rgba(255, 42, 42, 0.08);
  animation: auth-err-in 0.35s var(--ease-spring) both;
}

.auth-err::before {
  content: '!';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #1a1a1c;
  background: #ff6b6b;
  box-shadow: 0 0 10px rgba(255, 80, 80, 0.45);
}

.auth-err.hidden {
  display: none !important;
}

@keyframes auth-err-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-hero.auth-shake {
  animation: auth-shake 0.45s var(--ease-out) both;
}

@keyframes auth-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-8px);
  }
  30% {
    transform: translateX(7px);
  }
  45% {
    transform: translateX(-5px);
  }
  60% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

/* Fall back if :has() unsupported — still usable */
@supports not selector(:has(*)) {
  .input-shell input {
    padding-left: 14px !important;
  }
}

/* Welcome hero line */
.welcome-card {
  border: 1px solid rgba(255, 204, 0, 0.28) !important;
  background:
    radial-gradient(ellipse 80% 120% at 0% 0%, rgba(255, 204, 0, 0.1), transparent 55%),
    linear-gradient(165deg, rgba(40, 38, 28, 0.95), rgba(28, 28, 30, 0.96)) !important;
}

.welcome-text h2 {
  background: linear-gradient(105deg, #fff8d6 0%, #ffcc00 55%, #e6a800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Status line as a premium pill */
#list-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--mute);
  animation: status-in 0.4s var(--ease-out) both;
}

#list-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.55);
  flex-shrink: 0;
}

#list-status.is-loading::before {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
  animation: pulse-dot 1s ease-in-out infinite;
}

#list-status.is-empty::before {
  background: var(--mute);
  box-shadow: none;
}

@keyframes status-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bulk bar glass */
.bulk-bar {
  background: linear-gradient(180deg, rgba(44, 44, 46, 0.9), rgba(36, 36, 38, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.bulk-bar.has-selection {
  border-color: rgba(255, 204, 0, 0.35);
  box-shadow:
    0 4px 20px rgba(255, 204, 0, 0.1),
    0 0 0 1px rgba(255, 204, 0, 0.08);
  animation: bulk-glow 0.45s var(--ease-out) both;
}

@keyframes bulk-glow {
  from {
    box-shadow: 0 0 0 0 rgba(255, 204, 0, 0);
  }
}

#sel-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  transition: color 0.2s ease, transform 0.25s var(--ease-spring);
}

#sel-count.has-n {
  color: var(--gold);
  animation: chip-pop 0.35s var(--ease-bounce) both;
}

/* Slip cards — premium edge */
.slip-card {
  background: linear-gradient(165deg, rgba(48, 48, 52, 0.7), rgba(36, 36, 40, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.slip-card:hover {
  border-color: rgba(255, 204, 0, 0.4);
  background: linear-gradient(165deg, rgba(56, 52, 36, 0.55), rgba(40, 40, 44, 0.9));
}

.slip-card.is-selected {
  border-color: rgba(255, 204, 0, 0.6);
  background: linear-gradient(165deg, rgba(255, 204, 0, 0.1), rgba(40, 38, 28, 0.85));
  box-shadow:
    0 0 0 1px rgba(255, 204, 0, 0.15),
    0 8px 24px rgba(255, 204, 0, 0.08);
}

.slip-van {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
  /* Solid fill — clipped gradient text looks soft/pixelated on Windows */
  color: #fff8e0;
  -webkit-text-fill-color: #fff8e0;
  background: none;
}

/* Skeleton loaders */
.skel-card {
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  gap: 10px;
  animation: skel-in 0.4s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 0.06s);
}

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

.skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 204, 0, 0.12) 45%,
    rgba(255, 255, 255, 0.04) 90%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}

.skel-line.w40 {
  width: 40%;
}
.skel-line.w55 {
  width: 55%;
}
.skel-line.w70 {
  width: 70%;
}
.skel-line.w90 {
  width: 90%;
}

@keyframes skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Empty state — designed, not bare text */
.empty-state {
  text-align: center;
  padding: 40px 16px 36px;
  animation: empty-in 0.5s var(--ease-spring) both;
}

@keyframes empty-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.empty-visual {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, rgba(255, 204, 0, 0.15), rgba(27, 42, 74, 0.4));
  border: 1px solid rgba(255, 204, 0, 0.25);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  animation: empty-float 3.2s ease-in-out infinite;
  font-size: 1.75rem;
}

.empty-visual:empty {
  display: none;
}

@keyframes empty-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.empty-title {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.empty-state .muted {
  max-width: 28rem;
  margin: 0 auto;
}

/* Toasts — above busy/ceremony overlays */
.toast-host {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10060;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(420px, calc(100vw - 24px));
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(165deg, rgba(40, 40, 44, 0.98), rgba(28, 28, 30, 0.98));
  border: 1px solid rgba(255, 204, 0, 0.35);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.4s var(--ease-spring) both;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.toast-ok {
  border-color: rgba(52, 199, 89, 0.45);
}

.toast.toast-err {
  border-color: rgba(255, 42, 42, 0.45);
  animation: toast-shake 0.45s var(--ease-out) both;
}

.toast.out {
  animation: toast-out 0.3s var(--ease-out) both;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.7);
}

.toast.toast-ok .toast-dot {
  background: var(--ok);
  box-shadow: 0 0 10px rgba(52, 199, 89, 0.7);
}

.toast.toast-err .toast-dot {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 42, 42, 0.6);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

@keyframes toast-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* Confetti burst host (download success) */
.confetti-host {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
  overflow: hidden;
}

.confetti-bit {
  position: absolute;
  width: 6px;
  height: 8px;
  border-radius: 1px;
  opacity: 0.95;
  animation: confetti-fall 0.95s var(--ease-out) forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.4);
    opacity: 0;
  }
}

/* Button press ripple */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: ripple 0.55s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Footer premium */
.footer {
  margin-top: 36px;
  text-align: center;
  color: var(--mute);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  animation: footer-in 0.6s var(--ease-out) 0.4s both;
}

.footer span {
  color: rgba(255, 204, 0, 0.55);
}

@keyframes footer-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.75;
  }
}

/* PDF busy glass overlay */
.pdf-busy {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(8, 8, 10, 0.62) !important;
}

.pdf-busy-card {
  border: 1px solid rgba(255, 204, 0, 0.28);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 204, 0, 0.12);
  background: linear-gradient(165deg, rgba(40, 40, 44, 0.98), rgba(24, 24, 28, 0.98));
}

/* Chip row entrance stagger */
.quick-row .chip-btn {
  animation: chip-rise 0.4s var(--ease-out) both;
  animation-delay: calc(var(--ci, 0) * 0.04s);
}

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

/* Input premium focus ring */
input:focus,
select:focus {
  border-color: rgba(255, 204, 0, 0.6);
  box-shadow:
    0 0 0 3px rgba(255, 204, 0, 0.14),
    0 0 20px rgba(255, 204, 0, 0.08);
  background: rgba(44, 44, 46, 0.95);
}

/* Primary button glow pulse (idle, subtle) */
button:not(.secondary):not(.danger):not(.chip-btn):not(.admin-tab):not(:disabled) {
  box-shadow:
    0 2px 10px rgba(255, 204, 0, 0.22),
    0 0 0 0 rgba(255, 204, 0, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  button:not(.secondary):not(.danger):not(.chip-btn):not(.admin-tab):not(.act-icon-btn):not(:disabled):hover {
    box-shadow:
      0 8px 24px rgba(255, 204, 0, 0.38),
      0 0 0 1px rgba(255, 230, 120, 0.3);
  }
}



/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body {
    animation: none !important;
  }
  .ambient-orb,
  .empty-visual,
  .auth-eyebrow::before {
    animation: none !important;
  }
  .slip-card.slip-enter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  body::before {
    opacity: 0.02;
  }
}

/* —— QOL: offline, sticky bulk, copy chips, settings, touch —— */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 42, 42, 0.18);
  border-bottom: 1px solid rgba(255, 80, 80, 0.45);
  color: #ffc9c9;
}
.offline-banner.hidden {
  display: none !important;
}

.bulk-bar-sticky {
  position: sticky;
  top: 8px;
  z-index: 12;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-hero {
  font-weight: 800 !important;
  box-shadow: 0 4px 16px rgba(255, 204, 0, 0.35) !important;
}

body.gallery-open {
  overflow: hidden;
}

.photo-gallery {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: photo-gal-in 0.22s var(--ease-out) both;
}
.photo-gallery.hidden {
  display: none !important;
}
@keyframes photo-gal-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.photo-gal-card {
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-gal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.photo-gal-head h2 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.2rem;
  font-weight: 700;
}
.photo-gal-head .muted {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.photo-gal-empty {
  margin: 24px 0;
  text-align: center;
}

.photo-lb-stage {
  display: block;
  width: 100%;
}
.photo-lb-stage.hidden {
  display: none !important;
}
.photo-lb-stage[data-has-many='0'] .photo-lb-nav {
  display: none !important;
}

.photo-lb-frame {
  position: relative;
  min-height: 200px;
  max-height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0c;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.photo-lb-frame img {
  max-width: 100%;
  max-height: 58vh;
  width: auto;
  height: auto;
  object-fit: contain;
  /* No opacity transition — rapid flips must not fade-lag */
  transition: none;
  pointer-events: none; /* clicks go to frame / nav, not stuck on img */
  will-change: contents;
}
.photo-lb-frame img.is-loading {
  opacity: 0.72; /* soft hint only — keep previous/thumb visible */
}
.photo-lb-frame img.is-error,
.photo-lb-stage.is-error .photo-lb-frame::after {
  /* empty src / failed load — leave dark frame, no broken-icon flash */
}
.photo-lb-stage.is-error .photo-lb-frame::after {
  content: 'Photo unavailable';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 2;
}
.photo-lb-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
}

/*
 * Overlay arrows — isolate from global button styles (gold fill, shimmer ::after,
 * hover translateY/scale) which break vertical centering.
 */
.photo-lb-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  margin-top: auto;
  margin-bottom: auto;
  z-index: 4;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(20, 20, 24, 0.82) !important;
  color: #fff !important;
  font-size: 0 !important; /* hide any leftover text glyphs */
  line-height: 0 !important;
  font-weight: 400 !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin-left: 0;
  margin-right: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
  overflow: visible !important;
  white-space: nowrap;
  filter: none !important;
  transform: none !important;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease !important;
  -webkit-tap-highlight-color: transparent;
}
.photo-lb-nav.prev {
  left: 10px;
}
.photo-lb-nav.next {
  right: 10px;
}
/* Kill global shimmer strip */
.photo-lb-nav::after,
.photo-lb-nav:hover::after,
.photo-lb-nav:active::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}
.photo-lb-nav:hover:not(:disabled),
.photo-lb-nav:focus-visible:not(:disabled) {
  border-color: rgba(255, 204, 0, 0.55) !important;
  color: var(--gold) !important;
  background: rgba(28, 28, 32, 0.94) !important;
  outline: none;
  transform: none !important;
  filter: none !important;
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2), 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}
.photo-lb-nav:active:not(:disabled) {
  transform: none !important;
  filter: none !important;
  background: rgba(12, 12, 14, 0.92) !important;
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.15) !important;
}
.photo-lb-nav .photo-lb-chev {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
  pointer-events: none;
  /* Ensure chevron stroke paints even if parent color is muted */
  color: inherit;
  stroke: currentColor;
  overflow: visible;
}
.photo-lb-nav .photo-lb-chev path {
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.photo-thumb {
  flex: 0 0 auto;
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 2px solid transparent !important;
  background: var(--panel2) !important;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: center;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  color: inherit !important;
}
.photo-thumb::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.photo-thumb.is-active {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.25) !important;
}
.photo-thumb:hover:not(:disabled),
.photo-thumb:focus-visible:not(:disabled) {
  border-color: rgba(255, 204, 0, 0.45) !important;
  transform: none !important;
  filter: none !important;
}

@media (max-width: 560px) {
  .photo-lb-nav {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }
  .photo-lb-nav.prev {
    left: 6px;
  }
  .photo-lb-nav.next {
    right: 6px;
  }
  .photo-lb-nav .photo-lb-chev {
    width: 16px;
    height: 16px;
  }
  .photo-gal-card {
    padding: 12px;
    max-height: 96vh;
  }
}

.btn-undo-dl {
  font-size: 0.72rem !important;
  padding: 6px 8px !important;
  opacity: 0.85;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}
.search-chips.hidden {
  display: none !important;
}
.search-chip {
  margin: 0 !important;
  min-height: 0 !important;
  padding: 4px 10px !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  background: var(--panel2) !important;
  color: var(--mute) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}
.search-chip::after {
  display: none !important;
}
.search-chip:hover {
  color: var(--ink) !important;
  border-color: rgba(255, 204, 0, 0.35) !important;
  transform: none !important;
}

.kbd-hint {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--mute);
  margin-left: 4px;
}
.footer kbd {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.cache-age {
  margin: -6px 0 10px !important;
  font-size: 0.72rem !important;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
.empty-actions button {
  width: auto !important;
  min-width: 8rem;
}

.caps-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffb020;
  margin: -6px 0 10px;
}
.caps-hint.hidden {
  display: none !important;
}

.reg-steps {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mute);
}
.reg-steps li.on {
  color: var(--gold);
}
.reg-steps.hidden {
  display: none !important;
}

.settings-block {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.settings-h3 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: var(--ink) !important;
  margin-bottom: 10px !important;
  cursor: pointer;
}
.check-row input {
  width: auto !important;
  margin: 3px 0 0 !important;
  min-height: 0 !important;
  accent-color: #ffcc00;
}
.pdf-name-preview {
  margin: -6px 0 12px !important;
  font-family: var(--mono);
  font-size: 0.78rem !important;
}

.toast-retry {
  margin-left: 8px !important;
  min-height: 28px !important;
  padding: 4px 10px !important;
  font-size: 0.75rem !important;
}

body.large-touch button,
body.large-touch .chip-btn {
  min-height: 48px !important;
  font-size: 0.95rem !important;
}
body.large-touch input,
body.large-touch select {
  min-height: 48px !important;
  font-size: 1rem !important;
}
body.large-touch .slip-acts .act-icon-btn {
  min-height: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
}

body.quiet-mode .ceremony,
body.quiet-mode .confetti-host {
  display: none !important;
}

@media print {
  .ambient,
  .snow-layer,
  .van-runner,
  .route-ribbon,
  .bulk-bar,
  .sound-toggle,
  .welcome-actions,
  #settings-panel,
  .offline-banner {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .slip-card {
    break-inside: avoid;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

/* �� Branded dialog (replaces window.confirm / alert) �� */
body.gomo-dialog-open {
  overflow: hidden;
}
.gomo-dialog {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  box-sizing: border-box;
}
.gomo-dialog.hidden {
  display: none !important;
}
.gomo-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: gomo-dlg-fade 0.22s ease both;
}
.gomo-dialog-card {
  position: relative;
  width: min(400px, 100%);
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: linear-gradient(165deg, #2a2a30 0%, #1c1c20 100%);
  border: 1px solid rgba(255, 204, 0, 0.28);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: gomo-dlg-pop 0.32s cubic-bezier(0.22, 1.2, 0.36, 1) both;
  color: #f2f2f4;
}
.gomo-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  background: rgba(255, 204, 0, 0.12);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.22);
}
.gomo-dialog-icon.kind-mail {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.28);
}
.gomo-dialog-icon.kind-danger,
.gomo-dialog-icon.kind-warn {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}
.gomo-dialog-icon.kind-download {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.28);
}
.gomo-dialog-icon.kind-logout {
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.28);
}
.gomo-dialog-title {
  margin: 0 0 8px;
  font-family: Sora, Lexend, system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  color: #fff;
}
.gomo-dialog-body {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
  color: rgba(242, 242, 244, 0.82);
  white-space: pre-wrap;
}
.gomo-dialog-body .dlg-email {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid rgba(255, 204, 0, 0.3);
  color: #ffe566;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  word-break: break-all;
}
.gomo-dialog-body .dlg-strong {
  color: #fff;
  font-weight: 700;
}
.gomo-dialog-field {
  margin: 0 0 16px;
}
.gomo-dialog-field.hidden {
  display: none !important;
}
.gomo-dialog-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(242, 242, 244, 0.65);
  margin-bottom: 6px;
  text-align: left;
}
.gomo-dialog-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
}
.gomo-dialog-input:focus {
  outline: none;
  border-color: rgba(255, 204, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
}
.gomo-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
}
.gomo-dialog-btn {
  flex: 1;
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.gomo-dialog-btn:active {
  transform: scale(0.98);
}
.gomo-dialog-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(242, 242, 244, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.gomo-dialog-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}
.gomo-dialog-btn.primary {
  background: linear-gradient(180deg, #ffd84d 0%, #ffcc00 100%);
  color: #1a1a1c;
  box-shadow: 0 4px 16px rgba(255, 204, 0, 0.25);
}
.gomo-dialog-btn.primary:hover {
  filter: brightness(1.05);
}
.gomo-dialog-btn.primary.danger {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.28);
}
@keyframes gomo-dlg-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes gomo-dlg-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gomo-dialog-backdrop,
  .gomo-dialog-card {
    animation: none;
  }
}

/* ============================================================
   A11y terminal — hard PRM (must stay last)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ambient-orb { animation: none !important; will-change: auto !important; }
  .route-stop, .route-stop.is-active, .route-stop.is-next { animation: none !important; }
  .van-runner.mast-van:not(.hidden),
  .van-runner.mast-van:has(.route-stop.is-active) {
    animation: none !important;
  }
}
