/* ==========================================================================
   AURA CS2 — chat module: floating messenger window (list <-> thread)
   Every surface is bound to the site theme tokens (--card, --button, --span…)
   ========================================================================== */

#modal_okno_chat [hidden] { display: none !important; }

/* The site theme pads every <button> with 1px 16px and every <input> with 1rem inline. Inside the
   module's fixed-size icon buttons that leaves a 2px content box, and because an <svg> is
   overflow:hidden its automatic minimum size is 0, so flex-shrink collapses the icon to a sliver. */
#modal_okno_chat .chat-ico-btn,
#modal_okno_chat .send-chat,
#modal_okno_chat .chat_emoji_cat_btn,
#modal_okno_chat .chat-admin-remove,
#modal_okno_chat .chat-admin-toggle,
#modal_okno_chat input.chat_switch { padding: 0; }
#modal_okno_chat svg { flex-shrink: 0; }

/* The theme also lays white-space: nowrap on every bare <label> of the page. A row of a card becomes a
   <label> as soon as its control is a switch, and the note under its title then runs off the sheet in one
   line and is cut by its edge. A word of this module wraps; the few shapes that must hold one line
   (a face's name, a pill, a time) name that themselves. */
#modal_okno_chat label { white-space: normal; }

/* The theme also pins every <button> to height: var(--input-height) (41px). Room rows carry a
   38-46px avatar, menu rows two lines of padding and a group row a coloured icon square, so those
   four get their height back; every other module button either sets its own box or wants the
   native 41px. */
#modal_okno_chat .chat-room-item,
#modal_okno_chat .chat-menu-item,
#modal_okno_chat .chat-admin-tab,
#modal_okno_chat .chat-group-row { height: auto; }

/* Line icons are stroke-only, but the theme paints every <svg> with fill, so the paint is pinned here.
   Deliberately ID-free: an id here would outrank every per-context size rule below (menu items, admin
   tabs, room list) and silently force all of them back to 16px. */
.chat-ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- what the module paints on top of a theme ----------
   The site ships fourteen palettes and a visitor may pick any of them: purple on violet, crimson on
   wine, forest, amber, graphite, pure black. So every hairline, tile, knob and ring this module draws is
   mixed out of the theme's own ink instead of a fixed white or a hand-picked hex - a row must keep the
   same relationship to its surface in all fourteen. color-mix is overridden where it exists and the
   plain rgba stays as the answer where it does not. */
#modal_okno_chat {
    --chat-line: rgba(255, 255, 255, .09);
    --chat-line-soft: rgba(255, 255, 255, .06);
    --chat-ring: rgba(255, 255, 255, .17);
    --chat-hover: rgba(255, 255, 255, .07);
    --chat-tile: rgba(255, 255, 255, .1);
    --chat-tile-accent: rgba(255, 179, 71, .16);
    --chat-tile-warn: rgba(215, 141, 60, .18);
    --chat-tile-lock: rgba(79, 131, 163, .2);
    --chat-tile-danger: rgba(204, 92, 77, .18);
    --chat-tile-ok: rgba(136, 192, 127, .18);
    --chat-shadow: rgba(0, 0, 0, .38);
    --chat-ink-soft: var(--text-secondary);
    /* the inks that sit on a fill, and so are the four places a visitor's own colours can disagree with
       them. What sits on a filled accent has always been the window's backdrop and what sits on a pill the
       reading ink - both right answers while the window wore the site's palette, both coin flips once the
       accent is picked by hand. A coin is a second fill of its own, and a switch knob rides two surfaces:
       its trough while off, the accent while on. So each is named, each off the others. */
    --chat-on-accent: var(--bg);
    --chat-on-money: var(--bg);
    --chat-on-span: var(--text-default);
    /* the reading ink of a control that turns red under the pointer: the same backdrop the other fills
       take, named apart from --chat-on-money so a palette that repaints --money cannot move it too */
    --chat-on-red: var(--bg);
    --chat-knob: var(--text-default);
    --chat-knob-on: var(--text-default);
    /* four state inks, named once. The palettes carry --money and --span in every one of the fourteen,
       but --red, --green, --orange and --ct are keys of the default colour sheet: a theme may hand the
       page no red at all, and then an unpainted var() silently takes the reading ink - the exit row
       stops being an exit. Each state therefore keeps the palette's own colour where one exists and the
       colour the default sheet ships with where none does, and every -ink below is what the module puts
       on a tile of that state, which a palette's flat hue would too often lose. */
    --chat-red: var(--red, #cc5c4d);
    --chat-green: var(--green, #88c07f);
    --chat-orange: var(--orange, #d78d3c);
    --chat-ct: var(--ct, #4f83a3);
    --chat-danger-ink: var(--chat-red);
    --chat-warn-ink: var(--chat-orange);
    --chat-lock-ink: var(--chat-ct);
    --chat-ok-ink: var(--chat-green);
}
@supports (color: color-mix(in srgb, red, blue)) {
    #modal_okno_chat {
        --chat-line: color-mix(in srgb, var(--text-default) 12%, transparent);
        --chat-line-soft: color-mix(in srgb, var(--text-default) 7%, transparent);
        --chat-ring: color-mix(in srgb, var(--text-default) 19%, transparent);
        --chat-hover: color-mix(in srgb, var(--text-default) 8%, transparent);
        --chat-tile: color-mix(in srgb, var(--span) 16%, transparent);
        --chat-tile-accent: color-mix(in srgb, var(--money) 17%, transparent);
        --chat-tile-warn: color-mix(in srgb, var(--chat-orange) 19%, transparent);
        --chat-tile-lock: color-mix(in srgb, var(--chat-ct) 22%, transparent);
        --chat-tile-danger: color-mix(in srgb, var(--chat-red) 19%, transparent);
        --chat-tile-ok: color-mix(in srgb, var(--chat-green) 19%, transparent);
        --chat-shadow: color-mix(in srgb, var(--text-default-invert, #000) 42%, transparent);
        /* a palette's second ink is a mood, not a promise: theme 7 pairs a near-black grey with a
           near-black card, and the small print of a sheet then disappears. Lifting it a step toward the
           reading ink keeps one relationship between word and surface in all fourteen palettes. */
        --chat-ink-soft: color-mix(in srgb, var(--text-secondary) 58%, var(--text-default));
        /* a palette's red is the same kind of mood. The tile behind a word of it stays red - that is what
           the tile is for - while the word itself steps toward the reading ink, so the exit row reads the
           same way in every palette instead of only in the bright ones. */
        --chat-danger-ink: color-mix(in srgb, var(--chat-red) 62%, var(--text-default));
        --chat-warn-ink: color-mix(in srgb, var(--chat-orange) 62%, var(--text-default));
        --chat-lock-ink: color-mix(in srgb, var(--chat-ct) 62%, var(--text-default));
        --chat-ok-ink: color-mix(in srgb, var(--chat-green) 62%, var(--text-default));
    }
}

/* ---------- presence ----------
   A face that belongs to one person carries a dot while that person stands on the site. The dot is a sibling
   of the circle rather than a child, because a face clips its own picture, and the ring around it is the
   surface the face sits on - every context hands that over as --chat-face-ring. Presence is the site's own
   green and never the accent: switching the palette must not turn "here" into a banner. */
#modal_okno_chat { --chat-face-ring: var(--card); }
/* The window never asked the page for its reading ink, so a word the module leaves unpainted took the
   colour of whatever host page carried it - on a dark palette that is a black title on a dark card.
   The window now names its own ink: every label that inherits answers to the palette, in all fourteen. */
#modal_okno_chat { color: var(--text-default); }
.chat-face {
    position: relative;
    display: flex;
    flex-shrink: 0;
}
.chat-face-dot, .chat_ava_dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: clamp(10px, 27%, 14px);
    height: clamp(10px, 27%, 14px);
    border-radius: 50%;
    background: var(--green, #43b581);
    box-shadow: 0 0 0 2px var(--chat-face-ring, var(--card));
    pointer-events: none;
}
.chat-face-lg .chat-face-dot { width: 18px; height: 18px; right: 1px; bottom: 1px; }
/* the group card paints its face inside a dashed ring of its own */
.chat-info-pick .chat-face { width: 100%; height: 100%; }
/* a bubble of the same author repeats no face at all, so it repeats no state either */
.chat_msg_grouped .chat_ava_dot { display: none; }

/* ---------- open button ----------
   A circle standing in the corner rather than a half-pill glued to the edge of the page: the window it
   opens already floats 16px off that corner, so the handle that calls it floats with it. */
.chat_open {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: 54px;
    height: 54px;
    padding: 0;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 50%;
    background: var(--span);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    transition: transform .2s ease, opacity .2s ease, background .2s ease;
}
.chat_open:hover { transform: scale(1.06); background: var(--button-hover); }
.chat_open svg { width: 24px; height: 24px; fill: var(--text-default); }
/* The badge of unread sits at the outer top corner; the button no longer hugs an edge, so the badge has
   that edge back and cannot be cut by it. */
.chat_open span {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span);
    color: var(--text-default);
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 0 0 3px var(--bg);
}
body:has(#modal_okno_chat.open) .chat_open {
    opacity: 0;
    pointer-events: none;
    transform: scale(.8);
}

/* ---------- panel shell: a floating messenger window ----------
   Not a docked column: the panel sits 16px off the bottom-right corner, keeps one width
   whether it shows the chat list or a conversation, and never resizes the page behind it.
   The window is laid out at full width while closed and fades/scales in - animating width used to
   squeeze the list against the container's overflow while it grew, which clipped the first rows. */
.chat-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(400px, calc(100% - 32px));
    height: min(660px, calc(100vh - 32px));
    z-index: 999;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.97);
    transform-origin: 100% 100%;
    transition: opacity .18s ease, transform .24s ease, visibility 0s linear .24s;
}
.chat-container.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity .18s ease, transform .24s ease;
    box-shadow: 0 20px 54px rgba(0, 0, 0, .5), 0 2px 10px rgba(0, 0, 0, .3);
}
.chat-content {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--span) 22%, transparent);
    border-radius: 16px;
    overflow: hidden;
    color: var(--text-default);
    font-family: Inter, sans-serif;
}

/* ---------- chat list pane ----------
   One pane at a time inside the window: this is what the panel opens on, and it fills the
   whole 400px. Choosing a room hides it (see the master/detail rules by .chat-thread). */
.chat-side {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    background: var(--card);
}
.chat-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 14px 8px 10px 16px;
    flex-shrink: 0;
}
.chat-side-title {
    /* the name owns the left edge and the two handles stand together on the right: a head of three children
       spread by space-between would otherwise drop the handle into the middle of the row, away from the
       cross it belongs to */
    margin-right: auto;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--text-default);
}
/* the cross of the head closes the window rather than going anywhere, so it answers the pointer in the
   sites red the same way the banners own cross does - a hover that only greys would read as a destination */
.chat-side-head #chat_close:hover { background: var(--chat-red); }
.chat-side-head #chat_close:hover svg { fill: var(--chat-on-red); }
.chat-side-search {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 14px 10px;
    padding: 0 12px;
    height: 40px;
    border-radius: 20px;
    background: var(--input-form);
    transition: box-shadow .18s ease;
}
/* a field that holds words says it is the one being typed in */
.chat-side-search:focus-within { box-shadow: 0 0 0 2px var(--span-middle); }
.chat-side-search svg { width: 16px; height: 16px; flex-shrink: 0; fill: var(--text-secondary); transition: fill .18s ease; }
.chat-side-search:focus-within svg { fill: var(--span); }
.chat-side-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-default);
    font-family: inherit;
    font-size: 14px;
    padding: 0 8px;
}
.chat-side-search input::placeholder { color: var(--text-secondary); }

