/* Colis — suivi de colis personnel */

:root {
  --bg: #f6f3ee;
  --bg-2: #efe9e0;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #78716c;
  --faint: #a8a29e;
  --line: #e9e3da;
  --line-2: #ddd5c9;
  --accent: #ea580c;
  --accent-2: #f97316;
  --accent-ink: #ffffff;
  --accent-soft: #fff1e6;
  --focus: rgba(234, 88, 12, .35);
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .05), 0 1px 1px rgba(28, 25, 23, .03);
  --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 6px 20px -6px rgba(28, 25, 23, .10);
  --shadow-lg: 0 24px 60px -12px rgba(28, 25, 23, .28), 0 2px 6px rgba(28, 25, 23, .06);

  --s-wait: #78716c;
  --s-info: #0284c7;
  --s-transit: #2563eb;
  --s-out: #ea580c;
  --s-pickup: #7c3aed;
  --s-done: #16a34a;
  --s-bad: #dc2626;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100f0e; --bg-2: #171513; --surface: #1b1917; --surface-2: #211e1b; --ink: #f5f2ee; --ink-2: #d6d3d1;
    --muted: #a8a29e; --faint: #78716c; --line: #2c2825; --line-2: #3a3531; --accent: #fb7a2c; --accent-2: #fb923c;
    --accent-ink: #1c1206; --accent-soft: rgba(251, 122, 44, .14); --focus: rgba(251, 122, 44, .4);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.8);
    --s-wait: #a8a29e; --s-info: #38bdf8; --s-transit: #60a5fa; --s-out: #fb923c; --s-pickup: #a78bfa; --s-done: #4ade80; --s-bad: #f87171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #100f0e; --bg-2: #171513; --surface: #1b1917; --surface-2: #211e1b; --ink: #f5f2ee; --ink-2: #d6d3d1;
  --muted: #a8a29e; --faint: #78716c; --line: #2c2825; --line-2: #3a3531; --accent: #fb7a2c; --accent-2: #fb923c;
  --accent-ink: #1c1206; --accent-soft: rgba(251, 122, 44, .14); --focus: rgba(251, 122, 44, .4);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.8);
  --s-wait: #a8a29e; --s-info: #38bdf8; --s-transit: #60a5fa; --s-out: #fb923c; --s-pickup: #a78bfa; --s-done: #4ade80; --s-bad: #f87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; letter-spacing: -.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

/* status color helper */
[data-s] { --c: var(--s-wait); }
[data-s="InfoReceived"] { --c: var(--s-info); }
[data-s="InTransit"] { --c: var(--s-transit); }
[data-s="OutForDelivery"] { --c: var(--s-out); }
[data-s="AvailableForPickup"] { --c: var(--s-pickup); }
[data-s="Delivered"] { --c: var(--s-done); }
[data-s="DeliveryFailure"], [data-s="Exception"] { --c: var(--s-bad); }

/* ---------- boot ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-box { width: 42px; height: 42px; border-radius: 12px; background: var(--accent); animation: bootpulse 1.1s var(--ease) infinite; }
@keyframes bootpulse { 0%,100% { transform: scale(.85) rotate(0); opacity: .6 } 50% { transform: scale(1) rotate(8deg); opacity: 1 } }

/* ---------- shell ---------- */
.shell { max-width: 760px; margin: 0 auto; padding: 0 16px calc(110px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; margin: 0 -16px 6px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; font-size: 19px; letter-spacing: -.02em; margin-right: auto; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent-2), var(--accent)); box-shadow: 0 6px 16px -6px var(--accent); }
.brand-mark svg { width: 20px; height: 20px; }
.brand:hover .brand-mark { animation: wiggle .5s var(--ease); }
@keyframes wiggle { 30% { transform: rotate(-10deg) } 60% { transform: rotate(6deg) } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--ink-2); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), background .2s;
  text-decoration: none; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 13px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s; white-space: nowrap; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--accent)); }
