/* Pluto dashboard. One dark, matte look: flat panels, thin borders, one accent colour. */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/assets/fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/assets/fonts/Poppins-Medium.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/assets/fonts/Poppins-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("/assets/fonts/Poppins-Bold.ttf") format("truetype"); }

:root {
  --bg: #0b0d13; --surface: #10131b; --raised: #161a25; --hover: #1c2130; --line: #232838; --line-2: #333a4f;
  --text: #eef0f6; --muted: #979eb4; --faint: #646b83;
  --accent: #5b8cff; --accent-2: #8a6bff; --accent-soft: rgba(91, 140, 255, .14);
  --ok: #3ecf8e; --ok-soft: rgba(62, 207, 142, .13); --warn: #f5b83d; --warn-soft: rgba(245, 184, 61, .12);
  --danger: #ff5d6c; --danger-soft: rgba(255, 93, 108, .12);
  --radius: 14px; --radius-s: 10px; --side: 268px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(91, 140, 255, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }
.noscript { padding: 40px; text-align: center; }

/* ── first paint / sign-in ── */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 85% -10%, rgba(91, 140, 255, .16), transparent 60%), radial-gradient(700px 480px at 0% 110%, rgba(138, 107, 255, .13), transparent 60%), var(--bg); }
.gate-card { width: min(480px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 34px; box-shadow: var(--shadow); }
.gate-card h1 { font-size: 22px; font-weight: 700; margin: 18px 0 6px; }
.gate-card > p { color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; }
.steps b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--accent-soft); color: var(--accent); }
.steps code, .kbd { font: 600 12.5px ui-monospace, Consolas, monospace; background: #0b0d13; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; color: var(--text); }
.gate-note { margin-top: 18px; font-size: 12.5px; color: var(--faint); }
.gate-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ── brand ── */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #1b2440, #1c1a36); border: 1px solid var(--line-2); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--faint); letter-spacing: 1.6px; text-transform: uppercase; }

/* ── frame ── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.side-top { padding: 20px 18px 14px; }
.server { margin: 0 12px 6px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-s); }
.server img, .avatar { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: var(--hover); flex: none; }
.avatar.round { border-radius: 50%; }
.avatar.letter { display: grid; place-items: center; font-weight: 600; color: var(--muted); }
.server .who { min-width: 0; }
.server-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-meta { font-size: 12px; color: var(--muted); }
.nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--faint); padding: 16px 10px 7px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border: 0; background: none; border-radius: 9px; color: var(--muted); text-align: left; position: relative; }
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--text); font-weight: 500; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.side-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--muted); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: rgba(11, 13, 19, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.crumbs { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--text); font-weight: 600; }
.btn.menu-btn { display: none; }
.content { padding: 28px 32px 120px; width: 100%; max-width: 1080px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(91, 140, 255, .28); flex: none; }
.page-head h1 { font-size: 22px; font-weight: 700; line-height: 1.25; }
.page-head p { color: var(--muted); margin-top: 3px; max-width: 640px; }
.page-head .grow { flex: 1; min-width: 0; }

/* ── pieces ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head p { color: var(--muted); font-size: 13px; }
.card-head .grow { flex: 1; min-width: 0; }
.card-body { padding: 6px 20px; }
.card-body.pad { padding: 18px 20px; }
.row { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 8px 28px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.row:last-child { border-bottom: 0; }
.row.off { opacity: .45; pointer-events: none; }
.row-label b { display: block; font-weight: 500; }
.row-label small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.row-control { min-width: 0; }
.row.wide { grid-template-columns: minmax(0, 1fr); }
.err { color: var(--danger); font-size: 12.5px; margin-top: 6px; display: none; }
.row.invalid .err { display: block; }
.row.invalid .input, .row.invalid .pick-btn, .row.invalid .tags { border-color: var(--danger); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #6d99ff; }
.btn.danger { background: var(--danger-soft); border-color: rgba(255, 93, 108, .4); color: #ff8a95; }
.btn.danger:hover { background: rgba(255, 93, 108, .2); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 38px; padding: 0; }
.btn.small.icon { width: 32px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.switch { position: relative; width: 46px; height: 26px; border-radius: 26px; border: 0; background: var(--line-2); transition: background .18s; flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch-line { display: flex; align-items: center; gap: 12px; }
.switch-line span { color: var(--muted); }

.input { width: 100%; height: 40px; padding: 0 13px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 104px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--faint); }
.input.short { max-width: 120px; }
.count { text-align: right; font-size: 12px; color: var(--faint); margin-top: 5px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 8px; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 500; }

/* picker (channels, roles, bots, webhooks) */
.pick { position: relative; }
.pick-btn { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px; text-align: left; }
.pick-btn:hover { border-color: #46506b; }
.pick-btn .val { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-btn .val.empty { color: var(--faint); }
.pick-btn .chev { color: var(--faint); }
.pop { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); background: var(--raised); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.pop.up { top: auto; bottom: calc(100% + 6px); }
.pop-search { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--faint); }
.pop-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; }
.pop-list { max-height: 264px; overflow-y: auto; padding: 6px; }
.pop-group { font-size: 11px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: var(--faint); padding: 9px 9px 4px; }
.opt { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 0; background: none; border-radius: 8px; text-align: left; }
.opt:hover, .opt.cursor { background: var(--hover); }
.opt .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt .hint { color: var(--faint); font-size: 12px; }
.opt .tick { color: var(--accent); visibility: hidden; }
.opt.sel .tick { visibility: visible; }
.opt.dim { opacity: .45; }
.opt img { width: 22px; height: 22px; border-radius: 50%; }
.pop-empty { padding: 18px; text-align: center; color: var(--faint); }
.pop-foot { border-top: 1px solid var(--line); padding: 8px; display: flex; gap: 8px; }
.pop-foot .input { height: 34px; }
.swatch { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--faint); }
.kind { color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 5px 0 10px; background: var(--hover); border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; color: var(--faint); width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; padding: 0; }
.chip button:hover { background: var(--line-2); color: var(--text); }
.chip.gone { border-style: dashed; color: var(--faint); }