/* three pills name what the list shows: everything, the groups, the private pairs. They scroll instead of
   wrapping - a second row would take height from the list, and a squeezed label from the pill. */
.chat-room-tabs {
    display: flex;
    gap: 6px;
    margin: 0 14px 10px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.chat-room-tabs::-webkit-scrollbar { display: none; }
#modal_okno_chat .chat-room-tab {
    flex-shrink: 0;
    height: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border: 1px solid color-mix(in srgb, var(--span) 16%, transparent);
    border-radius: 18px;
    background: var(--input-form);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
#modal_okno_chat .chat-room-tab:hover { color: var(--text-default); background: var(--button-hover); }
.chat-room-tab-on { background: var(--span); border-color: transparent; color: var(--chat-on-span); box-shadow: 0 3px 10px rgba(0, 0, 0, .22); }
.chat-room-tab-on:hover { color: var(--chat-on-span); background: var(--span); }
.chat-room-tab-count {
    min-width: 19px;
    padding: 1px 6px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--span) 22%, transparent);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.chat-room-tab-on .chat-room-tab-count { background: rgba(0, 0, 0, .24); color: var(--text-default); }

.chat-room-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 6px 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--span-middle) transparent;
}
.chat-room-list::-webkit-scrollbar { width: 5px; }
.chat-room-list::-webkit-scrollbar-thumb { background: var(--span-middle); border-radius: 4px; }

/* the list carries two kinds of rows, groups and private pairs, so each block gets a small heading. The
   rule after the word keeps the heading with the rows it names without asking for a second line */
.chat-room-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.chat-room-section::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--chat-line-soft);
}

.chat-room-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 8px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease;
}
.chat-room-item:hover { background: var(--span-10); }
/* the room being read is a soft inset pill rather than a band of the accent across the whole window: the
   list stays legible while the eye knows where it is */
.chat-room-active {
    background: var(--span-10);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--span) 26%, transparent);
}
.chat-room-active:hover { background: var(--span-10); }
.chat-room-active .chat-room-name { color: var(--span); }
/* a row holding words nobody has opened yet is read before it is opened: its name takes the weight and its
   time takes the accent, which is what the badge under it already counts */
.chat-room-unread .chat-room-name { font-weight: 700; }
.chat-room-unread .chat-room-time { color: var(--span); }
.chat-room-unread .chat-room-preview { color: var(--text-default); opacity: .72; }
.chat-room-avatar {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-default);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--chat-ring);
}
/* a private pair shows the face of the other person instead of a letter */
.chat-room-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-room-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-room-top, .chat-room-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-room-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-room-time { flex-shrink: 0; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.chat-room-preview {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-room-you { color: var(--span); font-size: 12px; }
.chat-room-badge {
    flex-shrink: 0;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span);
    color: var(--chat-on-span);
    font-size: 11.5px;
    font-weight: 700;
}
.chat-room-pin {
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: var(--text-secondary);
    -webkit-mask: radial-gradient(circle at 50% 20%, #000 2px, transparent 2.5px) center/contain no-repeat;
    clip-path: polygon(38% 0, 62% 0, 62% 45%, 88% 70%, 56% 70%, 56% 100%, 44% 100%, 44% 70%, 12% 70%, 38% 45%);
}
/* a private group says so in its own row: the same lock the settings sheet uses, at marker size */
.chat-room-lock { flex-shrink: 0; display: flex; align-items: center; color: var(--text-secondary); }
.chat-room-lock svg { width: 12px; height: 12px; }
/* how many people stand behind the link of a group: a count only its owner is ever sent, and the one part
   of a row that opens the sheet where the queue is answered instead of the conversation */
.chat-room-req {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span-10);
    color: var(--span);
    font-size: 11px;
    font-weight: 700;
}
.chat-room-empty {
    padding: 40px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-side-foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid color-mix(in srgb, var(--span) 18%, transparent);
}
/* the strip beside this word lists the people standing on the site, so the word carries their colour */
.chat-side-online { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.chat-side-online::before {
    content: '';
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--green, #43b581);
}
.chat_peoples_wrap { display: flex; align-items: center; min-width: 0; }
.chat_peoples {
    display: flex;
    gap: 0;
    align-items: center;
    max-width: 210px;
    overflow-x: auto;
    scrollbar-width: none;
}
.chat_peoples::-webkit-scrollbar { height: 0; }
.chat_peoples .ava {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    margin-left: -8px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    opacity: .9;
    outline: 2px solid var(--card);
    transition: .2s;
}
.chat_peoples .ava:first-child { margin-left: 0; }
.chat_peoples .ava:hover { opacity: 1; transform: translateY(-2px); }

/* ---------- thread ----------
   Master/detail inside the one window. The thread is an overlay rather than a second flex child:
   it slides in over the list, which stays mounted, so the settings sheet, the admin panel and the
   muted screen (all children of this section) keep covering the whole window in either state. */
.chat-thread {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .26s ease, visibility 0s linear .26s;
}
#modal_okno_chat.chat_show_thread .chat-thread {
    transform: none;
    visibility: visible;
    transition: transform .26s ease;
}
/* while the window itself is closing the slide would fight the width animation */
#modal_okno_chat:not(.open) .chat-thread { transition: none; }
.chat-thread-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 8px 0 5px;
    background: var(--card);
    border-bottom: 1px solid color-mix(in srgb, var(--span) 18%, transparent);
}
.chat-back { display: flex; position: relative; }
.chat-back-count {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span);
    color: var(--chat-on-span);
    font-size: 9.5px;
    font-weight: 700;
    pointer-events: none;
}
.chat-thread-avatar { display: flex; align-items: center; }
.chat-thread-avatar .chat-room-avatar { width: 34px; height: 34px; font-size: 14px; }
/* the whole face-and-name block of a thread is the door to the group card, so it answers as one button;
   the theme pads every button, hence the box is pinned here rather than left to the site default */
#modal_okno_chat .chat-thread-info {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease;
}
#modal_okno_chat .chat-thread-info:hover { background: var(--button); }
.chat-thread-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.chat-thread-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-thread-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* the line under a pair's name reports the state of the person, and says it in the colour of the dot */
.chat-thread-here { color: var(--green, #43b581); }
.chat-tools { display: flex; align-items: center; gap: 4px; }

.chat-ico-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.chat-ico-btn:hover { background: var(--span-10); }
.chat-ico-btn:active { transform: scale(.93); }
.chat-ico-btn svg { width: 19px; height: 19px; fill: var(--text-secondary); transition: fill .18s ease; }
.chat-ico-btn:hover svg { fill: var(--text-default); }

.chat-sound-toggle-label { position: relative; display: flex; width: 34px; height: 34px; cursor: pointer; }
.chat-sound-toggle-label .chat_checkbox { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chat-sound-toggle { width: 34px; height: 34px; padding: 7px; fill: var(--text-secondary); transition: fill .18s ease; }
.chat-sound-toggle.chat-sound-off { display: none; position: absolute; inset: 0; }
.chat-sound-toggle-label:hover .chat-sound-toggle { fill: var(--text-default); }
.chat_checkbox:checked ~ .chat-sound-toggle.chat-sound-on { display: none; }
.chat_checkbox:checked ~ .chat-sound-toggle.chat-sound-off { display: block; }

/* ---------- pinned bar & rules ---------- */
.chat-pinbar, .chat-rules {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 12.5px;
    background: var(--span-10);
    border-bottom: 1px solid color-mix(in srgb, var(--span) 20%, transparent);
    cursor: pointer;
}
.chat-pinbar:hover, .chat-rules:hover { background: var(--span-middle); }
.chat-pin-icon { width: 15px; height: 15px; flex-shrink: 0; fill: var(--span); }
.chat-pin-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.chat-pin-name { font-size: 11.5px; font-weight: 700; color: var(--span); }
.chat-pin-text {
    font-size: 12.5px;
    color: var(--text-custom);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-rules { cursor: default; color: var(--text-secondary); }
.chat-rules:hover { background: var(--span-10); }
.chat-rules-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--span); flex-shrink: 0; }

/* ---------- messages ---------- */
.chat-content-main {
    --chat-face-ring: var(--bg);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--span-middle) transparent;
}
.chat-content-main::-webkit-scrollbar { width: 6px; }
.chat-content-main::-webkit-scrollbar-thumb { background: var(--span-middle); border-radius: 4px; }

.reload-mess, .chat_no_msg {
    display: flex;
    flex: 1 1 auto;
    min-height: 120px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.chat_message, .chat_message_my {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 9px;
    align-items: flex-start;
}
.chat_message_my { grid-template-columns: minmax(0, 1fr) 36px; }
.chat_msg_ava { grid-column: 1; grid-row: 1; position: relative; }
.chat_message_my .chat_msg_ava { grid-column: 2; }
.chat_bubble {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    max-width: min(520px, 86%);
    padding: 7px 11px 6px;
    border-radius: 14px 14px 14px 4px;
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--span) 12%, transparent);
    position: relative;
}
.chat_message_my .chat_bubble {
    grid-column: 1;
    justify-self: end;
    border-radius: 14px 14px 4px 14px;
    background: var(--button);
    border-color: transparent;
}
.chat_msg_ava img, .chat_msg_ava .chat_avatar_wrap { width: 36px; height: 36px; border-radius: 50%; display: block; }
.chat_msg_ava img { object-fit: cover; }
.chat_message_my .chat_msg_ava img { outline: 2px solid var(--span-half); }

.chat_info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
}
.chat_message_content {
    margin: 0;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: anywhere;
    text-align: left;
    color: var(--text-custom);
}
.chat_message_my .chat_message_content { color: var(--text-default); }
.chat_message_content emoji { font-size: 17px; }
.chat_message_content .a-text-href { color: var(--span); font-weight: 600; transition: opacity .2s; }
.chat_message_content .a-text-href:hover { opacity: .72; }
.chat_message_date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.chat_message_my .chat_message_date { justify-content: flex-end; color: var(--text-secondary); }
.chat_message_date:hover { color: var(--text-default); }
.chat_message_date > stats { font-variant-numeric: tabular-nums; }
.chat_edited { font-style: normal; opacity: .85; }
.chat_edited::before { content: '·'; margin-right: 4px; }
.chat_pin_mark {
    width: 9px;
    height: 9px;
    display: inline-block;
    background: var(--span);
    clip-path: polygon(38% 0, 62% 0, 62% 45%, 88% 70%, 56% 70%, 56% 100%, 44% 100%, 44% 70%, 12% 70%, 38% 45%);
}

/* ---------- reactions: the floating bar above a bubble and the pills under it ----------
   The bar is rendered by PHP inside every bubble, so who may react never depends on the client. */
.chat_quick {
    position: absolute;
    top: -13px;
    right: 4px;
    display: none;
    align-items: center;
    gap: 1px;
    padding: 2px 3px;
    border-radius: 17px;
    background: var(--bg-modal);
    border: 1px solid color-mix(in srgb, var(--span) 18%, transparent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .34);
    z-index: 6;
}
/* the bar answers to a click only: hovering a line must never cover it with seven buttons */
.chat_qshow .chat_quick { display: flex; }
.chat_quick_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.chat_quick_btn:hover { background: var(--span-middle); transform: scale(1.14); }

