/* Villa Azzurra Help Center (/villa-azzurra/help/), scripts/support.mjs. Uses the site tokens from style.css.
   Look: the game's Riviera — azure sea, lemon, majolica tiles, the cast at the front desk. */
.page-help { background: var(--cream); }

/* ---------- Hero ---------- */
.help-hero { position: relative; isolation: isolate; overflow: hidden; color: #fff; padding: calc(96px + env(safe-area-inset-top)) 0 104px; }
.help-hero-bg { position: absolute; inset: 0; z-index: -2; }
.help-hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 35%; }
.help-hero-shade { position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 90% at 92% 0, rgba(255, 207, 63, .28), transparent 60%),
    linear-gradient(100deg, rgba(6, 34, 56, .93) 0, rgba(8, 48, 78, .82) 45%, rgba(10, 61, 92, .45) 100%); }
.help-hero-in { position: relative; }
.help-crumbs { padding: 0 0 18px; }
.help-crumbs a, .help-crumbs i { color: var(--on-dark-muted); }
.help-kicker { font-family: var(--display); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--lemon); margin: 0 0 8px; }
.help-kicker a { display: inline-flex; align-items: center; gap: 8px; color: var(--lemon-2); text-decoration: none; padding: 5px 14px 5px 6px; border-radius: 999px; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); letter-spacing: .08em; }
.help-kicker a:hover { background: rgba(255, 255, 255, .2); }
.help-kicker img { width: 22px; height: 22px; }
.help-hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 700; margin: 0 0 20px; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); max-width: 820px; }
.help-hero h1 span { display: block; background: linear-gradient(90deg, var(--lemon-2), var(--lemon) 45%, #ffb35c); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.help-lead { color: var(--on-dark-muted); font-size: 1.1rem; max-width: 600px; }
.help-hero .wave { fill: var(--cream); bottom: -1px; }
.help-hero-sm { padding-bottom: 92px; }
.help-hero-sm h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin-bottom: 14px; }
.help-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; font-size: .92rem; }
.help-meta span { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: var(--on-dark); }

