/* Secret_Web dashboard layout on top of the ORCA kit (kit/tokens.css + kit/orca.css) */

html, body { margin: 0; min-height: 100%; background: #0e0f10; }
body.o-root { user-select: text; }
.o-root button, .nav a, .o-toggle { user-select: none; }
.server-pick { height: 40px; min-width: 160px; max-width: 320px; text-overflow: ellipsis; }
body { font-size: var(--fs-body); line-height: 1.5; user-select: text; }
.hidden { display: none !important; }
h1 { margin: 0; font-size: var(--fs-title); font-weight: 600; letter-spacing: .02em; }
h2 { margin: 0 0 16px; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.error { color: var(--red); min-height: 22px; font-size: var(--fs-small); }
.o-head__title { line-height: 1.2; }
.o-close svg, .o-close { display: grid; place-items: center; }
.o-close svg { width: 18px; height: 18px; }
select.o-input { appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--box) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2373EFFF' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center / 20px; }
textarea.o-input { height: auto; padding: 12px 16px; resize: vertical; line-height: 1.6; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.o-input { min-width: 0; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(440px, calc(100vw - 32px)); display: grid; gap: 16px; }

/* the window */
#app { padding: 24px; }
.shell { min-height: calc(100vh - 48px); padding: 28px 32px 32px; overflow: hidden; overflow: clip; }
.shell::after {
  content: ''; position: absolute; right: -120px; bottom: -160px; width: 560px; height: 660px;
  background: url('kit/orca-logo.png') no-repeat center / contain; opacity: .04; pointer-events: none;
}
.top { margin-bottom: 32px; }
.body { position: relative; z-index: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; }

/* left menu, the SETTING page list */
.nav { display: grid; gap: 10px; align-content: start; }
.nav a {
  display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 20px;
  border-radius: var(--r-row); background: var(--well); cursor: pointer; transition: background .15s;
}
.nav a:hover { background: rgba(42, 42, 42, .6); }
.nav a svg { width: 20px; height: 20px; flex: none; color: var(--text-2); }
.nav__en { font-size: var(--fs-small); font-weight: 600; letter-spacing: .04em; }
.nav__th { margin-left: auto; font-size: var(--fs-small); color: var(--text-2); font-weight: 400; }
.nav a.active { background: var(--acc-14); }
.nav a.active svg, .nav a.active .nav__en { color: var(--acc); }

/* page */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin-top: 4px; font-size: var(--fs-small); }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tools .o-input { height: 40px; }
.tools input.o-input { width: 220px; }
.save { min-width: 200px; height: 48px; font-size: var(--fs-body); }
.box { padding: 24px; border-radius: var(--r-card); background: var(--card); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--text-2); font-size: var(--fs-small); cursor: pointer; }
.check input { accent-color: var(--acc); width: 16px; height: 16px; }
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 20px; border-radius: var(--r-row); background: var(--red-10); }
.empty { padding: 32px 0; text-align: center; }

/* player cell: avatar + names */
.who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: var(--r-btn); object-fit: cover; background: var(--box); }
.avatar--text { display: grid; place-items: center; font-size: var(--fs-small); color: var(--acc); background: var(--acc-14); }
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.who__name { display: grid; line-height: 1.3; }
.who__name small { color: var(--text-3); font-size: 12px; }
tr.is-off td { opacity: .55; }

/* overview */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { display: grid; gap: 6px; padding: 20px 24px; border-radius: var(--r-row); background: var(--box); }
.stat__label { font-size: var(--fs-small); color: var(--text-3); font-weight: 400; }
.stat__value { font-size: var(--fs-num); line-height: 1.1; }
.stat__value b { font-weight: 500; color: var(--acc); }
.stat__value.is-red { color: var(--red); }
.meter { display: grid; grid-template-columns: 170px 1fr 44px; gap: 14px; align-items: center; margin: 12px 0; font-size: var(--fs-small); }
.meter b { text-align: right; font-weight: 500; color: var(--acc); }

