/* ══ ИП Карпов — Грузоперевозки · style.css ══════════════════════════ */

:root {
  --bg:   #0f0f11;
  --surf: #17171c;
  --surf2:#1e1e26;
  --brd:  #2a2a36;
  --acc:  #e8c84a;
  --acc2: #c4a832;
  --txt:  #e8e8ee;
  --txt2: #9090a8;
  --mut:  #5a5a72;
  --dan:  #e85a4a;
  --success: #4ae8a0;
  --shadow: 0 4px 24px rgba(0,0,0,.45);
  --btn-warm: #e8c84a;
  --btn-warm2: #c4a832;
  --btn-warm-soft: rgba(232,200,74,.12);
  --btn-warm-glow: rgba(232,200,74,.24);
}

body[data-theme="light"] {
  --bg:   #f4f0e7;
  --surf: #fffaf0;
  --surf2:#f1eadf;
  --brd:  #d9cdbd;
  --acc:  #b88b08;
  --acc2: #d6a817;
  --txt:  #241d17;
  --txt2: #6b5f53;
  --mut:  #928678;
  --dan:  #c84638;
  --success: #148f59;
  --shadow: 0 10px 30px rgba(113,83,45,.13);
  --btn-warm: #d9a70f;
  --btn-warm2: #f2cd4d;
  --btn-warm-soft: rgba(217,167,15,.14);
  --btn-warm-glow: rgba(217,167,15,.28);
}

/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
  transition: background .34s ease, color .34s ease;
}
body:not(.app-ready) .app-hdr,
body:not(.app-ready) .main {
  opacity: 0;
}
body.app-ready .app-hdr {
  animation: appHeaderIn .72s cubic-bezier(.2,.8,.2,1) both;
}
body.app-ready .main {
  animation: appMainIn .72s cubic-bezier(.2,.8,.2,1) .08s both;
}

/* ── Header ────────────────────────────────────────────────────────── */
.app-hdr {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surf) 82%, #000 18%) 0%, color-mix(in srgb, var(--bg) 86%, #000 14%) 100%);
  border-bottom: 1px solid var(--brd);
  padding: 16px 20px 18px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  position: relative;
}
.app-hdr::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 2px;
  background: var(--acc);
  border-radius: 2px;
}
.hdr-in { max-width: 640px; margin: 0 auto; }
.brand-row {
  display: grid;
  grid-template-columns: 104px minmax(0, auto);
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
.brand-copy {
  min-width: 0;
  text-align: left;
}
.hero-art-frame {
  width: 104px;
  aspect-ratio: 1;
  margin: 0;
  padding: 3px;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,71,232,.92), rgba(81,210,255,.78) 48%, rgba(232,200,74,.7));
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 12px 28px rgba(0,0,0,.36), 0 0 24px rgba(123,93,255,.18);
}
.hero-art-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), inset 0 0 16px rgba(81,210,255,.2);
  pointer-events: none;
  z-index: 1;
}
.hero-art-frame::after {
  content: "";
  position: absolute;
  inset: -45%;
  background: conic-gradient(from 120deg, transparent, rgba(255,255,255,.18), transparent 22%);
  animation: heroSweep 4.8s linear infinite;
  opacity: .55;
  pointer-events: none;
}
.hero-art-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 15px;
  position: relative;
  z-index: 1;
}
.hdr-badge {
  display: inline-block;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mut);
  border: 1px solid var(--brd);
  border-radius: 20px;
  padding: 3px 12px;
  margin-bottom: 8px;
}
.hdr-in h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--acc);
  margin: 0;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.hdr-in p {
  font-size: 10px;
  color: var(--mut);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 6px 0 0;
  font-family: monospace;
}

/* ── Login Button ──────────────────────────────────────────────────── */
#loginBtn {
  margin-top: 12px;
  background: transparent;
  border: 1.5px solid #e8803a;
  color: #e8803a;
  border-radius: 20px;
  padding: 7px 22px;
  font-size: 12px;
  font-family: monospace;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#loginBtnIcon { display: none; }
