/* ══════════════════════════════════════════════════════════════
   Velo Dashboard — tema oscuro + rojo (mismo estilo que la web)
   ══════════════════════════════════════════════════════════════ */
:root {
    --red: #ED4245;
    --red-dark: #B5262A;
    --bg: #0e0f13;
    --bg-soft: #17181f;
    --card: #1c1e27;
    --border: #2a2c38;
    --text: #f2f2f5;
    --text-muted: #9a9caa;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ── Header ──────────────────────────────────────────────────── */
header.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(14,15,19,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
header.site-header .bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; max-width: 1120px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); }
.brand-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }

.header-right { display: flex; align-items: center; gap: 14px; }

.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-btn {
    background: transparent; border: none; color: var(--text-muted);
    padding: 6px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.lang-btn.active { background: var(--red); color: #fff; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 0.92rem;
    border: 1px solid transparent; cursor: pointer; transition: transform .12s, opacity .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--red); }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); }

/* ── Hero ────────────────────────────────────────────────────── */
.hero { padding: 90px 24px 60px; text-align: center; }
.badge {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: rgba(237,66,69,0.12); color: var(--red); font-size: 0.8rem; font-weight: 700;
    letter-spacing: .04em; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 16px; }
.hero p.subtitle { color: var(--text-muted); max-width: 640px; margin: 0 auto 32px; font-size: 1.05rem; }
.hero .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Features ────────────────────────────────────────────────── */
.features { padding: 60px 24px; }
.features h2 { text-align: center; margin-bottom: 36px; font-size: 1.8rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.feature-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--red); }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

/* ── Support ─────────────────────────────────────────────────── */
.support { padding: 60px 24px; text-align: center; }
.support .card {
    max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
}
.support h2 { margin-top: 0; }
.support p { color: var(--text-muted); }
.support .email {
    display: inline-block; margin-top: 10px; padding: 10px 18px; border-radius: 10px;
    background: rgba(237,66,69,0.12); color: var(--red); font-weight: 700; font-family: monospace;
}

/* ── Dashboard (lista de servidores) ────────────────────────────── */
.dash-wrap { padding: 50px 24px; max-width: 1000px; margin: 0 auto; }
.dash-wrap h1 { margin-bottom: 4px; }
.dash-wrap .sub { color: var(--text-muted); margin-top: 0; margin-bottom: 30px; }

.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.guild-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px;
}
.guild-card .icon {
    width: 48px; height: 48px; border-radius: 50%; background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted);
    overflow: hidden; flex-shrink: 0;
}
.guild-card .icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-card .info { flex: 1; min-width: 0; }
.guild-card .info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-card .btn { padding: 7px 14px; font-size: 0.82rem; white-space: nowrap; }

.state-msg { text-align: center; color: var(--text-muted); padding: 40px 0; }

.back-link { display: inline-block; margin-bottom: 20px; color: var(--text-muted); font-size: 0.9rem; }
.back-link:hover { color: var(--red); }

.coming-soon {
    background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
    padding: 40px; text-align: center;
}
.coming-soon h2 { margin-top: 0; color: var(--red); }
.coming-soon p { color: var(--text-muted); max-width: 480px; margin: 0 auto; }

/* ── Footer ──────────────────────────────────────────────────── */
footer { padding: 30px 24px; text-align: center; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); }

.hidden { display: none !important; }

@media (max-width: 560px) {
    header.site-header .bar { flex-wrap: wrap; gap: 10px; }
    .hero { padding: 60px 20px 40px; }
}

/* ══ Añadidos: legal, consentimiento, lista publica, formulario ══ */
.muted { color: var(--text-muted); }
.center { text-align: center; }
.guild-card .info small { display: block; font-size: 0.78rem; }

.public-servers { padding: 40px 24px 20px; }
.public-servers h2 { text-align: center; margin-bottom: 6px; font-size: 1.6rem; }
.public-servers .guild-grid { max-width: 1000px; margin: 24px auto 0; }

.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a, .link-btn { color: var(--text-muted); font-size: 0.85rem; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.footer-links a:hover, .link-btn:hover { color: var(--red); }

/* ══ Paginas legales (/terms, /privacy): indice + lectura comoda ══ */
body[data-doc="terms"] #doc-privacy,
body[data-doc="privacy"] #doc-terms { display: none; }
html[lang="es"] .lang-en { display: none; }
html[lang="en"] .lang-es { display: none; }

.legal-wrap {
    max-width: 1080px; margin: 0 auto; padding: 40px 24px 70px;
    display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start;
}
.legal-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.legal-tabs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.legal-tabs a {
    padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px;
    color: var(--text-muted); font-size: 0.9rem; font-weight: 600;
}
.legal-tabs a:hover { border-color: var(--red); color: var(--text); }
.legal-tabs a.active { background: var(--red); border-color: var(--red); color: #fff; }

.toc summary {
    cursor: pointer; list-style: none; font-size: 0.74rem; font-weight: 700;
    letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); padding: 4px 0 10px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: " ▾"; }
.toc:not([open]) summary::after { content: " ▸"; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a {
    display: block; padding: 6px 12px; margin-left: -1px; border-left: 2px solid transparent;
    color: var(--text-muted); font-size: 0.86rem; line-height: 1.35;
}
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--red); border-left-color: var(--red); font-weight: 600; }