/* secure net: KPI tiles, trend chart, per-script bars */
.net-live { height: 40px; font-size: var(--fs-small); }
.net-kpis { margin-bottom: 20px; }
.kpi { gap: 4px; padding-bottom: 14px; }
.kpi .delta { font-size: var(--fs-tiny); color: var(--text-2); }
.spark { display: block; width: 100%; height: 36px; margin-top: 8px; overflow: visible; }

.viz-card { margin-bottom: 20px; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.viz-head h2 { margin-bottom: 4px; }
.viz-sub { font-size: var(--fs-tiny); color: var(--text-3); }
.viz-hint { margin-left: 6px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; font-size: var(--fs-small); color: var(--text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.legend__item i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.viz-plot { min-height: 280px; }
.trend { display: block; max-width: 100%; }
.trend .grid { stroke: #2c2c2c; stroke-width: 1; }
.trend .baseline { stroke: #3a3a3a; stroke-width: 1; }
.trend .axis { fill: var(--text-3); font-family: var(--font); font-size: 11px; font-variant-numeric: tabular-nums; }
.trend .picked { stroke: var(--acc); stroke-width: 1; opacity: .8; }
.trend .crosshair { stroke: var(--text-2); stroke-width: 1; }
.trend .hit { fill: transparent; cursor: crosshair; outline: none; }
.trend .hit:focus-visible { stroke: var(--acc); stroke-width: 1; }

.viz-tip {
  position: absolute; z-index: 5; min-width: 190px; max-width: 300px; padding: 12px 14px;
  border-radius: var(--r-row); background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, .5);
  font-size: var(--fs-small); pointer-events: none; opacity: 0; transition: opacity .12s;
}
.viz-tip.show { opacity: 1; }
.viz-tip__title { margin-bottom: 2px; font-size: var(--fs-tiny); color: var(--text-2); }
.viz-tip__total { margin-bottom: 6px; font-weight: 600; }
.viz-tip__row { display: grid; grid-template-columns: 12px auto minmax(0, 1fr); align-items: center; gap: 8px; line-height: 1.7; }
.viz-tip__row i { width: 12px; height: 2px; border-radius: 1px; background: var(--c); }
.viz-tip__row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip__row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.viz-tip__hint { margin-top: 6px; font-size: var(--fs-tiny); color: var(--text-3); }

.hbars { display: grid; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 112px; align-items: center; gap: 12px; min-height: 30px; margin: 0 -8px; padding: 0 8px; border-radius: var(--r-chip); outline: none; }
.hbar:hover, .hbar:focus-visible { background: rgba(255, 255, 255, .03); }
.hbar__name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-small); }
.hbar__name i { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.hbar__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__track { height: 10px; }
.hbar__fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--c); }
.hbar__value { text-align: right; white-space: nowrap; font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar__value small { margin-left: 8px; font-weight: 400; color: var(--text-3); }

.net-detail-head { margin: 8px 0 16px; align-items: center; }
.net-detail-head h2 { margin: 0; font-size: var(--fs-h2); text-transform: none; letter-spacing: 0; color: var(--text); }
#net-detail { transition: opacity .15s; }
#net-detail.is-loading { opacity: .5; }
.net-flags { margin-bottom: 20px; }
.net-flag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; padding: 10px 14px; border-radius: var(--r-row); background: var(--well); font-size: var(--fs-small); }
.net-list-head { margin: 28px 0 12px; align-items: center; }
.net-list-head h2 { margin: 0; }
.dir { font-size: 12px; color: var(--text-2); }
.res-key { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; background: var(--c); vertical-align: 1px; }
tr.is-picked td { background: var(--acc-10); }
#net-trend tr[data-net-id] { cursor: pointer; }

/* tables: outlined header strip + rows in rounded wells (King of loop) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
th {
  height: 46px; padding: 0 16px; text-align: left; white-space: nowrap;
  font-size: var(--fs-tiny); font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
th:first-child { border-left: 1px solid var(--line); border-radius: var(--r-row) 0 0 var(--r-row); }
th:last-child { border-right: 1px solid var(--line); border-radius: 0 var(--r-row) var(--r-row) 0; }
td { height: 52px; padding: 8px 16px; background: var(--well); white-space: nowrap; font-size: var(--fs-small); }
td:first-child { border-radius: var(--r-row) 0 0 var(--r-row); }
td:last-child { border-radius: 0 var(--r-row) var(--r-row) 0; }
tr:hover td { background: rgba(42, 42, 42, .6); }
tr.is-red td { background: var(--red-10); }
td.wrap { white-space: normal; min-width: 220px; }
.dim { color: var(--text-3); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions .o-btn { height: 34px; padding: 0 14px; font-size: var(--fs-small); }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-chip); font-size: 12px; font-weight: 500; background: var(--soft); color: var(--text-2); }
.tag--acc { background: var(--acc-14); color: var(--acc); }
.tag--red { background: var(--red-17); color: var(--red); }
.tag--gold { background: rgba(255, 196, 107, .14); color: var(--gold); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: var(--fs-small); }
.pager .o-btn { height: 32px; }
.pager .o-btn:disabled { opacity: .4; cursor: default; }

/* rules: SETTING-page rows with the ON / OFF pair */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; align-items: start; }
.group { display: grid; gap: 10px; padding: 20px; border-radius: var(--r-card); background: var(--card); }
.group h2 { margin: 0 0 6px; color: var(--acc); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 10px 12px 10px 20px; border-radius: var(--r-row); background: var(--well); }
.setting__text { display: grid; gap: 2px; }
.setting__text small { color: var(--text-2); font-size: var(--fs-tiny); font-weight: 400; }
.setting .o-toggle button { width: 64px; height: 32px; }
.setting .o-input { width: 120px; height: 40px; }
.setting select.o-input { width: 190px; }
.setting--block { display: grid; grid-template-columns: 1fr; gap: 10px; }

