:root{
  --uv-bg:#ffffff;
  --uv-bubble:#efefef;
  --uv-txt:#1c1c1e;
  --uv-mut:#8e8e93;
  --uv-line:#ededed;
  --uv-black:#111111;
  --uv-blue:#0095f6;
  --uv-red:#b23b2e;
  --uv-wave-off:#c6c6cc;
  --uv-wave-on:#2a2a2e;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--uv-bg);
  color:var(--uv-txt);
  -webkit-font-smoothing:antialiased;
}

/* ---------- HOME ---------- */
.uv-home{background:#fafafa}
.uv-home-wrap{max-width:520px;margin:0 auto;padding:28px 18px 60px}
.uv-home-head{text-align:center;margin:14px 0 22px}
.uv-home-title{font-size:24px;font-weight:800;letter-spacing:.2px}
.uv-home-sub{color:var(--uv-mut);font-size:14px;margin:6px 0 0}
.uv-home-list{display:flex;flex-direction:column;gap:12px}
.uv-home-card{
  display:flex;align-items:center;gap:14px;text-decoration:none;color:inherit;
  background:#fff;border:1px solid #ececec;border-radius:16px;padding:14px 16px;
  transition:transform .12s ease,box-shadow .12s ease;
}
.uv-home-card:active{transform:scale(.99)}
.uv-home-av{width:52px;height:52px;border-radius:50%;background:#eee center/cover no-repeat;flex:0 0 auto}
.uv-home-info{flex:1;min-width:0;display:flex;flex-direction:column}
.uv-home-name{font-size:16px;font-weight:700;line-height:1.25}
.uv-home-desc{font-size:13px;color:var(--uv-mut);margin-top:2px}
.uv-home-arrow{font-size:26px;color:#c4c4c9;line-height:1}
.uv-empty{color:var(--uv-mut);text-align:center;padding:40px 0}

/* ---------- CHAT SHELL ---------- */
.uv-chat-body{background:var(--uv-bg)}
.uv-chat{
  display:flex;flex-direction:column;
  max-width:520px;margin:0 auto;
  height:100dvh;height:100vh;position:relative;overflow:hidden;
  background:var(--uv-bg);
  border-left:1px solid var(--uv-line);border-right:1px solid var(--uv-line);
}

/* ---------- HEADER ---------- */
.uv-header{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px 11px;
  padding-top:calc(10px + env(safe-area-inset-top));
  border-bottom:1px solid var(--uv-line);
  flex:0 0 auto;background:var(--uv-bg);
}
.uv-back{font-size:30px;line-height:1;color:#111;text-decoration:none;padding:0 2px;flex:0 0 auto}
.uv-av{width:38px;height:38px;border-radius:50%;background:#eee center/cover no-repeat;flex:0 0 auto}
.uv-id{flex:1;min-width:0}
.uv-name{display:flex;align-items:center;gap:4px;font-size:15px;font-weight:700;color:#111;line-height:1.2}
.uv-name span{white-space:normal}
.uv-badge{flex:0 0 auto}
.uv-user{font-size:12px;color:var(--uv-mut);line-height:1.25;margin-top:1px}
.uv-prof{
  flex:0 0 auto;font-size:13px;font-weight:600;color:#111;text-decoration:none;
  background:#f1f1f2;border-radius:9px;padding:8px 12px;white-space:nowrap;
}
.uv-prof:active{background:#e6e6e8}

/* ---------- MESSAGES ---------- */
.uv-msgs{
  flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:16px 12px 10px;display:flex;flex-direction:column;gap:8px;
}
.uv-row{display:flex;justify-content:flex-start}
.uv-row.enter{animation:uvpop .3s ease both}
@keyframes uvpop{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

.uv-bub{
  max-width:80%;background:var(--uv-bubble);color:var(--uv-txt);
  font-size:15px;line-height:1.45;padding:10px 14px;border-radius:20px;
  border-bottom-left-radius:6px;white-space:pre-wrap;overflow-wrap:break-word;word-break:break-word;
}
.uv-bub a{color:var(--uv-blue);text-decoration:none}

.uv-img{max-width:74%}
.uv-img img{width:100%;display:block;border-radius:18px}

/* ---------- AUDIO ---------- */
.uv-audio{
  display:flex;align-items:center;gap:10px;
  background:var(--uv-bubble);border-radius:22px;border-bottom-left-radius:6px;
  padding:9px 12px;max-width:82%;
}
.uv-play{
  width:34px;height:34px;border-radius:50%;background:var(--uv-black);border:none;
  display:flex;align-items:center;justify-content:center;flex:0 0 auto;cursor:pointer;padding:0;
}
.uv-play svg{width:16px;height:16px;fill:#fff}
.uv-wave{display:flex;align-items:center;gap:2px;height:26px;flex:1 1 auto;min-width:0;overflow:hidden}
.uv-wave i{width:2.5px;min-width:2.5px;border-radius:2px;background:var(--uv-wave-off);display:block}
.uv-wave i.on{background:var(--uv-wave-on)}
.uv-dur{font-size:12px;color:var(--uv-mut);flex:0 0 auto;font-variant-numeric:tabular-nums}

/* ---------- LINK CARD ---------- */
.uv-card{max-width:84%;background:var(--uv-bubble);border-radius:18px;border-bottom-left-radius:6px;overflow:hidden}
.uv-card-img{width:100%;display:block;aspect-ratio:1/1;object-fit:cover;background:#ddd}
.uv-card-bd{padding:12px 14px 2px}
.uv-card-t{font-size:15px;font-weight:700;color:#111;line-height:1.3}
.uv-card-d{font-size:13px;color:#4a4a4f;margin-top:3px;line-height:1.35}
.uv-card-btn{
  display:block;margin:11px 12px 12px;background:#fff;border:1px solid #e2e2e4;border-radius:12px;
  padding:13px;text-align:center;font-size:15px;font-weight:700;color:#111;text-decoration:none;
}
.uv-card-btn:active{background:#f7f7f7}

/* ---------- VIDEO THUMB ---------- */
.uv-vid{position:relative;width:200px;max-width:74%;border-radius:18px;overflow:hidden;cursor:pointer;background:#222}
.uv-vid img{width:100%;display:block}
.uv-vid .uv-vph{width:100%;aspect-ratio:3/4;background:#2b2b2f}
.uv-vid .uv-vplay{
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:48px;height:48px;border-radius:50%;background:rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;
}
.uv-vid .uv-vplay svg{width:22px;height:22px;fill:#fff;margin-left:2px}

/* ---------- TYPING / RECORDING ---------- */
.uv-typing{display:flex;gap:5px;background:var(--uv-bubble);width:54px;justify-content:center;padding:14px;border-radius:20px;border-bottom-left-radius:6px}
.uv-typing i{width:7px;height:7px;border-radius:50%;background:#a7a7ac;animation:uvbl 1.2s infinite}
.uv-typing i:nth-child(2){animation-delay:.2s}
.uv-typing i:nth-child(3){animation-delay:.4s}
@keyframes uvbl{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.uv-rec{display:flex;align-items:center;gap:8px;background:var(--uv-bubble);padding:12px 14px;border-radius:20px;border-bottom-left-radius:6px;font-size:13px;color:var(--uv-mut)}
.uv-rec .uv-recdot{width:9px;height:9px;border-radius:50%;background:#e0245e;animation:uvbl 1.2s infinite}

/* ---------- FAKE INPUT ---------- */
.uv-input{
  display:flex;align-items:center;gap:8px;padding:10px 12px;
  padding-bottom:calc(10px + env(safe-area-inset-bottom));
  border-top:1px solid var(--uv-line);flex:0 0 auto;background:var(--uv-bg);
}
.uv-camb{width:36px;height:36px;border-radius:50%;background:var(--uv-black);display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.uv-field{flex:1;min-width:0;background:#f1f1f2;border-radius:20px;height:40px;display:flex;align-items:center;overflow:hidden;cursor:default;padding:0 4px}
.uv-marquee{display:inline-flex;white-space:nowrap;color:var(--uv-mut);font-size:13.5px;animation:uvscroll 14s linear infinite}
.uv-marquee span{padding-left:10px}
@keyframes uvscroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}
.uv-icns{display:flex;align-items:center;gap:4px;flex:0 0 auto}
.uv-restart{background:none;border:none;padding:6px;cursor:pointer;display:flex;align-items:center;justify-content:center}

/* ---------- VIDEO MODAL ---------- */
.uv-modal{position:absolute;inset:0;background:rgba(0,0,0,.82);display:none;align-items:center;justify-content:center;padding:0 22px;z-index:30}
.uv-modal.open{display:flex}
.uv-vwrap{position:relative;width:100%;max-width:460px;height:70%;display:flex;align-items:center;justify-content:center}
.uv-vstage{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.uv-vstage video{width:100%;height:100%;border-radius:16px;background:#000;object-fit:contain}
.uv-vx{position:absolute;top:-6px;right:-6px;width:34px;height:34px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;border:none;font-size:22px;line-height:1;cursor:pointer;z-index:2;display:flex;align-items:center;justify-content:center}

/* ---------- TOAST ---------- */
.uv-toast{
  position:absolute;left:50%;bottom:80px;transform:translateX(-50%) translateY(8px);
  background:rgba(0,0,0,.82);color:#fff;font-size:13px;padding:10px 16px;border-radius:16px;
  max-width:82%;text-align:center;opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:40;
}
.uv-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