.btn.accent { background: linear-gradient(160deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px var(--accent); }
.btn.danger { color: var(--s-bad); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn .loader { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.add-desktop { display: none; }
@media (min-width: 720px) { .add-desktop { display: inline-flex; } .fab { display: none !important; } }

.fab {
  position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 30; height: 58px; padding: 0 22px 0 18px;
  border-radius: 20px; border: 0; color: #fff; font-weight: 700; display: flex; align-items: center; gap: 8px;
  background: linear-gradient(160deg, var(--accent-2), var(--accent)); box-shadow: 0 14px 30px -10px var(--accent), 0 2px 6px rgba(0,0,0,.12);
  animation: fabin .5s var(--spring) .2s both; transition: transform .15s var(--ease);
}
.fab svg { width: 22px; height: 22px; }
.fab:active { transform: scale(.95); }
@keyframes fabin { from { transform: translateY(30px) scale(.8); opacity: 0 } }

/* ---------- home ---------- */
.hero { padding: 14px 2px 6px; }
.hero h1 { margin: 0; font-size: clamp(26px, 6vw, 34px); letter-spacing: -.035em; line-height: 1.1; font-weight: 780; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 16px; }
.stat {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px 14px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .2s var(--ease), border-color .2s;
}
.stat:hover { transform: translateY(-2px); }
.stat.on { border-color: var(--c); }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 60px; height: 60px; border-radius: 50%; background: var(--c); opacity: .09; }
.stat b { display: block; font-size: 26px; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 550; }
.stat span i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.seg { position: relative; display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 13px; padding: 3px; }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .2s; display: flex; gap: 6px; align-items: center; }
.seg button.on { color: var(--ink); }
.seg button small { font-size: 11.5px; background: var(--line); color: var(--muted); border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; font-weight: 700; }
.seg .pill { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); transition: left .35s var(--spring), width .35s var(--spring); }
.search { flex: 1; min-width: 160px; position: relative; }
.search input { width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px 0 36px; outline: none; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; color: var(--faint); }

.list { display: grid; gap: 10px; }
.card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 14px 14px 14px;
  box-shadow: var(--shadow-sm); position: relative; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  animation: cardin .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card:active { transform: scale(.99); }
@keyframes cardin { from { opacity: 0; transform: translateY(12px) scale(.985) } }
.card .chev { color: var(--faint); width: 18px; height: 18px; transition: transform .2s var(--ease); }
.card:hover .chev { transform: translateX(3px); color: var(--muted); }
.card-main { min-width: 0; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 680; font-size: 16px; letter-spacing: -.01em; }
.card-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px var(--accent-soft); animation: dotpulse 2s infinite; }
@keyframes dotpulse { 50% { box-shadow: 0 0 0 6px transparent } }
.card-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.card-sub .mono { overflow: hidden; text-overflow: ellipsis; }
.card-event { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.card-event { align-items: center; }
.card-event time { color: var(--faint); font-size: 12px; flex: none; margin-left: auto; }
.card-desc { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.archived { opacity: .72; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live i { animation: livedot 1.6s ease-in-out infinite; }
@keyframes livedot { 50% { opacity: .25; transform: scale(.7) } }

/* mini progress */
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; position: relative; }
.mini span { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; position: relative; }
.mini span::after { content: ""; position: absolute; inset: 0; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
.mini span.on::after { transform: scaleX(1); }
.mini span.now::after { transform: scaleX(.55); animation: shimmer 2.2s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .55 } }

/* status icon (animated) */
.sicon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); position: relative; overflow: hidden; flex: none; }
.sicon svg { width: 24px; height: 24px; position: relative; z-index: 1; }
.sicon.lg { width: 76px; height: 76px; border-radius: 24px; }
.sicon.lg svg { width: 38px; height: 38px; }
.anim-road::before { content: ""; position: absolute; left: 0; right: 0; bottom: 22%; height: 2px;
  background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 12px); opacity: .35; animation: road .6s linear infinite; }