.auth-row {
  margin: 14px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 10px;
  min-height: 58px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.auth-row #loginBtn { margin-top: 0; }
.google-auth-btn {
  min-width: 158px;
  min-height: 38px;
  position: relative;
  isolation: isolate;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f4f0e8 0%, #d7c9b0 100%) !important;
  border: 0 !important;
  color: #17130f !important;
  border-radius: 10px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 8px 22px rgba(232,128,58,.16);
}
.google-auth-btn::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.45);
  pointer-events: none;
}
.google-auth-btn::after {
  content: '';
  position: absolute;
  width: 44px;
  height: 120%;
  left: -58px;
  top: -10%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  transform: skewX(-22deg);
  transition: left .55s ease;
  z-index: -1;
}
.google-auth-btn:hover::after { left: calc(100% + 20px); }
.google-auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 12px 28px rgba(232,128,58,.24);
}
.google-auth-btn:active { transform: translateY(0) scale(.98); }
.google-auth-btn:disabled { opacity: .72; cursor: wait; }
.google-auth-btn #loginBtnText { position: relative; z-index: 1; }
.google-auth-btn #loginBtnIcon {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: #178447 !important;
}
body[data-theme="light"] .app-hdr {
  background: linear-gradient(180deg, rgba(255,250,240,.86) 0%, rgba(244,240,231,.92) 100%);
  box-shadow: 0 10px 26px rgba(113,83,45,.08);
}
body[data-theme="light"] .auth-row {
  background: rgba(255,255,255,.42);
  border-color: rgba(184,139,8,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 22px rgba(113,83,45,.08);
}
.analytics-access-banner {
  display: none;
  width: min(520px, 100%);
  margin: 16px auto 0;
  border: 1px solid rgba(79,124,255,.32);
  border-radius: 18px;
  padding: 10px 16px 10px 12px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--txt);
  background: linear-gradient(135deg, rgba(79,124,255,.13), rgba(57,217,138,.07));
  box-shadow: 0 16px 38px rgba(0,0,0,.22), 0 0 28px rgba(79,124,255,.08), inset 0 1px 0 rgba(255,255,255,.07);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.analytics-access-banner.is-checking,
.analytics-access-banner.is-allowed,
.analytics-access-banner.is-denied {
  display: flex;
  animation: fadeInUp .32s ease both;
}
.analytics-access-banner.is-hidden {
  display: none;
}
.analytics-access-banner.is-checking {
  cursor: wait;
  pointer-events: none;
  border-color: rgba(87,244,255,.38);
}
.analytics-access-banner.is-allowed {
  border-color: rgba(57,217,138,.42);
  background: linear-gradient(135deg, rgba(57,217,138,.18), rgba(79,124,255,.1));
}
.analytics-access-banner.is-allowed:hover {
  transform: translateY(-2px);
  border-color: rgba(57,217,138,.68);
  box-shadow: 0 20px 44px rgba(0,0,0,.27), 0 0 30px rgba(57,217,138,.12), inset 0 1px 0 rgba(255,255,255,.09);
}
.analytics-access-banner.is-denied {
  cursor: default;
  border-color: rgba(255,95,95,.28);
  background: linear-gradient(135deg, rgba(255,95,95,.1), rgba(79,124,255,.06));
}
.analytics-access-loader {
  width: 96px;
  height: 52px;
  flex: 0 0 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.analytics-access-loader .google-truck-wrapper {
  width: 96px;
  height: 52px;
}
.analytics-access-loader .google-truck-body {
  width: 70px;
  height: 34px;
  margin-bottom: 5px;
}
.analytics-access-loader .google-truck-tires {
  width: 70px;
  padding: 0 6px 0 8px;
  bottom: 1px;
}
.analytics-access-loader .google-truck-tires svg {
  width: 14px;
  height: 14px;
}
.analytics-access-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.analytics-access-copy b {
  color: #fff;
  font-size: 15px;
  line-height: 1.12;
}
.analytics-access-copy small {
  color: var(--mut);
  font-size: 11px;
  line-height: 1.25;
}
.analytics-access-banner.is-checking .analytics-access-copy b:after {
  content: "";
  animation: routeDots 1.2s steps(4,end) infinite;
}
.analytics-access-banner.is-allowed .analytics-access-copy b {
  color: #dfffee;
}
.analytics-access-banner.is-denied .analytics-access-copy b {
  color: #ffd3d3;
}
body[data-theme="light"] .analytics-access-banner {
  background: linear-gradient(135deg, rgba(255,255,255,.76), rgba(57,217,138,.08));
  border-color: rgba(184,139,8,.2);
  box-shadow: 0 16px 34px rgba(113,83,45,.12), inset 0 1px 0 rgba(255,255,255,.7);
}
body[data-theme="light"] .analytics-access-copy b {
  color: #241d17;
}
#loginStatus {
  font-size: 10px;
  color: var(--mut);
  margin-top: 6px;
  min-height: 12px;
  font-family: monospace;
  letter-spacing: 1.5px;
  transition: color .3s;
}

/* ── Theme Switch ──────────────────────────────────────────────────── */
.theme-switch-wrap {
  width: 86px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.auth-row .bb8-toggle {
  --toggle-size: 7.9px;
  margin-top: 0;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.28));
}
.auth-row .bb8-toggle__container {
  box-shadow: 0 10px 24px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.14);
}

