:root {
  --bg: #0a0a0a;
  --side: #0e0e0e;
  --side2: #111111;
  --main: #141414;
  --panel: #0e0e0e;
  --card: #1a1a1a;
  --card2: #202020;
  --line: #262626;
  --line2: #353535;
  --text: #ececec;
  --muted: #9a9a9a;
  --muted2: #6a6a6a;
  --accent: #ff8a1e;
  --accent2: #ffab4d;
  --accent-deep: #e26a06;
  --accent-soft: rgba(255, 138, 30, 0.12);
  --accent-line: rgba(255, 138, 30, 0.40);
  --red: #e5484d;
  --green: #ff8a1e;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  --side-w: 248px;
  --mem-w: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: "Montserrat", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.45; overflow: hidden; }
#app.ds { height: 100vh; height: 100dvh; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); font-weight: 600; }
a { color: var(--accent2); text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(255, 138, 30, 0.35); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #383838; background-clip: content-box; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); padding: 9px 15px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .14s, border-color .14s, transform .08s, filter .14s; }
.btn:hover { background: #2a2a2a; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent-deep), var(--accent) 55%, var(--accent2)); border-color: transparent; color: #20140a; position: relative; overflow: hidden; box-shadow: 0 6px 18px rgba(255,138,30,.25); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.primary::after { content: ""; position: absolute; top: 0; left: -130%; width: 55%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.33), transparent); transform: skewX(-18deg); transition: left .6s ease; pointer-events: none; }
.btn.primary:hover::after { left: 140%; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--card2); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--red); border-color: rgba(229,72,77,.4); background: rgba(229,72,77,.08); }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- inputs ---------- */
.input, .textarea, select.input { width: 100%; background: #0b0b0b; border: 1px solid var(--line); color: var(--text); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .14s, box-shadow .14s; }
.input:focus, .textarea:focus, select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 7px; display: block; }
.field { margin-bottom: 14px; }
/* "I'm not a robot" captcha widget */
.capbox { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 11px 14px; background: #0d0d0d; border: 1px solid #2b2b2b; border-radius: 12px; cursor: pointer; user-select: none; transition: border-color .15s; }
.capbox:hover { border-color: #3d3d3d; }
.capbox:focus { outline: none; border-color: var(--accent); }
.capbox[data-state="done"] { cursor: default; border-color: rgba(255,138,30,.45); }
.cap-check { width: 26px; height: 26px; border: 2px solid #4a4a4a; border-radius: 6px; flex-shrink: 0; display: grid; place-items: center; background: #000; transition: background .2s, border-color .2s; }
.capbox[data-state="solving"] .cap-check { border-color: var(--accent); }
.capbox[data-state="solving"] .cap-check::after { content: ""; width: 14px; height: 14px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: capspin .6s linear infinite; }
.capbox[data-state="done"] .cap-check { background: var(--accent); border-color: var(--accent); }
.capbox[data-state="done"] .cap-check::after { content: "✓"; color: #000; font-weight: 900; font-size: 16px; line-height: 1; }
@keyframes capspin { to { transform: rotate(360deg); } }
.cap-label { font-size: 14px; color: var(--text); font-weight: 600; }
.cap-brand { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 9px; line-height: 1.25; color: #ff8a1e; letter-spacing: .4px; text-transform: uppercase; font-weight: 800; }
.cap-brand i { color: #666; font-style: normal; font-weight: 600; }
.ts-holder { margin: 4px 0 14px; min-height: 65px; width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ts-holder iframe { display: block; }
/* SVG icons inside sidebar channels/tickets, topbar hash, locked composer */
.ds-chan > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted2); }
.ds-chan.active > svg, .ds-chan:hover > svg { color: var(--text); }
.t-hash svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--accent); }
.chat-form.locked svg { width: 15px; height: 15px; vertical-align: -2px; flex-shrink: 0; }
.chat-attach svg { width: 20px; height: 20px; }
/* ticket conversation = full-width chat (no member panel) */
.chatwrap.noright { grid-template-columns: 1fr; }
.perm-row.disabled { opacity: .45; }
.users td .badge.role { margin: 1px 2px 1px 0; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line2); white-space: nowrap; }
.badge.role { background: var(--accent-soft); color: var(--accent2); border-color: var(--accent-line); }
.badge.lock { background: rgba(255,255,255,.05); color: #c7c7c7; border-color: var(--line2); }
.badge.soon { background: var(--card2); color: var(--muted); }
.st-open { background: rgba(255,255,255,.06); color: #cacaca; border-color: var(--line2); }
.st-in_progress { background: rgba(255,138,30,.14); color: var(--accent2); border-color: rgba(255,138,30,.4); }
.st-approved, .st-done { background: linear-gradient(135deg, var(--accent-deep), var(--accent)); color: #1c1204; border-color: transparent; }
.st-rejected { background: rgba(229,72,77,.14); color: #f0908d; border-color: rgba(229,72,77,.4); }
.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; flex: 0 0 auto; position: relative; }
/* presence dot baked into the avatar (green = online, grey = offline) — shown everywhere */
.av-dot { position: absolute; right: -1px; bottom: -1px; width: 32%; height: 32%; min-width: 8px; min-height: 8px; max-width: 13px; max-height: 13px; border-radius: 50%; background: var(--muted2); box-shadow: 0 0 0 2px var(--bg, #0a0a0a); }
.av-dot.on { background: #3ec46d; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(620px 360px at 50% 0%, rgba(255,138,30,.12), transparent 60%); pointer-events: none; }
.login-card { width: 100%; max-width: 410px; padding: 36px 32px; box-shadow: var(--shadow); position: relative; }
.login-card .brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 6px; text-align: center; }
.logo-img { display: block; width: auto; aspect-ratio: 495 / 512; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,.5)); }
.login-card .logo-img { height: 64px; }
.brand .wm { font-size: 22px; font-weight: 900; letter-spacing: .3px; }
.brand .wm span { color: var(--accent); }

/* ============ DISCORD-STYLE SHELL ============ */
.ds-app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }

/* ----- left sidebar (channels) ----- */
.ds-side { background: var(--side); border-right: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.ds-side-head { display: flex; align-items: center; gap: 10px; width: 100%; height: 49px; padding: 0 14px; box-sizing: border-box; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: inherit; text-align: left; font-family: inherit; cursor: pointer; transition: background .12s; }
.ds-side-head:hover { background: var(--side2); }
.ds-side-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ds-side-head .logo-img { height: 30px; flex: 0 0 auto; }
.ds-side-head .wm { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 900; line-height: 1.2; }
.ds-side-head .wm span { color: var(--accent); }
.ds-side-head .wm small { display: block; font-size: 10px; color: var(--muted2); font-weight: 700; letter-spacing: .3px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-channels { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 8px 14px; min-height: 0; }
.ds-cat { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted2); padding: 14px 8px 5px; }
.ds-cat .add { background: transparent; border: 0; color: var(--muted2); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px; border-radius: 5px; }
.ds-cat .add:hover { color: var(--accent2); }
.ds-chan { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 9px; border-radius: 7px; cursor: pointer; transition: background .1s, color .1s; position: relative; }
.ds-chan:hover { background: var(--side2); color: var(--text); }
.ds-chan.active { background: var(--accent-soft); color: var(--accent2); }
.ds-chan.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.ds-chan .hash { color: var(--muted2); font-weight: 700; flex: 0 0 auto; display: inline-flex; justify-content: center; width: 16px; }
.ds-chan.active .hash { color: var(--accent2); }
.ds-chan .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-chan .cnt { font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #20140a; display: grid; place-items: center; }
.ds-chan .av { width: 22px; height: 22px; font-size: 10px; }
.ds-chan .pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); flex: 0 0 auto; }
.ds-chan .pdot.on { background: #3ec46d; }
.ds-user { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-top: 1px solid var(--line); background: var(--side2); }
.ds-user .av { width: 34px; height: 34px; font-size: 14px; }
.ds-user .nm { line-height: 1.15; min-width: 0; flex: 1 1 auto; }
.ds-user .nm b { font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-user .nm span { font-size: 11.5px; color: var(--muted); }
.ds-gear { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 7px; display: grid; place-items: center; }
.ds-gear:hover { background: #1d1d1d; color: var(--accent2); }
.ds-gear svg { width: 18px; height: 18px; }

/* ----- main column ----- */
.ds-main { display: grid; grid-template-rows: 49px minmax(0, 1fr); min-width: 0; min-height: 0; background: var(--main); }
.ds-top { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.3); min-width: 0; }
.ds-top .t-hash { color: var(--muted2); font-size: 20px; font-weight: 700; }
.ds-top .t-title { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-top .t-desc { color: var(--muted); font-size: 13px; padding-left: 12px; margin-left: 6px; border-left: 1px solid var(--line2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.ds-top .t-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.ds-body { min-height: 0; overflow: hidden; }
.scroll-area { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 920px; margin: 0 auto; padding: 26px 22px 50px; }

/* ----- right member panel ----- */
.chatwrap { display: grid; grid-template-columns: 1fr var(--mem-w); height: 100%; min-height: 0; }
.ds-members { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 14px 10px; }
.mem-cat { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted2); padding: 12px 8px 6px; }
.mem { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.mem:hover { background: var(--side2); }
.mem .av { width: 30px; height: 30px; font-size: 12px; position: relative; }
.mem .avwrap { position: relative; flex: 0 0 auto; }
.mem .avwrap .pdot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); background: var(--muted2); }
.mem .avwrap .pdot.on { background: #3ec46d; }
.mem .mnm { min-width: 0; }
.mem .mnm b { font-size: 13.5px; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem.off { opacity: .45; }

/* ---------- chat ---------- */
.ds-chat { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; height: 100%; }
.chat-msgs { display: flex; flex-direction: column; gap: 7px; padding: 16px 18px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; min-height: 0; }
.chat-empty { color: var(--muted); text-align: center; margin: auto; font-size: 14px; }
.msgline { display: flex; gap: 12px; padding: 5px 6px; border-radius: 8px; }
.msgline:hover { background: rgba(255,255,255,.022); }
.msgline .av { width: 38px; height: 38px; font-size: 15px; margin-top: 2px; }
.msgline .mc { min-width: 0; flex: 1 1 auto; }
.msgline .mhead { display: flex; align-items: baseline; gap: 8px; }
.msgline .mname { font-weight: 800; font-size: 14.5px; cursor: pointer; }
.msgline .mname:hover { text-decoration: underline; }
.msgline .mtime { font-size: 11px; color: var(--muted2); }
.msgline .mtext { white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 14.5px; color: #e3e3e3; margin-top: 1px; }
.msgline { position: relative; }
.msgline.flash { background: var(--accent-soft); transition: background .3s; }
/* reply preview above a message */
.mreply { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0 0 2px 2px; cursor: pointer; max-width: 100%; }
.mreply:hover .mreply-text { color: var(--text); }
.mreply-ic { color: var(--muted2); flex: 0 0 auto; }
.mreply-nick { font-weight: 700; flex: 0 0 auto; }
.mreply-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* reaction chips */
.mreacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.mreact { display: inline-flex; align-items: center; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 9px; padding: 2px 8px; font-size: 13px; cursor: pointer; transition: background .12s, border-color .12s; line-height: 1.5; }
.mreact b { font-size: 12px; font-weight: 700; color: var(--muted); }
.mreact:hover { border-color: var(--accent-line); }
.mreact.mine { background: var(--accent-soft); border-color: var(--accent); }
.mreact.mine b { color: var(--accent2); }
.mreact.addr { color: var(--muted2); font-weight: 700; padding: 2px 7px; }
/* hover action toolbar */
.msg-tools { position: absolute; top: -4px; right: 12px; display: none; gap: 2px; background: var(--card); border: 1px solid var(--line2); border-radius: 9px; padding: 2px; box-shadow: 0 4px 14px rgba(0,0,0,.45); z-index: 4; }
.msgline:hover .msg-tools { display: flex; }
.mtool { background: none; border: 0; cursor: pointer; font-size: 14px; padding: 5px 7px; border-radius: 6px; line-height: 1; }
.mtool:hover { background: var(--card2); }
.mtool.danger:hover { background: rgba(229,72,77,.18); }
/* emoji picker popup */
.emoji-pop { position: fixed; z-index: 320; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.emoji-btn { background: none; border: 0; cursor: pointer; font-size: 19px; padding: 6px; border-radius: 8px; line-height: 1; }
.emoji-btn:hover { background: var(--card2); transform: scale(1.15); }
/* reply bar above composer */
.chat-foot { min-width: 0; }
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 18px; padding: 8px 12px; background: var(--card2); border: 1px solid var(--line); border-bottom: 0; border-radius: 11px 11px 0 0; font-size: 13px; color: var(--muted); }
.reply-bar-ic { color: var(--accent); font-weight: 700; }
.reply-bar-txt { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar-txt b { color: var(--text); }
.reply-bar-x { background: none; border: 0; color: var(--muted2); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.reply-bar-x:hover { background: var(--card); color: var(--text); }
.chat-form { display: flex; align-items: flex-end; gap: 10px; padding: 12px 18px 16px; }
.chat-form .input { background: #0b0b0b; border-radius: 11px; padding: 12px 15px; }
/* multiline chat textarea: grows with content, no manual resize, single-line at rest */
.chat-ta { resize: none; min-height: 44px; max-height: 168px; line-height: 1.45; font-family: inherit; overflow-y: auto; }
.chat-attach { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; background: #0b0b0b; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 18px; transition: background .12s, border-color .12s; }
.chat-attach:hover { background: var(--card2); border-color: var(--accent-line); }
/* round accent send button */
.chat-send { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; color: #1a1206; background: linear-gradient(160deg, var(--accent2, #ffae42), var(--accent, #ff8a00)); box-shadow: 0 3px 12px rgba(255,138,0,.32); transition: transform .1s ease, box-shadow .14s, filter .14s; }
.chat-send svg { width: 21px; height: 21px; transform: translateX(1px); }
.chat-send:hover { filter: brightness(1.08); box-shadow: 0 4px 16px rgba(255,138,0,.45); }
.chat-send:active { transform: scale(.92); }
/* attached-photo preview above composer */
.attach-bar { display: flex; align-items: center; gap: 10px; margin: 0 18px; padding: 8px 12px; background: var(--card2); border: 1px solid var(--line); border-bottom: 0; border-radius: 11px 11px 0 0; font-size: 13px; color: var(--muted); }
.attach-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; flex: 0 0 auto; }
.attach-txt { flex: 1 1 auto; }
/* photo inside a message bubble */
.msg-img { display: block; margin-top: 6px; max-width: min(420px, 100%); max-height: 340px; width: auto; height: auto; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; object-fit: contain; }
/* fullscreen image viewer */
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.86); display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: softFade .15s ease both; }
.lightbox img { max-width: 96vw; max-height: 94vh; border-radius: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
/* profile popout card (Discord-style) */
.popout { position: fixed; z-index: 320; width: 300px; max-width: 92vw; background: var(--card); border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; box-shadow: 0 16px 44px rgba(0,0,0,.6); animation: pop .14s ease both; }
.po-banner { height: 80px; background: linear-gradient(120deg, #1a1208, #2a1c0a); background-size: cover; background-position: center; }
.po-banner.has { height: 92px; }
.po-top { padding: 0 16px; margin-top: -32px; }
.po-av { width: 70px; height: 70px; font-size: 26px; border: 4px solid var(--card); box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.po-body { padding: 6px 16px 16px; }
.po-nick { font-size: 18px; font-weight: 900; }
.po-uname { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.po-roles { margin-top: 9px; }
.po-bio { margin-top: 10px; font-size: 13px; line-height: 1.5; color: #ccc; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; white-space: pre-wrap; word-break: break-word; max-height: 110px; overflow: auto; }
.po-actions { display: flex; gap: 8px; margin-top: 12px; }
/* admin role list (Discord-style rows) */
.role-list { display: flex; flex-direction: column; gap: 6px; }
.role-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card2); border: 1px solid var(--line); border-radius: 11px; transition: border-color .12s; }
.role-item:hover { border-color: var(--line2); }
.role-dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.role-dot.glow { animation: nameGlow 1.8s ease-in-out infinite; }
.role-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.role-name { font-weight: 800; font-size: 14.5px; }
.role-sub { font-size: 12px; color: var(--muted); }
.role-acts { display: flex; gap: 5px; flex: 0 0 auto; }
.rbtn { background: var(--card); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; padding: 6px 9px; color: var(--text); transition: background .12s, border-color .12s; }
.rbtn:hover { background: var(--side2); }
.rbtn.danger:hover { background: rgba(229,72,77,.18); border-color: var(--red); }
.role-base { font-size: 11.5px; color: var(--muted2); font-style: italic; flex: 0 0 auto; }

/* ---------- generic content ---------- */
.page-title { font-size: 23px; font-weight: 900; margin: 2px 0 6px; }
.page-lead { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.section-note { font-size: 13px; color: var(--muted); background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; white-space: pre-wrap; line-height: 1.55; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; flex-wrap: wrap; }
.sec-head h2 { font-size: 18px; font-weight: 900; margin: 0; }
.sec-head h2::before { content: ""; display: inline-block; width: 4px; height: 16px; background: linear-gradient(var(--accent), var(--accent-deep)); border-radius: 3px; margin-right: 10px; vertical-align: -2px; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.list-grid { display: grid; gap: 10px; }

/* ---------- home dashboard ---------- */
.dash-server { display: flex; align-items: center; gap: 18px; padding: 20px 22px; background: linear-gradient(135deg, var(--card), var(--card2)); border: 1px solid var(--line); border-radius: 16px; flex-wrap: wrap; }
.dash-online { text-align: center; padding-right: 20px; border-right: 1px solid var(--line2); }
.dash-online .num { font-size: 40px; font-weight: 900; color: var(--accent2); text-shadow: 0 0 22px rgba(255,138,30,.32); line-height: 1; }
.dash-online .num small { font-size: 18px; color: var(--muted2); font-weight: 800; }
.dash-online .lbl { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.dash-info { flex: 1 1 220px; min-width: 0; }
.dash-info .ip { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.dash-links { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: flex; align-items: center; gap: 13px; padding: 15px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; color: var(--text); text-align: left; transition: border-color .15s, transform .14s, background .15s; }
.tile:hover { border-color: var(--accent-line); transform: translateY(-2px); background: var(--card2); }
.tile-ico { width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent2); }
.tile-ico svg { width: 22px; height: 22px; }
.tile b { font-size: 14.5px; }
.tile span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; font-size: 14px; padding: 9px 6px; margin-bottom: -1px; cursor: pointer; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent2); border-bottom-color: var(--accent); }
.tab .cnt { color: var(--muted2); }

/* ---------- application & form cards ---------- */
.app-item, .form-card { display: block; width: 100%; text-align: left; padding: 15px 17px; cursor: pointer; transition: border-color .14s, transform .12s, background .14s; }
.app-item:hover, .form-card:hover { border-color: var(--accent-line); transform: translateY(-2px); background: var(--card2); }
.app-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app-title { font-weight: 800; font-size: 15.5px; }
.app-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.form-card .fc-note { color: var(--muted); font-size: 12.5px; margin-top: 7px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- detail / kv / reply ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 210px 1fr; gap: 8px 18px; margin: 4px 0 6px; }
.kv .k { color: var(--muted); font-size: 13px; }
.kv .v { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv .k { margin-top: 8px; } }
.msg { padding: 13px 15px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); margin-bottom: 10px; }
.msg .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.msg .text { white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.reply { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }

/* ---------- info pages ---------- */
.page-content { white-space: pre-wrap; word-break: break-word; line-height: 1.72; font-size: 14.7px; color: #e6e6e6; }
.doc-meta { color: var(--muted2); font-size: 12.5px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- rosters (pretty tables) ---------- */
.roster-card { padding: 0; overflow: hidden; }
.roster-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--card2); flex-wrap: wrap; }
.roster-title { font-weight: 800; font-size: 16px; }
table.roster-table, table.users { width: 100%; border-collapse: collapse; min-width: 540px; }
table.roster-table th, table.users th { text-align: left; padding: 11px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted2); background: #131313; border-bottom: 1px solid var(--line); }
table.roster-table td, table.users td { text-align: left; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.roster-table tbody tr:hover, table.users tbody tr:hover { background: rgba(255,255,255,.02); }
table.roster-table tbody tr:last-child td, table.users tbody tr:last-child td { border-bottom: 0; }
/* center value columns; the name column (.lcol) stays left, action cells stay right (inline) */
table.roster-table td, table.roster-table th, table.users td, table.users th { text-align: center; }
table.roster-table .lcol, table.users .lcol { text-align: left; }
/* roster punishments */
.pun-cell { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pun-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.pun-chip b { font-weight: 700; }
.pun-time { color: var(--muted); font-size: 11px; }
.pun-x { background: none; border: 0; color: var(--muted2); cursor: pointer; font-size: 12px; padding: 0 1px; line-height: 1; }
.pun-x:hover { color: var(--red); }
.pun-add { background: var(--card2); border: 1px dashed var(--line2); color: var(--accent2); cursor: pointer; border-radius: 8px; padding: 1px 8px; font-size: 15px; line-height: 1.4; }
.pun-add:hover { border-color: var(--accent); }
.pun-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pun-preset { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.pun-preset:hover { border-color: var(--accent-line); background: var(--side2); }
/* drag-and-drop roster rows */
.roster-table td.rdrag { cursor: grab; color: var(--muted2); text-align: center; font-size: 16px; user-select: none; width: 26px; padding-left: 8px; padding-right: 8px; }
.roster-table td.rdrag:active { cursor: grabbing; }
.roster-table tr.rrow.dragging { opacity: .45; }
.roster-table tr.rrow.dragging td { background: var(--accent-soft); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.uname { background: transparent; border: 0; color: var(--text); font-weight: 700; cursor: pointer; padding: 0; font-size: 14px; }
.uname:hover { color: var(--accent2); text-decoration: underline; }

/* ---------- profile / 2fa / pickers ---------- */
.prof-head { display: flex; align-items: center; gap: 16px; }
.prof-av { width: 60px; height: 60px; font-size: 24px; }
.prof-nick { font-size: 19px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 14px; }
.prof-stats > div { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; }
.prof-stats b { display: block; font-size: 14px; }
.prof-stats span { color: var(--muted); font-size: 11px; }
.prof-bio { white-space: pre-wrap; word-break: break-word; line-height: 1.55; font-size: 14px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
/* Profile banner + avatar uploads */
.prof-modal { overflow: hidden; padding: 0; }
.prof-banner { position: relative; height: 140px; background: linear-gradient(120deg, #1a1208, #2a1c0a); background-size: cover; background-position: center; }
.prof-banner.has { height: 160px; }
/* avatar + nick sit inside the banner, nick flush with the banner's bottom edge */
.prof-modal .prof-head { position: absolute; left: 22px; right: 22px; bottom: 8px; display: flex; align-items: flex-end; gap: 14px; }
.prof-modal .prof-av { width: 82px; height: 82px; font-size: 30px; border: 5px solid var(--card); box-shadow: 0 4px 14px rgba(0,0,0,.55); flex: 0 0 auto; }
.prof-headname { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding-bottom: 0; }
.prof-headname .prof-nick { font-size: 22px; font-weight: 900; text-shadow: 0 1px 6px rgba(0,0,0,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* tag + role go below the banner */
.prof-card-body { padding: 14px 22px 22px; }
.prof-tag { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.prof-role { margin-top: 9px; }
.prof-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.prof-edit { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.prof-banner-edit { position: relative; height: 130px; border-radius: 14px; background: linear-gradient(120deg, #1a1208, #2a1c0a); background-size: cover; background-position: center; border: 1px solid var(--line); display: flex; align-items: flex-end; padding: 12px; }
.prof-av-edit { border: 4px solid var(--card); box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.prof-up-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.upl { cursor: pointer; }
.chat-form.locked { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 13px; background: #0b0b0b; border-top: 1px solid var(--line); }
/* Channel settings — per-role permission overrides */
.ov-tablewrap { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ov-table th { position: sticky; top: 0; background: var(--card2); color: var(--muted); font-weight: 700; font-size: 11.5px; text-align: center; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.ov-table th:first-child { text-align: left; padding-left: 12px; }
.ov-table td { padding: 6px; text-align: center; border-bottom: 1px solid var(--line); }
.ov-table td:first-child { text-align: left; padding-left: 12px; }
.ov-table tr:last-child td { border-bottom: 0; }
.ov-rolename { font-weight: 700; }
.ovsel:not(.ovchk) { background: #0b0b0b; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; font-size: 13px; cursor: pointer; }
.ovsel:focus { outline: none; border-color: var(--accent-line); }
.ovchk { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.ov-table td:not(:first-child), .ov-table th:not(:first-child) { text-align: center; }
.tf-secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: 2px; font-weight: 700; color: var(--accent2); background: #0b0b0b; border: 1px dashed var(--accent-line); border-radius: 10px; padding: 12px 14px; cursor: pointer; word-break: break-all; text-align: center; }
.tf-secret:hover { background: #111; }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.pick-row:hover { background: var(--card2); }
.pick-row input { accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.dm-picklist { display: flex; flex-direction: column; gap: 6px; max-height: 56vh; overflow-y: auto; }
.dm-pick { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; cursor: pointer; color: var(--text); }
.dm-pick:hover { border-color: var(--accent-line); }
.mem-list { display: flex; flex-direction: column; gap: 6px; }
.mem-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.rolex { background: transparent; border: 0; color: var(--red); font-weight: 900; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 5px; }

/* ---------- modal / toast / menu ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 200; padding: 18px; overflow: auto; }
.modal { width: 100%; max-width: 540px; padding: 24px; box-shadow: var(--shadow); animation: pop .14s ease both; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal.wide { max-width: 720px; }
.modal h3 { margin: 0 0 16px; font-size: 19px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 22px); display: flex; align-items: center; gap: 12px; background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line2); color: var(--text); padding: 11px 18px 11px 12px; border-radius: 14px; box-shadow: 0 14px 38px rgba(0,0,0,.55); z-index: 300; max-width: 92vw; opacity: 0; transition: opacity .24s ease, transform .26s cubic-bezier(.2,.85,.3,1.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-weight: 900; font-size: 15px; background: var(--accent); color: #1a1205; box-shadow: 0 0 0 4px var(--accent-soft); }
.toast.err .toast-ic { background: var(--red); color: #fff; box-shadow: 0 0 0 4px rgba(229,72,77,.2); }
.toast-msg { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.menu { position: fixed; min-width: 215px; background: var(--card); border: 1px solid var(--line2); border-radius: 6px; box-shadow: var(--shadow); padding: 5px; z-index: 250; animation: pop .12s ease both; }
.menu .mhead { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .mhead b { display: block; font-size: 14px; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 4px; cursor: pointer; }
.menu button:hover { background: var(--card2); }
.menu button.danger { color: var(--red); }
.menu.ctx { min-width: 168px; }
.tk-num { color: var(--muted2); font-weight: 600; font-size: .9em; }
/* clickable links inside user text (messages, pages, bio) */
.mtext a, .text a, .page-content a, .po-bio a, .prof-bio a { color: var(--accent2); text-decoration: underline; word-break: break-word; }
.mtext a:hover, .text a:hover, .page-content a:hover, .po-bio a:hover, .prof-bio a:hover { color: var(--accent); }
.mtext code, .text code, .page-content code, .po-bio code, .prof-bio code { font-family: ui-monospace, Consolas, monospace; background: rgba(255,255,255,.08); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; font-size: .9em; }
.mtext u, .text u, .page-content u, .po-bio u, .prof-bio u { text-decoration-thickness: 1px; }
/* Discord-style selection formatting toolbar */
.md-bar { position: fixed; z-index: 360; display: flex; gap: 2px; background: var(--card); border: 1px solid var(--line2); border-radius: 6px; padding: 3px; box-shadow: var(--shadow); }
.md-bar button { min-width: 30px; height: 28px; padding: 0 7px; background: transparent; border: 0; color: var(--text); font-size: 14px; cursor: pointer; border-radius: 4px; line-height: 1; }
.md-bar button:hover { background: var(--card2); color: var(--accent2); }
/* Admin audit log */
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px 9px 12px; border-radius: 6px; position: relative; }
.log-row + .log-row { border-top: 1px solid var(--line); }
.log-row:hover { background: var(--card2); }
.log-dot { position: absolute; left: 2px; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; }
.log-row .av, .log-row .avatar { flex: 0 0 auto; }
.log-main { min-width: 0; flex: 1; }
.log-top { font-size: 14px; line-height: 1.4; word-break: break-word; }
.log-actor { font-weight: 800; }
.log-sum { color: var(--text); }
.log-meta { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.log-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.log-time { font-size: 12px; color: var(--muted); }

/* ---- News feed ---- */
.news-feed { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.news-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.news-card.pinned { border-color: var(--accent-line, rgba(255,138,0,.4)); box-shadow: 0 0 0 1px rgba(255,138,0,.12) inset; }
.news-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.news-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 3px 9px; border: 1px solid; border-radius: 999px; }
.news-kind svg { width: 14px; height: 14px; }
.news-pin-tag { font-size: 11px; color: var(--accent2); font-weight: 700; }
.news-actions { display: flex; gap: 4px; }
.news-title { font-size: 19px; font-weight: 900; margin: 2px 0 8px; line-height: 1.25; word-break: break-word; }
.news-body { font-size: 14.5px; line-height: 1.6; color: #e3e3e3; white-space: pre-wrap; word-break: break-word; }
.news-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.news-meta .avatar { width: 22px; height: 22px; font-size: 10px; }
.news-time { color: var(--muted2); }
.icon-btn { background: transparent; border: 1px solid var(--line); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 14px; transition: background .12s, border-color .12s, color .12s; }
.icon-btn:hover { background: var(--card2); color: var(--text); border-color: var(--accent-line); }
.icon-btn.danger:hover { color: #ff6b6b; border-color: rgba(255,80,80,.4); }

/* ---- Poll ---- */
.poll { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.poll-q { font-weight: 800; font-size: 14.5px; margin-bottom: 9px; }
.poll-opts { display: flex; flex-direction: column; gap: 7px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: var(--card2); border: 1px solid var(--line2); border-radius: 9px; padding: 10px 12px; color: var(--text); font-size: 14px; cursor: pointer; overflow: hidden; transition: border-color .12s, background .12s; }
.poll-opt:hover { border-color: var(--accent-line, rgba(255,138,0,.45)); }
.poll-opt .poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,138,0,.16); z-index: 0; transition: width .45s cubic-bezier(.2,.7,.2,1); }
.poll-opt.lead .poll-bar { background: rgba(255,138,0,.28); }
.poll-opt.picked { border-color: var(--accent); }
.poll-opt .poll-mark, .poll-opt .poll-otext, .poll-opt .poll-pct { position: relative; z-index: 1; }
.poll-opt .poll-mark { color: var(--accent2); font-size: 15px; flex: 0 0 auto; }
.poll-opt .poll-otext { flex: 1; word-break: break-word; }
.poll-opt .poll-pct { font-weight: 800; color: var(--text); font-size: 13px; }
.poll-foot { margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.poll-clear { background: none; border: 0; color: var(--accent2); cursor: pointer; font-size: 12.5px; padding: 0; text-decoration: underline; }

/* poll builder + kind picker in the news modal */
.seg-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-b { background: var(--card2); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 13px; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; transition: all .12s; }
.seg-b.on { color: #1a1206; background: var(--sc, var(--accent)); border-color: var(--sc, var(--accent)); }
.ck { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.opt-row { display: flex; gap: 7px; margin-bottom: 7px; }
.opt-row .input { flex: 1; }
/* long-press (mobile) opens the context menu — suppress the native iOS callout/selection on targets */
.ds-chan, .ds-cat, .mem, .msgline { -webkit-touch-callout: none; }
.ds-chan, .ds-cat, .mem { -webkit-user-select: none; user-select: none; }

/* ---------- roles & permissions ---------- */
.perm-list { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; max-height: 40vh; overflow-y: auto; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.perm-row:hover { background: var(--card2); }
.perm-info { min-width: 0; }
.perm-info b, .perm-row b { font-size: 14px; display: block; font-weight: 700; }
.perm-info span, .perm-row span { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.cpresets { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.cdot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.14); cursor: pointer; padding: 0; transition: transform .1s, box-shadow .1s; }
.cdot:hover { transform: scale(1.14); }
.cdot.sel { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px #fff; }
/* Discord-style toggle switch */
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; background: #3a3a3c; border-radius: 999px; transition: background .18s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
/* Role-create modal: live preview + color picker */
.role-modal .rp-preview { display: flex; align-items: center; gap: 12px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; }
.rp-label { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; flex: 0 0 auto; }
.rp-chip { font-weight: 800; font-size: 14px; padding: 5px 14px; border-radius: 999px; border: 1.5px solid currentColor; line-height: 1.1; color: var(--accent); }
.rp-chip.glow { animation: rpGlow 1.8s ease-in-out infinite; }
@keyframes rpGlow { 0%, 100% { box-shadow: 0 0 4px currentColor; } 50% { box-shadow: 0 0 13px currentColor, 0 0 22px currentColor; } }
.color-row { display: flex; align-items: center; gap: 14px; }
.color-swatch { width: 46px; height: 40px; border: 1px solid var(--line2); background: none; cursor: pointer; padding: 2px; border-radius: 11px; flex: 0 0 auto; }
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: 0; border-radius: 8px; }
.toggle-card { border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
/* Role editor: Discord-style tabs */
.role-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.role-tab { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 14px; padding: 10px 15px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s; font-family: inherit; }
.role-tab:hover { color: var(--text); }
.role-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.role-pane.hidden { display: none; }
.perm-search { background: #0b0b0b; }
/* Color grid (default swatches + custom picker tile) */
.color-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 340px; }
.color-cell { aspect-ratio: 1; border-radius: 8px; border: 0; cursor: pointer; position: relative; padding: 0; transition: transform .1s; }
.color-cell:hover { transform: scale(1.12); }
.color-cell.sel::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.color-cell.custom { background: conic-gradient(from 0deg, #f33, #ff3, #3f3, #3ff, #33f, #f3f, #f33); display: grid; place-items: center; overflow: hidden; }
.color-cell.custom .cc-plus { color: #fff; font-weight: 900; font-size: 18px; text-shadow: 0 1px 3px rgba(0,0,0,.7); position: relative; z-index: 1; }
.color-cell.custom.sel .cc-plus { display: none; }
.color-cell.custom input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; cursor: pointer; }
.role-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-weight: 800; font-size: 12.5px; border: 1px solid; }
.role-chip .rx { cursor: pointer; opacity: .7; }
.role-chip .rx:hover { opacity: 1; }
.role-chip .redit { cursor: pointer; opacity: .7; }

/* ---------- settings page ---------- */
.set-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; margin-top: 8px; }
.set-nav { display: flex; flex-direction: column; gap: 3px; }
.set-nav-item { text-align: left; background: transparent; border: 0; color: var(--muted); font-weight: 700; font-size: 14px; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.set-nav-item:hover { background: var(--card2); color: var(--text); }
.set-nav-item.active { background: var(--accent-soft); color: var(--accent2); }
.set-body { min-width: 0; }
.set-card { padding: 20px; }
.set-card h3 { margin: 0 0 6px; font-size: 17px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row .l b { display: block; font-size: 14.5px; }
.set-row .l span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 640px) { .set-layout { grid-template-columns: 1fr; } }

/* ---------- music player ---------- */
.mp-player { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 10px; }
.mp-art { width: 54px; height: 54px; border-radius: 13px; background: linear-gradient(135deg, var(--accent-deep), var(--accent2)); display: grid; place-items: center; font-size: 26px; color: #1c1204; flex: 0 0 auto; box-shadow: 0 6px 18px rgba(255,138,30,.3); }
.mp-mid { flex: 1 1 auto; min-width: 0; }
.mp-now { font-weight: 800; font-size: 15px; margin-bottom: 9px; }
.mp-seekrow { display: flex; align-items: center; gap: 10px; }
.mp-t { font-size: 11.5px; color: var(--muted2); font-variant-numeric: tabular-nums; min-width: 34px; }
.mp-t:last-child { text-align: right; }
.mp-seek { flex: 1 1 auto; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px; background: var(--line2); cursor: pointer; }
.mp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.mp-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--accent); cursor: pointer; }
.mp-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent-deep), var(--accent)); color: #1c1204; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.mp-btn:hover { filter: brightness(1.08); }
.mp-btn svg { width: 22px; height: 22px; }
.mp-list { display: flex; flex-direction: column; gap: 8px; }
.mp-track { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--text); transition: border-color .14s, background .14s; }
.mp-track:hover { border-color: var(--accent-line); background: var(--card2); }
.mp-track.active { border-color: var(--accent-line); }
.mp-pi { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent2); display: grid; place-items: center; flex: 0 0 auto; }
.mp-pi svg { width: 15px; height: 15px; }
.mp-tinfo { flex: 1 1 auto; min-width: 0; }
.mp-tinfo b { display: block; font-size: 14.5px; }
.mp-tinfo span { color: var(--muted); font-size: 12.5px; }
.mp-eq { display: flex; align-items: flex-end; gap: 2px; height: 16px; flex: 0 0 auto; }
.mp-eq i { width: 3px; height: 6px; background: var(--accent); border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.mp-eq i:nth-child(2) { animation-delay: .25s; }
.mp-eq i:nth-child(3) { animation-delay: .5s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 15px; } }

.mp-vol { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.mp-volic { font-size: 15px; }
.mp-volrange { width: 76px; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 3px; background: var(--line2); cursor: pointer; }
.mp-volrange::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.mp-volrange::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); cursor: pointer; }

/* glowing / shimmering roles */
.badge.role.glow, .role-chip.glow { animation: roleGlow 1.8s ease-in-out infinite; }
@keyframes roleGlow {
  0%, 100% { box-shadow: 0 0 5px -2px currentColor; text-shadow: 0 0 5px currentColor; }
  50% { box-shadow: 0 0 12px 0 currentColor; text-shadow: 0 0 13px currentColor, 0 0 4px currentColor; }
}
.mname.glow, .mem .mnm b.glow, .mn.glow { animation: nameGlow 1.8s ease-in-out infinite; }
@keyframes nameGlow { 0%,100% { text-shadow: 0 0 5px currentColor; } 50% { text-shadow: 0 0 13px currentColor; } }
.medited { font-size: 10px; color: var(--muted2); font-style: italic; }
.dm-pick.sel { border-color: var(--accent); background: var(--accent-soft); }
.mem-cat { font-weight: 800; }

/* Yandex-table style (spreadsheet grid) */
.tbl-yx table.roster-table th, .tbl-yx table.users th, table.roster-table th, table.users th { border-right: 1px solid var(--line); }
table.roster-table th, table.users th, table.roster-table td, table.users td { border-right: 1px solid var(--line); }
table.roster-table th:last-child, table.users th:last-child, table.roster-table td:last-child, table.users td:last-child { border-right: 0; }
table.roster-table tbody tr:nth-child(even) td, table.users tbody tr:nth-child(even) td { background: rgba(255,255,255,.018); }
table.roster-table tbody tr:hover td, table.users tbody tr:hover td { background: var(--accent-soft); }

/* now-playing strip in sidebar */
.np { border-top: 1px solid var(--line); background: var(--side2); }
.np-strip { display: flex; align-items: center; gap: 9px; padding: 8px 11px; }
.np-toggle { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--accent); color: #1c1204; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }
.np-toggle svg { width: 15px; height: 15px; }
.np-info { min-width: 0; flex: 1 1 auto; cursor: pointer; }
.np-info b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-info span { font-size: 11px; color: var(--muted); }
.np-prog-wrap { height: 3px; background: var(--line); }
.np-prog-wrap i { display: block; height: 100%; background: var(--accent); width: 0; }

/* ---------- motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes softFade { from { opacity: 0; } to { opacity: 1; } }
.scroll-area > .wrap { animation: softFade .18s ease both; }
/* tab panes fade gently in place (no vertical jump when switching tabs) */
.tab-pane { animation: softFade .16s ease both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---------- responsive ---------- */
.ds-burger { display: none; }
@media (max-width: 860px) {
  .ds-app { grid-template-columns: 1fr; }
  .ds-side { position: fixed; left: 0; top: 0; bottom: 0; width: 82vw; max-width: 300px; z-index: 120; transform: translateX(-100%); transition: transform .22s ease; }
  .ds-app.open .ds-side { transform: none; }
  .ds-burger { display: grid; place-items: center; background: transparent; border: 0; color: var(--text); cursor: pointer; padding: 6px; }
  .ds-burger svg { width: 22px; height: 22px; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 110; }
  .chatwrap { grid-template-columns: 1fr; }
  .ds-members { display: none; }
}
/* ---------- phones ---------- */
@media (max-width: 600px) {
  /* inputs must be >=16px or iOS auto-zooms on focus */
  .input, .textarea, select.input { font-size: 16px; }
  .wrap { padding: 16px 13px 44px; }
  .login-card { padding: 26px 18px; }
  .page-title { font-size: 21px; }
  .page-lead { font-size: 13px; }
  .ds-top { padding: 0 12px; gap: 8px; }
  .chat-msgs { padding: 12px 12px 6px; }
  .modal-bg { padding: 10px; }
  .modal, .modal.wide { padding: 18px 16px; max-width: 100%; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }
  .dash-server { gap: 12px; padding: 16px; }
  .dash-online { width: 100%; border-right: 0; padding-right: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line2); }
  .dash-online .num { font-size: 34px; }
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .sec-head { flex-wrap: wrap; gap: 8px; }
  .tabs { overflow-x: auto; }
}
@media (max-width: 380px) {
  .tile-grid { grid-template-columns: 1fr; }
}