.chat_reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.chat_rx {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 6px 0 5px;
    border: 1px solid color-mix(in srgb, var(--span) 22%, transparent);
    border-radius: 11px;
    background: var(--span-10);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.chat_rx:hover { background: var(--span-middle); }
.chat_rx_mine { background: var(--span); border-color: transparent; color: var(--chat-on-span); }
.chat_rx_e { font-size: 13px; line-height: 1; }
/* the faces of the people behind one face: a pill is a crowd, so it shows the crowd. Three circles overlap
   the way a messenger stacks them and still fit a 400px window beside the emoji; the rest are counted, and
   the right button on the pill lists every one of them in full. */
.chat_rx_faces { display: flex; align-items: center; }
.chat_rx_face {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: -5px;
    box-shadow: 0 0 0 1.5px var(--chat-face-ring, var(--card));
}
.chat_rx_face:first-child { margin-left: 0; }
.chat_rx_more { margin-left: 3px; font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* ---------- who reacted: the list a right click opens behind one pill ----------
   The same sheet the message menu uses, but its rows are people rather than commands, so it is narrower and
   scrolls instead of growing past the window. */
.chat-rx-sheet {
    position: absolute;
    z-index: 20;
    width: 218px;
    max-height: 252px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 14px;
    background: var(--bg-modal);
    border: 1px solid color-mix(in srgb, var(--span) 28%, transparent);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
    /* the sheet, not the card, is the surface these faces sit on */
    --chat-face-ring: var(--bg-modal);
    animation: chatMenuIn .15s ease;
}
.chat_rx_head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 7px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--chat-ink-soft);
}
.chat_rx_head span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat_rx_head b { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--span); }
.chat_rx_h_e { font-size: 13px; line-height: 1; font-style: normal; }
.chat_rx_loading { padding: 8px 6px; font-size: 13px; text-align: center; color: var(--chat-ink-soft); }
.chat_rx_row {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 5px 6px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-default);
    font-family: inherit;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease;
}
.chat_rx_row:hover { background: var(--chat-hover); }
.chat_rx_ava { width: 26px; height: 26px; }
.chat_rx_ava img, .chat_rx_letter {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}
/* a person the store has no picture for still gets a circle: the first letter of the name he answers to */
.chat_rx_letter {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-tile);
    color: var(--span);
    font-size: 12px;
    font-weight: 700;
}
.chat_rx_name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat_rx_when {
    flex: 0 0 auto;
    font-size: 10.5px;
    color: var(--chat-ink-soft);
    font-variant-numeric: tabular-nums;
}

/* grouping of consecutive messages from one author */.chat_msg_grouped { margin-top: -4px; }
.chat_msg_grouped .chat_info { display: none; }
.chat_msg_grouped .chat_bubble { border-radius: 14px; }
.chat_msg_grouped .chat_msg_ava img { opacity: 0; }
.chat_msg_grouped .chat_msg_ava .chat_avatar_badge { display: none; }

/* date chip + unread divider */
.chat_date_sep { display: flex; justify-content: center; margin: 6px 0 2px; }
.chat_date_sep span {
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--span-10);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
}
.chat_unread_divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 2px;
    color: var(--span);
    font-size: 11.5px;
    font-weight: 600;
}
.chat_unread_divider::before, .chat_unread_divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--span-half);
}

/* reply quote inside a bubble */
.chat_reply {
    display: flex;
    gap: 7px;
    margin-bottom: 5px;
    padding: 4px 7px;
    border-radius: 8px;
    background: var(--span-10);
    cursor: pointer;
    min-width: 0;
}
.chat_message_my .chat_reply { background: rgba(0, 0, 0, .18); }
.chat_reply_bar { flex-shrink: 0; width: 2px; border-radius: 2px; background: var(--span); }
.chat_reply_body { display: flex; flex-direction: column; min-width: 0; }
.chat_reply_name { font-size: 11.5px; font-weight: 700; color: var(--span); }
.chat_reply_text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* roles, nicknames, mentions */
.chat_role {
    font-size: 10px;
    font-weight: 700;
    background: var(--span-middle);
    color: var(--text-default);
    border-radius: 5px;
    padding: 2px 6px;
}
.chat_nickname {
    max-width: 180px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color .2s;
}
.chat_nickname:hover { color: var(--text-default); }
.chat_message_content .chat_mention_user,
.chat_message_content .chat_mention_discord {
    font-weight: 600;
    text-decoration: none;
    color: var(--span);
    background: var(--span-10);
    padding: 1px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background .2s;
}
.chat_message_content .chat_mention_user:hover,
.chat_message_content .chat_mention_discord:hover { background: var(--span-middle); color: var(--text-default); }
.chat_nickname_discord { color: var(--text-custom); }
.chat_discord_mark { display: inline-block; font-size: 11px; vertical-align: middle; opacity: .85; margin-left: 2px; filter: saturate(.9); }

/* flags & filters */
.chat_msg_flagged .chat_bubble { outline: 1px solid var(--span-half); }
.chat_msg_hidden { display: none !important; }

/* compact (context) view */
.chat_compact { gap: 3px; padding: 10px 10px 14px; }
.chat_compact .chat_bubble { padding: 4px 9px 3px; }
.chat_compact .chat_message_content { font-size: 13.5px; }
.chat_compact .chat_info { margin-bottom: 0; }
.chat_compact .chat_msg_ava img, .chat_compact .chat_msg_ava .chat_avatar_wrap { width: 28px; height: 28px; }
.chat_compact .chat_message, .chat_compact .chat_message_my { grid-template-columns: 28px minmax(0, 1fr); }
.chat_compact .chat_message_my { grid-template-columns: minmax(0, 1fr) 28px; }

/* verified badge + discord avatar badge */
.verified_badge { display: inline-flex; align-items: center; flex-shrink: 0; vertical-align: middle; margin-left: 2px; }
.verified_badge svg { display: block; }
.chat_avatar_wrap { position: relative; display: block; width: 36px; height: 36px; }
.chat_avatar_wrap > img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; transition: transform .2s; }
.chat_avatar_wrap > img:hover { transform: scale(1.06); }
.chat_avatar_badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span);
    box-shadow: 0 0 0 2px var(--bg);
    pointer-events: none;
}
.chat_avatar_badge svg { width: 9px; height: 9px; display: block; }

