:root {
  --bg: #0a0b10; --surface: #12141b; --surface-2: #181b24; --surface-3: #1f2330;
  --border: rgba(255, 255, 255, .07); --border-2: rgba(255, 255, 255, .13);
  --text: #eceef4; --muted: #8a8fa0; --faint: #5d6274;
  --accent: #ff6b35; --accent-2: #ff3d71; --grad: linear-gradient(135deg, #ff7a3d 0%, #ff3d71 100%);
  --accent-soft: rgba(255, 107, 53, .12); --ring: 0 0 0 3px rgba(255, 107, 53, .22);
  --ok: #2fd39f; --danger: #ff4d5e; --warn: #ffb547;
  --r: 14px; --r-sm: 10px;
  --dc-bg: #313338; --dc-embed: #2b2d31;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 14px/1.5 Inter, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 600px at 0% -10%, rgba(255, 107, 53, .10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 61, 113, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(255, 107, 53, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
.ic { display: inline-flex; flex: none; }
.ic svg { width: 100%; height: 100%; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: var(--r-sm); font-weight: 600; color: #fff; white-space: nowrap;
  background: var(--grad); box-shadow: 0 6px 20px -8px rgba(255, 77, 94, .6);
  transition: transform .15s, box-shadow .15s, filter .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 10px 26px -8px rgba(255, 77, 94, .7); }
.btn:active { transform: none; }
.btn:focus-visible, .icon-btn:focus-visible, .nav a:focus-visible { outline: none; box-shadow: var(--ring); }
.btn .ic { width: 16px; height: 16px; }
.btn.ghost { background: var(--surface-3); box-shadow: none; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: #262a38; border-color: var(--border-2); }
.btn.danger { background: rgba(255, 77, 94, .12); color: var(--danger); box-shadow: none; border: 1px solid rgba(255, 77, 94, .25); }
.btn.danger:hover { background: rgba(255, 77, 94, .2); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 14px 26px; font-size: 15px; border-radius: 12px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted); transition: .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.icon-btn.danger:hover { color: var(--danger); background: rgba(255, 77, 94, .1); }
.icon-btn .ic { width: 17px; height: 17px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px;
  background: rgba(14, 16, 22, .75); backdrop-filter: blur(16px); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--text); padding: 0 8px; }
.brand .mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 15px; box-shadow: 0 6px 18px -6px rgba(255, 77, 94, .8); }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gswitch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: .15s; }
.gswitch:hover { border-color: var(--border-2); }
.gswitch .gi { width: 36px; height: 36px; font-size: 13px; }
.gswitch .t { min-width: 0; flex: 1; }
.gswitch .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.gswitch .t small { color: var(--muted); font-size: 11.5px; }
.gswitch > .ic { width: 16px; height: 16px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 12px 6px; font-weight: 600; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: .15s; }
.nav a .ic { width: 18px; height: 18px; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav a.active { color: var(--text); background: var(--accent-soft); }
.nav a.active .ic { color: var(--accent); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav a .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.nav a .dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.me .t { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.content { padding: 32px 40px 120px; max-width: 1280px; width: 100%; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 16px; gap: 12px; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav .label, .nav a.active::before, .me { display: none; }
  .nav a { white-space: nowrap; }
  .content { padding: 20px 16px 120px; }
}

/* ---------- page ---------- */
.page { animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; font-weight: 800; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; margin-bottom: 18px; }
.card-head { margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head h2 .ic { width: 18px; height: 18px; color: var(--accent); }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sub { margin: 22px 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px 18px; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(255, 107, 53, .2); color: #ffd2c0; font-size: 13px; }
.callout .ic { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.callout a { font-weight: 600; }

/* ---------- forms ---------- */
.field label.l { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: #cfd2dc; }
.inp, .field input:not([type=checkbox]):not([type=color]), .field select, .field textarea {
  width: 100%; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.inp:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-2); }
.inp:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--ring); background: rgba(255, 255, 255, .045); }
select { appearance: none; cursor: pointer; padding-right: 36px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8fa0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important; background-size: 18px !important; }
select option, select optgroup { background: var(--surface-2); color: var(--text); }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input[type=color] { width: 54px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: none; padding: 4px; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; margin: 4px 0; user-select: none; }
.check input { appearance: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border-2); background: rgba(255, 255, 255, .03); display: grid; place-items: center; cursor: pointer; transition: .15s; margin: 0; flex: none; }
.check input:checked { background: var(--grad); border-color: transparent; }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible { box-shadow: var(--ring); }

.switch { position: relative; width: 42px; height: 24px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 24px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #c9ccd6; border-radius: 50%; transition: .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + span { background: var(--grad); border-color: transparent; }
.switch input:checked + span::before { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.toggle-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px; min-height: 42px; transition: border-color .15s; }
.chips:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; background: var(--surface-3); border: 1px solid var(--border); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; }
.chip button:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.chip button .ic { width: 12px; height: 12px; }
.chips select { background: transparent !important; border: 0; color: var(--muted); flex: 1; min-width: 130px; outline: none; padding: 4px 30px 4px 6px !important; }

/* ---------- overview ---------- */
.hero { display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: 18px; margin-bottom: 22px; border: 1px solid var(--border);
  background: radial-gradient(500px 200px at 0% 0%, rgba(255, 107, 53, .18), transparent 70%), radial-gradient(400px 200px at 100% 100%, rgba(255, 61, 113, .14), transparent 70%), var(--surface); }
.hero .gi { width: 64px; height: 64px; font-size: 20px; border-radius: 18px; }
.hero h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.stats { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.stat { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.stat b { color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: .2s; }
.tile:hover { border-color: rgba(255, 107, 53, .35); transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(255, 77, 94, .5); }
.tile .top { display: flex; justify-content: space-between; align-items: center; }
.tile .bubble { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile .bubble .ic { width: 20px; height: 20px; }
.tile b { font-size: 15px; }
.tile p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.tile .go { font-size: 13px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.tile .go .ic { width: 14px; height: 14px; transition: transform .2s; }
.tile:hover .go .ic { transform: translateX(3px); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { background: rgba(47, 211, 159, .12); color: var(--ok); }

/* ---------- lists: filters, logs, commands, tickets ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fcard { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); transition: .15s; }
.fcard:hover { border-color: var(--border-2); }
.fcard.on { border-color: rgba(255, 107, 53, .3); background: linear-gradient(90deg, rgba(255, 107, 53, .07), transparent 60%), var(--surface-2); }
.fcard .bubble { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--muted); flex: none; transition: .15s; }
.fcard.on .bubble { background: var(--accent-soft); color: var(--accent); }
.fcard .bubble .ic { width: 19px; height: 19px; }
.fcard .t { flex: 1; min-width: 0; }
.fcard .t b { display: block; font-size: 14px; }
.fcard .t small { color: var(--muted); font-size: 12.5px; }

.cmds { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .cmds { grid-template-columns: 1fr; } }
.cmd { padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.cmd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cmd-head code { font: 700 15px/1 ui-monospace, Consolas, monospace; color: var(--text); }
.cmd-head .t { flex: 1; } .cmd-head .t small { display: block; color: var(--muted); margin-top: 3px; }

.acc { border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 10px; overflow: hidden; transition: border-color .15s; }
.acc[open] { border-color: var(--border-2); }
.acc summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; user-select: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .emo { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .05); display: grid; place-items: center; font-size: 18px; flex: none; }
.acc summary .t { flex: 1; min-width: 0; } .acc summary .t b { display: block; } .acc summary .t small { color: var(--muted); font-size: 12.5px; }
.acc summary > .ic { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.acc[open] summary > .ic { transform: rotate(180deg); }
.acc .acc-body { padding: 4px 16px 18px; border-top: 1px solid var(--border); }
.qrow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; margin-bottom: 8px; }
@media (max-width: 640px) { .qrow { grid-template-columns: 1fr auto; } }
.empty { text-align: center; padding: 34px 20px; border: 1px dashed var(--border-2); border-radius: 12px; color: var(--muted); }

/* ---------- drawer ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 10, .55); backdrop-filter: blur(3px); display: flex; justify-content: flex-end; }
.drawer-wrap.anim { animation: fade .2s ease both; }
.drawer-wrap.anim .drawer { animation: slide .28s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer { width: min(620px, 100%); height: 100%; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border-2); box-shadow: -30px 0 60px -20px rgba(0, 0, 0, .6); }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 18px 22px; background: rgba(18, 20, 27, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.drawer-head .t { flex: 1; } .drawer-head h2 { margin: 0; font-size: 17px; } .drawer-head small { color: var(--muted); }
.drawer-body { padding: 8px 22px 28px; }

/* ---------- save bar & toast ---------- */
#savebar { position: fixed; left: 50%; bottom: 22px; z-index: 40; transform: translate(-50%, 140%); opacity: 0; transition: .3s cubic-bezier(.2, .9, .3, 1);
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 14px; width: min(640px, calc(100% - 32px));
  background: rgba(24, 27, 36, .92); backdrop-filter: blur(14px); border: 1px solid var(--border-2); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .7); }
#savebar.show { transform: translate(-50%, 0); opacity: 1; }
#savebar .t { flex: 1; font-weight: 600; } #savebar .t small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
#toast { position: fixed; top: 20px; left: 50%; z-index: 60; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; transition: .25s;
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; font-weight: 600; max-width: min(480px, calc(100% - 32px));
  background: rgba(24, 27, 36, .95); backdrop-filter: blur(12px); border: 1px solid var(--border-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast .ic { width: 18px; height: 18px; color: var(--ok); }
#toast.err .ic { color: var(--danger); }

/* ---------- login & servers ---------- */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.landing .mark { width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 22px; background: var(--grad); display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #fff; box-shadow: 0 20px 60px -10px rgba(255, 77, 94, .7); }
.landing h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.03em; font-weight: 800; }
.landing h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing p { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0 auto 28px; }
.features { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 34px; }
.features span { padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--border); background: rgba(14, 16, 22, .6); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.topbar .me { margin: 0; background: transparent; border: 0; padding: 0; }
.servers { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; }
.guilds { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.guild { position: relative; overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); padding: 0 18px 18px; text-align: center; transition: .2s; }
.guild:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8); }
.guild .banner { height: 70px; margin: 0 -18px; background: radial-gradient(160px 80px at 30% 0%, rgba(255, 107, 53, .45), transparent), radial-gradient(160px 80px at 80% 100%, rgba(255, 61, 113, .35), transparent), var(--surface-3); }
.guild.off .banner { filter: grayscale(1) brightness(.7); }
.guild .gi { width: 64px; height: 64px; margin: -32px auto 10px; border: 4px solid var(--surface); font-size: 20px; border-radius: 20px; }
.guild .name { font-weight: 700; margin-bottom: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild .btn { width: 100%; }
.gi { border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; }
.gi img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1200px) { .builder { grid-template-columns: 1fr; } }
.preview-wrap { position: sticky; top: 24px; }
.preview-label { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; margin-bottom: 10px; }
.preview-label .live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.preview { background: var(--dc-bg); border-radius: var(--r); padding: 18px 16px; border: 1px solid var(--border); font-family: "gg sans", "Segoe UI", system-ui, sans-serif; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tpl { text-align: left; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: .15s; }
.tpl:hover { border-color: rgba(255, 107, 53, .4); background: var(--surface-3); }
.tpl b { display: block; font-size: 13px; } .tpl small { color: var(--muted); font-size: 12px; }
.msg { display: flex; gap: 14px; }
.msg .av { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); flex: none; display: grid; place-items: center; font-weight: 800; object-fit: cover; }
.msg .who { font-weight: 600; color: #ff8a5c; } .msg .who .tag { background: #5865f2; color: #fff; font-size: 10px; border-radius: 3px; padding: 1px 4px; margin-left: 6px; vertical-align: middle; font-weight: 600; }
.msg .who time { color: #949ba4; font-size: 12px; font-weight: 400; margin-left: 6px; }
.msg .body { min-width: 0; flex: 1; }
.md { white-space: pre-wrap; word-wrap: break-word; color: #dbdee1; }
.md blockquote { margin: 4px 0; padding-left: 12px; border-left: 4px solid #4e5058; white-space: pre-wrap; }
.md code { background: #1e1f22; padding: 1px 4px; border-radius: 3px; font-size: 85%; }
.md a { color: #00a8fc; }
.md .mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.embed { background: var(--dc-embed); border-left: 4px solid #1e1f22; border-radius: 4px; padding: 10px 16px 14px 12px; margin-top: 6px; max-width: 520px; display: grid; grid-template-columns: 1fr auto; gap: 0 12px; }
.embed > * { grid-column: 1; }
.embed .thumb { grid-column: 2; grid-row: 1 / 5; max-width: 80px; max-height: 80px; border-radius: 4px; }
.embed .author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-top: 4px; }
.embed .author img, .embed .footer img { width: 20px; height: 20px; border-radius: 50%; }
.embed .title { font-weight: 700; margin-top: 6px; color: #f2f3f5; }
.embed .desc { font-size: 14px; margin-top: 6px; }
.embed .fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.embed .fields .f { grid-column: 1 / -1; } .embed .fields .f.inline { grid-column: auto; }
.embed .fields b { display: block; font-size: 13px; }
.embed .img { max-width: 100%; border-radius: 4px; margin-top: 12px; grid-column: 1 / -1; }
.embed .footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #949ba4; margin-top: 8px; grid-column: 1 / -1; }
.comps { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.comps .r { display: flex; gap: 8px; }
.comps .b { background: #4e5058; border-radius: 6px; width: 60px; height: 32px; display: grid; place-items: center; }
.comps .b.red { background: #da373c; }
.comps .sel { background: #1e1f22; border: 1px solid #2b2d31; border-radius: 8px; padding: 10px 12px; color: #949ba4; max-width: 400px; display: flex; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
