@font-face{font-family:"Onest";font-style:normal;font-weight:100 900;font-display:swap;src:url(/widget/fonts/onest-cyrillic.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Onest";font-style:normal;font-weight:100 900;font-display:swap;src:url(/widget/fonts/onest-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Bounded";font-style:normal;font-weight:200 900;font-display:swap;src:url(/widget/fonts/Bounded-Variable.woff2) format("woff2")}
*{box-sizing:border-box}
/* One soft blue for everything. --accent-text is the same family, light enough for 4.5:1 on --bg, --surface and --surface-2. */
:root{color-scheme:dark;--bg:#0f0e19;--surface:#17152b;--surface-2:#1e1b36;--line:rgba(255,255,255,.08);--text:#ffffff;--muted:#a5acc7;--accent:#4f78f0;--accent-hover:#5a7ff5;--accent-text:#5a7ff5;--ok:#3ecf6e;--warn:#f5b83d;--err:#ef4b4b;--font:"Onest",system-ui,-apple-system,"Segoe UI",sans-serif;--display:"Bounded","Onest",system-ui,sans-serif}
[hidden]{display:none!important}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font:400 14px/1.45 var(--font);overflow:hidden;-webkit-font-smoothing:antialiased}
#shell{position:relative;height:100vh;height:100dvh;display:flex;flex-direction:column}
button,a,textarea{font:inherit}button{cursor:pointer;color:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{cursor:wait;opacity:.55}
button:focus-visible,a:focus-visible{outline:2px solid var(--accent-text);outline-offset:2px}
small{display:block}h1,h2,p{margin:0}

/* Motion: backgrounds ease in 150ms, a press scales to .98, screens fade, new messages rise 3px. All of it is off for prefers-reduced-motion. */
@keyframes fs-fade{from{opacity:0}to{opacity:1}}
@keyframes fs-rise{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:none}}
#shell button,#shell .discord-row{transition:background-color .15s ease,border-color .15s ease,opacity .15s ease,transform .15s ease}
#shell button:not(:disabled):active,#shell .discord-row:active{transform:scale(.98)}
#home:not([hidden]),#history:not([hidden]),#chat:not([hidden]){animation:fs-fade .15s ease both}
.row.enter{animation:fs-rise .18s ease-out both}

/* Header: one compact bar on every screen; Back appears only inside chat and the ticket list. */
header{display:flex;align-items:center;gap:12px;height:64px;padding:0 20px;flex-shrink:0;background:var(--surface);border-bottom:1px solid var(--line)}
#back{display:none}[data-view="chat"] #back,[data-view="history"] #back{display:flex}
.icon-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;flex-shrink:0;border:0;border-radius:10px;background:var(--surface-2);color:var(--text)}
.icon-btn:hover{background:var(--bg)}
.icon-btn svg{width:16px;height:16px;display:block}
.brand{flex:1;min-width:0;display:flex;align-items:center;gap:12px}
.logo{width:36px;height:36px;flex-shrink:0;display:block}
.heading{min-width:0}.heading strong{display:block;font:600 15px/1.2 var(--display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.heading small{color:var(--muted);font-size:12px;line-height:1.3;margin-top:2px;white-space:nowrap}

main{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--surface-2) transparent}
[data-view="home"] main{flex:0 1 auto}
#chat,#history{padding:16px 20px}

/* Home: greeting, main action, Discord, quick questions, tickets. */
.greet{padding:20px}
.hello{color:var(--muted);font-size:13px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:4px}
.greet h1{font:700 20px/1.25 var(--display);letter-spacing:-.01em}
.home-body{padding:0 20px 4px;display:flex;flex-direction:column;gap:16px}

.write-card{position:relative;display:flex;flex-direction:column;justify-content:center;width:100%;min-height:64px;text-align:left;border:1px solid var(--line);border-radius:14px;padding:12px 68px 12px 16px;background:var(--surface);color:var(--text);font:600 15px/1.3 var(--font)}
.write-card:hover:not(:disabled){background:var(--surface-2)}
.write-card small{font-weight:400;font-size:12px;line-height:1.4;margin-top:2px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.write-icon{position:absolute;right:12px;top:50%;width:40px;height:40px;margin-top:-20px;border-radius:12px;background:var(--accent);display:flex;align-items:center;justify-content:center;transition:background-color .15s ease}
.write-card:hover:not(:disabled) .write-icon{background:var(--accent-hover)}
.write-icon svg{width:20px;height:20px;display:block}

.discord-row{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--text);text-decoration:none}
.discord-row:hover{background:var(--surface-2)}
.discord-ico{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;height:36px;border-radius:10px;background:var(--surface-2);color:var(--text);transition:background-color .15s ease}
.discord-row:hover .discord-ico{background:var(--bg)}
.discord-ico svg{width:20px;height:20px;display:block;fill:currentColor}
.discord-text{flex:1;min-width:0}
.discord-text small{font-size:12px;line-height:1.3;color:var(--muted)}
.discord-text strong{display:block;font:600 14px/1.3 var(--font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.discord-ext{flex-shrink:0;width:16px;height:16px;display:block;color:var(--muted)}

.block h2,.history-heading,.block-head h2{font:600 11px/1.2 var(--font);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.block>h2{margin:0 0 8px}
.block-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px;min-height:16px}
#all-tickets{border:0;background:transparent;color:var(--accent-text);font-size:12px;font-weight:500;padding:4px;margin-right:-4px;border-radius:8px;white-space:nowrap}#all-tickets:hover{color:var(--text)}
#history-card:not(:has(#tickets > *)),#faq-block:not(:has(#home-topics > *)){display:none}

/* Quick questions: an even two-column grid of equal tiles; the last odd tile spans the row. */
#home-topics{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#home-topics button{display:flex;align-items:center;gap:8px;min-width:0;height:44px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);font-size:13px;font-weight:500;line-height:1.2;text-align:left}
#home-topics button:last-child:nth-child(odd){grid-column:1/-1}
#home-topics button:hover:not(:disabled){background:var(--surface-2)}
.ico{display:flex;flex-shrink:0;color:var(--accent-text)}.ico svg{width:16px;height:16px;display:block}
.label{min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}

#topics{margin-top:16px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
#topics button{min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);font-size:13px;font-weight:500;text-align:left}
#topics button:hover:not(:disabled){background:var(--surface-2)}
#topics button:disabled{cursor:not-allowed}
#topics button:last-child:nth-child(odd){grid-column:1/-1}
#topics button[aria-pressed="true"]{background:var(--surface-2);border-color:var(--accent)}

.ticket-list{display:flex;flex-direction:column;gap:8px}
.ticket-list button{display:block;width:100%;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);text-align:left;color:var(--text)}
.ticket-list button:hover{background:var(--surface-2)}
.ticket-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.ticket-subject{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ticket-status{flex-shrink:0;font-size:11px;font-weight:600;color:var(--accent-text);background:var(--bg);padding:4px 8px;border-radius:8px;white-space:nowrap}.ticket-status.closed{color:var(--muted)}
.ticket-preview{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px;color:var(--muted);font-size:12px}.ticket-date{display:none;color:var(--muted);font-size:11px;margin-top:4px}
#all-list .ticket-date{display:block}
.history-heading{margin:0 0 12px}

.chat-info{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:12px;line-height:1.3;color:var(--muted);margin-bottom:12px}
.chat-info span{white-space:nowrap}
.chat-info button{border:1px solid var(--line);border-radius:10px;background:var(--surface);padding:8px 12px;font-size:12px;font-weight:500;white-space:nowrap}
.chat-info button:hover{background:var(--surface-2)}
#greeting{margin:0 0 4px;padding:12px 16px;background:var(--surface);border:1px solid var(--line);border-radius:14px 14px 14px 4px;color:var(--text);font-size:13px;line-height:1.5}
#messages{display:flex;flex-direction:column;gap:12px;outline:none}
.row{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.row.follow{margin-top:-8px}
.row.mine{align-items:flex-end}
.row.system{align-items:center}
.head{display:flex;align-items:center;gap:8px;min-height:28px;margin-bottom:4px;font-size:12px;line-height:1.3;color:var(--muted);max-width:100%}
.row.mine .head{min-height:0;margin-bottom:4px}
.avatar{width:28px;height:28px;flex-shrink:0;display:block;border-radius:50%;background:var(--surface-2)}
.author{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--accent-text);font-weight:600}
.role{flex:0 1 auto;min-width:0;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:1px 8px;border-radius:8px;background:var(--surface-2);color:var(--muted);font-size:11px;font-weight:500}
.stamp{flex-shrink:0;white-space:nowrap}
.message{max-width:85%;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px;font-size:14px;line-height:1.45}
.row:not(.mine):not(.system) .message{margin-left:36px}
.row:not(.follow):not(.mine):not(.system) .message{border-top-left-radius:4px}
.message.mine{border-bottom-right-radius:4px}
.message.system{max-width:100%;background:transparent;border:0;color:var(--muted);font-size:12px;text-align:center;padding:0 12px}
.day{align-self:center;color:var(--muted);font-size:12px;line-height:1.3;text-align:center;padding:4px 0}
.file-download{display:block;max-width:100%;white-space:normal;overflow-wrap:anywhere;border:1px solid var(--line);background:var(--surface-2);border-radius:10px;padding:8px 12px;color:var(--text);text-align:left;margin-top:8px;font-size:13px}.file-download:hover{background:var(--bg)}

/* Image attachments render as a preview inside the bubble; the lightbox opens the full size. */
.image-preview{display:block;max-width:100%;min-width:160px;min-height:96px;margin-top:8px;padding:0;border:0;border-radius:10px;background:var(--surface-2);overflow:hidden;line-height:0}
.image-preview:first-child{margin-top:0}
.image-preview.loaded{min-width:0;min-height:0}
.image-preview img{display:block;max-width:100%;max-height:240px;border-radius:10px;object-fit:cover;animation:fs-fade .15s ease both}
.image-preview:hover:not(:disabled){background:var(--bg)}

#lightbox{position:fixed;inset:0;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;background:color-mix(in srgb,var(--bg) 97%,transparent);animation:fs-fade .15s ease both}
#lightbox-img{display:block;min-height:0;max-width:100%;max-height:calc(100% - 64px);border-radius:10px;object-fit:contain}
.lightbox-bar{display:flex;gap:8px;flex-shrink:0}
.lightbox-btn{display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);color:var(--text);font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;transition:background-color .15s ease,transform .15s ease}
.lightbox-btn:hover{background:var(--surface)}
.lightbox-btn:active{transform:scale(.98)}
#lightbox-download{color:var(--accent-text)}

.history-note{font-size:12px;color:var(--muted)}

footer{position:relative;z-index:1;padding:8px 20px 12px;flex-shrink:0}
[data-view="home"] footer{padding:12px 20px 16px}
.consent{display:flex;align-items:flex-start;gap:8px;margin:0 0 8px;font-size:12px;line-height:16px;color:var(--muted);cursor:pointer}
.consent input{appearance:none;-webkit-appearance:none;display:grid;place-content:center;flex:0 0 16px;width:16px;height:16px;margin:0;border:1px solid var(--muted);border-radius:4px;background:var(--surface);cursor:pointer;transition:background-color .15s ease,border-color .15s ease}
.consent input:checked{background:var(--accent);border-color:var(--accent)}
.consent input:checked::after{content:"";display:block;width:8px;height:4px;margin-top:-2px;border-left:2px solid var(--text);border-bottom:2px solid var(--text);transform:rotate(-45deg)}
.consent input:focus-visible{outline:2px solid var(--accent-text);outline-offset:2px}
.consent a{color:var(--accent-text);text-decoration:none}.consent a:hover{text-decoration:underline}
form{display:flex;align-items:flex-end;gap:8px;min-height:48px;background:var(--surface);border:1px solid var(--line);padding:4px 4px 4px 16px;border-radius:14px;transition:border-color .15s}
form:focus-within{border-color:var(--accent)}
textarea{flex:1;min-width:0;resize:none;background:transparent;border:0;color:var(--text);padding:8px 0;outline:none;height:36px;max-height:96px;font-size:14px;line-height:20px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--surface-2) transparent}
textarea::placeholder{color:var(--muted)}
textarea:disabled{cursor:not-allowed}
form .primary{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;height:36px;padding:0;border:0;border-radius:10px;background:var(--accent);color:var(--text)}
form .primary:hover:not(:disabled){background:var(--accent-hover)}
form .primary:disabled{cursor:not-allowed}
form[data-empty="true"] .primary:not(:disabled){opacity:.45}
form svg{width:18px;height:18px;display:block}
#to-bottom{position:absolute;right:20px;bottom:100%;margin-bottom:8px;display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface-2);color:var(--text)}
#to-bottom:not([hidden]){animation:fs-rise .15s ease-out both}
#to-bottom:hover{background:var(--surface)}
#to-bottom svg{width:18px;height:18px;display:block}
#error{color:var(--err);font-size:12px;margin:8px 0 0}#error:empty{display:none}
#retry{border:1px solid var(--line);background:var(--surface-2);border-radius:10px;padding:8px 12px;margin-top:8px;font-size:14px;font-weight:600;color:var(--accent-text)}#retry:hover{background:var(--surface)}
.foot{text-align:center;font-size:11px;line-height:1.4}
#composer:not([hidden])~.foot,#error:not(:empty)~.foot,#retry:not([hidden])~.foot{margin-top:8px}
#privacy{color:var(--muted);text-decoration:none;white-space:nowrap}#privacy:hover{color:var(--text);text-decoration:underline}

/* Narrow frames: drop the working hours and tighten the gutters. */
@media(max-width:340px){#hours{display:none}header{gap:8px;padding:0 16px}.brand{gap:8px}.heading strong{font-size:13px}.greet{padding:16px}.home-body{padding:0 16px 4px}[data-view="home"] footer{padding:12px 16px}#home-topics{gap:8px}#home-topics button{gap:8px;padding:0 8px}#chat,#history{padding:12px 16px}footer{padding:8px 16px 12px}.write-card{padding-right:64px}.write-card small{white-space:normal}#to-bottom{right:16px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}#shell button:not(:disabled):active,#shell .discord-row:active,.lightbox-btn:active{transform:none}}
