.chat-theme-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: 12px; }
.chat-theme-cards section { padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
[data-chat-theme="midnight"] { --chat-wall: #111e3d; --chat-received: #233a63; --chat-sent: #275394; --chat-accent: #91baff; }
[data-chat-theme="sunset"] { --chat-wall: linear-gradient(150deg,#29153e,#572c26); --chat-received: #583255; --chat-sent: #8c3b3d; --chat-accent: #ffb99f; }
[data-chat-theme="cyber"] { --chat-wall: #0b0b17; --chat-received: #143746; --chat-sent: #65316d; --chat-accent: #65e7ee; }
[data-chat-theme="royal"] { --chat-wall: linear-gradient(135deg,#141414,#302719); --chat-received: #3c3428; --chat-sent: #65501d; --chat-accent: #f1ce75; }
[data-chat-theme="prestige"] { --chat-wall: radial-gradient(ellipse at top,#30220e,#060606 72%); --chat-received: #23201a; --chat-sent: #634313; --chat-accent: #ffd671; }
.chat-theme-cards section { background: var(--chat-wall,var(--surface)); }
.chat-theme-cards section:where(:not([data-chat-theme="default"])) { color: #fff; }
.chat-theme-preview { background: var(--chat-received,var(--control-hover)); padding: 7px 10px; border-radius: 10px; width: fit-content; }
.chat-theme-sent { background: var(--chat-sent,var(--control-hover)); margin-inline-start: auto; }
.chat-theme-cards button { margin: 4px 4px 0 0; }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) .chat-active { background: var(--chat-wall); }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) .message-scroll { color: #fff; }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) .bubble:not(.is-deleted) { background: var(--chat-received); color: #fff; }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) .message.is-mine .bubble:not(.is-deleted) { background: var(--chat-sent); }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) .bubble a:not(.link-preview) { color: #fff; }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) .composer { border-top-color: var(--chat-accent); }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) #composer-input:focus { outline: 2px solid var(--chat-accent); }
:root[data-chat-theme]:not([data-chat-theme="default"], [data-chat-theme="light"]) {
  color-scheme: dark;
  --surface-0: #08090b;
  --surface-1: color-mix(in srgb, var(--chat-received) 45%, #090a0d);
  --surface-2: var(--chat-received);
  --surface-3: color-mix(in srgb, var(--chat-received) 80%, #fff);
  --text-primary: #f4f1ed;
  --text-secondary: #d1cbc4;
  --text-tertiary: #b7afa6;
  --separator: color-mix(in srgb, var(--chat-accent) 36%, var(--surface-1));
  --separator-soft: color-mix(in srgb, var(--chat-accent) 20%, var(--surface-1));
  --control-hover: var(--surface-3);
  --accent: var(--chat-sent);
  --accent-hover: color-mix(in srgb, var(--chat-sent) 88%, #fff);
  --accent-active: var(--chat-sent);
  --focus: var(--chat-accent);
  --link: var(--chat-accent);
}
:root[data-chat-theme="prestige"] { --surface-1: #12100c; --surface-2: #221c12; --surface-3: #342819; }
.diamond-member-badge { width: 1em; height: 1em; object-fit: contain; vertical-align: -.12em; margin-inline-start: .35em; }
.diamond-member-badge[hidden] { display: none; }
.chat-placeholder.has-theme-shop:has(.chat-theme-shop:not([hidden])) { justify-content: flex-start; overflow-y: auto; min-height: 0; padding: clamp(16px, 3vw, 32px); }
.chat-placeholder.has-theme-shop:has(.chat-theme-shop:not([hidden])) > :not(.chat-theme-shop) { display: none; }
.chat-placeholder.has-theme-shop > .chat-theme-shop { width: 100%; flex: 1 0 auto; display: flex; flex-direction: column; text-align: start; color: var(--text-primary); }
.chat-placeholder.has-theme-shop > .chat-theme-shop[hidden], .chat-theme-wallet[hidden] { display: none; }
.chat-theme-shop h2 { font-size: 1.4rem; color: var(--text-primary); }
.chat-theme-wallet { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: auto; padding-top: 24px; }
.chat-theme-wallet > * { display: inline-flex; align-items: center; padding: 7px 13px; border: 1px solid var(--separator); border-radius: 999px; background: var(--surface-2); color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.chat-theme-wallet button { cursor: pointer; text-transform: uppercase; border-radius: 9px; }
.chat-theme-wallet button:hover { background: var(--control-hover); }
.chat-placeholder.has-theme-shop .chat-theme-cards { margin-top: 16px; }
.chat-theme-cards section[data-chat-theme="default"] {
  --chat-wall: #0c0f13;
  --chat-received: #1c222b;
  --chat-sent: #285eb8;
  color: #e7edf5;
}
.chat-theme-cards .chat-theme-sample {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 126px;
  padding: 16px;
  border-radius: 8px;
  background: var(--chat-wall);
  border: 1px solid currentColor;
}
.chat-theme-cards section { position: relative; }
.chat-theme-cards section.is-equipped { outline: 2px solid var(--focus); outline-offset: 3px; }
.chat-theme-cards section.is-equipped::after {
  content: "✓";
  position: absolute;
  inset: 17px 17px auto auto;
  color: #fff;
  background: #285eb8;
  border-radius: 50%;
  width: 23px;
  text-align: center;
}
@media (min-width: 1100px) {
  .chat-placeholder .chat-theme-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.chat-theme-cards section[data-chat-theme="light"] {
  --chat-wall: #f5f7fb;
  --chat-received: #e2e8f1;
  --chat-sent: #245dca;
  color: #182332;
}
.chat-theme-cards section[data-chat-theme="light"] .chat-theme-sent { color: #fff; }
.chat-placeholder.has-theme-shop:has(.chat-theme-shop:not([hidden])) { overflow: hidden; }
.chat-placeholder.has-theme-shop > .chat-theme-shop { flex: 1 1 auto; min-height: 0; }
.chat-placeholder .chat-theme-content { flex: 1; min-height: 0; overflow-y: auto; padding: 5px; }
.chat-theme-wallet { position: sticky; bottom: 0; z-index: 1; padding: 12px 4px; background: var(--surface-1); border-radius: 12px; }
.diamond-request-dialog { width: min(760px, calc(100vw - 24px)); }
.diamond-request-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.diamond-request-form label { display: grid; gap: 5px; min-width: 0; }
.diamond-request-list { list-style: none; padding: 0; display: grid; gap: 6px; }
.diamond-request-list li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }
@media (max-width: 600px) { .diamond-request-form { grid-template-columns: 1fr; } }
.chat-theme-cards .chat-theme-sample {
  display: block;
  padding: 0;
  overflow: hidden;
  border-color: var(--separator);
}
.chat-theme-sample-header, .chat-theme-sample-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  background: var(--chat-received);
  font-size: 12px;
}
.chat-theme-sample-header span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--chat-sent);
  color: #fff;
}
.chat-theme-sample-thread { display: grid; gap: 5px; padding: 8px 11px; }
.chat-theme-sample-date, .chat-theme-sample-name, .chat-theme-sample-read { font-size: 10px; opacity: .88; }
.chat-theme-sample-date { text-align: center; }
.chat-theme-sample-read { text-align: end; }
.chat-theme-sample .chat-theme-preview { margin: 0; max-width: 86%; font-size: 12px; border-end-start-radius: 3px; }
.chat-theme-sample .chat-theme-sent { margin-inline-start: auto; margin-block-start: 5px; border-end-start-radius: 10px; border-end-end-radius: 3px; color: #fff; }
.chat-theme-sample-composer { justify-content: space-between; }
.chat-theme-sample-composer span:last-child { background: var(--chat-sent); color: #fff; border-radius: 6px; padding: 3px 7px; }