.sicon.lg.anim-road::before { bottom: 20%; }
@keyframes road { to { background-position: -12px 0 } }
.anim-road svg { animation: bump .6s ease-in-out infinite; }
@keyframes bump { 50% { transform: translateY(-1.5px) } }
.anim-scoot svg { animation: scoot 1.4s ease-in-out infinite; }
@keyframes scoot { 0%,100% { transform: translateX(-3px) } 50% { transform: translateX(3px) rotate(-3deg) } }
.anim-check svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .7s var(--ease) .15s forwards; }
@keyframes draw { to { stroke-dashoffset: 0 } }
.anim-alert svg { animation: shake 2.4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes shake { 0%,80%,100% { transform: rotate(0) } 84% { transform: rotate(-9deg) } 88% { transform: rotate(8deg) } 92% { transform: rotate(-5deg) } 96% { transform: rotate(3deg) } }
.anim-bounce svg { animation: hop 1.8s var(--ease) infinite; }
@keyframes hop { 0%,60%,100% { transform: translateY(0) } 30% { transform: translateY(-4px) } }
.anim-swing svg { animation: swing 2.6s ease-in-out infinite; transform-origin: 80% 20%; }
@keyframes swing { 0%,100% { transform: rotate(0) } 50% { transform: rotate(-10deg) } }
.anim-search svg { animation: look 2.4s ease-in-out infinite; }
@keyframes look { 0%,100% { transform: translate(0,0) } 25% { transform: translate(2px,-1px) } 50% { transform: translate(-1px,1px) } 75% { transform: translate(-2px,-1px) } }
.sicon.pulse::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--c); animation: ring 2s ease-out infinite; }
@keyframes ring { from { opacity: .6; transform: scale(.85) } to { opacity: 0; transform: scale(1.25) } }

/* empty */
.empty { text-align: center; padding: 40px 20px 30px; color: var(--muted); animation: cardin .6s var(--ease) both; }
.empty-art { width: 160px; height: 140px; margin: 0 auto 10px; }
.empty-art .float { animation: floaty 3.2s ease-in-out infinite; transform-origin: center; }
.empty-art .shadow { animation: shadowy 3.2s ease-in-out infinite; transform-origin: center; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(-2deg) } }
@keyframes shadowy { 50% { transform: scaleX(.8); opacity: .5 } }
.empty h2 { color: var(--ink); margin: 6px 0 4px; font-size: 20px; letter-spacing: -.02em; }
.empty p { margin: 0 0 18px; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%); background-size: 200% 100%; animation: skel 1.3s linear infinite; border-radius: 8px; }
@keyframes skel { to { background-position: -200% 0 } }

/* ---------- detail ---------- */
.detail-head { display: flex; gap: 10px; align-items: center; padding: 6px 0 12px; }
.detail-head .title { flex: 1; min-width: 0; }
.detail-head h1 { margin: 0; font-size: 24px; letter-spacing: -.03em; line-height: 1.15; display: flex; gap: 8px; align-items: center; font-weight: 760; }
.detail-head h1 span { overflow: hidden; text-overflow: ellipsis; }
.edit-btn { border: 0; background: none; color: var(--faint); padding: 4px; border-radius: 8px; }
.edit-btn:hover { color: var(--ink); background: var(--bg-2); }
.edit-btn svg { width: 16px; height: 16px; }
.numline { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; margin-top: 3px; flex-wrap: wrap; }
.copy { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 2px 8px; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; transition: all .2s; }
.copy svg { width: 13px; height: 13px; }
.copy:hover { color: var(--ink); }
.copy.done { color: var(--s-done); border-color: var(--s-done); }
.title-input { font-size: 22px; font-weight: 700; letter-spacing: -.02em; border: 0; border-bottom: 2px solid var(--accent); background: transparent; outline: none; width: 100%; padding: 2px 0; }