.tags { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px; min-height: 44px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 10px; cursor: text; }
.tags:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tags input { flex: 1; min-width: 140px; height: 28px; background: none; border: 0; outline: none; }

/* role panel editor */
.panel-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1.2fr) 38px; gap: 10px; margin-bottom: 10px; align-items: start; }
.panel-row .input.emoji { text-align: center; font-size: 18px; padding: 0 6px; }

/* status + banners */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 26px; font-size: 12.5px; font-weight: 500; background: var(--hover); color: var(--muted); border: 1px solid var(--line-2); }
.pill.on { background: var(--ok-soft); color: var(--ok); border-color: rgba(62, 207, 142, .35); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(245, 184, 61, .35); }
.banner { display: flex; gap: 13px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-s); margin-bottom: 16px; border: 1px solid; }
.banner b { display: block; font-weight: 600; }
.banner p { color: var(--muted); font-size: 13px; }
.banner .grow { flex: 1; min-width: 0; }
.banner.warn { background: var(--warn-soft); border-color: rgba(245, 184, 61, .35); color: var(--warn); }
.banner.danger { background: var(--danger-soft); border-color: rgba(255, 93, 108, .35); color: #ff8a95; }
.banner.info { background: var(--accent-soft); border-color: rgba(91, 140, 255, .32); color: #9db8ff; }
.banner b, .banner.info b { color: var(--text); }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.list li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.list li svg { color: var(--accent); margin-top: 2px; }
.list li b { color: var(--text); font-weight: 500; }

/* overview */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.stat b { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 8px; }
.stat em { font-style: normal; font-size: 12px; color: var(--faint); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.score { display: flex; align-items: center; gap: 20px; }
.ring { width: 104px; height: 104px; flex: none; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.score p { color: var(--muted); font-size: 13px; }
.score h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.feature { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-align: left; width: 100%; }
.feature:hover { border-color: var(--line-2); background: var(--hover); text-decoration: none; }
.feature .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--hover); color: var(--muted); flex: none; }
.feature.on .ico { background: var(--accent-soft); color: var(--accent); }
.feature .t { flex: 1; min-width: 0; }
.feature .t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feature .t small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--faint); font-size: 12px; white-space: nowrap; }
.feed .what { flex: 1; min-width: 0; }
.feed .what b { font-weight: 500; }
.feed .what p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.empty { padding: 28px; text-align: center; color: var(--faint); }

/* preview of a welcome / goodbye message */
.preview { background: #0b0d13; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 13px; }
.preview .body { min-width: 0; flex: 1; }
.preview .who { font-weight: 600; }
.preview .who small { font-weight: 400; color: var(--faint); margin-left: 7px; font-size: 11.5px; }
.preview .bubble { margin-top: 7px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.preview .bubble b { display: block; margin-bottom: 3px; }
.preview .bubble p { color: #d5d9e6; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview .bubble img { display: block; max-width: 100%; max-height: 180px; border-radius: 8px; margin-top: 10px; }
.mention { background: rgba(91, 140, 255, .22); color: #b6caff; border-radius: 4px; padding: 0 3px; font-weight: 500; }

/* save bar, toasts, dialogs */
.savebar { position: fixed; z-index: 60; left: calc(var(--side) + 24px); right: 24px; bottom: 20px; margin: 0 auto; max-width: 760px; display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 18px; background: #1a2030; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); transform: translateY(140%); opacity: 0; transition: transform .22s ease, opacity .22s ease; }
.savebar.show { transform: none; opacity: 1; }
.savebar span { flex: 1; min-width: 0; }
#toasts { position: fixed; z-index: 90; right: 20px; top: 20px; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; background: #1a2030; border: 1px solid var(--line-2); border-left: 3px solid var(--ok); border-radius: 12px; box-shadow: var(--shadow); animation: drop .2s ease; }
.toast.bad { border-left-color: var(--danger); }
.toast svg { margin-top: 2px; color: var(--ok); }
.toast.bad svg { color: var(--danger); }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } }
.veil { position: fixed; inset: 0; z-index: 80; background: rgba(5, 6, 10, .66); display: grid; place-items: center; padding: 20px; }
.dialog { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.dialog h2 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.dialog p { color: var(--muted); }
.dialog .acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.scrim { display: none; }

@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 70; left: 0; top: 0; width: min(var(--side), 86vw); transform: translateX(-102%); transition: transform .22s ease; }
  .shell.open .side { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(5, 6, 10, .6); }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 130px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: minmax(0, 1fr); }
  .savebar { left: 12px; right: 12px; bottom: 12px; }
  .panel-row { grid-template-columns: 60px minmax(0, 1fr) 38px; }
  .panel-row .pick { grid-column: 1 / -1; }
  .page-head h1 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
