/* Rassyna Smart Fleet Platform prototype — polish layer (depth, motion, interaction). Loaded after app.css.
   Petrol and teal only, with amber for attention. Entry animations run only under body.enter, which motion.js
   sets on a page change — never on the live refresh. */

:root {
  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 48, 58, .04), 0 2px 6px -2px rgba(34, 48, 58, .06);
  --shadow-md: 0 2px 4px rgba(34, 48, 58, .04), 0 10px 24px -10px rgba(34, 48, 58, .18);
  --shadow-hover: 0 4px 8px rgba(34, 48, 58, .05), 0 18px 36px -14px rgba(34, 48, 58, .26);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --petrol-grad: linear-gradient(135deg, #0d5468 0%, #0b4557 55%, #083544 100%);
}
body { background: #f4f6f7; background-image: radial-gradient(1200px 380px at 70% -120px, rgba(15, 107, 130, .07), transparent 70%); background-attachment: fixed; }

/* ---------- sidebar ---------- */
.side { background: var(--petrol-grad); }
.side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 260px; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 124px, rgba(255, 255, 255, .06) 124px 127px), linear-gradient(180deg, transparent, rgba(0, 0, 0, .12)); -webkit-mask: linear-gradient(180deg, transparent, #000); mask: linear-gradient(180deg, transparent, #000); }
.side > * { position: relative; z-index: 1; }
.nav a { transition: background .18s var(--ease), transform .18s var(--ease), opacity .18s; border-radius: 9px; }
.nav a:hover { transform: translateX(3px); background: rgba(255, 255, 255, .1); }
.nav a.on { background: #fff; color: var(--brand); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); font-weight: 650; }
.nav a.on .ic { opacity: 1; }
.nav a.on .n { background: var(--brand); color: #fff; }
.nav a .n.warn { background: #fff; color: var(--brand); animation: badge-pulse 2.4s ease-in-out infinite; }
.nav a.on .n.warn { background: var(--brand); color: #fff; }
@keyframes badge-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); } }
.nav-sec { opacity: .62; font-weight: 650; }

/* ---------- top bar ---------- */
.top { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.top .top-search { display: flex; align-items: center; }
.top .top-search input[type=search] { height: 36px; min-height: 36px; padding: 0 58px 0 36px; font-size: 13.5px; line-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; box-shadow: none; transition: background .2s, border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.top .top-search input[type=search]::placeholder { color: var(--muted); }
.top .top-search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.top .top-search input[type=search]:hover { background: #fff; border-color: var(--line-2); }
.top .top-search input[type=search]:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15, 107, 130, .12); }
.top .top-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; z-index: 1; transition: color .2s; }
.top .top-search:focus-within .ic { color: var(--brand); }
.top .top-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; white-space: nowrap; }
.top .top-search input:not(:placeholder-shown) ~ kbd, .top .top-search input:focus ~ kbd { opacity: 0; }
kbd { font: 600 10.5px/1 var(--font); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: #fff; color: var(--muted); }
.icon-btn, .user-btn { transition: background .15s; }
.icon-btn .dot { animation: pop .4s var(--ease); }
@keyframes pop { from { transform: scale(.4); } }

/* ---------- cards, KPIs ---------- */
.card { box-shadow: var(--shadow); border-color: #e9edee; transition: box-shadow .25s var(--ease); }
.card-h h3 { font-size: 15px; }
.kpis { gap: 14px; }
.kpi { overflow: hidden; border-color: #e9edee; padding: 15px 16px 14px; transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; isolation: isolate; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-2); transition: width .22s var(--ease); }
.kpi.tone-amber::before, .kpi.tone-red::before { background: var(--amber); }
.kpi.tone-green::before, .kpi.tone-blue::before { background: var(--brand); }
a.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #e9edee; }
a.kpi:hover::before { width: 5px; }
.kpi-l { font-weight: 600; }
.kpi-l .ic { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: #f1f5f7; color: var(--ink-2); flex: none; transition: transform .25s var(--ease), background .25s, color .25s; }
.kpi.tone-amber .kpi-l .ic, .kpi.tone-red .kpi-l .ic { background: var(--amber-bg); color: var(--amber); }
.kpi.tone-green .kpi-l .ic, .kpi.tone-blue .kpi-l .ic { background: var(--accent-soft); color: var(--brand); }
a.kpi:hover .kpi-l .ic { transform: rotate(-8deg) scale(1.08); background: var(--brand); color: #fff; }
.kpi-v { font-size: 30px; margin-top: 8px; }
.kpi.tone-amber { background: linear-gradient(180deg, #fff 40%, #fdf8ef); border-color: var(--amber-line); }
.kpi.tone-amber .kpi-v::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-left: 8px; vertical-align: middle; animation: live 1.8s ease-out infinite; }

/* cursor spotlight (motion.js sets --mx / --my) */
.spot { position: relative; }
.spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(15, 107, 130, .08), transparent 65%); z-index: -1; }
.spot:hover::after { opacity: 1; }

/* ---------- dashboard hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 18px; background: var(--petrol-grad); color: #fff; padding: 26px 28px; margin-bottom: 18px;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr); gap: 24px; align-items: center; box-shadow: 0 18px 40px -22px rgba(8, 53, 68, .8); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 260px at 88% -40px, rgba(255, 255, 255, .14), transparent 70%), radial-gradient(360px 200px at 0% 120%, rgba(0, 0, 0, .18), transparent 70%); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.2px); background-size: 18px 18px;
  -webkit-mask: linear-gradient(90deg, transparent 20%, #000 90%); mask: linear-gradient(90deg, transparent 20%, #000 90%); }
.hero > * { position: relative; z-index: 1; }
.hero-art { position: absolute !important; inset: 0; width: 100%; height: 100%; z-index: 0 !important; opacity: .55; }
.hero-truck { position: absolute !important; left: 0; top: 0; z-index: 0 !important; pointer-events: none; color: #fff; will-change: transform; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); opacity: 0; transition: opacity .6s; }
.hero-truck.on { opacity: .95; }
.hero-truck .ic { width: 22px; height: 22px; display: block; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); padding: 5px 11px 5px 9px; border-radius: 20px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #7fd6c2; animation: live 1.8s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(127, 214, 194, .8); } 100% { box-shadow: 0 0 0 9px rgba(127, 214, 194, 0); } }
.hero h1 { font-size: 30px; letter-spacing: -.02em; margin-top: 12px; line-height: 1.15; }
.hero-sub { color: var(--brand-ink); margin-top: 4px; font-size: 14px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero .btn { border-color: transparent; }
.hero .btn.primary { background: #fff; color: var(--brand); }
.hero .btn.primary:hover { filter: none; background: var(--brand-ink); }
.hero .btn:not(.primary) { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; border: 1px solid rgba(255, 255, 255, .25); }
.hero .btn:not(.primary):hover { background: rgba(255, 255, 255, .24); }
.hero .btn kbd { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); margin-left: 2px; }
.hero .req { background: rgba(255, 255, 255, .9); }
.hero-stats { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; }
.hero-stat { display: block; color: #fff; background: rgba(255, 255, 255, .11); border: 1px solid rgba(255, 255, 255, .2); border-radius: 14px; padding: 14px 15px; transition: transform .22s var(--ease), background .22s; min-width: 0; }
a.hero-stat:hover { text-decoration: none; transform: translateY(-3px); background: rgba(255, 255, 255, .19); }
.hero-stat.gauge { display: flex; align-items: center; gap: 12px; }
.hs-v { font-size: 28px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 3px 0 2px; white-space: nowrap; }
.hs-l { font-size: 12px; color: var(--brand-ink); line-height: 1.35; }
.ring { width: 70px; height: 70px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(255, 255, 255, .18); }
.ring-fg { stroke: #7fd6c2; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
body.enter .ring-fg { animation: ring-in 1.3s var(--ease) both .15s; }
@keyframes ring-in { from { stroke-dashoffset: var(--ring-c); } }

/* ---------- buttons ---------- */
.btn { border-radius: 10px; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, filter .2s; position: relative; overflow: hidden; }
.btn:hover { box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary, .btn.success { background-image: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0)); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 14px -8px rgba(15, 107, 130, .8); }
.btn.primary:hover, .btn.success:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 10px 20px -8px rgba(15, 107, 130, .75); }
.btn.ghost:hover, .btn[disabled]:hover { box-shadow: none; transform: none; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 255, 255, .45); pointer-events: none; animation: ripple .6s ease-out forwards; }
.btn:not(.primary):not(.success):not(.danger-solid) .ripple { background: rgba(15, 107, 130, .14); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }
.chip { transition: background .18s, border-color .18s, color .18s, transform .15s var(--ease); }
.chip:hover { transform: translateY(-1px); }
.chip.on { box-shadow: 0 6px 14px -8px rgba(15, 107, 130, .8); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], select, textarea { transition: border-color .15s, box-shadow .2s; border-radius: 9px; }
input:focus, select:focus, textarea:focus { outline: 0; box-shadow: 0 0 0 4px rgba(15, 107, 130, .12); }
.switch span { transition: background .2s var(--ease); }
.switch span::after { transition: transform .25s var(--ease); }

/* ---------- tabs with sliding indicator ---------- */
.tabs { position: relative; }
.tabs.has-ink .tab.on { border-bottom-color: transparent; }
.tab-ink { position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); pointer-events: none; transition: transform .35s var(--ease), width .35s var(--ease); }
.tab { transition: color .15s; }

/* ---------- tables and lists ---------- */
.tbl th { background: #f8fafb; }
.tbl tr.click td { transition: background .15s; }
.tbl tr.click:hover td { background: #f1f7f9; }
.tbl tr.click td:first-child { transition: box-shadow .2s var(--ease), background .15s; }
.tbl tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.list-i { transition: background .15s; }
.list-i:hover { background: #f8fafb; }
.list-i .ico { border-radius: 10px; transition: transform .25s var(--ease); }
.list-i:hover .ico { transform: scale(1.08); }
.badge { transition: transform .15s; }

/* progress: animated fill on page entry, moving stripes where work is running */
.prog { height: 8px; background: #e9edee; }
body.enter .prog i { animation: grow 1.1s var(--ease) both .1s; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.prog.tone-blue i { background-image: linear-gradient(135deg, rgba(255, 255, 255, .22) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .22) 75%, transparent 75%); background-size: 14px 14px; animation: stripes 1s linear infinite; }
body.enter .prog.tone-blue i { animation: grow 1.1s var(--ease) both .1s, stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 14px 0; } }
.flow-s { border-radius: 12px; transition: transform .2s var(--ease), box-shadow .2s; }
a.flow-s:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.health::before { background: var(--green); box-shadow: none; animation: live-g 1.8s ease-out infinite; }
@keyframes live-g { 0% { box-shadow: 0 0 0 0 rgba(30, 127, 79, .5); } 100% { box-shadow: 0 0 0 8px rgba(30, 127, 79, 0); } }
.tl li.done .dot { box-shadow: 0 0 0 3px var(--accent-soft); }

/* map markers breathe when live */
.map .truck-dot { transition: transform .4s var(--ease); }

/* ---------- page entry (only on a page change) ---------- */
body.enter .content > * { animation: rise-in .55s var(--ease) both; }
body.enter .content > *:nth-child(2) { animation-delay: .06s; }
body.enter .content > *:nth-child(3) { animation-delay: .12s; }
body.enter .content > *:nth-child(4) { animation-delay: .18s; }
body.enter .content > *:nth-child(n+5) { animation-delay: .22s; }
body.enter .kpis > * { animation: rise-in .5s var(--ease) both; }
body.enter .kpis > *:nth-child(2) { animation-delay: .1s; } body.enter .kpis > *:nth-child(3) { animation-delay: .14s; }
body.enter .kpis > *:nth-child(4) { animation-delay: .18s; } body.enter .kpis > *:nth-child(5) { animation-delay: .22s; }
body.enter .kpis > *:nth-child(6) { animation-delay: .26s; } body.enter .kpis > *:nth-child(7) { animation-delay: .3s; }
body.enter .kpis > *:nth-child(8) { animation-delay: .34s; }
body.enter .hero-stat { animation: rise-in .6s var(--ease) both .2s; }
body.enter .hero-stat + .hero-stat { animation-delay: .28s; }
body.enter .hero-stat + .hero-stat + .hero-stat { animation-delay: .36s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- modal, toast ---------- */
.modal-wrap { background: rgba(34, 48, 58, .38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s ease; }
.modal { border-radius: 16px; animation: modal-in .28s var(--ease); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35); }
.modal-foot { border-radius: 0 0 16px 16px; }
@keyframes modal-in { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.toast { border-radius: 12px; animation: toast-in .4s var(--ease); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .3); }
@keyframes toast-in { from { transform: translateX(40px) scale(.96); opacity: 0; } }

/* ---------- command palette ---------- */
.pal-wrap { position: fixed; inset: 0; z-index: 150; background: rgba(34, 48, 58, .38); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .15s ease; }
.pal { width: min(620px, 100%); background: #fff; border-radius: 16px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45); overflow: hidden; animation: modal-in .25s var(--ease); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in .ic { width: 18px; height: 18px; color: var(--brand); }
.pal-in input { border: 0 !important; box-shadow: none !important; font-size: 16px; padding: 0; min-height: 30px; background: transparent; }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 10px 10px 4px; }
.pal-i { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.pal-i .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pal-i .s { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pal-i.on { background: var(--accent-soft); color: var(--brand); }
.pal-i.on .ic { color: var(--brand); }
.pal-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); background: #f8fafb; }
.pal-empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------- sign-in ---------- */
.login-art { background: var(--petrol-grad); }
.login-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px 300px at 20% 0%, rgba(255, 255, 255, .14), transparent 70%); }
.login-art h1, .login-art p, .login-feats > div { animation: rise-in .7s var(--ease) both; }
.login-art p { animation-delay: .08s; }
.login-feats > div:nth-child(1) { animation-delay: .16s; } .login-feats > div:nth-child(2) { animation-delay: .22s; }
.login-feats > div:nth-child(3) { animation-delay: .28s; } .login-feats > div:nth-child(4) { animation-delay: .34s; }
.login-feats div { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 10px 12px; transition: background .2s, transform .2s var(--ease); }
.login-feats div:hover { background: rgba(255, 255, 255, .18); transform: translateY(-2px); }
.login-feats .ic { color: #fff; }
.route-art .flow-line { stroke-dasharray: 6 8; animation: dashmove 1.6s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -28; } }
.route-art .route-dot { animation: routepulse 2.4s ease-in-out infinite; }
@keyframes routepulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.login-card { animation: rise-in .55s var(--ease) both; }
.persona { border-radius: 12px; transition: transform .18s var(--ease), box-shadow .2s, border-color .2s, background .2s; }
.persona:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #fff; }
.otp input { border-radius: 12px; transition: transform .15s var(--ease), border-color .15s, box-shadow .2s; }
.otp input:focus { transform: translateY(-2px); }

@media (min-width: 961px) { .hero ~ .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .hero { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .hero-stats { grid-template-columns: minmax(0, 1fr); } .hero { padding: 20px; } .hero h1 { font-size: 24px; } .top-search kbd { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero-truck { display: none; }
}
@media print { .hero-truck, .hero-art { display: none; } }

/* avatars inside persona cards and the account button: keep the initials white */
.persona .avatar, .user-btn .avatar { display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px #fff, 0 2px 6px -2px rgba(34, 48, 58, .4); }

/* ---------- Petromen station keypad, pipeline strip & AI assistant ---------- */
.rtl { direction: rtl; text-align: right; }
.kbd-screen { background: #10222b; color: #eaf4f7; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.kbd-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed rgba(255, 255, 255, .12); }
.kbd-row:last-of-type { border-bottom: 0; }
.kbd-row.total { border-top: 1px solid rgba(255, 255, 255, .35); border-bottom: 0; margin-top: 4px; padding-top: 8px; font-weight: 700; }
.kbd-row b { font-variant-numeric: tabular-nums; }
.kbd-note { font-size: 11.5px; color: #5b6770; margin-top: 8px; line-height: 1.5; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; direction: ltr; }
.key { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; height: 44px; font-weight: 600; font-size: 16px; color: var(--ink); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.key.ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.key.c { color: var(--red); }

.pflow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pf { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 18px; padding: 5px 10px; font-size: 11.5px; }
.pf .ic { width: 14px; height: 14px; }
.pf b { font-weight: 600; }
.pf-n { font-size: 10.5px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand); border-radius: 10px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.pf.done { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.pf.cur { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(15, 107, 130, .8); }
.pf.cur .pf-n { background: rgba(255, 255, 255, .18); border-color: transparent; color: #fff; }
.pf.stop { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.pf-ln { width: 14px; height: 2px; background: var(--line); border-radius: 2px; }
.pf-ln.done { background: var(--accent); }

.chat { display: flex; flex-direction: column; gap: 14px; }
.chat-i { display: flex; flex-direction: column; gap: 6px; }
.chat-q { align-self: flex-end; max-width: 78%; background: var(--brand); color: #fff; border-radius: 14px 14px 4px 14px; padding: 9px 13px; font-size: 13.5px; }
.chat-meta { display: block; font-size: 10.5px; opacity: .75; margin-top: 3px; }
.chat-a { align-self: flex-start; max-width: 86%; display: flex; gap: 8px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 14px 14px 14px 4px; padding: 10px 13px; font-size: 13.5px; line-height: 1.55; }
.chat-a .ic { width: 16px; height: 16px; color: var(--brand); flex: 0 0 auto; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }

/* ---------- AI assistant polish ---------- */
.ai-bar { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.ai-chips { flex: 1; margin: 0; }
.chat-a-wrap { align-self: flex-start; max-width: 86%; display: flex; flex-direction: column; gap: 4px; }
.chat-a-wrap .chat-a { max-width: 100%; }
.chat-acts { opacity: .55; transition: opacity .15s ease; }
.chat-i:hover .chat-acts { opacity: 1; }
.ai-link { color: var(--brand); font-weight: 600; text-decoration: none; border-bottom: 1px dashed var(--brand-line); }
.ai-link:hover { border-bottom-style: solid; }
.chat-typing { align-items: center; padding: 12px 14px; }
.tdots { display: inline-flex; gap: 4px; }
.tdots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .35; animation: tdot 1s infinite; }
.tdots i:nth-child(2) { animation-delay: .15s; }
.tdots i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

/* ---------- guided demo ---------- */
#guide-root { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; width: min(680px, calc(100vw - 32px)); pointer-events: none; }
.guide-bar { pointer-events: auto; display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px -18px rgba(13, 79, 99, .45), 0 4px 14px -8px rgba(0, 0, 0, .2); padding: 14px 16px; animation: guide-in .28s ease; }
.guide-bar .g-ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; }
.guide-bar .g-ic .ic { width: 17px; height: 17px; }
.guide-main { flex: 1; min-width: 0; }
.guide-kick { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.guide-tag { background: var(--amber-bg, #fdf3e3); color: var(--amber, #a05e03); border: 1px solid var(--amber-line, #f0d9b0); border-radius: 8px; padding: 0 6px; font-size: 9.5px; letter-spacing: .3px; }
.guide-t { font-weight: 700; font-size: 15.5px; color: var(--ink); margin-top: 3px; }
.guide-b { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-top: 4px; }
.guide-act { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.guide-dots { display: flex; gap: 4px; flex: 1; }
.guide-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.guide-dots i.done { background: var(--accent-soft); }
.guide-dots i.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(15, 107, 130, .18); }
.guide-hl { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; animation: guide-pulse 1.6s ease-in-out infinite; }
@keyframes guide-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(15, 107, 130, .35); } 50% { box-shadow: 0 0 0 10px rgba(15, 107, 130, 0); } }
@keyframes guide-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  #guide-root { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .guide-b { display: none; }
  .guide-act { flex-wrap: wrap; row-gap: 8px; }
  .guide-dots { flex: 1 0 100%; }
  .guide-act .btn { flex: 0 0 auto; }
}