.help-search { position: relative; max-width: 640px; margin: 4px 0 18px; }
.help-search svg { position: absolute; left: 20px; top: 50%; width: 22px; height: 22px; translate: 0 -50%; color: var(--sea-3); pointer-events: none; }
.help-search input {
  width: 100%; height: 60px; border: 0; border-radius: 999px; padding: 0 22px 0 54px; font: 600 1.05rem var(--body); color: var(--ink); background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 207, 63, .35), var(--shadow-lg); outline: none; -webkit-appearance: none; appearance: none;
}
.help-search input:focus { box-shadow: 0 0 0 4px var(--lemon), var(--shadow-lg); }
.help-search input::placeholder { color: #8a99a6; font-weight: 500; }
.help-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.help-chips a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 8px; border-radius: 999px; font-family: var(--display); font-weight: 500; font-size: .95rem; color: #fff; text-decoration: none;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, transform .2s var(--spring); }
.help-chips a:hover { background: rgba(255, 255, 255, .26); transform: translateY(-2px); }
.help-chips img { width: 24px; height: 24px; }


/* ---------- Hub ---------- */
.help-main { padding: 34px 0 72px; }
.help-h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); margin: 0 0 18px; }
.help-h2 a { color: inherit; text-decoration-color: var(--lemon); }
.help-cat-nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -20px 22px; padding-inline: 20px; }
.help-cat-nav::-webkit-scrollbar { display: none; }
.help-cat-nav a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px 7px 8px; border-radius: 999px; font-family: var(--display); font-weight: 500; color: var(--text); text-decoration: none; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 4px 12px -6px rgba(11, 34, 54, .2); transition: background .2s; }
.help-cat-nav a:hover { background: var(--sand); }
.help-cat-nav img { width: 28px; height: 28px; }
.help-cats { display: grid; gap: 18px; grid-template-columns: 1fr; }
.help-cat { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: var(--r-lg); padding: 20px 20px 12px; box-shadow: var(--shadow); scroll-margin-top: 90px; color: inherit; text-decoration: none; overflow: hidden; }
.help-cat::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: url(/assets/help/majolica.svg) 0 -14px / 22px 22px repeat-x; opacity: .9; }
.help-cat header { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }
.help-cat header img { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 4px 6px rgba(11, 34, 54, .18)); }
.help-cat h2 { font-size: 1.32rem; margin: 0; }
.help-cat header span { font-size: .88rem; color: var(--muted); font-weight: 700; }
.help-cat ul { list-style: none; margin: 0; padding: 0; }
.help-cat li + li { border-top: 1px solid var(--line); }
.help-cat li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px; color: var(--ink); text-decoration: none; font-weight: 700; border-radius: 12px; transition: background .2s, color .2s; }
.help-cat li a b { color: var(--sea-3); font-size: 1.3rem; line-height: 1; transition: transform .2s var(--spring); }
.help-cat li a:hover { background: #fff6d6; color: var(--sea-2); }
.help-cat li a:hover b { transform: translateX(4px); }
.help-cat-contact { background: linear-gradient(160deg, #fffaf0, var(--sand)); box-shadow: inset 0 0 0 1px var(--sand-2), var(--shadow); padding-bottom: 22px; transition: transform .25s var(--spring); }
.help-cat-contact:hover { transform: translateY(-3px); }
.help-cat-contact p { color: var(--muted); margin: 0 0 16px; }
.help-cat-contact .btn { align-self: flex-start; margin-top: auto; }

.help-results { min-height: 200px; }
.help-result-list { display: grid; gap: 12px; margin-bottom: 22px; }
.help-result { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform .2s var(--spring); }
.help-result:hover { transform: translateY(-2px); }
.help-result img { width: 44px; height: 44px; flex: none; }
.help-result span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.help-result small { font-family: var(--display); font-weight: 600; color: var(--coral); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.help-result b { font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ink); }
.help-result em { font-style: normal; color: var(--muted); font-size: .94rem; }
.help-noresult { color: var(--muted); }

/* ---------- Contact (front desk) ---------- */
.help-band { position: relative; background: radial-gradient(120% 90% at 85% 0, #11618f 0, var(--sea) 50%, #08304a 100%); padding: 72px 0 80px; overflow: hidden; }
.help-band::before { content: ""; position: absolute; inset: 0 0 auto; height: 34px; background: url(/assets/help/majolica.svg) 0 0 / 34px 34px repeat-x; box-shadow: inset 0 -2px 0 #1f6fb2; }
.help-contact { position: relative; display: grid; grid-template-columns: 1fr; gap: 0; background: var(--cream); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); scroll-margin-top: 90px; margin-top: 70px; }
.hc-art { position: relative; height: 0; display: flex; justify-content: center; }
.hc-art > img:first-child { position: absolute; bottom: -10px; width: 150px; height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .25)); }
.hc-bell { position: absolute; bottom: -24px; left: calc(50% + 46px); width: 56px; height: 56px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3)); animation: hc-ring 4s 1.5s infinite; transform-origin: 50% 90%; }
@keyframes hc-ring { 0%, 86%, 100% { rotate: 0deg; } 89% { rotate: -14deg; } 92% { rotate: 12deg; } 95% { rotate: -6deg; } }
.hc-body { padding: 44px 22px 24px; }
.help-contact h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); color: var(--ink); }
.help-contact .help-kicker { color: var(--coral); }
.hc-body > p { color: var(--muted); max-width: 560px; }
.hc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 22px; }
.hc-actions .btn svg { width: 20px; height: 20px; flex: none; }
.hc-actions .btn-glass-dark { font-size: .98rem; }
.hc-ingame { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: #fff; box-shadow: inset 0 0 0 1px var(--sand-2); }
.hc-ingame img { width: 44px; height: 44px; flex: none; }
.hc-ingame p { margin: 0; font-size: .95rem; color: var(--text); }

/* ---------- Wiki links ---------- */
.help-wiki { padding: 64px 0 84px; }
.help-wiki-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.help-wiki-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); color: var(--muted); text-decoration: none; transition: transform .2s var(--spring); }
.help-wiki-card:hover { transform: translateY(-3px); }
.help-wiki-card img { width: 48px; height: 48px; flex: none; }
.help-wiki-card b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ink); }