/* ── Layout ────────────────────────────────────────────────────────── */
.main { max-width: 640px; margin: 0 auto; padding: 18px 16px 0; }

/* ── Card ──────────────────────────────────────────────────────────── */
.dc {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: background .34s ease, border-color .34s ease, box-shadow .34s ease, color .34s ease;
}
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .62s cubic-bezier(.2,.8,.2,1), transform .62s cubic-bezier(.2,.8,.2,1), filter .62s ease;
  filter: saturate(.86);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: saturate(1);
}

/* ── Card Label ────────────────────────────────────────────────────── */
.cl {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--acc);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cl::after { content: ''; flex: 1; height: 1px; background: var(--brd); }

/* ── Form ──────────────────────────────────────────────────────────── */
.fl {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--mut);
  text-transform: uppercase;
  display: block;
  margin-bottom: 5px;
}
.fi {
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: 8px;
  color: var(--txt);
  font-size: 15px;
  padding: 11px 13px;
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.fi:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(232,200,74,.1);
}
.fi[readonly] { color: var(--mut); }
input[type="date"].fi::-webkit-calendar-picker-indicator { filter: invert(0.5); cursor: pointer; }
body[data-theme="light"] input[type="date"].fi::-webkit-calendar-picker-indicator { filter: invert(.24) sepia(.24) saturate(1.4); }

/* ── Amount wrapper ────────────────────────────────────────────────── */
.aw { position: relative; }
.aw .fi { padding-right: 34px; }
.ct {
  position: absolute;
  right: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--mut);
  font-family: monospace;
  font-size: 12px;
  pointer-events: none;
}

/* ── Divider ───────────────────────────────────────────────────────── */
.idiv { height: 1px; background: var(--brd); margin: 16px 0; }

