:root {
  --bg-0: #121317; --bg-1: #1a1c21; --bg-2: #22252b; --bg-3: #2b2e36; --line: #353944;
  --tx: #ecedf1; --tx-2: #a3a7b3;
  --mg: #8b5cf6; --mg-light: #b79cff; --mg-dark: #5b2fc4; --mg-deep: #2e1a63;
  --r: 10px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; color: var(--tx); font: 15px/1.55 'Hanken Grotesk', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, .16), transparent 60%), linear-gradient(160deg, #101114 0%, #1d1f25 55%, #17181c 100%) fixed;
}
h1, h2, h3 { font-family: 'Bricolage Grotesque', 'Hanken Grotesk', sans-serif; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: 2rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
a { color: var(--mg-light); text-decoration: none; } a:hover { color: #fff; }
.muted { color: var(--tx-2); } .small { font-size: .8em; } .mt { margin-top: 2rem; }
:focus-visible { outline: 2px solid var(--mg-light); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--line); background: rgba(18, 19, 23, .75); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.brand { font: 700 1.25rem 'Bricolage Grotesque', sans-serif; color: var(--tx); display: flex; align-items: center; gap: 10px; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--mg-light), var(--mg-dark)); transform: rotate(12deg); }
.top-r { display: flex; align-items: center; gap: 12px; }
.lang { font-size: .75rem; padding: 2px 7px; border-radius: 6px; color: var(--tx-2); } .lang.on { background: var(--bg-3); color: var(--tx); }
.chip { font-size: .78rem; padding: 3px 10px; border-radius: 99px; background: var(--mg-deep); color: var(--mg-light); }
.ava { width: 28px; height: 28px; border-radius: 50%; } .uname { font-weight: 600; }
@media (max-width: 700px) { .uname { display: none; } }

.btn { display: inline-block; cursor: pointer; border: 0; border-radius: 8px; padding: 8px 16px; font: 600 .9rem 'Hanken Grotesk', sans-serif; color: #fff; background: linear-gradient(135deg, var(--mg), var(--mg-dark)); transition: filter .15s; }
.btn:hover { filter: brightness(1.15); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--tx); } .btn.ghost:hover { border-color: var(--mg); }
.btn.small { padding: 4px 10px; font-size: .8rem; } .btn.danger { background: var(--mg-deep); color: var(--mg-light); }
.btn.big { padding: 13px 26px; font-size: 1.02rem; } .w-full { width: 100%; }

.hero { min-height: calc(100vh - 54px); display: grid; place-items: center; padding: 24px; }
.hero-in { max-width: 640px; } .hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.02; }
.lead { font-size: 1.15rem; color: var(--tx-2); max-width: 52ch; } .cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 1.6rem 0 1rem; } .fine { font-size: .8rem; color: var(--tx-2); max-width: 60ch; }
.alert { background: var(--mg-deep); border: 1px solid var(--mg-dark); padding: 10px 14px; border-radius: var(--r); }

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 54px); }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .side { flex-direction: row !important; overflow-x: auto; position: static !important; height: auto !important; } .side .sep { display: none; } .side a { white-space: nowrap; } }
.side { background: rgba(18, 19, 23, .55); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto; }
.side a { color: var(--tx-2); padding: 7px 10px; border-radius: 8px; display: flex; align-items: center; gap: 8px; border-left: 3px solid transparent; }
.side a:hover { background: var(--bg-2); color: var(--tx); } .side a.on { color: #fff; background: var(--bg-2); border-left-color: var(--mg); }
.side .srv { color: var(--tx); margin-bottom: 8px; padding: 6px 10px 12px; border-bottom: 1px solid var(--line); border-radius: 0; border-left: 0; }
.srv img, .srv .ph, .gi { width: 34px; height: 34px; border-radius: 10px; } .ph { display: grid; place-items: center; background: var(--bg-3); font-weight: 700; }
.sep { margin: 14px 10px 4px; font-size: .78rem; color: var(--tx-2); }


.page { padding: 28px 32px 90px; max-width: 980px; width: 100%; } .page.wide { max-width: 1500px; } .page.narrow { max-width: 560px; margin: 8vh auto; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.list-rows { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); color: var(--tx); }
.lrow.link:hover { border-color: var(--mg-dark); background: var(--bg-2); } .grow { flex: 1; }
.state { font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: var(--bg-3); color: var(--tx-2); } .state.on { background: var(--mg-deep); color: var(--mg-light); }

.panel { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.grp { margin: 1.8rem 0 .6rem; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--mg-light); font-size: 1.05rem; }
.field { margin: 0 0 14px; max-width: 720px; } .field > .lab { display: block; font-weight: 600; margin-bottom: 4px; } .hint { color: var(--tx-2); font-size: .82rem; margin-top: 3px; }
.inp, .field input[type=text], .field input[type=number], .field textarea, .field select, select.inp {
  width: 100%; background: var(--bg-0); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit;
}
.field textarea { min-height: 90px; resize: vertical; } .field input[type=color] { width: 54px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-0); }
.inp:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--mg); outline: none; } .w-s { max-width: 260px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; } .chip2 { display: inline-flex; gap: 6px; align-items: center; padding: 3px 4px 3px 10px; background: var(--bg-3); border-radius: 99px; font-size: .85rem; }
.chip2 button { background: none; border: 0; color: var(--tx-2); cursor: pointer; font-size: 1rem; line-height: 1; } .chip2 button:hover { color: var(--mg-light); }
.multi { display: flex; flex-wrap: wrap; gap: 4px 14px; } .multi label { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: .88rem; accent-color: var(--mg); }