/* ---------- Article ---------- */
.help-article-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.help-article { position: relative; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 30px 20px 18px; }
.help-article-icon { position: absolute; top: -40px; right: 18px; width: 64px; height: 64px; filter: drop-shadow(0 6px 10px rgba(11, 34, 54, .25)); }
.help-prose { font-size: 1.04rem; line-height: 1.72; color: var(--text); overflow-wrap: anywhere; }
.help-prose > :first-child { margin-top: 0; }
.help-prose h2 { font-size: clamp(1.3rem, 2.6vw, 1.55rem); color: var(--ink); margin: 1.7em 0 .55em; scroll-margin-top: 90px; display: flex; align-items: center; gap: 10px; }
.help-prose h2::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 4px; rotate: 45deg; background: var(--lemon); box-shadow: 0 0 0 3px #fff3c2; }
.help-prose h3 { font-size: 1.18rem; margin: 1.4em 0 .4em; color: var(--ink); }
.help-prose h4 { font-size: 1.04rem; margin: 1.2em 0 .3em; }
.help-prose p { margin: 0 0 1em; }
.help-prose strong { color: var(--ink); font-weight: 800; }
.help-prose ul, .help-prose ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.help-prose li { margin: .3em 0; padding-left: .2em; }
.help-prose ul li::marker { content: "● "; color: var(--lemon-d); font-size: .8em; }
.help-prose ol li::marker { font-family: var(--display); font-weight: 600; color: var(--sea-3); }
.help-prose a { color: var(--sea-3); font-weight: 700; }
.help-prose a.xref { text-decoration-color: rgba(255, 207, 63, .9); text-decoration-thickness: 3px; }
.help-prose blockquote { margin: 0 0 1.1em; padding: 12px 18px; border-radius: 14px; background: #fff6d6; border-left: 4px solid var(--lemon); }
.help-prose blockquote p { margin: 0; }
.help-prose code { font-size: .9em; background: var(--sand); padding: 2px 6px; border-radius: 6px; }
.help-prose pre { background: var(--ink); color: #e6f0f6; padding: 14px 16px; border-radius: 14px; overflow-x: auto; }
.help-prose pre code { background: none; padding: 0; }
.help-prose img { border-radius: 14px; margin: 1em auto; box-shadow: var(--shadow); height: auto; }
.help-prose hr { border: 0; height: 18px; margin: 1.6em 0; background: url(/assets/help/majolica.svg) center / 18px 18px repeat-x; opacity: .7; }
.help-prose .video-embed, .help-prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; }
.help-article-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .94rem; color: var(--muted); }
.help-article-foot a { font-weight: 700; }

.help-side { display: grid; gap: 14px; }
.help-side-box { background: #fff; border-radius: var(--r); padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--line); }
.help-side-box h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.help-side-box ul, .help-side-box ol { list-style: none; margin: 0; padding: 0; }
.help-side-box li a { display: block; padding: 6px 0; color: var(--sea-2); font-weight: 700; text-decoration: none; line-height: 1.35; }
.help-side-box li a:hover { color: var(--sea-3); text-decoration: underline; }
.help-toc ol { counter-reset: toc; }
.help-toc li a::before { counter-increment: toc; content: counter(toc) ". "; color: var(--lemon-d); font-family: var(--display); }
.help-side-wiki { background: linear-gradient(160deg, #fffaf0, var(--sand)); box-shadow: inset 0 0 0 1px var(--sand-2); }
.help-side-search label { display: block; font-family: var(--display); font-weight: 600; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.help-side-search div { display: flex; gap: 8px; }
.help-side-search input { flex: 1; min-width: 0; height: 44px; border: 0; border-radius: 999px; padding: 0 16px; font: 600 1rem var(--body); background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); outline: none; }
.help-side-search input:focus { box-shadow: inset 0 0 0 2px var(--sea-3); }
.help-side-search button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--sea-3); color: #fff; display: grid; place-items: center; cursor: pointer; }
.help-side-search button svg { width: 20px; height: 20px; }

.help-related { padding-top: 48px; }
.help-related-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.help-rel-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); text-decoration: none; transition: transform .2s var(--spring); }
.help-rel-card:hover { transform: translateY(-3px); }
.help-rel-card img { width: 44px; height: 44px; flex: none; }
.help-rel-card small { display: block; font-family: var(--display); font-weight: 600; color: var(--coral); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; }
.help-rel-card b { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--ink); line-height: 1.25; }

