/* ZingMMO Support Desk: customer side. Theme tokens only (--zss-*), mobile first. */
.zsd { display: grid; gap: 1rem; color: var(--zss-soft, #c7cede); }
.zsd h2, .zsd h3 { margin: 0; color: var(--zss-strong, #f4f6fb); }
.zsd-card { padding: 1.1rem 1.2rem; border: 1px solid var(--zss-line, #2f384e); border-radius: var(--zss-r-lg, 14px); background: var(--zss-surface, #141a28); }
.zsd-card > h2, .zsd-card > h3 { font-size: 1.05rem; margin-bottom: .9rem; }
.zsd-note { margin: 0; padding: .8rem 1rem; border-radius: var(--zss-r, 10px); background: var(--zss-raised, #1f2739); }
.zsd-note.is-warn { background: color-mix(in srgb, #fbbf24 14%, transparent); color: var(--zss-strong, #f4f6fb); }
.zsd-back { color: var(--zss-subtle, #8f99b0); text-decoration: none; font-size: .9rem; }
.zsd-back:hover { color: var(--zss-strong, #f4f6fb); }

/* head + list */
.zsd-head { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.zsd-head p { margin: .25rem 0 0; font-size: .9rem; color: var(--zss-subtle, #8f99b0); }
.zsd-head .zsc-btn { display: inline-flex; gap: .4rem; align-items: center; min-height: 44px; }
.zsd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.zsd-list a { display: grid; gap: .25rem; padding: .9rem 1rem; border: 1px solid var(--zss-line, #2f384e); border-radius: var(--zss-r, 10px); background: var(--zss-surface, #141a28); text-decoration: none; color: inherit; transition: border-color .15s; }
.zsd-list a:hover, .zsd-list a:focus-visible { border-color: var(--zss-accent, #ff6b2c); }
.zsd-list .is-unread a { border-color: color-mix(in srgb, var(--zss-accent, #ff6b2c) 60%, var(--zss-line, #2f384e)); }
.zsd-list__top { display: flex; gap: .6rem; align-items: center; justify-content: space-between; }
.zsd-list__top strong { color: var(--zss-strong, #f4f6fb); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zsd-list__sub { font-size: .8rem; color: var(--zss-subtle, #8f99b0); }
.zsd-list__prev { font-size: .88rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.zsd-pill { flex: none; display: inline-flex; align-items: center; height: 24px; padding: 0 .65rem; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--zss-raised, #1f2739); color: var(--zss-soft, #c7cede); white-space: nowrap; }
.zsd-pill.is-open { background: color-mix(in srgb, #60a5fa 18%, transparent); color: color-mix(in srgb, var(--wp--preset--color--info, #38bdf8) 72%, var(--zms-strong, #fff)); }
.zsd-pill.is-answered { background: color-mix(in srgb, var(--zss-accent, #ff6b2c) 20%, transparent); color: var(--zss-accent-2, #ffb02e); }
.zsd-pill.is-closed { color: var(--zss-subtle, #8f99b0); }
.zsd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--zss-accent, #ff6b2c); margin-left: -.3rem; flex: none; }
.zsd-empty { display: grid; justify-items: center; gap: .5rem; padding: 2.5rem 1rem; text-align: center; border: 1px dashed var(--zss-line, #2f384e); border-radius: var(--zss-r-lg, 14px); }
.zsd-empty svg { color: color-mix(in srgb, var(--zss-accent, #ff6b2c) var(--zms-ink-mix, 100%), var(--zms-strong, #fff)); }
.zsd-empty p { margin: 0; max-width: 46ch; }

/* search */
.zsd-search { position: relative; display: flex; gap: .5rem; align-items: center; }
.zsd-search > svg { position: absolute; left: .85rem; color: var(--zss-subtle, #8f99b0); pointer-events: none; }
.zsd-search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 1rem 0 2.6rem; border-radius: var(--zss-r, 10px); border: 1px solid var(--zss-line, #2f384e); background: var(--zss-base, #0a0e18); color: var(--zss-strong, #f4f6fb); font-size: 1rem; }
.zsd-search .zsc-btn { min-height: 48px; }
.zsd-search--sm input { min-height: 42px; font-size: .95rem; }
.zsd-live, .zsd-suggest { padding: .6rem; border: 1px solid var(--zss-line, #2f384e); border-radius: var(--zss-r, 10px); background: var(--zss-surface, #141a28); }
.zsd-suggest { border-color: color-mix(in srgb, var(--zss-mint, #2fd6a0) 50%, var(--zss-line, #2f384e)); }
.zsd-suggest > p { margin: .1rem .4rem .5rem; font-size: .85rem; color: color-mix(in srgb, var(--zms-mint, #2fd6a0) 72%, var(--zms-strong, #fff)); font-weight: 600; }
.zsd-arts { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.zsd-arts a { display: grid; gap: .15rem; padding: .6rem .7rem; border-radius: 8px; text-decoration: none; color: inherit; }
.zsd-arts a:hover, .zsd-arts a:focus-visible { background: var(--zss-raised, #1f2739); }
.zsd-arts strong { color: var(--zss-strong, #f4f6fb); font-size: .95rem; }
.zsd-arts span { font-size: .85rem; color: var(--zss-subtle, #8f99b0); }

/* help center */
.zsd-hero { display: grid; gap: .9rem; padding: clamp(1.2rem, 4vw, 2.2rem); border-radius: var(--zss-r-lg, 14px); border: 1px solid var(--zss-line, #2f384e); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--zss-accent, #ff6b2c) 16%, transparent), transparent 60%), var(--zss-surface, #141a28); }
.zsd-hero h2 { font-size: clamp(1.3rem, 3.4vw, 1.9rem); }
.zsd-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.zsd-topic h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; }
.zsd-topic h3 a { color: inherit; text-decoration: none; }
.zsd-topic small { color: var(--zss-subtle, #8f99b0); font-weight: 500; }
.zsd-topic ul { margin: .7rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.zsd-topic li a { color: var(--zss-soft, #c7cede); }
.zsd-helpful { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 2rem 0 .5rem; padding: 1rem; border-radius: var(--zss-r, 10px); background: var(--zss-raised, #1f2739); }
.zsd-helpful span { font-weight: 600; color: var(--zss-strong, #f4f6fb); margin-right: auto; }
.zsd-helpful__done { margin: 0; color: color-mix(in srgb, var(--zms-mint, #2fd6a0) 72%, var(--zms-strong, #fff)); }
.zsd-still a { font-weight: 600; }

/* form */
.zsd-form { display: grid; gap: .9rem; }
.zsd-row { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.zsd-field { display: grid; gap: .35rem; margin: 0; }
.zsd-field label { font-size: .85rem; font-weight: 600; color: var(--zss-strong, #f4f6fb); }
.zsd-field small { font-size: .78rem; color: var(--zss-subtle, #8f99b0); }
.zsd input:not([type=radio]):not([type=checkbox]):not([type=file]), .zsd select, .zsd textarea, .zsd-chat input, .zsd-chat textarea {
	width: 100%; min-height: 44px; padding: .55rem .8rem; border-radius: var(--zss-r, 10px); border: 1px solid var(--zss-line, #2f384e); background: var(--zss-base, #0a0e18); color: var(--zss-strong, #f4f6fb); font: inherit; font-size: 16px; box-sizing: border-box;
}
.zsd textarea { resize: vertical; line-height: 1.5; }
.zsd input:focus-visible, .zsd select:focus-visible, .zsd textarea:focus-visible, .zsd-chat textarea:focus-visible, .zsd-chat input:focus-visible { outline: 2px solid var(--zss-accent, #ff6b2c); outline-offset: 1px; border-color: transparent; }
.zsd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.zsd-files { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; }
.zsd-files small { font-size: .78rem; color: var(--zss-subtle, #8f99b0); }
.zsd-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zsd-attach { display: inline-flex; gap: .35rem; align-items: center; min-height: 40px; padding: 0 .85rem; border-radius: 99px; border: 1px dashed var(--zss-line, #2f384e); cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--zss-soft, #c7cede); }
.zsd-attach:hover, .zsd-file-input:focus-visible + small, .zsd-files:focus-within .zsd-attach { border-color: var(--zss-accent, #ff6b2c); color: var(--zss-strong, #f4f6fb); }
.zsd-thumbs { list-style: none; display: flex; gap: .4rem; margin: 0; padding: 0; width: 100%; }
.zsd-thumbs:empty { display: none; }
.zsd-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--zss-line, #2f384e); }
.zsd-err { margin: 0; padding: .6rem .8rem; border-radius: 8px; background: color-mix(in srgb, var(--zss-rose, #fb7185) 14%, transparent); color: color-mix(in srgb, var(--zms-rose, #fb7185) 72%, var(--zms-strong, #fff)); font-size: .9rem; }
.zsd-form__foot { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.zsd-form__foot small { margin-right: auto; color: var(--zss-subtle, #8f99b0); font-size: .82rem; }
.zsd-form__foot .zsc-btn { min-height: 44px; }

/* thread */
.zsd-thread { display: grid; gap: .9rem; }
.zsd-thread__head { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.zsd-thread__head h2 { font-size: clamp(1.1rem, 3vw, 1.35rem); overflow-wrap: anywhere; }
.zsd-thread__head p { margin: .3rem 0 0; font-size: .82rem; color: var(--zss-subtle, #8f99b0); }
.zsd-order { display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; border-radius: var(--zss-r, 10px); background: var(--zss-raised, #1f2739); color: var(--zss-strong, #f4f6fb); text-decoration: none; font-weight: 600; font-size: .9rem; }
.zsd-order span { flex: 1; }
.zsd-eta { display: flex; gap: .4rem; align-items: center; margin: 0; font-size: .85rem; color: var(--zss-subtle, #8f99b0); }
.zsd-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.zsd-msg { max-width: min(85%, 640px); padding: .75rem .9rem; border-radius: 14px; background: var(--zss-surface, #141a28); border: 1px solid var(--zss-line, #2f384e); }
.zsd-msg.is-customer { justify-self: end; background: color-mix(in srgb, var(--zss-accent, #ff6b2c) 14%, var(--zss-surface, #141a28)); border-color: color-mix(in srgb, var(--zss-accent, #ff6b2c) 35%, var(--zss-line, #2f384e)); border-bottom-right-radius: 4px; }
.zsd-msg.is-staff { justify-self: start; border-bottom-left-radius: 4px; }
.zsd-msg.is-system { justify-self: center; max-width: 92%; padding: .4rem .8rem; border: 0; background: none; text-align: center; font-size: .82rem; color: var(--zss-subtle, #8f99b0); }
.zsd-msg.is-system p { margin: 0; }
.zsd-msg.is-system time { font-size: .72rem; opacity: .8; }
.zsd-msg__meta { display: flex; gap: .6rem; justify-content: space-between; margin-bottom: .3rem; font-size: .78rem; color: var(--zss-subtle, #8f99b0); }
.zsd-msg__meta strong { color: var(--zss-strong, #f4f6fb); }
.zsd-msg__body { line-height: 1.55; overflow-wrap: anywhere; color: var(--zss-strong, #f4f6fb); }
.zsd-msg__body a { color: var(--zss-accent-2, #ffb02e); }
.zsd-msg__files { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.zsd-msg__files img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; display: block; }
.zsd-reply { display: grid; gap: .6rem; padding: .9rem; border-radius: var(--zss-r-lg, 14px); border: 1px solid var(--zss-line, #2f384e); background: var(--zss-surface, #141a28); }
.zsd-closed { margin: 0; text-align: center; font-size: .85rem; color: var(--zss-subtle, #8f99b0); }
.zsd-rate { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: center; padding: 1rem; border-radius: var(--zss-r, 10px); background: var(--zss-raised, #1f2739); }
.zsd-rate p { margin: 0; font-weight: 600; color: var(--zss-strong, #f4f6fb); width: 100%; text-align: center; }
.zsd-rate input[name=note] { flex: 1 1 220px; }
.zsd-stars { display: flex; flex-direction: row-reverse; gap: .1rem; }
.zsd-stars label { cursor: pointer; font-size: 1.9rem; line-height: 1; color: var(--zss-line, #2f384e); min-width: 44px; text-align: center; }
.zsd-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.zsd-stars label:hover, .zsd-stars label:hover ~ label, .zsd-stars input:checked ~ span, .zsd-stars label:has(input:checked), .zsd-stars label:has(input:checked) ~ label { color: color-mix(in srgb, var(--zms-amber, #fbbf24) 72%, var(--zms-strong, #fff)); }
.zsd-stars input:focus-visible + span { outline: 2px solid var(--zss-accent, #ff6b2c); border-radius: 4px; }

/* order page + dashboard */
.zsd-orderhelp { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; margin: 1.5rem 0; padding: 1rem 1.1rem; border-radius: var(--zss-r-lg, 14px); border: 1px solid var(--zss-line, #2f384e); background: var(--zss-surface, #141a28); }
.zsd-orderhelp > svg { color: color-mix(in srgb, var(--zss-accent, #ff6b2c) var(--zms-ink-mix, 100%), var(--zms-strong, #fff)); flex: none; }
.zsd-orderhelp div { display: grid; gap: .15rem; flex: 1 1 220px; }
.zsd-orderhelp strong { color: var(--zss-strong, #f4f6fb); }
.zsd-orderhelp span { font-size: .85rem; color: var(--zss-subtle, #8f99b0); }
.zsd-orderhelp .zsc-btn { min-height: 44px; }

/* chat bubble */
.zsd-chat { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: calc(1rem + env(safe-area-inset-bottom) + var(--zss-mobile-nav, 0px)); z-index: 9990; font-size: .95rem; }
.zsd-chat__fab { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--zss-accent, #ff6b2c), var(--zss-accent-2, #ffb02e)); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--zss-accent, #ff6b2c) 70%, transparent); transition: transform .15s; }
.zsd-chat__fab:hover { transform: translateY(-2px); }
.zsd-chat__fab:focus-visible { outline: 3px solid var(--zss-strong, #f4f6fb); outline-offset: 3px; }
.zsd-chat.is-open .zsd-chat__fab { display: none; }
.zsd-chat__badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--zss-rose, #fb7185); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; border: 2px solid var(--zss-base, #0a0e18); }
.zsd-chat__panel { display: flex; flex-direction: column; width: min(380px, calc(100vw - 2rem)); height: min(560px, calc(100vh - 6rem)); border-radius: 18px; overflow: hidden; border: 1px solid var(--zss-line, #2f384e); background: var(--zss-base, #0a0e18); box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .55); }
.zsd-chat__panel[hidden] { display: none; }
.zsd-chat__panel header { display: flex; gap: .6rem; align-items: center; padding: .9rem 1rem; background: linear-gradient(135deg, color-mix(in srgb, var(--zss-accent, #ff6b2c) 22%, var(--zss-surface, #141a28)), var(--zss-surface, #141a28)); border-bottom: 1px solid var(--zss-line, #2f384e); }
.zsd-chat__panel header div { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.zsd-chat__panel header strong { color: var(--zss-strong, #f4f6fb); }
.zsd-chat__panel header small { font-size: .78rem; color: var(--zss-soft, #c7cede); }
.zsd-chat__x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--zss-soft, #c7cede); cursor: pointer; font-size: 1.1rem; }
.zsd-chat__x:hover { background: var(--zss-raised, #1f2739); }
.zsd-chat__msgs { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: .9rem; display: flex; flex-direction: column; gap: .55rem; overscroll-behavior: contain; }
.zsd-chat__msgs .zsd-msg { max-width: 86%; padding: .55rem .75rem; font-size: .92rem; }
.zsd-chat__msgs .zsd-msg.is-customer { align-self: flex-end; }
.zsd-chat__msgs .zsd-msg.is-staff { align-self: flex-start; }
.zsd-chat__msgs .zsd-msg.is-system { align-self: center; }
.zsd-chat__msgs .zsd-msg__meta { margin-bottom: .15rem; }
.zsd-chat__form { display: grid; gap: .45rem; padding: .7rem; border-top: 1px solid var(--zss-line, #2f384e); background: var(--zss-surface, #141a28); }
.zsd-chat__who { display: grid; grid-template-columns: 1fr 1.4fr; gap: .45rem; }
.zsd-chat__who[hidden] { display: none; }
.zsd-chat__send { display: flex; gap: .45rem; align-items: flex-end; }
.zsd-chat__send textarea { resize: none; max-height: 120px; }
.zsd-chat__send .zsc-btn { flex: none; width: 44px; min-height: 44px; padding: 0; }
@media (max-width: 480px) {
	.zsd-chat.is-open { inset: 0; }
	.zsd-chat__panel { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
	.zsd-thread__head { flex-direction: column; }
	.zsd-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .zsd-chat__fab { transition: none; } }

/* beat the generic field rule above */
.zsd .zsd-search input { padding-left: 2.6rem; }
.zsd .zsd-arts a, .zsd .zsd-arts a * { text-decoration: none; }
.zsd .zsd-arts a:hover strong { text-decoration: underline; }
.zsd .zsd-search input[type] , .zsd .zsd-search input { padding-left: 2.6rem !important; }
/* sit above the theme's mobile bottom bar (same offset as "back to top") */
body.zsc-has-bottombar .zsd-chat { bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body.zsc-has-bottombar .zsd-chat { bottom: max(1rem, env(safe-area-inset-bottom)); } }
@media (max-width: 480px) { body.zsc-has-bottombar .zsd-chat.is-open { bottom: 0; } }
/* "back to top" shares the corner: stack it above the chat button */
body:has(.zsd-chat:not([hidden])) .zsc-totop { bottom: calc(1rem + 66px); }
body.zsc-has-bottombar:has(.zsd-chat:not([hidden])) .zsc-totop { bottom: calc(76px + 66px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body.zsc-has-bottombar:has(.zsd-chat:not([hidden])) .zsc-totop { bottom: calc(1rem + 66px); } }