/* forms */
.form { display: grid; gap: 16px; align-content: start; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.preview-head h2 { margin: 0; }
.preview-tabs .o-tab { height: 36px; padding: 0 14px; font-size: var(--fs-small); }
.preview-note { margin-bottom: 12px; font-size: 12px; }
iframe#bancard-preview { width: 100%; height: 600px; border: 0; border-radius: var(--r-row); background: #0b0d12; }

/* dialog */
dialog.o-panel { width: min(480px, calc(100vw - 32px)); color: var(--text); border: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
.dialog-head { margin-bottom: 18px; gap: 14px; }
.dialog-head .o-head__title { font-size: var(--fs-h2); white-space: normal; }
#dialog-body { display: grid; gap: 14px; margin-bottom: 24px; font-size: var(--fs-small); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: calc(100vw - 48px);
  padding: 14px 20px; border-radius: var(--r-row); background: var(--card); box-shadow: inset 3px 0 0 var(--acc);
  font-size: var(--fs-small); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.bad { box-shadow: inset 3px 0 0 var(--red); }

/* form controls the kit's reset doesn't cover */
select.o-input, textarea.o-input { color: var(--text); border: 0; outline: 0; }
.setting--block textarea.o-input { width: 100%; min-height: 150px; }
td.wrap.mono { word-break: break-all; min-width: 260px; max-width: 420px; }
.tools input#bans-search { width: 280px; }

/* header: server name next to the title */
.top { flex-wrap: wrap; row-gap: 14px; }
.server-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--acc); }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .body { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .top { margin-bottom: 20px; }
  .nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; height: 44px; padding: 0 16px; gap: 10px; }
  .nav__th { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  #app { padding: 8px; }
  .shell { padding: 20px 16px; min-height: calc(100vh - 16px); }
  .shell::after { display: none; }
  .o-head { gap: 12px; }
  .top .o-hex { width: 40px; height: 40px; }
  .top .o-head__title { font-size: var(--fs-h2); }
  .top .server-name { display: none; }
  .top .o-head__end { flex: 1 1 100%; min-width: 0; margin-left: 0; }
  .server-pick { flex: 1; width: 0; min-width: 0; max-width: none; }
  .top #server-status { display: none; }

  .page-head { align-items: stretch; margin-bottom: 16px; }
  .page-head > div:first-child { flex: 1 1 100%; }
  .tools { flex: 1 1 100%; }
  .tools .o-input, .tools input.o-input, .tools input#bans-search { flex: 1 1 100%; width: auto; }
  .tools .o-btn { flex: 1 1 auto; }
  .save { width: 100%; min-width: 0; }
  .box { padding: 18px 16px; }
  .bulk { padding: 12px 14px; }
  .bulk .o-muted { flex: 1 1 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat__value { font-size: var(--fs-h2); overflow-wrap: anywhere; }
  .meter { grid-template-columns: 110px 1fr 36px; gap: 10px; }
  .group { padding: 16px 14px; }
  .setting { flex-wrap: wrap; padding: 12px 14px; }
  .setting__text { flex: 1 1 140px; }
  .setting .o-toggle { gap: 8px; }
  .setting .o-toggle button { width: 52px; }
  .pager { flex-wrap: wrap; }
  iframe#bancard-preview { height: 420px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .net-live { flex: 1 1 100%; justify-content: center; }
  .hbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .hbar__track { grid-column: 1 / -1; grid-row: 2; }

}

/* ---------- tables as cards (tablet portrait and phone) ---------- */
@media (max-width: 900px) {
  /* the column name sits on the left of every value */
  .table-wrap { overflow: visible; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards { border-spacing: 0; margin-top: 0; }
  table.cards thead { display: none; }
  table.cards tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; align-items: start; }
  table.cards tr { padding: 8px 16px; border-radius: var(--r-row); background: var(--well); }
  table.cards tr.is-red { background: var(--red-10); }
  table.cards tr.is-off { opacity: .55; }
  table.cards tr.is-off td { opacity: 1; }
  table.cards td {
    display: flex; justify-content: flex-end; align-items: center; gap: 6px 16px; flex-wrap: wrap;
    height: auto; min-height: 40px; padding: 6px 0; border-radius: 0; background: none !important;
    white-space: normal; text-align: right; overflow-wrap: anywhere;
  }
  table.cards td + td { border-top: 1px solid var(--line); }
  table.cards td::before {
    content: attr(data-label); flex: none; margin-right: auto; text-align: left; font-family: var(--font);
    font-size: var(--fs-tiny); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  }
  table.cards td[data-label=""]::before { display: none; }
  table.cards td.wrap, table.cards td.wrap.mono { min-width: 0; max-width: none; }
  table.cards .row-actions { flex: 1; flex-wrap: wrap; justify-content: stretch; }
  table.cards .row-actions .o-btn { flex: 1 1 auto; height: 38px; }
  table.cards td:has(> .row-actions:empty) { display: none; }
  table.cards .who { text-align: left; }
}

/* ---------- login with Discord ---------- */
.login-lead { color: var(--text-2); font-size: var(--fs-small); }
.login-discord {
  display: flex; align-items: center; justify-content: center; gap: 12px; height: 52px; border-radius: 12px;
  background: #5865F2; color: #FFFFFF; font-size: var(--fs-body); font-weight: 600; text-decoration: none;
  box-shadow: 0 10px 24px rgba(88, 101, 242, .22); transition: background .15s, box-shadow .15s, transform .15s;
}
.login-discord:hover { background: #4752C4; box-shadow: 0 12px 28px rgba(88, 101, 242, .32); }
.login-discord:active { transform: translateY(1px); }
.login-discord svg { width: 24px; height: 24px; }
#login-logo { cursor: default; user-select: none; }
.login-password { display: grid; gap: 14px; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: var(--fs-tiny); }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- signed-in user in the header ---------- */
.me { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 4px; border-radius: var(--r-btn); background: var(--box); }
.me:empty { display: none; }
.me img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--card); }
.me__text { display: grid; line-height: 1.15; }
.me__text b { font-weight: 500; font-size: var(--fs-small); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me__text .role { justify-self: start; height: 16px; padding: 0 6px; font-size: 10px; }

/* role chips: DEVELOPER red, ADMIN / MODERATOR cyan by strength, VIEWER grey */
.role { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-chip); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.role--developer { background: var(--red-17); color: var(--red); }
.role--admin { background: var(--acc-27); color: var(--acc); }
.role--moderator { background: var(--acc-10); color: var(--acc); }
.role--viewer { background: var(--soft); color: var(--text-2); }

/* ---------- TEAM page ---------- */
.team-tabs { margin-bottom: 20px; }
.team-setup { display: grid; gap: 8px; margin-bottom: 16px; padding: 16px 20px; border-radius: var(--r-row); background: rgba(255, 196, 107, .08); font-size: var(--fs-small); color: var(--text-2); }
.team-setup b { color: var(--gold); font-weight: 500; }
.team-setup code { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 6px; background: var(--box); color: var(--text); user-select: all; }
#team-invite { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#team-invite svg { width: 20px; height: 20px; }

.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 12px; }
.member { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-row); background: var(--well); }
.member.is-me { box-shadow: inset 3px 0 0 var(--acc); }
.member.is-off { opacity: .55; }
.member__avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--card); grid-row: span 2; }
.member__name { font-size: var(--fs-body); }
.member__sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.member__tags .tag { height: 24px; font-size: 11px; }
.member__meta { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-3); }
.member__meta b { color: var(--text-2); font-weight: 500; }
.member__note { flex-basis: 100%; color: var(--text-2); }
.member__edit { grid-column: 3; grid-row: 1; height: 36px; }