/* ---------- Wider screens ---------- */
@media (min-width: 700px) {
  .help-hero { padding-top: calc(110px + env(safe-area-inset-top)); padding-bottom: 120px; }
  .help-cats { grid-template-columns: 1fr 1fr; gap: 22px; }
  .help-cat { padding: 24px 24px 14px; }
  .help-cat-nav { flex-wrap: wrap; overflow: visible; margin: 0 0 26px; padding-inline: 2px; }
  .help-contact { grid-template-columns: 240px 1fr; margin-top: 0; }
  .hc-art { height: auto; }
  .hc-art > img:first-child { bottom: 0; left: 10px; width: 230px; }
  .hc-bell { left: auto; right: -6px; bottom: 26px; width: 64px; height: 64px; }
  .hc-body { padding: 38px 40px 34px 18px; }
  .help-wiki-grid, .help-related-grid { grid-template-columns: repeat(3, 1fr); }
  .help-article { padding: 40px 44px 24px; }
  .help-article-icon { width: 76px; height: 76px; top: -44px; right: 30px; }
}
@media (min-width: 1024px) {
  .help-cats { grid-template-columns: repeat(3, 1fr); }
  .help-article-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
  .help-side { position: sticky; top: 96px; }
  .help-band .wrap { max-width: 1040px; }
}
@media (max-width: 1023px) { .help-toc { display: none; } }
@media (max-width: 760px) {
  .help-hero { padding-bottom: 76px; }
  .help-hero-sm { padding-bottom: 70px; }
  .help-hero .wave, .help-band .wave { height: 44px; }
  .help-search input { height: 56px; font-size: 1rem; }
  .help-hero-bg img { object-position: 30% 30%; }
  .help-hero-shade { background: radial-gradient(80% 60% at 100% 0, rgba(255, 207, 63, .22), transparent 60%), linear-gradient(180deg, rgba(6, 34, 56, .74) 0, rgba(8, 48, 78, .8) 60%, rgba(10, 61, 92, .62) 100%); }
}
@media (max-width: 400px) {
  .hc-actions .btn { width: 100%; justify-content: center; }
  .hc-actions .btn-glass-dark { font-size: .92rem; padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) { .hc-bell { animation: none; } }

/* ---------- Contact article: chat call to action ---------- */
.help-chat-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 26px; padding: 16px 18px; border-radius: var(--r); background: linear-gradient(160deg, #fffaf0, var(--sand)); box-shadow: inset 0 0 0 1px var(--sand-2); }
.help-chat-cta img { width: 52px; height: 52px; flex: none; }
.help-chat-cta p { flex: 1 1 220px; margin: 0; color: var(--text); }

/* ---------- Front-desk chat panel (assets/help/chat.js); opened from Contact us / Chat with us only ---------- */
.vc { position: fixed; z-index: 90; inset: 0; display: flex; flex-direction: column; background: var(--cream); color: var(--text); font-size: 1rem;
  box-shadow: var(--shadow-lg); animation: vc-in .32s var(--ease) both; }
.vc[hidden] { display: none; }
/* slide only, no fade: the panel and its cards are opaque in every frame (nothing of the page shows through) */
@keyframes vc-in { from { transform: translateY(24px); } }
.vc-head { position: relative; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 10px 22px 14px; color: #fff;
  background: radial-gradient(120% 140% at 90% 0, #11618f, var(--sea) 60%, #08304a); flex: none; }
.vc-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: url(/assets/help/majolica.svg) 0 0 / 12px 12px repeat-x; box-shadow: inset 0 2px 0 #1f6fb2; }
.vc-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--lemon-2); box-shadow: 0 0 0 3px var(--lemon); flex: none; }
.vc-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.vc-titles b { font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
.vc-sub { font-size: .84rem; color: var(--on-dark-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.vc-icon[hidden] { display: none; }
.vc-icon svg { width: 22px; height: 22px; }
.vc-head .vc-icon:hover { background: rgba(255, 255, 255, .14); }
.vc-pop { position: absolute; right: 54px; top: calc(54px + env(safe-area-inset-top)); z-index: 2; display: flex; flex-direction: column; min-width: 200px; padding: 6px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); }
.vc-pop[hidden] { display: none; }
.vc-pop button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font: 700 .95rem var(--body); color: var(--ink); cursor: pointer; }
.vc-pop button:hover { background: var(--sand); }
.vc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.vc-card { margin: 18px 16px; padding: 20px 18px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); }
.vc-card h3 { font-size: 1.3rem; color: var(--ink); margin: 0 0 6px; }
.vc-card p { color: var(--muted); font-size: .95rem; margin: 0 0 12px; }
.vc-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.vc-center > img { width: 72px; height: 72px; margin-bottom: 4px; }
.vc-center .btn { margin: 6px 0 0; }
.vc-card .btn svg { width: 18px; height: 18px; }
.vc-form label { display: block; font-family: var(--display); font-weight: 500; color: var(--ink); margin: 0 0 12px; }
.vc-form input { display: block; width: 100%; height: 48px; margin-top: 4px; padding: 0 14px; border: 0; border-radius: 14px; font: 600 1rem var(--body); color: var(--ink); background: var(--cream); box-shadow: inset 0 0 0 1.5px var(--sand-2); outline: none; }
.vc-form input:focus { box-shadow: inset 0 0 0 2px var(--sea-3); }
.vc-form .btn { width: 100%; justify-content: center; margin: 4px 0 12px; }
.vc-small { font-size: .82rem !important; color: var(--muted); }
.vc-note { background: #fff6d6; color: #6b4c00 !important; padding: 8px 12px; border-radius: 10px; }
.vc-err { color: #b3361b !important; font-weight: 700; font-size: .92rem !important; }
.vc-ok { color: #1f7a4a !important; font-weight: 700; font-size: .92rem !important; }
.vc-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 0 0 10px; }
.vc-or::before, .vc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vc-google { display: flex; justify-content: center; min-height: 44px; margin-bottom: 12px; }
.vc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin: 4px 0 8px; }
.vc-link { border: 0; background: none; color: var(--sea-3); font: 700 .95rem var(--body); text-decoration: underline; cursor: pointer; }
.vc-loading { display: flex; gap: 6px; justify-content: center; padding: 18px; }
.vc-v-loading { justify-content: center; }
.vc-loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--lemon-d); animation: vc-dot 1s infinite; }
.vc-loading span:nth-child(2) { animation-delay: .15s; }
.vc-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes vc-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-6px); opacity: 1; } }