/* nickname effects */
.nickname-effect { display: inline-block; }
.nickname-effect-shine {
    background: linear-gradient(90deg, var(--nick-color, #8B5CF6) 0%, #fff 50%, var(--nick-color, #8B5CF6) 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: nicknameShine 4.5s linear infinite;
}
@keyframes nicknameShine { 0% { background-position: 520% center; } 100% { background-position: -20% center; } }
.nickname-effect-gradient {
    background: linear-gradient(90deg,
        var(--nick-color, #8B5CF6) 0%,
        color-mix(in srgb, var(--nick-color, #8B5CF6) 35%, var(--nick-color-2, #f65c5c)) 50%,
        var(--nick-color-2, #f65c5c) 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: nicknameGradient 4s ease-in-out infinite;
}
@keyframes nicknameGradient { 0%, 100% { background-position: 0% center; } 50% { background-position: 100% center; } }
.nickname-effect-pulse { color: var(--nick-color, #8B5CF6); animation: nicknamePulse 1.8s ease-in-out infinite; }
@keyframes nicknamePulse {
    0%, 100% { text-shadow: 0 0 4px var(--nick-color, #8B5CF6), 0 0 8px var(--nick-color, #8B5CF6); opacity: .85; }
    50% { text-shadow: 0 0 14px var(--nick-color, #8B5CF6), 0 0 26px var(--nick-color, #8B5CF6); opacity: 1; }
}
.nickname-effect-neon {
    color: var(--text-default);
    text-shadow: 0 0 4px var(--text-default), 0 0 10px var(--nick-color, #8B5CF6), 0 0 20px var(--nick-color, #8B5CF6), 0 0 34px var(--nick-color, #8B5CF6);
    animation: nicknameNeonFlicker 3s infinite;
}
@keyframes nicknameNeonFlicker { 0%, 19%, 21%, 23%, 55%, 57%, 100% { opacity: 1; } 20%, 22%, 56% { opacity: .55; } }
.nickname-effect-wave { display: inline-flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: baseline; }
.nickname-effect-wave span { display: inline-block; white-space: pre; color: var(--nick-color, #8B5CF6); animation: nicknameWave 1.4s ease-in-out infinite; }
@keyframes nicknameWave { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ---------- jump to latest ---------- */
.chat_jump {
    position: absolute;
    right: 16px;
    bottom: 96px;
    z-index: 4;
    display: none;
    align-items: center;
    gap: 4px;
    width: auto;
    height: 38px;
    padding: 0 12px;
    border: none;
    border-radius: 50%;
    background: var(--card);
    color: var(--text-default);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    transition: transform .18s ease;
}
.chat_jump-on { display: flex; }
.chat_jump:hover { transform: scale(1.06); }
.chat_jump svg { width: 20px; height: 20px; fill: var(--span); }
.chat_jump span { font-size: 12px; font-weight: 700; }

/* ---------- composer ---------- */
.chat-input {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: var(--card);
    border-top: 1px solid color-mix(in srgb, var(--span) 18%, transparent);
    box-sizing: border-box;
}
.chat-quote-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 9px;
    background: var(--span-10);
    min-width: 0;
}
.chat-quote-strip .chat_reply_bar { width: 2px; align-self: stretch; }
.chat-quote-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.chat-quote-kind { font-size: 11px; font-weight: 700; color: var(--span); }
.chat-quote-name { font-size: 11.5px; font-weight: 600; color: var(--text-default); }
.chat-quote-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-quote-strip .chat-ico-btn { width: 26px; height: 26px; }

#msg_input.type-chat {
    width: 100%;
    min-height: 22px;
    max-height: 120px;
    padding: 6px 4px;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--text-default);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}
#msg_input.type-chat::placeholder { color: var(--text-secondary); }
#msg_input.type-chat:disabled { opacity: .5; }

.chat-funcs { display: flex; align-items: center; gap: 8px; }
.chat_smile_btn { display: flex; align-items: center; cursor: pointer; user-select: none; }
.chat_smile_btn svg { width: 21px; height: 21px; fill: var(--text-secondary); transition: fill .2s; }
.chat_smile_btn:hover svg { fill: var(--text-default); }
.chat_no_emoji .chat_smile_btn, .chat_no_emoji .chat_menu_smile { display: none; }
.chat-counter { margin-left: auto; font-size: 11px; color: var(--text-secondary); }
.send-chat {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--span-10);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.send-chat svg { width: 19px; height: 19px; }
.send-chat svg path { fill: var(--span); }
.send-chat:hover { background: var(--span-middle); transform: translateY(-1px); }
.chat-counter + .send-chat { margin-left: 0; }

.chat-input-locked { cursor: pointer; }
.chat-locked-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 13px;
    user-select: none;
    transition: color .2s;
}
.chat-locked-text svg { width: 20px; height: 20px; flex-shrink: 0; }
.chat-input-locked:hover { background: var(--span-low); }
.chat-input-locked:hover .chat-locked-text { color: var(--text-default); }

/* ---------- emoji picker ----------
   A bottom sheet, as in the reference recording: child of .chat-thread, full width of the panel, rounded
   only on top, and it slides up over the composer instead of floating above it. */
.chat_menu_smile {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 24;
    display: flex;
    flex-direction: column;
    height: min(420px, 64%);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    transform: translateY(100%);
    background: var(--card);
    border-top: 1px solid color-mix(in srgb, var(--span) 24%, transparent);
    box-shadow: 0 -14px 38px rgba(0, 0, 0, .5);
    transition: transform .26s cubic-bezier(.22, .61, .36, 1);
}
.chat_menu_smile.active { pointer-events: auto; transform: translateY(0); }
.chat_emoji_grab {
    flex-shrink: 0;
    width: 36px;
    height: 4px;
    margin: 7px auto 1px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--span) 45%, transparent);
}

/* search row, with the four emoji this visitor reaches for most as shortcuts on its right */
.chat_emoji_bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 2px 8px 6px;
}
.chat_emoji_quick {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1px;
}
.chat_emoji_search {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--input-form);
    box-sizing: border-box;
    transition: border-color .18s ease, background .18s ease;
}
.chat_emoji_search:focus-within { border-color: var(--span-half); background: var(--button); }
.chat_emoji_search .chat-ico { width: 15px; height: 15px; color: var(--text-secondary); }
/* the theme pads every input with 1rem inline and a 41px row */
#modal_okno_chat .chat_emoji_search input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-default);
    font-family: inherit;
    font-size: 13px;
}
#modal_okno_chat .chat_emoji_search input::placeholder { color: var(--text-secondary); }

/* frequently used: the first block of the scrolling grid, heading centred like the recording */
.chat_emoji_freq { display: flex; flex-direction: column; }
.chat_emoji_freq_title {
    padding: 9px 4px 7px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
}

/* category tabs: the top row of the sheet, clock first */
.chat_emoji_categories {
    display: flex;
    flex-shrink: 0;
    gap: 2px;
    padding: 4px 6px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.chat_emoji_categories::-webkit-scrollbar { height: 0; }
.chat_emoji_cat_btn {
    flex: 1 0 auto;
    width: 36px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    opacity: .55;
    cursor: pointer;
    transition: .18s;
}
.chat_emoji_cat_btn:hover { opacity: .95; background: var(--span-10); }
.chat_emoji_cat_btn.active { opacity: 1; background: var(--span-middle); }
.chat_emoji_body { flex: 1 1 auto; overflow-y: auto; padding: 0 8px 8px; scroll-behavior: smooth; }
.chat_emoji_section { display: flex; flex-direction: column; }
.chat_emoji_section_title {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 4px 6px;
    background: var(--card);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.chat_emoji_grid { display: flex; flex-wrap: wrap; gap: 2px; }
.chat_menu_smile .smiley_js {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    opacity: .88;
    cursor: pointer;
    transition: .18s;
}
.chat_menu_smile .smiley_js:hover { opacity: 1; background: var(--span-10); }
/* the search row shortcuts are smaller than the grid cells */
.chat_menu_smile .chat_emoji_quick .smiley_js { width: 27px; height: 27px; border-radius: 7px; font-size: 18px; }

/* ---------- edit box ---------- */
.chat_edit_box { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chat_edit_box textarea {
    width: 100%;
    min-height: 54px;
    max-height: 140px;
    padding: 7px 9px;
    border: 1px solid var(--span-half);
    border-radius: 9px;
    background: var(--input-form);
    color: var(--text-default);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
}
.chat_edit_actions { display: flex; gap: 6px; }
.chat_edit_actions button {
    padding: 5px 11px;
    border: none;
    border-radius: 8px;
    background: var(--span-middle);
    color: var(--text-default);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: .18s;
}
.chat_edit_actions button:last-child { background: transparent; color: var(--text-secondary); }
.chat_edit_actions button:hover { background: var(--span-half); color: var(--text-default); }
.chat_edit_actions button:last-child:hover { background: var(--span-10); }

/* ---------- context menu ---------- */
.chat-menu {
    position: absolute;
    z-index: 20;
    min-width: 202px;
    padding: 6px;
    border-radius: 14px;
    background: var(--bg-modal);
    border: 1px solid color-mix(in srgb, var(--span) 28%, transparent);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    animation: chatMenuIn .15s ease;
}
@keyframes chatMenuIn {
    from { opacity: 0; transform: translateY(-5px) scale(.97); }
    to { opacity: 1; transform: none; }
}
.chat-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-default);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}
.chat-menu-item .chat-ico { width: 15px; height: 15px; stroke: var(--text-secondary); transition: stroke .16s ease; }
.chat-menu-item:hover { background: var(--span-middle); }
.chat-menu-item:hover .chat-ico { stroke: var(--text-default); }
.chat-menu-sep { height: 1px; margin: 5px 6px; background: color-mix(in srgb, var(--span) 16%, transparent); }
.chat-menu-danger { color: var(--money); }
.chat-menu-danger .chat-ico { stroke: var(--money); }
.chat-menu-danger:hover { background: var(--money-bg); color: var(--money); }
.chat-menu-danger:hover .chat-ico { stroke: var(--money); }

/* ---------- confirm dialog ---------- */
.chat-confirm {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-modal);
}
.chat-confirm-card {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--span) 26%, transparent);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
}
.chat-confirm-text { font-size: 14px; color: var(--text-default); }
.chat-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

.chat-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 9px;
    background: var(--button);
    color: var(--text-default);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease;
}
.chat-btn:hover { background: var(--button-hover); }
.chat-btn-danger { background: var(--money-bg); color: var(--money); }
.chat-btn-danger:hover { background: var(--money); color: var(--chat-on-money); }
.chat-btn:active { transform: translateY(1px); }
.chat-btn-primary {
    background: var(--span);
    background: linear-gradient(180deg, var(--span), color-mix(in srgb, var(--span) 80%, var(--text-default-invert, #000)));
    color: var(--chat-on-accent);
    box-shadow: 0 4px 14px var(--chat-shadow);
}
.chat-btn-primary:hover { background: color-mix(in srgb, var(--span) 78%, var(--bg)); }

/* ---------- mute screen ---------- */
.chat-muted-screen {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-modal);
    backdrop-filter: blur(3px);
}
.chat-muted-card {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 18px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--span) 26%, transparent);
    text-align: center;
}
.chat-muted-icon { width: 34px; height: 34px; fill: var(--money); }
.chat-muted-title { font-size: 15px; font-weight: 700; color: var(--text-default); }
.chat-muted-clock { font-size: 27px; font-weight: 800; color: var(--money); font-variant-numeric: tabular-nums; }
.chat-muted-reason { font-size: 12.5px; color: var(--text-secondary); }
.chat-muted-roles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.chat-muted-roles-label { width: 100%; font-size: 12px; color: var(--text-secondary); }
.chat-muted-noroles { font-size: 12px; color: var(--text-secondary); }

/* ---------- settings sheet ---------- */
.chat-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 18;
    width: min(320px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-left: 1px solid color-mix(in srgb, var(--span) 24%, transparent);
    box-shadow: -14px 0 34px rgba(0, 0, 0, .4);
    animation: chatSheetIn .22s ease;
}
@keyframes chatSheetIn { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.chat-sheet-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(180deg, var(--chat-line-soft), transparent);
    border-bottom: 1px solid var(--chat-line);
}
/* the only way out of a sheet has to read as a button before the sheet is even read */
.chat-sheet-head .chat-ico-btn { background: var(--chat-hover); }
.chat-sheet-head .chat-ico-btn svg { fill: var(--text-default); }
.chat-sheet-head .chat-ico-btn:hover { background: var(--chat-ring); }
/* A sheet only ever travels vertically: a two-pixel overflow of a card would otherwise earn the whole
   window a horizontal bar and a second, useless scroll. */
.chat-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 6px 14px 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--chat-ring) transparent;
}
.chat-sheet-body::-webkit-scrollbar { width: 7px; }
.chat-sheet-body::-webkit-scrollbar-track { background: transparent; }
.chat-sheet-body::-webkit-scrollbar-thumb { background: var(--chat-ring); border-radius: 7px; }
.chat-sheet-body::-webkit-scrollbar-thumb:hover { background: var(--span-half); }
/* a heading of a sheet is written the same way as a heading of the list: a word and the line it rests on */
.chat-sheet-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 2px 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--span);
}
.chat-sheet-group::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--chat-line-soft);
}
/* The screen opens with the face, then one card per group: every row is an icon tile, a label and
   whatever answers on the right - a switch, a number, or the chevron that says "this one opens". */
.chat-set-me {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 12px;
}
.chat-set-me-ava {
    width: 74px;
    height: 74px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--input-form);
    border: 1px solid color-mix(in srgb, var(--span) 30%, transparent);
}
.chat-set-me-ava img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-set-me-name {
    max-width: 100%;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    color: var(--text-default);
    overflow-wrap: anywhere;
}
.chat-set-me-id { font-size: 11.5px; letter-spacing: .05em; color: var(--span); font-variant-numeric: tabular-nums; }
/* ---------- the banner a member stands on ----------
   A cover rather than a frame: it runs across the top of the sheet it belongs to, and the face of the person
   it belongs to sits half over it, ringed in the colour of the sheet so the two read as one surface. Every
   word on it stands on a chip of that same surface rather than on the picture, because a banner is chosen by
   hand and no photograph owes anybody a readable caption.
   The strip is sixteen by nine because the crop the member draws is sixteen by nine: the two ratios agreeing
   is the whole reason nothing of a chosen picture is sliced away once it is on the wall. */
#modal_okno_chat .chat-set-me { padding-top: 0; }
.chat-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 92px;
    margin-bottom: -34px;
    overflow: hidden;
    border: 1px solid var(--chat-line);
    border-radius: 14px;
    background: var(--input-form);
}
.chat-banner-img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* an empty strip is the invitation itself: a dashed edge and the word with its mark sitting in the middle of
   it. The mark is taken out of the absolute layer and put back into the flow, because the site's own sheet
   gives every bare button a max-content width and a fixed height - a stretched button cannot be stretched by
   insets while those stand, so the centring is done by the strip that already owns the space. */
.chat_banner_empty { border-color: var(--chat-ring); border-style: dashed; }
.chat_banner_empty .chat-banner-pick {
    position: static;
    height: auto;
    min-height: 30px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
}
/* the theme pads every button of the site and pins its height, so both are said here in full */
.chat-banner-pick {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    border: 1px solid var(--chat-line);
    border-radius: 14px;
    background: var(--bg-modal);
    color: var(--text-default);
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.chat-banner-pick .chat-ico { width: 15px; height: 15px; stroke: currentColor; }
.chat-banner-pick:hover { background: var(--button-hover); }
/* a banner that is already chosen does not need its door painted across it: the word waits for the
   pointer. An empty strip keeps the word lit - it is the only thing saying a picture can go here - and a
   screen without a hover keeps it lit too, because there would be no other way to ask for it. */
@media (hover: hover) {
    .chat-banner:not(.chat_banner_empty) .chat-banner-pick {
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, background .18s ease;
    }
    .chat-banner:not(.chat_banner_empty):hover .chat-banner-pick,
    .chat-banner:not(.chat_banner_empty):focus-within .chat-banner-pick {
        opacity: 1;
        pointer-events: auto;
    }
}
.chat_banner_empty .chat-banner-pick:hover { color: var(--text-default); }
.chat-banner-pick[disabled] { cursor: default; opacity: .6; }
.chat-banner-clear {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--chat-line);
    border-radius: 50%;
    background: var(--bg-modal);
    color: var(--text-default);
    cursor: pointer;
}
.chat-banner-clear .chat-ico { width: 13px; height: 13px; stroke: var(--text-default); }
.chat-banner-clear:hover { background: var(--money); border-color: var(--money); }
.chat-banner-clear:hover .chat-ico { stroke: var(--chat-on-money); }
/* while the file travels the strip says so and answers nothing else: a second pick over a request already on
   its way would paint whichever of the two came back last */
.chat-banner-busy {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-modal);
}
.chat-banner-busy::after {
    width: 22px;
    height: 22px;
    border: 2px solid var(--chat-ring);
    border-top-color: var(--span);
    border-radius: 50%;
    animation: chatBannerSpin .8s linear infinite;
    content: '';
}
@keyframes chatBannerSpin { to { transform: rotate(360deg); } }
/* the picker the browser opens is one pixel of the page rather than a row of it: hidden by size, not by the
   attribute, so a theme that pins every input of the site away cannot take the only door away with it */