/* ── Upload zone ───────────────────────────────────────────────────── */
.uz {
  border: 1.5px dashed var(--brd);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.uz:hover { border-color: var(--acc); }
.uz input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%; height: 100%;
  padding: 0; background: none; border: none;
}
.uh { font-size: 12px; color: var(--mut); line-height: 1.4; }
.up { max-width: 80px; max-height: 56px; object-fit: contain; }
.stamp-zone-disabled { opacity: .35; pointer-events: none; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.bd {
  background: var(--acc);
  color: #0f0f11;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  padding: 16px;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, transform .1s;
}
.bd:hover { background: var(--acc2); }
.bd:active { transform: scale(0.97); }
.bd:disabled { opacity: .4; cursor: not-allowed; }

.doc-flight-btn {
  font-family: inherit;
  background: linear-gradient(135deg, #f2d14c 0%, #e3bd32 100%);
  color: #101014;
  border-radius: 16px;
  font-size: 19px;
  min-height: 62px;
  padding: .7em 1em .7em .9em;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(232,200,74,.18);
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.doc-flight-btn .doc-flight-label {
  display: block;
  margin-left: .3em;
  transition: transform .3s ease-in-out, opacity .3s ease-in-out;
}
.doc-flight-btn .doc-flight-icon-wrap,
.doc-flight-btn .doc-flight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-flight-btn .doc-flight-icon {
  position: relative;
  width: 24px;
  height: 24px;
  transition: transform .3s ease-in-out;
}
.doc-flight-btn .doc-flight-icon::before,
.doc-flight-btn .doc-flight-icon::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease, transform .35s ease;
}
.doc-flight-btn .doc-flight-icon::before {
  width: 13px;
  height: 10px;
  right: -5px;
  bottom: 2px;
  border-radius: 8px 8px 7px 3px;
  background: linear-gradient(135deg, #ffd5a5 0%, #e99b61 100%);
  box-shadow: inset -2px -2px 0 rgba(121,62,25,.16), -5px -1px 0 -3px #ffd5a5;
  transform: translate(8px, 7px) rotate(-18deg) scale(.72);
  transform-origin: 40% 70%;
}
.doc-flight-btn .doc-flight-icon::after {
  width: 18px;
  height: 3px;
  right: -9px;
  bottom: 5px;
  border-radius: 4px 1px 1px 4px;
  background: linear-gradient(90deg, #2b2430 0 72%, #f7f1df 72% 84%, #1b1820 84% 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
  transform: translate(10px, 5px) rotate(-35deg) scaleX(.55);
  transform-origin: left center;
}
.doc-flight-btn svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center center;
  transition: transform .3s ease-in-out;
}
.doc-flight-btn:hover {
  background: linear-gradient(135deg, #f7d957 0%, #e7c43e 100%);
  box-shadow: 0 18px 38px rgba(232,200,74,.26);
  transform: translateY(-1px);
}
.doc-flight-btn:hover .doc-flight-icon {
  transform: translateY(-1px) scale(1.05);
}
.doc-flight-btn:hover .doc-flight-icon::before {
  opacity: 1;
  transform: translate(0, 0) rotate(-18deg) scale(1);
  animation: signHand .82s ease-in-out infinite alternate;
}
.doc-flight-btn:hover .doc-flight-icon::after {
  opacity: 1;
  transform: translate(0, 0) rotate(-35deg) scaleX(1);
  animation: signPen .82s ease-in-out infinite alternate;
}
.doc-flight-btn:hover svg { transform: translateX(-.08em) rotate(0deg) scale(1.03); }
.doc-flight-btn:hover .doc-flight-label {
  transform: translateX(.28em);
  opacity: .98;
}
.doc-flight-btn:active { transform: scale(.95); }
.doc-flight-btn:disabled {
  opacity: .68;
  cursor: wait;
  transform: none;
}
.doc-flight-btn:disabled .doc-flight-icon::before {
  opacity: 1;
  transform: translate(0, 0) rotate(-18deg) scale(1);
  animation: signHand .82s ease-in-out infinite alternate;
}
.doc-flight-btn:disabled .doc-flight-icon::after {
  opacity: 1;
  transform: translate(0, 0) rotate(-35deg) scaleX(1);
  animation: signPen .82s ease-in-out infinite alternate;
}
.doc-flight-btn:disabled .doc-flight-label {
  transform: none;
  opacity: 1;
}
.doc-flight-btn:disabled svg { transform: none; }
.doc-flight-act {
  background: linear-gradient(135deg, #edd060 0%, #dcb936 100%);
}
.doc-flight-act:hover {
  background: linear-gradient(135deg, #f5dc70 0%, #e1c044 100%);
}
@keyframes signHand {
  from { transform: translate(-1px, 1px) rotate(-20deg) scale(1); }
  to { transform: translate(2px, -1px) rotate(-12deg) scale(1.02); }
}
@keyframes signPen {
  from { transform: translate(-1px, 1px) rotate(-37deg) scaleX(1); }
  to { transform: translate(3px, -1px) rotate(-28deg) scaleX(1); }
}

.send-flight-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f7cff 0%, #3163df 100%);
  color: #fff;
  padding: 13px 18px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(66,133,244,.24);
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, box-shadow .18s ease, background .18s ease;
}
.send-flight-btn .send-flight-label {
  display: block;
  transition: transform .28s ease, opacity .28s ease;
}
.send-flight-btn .send-flight-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .28s ease;
}
.send-flight-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center;
  transition: transform .28s ease;
}
.send-flight-btn:hover {
  background: linear-gradient(135deg, #5d8cff 0%, #3a6df0 100%);
  box-shadow: 0 14px 34px rgba(66,133,244,.32);
  transform: translateY(-1px);
}
.send-flight-btn:hover .send-flight-icon { animation: sendFloat .62s ease-in-out infinite alternate; }
.send-flight-btn:hover svg { transform: translateX(13px) rotate(42deg) scale(1.08); }
.send-flight-btn:hover .send-flight-label {
  transform: translateX(72px);
  opacity: 0;
}
.send-flight-btn:active { transform: scale(.97); }
.send-flight-btn:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}
.send-flight-btn:disabled .send-flight-icon { animation: sendFloat .62s ease-in-out infinite alternate; }
@keyframes sendFloat {
  from { transform: translateY(1px); }
  to { transform: translateY(-2px); }
}

.bh {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: var(--txt2);
  border: 1px solid var(--brd);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  min-height: 56px;
  padding: 14px;
  width: 100%;
  cursor: pointer;
  transform: translateZ(0);
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color .18s ease,
    color .18s ease,
    background .18s ease,
    box-shadow .2s ease,
    transform .2s ease;
}
.bh::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.bh:hover,
.bh:focus-visible {
  border-color: currentColor;
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 12px 28px rgba(0,0,0,.22), 0 0 22px color-mix(in srgb, currentColor 28%, transparent);
}
.bh:hover::before,
.bh:focus-visible::before {
  opacity: .075;
}
.bh:active {
  transform: translateY(0) scale(1.035);
  box-shadow: 0 8px 22px rgba(0,0,0,.25), 0 0 18px color-mix(in srgb, currentColor 34%, transparent);
}
.bh:active::before { opacity: .12; }
.bh:focus-visible { outline: none; }

.bh-drive    { border-color: #4285f4; color: #4285f4; }
.bh-drive:hover    { border-color: #4285f4; background: rgba(66,133,244,.08); }
.bh-archive  { border-color: #e8c84a; color: #e8c84a; }
.bh-archive:hover  { border-color: #e8c84a; background: rgba(232,200,74,.08); }
.bh-archive:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.bh-email    { border-color: #ea4335; color: #ea4335; }
.bh-email:hover    { border-color: #ea4335; background: rgba(234,67,53,.08); }
.bh-sign     { border-color: #9c27b0; color: #9c27b0; }
.bh-sign:hover     { border-color: #9c27b0; background: rgba(156,39,176,.08); }
.bh-analytics{ border-color: #34a853; color: #34a853; }
.bh-analytics:hover{ border-color: #34a853; background: rgba(52,168,83,.08); }

@media (hover: none) {
  .bh { min-height: 60px; }
  .bh:active {
    transform: scale(1.025);
  }
}

/* ── Toggle Switch ─────────────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 68px; height: 34px;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.22));
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #2b2d38;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  transition: background .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.toggle-slider::after {
  content: attr(data-off);
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.48);
  font-family: monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  transition: color .24s ease, transform .24s ease, opacity .24s ease;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 28px; height: 28px;
  left: 3px; bottom: 2px;
  background: linear-gradient(180deg, #fff, #d7d9e4);
  border-radius: 50%;
  z-index: 2;
  transition: transform .3s cubic-bezier(.22,1,.36,1), background .25s, box-shadow .25s;
  box-shadow: 0 4px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.8);
}
.toggle-switch:hover .toggle-slider::before {
  box-shadow: 0 6px 14px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.9);
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #39d98a, #1f9d63);
  border-color: rgba(57,217,138,.62);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 0 18px rgba(57,217,138,.18);
}
.toggle-switch input:checked + .toggle-slider::after {
  content: attr(data-on);
  right: auto;
  left: 10px;
  color: #08140f;
  opacity: .8;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(33px);
  background: linear-gradient(180deg, #f9fff9, #d9f3e4);
}
.toggle-switch input:disabled + .toggle-slider {
  cursor: not-allowed;
  background: #242631;
  border-color: rgba(255,255,255,.05);
  box-shadow: none;
  opacity: .72;
}
.toggle-switch input:disabled + .toggle-slider::before {
  background: linear-gradient(180deg, #7d8190, #4b4e5b);
  box-shadow: 0 3px 8px rgba(0,0,0,.28);
}

/* ── Parse Box ─────────────────────────────────────────────────────── */
.parse-box {
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  display: none;
}
.parse-box h3 {
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--acc);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.prow {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--brd);
}
.prow:last-child { border-bottom: none; }
.pk { color: var(--mut); flex-shrink: 0; margin-right: 8px; }
.pv { color: var(--txt); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 65%; }
.pbtns { display: flex; gap: 8px; margin-top: 12px; }
.pbtn-ok {
  background: var(--acc);
  color: #0f0f11;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}
.pbtn-no {
  background: transparent;
  color: var(--mut);
  border: 1px solid var(--brd);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
}

/* ── Drive message ─────────────────────────────────────────────────── */
.drive-msg { font-size: 11px; text-align: center; min-height: 16px; margin-bottom: 6px; transition: color .2s; }
.drive-msg.ok   { color: var(--success); }
.drive-msg.err  { color: var(--dan); }
.drive-msg.info { color: var(--mut); }

/* ── Sign panel ────────────────────────────────────────────────────── */
#signViewport {
  position: relative;
  overflow: auto;
  max-height: 500px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: #fff;
}
#pdfCanvas { display: block; }
#stampOverlay {
  position: absolute;
  width: 80px; height: 56px;
  cursor: move;
  display: none;
  opacity: 0.85;
}
#signPageInfo { font-size: 12px; color: var(--mut); white-space: nowrap; }
#downloadSignBtn { display: none; }
#signEmailBlock { display: none; margin-top: 12px; }
#sendSignedBtn { background: var(--surf2); color: var(--acc); border: 1px solid var(--acc); }
#signMsg, #emailMsg {
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  min-height: 14px;
}

/* ── Panels (hidden by default) ────────────────────────────────────── */
#emailPanel    { display: none; margin-bottom: 8px; }
#signPanel     { display: none; margin-bottom: 8px; }
#analyticsPanel{ display: none; margin-bottom: 8px; }
#googleOverlay { display: none; }
#signCanvas    { display: none; margin-bottom: 12px; }
#contractName  { font-size: 12px; color: var(--acc); display: none; }
#spPrev        { display: none; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surf);
  border: 1px solid var(--brd);
  color: var(--txt);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 30px;
  z-index: 200;
  transition: transform .3s, opacity .3s;
  opacity: 0;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

body[data-theme="light"] .google-auth-btn {
  background: linear-gradient(135deg, #ffffff 0%, #efe5d4 100%) !important;
  color: #2c2118 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 10px 24px rgba(113,83,45,.12);
}
body[data-theme="light"] :where(.bd, .bh, .google-auth-btn, .doc-flight-btn, .send-flight-btn, .analytics-access-banner, .analytics-back-btn) {
  transition:
    background .34s cubic-bezier(.2,.8,.2,1),
    border-color .34s cubic-bezier(.2,.8,.2,1),
    color .34s cubic-bezier(.2,.8,.2,1),
    box-shadow .34s cubic-bezier(.2,.8,.2,1),
    transform .24s cubic-bezier(.2,.8,.2,1),
    filter .34s cubic-bezier(.2,.8,.2,1);
}
body[data-theme="light"] .bd,
body[data-theme="light"] .doc-flight-btn {
  background: linear-gradient(135deg, #fff2a8 0%, var(--btn-warm2) 48%, var(--btn-warm) 100%) !important;
  color: #21170a !important;
  box-shadow: 0 12px 28px var(--btn-warm-glow), inset 0 1px 0 rgba(255,255,255,.72);
}
body[data-theme="light"] .bd:hover,
body[data-theme="light"] .doc-flight-btn:hover {
  background: linear-gradient(135deg, #fff7c8 0%, #f6d969 48%, #dba612 100%) !important;
  box-shadow: 0 18px 38px rgba(217,167,15,.34), 0 0 24px rgba(242,205,77,.22), inset 0 1px 0 rgba(255,255,255,.82);
  transform: translateY(-2px);
}
body[data-theme="light"] .bd:active,
body[data-theme="light"] .doc-flight-btn:active {
  transform: translateY(0) scale(.98);
  box-shadow: 0 8px 20px rgba(217,167,15,.24), inset 0 2px 6px rgba(113,83,45,.1);
}
body[data-theme="light"] .bh,
body[data-theme="light"] .send-flight-btn,
body[data-theme="light"] .analytics-access-banner,
body[data-theme="light"] .analytics-back-btn {
  border-color: rgba(217,167,15,.42) !important;
  color: #5d4305 !important;
  background: linear-gradient(135deg, rgba(255,255,255,.72), var(--btn-warm-soft)) !important;
  box-shadow: 0 10px 24px rgba(113,83,45,.1), inset 0 1px 0 rgba(255,255,255,.72);
}
body[data-theme="light"] .bh:hover,
body[data-theme="light"] .bh:focus-visible,
body[data-theme="light"] .send-flight-btn:hover,
body[data-theme="light"] .analytics-access-banner.is-allowed:hover,
body[data-theme="light"] .analytics-back-btn:hover {
  border-color: rgba(217,167,15,.72) !important;
  color: #2c2118 !important;
  background: linear-gradient(135deg, #fff9df 0%, rgba(242,205,77,.3) 100%) !important;
  box-shadow: 0 16px 34px rgba(217,167,15,.24), 0 0 26px rgba(242,205,77,.2), inset 0 1px 0 rgba(255,255,255,.86);
}
body[data-theme="light"] .bh-drive,
body[data-theme="light"] .bh-email,
body[data-theme="light"] .bh-sign,
body[data-theme="light"] .bh-analytics,
body[data-theme="light"] .bh-archive {
  border-color: rgba(217,167,15,.46) !important;
  color: #6c4f05 !important;
}
body[data-theme="light"] .google-auth-btn:hover {
  background: linear-gradient(135deg, #fffdf4 0%, #f6df95 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86), 0 14px 32px rgba(217,167,15,.24), 0 0 24px rgba(242,205,77,.18);
}
body[data-theme="light"] .analytics-access-banner.is-allowed .analytics-access-copy b,
body[data-theme="light"] .analytics-access-banner.is-checking .analytics-access-copy b {
  color: #3a2a04;
}
body[data-theme="light"] .dc,
body[data-theme="light"] .parse-box,
body[data-theme="light"] .toast {
  background: linear-gradient(180deg, #fffaf0, #f7efe3);
  border-color: #d8cbb8;
}
body[data-theme="light"] .fi {
  background: #fffdf8;
  border-color: #d9cdbd;
  color: var(--txt);
}
body[data-theme="light"] .fi:focus {
  border-color: var(--acc2);
  box-shadow: 0 0 0 3px rgba(184,139,8,.13);
}
body[data-theme="light"] .cl::after,
body[data-theme="light"] .idiv {
  background: #d9cdbd;
}
body[data-theme="light"] .prow {
  border-color: #d9cdbd;
}
body[data-theme="light"] #analyticsPanel > .dc {
  --ana-bg:#fff7e9 !important;
  --ana-card:#fff3df !important;
  --ana-card2:#f4e5cf !important;
  --ana-text:#241d17 !important;
  --ana-muted:#716658 !important;
  background: radial-gradient(circle at 12% 0%,rgba(57,217,138,.13),transparent 28%),linear-gradient(180deg,#fffaf0,#f2e7d9) !important;
  border-color: rgba(184,139,8,.26) !important;
  box-shadow: 0 22px 46px rgba(113,83,45,.13) !important;
}
body[data-theme="light"] #analyticsPanel .journal-card-inner {
  background: linear-gradient(145deg,#fff8ea 0%,#f4eadc 100%) !important;
}
body[data-theme="light"] #analyticsPanel .route-map-dialog {
  background: linear-gradient(180deg,#fffaf0,#f2e7d9) !important;
}
body[data-theme="light"] #analyticsPanel .route-map-manual-km,
body[data-theme="light"] #analyticsPanel .overview-year-card {
  background: linear-gradient(135deg,rgba(255,255,255,.72),rgba(57,217,138,.07)) !important;
  border-color: rgba(184,139,8,.22) !important;
}
body[data-theme="light"] #analyticsPanel .journal-summary,
body[data-theme="light"] #analyticsPanel .route-map-route-metrics span,
body[data-theme="light"] #analyticsPanel .journal-route-metrics span {
  background: rgba(57,217,138,.08) !important;
}

/* ── Hint ──────────────────────────────────────────────────────────── */
.hint { font-size: 11px; color: var(--mut); text-align: center; line-height: 1.7; margin-top: 4px; }
.app-slogan {
  margin: 26px auto 8px;
  padding: 18px 10px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.app-slogan::before {
  content: "";
  width: min(420px, 86%);
  height: 1px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255,71,232,.55), rgba(81,210,255,.62), transparent);
  box-shadow: 0 0 18px rgba(81,210,255,.22);
}
.app-slogan span {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, #ff4fe8, #f8fbff 28%, #51d2ff 58%, var(--acc) 86%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(18px, 4.8vw, 28px);
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255,71,232,.2), 0 0 28px rgba(81,210,255,.14);
  animation: sloganIn .72s cubic-bezier(.2,.8,.2,1) both, sloganGlow 4.2s ease-in-out infinite .72s;
}
body[data-theme="light"] .app-slogan span {
  background: linear-gradient(90deg, #b80aa4, #2c2118 30%, #0f85ba 62%, #b88b08 88%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 18px rgba(184,139,8,.14);
}

/* ── Google Overlay ────────────────────────────────────────────────── */
.google-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,14,.95);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  backdrop-filter: blur(8px);
}
.google-overlay-text {
  font-family: monospace;
  font-size: 12px;
  color: #e8803a;
  letter-spacing: 4px;
  animation: textPulse 2s ease infinite;
}
.google-overlay-sub { font-family: monospace; font-size: 10px; color: #444; letter-spacing: 3px; }
.hg-svg-wrap { animation: hgRotate 2.4s ease-in-out infinite, hgGlow 2.4s ease-in-out infinite; }
.hg-svg { width: 56px; height: 84px; }
.google-truck-loader {
  width: 190px;
  height: 106px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(79,124,255,.32);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(79,124,255,.14), rgba(57,217,138,.08));
  box-shadow: 0 22px 54px rgba(0,0,0,.32), 0 0 34px rgba(79,124,255,.16), inset 0 1px 0 rgba(255,255,255,.08);
  overflow: hidden;
}
.google-truck-wrapper {
  width: 146px;
  height: 76px;
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}
.google-truck-body {
  width: 104px;
  height: 50px;
  margin-bottom: 7px;
  display: block;
  animation: routeTruckMotion 1s linear infinite;
}
.google-truck-body svg {
  width: 100%;
  height: auto;
  display: block;
}
.google-truck-tires {
  width: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 12px;
  position: absolute;
  bottom: 2px;
}
.google-truck-tires svg {
  width: 20px;
  height: 20px;
}
.google-loader-road {
  width: 100%;
  height: 2px;
  background: #d7d7d7;
  position: relative;
  bottom: 0;
  align-self: flex-end;
  border-radius: 3px;
}
.google-loader-road:before,
.google-loader-road:after {
  content: "";
  position: absolute;
  height: 100%;
  background: #d7d7d7;
  border-radius: 3px;
  animation: routeRoadAnimation 1.4s linear infinite;
}
.google-loader-road:before {
  width: 24px;
  right: -50%;
  border-left: 12px solid rgba(10,10,14,.95);
}
.google-loader-road:after {
  width: 12px;
  right: -66%;
  border-left: 5px solid rgba(10,10,14,.95);
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--mut); }

/* ── Animations ────────────────────────────────────────────────────── */
@keyframes textPulse  { 0%,100%{opacity:.5;} 50%{opacity:1;} }
@keyframes hgRotate   { 0%,42%{transform:rotate(0deg);} 50%,92%{transform:rotate(180deg);} 100%{transform:rotate(360deg);} }
@keyframes hgGlow     { 0%,100%{filter:drop-shadow(0 0 4px rgba(232,128,58,.3));} 50%{filter:drop-shadow(0 0 10px rgba(232,128,58,.6));} }
@keyframes routeTruckMotion { 0%,100%{transform:translateY(0);} 50%{transform:translateY(3px);} }
@keyframes routeRoadAnimation { 0%{transform:translateX(0);} 100%{transform:translateX(-220px);} }
@keyframes fadeInUp   { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }
@keyframes loginPulse { 0%{box-shadow:0 0 0 0 rgba(232,128,58,.7);} 70%{box-shadow:0 0 0 7px rgba(232,128,58,0);} 100%{box-shadow:0 0 0 0 rgba(232,128,58,0);} }
@keyframes appHeaderIn { from{opacity:0;transform:translateY(-10px);} to{opacity:1;transform:translateY(0);} }
@keyframes appMainIn { from{opacity:0;transform:translateY(16px);} to{opacity:1;transform:translateY(0);} }
@keyframes heroSweep { to{transform:rotate(360deg);} }
@keyframes sloganIn { from{opacity:0;transform:translateY(18px) scale(.98);filter:blur(6px);} to{opacity:1;transform:translateY(0) scale(1);filter:blur(0);} }
@keyframes sloganGlow { 0%,100%{background-position:0 50%;filter:saturate(1);} 50%{background-position:100% 50%;filter:saturate(1.22);} }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .app-hdr { padding: 18px 14px 18px; }
  .brand-row {
    width: min(100%, 430px);
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    margin: 0 auto;
    padding: 14px 14px 16px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 32px rgba(0,0,0,.16);
  }
  body[data-theme="light"] .brand-row {
    background: linear-gradient(180deg, rgba(255,255,255,.58), rgba(255,250,240,.36));
    border-color: rgba(184,139,8,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 10px 24px rgba(113,83,45,.09);
  }
  .brand-copy { text-align: center; }
  .hero-art-frame { width: 94px; border-radius: 17px; }
  .hero-art-frame img,
  .hero-art-frame::before { border-radius: 14px; }
  .hdr-in h1 { font-size: 21px; }
  .auth-row {
    width: min(100%, 430px);
    display: flex;
    margin-top: 12px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .app-hdr { padding: 20px 14px 18px; }
  .brand-row { width: 100%; padding: 13px 12px 15px; }
  .brand-copy { text-align: center; }
  .hero-art-frame { width: 82px; border-radius: 15px; }
  .hero-art-frame img,
  .hero-art-frame::before { border-radius: 12px; }
  .hdr-in h1 { font-size: 19px; }
  .hdr-badge { font-size: 8px; letter-spacing: 2px; padding-inline: 10px; }
  .auth-row { width: 100%; justify-content: center; gap: 10px; padding-inline: 8px; }
  .google-auth-btn { min-width: 148px; }
  .theme-switch-wrap { width: 80px; }
  .auth-row .bb8-toggle { --toggle-size: 7.3px; }
  .main { padding: 14px 12px 0; }
  .dc { padding: 16px 14px; }
  .bd { font-size: 15px; padding: 14px; }
  .doc-flight-btn { font-size: 16px; min-height: 58px; padding: .7em .8em .7em .75em; }
}