.status-card {
  position: relative; overflow: hidden; border-radius: 26px; padding: 22px; border: 1px solid var(--line);
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c) 16%, transparent) 0%, transparent 55%), var(--surface);
  box-shadow: var(--shadow); animation: cardin .5s var(--ease) both;
}
.status-top { display: flex; gap: 16px; align-items: center; }
.status-top h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; color: var(--c); line-height: 1.1; }
.status-top p { margin: 5px 0 0; color: var(--ink-2); font-size: 14.5px; }
.eta { margin-top: 18px; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.eta svg { width: 18px; height: 18px; color: var(--c); flex: none; }
.eta b { font-weight: 700; }
.route { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 14px; }
.route .flag { font-size: 18px; line-height: 1; }
.route .dash { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); position: relative; }
.route .dash::after { content: ""; position: absolute; top: -3px; left: var(--pos, 0%); width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 20%, transparent); transition: left 1s var(--ease); }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 22px; position: relative; }
.step { text-align: center; position: relative; font-size: 12px; color: var(--faint); font-weight: 600; }
.step .dot { width: 26px; height: 26px; margin: 0 auto 7px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); position: relative; z-index: 1; transition: all .4s var(--ease); }
.step .dot svg { width: 13px; height: 13px; opacity: 0; transform: scale(.4); transition: all .35s var(--spring); }
.step::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.step::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); transition-delay: calc(var(--k) * 140ms); }
.step:first-child::before, .step:first-child::after { display: none; }
.step.on { color: var(--ink-2); }
.step.on::after { transform: scaleX(1); }
.step.on .dot { background: var(--c); border-color: var(--c); color: #fff; transition-delay: calc(var(--k) * 140ms + 120ms); }
.step.on .dot svg { opacity: 1; transform: scale(1); transition-delay: calc(var(--k) * 140ms + 160ms); }
.step.now .dot { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); animation: nowring 2s ease-in-out infinite; }
@keyframes nowring { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 6%, transparent) } }
.step small { display: block; font-weight: 500; color: var(--faint); font-size: 11px; margin-top: 1px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin: 12px 0; font-size: 14px;
  background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); --c: var(--s-out); }
.banner.bad { --c: var(--s-bad); }
.banner.info { --c: var(--s-info); }
.banner svg { width: 18px; height: 18px; color: var(--c); flex: none; margin-top: 1px; }
.banner .grow { flex: 1; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 26px 2px 10px; display: flex; justify-content: space-between; align-items: center; }
.section-title button { text-transform: none; letter-spacing: 0; }

