/* Live Share (live.php) — builds on app.css tokens and components. */
body.live-page { background: var(--bg, var(--surface-2)); min-height: 100vh; }
.lv-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, calc((100vw - 900px) / 2)); background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.lv-nav { display: flex; align-items: center; gap: 14px; }
.lv-nav > a:not(.btn) { color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.lv-main { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }
.lv-center { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 80px 0; color: var(--muted); font-weight: 600; }
.lv-center .ic { color: var(--accent); }

/* home */
.lv-hero { text-align: center; padding: 16px 0 8px; }
.lv-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.lv-hero h1 { font: 800 clamp(30px, 6vw, 46px)/1.08 var(--font-display); letter-spacing: -.03em; margin: 14px auto 12px; max-width: 700px; }
.lv-hero > p { max-width: 580px; margin: 0 auto 26px; color: var(--text-2); font-size: 16.5px; line-height: 1.55; }
.lv-drop { display: grid; justify-items: center; gap: 8px; max-width: 560px; margin: 0 auto; padding: 44px 20px; border-radius: 26px; cursor: pointer; text-align: center;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6 60%, #22d3ee); color: #fff; box-shadow: 0 24px 50px -24px rgba(79, 70, 229, .7); transition: transform .2s, box-shadow .2s; }
.lv-drop:hover, .lv-drop.over { transform: translateY(-2px); box-shadow: 0 30px 60px -24px rgba(79, 70, 229, .85); }
.lv-drop-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: rgba(255, 255, 255, .18); }
.lv-drop-ic .ic { width: 32px; height: 32px; }
.lv-drop b { font: 800 22px var(--font-display); }
.lv-drop small { opacity: .85; font-size: 14px; }
.lv-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin-top: 30px; }
.lv-feats > div { display: grid; gap: 6px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.lv-feats .ic { color: var(--accent); width: 24px; height: 24px; }
.lv-feats b { font-size: 15px; }
.lv-feats small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.lv-how { margin-top: 28px; }
.lv-how h2 { font: 800 20px var(--font-display); margin: 0 0 10px; }
.lv-how ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); line-height: 1.5; }