.chat-banner-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
#modal_okno_chat .chat-set-me-ava { position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--card); }
/* ---------- the cut a member draws before a picture becomes a banner ----------
   Only the inside of the frame survives, so everything outside it is pushed under a shade - one shadow wide
   enough to cover the stage however the frame is moved, rather than four panels to keep in step with it.
   The frame answers to a drag anywhere on it and to the corner for its size; both keep the ratio of the strip
   the result is meant to fill, so what is chosen is what is shown. */
.chat-crop-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 168px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--input-form);
}
.chat-crop-box { position: relative; flex: 0 0 auto; }
.chat-crop-img { display: block; width: 100%; height: 100%; }
.chat-crop-frame {
    --chat-crop-line: color-mix(in srgb, var(--chat-on-accent) 62%, transparent);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    border: 1px solid var(--span);
    box-shadow: 0 0 0 2000px var(--chat-shadow);
    cursor: grab;
    touch-action: none;
}
.chat-crop-frame.chat_crop_dragging { cursor: grabbing; }
.chat-crop-v, .chat-crop-h {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
}
.chat-crop-v { background: linear-gradient(to right, transparent 0 calc(33.33% - .5px), var(--chat-crop-line) calc(33.33% + .5px) calc(66.66% - .5px), transparent calc(66.66% + .5px) 100%); }
.chat-crop-h { background: linear-gradient(to bottom, transparent 0 calc(33.33% - .5px), var(--chat-crop-line) calc(33.33% + .5px) calc(66.66% - .5px), transparent calc(66.66% + .5px) 100%); }
.chat-crop-knob {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 0 0 11px 0;
    background: var(--span);
    cursor: nwse-resize;
    touch-action: none;
}
.chat-crop-knob::after {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--chat-on-accent);
    border-bottom: 2px solid var(--chat-on-accent);
    content: '';
}
.chat-crop-size {
    position: absolute;
    top: 5px;
    left: 7px;
    z-index: 3;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--span);
    pointer-events: none;
    text-shadow: 0 1px 2px var(--chat-shadow);
    font-variant-numeric: tabular-nums;
}
.chat-crop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.chat-set-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
    padding: 4px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--span) 8%, transparent);
}
.chat-set-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 3px 6px;
    border-radius: 11px;
    font-size: 12.5px;
    color: var(--text-default);
    cursor: pointer;
    user-select: none;
    transition: background .16s ease;
}
.chat-set-row:hover { background: var(--chat-hover); }
.chat-set-ico {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 10px;
    background: var(--chat-tile);
    transition: background .16s ease;
}
.chat-set-ico svg { width: 15px; height: 15px; fill: var(--span); }
/* a row that is being reached for answers with a fuller tile, so the eye lands on the icon first */
.chat-set-row:hover .chat-set-ico { background: color-mix(in srgb, var(--span) 28%, transparent); }
/* A row of this sheet is one line tall wherever it stands, and a row that overflows its own card is the bug
   it looks like: a label that folds under itself leaves its icon floating in the middle of nothing, and a
   value that will not give up its tail pushes the chevron off the sheet. So the two give up letters rather
   than shape, and they do not do it equally: the word above the door holds its ground up to half the line, and the
   course beside it is what gives, because the row still opens the page that spells the whole trade out. */
.chat-set-label {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-set-value {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    color: var(--chat-ink-soft);
}
/* a bio is a line he wrote himself and it can be longer than the row that shows it: the row keeps its chevron
   and the line gives up its tail, because a row which pushes its own button off the sheet has no button */
.chat-set-value-long {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-set-go { display: flex; flex-shrink: 0; align-items: center; }
.chat-set-go svg { width: 15px; height: 15px; fill: var(--chat-ink-soft); }
.chat-set-static,
.chat-set-action { cursor: default; }
.chat-set-static:hover,
.chat-set-action:hover { background: transparent; }
.chat-set-form { padding: 4px 6px 8px; }
.chat-set-form-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
/* the site sizes every button to its own word, so a door pair would sit unequal on the right of an empty line;
   here the two share the width of the sheet the same way */
.chat-set-form-row .chat-btn { flex: 1 1 0; min-width: 0; }
.chat-set-form .chat-input { width: 100%; }
.chat-sheet-value { font-weight: 700; color: var(--span); }
.chat-sheet-hint { margin: 2px 0 6px; font-size: 11.5px; color: var(--chat-ink-soft); }
/* ---------- the sentence about the banner, and the cross in its corner ----------
   A hint a member has read once tells him nothing any more, so the corner of it offers two silences: this
   visit only, or until he asks the words back from his own look settings. The cross stands in the four pixels
   of padding the card keeps, and the sentence gives up a little of its own width to stay clear of it. Both
   buttons carry their full size here, because the site pins every button to a forty-one pixel line of its
   own - a cross that grew into that would sit over the sentence like a door over a window. */
#modal_okno_chat .chat-hint { position: relative; padding-right: 26px; }
#modal_okno_chat .chat-hint-x {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--chat-ink-soft);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
#modal_okno_chat .chat-hint-x svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}
#modal_okno_chat .chat-hint-x:hover { background: color-mix(in srgb, var(--span) 14%, transparent); color: var(--text-default); }
/* the two answers hang under the sentence they belong to, so the words stay readable while he chooses.
   The pair shares one width rather than sizing to their own words, because the same choice is asked twice;
   the width stops at the sheet, so a locale with a longer word wraps the line instead of hanging out of the
   window. The box is dressed the way the menu of a message is, because a choice that stands over a scrolling
   sheet has to cover what lies under it rather than let the next row show through its own words. */
#modal_okno_chat .chat-hint-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 236px;
    max-width: 100%;
    padding: 4px;
    border: 1px solid color-mix(in srgb, var(--span) 28%, transparent);
    border-radius: 12px;
    background: var(--bg-modal);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
}
#modal_okno_chat .chat-hint-opt {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    height: auto;
    padding: 6px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-default);
    font-size: 12px;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    cursor: pointer;
    transition: background .18s ease;
}
#modal_okno_chat .chat-hint-opt:hover { background: color-mix(in srgb, var(--span) 14%, transparent); }

/* ---------- the look a visitor picks for himself ----------
   Six ready modes and three colours of his own, all of them written onto the window itself, so the page
   behind keeps the site's theme. A chip carries the three colours it stands for because a name says
   nothing about a mood, and the picked colours arrive as plain squares the browser paints for us. */
.chat-theme-panel { padding: 4px 6px 10px; }
.chat-theme-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-theme-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 6px;
    border: 1px solid var(--chat-ring);
    border-radius: 999px;
    background: var(--input-form);
    color: var(--text-default);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}
.chat-theme-chip:hover { background: var(--button-hover); }
.chat-theme-chip-on { border-color: var(--span); background: var(--chat-tile); }
.chat-theme-dots { display: flex; flex-shrink: 0; }
.chat-theme-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--chat-ring); margin-left: -4px; }
.chat-theme-dot:first-child { margin-left: 0; }
.chat-theme-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.chat-theme-swatch { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--chat-ink-soft); }
#modal_okno_chat .chat-theme-swatch input[type="color"] {
    width: 32px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--chat-ring);
    border-radius: 7px;
    background: var(--input-form);
    cursor: pointer;
}
#modal_okno_chat .chat-theme-swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
#modal_okno_chat .chat-theme-swatch input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
.chat-sheet-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 4px; }
/* a card with nothing in it still says why, in the shape of the pills it would have held */
.chat-sheet-roles .chat-muted-noroles {
    padding: 5px 10px;
    border: 1px dashed var(--chat-ring);
    border-radius: 9px;
    font-size: 11.5px;
}
/* A row of the menu is a real button, and the theme pins every button of the page to its input height and
   paints it on its own; inside this sheet a row keeps the shape of every other row of a card. */
#chat_menu_sheet button.chat-set-row {
    width: 100%;
    height: auto;
    padding: 3px 6px;
    border: 0;
    background: transparent;
    font-family: inherit;
    color: var(--text-default);
    text-align: start;
}
#chat_menu_sheet button.chat-set-row:hover { background: var(--chat-hover); }
/* Two rows of a profile card leave the chat, so they are real links and the browser offers them as such -
   but the theme colours and underlines every <a>, and a row of a card must read as a row of a card. */
a.chat-set-row { text-decoration: none; }
/* the face of a member is a steam picture, and when the site has none the circle answers with a letter */
.chat-set-me-ava span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 26px;
    font-weight: 700;
    color: var(--span);
}
/* Under the name the card says whether this person stands on the site right now, and it says it with a dot:
   lit in the accent while they are here, grey while they are away. The settings sheet prints a steam id in
   the same line, so the dot belongs to the card alone. */
#chat_user_sheet .chat-set-me-id::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--span);
}
#chat_user_sheet .chat-set-me-id.chat_set_away { color: var(--text-secondary); }
#chat_user_sheet .chat-set-me-id.chat_set_away::before { background: var(--text-secondary); }
/* The one line of a card that is his own words. It stands under the name in the softer ink so it never
   competes with it, and it wraps instead of cutting, because a person is not a URL to be truncated. */
.chat-user-bio {
    max-width: 100%;
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
    color: var(--chat-ink-soft);
    overflow-wrap: anywhere;
}
/* The theme paints every checkbox through custom properties and marks that paint !important
   (`background: var(--b, var(--background))`, `border: 1px solid var(--bc, var(--border))`), and it
   fades its tick with `opacity: var(--o, 0)` — which would leave our knob invisible while off.
   The track therefore answers with the same force and the knob pins its own opacity. */
#modal_okno_chat input.chat_switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 22px;
    margin: 0;
    border-radius: 22px;
    outline: none;
    cursor: pointer;
    background-color: var(--input-form) !important;
    --border: transparent;
    --bc: transparent;
    --border-hover: var(--span);
    --focus: 4px solid var(--span-10);
    box-shadow: inset 0 0 0 1px var(--chat-ring);
    transition: background-color .2s ease, box-shadow .2s ease;
}
#modal_okno_chat input.chat_switch:checked { background-color: var(--span) !important; box-shadow: inset 0 0 0 1px transparent; }
#modal_okno_chat input.chat_switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    /* the theme draws its tick as two borders of its own ::after, and our knob IS that ::after: without
       this the tick survives as an accent crescent biting into the knob, visible only while switched off
       (while on, the knob sits over a track of the same accent). The rotation leaks the same way. */
    border: 0;
    transform: none;
    /* the knob rides two surfaces - an empty trough while off, the accent while on - and a hand-picked
       accent can be the opposite lightness of a hand-picked field, so one ink cannot serve both. Each state
      names its own, and each keeps the hairline ring that separates it from a track of the same tone. */
    background: var(--chat-knob);
    box-shadow: 0 1px 3px var(--chat-shadow), 0 0 0 1px var(--chat-ring);
    opacity: 1;
    transition: transform .2s ease;
}
#modal_okno_chat input.chat_switch:checked::after { transform: translateX(16px); background: var(--chat-knob-on); }
/* A choice of the room is a control, not a word: it carries the same box as a switch row, an edge that
   proves it is a field, and a chevron painted by the theme rather than the operating system. The chevron
   is a mask, so the accent colour of the palette shows through it. */