.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 18px 10px; box-shadow: var(--shadow-sm); }
.day { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 14px 0 4px; }
.day::first-letter { text-transform: uppercase; }
.ev { display: grid; grid-template-columns: 18px 1fr; gap: 12px; position: relative; padding: 8px 0 12px; animation: evin .45s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes evin { from { opacity: 0; transform: translateX(-8px) } }
.ev::before { content: ""; position: absolute; left: 8px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
.ev.last::before { display: none; }
.ev .pt { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); margin: 5px 0 0 4px; position: relative; z-index: 1; }
.ev.first .pt { background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 20%, transparent); }
.ev.first .pt::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c); animation: ring 2s ease-out infinite; }
.ev .txt { font-size: 14.5px; color: var(--ink-2); }
.ev.first .txt { color: var(--ink); font-weight: 600; }
.ev .meta { font-size: 12.5px; color: var(--faint); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ev .meta .loc { display: inline-flex; align-items: center; gap: 3px; }
.ev .meta .loc svg { width: 12px; height: 12px; }
.ev .orig { font-size: 12.5px; color: var(--faint); font-style: italic; margin-top: 3px; }
.more { width: 100%; border: 0; background: none; color: var(--accent); font-weight: 650; padding: 10px; border-top: 1px solid var(--line); margin-top: 4px; }

.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.info { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.info span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.info b { display: block; margin-top: 3px; font-weight: 650; font-size: 14.5px; overflow-wrap: anywhere; }
.info a { color: var(--accent); text-decoration: none; }

/* ---------- forms / modal ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.field small { color: var(--muted); font-weight: 500; }
.input { width: 100%; height: 48px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 14px; outline: none; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.input.big { height: 56px; font-size: 19px; font-family: var(--mono); letter-spacing: .02em; }
.input-wrap { position: relative; }
.input-wrap .in-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 36px; border: 0; border-radius: 10px; background: var(--bg-2); padding: 0 10px; display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input-wrap .in-btn svg { width: 15px; height: 15px; }
.input-wrap .input { padding-right: 96px; }
.err-text { color: var(--s-bad); font-size: 13.5px; margin: -4px 0 12px; display: flex; gap: 6px; align-items: center; animation: cardin .3s var(--ease); }
.err-text svg { width: 15px; height: 15px; flex: none; }
.shake { animation: shakeit .45s var(--ease); }
@keyframes shakeit { 20% { transform: translateX(-8px) } 40% { transform: translateX(7px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }

.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 260px; overflow: auto; padding: 5px; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98) } }
.combo-list button { width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; display: flex; gap: 10px; align-items: center; }
.combo-list button:hover, .combo-list button.hl { background: var(--bg-2); }
.combo-list .cc { font-size: 11px; color: var(--faint); margin-left: auto; font-weight: 600; }
.cav { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; letter-spacing: -.02em; }

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(12, 10, 9, .42); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s var(--ease); }
@media (min-width: 640px) { .overlay { align-items: center; } }
@keyframes fade { from { opacity: 0 } }
.sheet { width: 100%; max-width: 480px; background: var(--surface); border-radius: 28px 28px 0 0; padding: 10px 22px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheetup .42s var(--spring); max-height: 92dvh; overflow: auto; }
@media (min-width: 640px) { .sheet { border-radius: 28px; padding: 22px 26px 26px; animation: popin .35s var(--spring); } }
@keyframes sheetup { from { transform: translateY(100%) } }
@keyframes popin { from { transform: scale(.92) translateY(10px); opacity: 0 } }
.overlay.closing { animation: fade .2s var(--ease) reverse forwards; }
.overlay.closing .sheet { animation: sheetdown .22s var(--ease) forwards; }
@keyframes sheetdown { to { transform: translateY(40px); opacity: 0 } }
.grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 0 auto 14px; }
@media (min-width: 640px) { .grab { display: none; } }
.sheet h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.025em; }
.sheet .lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }

/* add animation */
.sending { text-align: center; padding: 26px 0 10px; }
.sending .scene { width: 200px; height: 110px; margin: 0 auto; position: relative; }
.sending .box { position: absolute; left: 50%; top: 0; width: 34px; height: 30px; margin-left: -17px; border-radius: 6px; background: linear-gradient(160deg, #e9b77a, #c98a45); animation: drop 1.4s var(--ease) infinite; }
.sending .box::after { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 6px; background: rgba(255,255,255,.4); }
.sending .truck { position: absolute; bottom: 8px; left: 50%; width: 110px; margin-left: -55px; color: var(--accent); animation: idle .5s ease-in-out infinite; }
.sending .truck svg { width: 110px; height: 60px; }
.sending .road { position: absolute; left: 0; right: 0; bottom: 4px; height: 3px; background: repeating-linear-gradient(90deg, var(--line-2) 0 14px, transparent 14px 24px); animation: road2 .5s linear infinite; }
@keyframes road2 { to { background-position: -24px 0 } }
@keyframes drop { 0% { transform: translateY(-20px) rotate(-10deg); opacity: 0 } 25% { opacity: 1 } 55% { transform: translateY(42px) rotate(0) } 70%,100% { transform: translateY(42px) scale(.6); opacity: 0 } }
@keyframes idle { 50% { transform: translateY(-1px) } }
.sending p { color: var(--muted); margin: 14px 0 0; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.blobs { position: fixed; inset: -20%; z-index: 0; filter: blur(60px); opacity: .55; pointer-events: none; }
.blobs i { position: absolute; border-radius: 50%; animation: blob 18s ease-in-out infinite; }
.blobs i:nth-child(1) { width: 46vmax; height: 46vmax; background: #fdba74; left: 5%; top: 0; }
.blobs i:nth-child(2) { width: 38vmax; height: 38vmax; background: #fda4af; right: 0; top: 25%; animation-delay: -6s; animation-duration: 22s; }
.blobs i:nth-child(3) { width: 34vmax; height: 34vmax; background: #93c5fd; left: 25%; bottom: -5%; animation-delay: -12s; animation-duration: 26s; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .blobs { opacity: .22; } }
:root[data-theme="dark"] .blobs { opacity: .22; }
@keyframes blob { 33% { transform: translate(6vmax, -4vmax) scale(1.1) } 66% { transform: translate(-5vmax, 5vmax) scale(.92) } }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 400px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 30px; padding: 30px 26px 26px; box-shadow: var(--shadow-lg); animation: popin .6s var(--spring); }
.auth-logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent-2), var(--accent)); box-shadow: 0 14px 30px -10px var(--accent); animation: logo 3.5s ease-in-out infinite; }
.auth-logo svg { width: 34px; height: 34px; }
@keyframes logo { 50% { transform: translateY(-5px) rotate(-4deg) } }
.auth-card h1 { text-align: center; margin: 0; font-size: 27px; letter-spacing: -.035em; }
.auth-card .lead { text-align: center; margin: 6px 0 24px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); margin: 4px 0 18px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; }
.check .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-2); display: grid; place-items: center; transition: all .2s var(--ease); background: var(--surface); }
.check .box svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.5); transition: all .25s var(--spring); }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--focus); }

