/*
 * chat.css — the chat corner's look (#655), served at /m/chat/chat.css. Linked
 * by the engine on /chat; a page that places a [data-chat-slot] gets it linked
 * by chat.js. Generic: no tenant colour or name here.
 *
 * Every rule is under the .uzc root class, and every element chat.js makes is
 * first reset (`all: revert`, the browser's own defaults) at the weight of the
 * root class plus the element, so neither the engine page's member-area rules
 * nor a tenant page's own rules reach in; our rules carry two classes or more.
 *
 * Colours and fonts are the site's --uzj-* properties, measured on the event
 * page by /features.js (#644) and set by chat.js; without them, the app page's
 * own palette (--fx-*), and last neutral values. Light and dark both read.
 * Sizes are fixed where something fills in later (the status line, the tools,
 * the composer), so nothing moves when it does. Reduced motion is honoured.
 */
.uzc{--c-bg:var(--uzj-bg,var(--fx-bg,#fff));--c-ink:var(--uzj-ink,var(--fx-ink,#1b1f1d));--c-surface:var(--uzj-surface,var(--fx-surface,#f3f4f2));--c-on-surface:var(--uzj-on-surface,var(--fx-on-surface,#1b1f1d));--c-muted:var(--uzj-page-muted,var(--fx-muted,#5b6660));--c-muted-surface:var(--uzj-surface-muted,var(--uzj-muted,var(--fx-muted,#5b6660)));--c-line:var(--uzj-line,var(--fx-line,rgba(127,127,127,.28)));--c-line-strong:var(--uzj-line-strong,rgba(127,127,127,.55));--c-accent:var(--uzj-accent,var(--fx-accent,#1f5f3f));--c-on-accent:var(--uzj-on-accent,var(--fx-on-accent,#fff));--c-radius:var(--uzj-radius,16px);--c-btn-radius:var(--uzj-btn-radius,999px);--c-font:var(--uzj-font,inherit);--c-head-font:var(--uzj-head-font,inherit);--c-head-weight:var(--uzj-head-weight,700);--c-warn:#b54708;--c-warn:color-mix(in srgb,#f79009 60%,var(--c-ink));--c-danger:#b42318;--c-danger:color-mix(in srgb,#f04438 70%,var(--c-ink));--c-shadow:var(--uzj-shadow,rgba(0,0,0,.06))}
.uzc :is(div,p,ol,ul,li,span,strong,time,button,a,form,textarea,label,h2,h3,section,aside,blockquote,dialog,select,option,input,fieldset,legend){all:revert;box-sizing:border-box;min-width:0}
.uzc [hidden]{display:none!important}
.uzc :is(p,ol,ul,h2,h3,blockquote,fieldset){margin:0;padding:0}
.uzc :is(ol,ul){list-style:none}
.uzc :is(button,input,select,textarea){font:inherit;color:inherit}
.uzc :is(button){cursor:pointer}
.uzc :is(button,a,textarea,select,input):focus-visible{outline:3px solid var(--c-accent);outline-offset:2px}
.uzc a{color:inherit}

/* the root: the app fills its slot; placed on another page it is a box */
.uzc.uzc-root{container-type:inline-size;display:flex;flex-direction:column;flex:1 1 auto;min-height:0;width:100%;position:relative;font-family:var(--c-font);font-size:1rem;line-height:1.45;color:var(--c-ink);background:var(--c-bg);overflow-wrap:anywhere;text-align:left}
.uzc.uzc-embed{height:min(640px,82vh);border:1px solid var(--c-line);border-radius:var(--c-radius);overflow:hidden;margin:16px 0}
.uzc .uzc-top{flex:none;display:flex;align-items:center;gap:8px;min-height:56px;padding:6px 10px 6px 14px;background:var(--c-surface);color:var(--c-on-surface);border-bottom:1px solid var(--c-line);position:relative;z-index:6}
.uzc .uzc-top-h{flex:1 1 auto;min-width:0}
.uzc .uzc-top-h h2{display:block;margin:0;font-family:var(--c-head-font);font-weight:var(--c-head-weight);font-size:1.05rem;line-height:1.25}
.uzc .uzc-top .uzc-status{display:block;min-height:1.2rem;font-size:.8rem;line-height:1.2rem;color:var(--c-muted-surface)}
.uzc .uzc-body{flex:1 1 auto;display:flex;min-height:0;position:relative}
.uzc .uzc-col{flex:1 1 auto;display:flex;flex-direction:column;min-width:0;min-height:0;position:relative}
.uzc .uzc-feedwrap{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;position:relative}
.uzc .uzc-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 14px 12px;container-type:inline-size}
.uzc .uzc-inner{max-width:760px;margin:0 auto}
.uzc .uzc-note{display:block;margin:4px auto 12px;max-width:520px;text-align:center;font-size:.8rem;color:var(--c-muted)}
.uzc .uzc-empty{display:block;margin:12vh auto 0;max-width:420px;padding:28px 22px;text-align:center;color:var(--c-ink);border:1px dashed var(--c-line-strong);border-radius:var(--c-radius)}
.uzc :is(.uzc-empty,.uzc-load,.uzc-conn):empty{margin:0;padding:0;border:0}
.uzc .uzc-empty:not(:empty)::before{content:"";display:block;width:44px;height:36px;margin:0 auto 12px;border-radius:14px 14px 14px 4px;background:var(--c-accent);opacity:.9}
.uzc .uzc-load,.uzc .uzc-conn{display:block;margin:12vh auto 0;max-width:420px;text-align:center;color:var(--c-muted)}
.uzc .uzc-conn{margin:0 auto 12px;padding:8px 14px;border-radius:999px;border:1px solid var(--c-line-strong);color:var(--c-ink);font-size:.88rem;font-weight:600}

/* a message */
.uzc .uzc-feed{display:flex;flex-direction:column}
.uzc .uzc-day{display:flex;align-items:center;gap:12px;margin:14px 0 8px;font-size:.78rem;font-weight:600;color:var(--c-muted);text-transform:uppercase;letter-spacing:.04em}
.uzc .uzc-day::before,.uzc .uzc-day::after{content:"";flex:1 1 auto;border-top:1px solid var(--c-line)}
.uzc .uzc-msg{display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:10px;position:relative;margin:16px 0 0;padding:2px 4px;border-radius:12px;scroll-margin:80px}
.uzc .uzc-msg.is-grouped{margin-top:3px}
.uzc .uzc-msg.is-target{background:color-mix(in srgb,var(--c-accent) 14%,transparent)}
.uzc .uzc-av{grid-column:1;grid-row:1 / span 4;align-self:start;display:flex;align-items:center;justify-content:center;width:36px;height:36px;margin-top:2px;border-radius:50%;font-size:.8rem;font-weight:700;letter-spacing:.02em;color:#fff;background:#475467;user-select:none}
.uzc .uzc-msg.is-grouped .uzc-av{visibility:hidden;height:0}
.uzc .uzc-av.uzc-av-0{background:#b42318}.uzc .uzc-av.uzc-av-1{background:#b54708}.uzc .uzc-av.uzc-av-2{background:#7a5c00}.uzc .uzc-av.uzc-av-3{background:#027a48}
.uzc .uzc-av.uzc-av-4{background:#0e7490}.uzc .uzc-av.uzc-av-5{background:#175cd3}.uzc .uzc-av.uzc-av-6{background:#4f46e5}.uzc .uzc-av.uzc-av-7{background:#7c3aed}
.uzc .uzc-av.uzc-av-8{background:#c11574}.uzc .uzc-av.uzc-av-9{background:#475467}.uzc .uzc-av.uzc-av-10{background:#9a3412}.uzc .uzc-av.uzc-av-11{background:#3f6212}
.uzc .uzc-main{grid-column:2;display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.uzc .uzc-meta{display:flex;align-items:baseline;gap:8px;margin:0 0 4px 2px;font-size:.8rem;color:var(--c-muted)}
.uzc .uzc-name{font-weight:700;font-size:.86rem;color:var(--c-ink)}
.uzc .uzc-time{font-variant-numeric:tabular-nums}
.uzc .uzc-bwrap{position:relative;display:block;max-width:min(100%,62ch)}
.uzc .uzc-bubble{display:block;max-width:100%;padding:9px 14px;border-radius:6px 18px 18px 18px;background:var(--c-surface);color:var(--c-on-surface);border:1px solid var(--c-line);box-shadow:0 1px 2px var(--c-shadow);line-height:1.5}
.uzc .uzc-msg.is-grouped .uzc-bubble{border-top-left-radius:18px}
.uzc .uzc-text{display:block;white-space:pre-wrap;margin:0}
.uzc .uzc-quote{display:block;margin:0 0 6px;padding:4px 10px;border-left:3px solid var(--c-line-strong);font-size:.85rem;color:var(--c-muted-surface)}
.uzc .uzc-quote-name{display:block;font-weight:700}
.uzc .uzc-quote.is-gone{font-style:italic}
.uzc .uzc-msg.is-own{grid-template-columns:minmax(0,1fr)}
.uzc .uzc-msg.is-own .uzc-av{display:none}
.uzc .uzc-msg.is-own .uzc-main{grid-column:1;align-items:flex-end}
.uzc .uzc-msg.is-own .uzc-bubble{background:var(--c-accent);color:var(--c-on-accent);border-color:transparent;border-radius:18px 6px 18px 18px}
.uzc .uzc-msg.is-own.is-grouped .uzc-bubble{border-top-right-radius:18px}
.uzc .uzc-msg.is-own .uzc-quote{color:inherit;border-left-color:currentColor;opacity:.85}
.uzc .uzc-msg.is-pending .uzc-bubble{background:transparent;color:var(--c-ink);border:1px dashed var(--c-line-strong)}
.uzc .uzc-pending{display:block;margin:3px 0 0;font-size:.78rem;color:var(--c-muted)}
.uzc .uzc-under{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:6px 0 0}
.uzc .uzc-under:empty{display:none}
.uzc .uzc-chip{display:inline-flex;align-items:center;gap:4px;min-height:28px;padding:0 9px;border-radius:999px;border:1px solid var(--c-line);background:var(--c-bg);color:var(--c-ink);font-size:.82rem;font-variant-numeric:tabular-nums}
.uzc .uzc-chip[aria-pressed="true"]{border-color:var(--c-accent);background:color-mix(in srgb,var(--c-accent) 16%,var(--c-bg));font-weight:700}
.uzc .uzc-chip:disabled{cursor:default}
.uzc .uzc-replies{display:inline-flex;align-items:center;min-height:28px;padding:0 4px;border:0;background:none;color:var(--c-accent);font-size:.82rem;font-weight:700;text-decoration:underline;text-underline-offset:3px}

/* the actions of a message: beside its bubble (over its top corner when the
   column is narrow), shown on hover, focus, or a tap */
.uzc .uzc-acts{position:absolute;top:-18px;right:4px;z-index:3;width:max-content;display:flex;gap:2px;padding:2px;border-radius:999px;background:var(--c-bg);border:1px solid var(--c-line);box-shadow:0 4px 14px rgba(0,0,0,.14);opacity:0;pointer-events:none}
.uzc .uzc-msg:hover .uzc-acts,.uzc .uzc-msg:focus-within .uzc-acts,.uzc .uzc-msg.is-open .uzc-acts{opacity:1;pointer-events:auto}
.uzc .uzc-msg.is-own .uzc-acts{right:auto;left:4px}
.uzc .uzc-act{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:30px;padding:0 8px;border:0;border-radius:999px;background:none;color:var(--c-ink);font-size:.85rem}
.uzc .uzc-act:hover{background:var(--c-surface)}
.uzc .uzc-pop{position:absolute;top:calc(100% + 4px);right:0;z-index:8;display:flex;flex-direction:column;width:max-content;min-width:200px;max-width:min(300px,80vw);padding:6px;border-radius:12px;background:var(--c-bg);color:var(--c-ink);border:1px solid var(--c-line);box-shadow:0 12px 32px rgba(0,0,0,.22)}
.uzc .uzc-msg.is-own .uzc-pop{right:auto;left:0}
@container (min-width:560px){
  .uzc .uzc-acts{top:2px;right:auto;left:calc(100% + 8px)}
  .uzc .uzc-msg.is-own .uzc-acts{left:auto;right:calc(100% + 8px)}
  .uzc .uzc-pop{top:40px;right:auto;left:calc(100% + 8px)}
  .uzc .uzc-msg.is-own .uzc-pop{left:auto;right:calc(100% + 8px)}
}
.uzc .uzc-pop.uzc-picker{flex-direction:row;min-width:0;gap:2px}
.uzc .uzc-item{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border:0;border-radius:8px;background:none;color:inherit;text-align:left;text-decoration:none;font-size:.92rem}
.uzc .uzc-item:hover,.uzc .uzc-item:focus-visible{background:var(--c-surface)}
.uzc .uzc-item.is-danger{color:var(--c-danger)}
.uzc .uzc-emoji{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:10px;background:none;font-size:1.3rem}
.uzc .uzc-emoji[aria-pressed="true"]{background:color-mix(in srgb,var(--c-accent) 18%,transparent)}
.uzc .uzc-emoji:hover{background:var(--c-surface)}

/* the new-messages pill */
.uzc .uzc-pill{position:absolute;left:50%;bottom:12px;z-index:5;transform:translateX(-50%);display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 16px;border:0;border-radius:999px;background:var(--c-accent);color:var(--c-on-accent);font-size:.85rem;font-weight:700;box-shadow:0 6px 18px rgba(0,0,0,.2)}

/* the composer, pinned under the feed; or the bar that says why there is none */
.uzc .uzc-foot{flex:none;min-height:76px;padding:10px 14px max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--c-line);background:var(--c-bg);box-shadow:0 -6px 18px var(--c-shadow)}
.uzc .uzc-foot-in{max-width:760px;margin:0 auto}
.uzc .uzc-form{display:block}
.uzc .uzc-row{display:flex;align-items:flex-end;gap:6px;padding:4px;border-radius:26px;border:1px solid var(--c-line-strong);background:var(--c-bg)}
.uzc .uzc-row:focus-within{border-color:var(--c-accent);outline:2px solid var(--c-accent);outline-offset:0}
.uzc .uzc-input{flex:1 1 auto;display:block;width:100%;min-height:44px;max-height:9.5em;field-sizing:content;resize:none;padding:10px 12px;border-radius:20px;border:0;background:transparent;color:var(--c-ink);line-height:1.4}
.uzc .uzc-row .uzc-input:focus-visible{outline:0}
.uzc .uzc-send{flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:72px;height:44px;padding:0 18px;border:0;border-radius:var(--c-btn-radius);background:var(--c-accent);color:var(--c-on-accent);font-weight:700}
.uzc .uzc-send:disabled{opacity:1;background:transparent;color:var(--c-muted);box-shadow:inset 0 0 0 1px var(--c-muted);cursor:default}
.uzc .uzc-row .uzc-send:disabled{box-shadow:none}
.uzc .uzc-sub{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:1.3rem;margin:6px 14px 0;font-size:.78rem;color:var(--c-muted)}
.uzc .uzc-count{flex:none;font-variant-numeric:tabular-nums}
.uzc .uzc-count.is-near{color:var(--c-warn);font-weight:700}
.uzc .uzc-quoting{display:flex;align-items:center;gap:8px;margin:0 0 6px;padding:6px 6px 6px 12px;border-left:3px solid var(--c-accent);border-radius:8px;background:var(--c-surface);color:var(--c-on-surface);font-size:.85rem}
.uzc .uzc-quoting span{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.uzc .uzc-x{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:0;border-radius:50%;background:none;color:inherit;font-size:1.1rem}
.uzc .uzc-x:hover{background:var(--c-line)}
.uzc .uzc-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 14px;min-height:58px;padding:8px 8px 8px 16px;border:1px solid var(--c-line);border-radius:var(--c-radius)}
.uzc .uzc-bar p{flex:1 1 220px;font-size:.92rem}
.uzc .uzc-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 20px;border:0;border-radius:var(--c-btn-radius);background:var(--c-accent);color:var(--c-on-accent);font-weight:700;text-decoration:none}
.uzc .uzc-btn.is-plain{background:none;color:var(--c-ink);border:1px solid var(--c-line-strong)}
.uzc .uzc-say{display:block;min-height:1.2rem;margin:2px 6px 0;font-size:.82rem;color:var(--c-muted)}

/* the side: who is active, and a thread when one is open */
.uzc .uzc-side{display:none;flex-direction:column;min-height:0;background:var(--c-bg);border-left:1px solid var(--c-line)}
.uzc .uzc-side-sec{padding:18px 18px 16px;border-bottom:1px solid var(--c-line)}
.uzc .uzc-side h2,.uzc .uzc-side h3{display:block;margin:0 0 10px;font-family:var(--c-head-font);font-weight:var(--c-head-weight);font-size:.95rem}
.uzc .uzc-who{display:flex;flex-wrap:wrap;gap:6px}
.uzc .uzc-who li{display:inline-flex;align-items:center;gap:6px;padding:3px 10px 3px 4px;border-radius:999px;background:var(--c-surface);color:var(--c-on-surface);font-size:.85rem}
.uzc .uzc-who .uzc-av{width:22px;height:22px;margin:0;font-size:.6rem;grid-row:auto}
.uzc .uzc-side-note{display:block;font-size:.85rem;color:var(--c-muted)}
.uzc .uzc-thread{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.uzc .uzc-thread-top{flex:none;display:flex;align-items:center;gap:8px;min-height:56px;padding:6px 8px 6px 16px;border-bottom:1px solid var(--c-line)}
.uzc .uzc-thread-top h2{flex:1 1 auto;margin:0}
.uzc .uzc-thread .uzc-scroll{padding:8px 12px}
.uzc .uzc-thread-count{display:flex;align-items:center;gap:10px;margin:12px 0 4px;font-size:.78rem;font-weight:700;color:var(--c-muted)}
.uzc .uzc-thread-count::after{content:"";flex:1 1 auto;border-top:1px solid var(--c-line)}
.uzc .uzc-thread .uzc-foot{min-height:0}
.uzc.has-thread .uzc-side{display:flex;position:fixed;inset:0;z-index:60;border:0}
.uzc.has-thread .uzc-side .uzc-active{display:none}
.uzc .uzc-side .uzc-thread-back{display:inline-flex}
.uzc .uzc-side .uzc-thread-x{display:none}

/* the menu of the corner (in the app page's header, or the box's own top) */
.uzc.uzc-tools,.uzc .uzc-tools{position:relative;display:flex;align-items:center}
.uzc.uzc-statusin{display:inline}
.uzc .uzc-menu-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:50%;background:none;color:inherit;font-size:1.3rem;line-height:1}
.uzc .uzc-menu-btn:hover,.uzc .uzc-menu-btn[aria-expanded="true"]{background:var(--c-line)}
.uzc .uzc-menu{position:absolute;top:calc(100% + 6px);right:0;width:min(300px,calc(100vw - 24px));min-width:0;z-index:45}
.uzc .uzc-menu-note{display:block;padding:8px 10px;font-size:.82rem;color:var(--c-muted)}
.uzc .uzc-check{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;border:1px solid var(--c-line-strong);font-size:.85rem}
.uzc .uzc-check.is-on{background:var(--c-accent);color:var(--c-on-accent);border-color:var(--c-accent)}

/* the status line: N online · M active */
.uzc .uzc-dot{display:inline-block;width:8px;height:8px;margin:0 6px 1px 0;border-radius:50%;background:#12b76a;vertical-align:middle}

/* a dialog: report, or a staff decision */
.uzc .uzc-dialog{width:min(420px,calc(100vw - 32px));padding:18px;border:1px solid var(--c-line);border-radius:var(--c-radius);background:var(--c-bg);color:var(--c-ink);font-family:var(--c-font)}
.uzc .uzc-dialog::backdrop{background:rgba(0,0,0,.45)}
.uzc .uzc-dialog h2{display:block;margin:0 0 6px;font-size:1.05rem;font-family:var(--c-head-font)}
.uzc .uzc-dialog p{display:block;margin:0 0 10px;font-size:.9rem;color:var(--c-muted)}
.uzc .uzc-dialog label{display:block;margin:10px 0 4px;font-size:.88rem;font-weight:600}
.uzc .uzc-dialog select,.uzc .uzc-dialog input{display:block;width:100%;min-height:42px;padding:8px 10px;border-radius:10px;border:1px solid var(--c-line-strong);background:var(--c-bg);color:var(--c-ink)}
.uzc .uzc-dialog-acts{display:flex;justify-content:flex-end;gap:8px;margin:16px 0 0}

.uzc .uzc-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;white-space:nowrap}

/* wide: the side is a column of its own */
@container (min-width:900px){
  .uzc .uzc-side{display:flex;flex:0 0 340px}
  .uzc.has-thread .uzc-side{position:static;inset:auto;z-index:auto;border-left:1px solid var(--c-line)}
  .uzc.has-thread .uzc-side .uzc-active{display:block}
  .uzc .uzc-side .uzc-thread-back{display:none}
  .uzc .uzc-side .uzc-thread-x{display:inline-flex}
  .uzc .uzc-scroll{padding:16px 20px 8px}
}
/* a phone: the actions stay reachable without hover */
@media (hover:none){.uzc .uzc-acts{box-shadow:0 2px 8px rgba(0,0,0,.2)}}
@media (prefers-reduced-motion:no-preference){
  .uzc .uzc-acts{transition:opacity .12s ease}
  .uzc .uzc-msg.is-target{transition:background-color 1.2s ease}
  .uzc .uzc-scroll{scroll-behavior:smooth}
}
@media (prefers-reduced-motion:reduce){.uzc *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
@media (forced-colors:active){.uzc .uzc-bubble,.uzc .uzc-chip,.uzc .uzc-pop,.uzc .uzc-acts,.uzc .uzc-send,.uzc .uzc-btn{border:1px solid CanvasText}.uzc .uzc-av{forced-color-adjust:none}}