/* cards (sender + receiver) */
.lv-send, .lv-recv { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.lv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; min-width: 0; }
.lv-card h2 { font: 800 20px var(--font-display); margin: 10px 0 12px; }
.lv-card h3 { font: 700 16px var(--font); margin: 0; }
.lv-cardh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.lv-live { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.lv-dot { width: 10px; height: 10px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: lvPulse 1.8s infinite; }
@keyframes lvPulse { 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.lv-linkrow { display: flex; gap: 8px; }
.lv-linkrow .input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }
.lv-sharebtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.lv-qr { display: grid; place-items: center; margin-top: 14px; padding: 16px; background: #fff; border-radius: 16px; width: fit-content; }
.lv-qr[hidden] { display: none; }
.lv-keep { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #f59e0b 12%, transparent); font-size: 13.5px; line-height: 1.45; }
.lv-keep .ic-sm { color: #d97706; flex: none; margin-top: 2px; }
.lv-recv .lv-keep { background: var(--soft); }
.lv-recv .lv-keep .ic-sm { color: var(--accent); }

.lv-files, .lv-peers { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.lv-file, .lv-peer { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.lv-file .thumb { width: 42px; height: 42px; flex: none; }
.lv-file .grow, .lv-peer .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lv-file b, .lv-peer b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-file small, .lv-peer small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-file .bar, .lv-peer .bar { margin-top: 6px; height: 6px; }
.lv-file .btn { flex: none; }
.lv-file.done small { color: var(--ok, #10b981); }
.lv-file.gone { opacity: .55; }
.lv-pic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--soft); color: var(--accent); flex: none; }
.lv-peer.failed small { color: var(--bad); }
.lv-peer.gone { display: none; }
.lv-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; }

/* receiver */
.lv-rhead { display: flex; align-items: center; gap: 14px; }
.lv-rhead h1 { font: 800 22px var(--font-display); margin: 0 0 2px; }
.lv-rhead p { margin: 0; font-size: 14px; display: flex; gap: 6px; align-items: flex-start; }
.lv-rhead p .ic-sm { flex: none; margin-top: 2px; }
.lv-rhead p.ok { color: var(--ok, #10b981); }
.lv-rhead p.warn { color: #d97706; }
.lv-rhead p.bad { color: var(--bad); }
.lv-bigic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--soft); color: var(--accent); flex: none; }
.lv-bigic .ic { width: 28px; height: 28px; }
.lv-bigic.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.lv-msg { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 60px 10px; }
.lv-msg h1 { font: 800 26px var(--font-display); margin: 6px 0 0; }
.lv-msg p { max-width: 460px; color: var(--text-2); margin: 0 0 8px; line-height: 1.5; }

@media (max-width: 600px) {
  .lv-top .brand span { display: none; }
  .lv-card { padding: 14px; border-radius: 18px; }
  .lv-linkrow { flex-direction: column; }
  .lv-file { flex-wrap: wrap; }
  .lv-file .grow { flex-basis: calc(100% - 60px); }
  .lv-file .btn { flex: 1; }
  .lv-drop { padding: 34px 16px; }
}

/* ── Design A: the flow card (both sides) ─────────────────────── */
.lv-main { max-width: 1000px; }
.lv-hero2 { position: relative; overflow: hidden; border-radius: 28px; padding: 24px 26px 22px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #6d5dfc 0%, #4f46e5 45%, #312e81 100%); box-shadow: 0 30px 60px -34px rgba(49, 46, 129, .9); }
.lv-hero2::after { content: ""; position: absolute; right: -90px; bottom: -130px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(rgba(34, 211, 238, .35), transparent 70%); pointer-events: none; }
.lv-livebadge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .14); font: 800 12px var(--font); letter-spacing: .06em; text-transform: uppercase; }
.lv-hero2 .lv-dot { background: #34d399; }
.lv-hero2 h1 { position: relative; font: 800 clamp(24px, 4vw, 32px)/1.15 var(--font-display); letter-spacing: -.02em; margin: 14px 0 4px; }
.lv-hero2 [data-status] { position: relative; margin: 0; opacity: .85; font-size: 14.5px; display: flex; gap: 6px; align-items: flex-start; }
.lv-hero2 [data-status] .ic-sm { flex: none; margin-top: 2px; }
.lv-hero2 [data-status].ok { opacity: 1; color: #a7f3d0; }
.lv-hero2 [data-status].warn { opacity: 1; color: #fde68a; }
.lv-hero2 [data-status].bad { opacity: 1; color: #fecaca; }
.lv-flow { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; margin: 22px 0 18px; }
.lv-dev { display: grid; justify-items: center; gap: 6px; font: 600 12.5px var(--font); max-width: 130px; text-align: center; }
.lv-dev > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.lv-devbox { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: rgba(255, 255, 255, .14); }
.lv-devbox .ic { width: 28px; height: 28px; }
.lv-line { position: relative; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .18); margin-bottom: 22px; align-self: start; margin-top: 28px; }
.lv-line i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #22d3ee, #a78bfa); transition: width .5s ease; }
.lv-line b { position: absolute; top: -3px; left: -6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px #fff; transition: left .5s ease; }
/* sending: light keeps flowing along the line */
.lv-hero2.active .lv-line i { background: linear-gradient(90deg, #22d3ee, #a78bfa, #22d3ee); background-size: 200% 100%; animation: lvFlow 1.2s linear infinite; }
@keyframes lvFlow { to { background-position: -200% 0; } }
/* waiting: a dashed line with dots drifting toward the receiver */
.lv-hero2.idle .lv-line { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 8px, transparent 8px 16px); background-size: 32px 6px; animation: lvDash 1.4s linear infinite; }
.lv-hero2.idle .lv-line b { display: none; }
@keyframes lvDash { to { background-position: 32px 0; } }
.lv-flowtag { grid-column: 1 / -1; justify-self: center; margin-top: 2px; font: 600 12.5px var(--font); opacity: .9; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-stats { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lv-stats div { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .1); min-width: 0; }
.lv-stats b { display: block; font: 800 20px var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-stats span { font-size: 12px; opacity: .75; }

.lv-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.lv-side { display: grid; gap: 14px; min-width: 0; }
.lv-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font: 800 16px var(--font-display); }
.lv-card h3 .muted { font: 600 13px var(--font); margin-left: auto; }
.lv-share .lv-linkrow .input { background: var(--surface-2); }
.lv-wa { background: #dcfce7; color: #15803d; border-color: transparent; }
.lv-qrrow { display: flex; gap: 16px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.lv-qrrow .lv-qr { margin: 0; padding: 8px; box-shadow: 0 8px 22px -12px rgba(15, 23, 42, .45); flex: none; }
.lv-qrrow .lv-qr img, .lv-qrrow .lv-qr canvas { display: block; }
.lv-qrrow p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.lv-qrrow p b { display: block; color: var(--text); font-size: 14px; }
.lv-add { margin-top: 10px; }
.lv-stop { justify-self: center; }
.lv-recv .lv-hero2 + .lv-card { margin-top: 0; }

@media (max-width: 720px) {
  .lv-grid { grid-template-columns: minmax(0, 1fr); }
  .lv-hero2 { padding: 20px 18px 18px; border-radius: 24px; }
  .lv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lv-devbox { width: 50px; height: 50px; border-radius: 16px; }
  .lv-dev { max-width: 92px; } .lv-dev > span:last-child { max-width: 92px; }
  .lv-linkrow { flex-direction: column; }
  .lv-qrrow .lv-qr img { width: 120px !important; height: 120px !important; }
  .lv-line { margin-top: 22px; }
  .lv-send .lv-file { flex-wrap: nowrap; }
  .lv-send .lv-file .grow { flex-basis: auto; }
}