.matrix th { vertical-align: top; height: auto; padding-top: 12px; padding-bottom: 12px; white-space: normal; text-transform: none; letter-spacing: 0; }
.matrix th small { display: block; margin-top: 6px; color: var(--text-3); font-weight: 400; font-size: 11px; min-width: 110px; }
.matrix td { text-align: center; }
.matrix td:first-child { text-align: left; }
.matrix td:first-child small { display: block; color: var(--text-3); font-size: 11px; }
.matrix__group td { height: 34px; background: none !important; text-align: left !important; color: var(--acc); font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .06em; }
.perm-check { width: 40px; height: 28px; border: 0; border-radius: 8px; background: var(--box); cursor: pointer; }
.perm-check::after { content: '\2715'; color: var(--text-3); font-size: 13px; }
.perm-check.is-on { background: var(--acc-27); }
.perm-check.is-on::after { content: '\2713'; color: var(--acc); font-size: 15px; font-weight: 700; }
.perm-check:disabled { cursor: default; opacity: .75; }
.matrix__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.audit-tools { margin-bottom: 12px; }
.audit-tools .o-input { width: min(360px, 100%); }

/* ---------- invite / edit dialog ---------- */
dialog.team-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; }
.dialog-x { margin-left: auto; width: 36px; height: 36px; font-size: 16px; }
#team-dialog-body { display: grid; gap: 14px; margin-bottom: 22px; }
.team-dialog .dialog-actions { align-items: center; }
.edit-remove { margin-right: auto; }