.chat-select-wrap { position: relative; display: inline-flex; align-items: center; }
.chat-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 7px 28px 7px 11px;
    border: 1px solid var(--chat-ring);
    border-radius: 9px;
    background: var(--input-form);
    color: var(--text-default);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .18s ease;
}
.chat-select:focus { border-color: var(--span-half); outline: none; }
.chat-select-wrap::after {
    content: '';
    position: absolute;
    right: 10px;
    width: 11px;
    height: 11px;
    pointer-events: none;
    background: var(--span);
    -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- admin panel ---------- */
.chat-admin-panel {
    position: absolute;
    inset: 0;
    z-index: 16;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
}
.chat-admin-panel-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px 0;
    background: var(--card);
    border-bottom: 1px solid color-mix(in srgb, var(--span) 18%, transparent);
}
.chat-admin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-admin-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.chat-admin-eyebrow .chat-ico { width: 15px; height: 15px; stroke: var(--span); }
/* Six tabs never fit a 400px window in one row, so the strip wraps into a three-column grid of
   pills. The active state is a filled pill rather than a bottom bar: with two rows the bar of a
   first-row tab would float in the middle of the strip. */
.chat-admin-panel-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 9px; }
.chat-admin-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 1 1 30%;
    padding: 7px 6px;
    border: none;
    border-radius: 9px;
    background: var(--span-10);
    color: var(--text-secondary);
    /* a tab that is not the one being read still has to be readable: the theme's own grey sits under the
       contrast this strip needs on a tinted pill, so the words are mixed out of the text colour instead */
    color: color-mix(in srgb, var(--text-default) 76%, transparent);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.chat-admin-tab .chat-ico { width: 14px; height: 14px; }
.chat-admin-tab:hover { color: var(--text-default); background: var(--span-middle); }
.chat-admin-tab-active {
    color: var(--chat-on-span);
    background: var(--span);
    background: linear-gradient(180deg, var(--span), color-mix(in srgb, var(--span) 78%, var(--text-default-invert, #000)));
    box-shadow: 0 3px 10px var(--chat-shadow);
}
.chat-admin-tab-active:hover { color: var(--chat-on-span); background: var(--span); }

/* The strip deliberately uses no ARIA tab roles: three site stylesheets (theme, module_block_main_theme,
   module_page_adminpanel) claim [role="tablist"] / [role="tab"] / [aria-selected] globally, one with
   !important, and that turned this row into a vertical list with a white active tab. */
.chat-admin-tab-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    padding: 14px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--span-middle) transparent;
}
.chat-admin-tab-content::-webkit-scrollbar { width: 5px; }
.chat-admin-tab-content::-webkit-scrollbar-thumb { background: var(--span-middle); border-radius: 4px; }

/* cards replace the old flat stack */
.chat-admin-card {
    padding: 12px 13px 14px;
    border: 1px solid var(--chat-line);
    border-radius: 14px;
    background: var(--card);
}
.chat-admin-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 11px;
    padding-bottom: 9px;
    border-bottom: 1px solid color-mix(in srgb, var(--span) 12%, transparent);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--chat-ink-soft);
}
.chat-admin-card-head .chat-ico { width: 15px; height: 15px; stroke: var(--span); }
.chat-admin-card-danger { border-color: color-mix(in srgb, var(--money) 32%, transparent); }
.chat-admin-card-danger .chat-admin-card-head {
    color: var(--money);
    border-bottom-color: color-mix(in srgb, var(--money) 26%, transparent);
}
.chat-admin-card-danger .chat-admin-card-head .chat-ico { stroke: var(--money); }

.chat-admin-form { display: flex; flex-direction: column; gap: 10px; }
/* a caption that wraps would otherwise leave its input standing above the input of the field beside it: the
   row is measured by its tallest field and every field is dropped to the bottom of it, so the two doors of one
   row open on one line however long the creator's own words are */
.chat-admin-grid { display: grid; align-items: end; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.chat-admin-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.chat-admin-field > span, .chat-admin-color > span {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--chat-ink-soft);
}
.chat-admin-form input, .chat-admin-form textarea {
    width: 100%;
    padding: 9px 11px;
    /* a field with no edge is a paragraph of text until it is clicked; one hairline of the theme's own ink
       says "type here" in every palette */
    border: 1px solid var(--chat-ring);
    border-radius: 9px;
    background: var(--input-form);
    color: var(--text-default);
    font-family: inherit;
    font-size: 13px;
    resize: none;
    box-sizing: border-box;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.chat-admin-form input:focus, .chat-admin-form textarea:focus {
    border-color: var(--span-half);
    background: var(--button);
    box-shadow: 0 0 0 3px var(--span-low);
    outline: none;
}
.chat-admin-form textarea { min-height: 54px; line-height: 1.45; }
.chat-admin-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
/* The bar of faces is one field and one door: the field holds them separated by spaces, the plus opens the
   same sheet a member reacts with. The theme pins every button onto a 41px line and pads it, so this one
   has to name its own box rather than inherit a primary button's. */
.chat-admin-emoji-row { display: flex; align-items: stretch; gap: 6px; min-width: 0; }
.chat-admin-emoji-row input { flex: 1 1 auto; min-width: 0; letter-spacing: 2px; }
.chat-admin-emoji-pick {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--chat-ring);
    border-radius: 9px;
    background: var(--button);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.chat-admin-emoji-pick:hover { background: var(--span-low); color: var(--text-default); }
.chat-admin-emoji-pick .chat-ico { width: 16px; height: 16px; }
.chat-admin-color { display: flex; flex-direction: column; gap: 5px; }
.chat-admin-form input[type="color"] {
    width: 46px;
    height: 34px;
    padding: 3px;
    border: 1px solid var(--chat-ring);
    border-radius: 10px;
    background: var(--input-form);
    cursor: pointer;
    transition: border-color .18s ease;
}
.chat-admin-form input[type="color"]:hover { border-color: var(--span-half); }
.chat-admin-switch { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-custom); cursor: pointer; user-select: none; }

/* The face of a room inside the panel: the same round pick a member paints in his own sheet, standing beside
   the two lines that name it and take it away. The badge shrinks with the circle, and the letter keeps its
   ground while the room wears no picture - so an empty pick is never an empty box. */
.chat-admin-photo { display: flex; align-items: center; gap: 12px; }
.chat-admin-photo-side { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.chat-admin-photo-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--chat-ink-soft);
}
#modal_okno_chat .chat-admin-pick .chat-group-cam { right: 1px; bottom: 1px; width: 20px; height: 20px; padding: 4px; }
/* on a circle this small the badge and the glyph would sit on each other, so the badge only arrives once a
   picture actually covers the face */
#modal_okno_chat .chat-admin-pick:not(.chat-photo-picked) .chat-group-cam { display: none; }
#modal_okno_chat #chat_admin_room_letter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-default);
}

/* the group picture: one round pick that shows either the camera hint or the crop the member chose.
   The file input stays invisible on purpose - the label is the control, and a path is never shown. */
.chat-photo-pick {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed color-mix(in srgb, var(--span) 45%, transparent);
    border-radius: 50%;
    background: var(--input-form);
    color: var(--text-secondary);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}
.chat-photo-pick:hover { border-color: var(--span-half); background: var(--button); }
.chat-photo-pick .chat-ico { width: 22px; height: 22px; }
.chat-photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-photo-pick.chat-photo-picked { border-style: solid; }
.chat-photo-pick.chat-photo-picked .chat-ico { display: none; }
#modal_okno_chat .chat-photo-pick input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

/* ---------- group sheets: the settings a member owns, and the card every visitor reads ----------
   Both sheets share one face - a big round avatar with a camera badge - and one kind of row: a coloured
   icon square, two lines of words, and the control of that row on the right. Nothing here stretches
   past the 320px sheet, so the rows stack and the notes wrap instead. */
.chat-group-body { padding-top: 2px; }
.chat-group-face { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 0 2px; text-align: center; }
#modal_okno_chat .chat-group-pick {
    position: relative;
    z-index: 3;
    width: 86px;
    height: 86px;
    box-shadow: 0 0 0 3px var(--card);
}
#modal_okno_chat .chat-group-pick .chat-ico { width: 30px; height: 30px; }
#modal_okno_chat #chat_group_letter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: var(--text-default);
}
.chat-group-cam {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 26px;
    height: 26px;
    padding: 5px;
    border-radius: 50%;
    background: var(--span);
    fill: none;
    stroke: var(--text-default);
    stroke-width: 1.7;
    pointer-events: none;
}
.chat-group-facename {
    max-width: 100%;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-group-facehint { font-size: 11px; line-height: 1.45; color: var(--text-secondary); }
#modal_okno_chat .chat-group-facesub {
    height: auto;
    padding: 4px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--span);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease;
}
#modal_okno_chat .chat-group-facesub:hover { background: var(--button); }

.chat-group-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    padding: 6px;
    border: 1px solid var(--chat-line);
    border-radius: 14px;
    background: var(--input-form);
}
.chat-group-card > .chat-admin-field { padding: 5px 5px 2px; }
.chat-group-card .chat-sheet-hint { padding: 0 5px 4px; margin: 0; }

.chat-group-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    width: 100%;
    min-height: 52px;
    padding: 8px 8px;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: var(--text-default);
    font-family: inherit;
    text-align: left;
    cursor: default;
    transition: background .18s ease;
}
button.chat-group-row { cursor: pointer; }
button.chat-group-row:hover { background: var(--button-hover); }
.chat-group-ico {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--span) 20%, transparent);
    color: var(--span);
}
.chat-group-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
/* Each row of a group owns one meaning, and each meaning wears one of the site's own colours: the palette
   of the room, the wait between two lines, the lock of a closed room, who may read it, who may join it.
   None of them is a hand-picked hex, because a pink square in a violet palette and in a forest one are two
   different products. */
.chat-group-ico-color { background: var(--chat-tile); color: var(--span); }
.chat-group-ico-slow { background: var(--chat-tile-warn); color: var(--chat-warn-ink); }
.chat-group-ico-lock { background: var(--chat-tile-lock); color: var(--chat-lock-ink); }
.chat-group-ico-private { background: var(--chat-tile-danger); color: var(--chat-danger-ink); }
.chat-group-ico-link { background: var(--chat-tile-ok); color: var(--chat-ok-ink); }
/* the queue square carries no colour of its own: it is an outline, not a state */
.chat-group-ico-join {
    border: 1px solid color-mix(in srgb, var(--span) 30%, transparent);
    background: var(--span-10);
    color: var(--span);
}
.chat-group-text { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-group-label { font-size: 12.5px; font-weight: 700; color: var(--text-default); }
.chat-group-note { font-size: 11px; line-height: 1.4; color: var(--chat-ink-soft); }
/* a control that no longer fits drops under its own words instead of squeezing them into six lines */
.chat-group-row .chat-select-wrap { flex-shrink: 0; max-width: 128px; margin-left: auto; }
.chat-group-row input[type="color"] { flex-shrink: 0; margin-left: auto; }
.chat-group-row .chat_switch { margin-left: auto; }
#modal_okno_chat .chat-group-mini {
    flex-shrink: 0;
    margin-left: auto;
    height: auto;
    padding: 7px 12px;
    border: none;
    border-radius: 9px;
    background: var(--button);
    color: var(--text-default);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease;
}
#modal_okno_chat .chat-group-mini:hover { background: var(--button-hover); }

/* the row that closes the sheet: the same shape as every other row, painted in the site red */
#modal_okno_chat .chat-group-danger {
    margin-top: 12px;
    border: 1px solid color-mix(in srgb, var(--money) 40%, transparent);
    background: var(--money-bg);
    color: var(--money);
}
.chat-group-danger .chat-group-ico { background: color-mix(in srgb, var(--money) 22%, transparent); color: var(--money); }
.chat-group-danger .chat-group-label, .chat-group-danger .chat-group-ico svg { color: var(--money); stroke: var(--money); }
.chat-group-danger:hover { background: var(--money); color: var(--chat-on-money); }
.chat-group-danger:hover .chat-group-label,
.chat-group-danger:hover .chat-group-note,
.chat-group-danger:hover .chat-group-ico svg { color: var(--chat-on-money); stroke: var(--chat-on-money); }