.legal-doc { min-width: 0; }
.doc { max-width: 70ch; font-size: 1.04rem; line-height: 1.78; color: #d9dae2; }
.doc h1 { font-size: clamp(1.9rem, 3.5vw, 2.5rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; color: var(--text); }
.doc-meta {
    display: inline-block; margin: 0 0 30px; padding: 5px 12px; border-radius: 999px;
    background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.82rem;
}
.doc h2 {
    margin: 2.4em 0 0.6em; padding-top: 0.2em; font-size: 1.3rem; line-height: 1.3;
    color: var(--text); scroll-margin-top: 90px;
}
.doc h2::before { content: ""; display: block; width: 34px; height: 3px; border-radius: 3px; background: var(--red); margin-bottom: 12px; }
.doc p { margin: 0 0 1.05em; }
.doc ul { margin: 0 0 1.2em; padding-left: 1.3em; }
.doc li { margin-bottom: 0.7em; padding-left: 0.2em; }
.doc li::marker { color: var(--red); }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: #ff7a7d; text-decoration: underline; text-underline-offset: 3px; }
.doc a:hover { color: #fff; }
.doc code { background: var(--bg-soft); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; font-size: 0.86em; }
.legal-top { margin: 50px 0 0; max-width: 70ch; font-size: 0.88rem; }
.legal-top a { color: var(--text-muted); }
.legal-top a:hover { color: var(--red); }
html { scroll-behavior: smooth; }

@media (max-width: 860px) {
    .legal-wrap { grid-template-columns: 1fr; gap: 22px; padding: 24px 18px 56px; }
    .legal-side { position: static; max-height: none; }
    .legal-tabs { flex-direction: row; flex-wrap: wrap; }
    .toc { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
    .doc { font-size: 1rem; }
}

/* Aviso de cookies */
.consent-banner[hidden] { display: none !important; }
body.booting .consent-banner { visibility: visible; }
.consent-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
    max-width: 760px; margin: 0 auto;
    display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.consent-text { flex: 1 1 320px; }
.consent-text p { margin: 6px 0 0; color: var(--text-muted); font-size: 0.88rem; }
.consent-links { font-size: 0.82rem !important; }
.consent-links a { color: var(--red); text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Panel de servidor: formulario de listado */
.panel-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.panel-card h2 { margin-top: 0; }
.panel-card label { display: block; margin: 16px 0 6px; font-size: 0.9rem; color: var(--text-muted); }
.panel-card input[type="url"] {
    width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text); font-size: 0.95rem;
}
.panel-card input[type="url"]:focus { outline: none; border-color: var(--red); }
.panel-card label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 0.88rem; }
.panel-card label.check input { margin-top: 3px; accent-color: var(--red); }
.panel-card label.check a { color: var(--red); text-decoration: underline; }
.row-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.status-line { font-weight: 600; margin: 12px 0 0; }
.status-line.on { color: #57F287; }
.status-line.off { color: var(--text-muted); }
.msg-line { min-height: 1.2em; margin: 12px 0 0; font-size: 0.88rem; }
.msg-line.ok { color: #57F287; }
.msg-line.err { color: var(--red); }
.public-servers .guild-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 380px)); justify-content: center; gap: 20px; }

/* ══ Tarjeta estilo invitacion de Discord ══ */
.invite-card { background: #111214; border: 1px solid #1e1f22; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.invite-banner { height: 92px; background: #1e1f22; position: relative; overflow: hidden; }
.invite-banner.no-banner { background: linear-gradient(135deg, #7a1b1e 0%, #ED4245 55%, #f08a5d 100%); }
.invite-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.invite-body { padding: 0 18px 18px; display: flex; flex-direction: column; flex: 1; }
.invite-icon {
    width: 72px; height: 72px; margin-top: -36px; border-radius: 18px; border: 5px solid #111214;
    background: #1e1f22; overflow: hidden; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.3rem; color: var(--text-muted); flex-shrink: 0; position: relative;
}
.invite-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.invite-name { margin: 12px 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.15rem; line-height: 1.25; }
.invite-name-text { word-break: break-word; }
.badge-verified { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 50%; background: #5865F2; color: #fff; font-size: 0.65rem; font-weight: 700; }
.badge-tag { background: #2b2d31; color: #dbdee1; border-radius: 6px; padding: 2px 7px; font-size: 0.72rem; font-weight: 700; letter-spacing: .03em; }
.invite-stats { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; color: #b5bac1; font-size: 0.88rem; }
.invite-stats span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-on { background: #23a55a; }
.dot-off { background: #80848e; }
.invite-est { margin: 6px 0 0; color: #b5bac1; font-size: 0.85rem; }
.invite-desc {
    margin: 12px 0 0; color: #949ba4; font-size: 0.9rem; line-height: 1.4; max-height: 4.3em; overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.invite-btn {
    margin-top: auto; display: block; text-align: center; background: #248046; color: #fff;
    padding: 11px 14px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; transition: background .12s;
}
.invite-desc + .invite-btn, .invite-est + .invite-btn { margin-top: 16px; }
.invite-btn:hover { background: #1a6334; }

.lang-btn:focus-visible, .btn:focus-visible, .link-btn:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ── Velo 7.8 dashboard workspace ─────────────────────────────── */
.logout-icon,.icon-button { background:transparent; border:1px solid var(--border); color:var(--text); width:40px; height:40px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.logout-icon:hover,.icon-button:hover { border-color:var(--red); color:var(--red); }
.logout-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.guild-list-heading,.analytics-heading { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.guild-list-heading .sub { margin-bottom:0; }
.server-dashboard { position:relative; display:grid; grid-template-columns:250px minmax(0,1fr); gap:20px; align-items:start; margin-top:20px; }
.sidebar-toggle { display:none; }
.server-sidebar { position:sticky; top:80px; align-self:start; min-height:0; height:calc(100vh - 96px); height:calc(100dvh - 96px); max-height:calc(100dvh - 96px); overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; scrollbar-gutter:stable; scrollbar-width:thin; scrollbar-color:var(--border) transparent; background:var(--bg-soft); border:1px solid var(--border); border-radius:12px; padding:10px 7px 18px 10px; display:flex; flex-direction:column; gap:5px; z-index:40; }
.sidebar-heading { position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:center; padding:9px 10px 13px; border-bottom:1px solid var(--border); margin-bottom:5px; background:var(--bg-soft); }
.sidebar-heading strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.server-sidebar::-webkit-scrollbar { width:6px; }
.server-sidebar::-webkit-scrollbar-track { background:transparent; }
.server-sidebar::-webkit-scrollbar-thumb { background:var(--border); border-radius:999px; }
.sidebar-heading .icon-button { width:32px; height:32px; font-size:1.3rem; display:none; }
.sidebar-item { display:flex; width:100%; align-items:center; padding:11px 12px; border:0; border-radius:8px; background:transparent; color:#c6c9d2; cursor:pointer; text-align:left; font:inherit; font-size:.92rem; }
.sidebar-item:hover,.sidebar-item.active { background:#272a33; color:white; }
.sidebar-item.active { border-left:3px solid var(--red); }
.server-content { min-width:0; }
.server-content .panel-card { margin:0 0 18px; }
.server-content h2 { margin-bottom:4px; }
.sidebar-backdrop { display:none; }
.analytics-heading .muted { margin:3px 0 0; }
.activity-badge { flex-shrink:0; border-radius:999px; padding:7px 12px; font-size:.82rem; font-weight:700; }
.activity-badge.active { background:rgba(35,165,90,.16); color:#57f287; }
.activity-badge.inactive { background:rgba(237,66,69,.15); color:#ff7b80; }
.analytics-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:12px; margin-top:22px; }
.metric-card { min-height:94px; background:#171a21; border:1px solid var(--border); border-radius:10px; padding:15px; display:flex; flex-direction:column; justify-content:space-between; gap:8px; }
.metric-card span { color:var(--text-muted); font-size:.82rem; }
.metric-card strong { font-size:1.28rem; overflow-wrap:anywhere; }
.analytics-note { min-height:1.2em; font-size:.84rem; }
.toggle-row { display:flex !important; align-items:center; justify-content:space-between; gap:12px; min-height:38px; margin:0 !important; color:var(--text) !important; cursor:pointer; }
.toggle-row > span:first-child { flex:1 1 auto; min-width:0; }
.toggle-input { position:absolute; opacity:0; width:1px; height:1px; }
.toggle-track { flex:0 0 44px; width:44px; height:24px; border-radius:99px; background:#464a55; position:relative; transition:background .2s; }
.toggle-track::after { content:""; width:18px; height:18px; background:white; position:absolute; top:3px; left:3px; border-radius:50%; transition:transform .2s; }
.toggle-input:checked + .toggle-track { background:#248046; }
.toggle-input:checked + .toggle-track::after { transform:translateX(20px); }
.toggle-input:focus-visible + .toggle-track { outline:2px solid var(--red); outline-offset:3px; }
.logs-toolbar { display:flex; align-items:center; gap:10px; padding:14px 0; }
.logs-toolbar select { max-width:300px; }
.logs-categories { border-top:1px solid var(--border); }
.log-category { display:grid; grid-template-columns:minmax(150px,1fr) minmax(180px,300px); align-items:center; gap:14px; padding:11px 0; border-bottom:1px solid var(--border); }
.log-category-title { display:flex; align-items:center; gap:10px; font-size:.92rem; }
.log-category-title span { color:var(--text-muted); }
.log-category select,.logs-toolbar select,.server-content select,.server-content textarea { width:100%; min-height:40px; border:1px solid var(--border); border-radius:8px; background:#151821; color:var(--text); padding:8px 10px; font:inherit; }
.server-content textarea { resize:vertical; }
.language-fade main { animation:languageFade .3s ease; }
@keyframes languageFade { 0% { opacity:.45; transform:translateY(3px); } 100% { opacity:1; transform:translateY(0); } }
@media (max-width:800px) {
    .server-dashboard { grid-template-columns:1fr; }
    .sidebar-toggle { display:inline-flex; align-items:center; gap:8px; background:var(--bg-soft); color:var(--text); border:1px solid var(--border); border-radius:9px; padding:9px 13px; cursor:pointer; margin:0 0 12px; }
    .server-sidebar { position:fixed; left:0; top:0; bottom:0; width:min(300px,84vw); height:100vh; height:100dvh; max-height:100dvh; padding-bottom:max(18px,env(safe-area-inset-bottom)); border-radius:0 14px 14px 0; transform:translateX(-105%); transition:transform .24s ease; overflow-y:auto; overflow-x:hidden; z-index:70; }
    .server-sidebar.open { transform:translateX(0); }
    body.sidebar-open { overflow:hidden; }
    .sidebar-heading .icon-button { display:inline-flex; }
    .sidebar-backdrop:not(.hidden) { display:block; position:fixed; inset:0; z-index:65; background:rgba(0,0,0,.58); }
}
@media (max-width:560px) {
    .header-right { margin-left:auto; gap:8px; }
    .user-chip { gap:6px; }
    .server-content .panel-card { padding:17px; }
    .analytics-heading { align-items:flex-start; }
    .log-category { grid-template-columns:1fr; gap:7px; }
    .guild-list-heading { align-items:flex-start; }
}
@media (prefers-reduced-motion:reduce) {
    *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ── Módulos de configuración del servidor ─────────────────────── */
.server-content input[type="text"],
.server-content input[type="number"],
.server-content input[type="url"],
.server-content select,
.server-content textarea {
    min-height: 42px; border: 1px solid var(--border); border-radius: 8px;
    background: #151821; color: var(--text); padding: 9px 11px; font: inherit;
}
.server-content input[type="text"],
.server-content input[type="number"],
.server-content input[type="url"] { width: 100%; }
.server-content input[type="color"] { width: 64px; height: 42px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #151821; }
.server-content input:focus-visible,
.server-content select:focus-visible,
.server-content textarea:focus-visible,
.server-content button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.form-grid-two,.form-grid-three { display: grid; gap: 14px; align-items: start; }
.form-grid-two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-grid-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.levels-roles-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:22px; }
.levels-roles-heading h3 { margin:0; font-size:1rem; }
.level-role-rows { display:grid; gap:10px; margin-top:12px; }
.level-role-row { display:grid; grid-template-columns:minmax(90px,.7fr) minmax(180px,1.5fr) 40px; align-items:end; gap:12px; padding:12px; border:1px solid var(--border); border-radius:10px; background:#171a21; }
.level-role-row label { margin:0 !important; }
.level-role-row label span { display:block; margin-bottom:5px; color:var(--text-muted); font-size:.82rem; }
.level-role-row .icon-button { width:40px; height:42px; font-size:1.2rem; }
@media (max-width:700px) {
    .form-grid-three { grid-template-columns:1fr; gap:4px; }
}
@media (max-width:560px) {
    .form-grid-two { grid-template-columns:1fr; gap:4px; }
    .level-role-row { grid-template-columns:minmax(75px,.7fr) minmax(120px,1.5fr) 38px; gap:8px; padding:9px; }
}
.guild-view-nav { display:flex; align-items:center; gap:18px; }
.guild-view-nav .back-link { margin-bottom:20px; }

.public-list-link { margin-top:14px; }

/* Hide the initial view until the session check chooses the correct route. */
body.booting main, body.booting footer, body.booting .header-right { visibility: hidden; }
.unsaved-dialog { width:min(520px,calc(100% - 32px)); padding:24px; color:var(--text); background:var(--card); border:1px solid var(--border); border-radius:16px; box-shadow:0 24px 80px #0009; }
.unsaved-dialog::backdrop { background:#06070acc; backdrop-filter:blur(3px); }
.unsaved-dialog h2 { margin:0 0 8px; }
.unsaved-dialog p { color:var(--text-muted); }
.unsaved-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:22px; }
.btn:disabled { cursor:not-allowed; opacity:.72; filter:saturate(.72); transform:none; }
.btn:disabled:hover { transform:none; }
.save-spinner { width:15px; height:15px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:save-spin .7s linear infinite; }
@keyframes save-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .save-spinner { animation:none; } }
.activity-chart-card { margin-top:22px; padding:18px; border:1px solid var(--border); border-radius:12px; background:var(--bg-soft); }
.activity-chart-heading { display:flex; flex-direction:column; gap:2px; margin-bottom:12px; }
.activity-chart-heading h3 { margin:0; font-size:1rem; }
.activity-chart-heading span { color:var(--text-muted); font-size:.82rem; }
.activity-chart { min-height:170px; width:100%; overflow:hidden; }
.activity-chart svg { display:block; width:100%; height:auto; min-height:170px; }
.template-help { display:flex; flex-direction:column; gap:6px; margin:8px 0; color:var(--text-muted); font-size:.84rem; }
.template-help code { display:inline-block; margin:2px 3px 2px 0; padding:2px 5px; border:1px solid var(--border); border-radius:5px; background:#151821; color:var(--text); }
.header-right #authArea { display:flex; align-items:center; gap:10px; }
#authArea .btn, #authArea .logout-icon { align-self:center; margin:0; }
/* Subtle cross-view affordances; honor reduced-motion preferences. */
.panel-card, .analytics-card, .guild-card, .sidebar-item, .btn, .icon-button, input, select, textarea { transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease; }
body.language-fade main { animation: language-soft-fade .28s ease both; }
@keyframes language-soft-fade { 0% { opacity:.62; transform:translateY(2px); } 100% { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition-duration:.01ms !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; } }
@media (max-width: 640px) { .activity-chart-card { padding:12px; } .activity-chart-heading span { line-height:1.45; } .template-help code { word-break:break-word; } .form-grid-three { grid-template-columns:1fr; } }


/* Public SEO copy and an honest, inactive ad slot (no advertising scripts loaded). */
.seo-intro { padding-top: 3.25rem; padding-bottom: 2rem; }
.seo-intro > h2 { margin-bottom: .75rem; }
.seo-intro > p { max-width: 900px; color: var(--muted, #aab0bd); line-height: 1.7; }
.seo-faq { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem; margin-top:1.5rem; }
.seo-faq article { padding:1.1rem; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(255,255,255,.025); }
.seo-faq h3 { margin:.1rem 0 .5rem; }
.seo-faq p { margin:0; color:var(--muted,#aab0bd); line-height:1.6; }
.ad-support { display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,.65fr); gap:1.25rem; align-items:center; margin:1.5rem auto 3rem; padding:1.25rem; border:1px dashed rgba(255,255,255,.18); border-radius:16px; background:rgba(255,255,255,.02); }
.ad-label { display:inline-block; margin-bottom:.4rem; color:var(--muted,#aab0bd); font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; }
.ad-copy h2 { margin:.1rem 0 .45rem; }
.ad-copy p { margin:0; color:var(--muted,#aab0bd); line-height:1.55; }
.ad-placeholder { min-height:110px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.1); border-radius:12px; background:rgba(0,0,0,.12); color:var(--muted,#aab0bd); text-align:center; font-size:.9rem; }
.login-wrap { min-height:calc(100vh - 150px); display:grid; place-items:center; padding:2rem 1rem; }
.login-card { width:min(100%,520px); padding:2rem; border:1px solid rgba(255,255,255,.1); border-radius:20px; background:rgba(255,255,255,.035); box-shadow:0 20px 70px rgba(0,0,0,.24); }
.login-card h1 { margin:.75rem 0; font-size:clamp(1.8rem,4vw,2.4rem); }
.login-card form { margin-top:1.4rem; }
.login-card #turnstileWidget { min-height:70px; }
.login-card .btn { margin-top:1rem; width:100%; }
.login-card .back-link { display:inline-block; margin-top:1.25rem; }
@media(max-width:650px){.ad-support{grid-template-columns:1fr}.ad-placeholder{min-height:90px}.login-card{padding:1.35rem}}

/* Account menu, theme switch and invitation ranking. */
.profile-menu { position:relative; }
.profile-menu-button { width:42px; height:42px; display:inline-flex; align-items:center; justify-content:center; gap:4px; padding:3px; border:1px solid var(--border); border-radius:999px; background:var(--bg-soft); color:var(--text); cursor:pointer; }
.profile-menu-button:hover,.profile-menu-button[aria-expanded="true"] { border-color:var(--red); }
.profile-avatar { width:32px; height:32px; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:var(--card); color:var(--text-muted); }
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-avatar svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.profile-chevron { font-size:.75rem; line-height:1; color:var(--text-muted); }
.profile-menu-popover { position:absolute; z-index:100; top:calc(100% + 10px); right:0; width:min(300px,calc(100vw - 24px)); padding:12px; border:1px solid var(--border); border-radius:14px; background:var(--card); box-shadow:0 18px 50px rgba(0,0,0,.32); }
.profile-menu-identity { display:flex; flex-direction:column; gap:2px; padding:5px 7px 11px; border-bottom:1px solid var(--border); }
.profile-menu-identity strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.profile-menu-identity small,.profile-language>span { color:var(--text-muted); font-size:.82rem; }
.profile-menu-action { width:100%; display:flex; align-items:center; gap:11px; margin-top:10px; padding:10px 8px; border:0; border-radius:8px; background:transparent; color:var(--text); text-align:left; font:inherit; cursor:pointer; }
.profile-menu-action:hover { background:var(--bg-soft); }
.profile-action-icon { width:22px; height:22px; display:grid; place-items:center; color:var(--red); }
.profile-action-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.profile-language { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 8px 4px; }
.profile-language .lang-switch { gap:4px; overflow:visible; border:0; }
.profile-language .lang-btn { padding:6px 9px; border:1px solid var(--border); border-radius:7px; }
.profile-language .lang-btn.active { border-color:var(--red); }
#profileLogoutArea { margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
#profileLogoutArea .logout-icon { width:100%; justify-content:flex-start; gap:10px; padding:8px 10px; }
.invite-board-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:18px; }
.invite-ranking-card { margin-top:24px; padding:17px; border:1px solid var(--border); border-radius:12px; background:var(--bg-soft); }
.invite-ranking-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
.invite-ranking-heading h3 { margin:0; font-size:1rem; }
.invite-ranking-heading p { margin:3px 0 0; font-size:.82rem; }
.invite-refresh-indicator { color:var(--text-muted); font-size:.78rem; white-space:nowrap; }
.invite-ranking-table { overflow-x:auto; }
.invite-ranking-table table { width:100%; border-collapse:collapse; text-align:left; }
.invite-ranking-table th,.invite-ranking-table td { padding:10px 9px; border-bottom:1px solid var(--border); }
.invite-ranking-table th { color:var(--text-muted); font-size:.78rem; font-weight:650; }
.invite-ranking-table tr:last-child td { border-bottom:0; }
.invite-ranking-table td:last-child,.invite-ranking-table th:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.invite-ranking-member { display:flex; align-items:center; gap:9px; min-width:160px; }
.invite-ranking-avatar { width:28px; height:28px; flex:0 0 28px; border-radius:50%; object-fit:cover; background:var(--card); }
.invite-ranking-position { width:28px; color:var(--text-muted); }
@media(max-width:560px){.profile-menu-popover{right:-8px}.invite-board-actions .btn{flex:1 1 auto;justify-content:center}.invite-ranking-card{padding:12px}.invite-refresh-indicator{white-space:normal;text-align:right}}

html[data-theme="light"] { --bg:#f4f5f8; --bg-soft:#ffffff; --card:#ffffff; --border:#d8dbe4; --text:#20232c; --text-muted:#697080; color-scheme:light; }
html[data-theme="light"] body { background:var(--bg); color:var(--text); }
html[data-theme="light"] header.site-header { background:rgba(255,255,255,.9); }
html[data-theme="light"] .sidebar-heading { background:var(--bg-soft); }
html[data-theme="light"] .sidebar-item { color:#3b404c; }
html[data-theme="light"] .sidebar-item:hover,html[data-theme="light"] .sidebar-item.active { background:#f0f1f5; color:#20232c; }
html[data-theme="light"] .metric-card,html[data-theme="light"] .activity-chart-card,html[data-theme="light"] .invite-ranking-card,html[data-theme="light"] .level-role-row,html[data-theme="light"] .message-template-list,html[data-theme="light"] .message-editor,html[data-theme="light"] .message-embed-editor,html[data-theme="light"] .message-responses-section,html[data-theme="light"] .message-publish-box,html[data-theme="light"] .security-group,html[data-theme="light"] .settings-group { background:#fff; }
html[data-theme="light"] .server-content select,html[data-theme="light"] .server-content textarea,html[data-theme="light"] .server-content input[type="text"],html[data-theme="light"] .server-content input[type="number"],html[data-theme="light"] .server-content input[type="url"],html[data-theme="light"] .message-manager-toolbar input[type="search"] { background:#f8f9fb; color:var(--text); }
html[data-theme="light"] .message-list-item,html[data-theme="light"] .message-field-row,html[data-theme="light"] .message-option-card,html[data-theme="light"] .message-response-card { background:#f7f8fa; color:var(--text); }
html[data-theme="light"] .security-group[open],html[data-theme="light"] .settings-group[open] { border-color:rgba(237,66,69,.4); }
html[data-theme="light"] .invite-card { background:#fff; border-color:var(--border); }
html[data-theme="light"] .invite-icon { border-color:#fff; background:#f0f1f5; }
html[data-theme="light"] .activity-chart svg text { fill:#697080; }

.owner-guild-section { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.owner-guild-section h2 { margin-bottom: 4px; }
.owner-guild-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.owner-guild-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px 14px; }
.owner-guild-card .info { min-width: 0; }
.owner-guild-card .info .owner-guild-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.owner-guild-card .owner-guild-id { margin-top: 4px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.owner-guild-actions { grid-column: 1 / -1; display: flex; gap: 8px; min-width: 0; }
.owner-guild-actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; }
.owner-invite-missing { flex: 1 1 0; min-width: 0; display: grid; place-items: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: .82rem; }


/* Navigation groups and focused configuration sections */
.sidebar-group-title { margin: 1.1rem .65rem .35rem; color: var(--text-muted); font-size: .68rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-nav-group.hidden { display: none; }
.security-group, .settings-group, .support-guide { margin: .8rem 0; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.018); }
.security-group > summary, .settings-group > summary, .support-guide > summary { cursor: pointer; color: var(--text); font-weight: 700; list-style: none; }
.security-group > summary::-webkit-details-marker, .settings-group > summary::-webkit-details-marker, .support-guide > summary::-webkit-details-marker { display: none; }
.security-group > summary::after, .settings-group > summary::after, .support-guide > summary::after { content: '+'; float: right; color: var(--red); font-size: 1.15rem; line-height: 1; }
.security-group[open] > summary::after, .settings-group[open] > summary::after, .support-guide[open] > summary::after { content: '−'; }
.security-group[open], .settings-group[open] { border-color: rgba(237,66,69,.38); }
.security-group > :not(summary), .settings-group > :not(summary) { margin-top: .8rem; }
.support-guides { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem .8rem; }
.support-guide { margin: 0; }
.support-guide p { margin: .65rem 0 .15rem; color: var(--text-muted); }
.support-chat { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-soft); }
.support-chat-log { display: flex; flex-direction: column; gap: .65rem; min-height: 120px; max-height: 360px; overflow-y: auto; margin: 1rem 0; padding: .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.support-chat-message { max-width: min(90%,720px); padding: .7rem .9rem; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-chat-message.assistant { align-self: flex-start; background: var(--card); color: var(--text); }
.support-chat-message.user { align-self: flex-end; background: rgba(237,66,69,.17); border: 1px solid rgba(237,66,69,.3); }
#supportChatInput { min-height: 76px; }
#saveTempVoice[aria-busy="true"], #supportChatSend[aria-busy="true"] { opacity: .75; }
@media(max-width:720px) { .support-guides { grid-template-columns: 1fr; } .support-chat { padding: .9rem; } }


/* ── Dashboard: editor de Mensajes Embed ─────────────────────────── */
.sr-only { position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.message-manager-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:18px; }
.message-manager-header h2 { margin:0 0 4px; }
.message-manager-header p { margin:0; }
.message-manager-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.message-manager-toolbar input[type="search"] { width:min(220px,42vw); min-height:42px; padding:9px 11px; border:1px solid var(--border); border-radius:9px; background:#151821; color:var(--text); font:inherit; }
.message-manager-layout { display:grid; grid-template-columns:minmax(210px, .72fr) minmax(0,2fr); gap:18px; align-items:start; }
.message-template-list { min-width:0; padding:15px; border:1px solid var(--border); border-radius:12px; background:var(--bg-soft); }
.message-template-list h3 { margin:0 0 12px; font-size:1rem; }
.message-list { display:grid; gap:8px; }
.message-list-item { width:100%; display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:11px 12px; border:1px solid var(--border); border-radius:9px; background:#12141a; color:var(--text); text-align:left; cursor:pointer; }
.message-list-item:hover,.message-list-item.active { border-color:var(--red); background:rgba(237,66,69,.08); }
.message-list-item strong { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.message-list-item small { color:var(--text-muted); font-size:.78rem; }
.message-editor { min-width:0; padding:18px; border:1px solid var(--border); border-radius:12px; background:#171a22; }
.message-editor-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:8px; }
.message-editor-heading h3 { margin:0; }
.message-editor-heading p { margin:2px 0 0; font-size:.84rem; }
.message-mode-tabs { display:flex; gap:8px; margin:16px 0 4px; padding:4px; width:max-content; max-width:100%; border:1px solid var(--border); border-radius:10px; background:#111319; }
.message-mode-tabs button { border:0; border-radius:7px; padding:8px 14px; background:transparent; color:var(--text-muted); font:inherit; font-weight:650; cursor:pointer; }
.message-mode-tabs button.active { color:#fff; background:var(--red); }
.message-embed-editor,.message-responses-section,.message-publish-box { margin-top:18px; padding:16px; border:1px solid var(--border); border-radius:11px; background:rgba(12,14,19,.45); }
.message-embed-editor h4,.message-responses-section h4 { margin:0; font-size:1rem; }
.message-fields-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:16px 0 10px; }
.message-fields-heading h4 { margin:0; }
.message-fields-heading p { margin:3px 0 0; font-size:.83rem; }
.message-field-list,.message-response-list { display:grid; gap:10px; }
.message-field-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) auto auto; align-items:end; gap:10px; padding:12px; border:1px solid var(--border); border-radius:10px; background:#12141a; }
.message-field-row label,.message-option-card label,.message-response-card label { margin:0 0 5px!important; font-size:.82rem!important; }
.message-field-row input,.message-option-card input,.message-option-card textarea,.message-response-card input,.message-response-card textarea,.message-response-card select { width:100%; min-width:0; }
.message-inline-check { display:flex; align-items:center; gap:6px; min-height:42px; color:var(--text-muted); font-size:.82rem; white-space:nowrap; }
.message-inline-check input { accent-color:var(--red); }
.message-remove { min-height:40px; padding:7px 10px; border:1px solid rgba(237,66,69,.45); border-radius:8px; background:rgba(237,66,69,.08); color:#ff9b9d; cursor:pointer; }
.message-response-card { padding:14px; border:1px solid var(--border); border-radius:11px; background:#12141a; }
.message-response-card > .form-grid-two,.message-response-card > .form-grid-three { margin-top:4px; }
.message-response-card h5 { margin:0 0 12px; font-size:.94rem; }
.message-response-options { display:grid; gap:10px; margin-top:12px; }
.message-option-card { padding:12px; border:1px solid #333744; border-radius:9px; background:#191c25; }
.message-option-card h6 { margin:0 0 8px; color:var(--text-muted); font-size:.84rem; }
.message-option-card .option-response-fields { margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
.message-response-embed { display:grid; gap:8px; margin-top:10px; padding:12px; border-left:3px solid var(--red); background:#191c25; }
.message-response-embed .form-grid-two { gap:10px; }
.message-publish-box { display:grid; grid-template-columns:minmax(0,1fr); }
.message-publish-box select { width:100%; }
.message-publish-box .row-actions { margin-top:14px; }
.btn-danger { border-color:rgba(237,66,69,.58); background:rgba(237,66,69,.14); color:#ffb5b6; }
.btn-danger:hover { border-color:var(--red); background:rgba(237,66,69,.24); }
#messagesLimit { margin:0 0 12px; font-size:.85rem; }
#messageListEmpty { margin:12px 0 0; font-size:.84rem; }
@media (max-width:900px) { .message-manager-layout { grid-template-columns:minmax(0,1fr); } .message-template-list { order:1; } .message-editor { order:2; } }
@media (max-width:640px) {
    .message-manager-header { flex-direction:column; }
    .message-manager-toolbar { width:100%; }
    .message-manager-toolbar input[type="search"] { flex:1; width:auto; }
    .message-editor { padding:12px; }
    .message-embed-editor,.message-responses-section,.message-publish-box { padding:12px; }
    .message-field-row { grid-template-columns:1fr; }
    .message-inline-check { min-height:30px; }
    .message-editor-heading { flex-direction:column; }
}

/* Server Tools dashboard */
.tools-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr));gap:1rem;margin-top:1.25rem;align-items:start}
.tools-card{padding:1.1rem;border:1px solid var(--border);border-radius:14px;background:var(--bg-soft);min-width:0}
.tools-card h3{margin:0 0 1rem;font-size:1.05rem}
.tools-card label{display:flex;flex-direction:column;gap:.4rem;margin:.65rem 0}
.tools-card .check{flex-direction:row;align-items:center}
.tools-card input,.tools-card textarea,.tools-card select{max-width:100%;box-sizing:border-box}
.tools-list{display:flex;flex-direction:column;gap:.6rem;margin-top:1rem;max-height:22rem;overflow:auto}
.tool-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.7rem;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,.025);min-width:0}
.tool-row>span{display:flex;flex-direction:column;gap:.25rem;min-width:0;overflow-wrap:anywhere}
.tool-row small{color:var(--text-muted);white-space:normal;overflow-wrap:anywhere}
.tool-row-actions{display:flex;gap:.4rem;flex-wrap:wrap}
.ticket-row{align-items:flex-start}
.ticket-row .link-btn{font-size:.78rem}
@media(max-width:700px){.tools-grid{grid-template-columns:1fr}.tool-row{align-items:flex-start}.tool-row-actions{flex-direction:column}}

/* Server Tools: one focused module at a time, with clear category navigation. */
.tools-tabs{display:flex;gap:.45rem;overflow-x:auto;padding:.25rem .1rem .75rem;margin:1rem 0 1.1rem;border-bottom:1px solid var(--border);scrollbar-width:thin;overscroll-behavior-x:contain}
.tools-tab{flex:0 0 auto;border:1px solid var(--border);border-radius:999px;padding:.58rem .9rem;background:var(--bg-soft);color:var(--text-muted);font:inherit;font-size:.9rem;white-space:nowrap;cursor:pointer;transition:background .16s ease,color .16s ease,border-color .16s ease,transform .16s ease}
.tools-tab:hover{color:var(--text);border-color:rgba(237,66,69,.55);transform:translateY(-1px)}
.tools-tab.active,.tools-tab[aria-selected="true"]{color:#fff;background:rgba(237,66,69,.17);border-color:var(--red);box-shadow:0 0 0 1px rgba(237,66,69,.12) inset}
.tools-tab:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.tools-grid{display:block;margin-top:0}
.tools-grid>.tools-card{max-width:100%;animation:toolsPanelIn .18s ease-out}
@keyframes toolsPanelIn{from{opacity:.55;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:640px){.tools-tabs{margin-inline:-.25rem;padding-inline:.25rem}.tools-tab{padding:.52rem .78rem;font-size:.84rem}}
@media(prefers-reduced-motion:reduce){.tools-tab,.tools-grid>.tools-card{transition:none;animation:none}}

/* Independent Server Tools pages and the free member-counter setup. */
#panel-tool-birthdays,#panel-tool-autoresponses,#panel-tool-events,#panel-tool-suggestions,#panel-tool-tickets,#panel-tool-invites,#panel-tool-counters{max-width:100%;}
.counter-global-settings{max-width:460px;padding:.9rem 1rem;border:1px solid var(--border);border-radius:12px;background:rgba(255,255,255,.025)}
.counter-global-settings label,.counter-config-card label{display:block;margin:.7rem 0 .35rem;color:var(--text-muted);font-size:.9rem}
.counter-global-settings input,.counter-config-card input:not([type="checkbox"]),.counter-config-card select{width:100%;max-width:100%;box-sizing:border-box}
.counter-global-settings .muted{margin:.55rem 0 0;font-size:.84rem}
.counter-config-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:1rem 0}
.counter-config-card{min-width:0;padding:1rem;border:1px solid var(--border);border-radius:14px;background:var(--bg-soft)}
.counter-config-card h3{margin:.1rem 0 .8rem;font-size:1rem}
.counter-config-card .toggle-row{display:flex;align-items:center;gap:.65rem;min-height:34px;color:var(--text);cursor:pointer}
.counter-config-card .toggle-row input.toggle-input{width:1px;height:1px;accent-color:var(--red)}
.counter-config-card .toggle-row .toggle-track{display:block;box-sizing:border-box;flex:0 0 44px;width:44px;min-width:44px;height:24px;min-height:24px;border-radius:999px;background:#464a55;position:relative}
.counter-config-card .toggle-row .toggle-track::after{content:"";width:18px;height:18px;background:#fff;position:absolute;top:3px;left:3px;border-radius:50%;transition:transform .2s}
.counter-config-card .toggle-row input.toggle-input:checked+.toggle-track{background:#248046}
.counter-config-card .toggle-row input.toggle-input:checked+.toggle-track::after{transform:translateX(20px)}
.counter-config-card .counter-channel-status{min-height:1.3em;margin:.75rem 0 0;overflow-wrap:anywhere;font-size:.84rem}
.counter-config-card .counter-channel-status a{color:var(--red);text-decoration:underline;text-underline-offset:2px}
@media(max-width:1000px){.counter-config-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.counter-config-list{grid-template-columns:1fr}.counter-global-settings{max-width:none}}

/* Landing refresh: clear hierarchy, useful product preview and responsive CTAs. */
.hero{position:relative;isolation:isolate;overflow:hidden;padding:clamp(4rem,8vw,7rem) 24px 3.5rem;text-align:left;background:radial-gradient(ellipse at 78% 32%,rgba(237,66,69,.12),transparent 38%),linear-gradient(180deg,rgba(255,255,255,.012),transparent)}
.hero::before{content:"";position:absolute;z-index:-1;width:440px;height:440px;right:-10rem;top:-13rem;border:1px solid rgba(237,66,69,.12);border-radius:50%;box-shadow:0 0 0 38px rgba(237,66,69,.025),0 0 0 78px rgba(237,66,69,.018)}
.hero-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);align-items:center;gap:clamp(2rem,6vw,5rem)}
.hero-copy{max-width:650px}
.hero .badge{margin-bottom:1.2rem}
.hero h1{max-width:670px;margin:0 0 1.1rem;font-size:clamp(2.5rem,5.3vw,4.25rem);line-height:1.03;letter-spacing:-.045em;text-wrap:balance}
.hero p.subtitle{max-width:590px;margin:0 0 1.7rem;font-size:clamp(1rem,1.5vw,1.13rem);line-height:1.7}
.hero .actions{justify-content:flex-start;gap:.75rem}
.hero-proofline{display:flex;flex-wrap:wrap;gap:.75rem 1.25rem;margin-top:1.4rem;color:var(--text-muted);font-size:.84rem}
.hero-proofline>span{display:inline-flex;align-items:center;gap:.5rem}
.hero-proofline i,.showcase-footer-dot{width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:#60d394;box-shadow:0 0 12px rgba(96,211,148,.45)}
.hero-showcase{position:relative;display:grid;place-items:center;min-height:340px;padding:1rem}
.showcase-window{position:relative;z-index:1;width:min(100%,440px);padding:1.15rem;border:1px solid rgba(255,255,255,.12);border-radius:20px;background:linear-gradient(145deg,rgba(30,32,42,.98),rgba(18,19,26,.96));box-shadow:0 28px 80px rgba(0,0,0,.4),0 0 60px rgba(237,66,69,.08);transform:rotate(-1deg)}
.showcase-top,.showcase-heading,.showcase-module,.showcase-footer{display:flex;align-items:center}
.showcase-top{justify-content:space-between;padding-bottom:.9rem;border-bottom:1px solid rgba(255,255,255,.08)}
.showcase-brand{display:flex;align-items:center;gap:.48rem;font-size:.76rem;font-weight:850;letter-spacing:.1em}
.showcase-brand b{display:grid;place-items:center;width:25px;height:25px;border-radius:8px;background:var(--red);color:white;font-size:.8rem}
.showcase-label{padding:.35rem .55rem;border:1px solid rgba(237,66,69,.25);border-radius:999px;color:#ff9b9d;font-size:.62rem;font-weight:750;letter-spacing:.08em}
.showcase-heading{gap:.8rem;margin:1.1rem 0}
.showcase-server-icon{display:grid;place-items:center;width:44px;height:44px;border:1px solid rgba(237,66,69,.35);border-radius:13px;background:rgba(237,66,69,.13);color:#ff8588;font-weight:850}
.showcase-heading>span:last-child{display:flex;flex-direction:column;gap:.18rem}
.showcase-heading small{color:var(--text-muted);font-size:.63rem;letter-spacing:.1em}
.showcase-heading strong{font-size:1rem}
.showcase-module-list{display:grid;gap:.55rem}
.showcase-module{gap:.7rem;min-height:53px;padding:.65rem .75rem;border:1px solid rgba(255,255,255,.075);border-radius:11px;background:rgba(255,255,255,.025);font-size:.86rem;font-weight:620}
.showcase-module-icon{display:grid;place-items:center;width:29px;height:29px;flex:0 0 29px;border-radius:9px;background:rgba(237,66,69,.12);color:#ff9496;font-size:.63rem;font-weight:800}
.showcase-arrow{margin-left:auto;color:var(--text-muted);font-size:1.2rem}
.showcase-footer{gap:.55rem;margin-top:1rem;padding-top:.85rem;border-top:1px solid rgba(255,255,255,.08);color:var(--text-muted);font-size:.75rem}
.showcase-footer-dot{width:6px;height:6px;flex-basis:6px}
.showcase-orbit{position:absolute;border:1px solid rgba(237,66,69,.15);border-radius:50%;pointer-events:none}
.showcase-orbit-one{width:300px;height:300px;right:5%;top:4%;box-shadow:0 0 0 30px rgba(237,66,69,.025)}
.showcase-orbit-two{width:170px;height:170px;left:4%;bottom:1%;border-color:rgba(255,255,255,.08)}
.capability-strip{padding:1.1rem 24px;border-top:1px solid rgba(255,255,255,.055);border-bottom:1px solid rgba(255,255,255,.055);background:rgba(255,255,255,.018)}
.capability-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem 1.5rem;flex-wrap:wrap}
.capability-label{color:var(--text-muted);font-size:.82rem;font-weight:650}
.capability-tags{display:flex;flex-wrap:wrap;gap:.5rem}
.capability-tags span{padding:.38rem .65rem;border:1px solid var(--border);border-radius:999px;background:rgba(255,255,255,.025);color:#d7d8df;font-size:.75rem}
.features{padding:clamp(3.5rem,7vw,5.5rem) 24px}
.features h2{margin-bottom:.55rem;font-size:clamp(1.8rem,3.5vw,2.35rem);letter-spacing:-.025em}
.features-subtitle{max-width:620px;margin:0 auto 2rem;color:var(--text-muted);text-align:center;line-height:1.65}
.feature-grid{gap:1rem}
.feature-card{position:relative;overflow:hidden;min-height:150px;padding:1.4rem;border-radius:16px;background:linear-gradient(145deg,rgba(28,30,39,.96),rgba(21,23,30,.96));box-shadow:0 8px 24px rgba(0,0,0,.12);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.feature-card:hover{transform:translateY(-3px);border-color:rgba(237,66,69,.45);box-shadow:0 14px 32px rgba(0,0,0,.22)}
.feature-card::after{content:"";position:absolute;width:95px;height:95px;right:-48px;top:-48px;border:1px solid rgba(237,66,69,.13);border-radius:50%;box-shadow:0 0 0 14px rgba(237,66,69,.025)}
.feature-card h3{position:relative;z-index:1;margin:0 0 .65rem;font-size:1.04rem}
.feature-card p{position:relative;z-index:1;line-height:1.65}
.landing-steps{padding:clamp(3.5rem,7vw,5rem) 24px;background:linear-gradient(180deg,rgba(255,255,255,.018),transparent)}
.section-heading{max-width:700px;margin:0 auto 2rem;text-align:center}
.section-eyebrow{display:inline-block;color:#ff999b;font-size:.72rem;font-weight:800;letter-spacing:.13em}
.section-heading h2,.landing-cta h2{margin:.55rem 0 .6rem;font-size:clamp(1.7rem,3.4vw,2.3rem);letter-spacing:-.025em;text-wrap:balance}
.section-heading p{margin:0;color:var(--text-muted);line-height:1.65}
.steps-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.step-card{min-width:0;padding:1.35rem;border:1px solid var(--border);border-radius:16px;background:rgba(255,255,255,.025)}
.step-number{display:grid;place-items:center;width:38px;height:38px;margin-bottom:1rem;border:1px solid rgba(237,66,69,.35);border-radius:12px;background:rgba(237,66,69,.12);color:#ff999b;font-size:.78rem;font-weight:850}
.step-card h3{margin:0 0 .45rem;font-size:1rem}
.step-card p{margin:0;color:var(--text-muted);font-size:.9rem;line-height:1.65}
.landing-cta{padding:1rem 24px 3rem}
.landing-cta-inner{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:clamp(1.5rem,4vw,2.5rem);border:1px solid rgba(237,66,69,.24);border-radius:20px;background:radial-gradient(ellipse at 15% 0%,rgba(237,66,69,.16),transparent 48%),linear-gradient(120deg,#191b23,#14151b);box-shadow:0 20px 55px rgba(0,0,0,.22)}
.landing-cta-inner>div:first-child{max-width:610px}
.landing-cta h2{margin:.45rem 0;font-size:clamp(1.5rem,3vw,2.1rem)}
.landing-cta p{margin:0;color:var(--text-muted);line-height:1.6}
.landing-cta-actions{display:flex;flex-wrap:wrap;gap:.65rem;flex:0 0 auto}

/* Consistent control sizing, spacing and feedback across the dashboard. */
.btn{min-height:42px;justify-content:center;text-align:center;line-height:1.25;white-space:normal;transition:transform .16s ease,background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease}
.btn-primary{box-shadow:0 7px 18px rgba(237,66,69,.16)}
.btn-primary:hover{box-shadow:0 9px 23px rgba(237,66,69,.24)}
.btn-ghost:hover{background:rgba(255,255,255,.045)}
.row-actions{display:flex;align-items:center;flex-wrap:wrap;gap:.65rem;margin-top:14px}
.msg-line{min-height:1.35em;margin:10px 0 0;padding-inline:2px;line-height:1.45;overflow-wrap:anywhere}
.tool-row{gap:1rem;padding:.8rem .85rem}
.tool-row-actions .btn{min-width:108px}
.counter-config-card .toggle-row{justify-content:space-between;text-align:left}

@media(max-width:900px){
    .hero-layout{grid-template-columns:1fr;gap:2rem}
    .hero-copy{max-width:760px;margin:0 auto;text-align:center}
    .hero h1,.hero p.subtitle{margin-left:auto;margin-right:auto}
    .hero .actions,.hero-proofline{justify-content:center}
    .hero-showcase{width:min(100%,600px);min-height:315px;margin:0 auto}
    .capability-inner{justify-content:center;text-align:center}
    .landing-cta-inner{align-items:flex-start;flex-direction:column}
}
@media(max-width:640px){
    .hero{padding:3.5rem 16px 2.5rem}
    .hero h1{font-size:clamp(2.25rem,10vw,3.2rem)}
    .hero .actions{align-items:stretch;flex-direction:column}
    .hero .actions .btn{width:100%}
    .hero-proofline{align-items:center;flex-direction:column}
    .hero-showcase{min-height:290px;padding:.35rem}
    .showcase-window{padding:.9rem;transform:none}
    .capability-strip{padding:1rem 16px}
    .capability-tags{justify-content:center}
    .features,.landing-steps{padding:3rem 16px}
    .feature-grid,.steps-grid{grid-template-columns:1fr}
    .feature-card{min-height:0}
    .landing-cta{padding:0 16px 2.5rem}
    .landing-cta-actions{width:100%;flex-direction:column}
    .landing-cta-actions .btn{width:100%}
    .row-actions .btn{max-width:100%}
    .tool-row-actions .btn{min-width:0}
}
@media(prefers-reduced-motion:reduce){.feature-card,.showcase-window{transition:none;transform:none}}

/* Toggle rows inside the generic stacked tool forms must remain horizontal. */
.counter-config-card .toggle-row{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between}
.counter-config-card .toggle-row .toggle-track{flex:0 0 44px;height:24px;min-height:24px;align-self:center}

/* Keep the sidebar's scroll container bounded by its viewport-sized grid track. */
.server-sidebar{min-height:0;overscroll-behavior-y:contain}


/* Sidebar drawer: remains on the side and slides in from the left at every viewport size. */
.guild-view-nav { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.guild-view-nav .back-link { margin-bottom:10px; }
.guild-view-nav .sidebar-toggle { margin:0 0 10px auto; position:relative; z-index:4; }
.sidebar-toggle { display:inline-flex; align-items:center; justify-content:center; gap:8px; background:var(--bg-soft); color:var(--text); border:1px solid var(--border); border-radius:9px; padding:9px 13px; cursor:pointer; font:inherit; }
.sidebar-toggle:hover { border-color:var(--red); }
.sidebar-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
.server-dashboard { display:block; margin-top:8px; }
.server-sidebar { position:fixed; left:0; top:0; bottom:0; width:min(320px,86vw); height:100vh; height:100dvh; max-height:100dvh; padding:max(10px,env(safe-area-inset-top)) 8px max(18px,env(safe-area-inset-bottom)) 10px; border-radius:0 14px 14px 0; transform:translateX(-105%); visibility:hidden; transition:transform .28s cubic-bezier(.2,.8,.2,1),visibility 0s linear .28s; z-index:70; }
.server-sidebar.open { transform:translateX(0); visibility:visible; transition:transform .28s cubic-bezier(.2,.8,.2,1); }
.server-sidebar .sidebar-heading .icon-button { display:inline-flex; }
.sidebar-backdrop:not(.hidden) { display:block; position:fixed; inset:0; z-index:65; background:rgba(0,0,0,.62); animation:sidebar-backdrop-in .2s ease both; }
@keyframes sidebar-backdrop-in { from { opacity:0; } to { opacity:1; } }
body.sidebar-open { overflow:hidden; }
.sidebar-item { gap:10px; }
.sidebar-icon { display:inline-flex; width:24px; flex:0 0 24px; justify-content:center; font-size:1.08rem; line-height:1; }
.sidebar-item > span:last-child { min-width:0; }
.sidebar-group-title { display:flex; align-items:center; gap:5px; }
.guild-view-nav .sidebar-toggle:focus-visible,.sidebar-item:focus-visible,.icon-button:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
@media(max-width:800px) {
    .server-dashboard { display:block; }
    .sidebar-toggle { display:inline-flex; }
    .server-sidebar { width:min(320px,86vw); height:100dvh; max-height:100dvh; }
}
@media(prefers-reduced-motion:reduce) {
    .server-sidebar,.sidebar-backdrop:not(.hidden) { transition:none; animation:none; }
}

/* Pure dark / OLED palette; the default Velo theme keeps its charcoal-and-red identity. */
html[data-theme="dark"] { --bg:#030405; --bg-soft:#090b0e; --card:#101216; --border:#20242b; --text:#f5f6f8; --text-muted:#a0a5af; color-scheme:dark; }
html[data-theme="dark"] body { background:var(--bg); color:var(--text); }
html[data-theme="dark"] header.site-header { background:rgba(3,4,5,.94); }
html[data-theme="dark"] .sidebar-heading { background:var(--bg-soft); }
html[data-theme="dark"] .sidebar-item { color:#d5d8df; }
html[data-theme="dark"] .sidebar-item:hover,html[data-theme="dark"] .sidebar-item.active { background:#191c22; color:#fff; }
html[data-theme="dark"] .metric-card,html[data-theme="dark"] .activity-chart-card,html[data-theme="dark"] .invite-ranking-card,html[data-theme="dark"] .level-role-row,html[data-theme="dark"] .message-template-list,html[data-theme="dark"] .message-editor,html[data-theme="dark"] .message-embed-editor,html[data-theme="dark"] .message-responses-section,html[data-theme="dark"] .message-publish-box,html[data-theme="dark"] .security-group,html[data-theme="dark"] .settings-group { background:var(--card); }
html[data-theme="dark"] .server-content select,html[data-theme="dark"] .server-content textarea,html[data-theme="dark"] .server-content input[type="text"],html[data-theme="dark"] .server-content input[type="number"],html[data-theme="dark"] .server-content input[type="url"],html[data-theme="dark"] .message-manager-toolbar input[type="search"] { background:#080a0d; color:var(--text); }
html[data-theme="dark"] .message-list-item,html[data-theme="dark"] .message-field-row,html[data-theme="dark"] .message-option-card,html[data-theme="dark"] .message-response-card { background:#0c0e12; color:var(--text); }
.theme-v-mark { display:grid; place-items:center; width:20px; height:20px; border:1px solid var(--red); border-radius:6px; color:var(--red); font-weight:900; font-size:.8rem; }


/* Navigation alignment and overlay stacking refinement. */
.guild-view-nav { justify-content:space-between; }
.guild-view-nav .sidebar-toggle { margin:0 0 10px; position:relative; z-index:4; }
.guild-view-nav-links { display:flex; align-items:center; justify-content:flex-end; gap:16px; margin-left:auto; }
.guild-view-nav-links .back-link { margin-bottom:10px; }
body.sidebar-open .guild-view-nav .sidebar-toggle { z-index:4; pointer-events:none; }
@media(max-width:560px) {
    .guild-view-nav { align-items:center; }
    .guild-view-nav-links { gap:10px; flex-wrap:wrap; }
}

/* ── Tickets (tickets-ui.js) ── */
.tk-section h2{margin:0 0 4px}.tk-section h3{margin:0 0 10px;font-size:1rem}.tk-section h4{margin:16px 0 8px}
.tk-card{background:var(--surface-2,rgba(255,255,255,.04));border:1px solid var(--border,rgba(255,255,255,.1));border-radius:12px;padding:16px;margin:12px 0}
.tk-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}.tk-grid>.tk-card{margin:0}
.tk-field{display:flex;flex-direction:column;gap:6px;margin:10px 0}.tk-label{font-weight:600}.tk-desc{margin:0;font-size:.85rem;opacity:.7}
.tk-field input[type=text],.tk-field textarea,.tk-field select,.tk-card select{width:100%;box-sizing:border-box}
.tk-switch .toggle-row{display:flex;justify-content:space-between;align-items:center;gap:12px}.tk-switch .toggle-row>span:first-child{display:flex;flex-direction:column;gap:2px}
.tk-stepper{display:flex;gap:6px;align-items:center}.tk-stepper .tk-num{width:90px;text-align:center}
.tk-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:14px 0}
.tk-stat{display:flex;flex-direction:column;align-items:center;padding:16px;border-radius:12px;border:1px solid var(--border,rgba(255,255,255,.1));background:var(--surface-2,rgba(255,255,255,.04))}
.tk-stat-n{font-size:1.8rem;font-weight:700}.tk-stat-l{font-size:.85rem;opacity:.7;text-align:center}
.tk-nav-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin-top:14px}
.tk-nav-card{display:flex;gap:12px;align-items:center;text-align:left;padding:14px;border-radius:12px;border:1px solid var(--border,rgba(255,255,255,.1));background:var(--surface-2,rgba(255,255,255,.04));color:inherit;cursor:pointer;font:inherit}
.tk-nav-card:hover{border-color:var(--accent,#5865f2)}.tk-nav-card small{display:block;opacity:.7}.tk-nav-icon{font-size:1.6rem}
.tk-panel-head{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.tk-badge{margin-left:8px;padding:2px 8px;border-radius:99px;background:rgba(255,160,0,.2);font-size:.75rem}
.tk-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:12px 0}
.tk-step{display:flex;gap:10px;align-items:center;text-align:left;padding:10px;border-radius:10px;border:1px solid var(--border,rgba(255,255,255,.1));background:transparent;color:inherit;cursor:pointer;font:inherit}
.tk-step small{display:block;opacity:.65}.tk-step.active{border-color:var(--accent,#5865f2);background:rgba(88,101,242,.15)}
.tk-step-n{display:inline-flex;width:26px;height:26px;border-radius:50%;align-items:center;justify-content:center;background:var(--accent,#5865f2);color:#fff;font-weight:700;flex:none}
.tk-actions{margin-top:14px;display:flex;gap:8px;flex-wrap:wrap}
.tk-q{border:1px dashed var(--border,rgba(255,255,255,.18));border-radius:10px;padding:12px;margin:8px 0}.tk-inline{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.tk-btn-editor{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.tk-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.tk-chip{display:inline-flex;gap:6px;align-items:center;padding:3px 10px;border-radius:99px;background:rgba(88,101,242,.2)}
.tk-chip button{background:none;border:0;color:inherit;cursor:pointer}
.tk-table-wrap{overflow-x:auto}.tk-table{width:100%;border-collapse:collapse}.tk-table th,.tk-table td{padding:8px 10px;text-align:left;border-bottom:1px solid var(--border,rgba(255,255,255,.1));white-space:nowrap}
.msg-line.ok{color:#3ba55d}.msg-line.err{color:#ed4245}
/* Tickets · mensajes y componentes */
.tk-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start;margin:12px 0}
@media(max-width:900px){.tk-split{grid-template-columns:1fr}}
.tk-msg-list{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.tk-msg-row{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:center;padding:12px 14px;border:1px solid var(--border,rgba(255,255,255,.1));border-radius:12px;background:var(--surface-2,rgba(255,255,255,.04))}
.tk-msg-meta{display:flex;flex-direction:column;gap:2px}.tk-badge.ok{background:rgba(59,165,93,.25)}
.tk-pv{background:#1e1f22;border-radius:12px;padding:14px;color:#dbdee1}
.tk-pv-embed{border-left:4px solid #5865f2;background:#2b2d31;border-radius:6px;padding:10px 14px;display:flex;flex-direction:column;gap:6px}
.tk-pv-title{font-size:1rem}.tk-pv-text{margin:0;font-size:.9rem;white-space:pre-wrap;word-break:break-word}.tk-pv-img{max-width:100%;border-radius:6px}.tk-pv-foot{opacity:.65}
.tk-pv-rows{display:flex;flex-direction:column;gap:8px;margin-top:10px}.tk-pv-btnrow{display:flex;gap:8px;flex-wrap:wrap}
.tk-pv-btn,.tk-colorchip{border:0;border-radius:4px;padding:7px 14px;color:#fff;font:inherit;font-weight:600;cursor:pointer;outline-offset:2px}
.tk-c-primary{background:#5865f2}.tk-c-secondary{background:#4e5058}.tk-c-success{background:#248046}.tk-c-danger{background:#da373c}
.tk-pv-btn.sel,.tk-pv-menu.sel,.tk-pv-opt.sel,.tk-colorchip.active{outline:2px solid #fff}
.tk-pv-menu{display:flex;justify-content:space-between;width:100%;border:1px solid #1e1f22;background:#111214;color:#dbdee1;padding:9px 12px;border-radius:6px;font:inherit;cursor:pointer;text-align:left}
.tk-pv-opts{display:flex;flex-direction:column;margin-top:4px;background:#2b2d31;border-radius:6px;overflow:hidden}
.tk-pv-opt{display:flex;gap:10px;align-items:center;background:none;border:0;color:inherit;padding:8px 12px;text-align:left;font:inherit;cursor:pointer}.tk-pv-opt:hover{background:#35373c}.tk-pv-opt small{display:block;opacity:.65}
.tk-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.tk-tool{display:inline-flex;gap:6px;align-items:center;padding:7px 12px;border-radius:99px;border:1px solid var(--border,rgba(255,255,255,.2));background:transparent;color:inherit;font:inherit;cursor:pointer}.tk-tool.active{background:rgba(88,101,242,.25);border-color:#5865f2}
.tk-colorchips{display:flex;gap:8px;flex-wrap:wrap}.tk-quick{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}.tk-quick-b{border:1px solid var(--border,rgba(255,255,255,.15));background:transparent;border-radius:6px;padding:3px 7px;cursor:pointer;font-size:1.05rem}
.tk-actions>.btn{flex:1 1 140px;min-width:0}
.tk-pv-btnrow>.tk-pv-btn{flex:1 1 120px;min-width:0;min-height:38px}
.tk-staff-metrics{display:grid;gap:8px}.tk-staff-row{display:grid;grid-template-columns:minmax(120px,1fr) auto auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--border,rgba(255,255,255,.1));border-radius:9px}.tk-staff-row span{font-size:.88rem;opacity:.85}
.profile-preference-status{display:block;min-height:1.25em;margin:8px 0;color:var(--text-muted);font-size:.8rem;line-height:1.35}
@media(max-width:560px){.tk-staff-row{grid-template-columns:1fr;gap:4px}.tk-actions>.btn{flex-basis:100%}}