.invite-preview { min-height: 96px; display: grid; align-content: center; padding: 4px 0; }
.profile { position: relative; overflow: hidden; border-radius: var(--r-row); background: var(--well); }
.profile__banner { height: 64px; opacity: .85; }
.profile__avatar { position: absolute; left: 20px; top: 24px; width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 5px solid #1f2021; background: var(--card); }
.profile__body { padding: 8px 20px 18px 124px; min-height: 76px; }
.profile__name { font-size: var(--fs-h2); line-height: 1.25; }
.profile__sub { font-size: var(--fs-small); color: var(--text-3); }
.profile__facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; }
.profile__facts span { display: grid; }
.profile__facts small { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.profile__facts b { font-weight: 500; font-size: var(--fs-small); }

.role-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.role-pick { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-row); background: var(--well); cursor: pointer; }
.role-pick input { display: none; }
.role-pick small { font-size: 11px; color: var(--text-3); line-height: 1.35; }
.role-pick .role { justify-self: start; }
.role-pick.is-active { background: var(--acc-14); box-shadow: inset 0 0 0 1px var(--acc-27); }

.perm-list { display: grid; gap: 10px; max-height: 300px; overflow: auto; padding-right: 4px; }
.perm-group { display: grid; gap: 4px; }
.perm-group__title { font-size: var(--fs-tiny); font-weight: 600; color: var(--acc); letter-spacing: .06em; }
.perm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 10px; background: var(--well); font-size: var(--fs-small); }
.seg { display: flex; gap: 4px; flex: none; }
.seg button { height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--box); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.seg button.is-on { background: var(--acc-27); color: var(--text); }
.seg button.is-on.is-red { background: var(--red-27); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg i { font-style: normal; margin-left: 2px; }
.seg i.yes { color: var(--acc); }
.seg i.no { color: var(--red); }

@media (max-width: 760px) {
  .me__text { display: none; }
  .me { padding: 0 4px; }
  .member { grid-template-columns: 48px minmax(0, 1fr); }
  .member__avatar { width: 48px; height: 48px; }
  .member__edit { grid-column: 1 / -1; grid-row: auto; width: 100%; }
  .perm-row { flex-wrap: wrap; }
  .profile__avatar { width: 68px; height: 68px; top: 30px; left: 14px; }
  .profile__body { padding-left: 96px; }
}

/* ---------- server switcher (header) ---------- */
.dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--text-3); }
.dot.is-on { background: var(--green); box-shadow: 0 0 0 4px rgba(var(--acc-rgb), .08), 0 0 10px var(--green); }
.server-switch { position: relative; }
.server-button {
  display: flex; align-items: center; gap: 12px; height: 44px; min-width: 240px; max-width: 360px; padding: 0 12px 0 16px;
  border: 0; border-radius: var(--r-btn); background: var(--box); color: var(--text); font: inherit; cursor: pointer; transition: background .15s;
}
.server-button:hover, .server-switch.is-open .server-button { background: rgba(var(--acc-rgb), .08); }
.server-button__text { display: grid; flex: 1; min-width: 0; text-align: left; line-height: 1.2; }
.server-button__text b { font-weight: 500; font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-button__text small { font-size: 11px; color: var(--text-3); }
.server-button__arrow { width: 20px; height: 20px; flex: none; color: var(--acc); transition: transform .2s; }
.server-switch.is-open .server-button__arrow { transform: rotate(180deg); }

.server-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(440px, calc(100vw - 24px));
  display: grid; gap: 4px; padding: 10px; border-radius: var(--r-card); background: var(--card);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--line);
}
.server-menu__head { display: flex; justify-content: space-between; padding: 6px 10px 10px; font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .04em; color: var(--text-2); }
.server-menu__head .o-muted { font-weight: 400; }
.server-option {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 0; border-radius: var(--r-row);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.server-option:hover { background: var(--well); }
.server-option.is-active { background: var(--acc-14); }
.server-option.is-off .server-option__main b { color: var(--text-2); }
.server-option__main { display: grid; flex: 1; min-width: 0; gap: 2px; }
.server-option__main b { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--fs-small); }
.server-option__main b .tag { height: 20px; padding: 0 8px; font-size: 10px; }
.server-option__main small { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-option__side { display: grid; flex: none; text-align: right; line-height: 1.2; }
.server-option__side b { font-weight: 500; color: var(--acc); }
.server-option__side small { font-size: 11px; color: var(--text-3); }
.server-option__check { width: 18px; height: 18px; flex: none; color: var(--acc); }
.server-menu__foot {
  display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 12px 14px; border: 0; border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-row) var(--r-row); background: none; color: var(--text-2); font: inherit; font-size: var(--fs-small); cursor: pointer;
}
.server-menu__foot:hover { color: var(--acc); }
.server-menu__foot svg { width: 18px; height: 18px; }