details.item { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; border-left: 3px solid var(--mg-dark); }
details.item > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; } details.item > summary::-webkit-details-marker { display: none; }
details.item > summary::after { content: '▾'; color: var(--tx-2); } details.item[open] > summary::after { content: '▴'; }
.item-body { padding: 4px 16px 14px; border-top: 1px solid var(--line); padding-top: 14px; } .item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.item details.item { background: var(--bg-2); }

.savebar { position: fixed; right: 0; bottom: 0; left: 250px; padding: 12px 32px; background: rgba(18, 19, 23, .9); border-top: 1px solid var(--line); backdrop-filter: blur(8px); } @media (max-width: 860px) { .savebar { left: 0; } }
.toast { position: fixed; right: 24px; bottom: 76px; background: var(--bg-3); border: 1px solid var(--mg-dark); padding: 10px 16px; border-radius: 10px; z-index: 50; } .toast.err { background: var(--mg-deep); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-1); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; } th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; } th { color: var(--tx-2); font-weight: 600; background: var(--bg-2); } tr:last-child td { border-bottom: 0; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

.builder { display: grid; grid-template-columns: 230px minmax(420px, 1fr) 380px; gap: 14px; align-items: start; } @media (max-width: 1200px) { .builder { grid-template-columns: 1fr; } }
.b-list #msgList { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; } .b-list button.it { text-align: left; background: none; border: 0; color: var(--tx-2); padding: 7px 10px; border-radius: 8px; cursor: pointer; font: inherit; } .b-list button.it:hover, .b-list button.it.on { background: var(--bg-3); color: #fff; }
.b-edit .row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; } .b-edit .row > * { flex: 1; } .b-edit .row > .btn { flex: none; }
.block { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; } .block .bh { display: flex; justify-content: space-between; font-size: .8rem; color: var(--tx-2); margin-bottom: 6px; }
.b-edit input[type=text], .b-edit textarea, .b-edit select { width: 100%; background: var(--bg-0); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; margin-bottom: 6px; } .b-edit textarea { min-height: 80px; resize: vertical; }
.discord { background: #313338; border-radius: 8px; padding: 14px; color: #dbdee1; font-size: .92rem; } .discord .cont { background: #2b2d31; border-radius: 8px; border-left: 4px solid var(--mg); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.discord .cont hr { border: 0; border-top: 1px solid #3f4147; width: 100%; margin: 4px 0; } .discord img { max-width: 100%; border-radius: 8px; } .discord .pb { white-space: pre-wrap; word-break: break-word; }
.discord .lb { display: inline-block; background: #4e5058; color: #fff; border-radius: 6px; padding: 5px 12px; font-size: .82rem; margin-right: 6px; } .discord .emb { background: #2b2d31; border-left: 4px solid var(--mg); border-radius: 6px; padding: 10px 14px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- icons ---- */
.i { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.17em; }
.btn { display: inline-flex; align-items: center; gap: 8px; } .btn.small .i { width: 1em; height: 1em; }
.mi { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--mg-deep); color: var(--mg-light); flex: none; } .mi .i { width: 20px; height: 20px; }
h1 .mi { margin-right: 6px; vertical-align: middle; }
.side a .i { width: 1.05em; height: 1.05em; color: var(--mg-light); opacity: .85; } .side a.on .i { opacity: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; } .lo { display: inline-flex; align-items: center; gap: 6px; }
.i.on { color: var(--mg-light); } td .i { width: .9em; height: .9em; }

/* ---- toggle ---- */
.tgl { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; position: relative; user-select: none; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tgl .knob { width: 42px; height: 24px; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--line); position: relative; flex: none; transition: background .15s, border-color .15s; }
.tgl .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #c4c7d1; transition: transform .15s, background .15s; }
.tgl input:checked + .knob { background: var(--mg); border-color: var(--mg-light); } .tgl input:checked + .knob::after { transform: translateX(18px); background: #fff; }
.tgl input:focus-visible + .knob { outline: 2px solid var(--mg-light); outline-offset: 2px; } .tgl input:disabled + .knob { opacity: .5; cursor: not-allowed; }
.tgl .tx { font-weight: 600; } .tgl.lg .knob { width: 50px; height: 28px; } .tgl.lg .knob::after { width: 22px; height: 22px; } .tgl.lg input:checked + .knob::after { transform: translateX(22px); }
.field.f-toggle { margin-bottom: 12px; } .field.f-toggle .hint { margin: 4px 0 0 54px; }

/* ---- misc ---- */
.alert.ok { background: #231a45; border-color: var(--mg-dark); color: #e4d9ff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } @media (max-width: 760px) { .two { grid-template-columns: 1fr; } } .two .field { margin: 0; }
.colorrow { display: flex; align-items: center; gap: 10px; } .colorrow input[type=color] { width: 54px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-0); cursor: pointer; } .colorrow code { color: var(--tx-2); }
.field .optcolor { display: flex; align-items: center; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; } @media (max-width: 760px) { .seg { grid-template-columns: 1fr; } }
.seg label { cursor: pointer; } .seg input { position: absolute; opacity: 0; } .seg span { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-0); } .seg small { display: block; color: var(--tx-2); margin-top: 2px; }
.seg input:checked + span { border-color: var(--mg); background: #1f1840; box-shadow: inset 3px 0 0 var(--mg); } .seg input:focus-visible + span { outline: 2px solid var(--mg-light); }
.acts { display: flex; gap: 6px; } .small-note { font-size: .8rem; }
.vars { color: var(--tx-2); font-size: .8rem; margin-top: 4px; } .vars code { background: var(--bg-3); border-radius: 5px; padding: 1px 5px; margin-right: 3px; display: inline-block; cursor: pointer; } .vars code:hover { color: #fff; background: var(--mg-deep); }
.item-actions .btn { display: inline-flex; }
.ico-only { padding: 6px 9px; }

/* ---- feedback / admin bots ---- */
.stars { display: inline-flex; gap: 1px; vertical-align: middle; } .stars .i { width: 1em; height: 1em; } .stars .i.on { color: var(--mg-light); } .stars .i.off { color: var(--bg-3); }
.tablewrap.sm { max-width: 560px; }
.form-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: end; margin-top: 12px; } @media (max-width: 860px) { .form-row { grid-template-columns: 1fr; } }
.form-row label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .85rem; } .form-row input { width: 100%; background: var(--bg-0); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.state.err { background: #3a1330; color: #ff9bb8; } .note { color: var(--tx-2); font-size: .85rem; margin: 6px 0 0; }
.panel + .panel { margin-top: 16px; }
.top .brand { flex: none; }

/* long server names: icon left, name (max 2 lines) + plan badge underneath */
.side .srv { display: flex; align-items: center; gap: 12px; }
.side .srv img, .side .srv .ph { flex: none; width: 40px; height: 40px; }
.srvtxt { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; flex: 1; }
.srvtxt strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.25; font-size: .95rem; }
.srvtxt .plan { flex: none; }
.pagehead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; min-width: 0; }
.pagehead .gi { flex: none; width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.pagehead .gtxt { min-width: 0; flex: 1; }
.pagehead h1 { margin: 0 0 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; }
.pagehead .plan { display: inline-block; }
.accessbox .roles-pick { margin-top: 6px; }
.accessnote { display: flex; gap: 8px; align-items: center; color: var(--tx-2); font-size: .9rem; margin: 8px 0; }
.switchrow { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; cursor: pointer; } .switchrow input { width: 18px; height: 18px; accent-color: var(--mg); }

/* logs */
.loghead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; } .loghead h1 { margin-bottom: 4px; } .loghead p { margin: 0 0 12px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.stat { background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 110px; } .stat .n { font-size: 1.5rem; font-weight: 700; color: var(--mg-light); line-height: 1.1; } .stat .l { font-size: .78rem; color: var(--tx-2); }
.logfilter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .logfilter .inp { flex: 1; min-width: 200px; max-width: 420px; }
.facets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.facet { padding: 5px 12px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); color: var(--tx-2); font-size: .84rem; text-decoration: none; } .facet b { color: var(--tx); margin-left: 4px; font-weight: 600; }
.facet:hover { border-color: var(--mg-dark); color: var(--tx); } .facet.on { background: var(--mg-deep); border-color: var(--mg); color: #fff; }
.av { width: 24px; height: 24px; border-radius: 50%; flex: none; object-fit: cover; background: var(--bg-3); } .av.ph { display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--tx-2); }
.usr { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; } .usr span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .usrs { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.badge, .mbadge, .abadge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; background: var(--bg-3); color: var(--tx-2); }
.tone-red { background: #3a1320; color: #ff8aa5; } .tone-orange { background: #3b2410; color: #ffb36b; } .tone-yellow { background: #38310f; color: #f2dc6b; } .tone-green { background: #12301d; color: #6ee79a; } .tone-grey { background: var(--bg-3); color: var(--tx-2); }
.facet.tone-red b, .facet.tone-green b { color: inherit; }
.logtable td { vertical-align: middle; } .logtable .num { font-weight: 700; color: var(--mg-light); font-variant-numeric: tabular-nums; } .logtable td.c-text { max-width: 340px; overflow-wrap: anywhere; }
.logtable time, .tl time { color: var(--tx-2); white-space: nowrap; font-size: .85rem; }
details.more summary { cursor: pointer; list-style: none; } details.more summary::-webkit-details-marker { display: none; } details.more div { margin-top: 6px; padding: 8px 10px; background: var(--bg-2); border-radius: 8px; white-space: pre-wrap; }
.empty { padding: 28px; text-align: center; color: var(--tx-2); background: var(--bg-1); border: 1px dashed var(--line); border-radius: var(--r); }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl { background: var(--bg-1); border: 1px solid var(--line); border-left: 3px solid var(--mg-dark); border-radius: 12px; padding: 12px 16px; }
.tl.act-enable { border-left-color: #3ecf74; } .tl.act-disable, .tl.act-delete { border-left-color: #ff6b8b; } .tl.act-update, .tl.act-settings, .tl.act-access { border-left-color: var(--mg); }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .tl-who { min-width: 0; } .tl-head .grow { margin-left: auto; }
.mbadge { background: var(--mg-deep); color: #e4d6ff; }
.a-enable { background: #12301d; color: #6ee79a; } .a-disable, .a-delete { background: #3a1320; color: #ff8aa5; } .a-update, .a-settings, .a-access, .a-create { background: #251a47; color: #c9afff; } .a-action, .a-post, .a-restart { background: #38310f; color: #f2dc6b; }
.tl-note { margin: 8px 0 0; color: var(--tx-2); font-size: .9rem; }
.tl details { margin-top: 8px; } .tl summary { cursor: pointer; color: var(--tx-2); font-size: .85rem; }
.diff { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.diff li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 10px; background: var(--bg-2); border-radius: 8px; font-size: .86rem; }
.diff .k { font-weight: 600; min-width: 160px; } .diff .from { color: #ff9bb0; text-decoration: line-through; text-decoration-color: #ff9bb066; overflow-wrap: anywhere; } .diff .to { color: #7ee8a6; overflow-wrap: anywhere; } .diff .arrow { color: var(--tx-2); }


.acts { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.transcript { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; max-height: 560px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.5; color: var(--tx-2); }
.stat .n.usr { font-size: 1rem; color: var(--tx); display: inline-flex; gap: 8px; align-items: center; }

/* round 7: copy-id button, remaining time, exact time line */
.copyid { background: none; border: 0; cursor: pointer; color: var(--muted, #9a8fb5); padding: 2px 4px; margin-left: 4px; border-radius: 6px; vertical-align: middle; line-height: 0; }
.copyid svg { width: 14px; height: 14px; fill: currentColor; } .copyid:hover { color: inherit; background: rgba(139,92,246,.18); } .copyid.done { color: #38e02c; }
.forever { font-size: 1.25rem; line-height: 1; } time.until { white-space: nowrap; }
.abs { font-size: .72rem; opacity: .6; white-space: nowrap; }