/* ---------- settings ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; animation: cardin .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); flex: none; }
.row .ico svg { width: 18px; height: 18px; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-weight: 620; font-size: 15px; }
.row .grow span { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; overflow-wrap: anywhere; }
.row.col { flex-direction: column; align-items: stretch; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--line-2); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--s-done); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px var(--focus); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; transition: all .2s var(--ease); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .4; transition: opacity .2s; }
.chip.on { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.chip.on i { opacity: 1; }

.quota { margin-top: 10px; }
.quota .bar { height: 10px; border-radius: 10px; background: var(--bg-2); overflow: hidden; }
.quota .bar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--s-done), var(--s-out)); width: 0; transition: width 1s var(--ease); }
.quota .legend { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.codebox { display: flex; gap: 8px; align-items: center; background: var(--bg-2); border-radius: 11px; padding: 8px 8px 8px 12px; font-family: var(--mono); font-size: 12.5px; overflow: hidden; margin-top: 8px; }
.codebox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.help ol { margin: 6px 0 0; padding-left: 20px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 720px) { #toasts { bottom: 28px; } }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 550; animation: toastin .4s var(--spring); }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: var(--s-done); }
.toast.bad svg { color: var(--s-bad); }
.toast.out { animation: toastout .25s var(--ease) forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(16px) scale(.95) } }
@keyframes toastout { to { opacity: 0; transform: translateY(10px) scale(.97) } }

/* ---------- page transitions ---------- */
.page { animation: pagein .38s var(--ease) both; }
.page.back { animation-name: pageback; }
@keyframes pagein { from { opacity: 0; transform: translateX(18px) } }
@keyframes pageback { from { opacity: 0; transform: translateX(-18px) } }
::view-transition-old(root) { animation: vt-out .2s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985) } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px) } }

.footer-note { text-align: center; color: var(--faint); font-size: 12px; margin-top: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