/* ---------- collapsible sidebar ---------- */
.body { transition: grid-template-columns .2s var(--ease, ease); }
.nav-toggle {
  display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 20px; border: 0; border-radius: var(--r-row);
  background: none; color: var(--text-3); font: inherit; cursor: pointer;
}
.nav-toggle:hover { color: var(--acc); background: var(--well); }
.nav-toggle svg { width: 20px; height: 20px; flex: none; }
.nav-toggle .nav__en { font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; }

@media (min-width: 1101px) {
  .nav-mini .body { grid-template-columns: 64px minmax(0, 1fr); }
  .nav-mini .nav a, .nav-mini .nav-toggle { justify-content: center; padding: 0; }
  .nav-mini .nav__en, .nav-mini .nav__th { display: none; }
  .nav-mini .nav a.active { box-shadow: inset 3px 0 0 var(--acc); }
}

/* ---------- SETTINGS page ---------- */
.settings-note { margin: -6px 0 18px; font-size: var(--fs-small); color: var(--text-2); }
.settings-note b { color: var(--acc); font-weight: 500; }
.server-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.server-card { display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--r-row); background: var(--well); }
.server-card.is-default { background: var(--acc-10); box-shadow: inset 0 0 0 1px var(--acc-27); }
.server-card.is-off .server-card__title b { color: var(--text-2); }
.server-card__head { display: flex; align-items: center; gap: 12px; }
.server-card__title { display: grid; flex: 1; min-width: 0; }
.server-card__title b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card__title small { font-size: 11px; color: var(--text-3); }
.server-card__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 18px; }
.server-card__facts span { display: grid; gap: 2px; }
.server-card__facts small { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.server-card__facts b { font-weight: 500; font-size: var(--fs-small); }
.server-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.server-card__actions .o-btn { height: 36px; }
.server-card__actions .o-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- BANS ---------- */
.ban-code {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px;
  background: var(--acc-10); color: var(--acc); font-family: ui-monospace, Consolas, monospace; font-size: 13px; letter-spacing: .06em; user-select: all;
}

@media (max-width: 1100px) {
  .nav-toggle { display: none; }
}

@media (max-width: 760px) {
  .top .server-switch { flex: 1; min-width: 0; }
  .server-button { width: 100%; min-width: 0; max-width: none; }
  .server-menu { position: fixed; top: 120px; left: 12px; right: 12px; width: auto; }
  .server-option__side { display: none; }
}

/* players: online / everyone */
.players-mode .o-chip { height: 40px; padding: 0 16px; white-space: nowrap; }
@media (max-width: 760px) {
  .players-mode { flex: 1 1 100%; grid-auto-columns: 1fr; }
}

/* OWNER and per-server team */
.role--owner { background: rgba(255, 196, 107, .16); color: var(--gold); }
.role--none { background: var(--soft); color: var(--text-3); }
.team-scope { margin: -6px 0 16px; font-size: var(--fs-small); color: var(--text-2); }
.team-scope b { color: var(--acc); font-weight: 500; }
.bans-filter { width: 240px; }
.ban-scope-note { font-size: 12px; }
.ban-scope-note b { color: var(--acc); font-weight: 500; }
.settings-box + .settings-box { margin-top: 16px; }
.settings-words { width: 100%; min-height: 120px; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

/* detection recordings */
.clip-play { display: inline-flex; align-items: center; gap: 6px; }
.clip-play svg { width: 16px; height: 16px; }
dialog.video-dialog { width: min(960px, calc(100vw - 24px)); color: var(--text); border: 0; }
#video-player { display: block; width: 100%; max-height: 70vh; border-radius: var(--r-row); background: #000; }
.video-note { margin-top: 10px; font-size: 12px; }

/* GLOBAL + BYPASS tags side by side */
td .tag + .tag { margin-left: 6px; }