#modal_okno_chat .chat-group-save { width: 100%; margin-top: 14px; align-self: stretch; }
.chat-info-pick { border-style: solid; cursor: default; }
.chat-info-pick:hover { border-color: color-mix(in srgb, var(--span) 45%, transparent); background: var(--input-form); }
.chat-info-pick .chat-room-avatar { width: 100%; height: 100%; border-radius: 50%; font-size: 32px; }
/* the owner's words, read before the rows: wide line, soft colour, never a box of its own */
.chat-info-desc {
    margin: 4px 0 0;
    padding: 0 4px;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}
.chat-admin-switch-line { width: 100%; flex-direction: row-reverse; padding: 7px 0; border-bottom: 1px dashed color-mix(in srgb, var(--span) 14%, transparent); }
.chat-admin-switch-line:last-of-type { border-bottom: none; }
.chat-admin-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: auto;
    padding: 9px 16px;
    border: none;
    border-radius: 9px;
    background: var(--span);
    color: var(--chat-on-span);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .18s ease, transform .18s ease;
}
.chat-admin-submit .chat-ico { width: 15px; height: 15px; stroke: var(--text-default); }
.chat-admin-submit:hover { filter: brightness(1.08); }
.chat-admin-submit:active { transform: translateY(1px); }
.chat-admin-form > .chat-admin-submit { margin-left: 0; align-self: flex-start; }
.chat-admin-wide { width: 100%; margin: 12px 0 0; align-self: stretch; }
.chat-admin-danger-solid { background: var(--money); }
.chat-admin-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--money) 40%, transparent);
    border-radius: 10px;
    background: var(--money-bg);
    color: var(--money);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .18s;
}
.chat-admin-danger:hover { background: var(--money); color: var(--chat-on-money); }

.chat-admin-list { display: flex; flex-direction: column; gap: 7px; }
.chat-admin-list-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px 9px 15px;
    border: 1px solid color-mix(in srgb, var(--span) 10%, transparent);
    border-radius: 11px;
    background: var(--bg);
    overflow: hidden;
    transition: border-color .18s ease;
}
.chat-admin-list-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tint, var(--span-middle)); }
.chat-admin-list-item:hover { border-color: color-mix(in srgb, var(--span) 28%, transparent); }
.chat-admin-off { opacity: .55; }
.chat-admin-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.chat-admin-item-info { flex: 1 1 auto; min-width: 0; }
.chat-admin-item-name { font-size: 13px; font-weight: 600; color: var(--text-default); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-admin-item-name em { font-style: normal; font-weight: 400; color: var(--text-secondary); }
.chat-admin-item-sub { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-admin-item-sub .chat-ico { width: 12px; height: 12px; }
.chat-admin-item-role { font-size: 11.5px; font-weight: 700; color: var(--tint, var(--span)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-admin-actions { display: flex; gap: 5px; margin-left: auto; flex-shrink: 0; }
.chat-admin-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 4px 9px;
    border-radius: 20px;
    background: var(--span-10);
    color: var(--span);
    font-size: 11px;
    font-weight: 700;
}
.chat-admin-chip .chat-ico { width: 12px; height: 12px; }
.chat-admin-remove, .chat-admin-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--span-10);
    color: var(--text-secondary);
    cursor: pointer;
    transition: .16s;
}
.chat-admin-remove .chat-ico, .chat-admin-toggle .chat-ico { width: 15px; height: 15px; stroke: currentColor; }
.chat-admin-remove:hover { background: var(--money); border-color: var(--money); color: var(--chat-on-money); }
.chat-admin-toggle:hover { background: var(--span-middle); color: var(--text-default); }
.chat-admin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 20px 0;
    border: 1px dashed color-mix(in srgb, var(--span) 20%, transparent);
    border-radius: 12px;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.chat-admin-empty .chat-ico { width: 20px; height: 20px; stroke: var(--span-middle); }
.chat-admin-note { margin: 11px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--text-secondary); }
.chat-discord-help { text-align: left; }

/* ---------- the security table of private pairs ----------
   A pair is two people, so its row carries two faces that touch and one line of both names between them. The
   log opens inside the same list, under its own row alone, and reads as a document rather than as bubbles:
   this is a table an admin looks through, not a conversation anybody is standing inside. */
.chat-admin-dm-faces { display: flex; flex-shrink: 0; }
/* the table of banners reads the picture at the size of a row, so what an admin sees is what a visitor stands
   on: no crop of a crop, and a row no taller than any other row of this tab */
.chat-admin-banner-thumb {
    flex: 0 0 auto;
    width: 54px;
    height: 30px;
    border: 1px solid var(--chat-line);
    border-radius: 7px;
    object-fit: cover;
    background: var(--input-form);
}
.chat-admin-dm-faces .chat-admin-avatar { width: 30px; height: 30px; border: 2px solid var(--bg); }
.chat-admin-dm-faces .chat-admin-avatar + .chat-admin-avatar { margin-left: -12px; }
.chat-admin-dm-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 7px;
    padding: 4px 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--span) 14%, transparent);
    font-size: 11.5px;
    line-height: 1.5;
}
.chat-admin-dm-line:last-child { border-bottom: 0; padding-bottom: 0; }
.chat-admin-dm-who { font-weight: 700; color: var(--span); white-space: nowrap; }
.chat-admin-dm-time { font-size: 10.5px; color: var(--text-secondary); white-space: nowrap; }
.chat-admin-dm-text { flex: 1 1 100%; color: var(--text-default); word-break: break-word; }
.chat-admin-dm-log {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: -3px;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--span) 14%, transparent);
    border-radius: 11px;
    background: color-mix(in srgb, var(--span) 6%, var(--bg));
    max-height: 250px;
    overflow-y: auto;
}
/* four rows is the window, the rest is a page: the link is the only way out of the cap, so it reads as an
   action rather than a note, and it is never taller than the row it follows. */
a.chat-admin-more {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 7px 11px;
    border-radius: 10px;
    background: var(--span-10);
    color: var(--span);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}
a.chat-admin-more:hover { background: var(--span-middle); }
a.chat-admin-more em {
    margin-left: auto;
    color: var(--text-secondary);
    font-style: normal;
    font-weight: 600;
    font-size: 10.5px;
}
.chat-admin-more .chat-ico { width: 13px; height: 13px; stroke: currentColor; }

/* ---------- the trail of who opened which pair ----------
   The row shape of the table above it, but with one face instead of two: the reader. A session that carried no
   steam id still keeps its place, and shows a lock where its face would be - dropping it would hide exactly the
   read worth remembering. */
.chat-admin-read-row .chat-admin-item-name { color: var(--span); }
.chat-admin-read-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span-10);
    color: var(--text-secondary);
}
.chat-admin-read-ghost .chat-ico { width: 15px; height: 15px; }

@media (max-width: 560px) {
    /* the ids are the widest thing a row prints, and on a phone they are the first line to give room to -
       a class, not nth-of-type: the name above them is a div too, so it would take the first number */
    .chat-admin-dm-row .chat-admin-dm-ids { display: none; }
    .chat-admin-read-row .chat-admin-dm-ids { display: none; }
}

/* ---------- asking into a private group ----------
   The queue lives one row under the switch that closes the door: a line per person waiting, each carrying
   the only two answers there are. The card a visitor outside reads borrows the sheet's shapes and adds one
   button, because the question is the single thing they may ask. */
.chat-join-count {
    flex-shrink: 0;
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span);
    color: var(--chat-on-span);
    font-size: 11px;
    font-weight: 700;
}
.chat-join-list {
    display: flex;
    flex-direction: column;
    margin: 0 8px 4px;
    padding-left: 10px;
    border-left: 2px solid color-mix(in srgb, var(--span) 30%, transparent);
}
.chat-join-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--span) 14%, transparent);
}
.chat-join-row:last-child { border-bottom: none; }
.chat-join-who {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-join-when { flex-shrink: 0; font-size: 11px; color: var(--text-secondary); }
.chat-join-actions { display: flex; gap: 5px; margin-left: auto; flex-shrink: 0; }
#modal_okno_chat .chat-join-yes,
#modal_okno_chat .chat-join-no {
    width: 27px;
    height: 27px;
    padding: 0;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--span-10);
    color: var(--text-secondary);
    cursor: pointer;
    transition: .16s;
}
#modal_okno_chat .chat-join-yes .chat-ico,
#modal_okno_chat .chat-join-no .chat-ico { width: 14px; height: 14px; stroke: currentColor; }
#modal_okno_chat .chat-join-yes:hover { background: var(--span); color: var(--chat-on-span); }
#modal_okno_chat .chat-join-no:hover { background: var(--money); color: var(--chat-on-money); }

.chat-join-ask {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    padding: 14px 12px 12px;
    border: 1px dashed color-mix(in srgb, var(--span) 30%, transparent);
    border-radius: 14px;
    background: var(--input-form);
    text-align: center;
}
.chat-join-ask > .chat-ico { width: 22px; height: 22px; stroke: var(--span); }
.chat-join-asktext { font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }
#modal_okno_chat .chat-join-ask .chat-group-save { margin-top: 2px; }

/* ---------- what a picture costs, and the word for the money ----------
   One line under the door that asks for the file: the balance of the person standing in the window, and the
   price the server wrote for this very strip. The two sit at opposite ends of the card because they answer
   two different questions - what I hold, and what is asked - and a member reads both before he picks a file.
   The name of the money is typed by the creator of the site, so nothing here is wide enough to cut it off. */
.chat-set-price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 10px;
    padding: 3px 8px 7px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--chat-ink-soft);
}
.chat-set-price > span:last-child { color: var(--span); font-weight: 700; }

/* three answers to one question, printed as a single pill: a balance is either raised, lowered or set, and a
   member who means to set it must not have to write the difference himself. Buttons of this site are padded
   and pinned by the theme, so the shape of these is stated in full. */
.chat-coin-modes { display: flex; gap: 5px; }
#modal_okno_chat .chat-coin-mode {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    padding: 7px 8px;
    border: 1px solid color-mix(in srgb, var(--span) 22%, transparent);
    border-radius: 9px;
    background: var(--input-form);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}
#modal_okno_chat .chat-coin-mode:hover { border-color: var(--span-half); color: var(--text-default); }
#modal_okno_chat .chat-coin-mode[aria-pressed="true"] {
    border-color: transparent;
    background: var(--span);
    color: var(--chat-on-span);
}
/* the ledger and the badge are written the same way: a line of answers, then the door. They cannot share one
   line - four answers of two words each wrap, and the door, pinned to `width: max-content` and pushed right by
   its own auto margin, rides alone over an empty half of the card. Stacked, every answer gets its share of the
   first line and the door gets the whole second one. */
.chat-admin-row-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.chat-admin-row-stack .chat-coin-modes { width: 100%; }
.chat-admin-row-stack .chat-admin-submit { width: 100%; margin-left: 0; }
.chat-admin-coins {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--span);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---------- the strip of a group, and the face of its card ----------
   A group is dressed like a person now: the strip opens the sheet and the face of the group stands half over
   it, and the same pill asks for the same file. The pull is six pixels longer than the one a member uses,
   because this form keeps ten between its blocks and the face keeps six above its picture - both are paid
   back here, so the overhang measures the same thirty as the banner of a profile. */
#modal_okno_chat .chat-banner-group { margin-bottom: -46px; min-height: 104px; }
/* the line under the face, and only under it: while the badge is missing the pill is off the strip and this
   is the only thing saying why the picture of a group cannot be changed */