.vc-list { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.vc-new, .vc-item { display: flex; text-align: left; border: 0; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; font: inherit; color: inherit; transition: transform .2s var(--spring); }
.vc-new:hover, .vc-item:hover { transform: translateY(-2px); }
.vc-new { align-items: center; gap: 12px; background: linear-gradient(180deg, var(--lemon-2), var(--lemon)); box-shadow: 0 4px 0 var(--lemon-d); color: #4a2f00; }
.vc-new svg { width: 28px; height: 28px; flex: none; }
.vc-new span { display: flex; flex-direction: column; }
.vc-new b { font-family: var(--display); font-weight: 600; font-size: 1.08rem; }
.vc-new small { font-size: .85rem; opacity: .8; }
.vc-item { flex-direction: column; gap: 3px; position: relative; }
.vc-item-top { display: flex; justify-content: space-between; gap: 10px; }
.vc-item-top b { font-family: var(--display); font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-item time { font-size: .8rem; color: var(--muted); flex: none; }
.vc-item-last { font-size: .9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-item.is-unread::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.vc-tag { align-self: flex-start; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(62, 163, 106, .14); color: #1f7a4a; }
.vc-tag-closed { background: rgba(11, 34, 54, .08); color: var(--muted); }
.vc-tag-pending { background: rgba(255, 207, 63, .25); color: #8a5d00; }
.vc-empty { text-align: center; color: var(--muted); }

.vc-v-thread { overflow: hidden; }
.vc-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px;
  background: radial-gradient(circle at 10% 0, rgba(255, 207, 63, .08), transparent 40%), var(--cream); }
.vc-hello { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: #fff; box-shadow: inset 0 0 0 1px var(--sand-2); }
.vc-hello img { width: 48px; height: 48px; flex: none; }
.vc-hello p { margin: 0; font-size: .95rem; color: var(--text); }
.vc-msg { display: flex; flex-direction: column; max-width: 84%; gap: 3px; }
.vc-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.vc-msg.is-them { align-self: flex-start; }
.vc-who { font-family: var(--display); font-weight: 600; font-size: .78rem; color: var(--sea-2); padding: 0 6px; }
.vc-bubble { padding: 10px 14px; border-radius: 18px; font-size: .97rem; line-height: 1.5; overflow-wrap: anywhere; }
.is-them .vc-bubble { background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(11, 34, 54, .08), inset 0 0 0 1px var(--line); }
.is-mine .vc-bubble { background: linear-gradient(180deg, #1c93d1, var(--sea-3)); color: #fff; border-bottom-right-radius: 6px; }
.vc-bubble a { color: inherit; font-weight: 700; }
.is-them .vc-bubble a { color: var(--sea-3); }
.vc-bubble img { max-width: 100%; border-radius: 10px; margin: 4px 0; }
.vc-bubble code { background: rgba(11, 34, 54, .08); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.vc-li { display: block; padding-left: 14px; position: relative; }
.vc-li::before { content: "\2022"; position: absolute; left: 2px; color: var(--lemon-d); }
.vc-msg time { font-size: .72rem; color: var(--muted); padding: 0 6px; }
.vc-msg.is-pending { opacity: .65; }
.vc-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.is-mine .vc-atts { justify-content: flex-end; }
.vc-att-img img { width: 140px; height: 140px; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow); }
.vc-att-file { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: .88rem; font-weight: 700; text-decoration: none; max-width: 240px; }
.vc-att-file svg { width: 18px; height: 18px; flex: none; color: var(--sea-3); }
.vc-att-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-sys { align-self: center; text-align: center; font-size: .82rem; color: var(--muted); background: rgba(11, 34, 54, .05); padding: 4px 12px; border-radius: 999px; margin: 4px 0; }

.vc-rate { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px; border-radius: var(--r); background: linear-gradient(160deg, #fffaf0, var(--sand)); box-shadow: inset 0 0 0 1px var(--sand-2); }
.vc-rate p { margin: 0; font-size: .92rem; color: var(--text); }
.vc-stars { display: flex; gap: 4px; }
.vc-stars button { border: 0; background: none; font-size: 2rem; line-height: 1; color: #d9cdb5; cursor: pointer; padding: 2px; transition: transform .15s var(--spring), color .15s; }
.vc-stars button:hover { transform: scale(1.15); }
.vc-stars button.is-on { color: var(--lemon-d); }
.vc-rate textarea { width: 100%; resize: none; border: 0; border-radius: 12px; padding: 8px 12px; font: 500 .95rem var(--body); background: #fff; box-shadow: inset 0 0 0 1.5px var(--sand-2); outline: none; }
.vc-thanks { font-size: .95rem; }
.vc-compose { flex: none; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -1px 0 var(--line); }
.vc-input { display: flex; align-items: flex-end; gap: 6px; }
.vc-input textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; max-height: 140px; padding: 11px 14px; border-radius: 22px; background: var(--cream); box-shadow: inset 0 0 0 1.5px var(--sand-2); font: 500 1rem/1.4 var(--body); color: var(--ink); }
.vc-input textarea:focus { box-shadow: inset 0 0 0 2px var(--sea-3); }
.vc-attach { color: var(--sea-2); }
.vc-attach:hover { background: var(--sand); }
.vc-send { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; cursor: pointer; color: #4a2f00; background: linear-gradient(180deg, var(--lemon-2), var(--lemon)); box-shadow: 0 3px 0 var(--lemon-d); }
.vc-send svg { width: 20px; height: 20px; }
.vc-send:disabled { opacity: .5; cursor: default; }
.vc-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.vc-files[hidden] { display: none; }
.vc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 6px; border-radius: 12px; background: var(--sand); font-size: .82rem; font-weight: 700; }
.vc-chip img, .vc-chip > svg { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex: none; color: var(--sea-3); }
.vc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.vc-chip button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(11, 34, 54, .08); cursor: pointer; }
.vc-chip button svg { width: 14px; height: 14px; }
.vc-compose .vc-err { margin: 6px 4px 0; }
.vc-ended { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: .92rem; color: var(--muted); }

@media (min-width: 640px) {
  .vc { inset: auto 24px 24px auto; width: 400px; height: min(680px, calc(100vh - 110px)); border-radius: 26px; overflow: hidden; }
  .vc-head { padding-top: 14px; }
  .vc-pop { top: 58px; }
}
@media (max-width: 639px) { html.vc-open, html.vc-open body { overflow: hidden; } }
@media (prefers-reduced-motion: reduce) { .vc { animation: none; } .vc-loading span { animation: none; opacity: .8; } }