.chat-banner-need { font-size: 11px; line-height: 1.45; text-align: center; color: var(--text-secondary); }
.chat-info-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 96px;
    margin-bottom: 6px;
    border: 1px solid var(--chat-line);
    border-radius: 14px;
    background-color: var(--input-form);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ---------- the wall a group hangs behind its words ----------
   Eight patterns and no files: every one of them is drawn out of the tokens of whichever palette the window
   wears, so a group dressed in dots reads the same in a violet site and in a forest one. A preset names itself
   on the element that carries it and the three properties below are all it leaves behind; the one rule that
   follows paints a conversation, a preview and a tile of the picker from those properties, which is why
   choosing a wall and showing one are the same act rather than two. */
#modal_okno_chat [data-wall="dots"] {
    --chat-wall-img: radial-gradient(circle, color-mix(in srgb, var(--span) 26%, transparent) 1.4px, transparent 1.5px);
    --chat-wall-size: 20px 20px;
}
#modal_okno_chat [data-wall="grid"] {
    --chat-wall-img: linear-gradient(to right, color-mix(in srgb, var(--text-default) 11%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--text-default) 11%, transparent) 1px, transparent 1px);
    --chat-wall-size: 26px 26px;
}
#modal_okno_chat [data-wall="stripes"] {
    --chat-wall-img: repeating-linear-gradient(45deg, color-mix(in srgb, var(--span) 17%, transparent) 0 7px, transparent 7px 18px);
}
#modal_okno_chat [data-wall="rings"] {
    --chat-wall-img: radial-gradient(circle, transparent 0 7px, color-mix(in srgb, var(--chat-lock-ink) 30%, transparent) 7.5px 8.5px, transparent 9px);
    --chat-wall-size: 26px 26px;
}
#modal_okno_chat [data-wall="cross"] {
    --chat-wall-img: linear-gradient(45deg, transparent 0 46%, color-mix(in srgb, var(--chat-ok-ink) 26%, transparent) 46% 54%, transparent 54%),
        linear-gradient(-45deg, transparent 0 46%, color-mix(in srgb, var(--chat-ok-ink) 26%, transparent) 46% 54%, transparent 54%);
    --chat-wall-size: 22px 22px;
}
#modal_okno_chat [data-wall="diamond"] {
    --chat-wall-img: linear-gradient(45deg, color-mix(in srgb, var(--span) 15%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--span) 15%, transparent) 75%),
        linear-gradient(45deg, color-mix(in srgb, var(--span) 15%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--span) 15%, transparent) 75%);
    --chat-wall-size: 22px 22px;
    --chat-wall-pos: 0 0, 11px 11px;
}
#modal_okno_chat [data-wall="zigzag"] {
    --chat-wall-img: linear-gradient(135deg, color-mix(in srgb, var(--chat-warn-ink) 27%, transparent) 26%, transparent 26%),
        linear-gradient(225deg, color-mix(in srgb, var(--chat-warn-ink) 27%, transparent) 26%, transparent 26%);
    --chat-wall-size: 18px 18px;
}
#modal_okno_chat [data-wall="confetti"] {
    --chat-wall-img: radial-gradient(circle, color-mix(in srgb, var(--span) 30%, transparent) 1.8px, transparent 1.9px),
        radial-gradient(circle, color-mix(in srgb, var(--chat-ok-ink) 32%, transparent) 1.5px, transparent 1.6px),
        radial-gradient(circle, color-mix(in srgb, var(--money) 30%, transparent) 1.3px, transparent 1.4px);
    --chat-wall-size: 34px 34px, 34px 34px, 34px 34px;
    --chat-wall-pos: 0 0, 11px 17px, 23px 6px;
}
#modal_okno_chat .chat-content-main[data-wall],
#modal_okno_chat .chat-wall-preview[data-wall],
#modal_okno_chat .chat-wall-tile[data-wall] > .chat-wall-face {
    background-image: var(--chat-wall-img);
    background-size: var(--chat-wall-size, auto);
    background-position: var(--chat-wall-pos, 0 0);
    background-repeat: repeat;
}
/* a picture of an owner's own travels into the same element as an address the script has already signed for,
   so the size and the repeat are said here while the address itself belongs to the line that wrote it. */
#modal_okno_chat .chat-content-main.chat_walled:not([data-wall]),
#modal_okno_chat .chat-wall-preview:not([data-wall]) {
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}
/* behind a wall a bubble is no longer the surface of the window but a veil over a picture: the same card colour
   with a little of the picture left showing through, so the room the owner dressed is still the room he dressed
   and the words inside it are still the first thing a member reads. */
#modal_okno_chat .chat-content-main.chat_walled .chat_bubble { background-color: color-mix(in srgb, var(--card) 84%, transparent); }
#modal_okno_chat .chat-content-main.chat_walled .chat_message_my .chat_bubble { background-color: color-mix(in srgb, var(--button) 84%, transparent); }

/* ---------- the picker those walls are chosen in ----------
   The sheet stands over the group sheet it was opened from, and the crop over both, because a picture is cut
   for a banner and the banner is being chosen inside a sheet already. A tile is a face and nothing else: the
   pattern is the whole argument for it, and a name under the face would push the eighth of them out of view. */
#modal_okno_chat #chat_wall_sheet { z-index: 20; }
#modal_okno_chat #chat_crop_sheet { z-index: 21; }
.chat-wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; padding: 4px 2px 8px; }
#modal_okno_chat .chat-wall-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* the site pins every button it meets to `width: max-content`, and a pattern tile holds no word at all -
       without a width of its own it collapses to its padding and the picker shows ten thin bars. */
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 3px;
    border: 1px solid var(--chat-line);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}
#modal_okno_chat .chat-wall-tile:hover { border-color: var(--span-half); }
#modal_okno_chat .chat-wall-tile-on {
    border-color: var(--span);
    background: var(--span-10);
}
.chat-wall-face {
    display: block;
    width: 100%;
    height: 54px;
    border-radius: 9px;
    background-color: var(--input-form);
    background-repeat: repeat;
}
.chat-wall-name {
    font-size: 10.5px;
    line-height: 1.3;
    text-align: center;
    color: var(--chat-ink-soft);
}
.chat-wall-tile-on .chat-wall-name { color: var(--span); font-weight: 700; }
/* the tile that asks for a file rather than offering one: a dashed face with a corner folded, drawn out of the
   same two bars every other mark of this window is drawn from */
#modal_okno_chat .chat-wall-tile-own > .chat-wall-face {
    position: relative;
    border: 1px dashed color-mix(in srgb, var(--span) 34%, transparent);
    background-color: transparent;
}
#modal_okno_chat .chat-wall-tile-own > .chat-wall-face::before,
#modal_okno_chat .chat-wall-tile-own > .chat-wall-face::after {
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--span);
    border-radius: 2px;
    content: '';
    transform: translate(-50%, -50%);
}
#modal_okno_chat .chat-wall-tile-own > .chat-wall-face::before { width: 17px; height: 2px; }
#modal_okno_chat .chat-wall-tile-own > .chat-wall-face::after { width: 2px; height: 17px; }
/* the wall the group already wears, shown inside the sheet that changes it - the same face the picker offers,
   so an owner sees the pattern he picked rather than a word describing it */
.chat-wall-preview {
    height: 74px;
    margin: 2px 4px 10px;
    border: 1px solid var(--chat-line);
    border-radius: 12px;
    background-color: var(--input-form);
    overflow: hidden;
}

/* ---------- the page the badge is sold on ----------
   The star is painted by the browser rather than downloaded: three shapes filled with a gradient mixed out of
   the window's own accent, so it takes the colour the member chose for his chat and costs no request. A promise
   of the list is an icon and two lines - what opens, and in one line what opening it is worth. */
#modal_okno_chat #chat_premium_sheet { z-index: 20; }
.chat-premium-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 6px 16px;
    text-align: center;
}
.chat-premium-star { display: block; width: 108px; height: 108px; }
.chat-premium-star svg { display: block; width: 108px; height: 108px; }
/* a site theme paints every svg it meets, and an attribute is the weakest answer a file can give it. The
   gradient is therefore asked for here as well as in the markup: a star the theme flattened to one colour
   would still be a star, just not the one this window drew */
#modal_okno_chat .chat-premium-star path { fill: url(#chat_premium_grad); stroke: none; }
.chat-premium-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--text-default); }
.chat-premium-lead { max-width: 262px; font-size: 12.5px; line-height: 1.5; color: var(--chat-ink-soft); }
.chat-premium-feats { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 12px; }
.chat-premium-feat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--span) 7%, transparent);
}
.chat-premium-feat-ico {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 10px;
    background: var(--chat-tile);
}
/* these four marks are drawn as outlines rather than filled, because a solid banner and a solid wall are two
   blurs the eye cannot tell apart at sixteen pixels */
.chat-premium-feat-ico svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--span);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.chat-premium-feat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-premium-feat-text b { font-size: 12.5px; font-weight: 700; color: var(--text-default); }
.chat-premium-feat-text i { font-size: 11.5px; font-style: normal; line-height: 1.45; color: var(--chat-ink-soft); }
/* one plan, one row: the length the admin typed on the left and the price of that length on the right */
.chat-premium-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--span) 26%, transparent);
    border-radius: 13px;
    background: var(--chat-tile);
}
.chat-premium-plan-name { font-size: 12.5px; color: var(--text-secondary); }
.chat-premium-plan-price { font-size: 13.5px; font-weight: 800; color: var(--span); white-space: nowrap; }
/* the single press of the page is as wide as the page: a member decides by pressing, not by looking for it */
.chat-premium-buy-row { margin-top: 10px; }
#modal_okno_chat .chat-premium-buy-row .chat-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.3;
}

/* ---------- coin traded for the balance of the site ----------
   The course is the reason this page exists, so it is the first thing on it and the largest: the two numbers the
   creator wrote stand on one line, and everything below is arithmetic done out loud from them. */
.chat-ex-rate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 10px;
    margin-bottom: 10px;
    border: 1px solid color-mix(in srgb, var(--span) 26%, transparent);
    border-radius: 13px;
    background: var(--chat-tile);
}
.chat-ex-coins { font-size: 15px; font-weight: 800; color: var(--text-default); white-space: nowrap; }
.chat-ex-money { font-size: 15px; font-weight: 800; color: var(--span); white-space: nowrap; }
.chat-ex-eq { font-size: 14px; font-weight: 700; color: var(--chat-ink-soft); }
.chat-ex-count { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
/* the site theme pins every button to its own input height and every bare one to max-content, and it pads a
   control that holds nothing but a mark down to nothing at all. Both steps and the field between them are sized
   here, in the height the theme itself uses, so the row is three equal blocks rather than a guess. */
#modal_okno_chat .chat-ex-step {
    flex: 0 0 auto;
    width: 41px;
    height: 41px;
    border-radius: 12px;
    background: var(--chat-tile);
}
#modal_okno_chat .chat-ex-num {
    flex: 1 1 0;
    min-width: 0;
    height: 41px;
    min-height: 41px;
    text-align: center;
    font-weight: 800;
    -moz-appearance: textfield;
    appearance: textfield;
}
#modal_okno_chat .chat-ex-num::-webkit-outer-spin-button,
#modal_okno_chat .chat-ex-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chat-ex-sum { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }

/* ---------- responsive ----------
   Below 769px the floating window becomes the whole screen: same master/detail switch, just
   edge to edge with no rounded shell. Nothing above it shifts the page - the panel always
   floats over the content. */
@media (max-width: 768px) {
    .chat-container {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }
    .chat-content { border: none; border-radius: 0; }
    .chat_open { right: 16px; bottom: 84px; width: 48px; height: 48px; }
    .chat_bubble { max-width: 92%; }
    .chat-sheet { width: 100%; }
}
