/* Warden – dark ops console. */
:root {
  --bg: #0b0d10;
  --bg-2: #0e1115;
  --panel: #12161b;
  --panel-2: #171c22;
  --panel-3: #1d232b;
  --border: #232a33;
  --border-2: #2e3742;
  --text: #e6e9ee;
  --text-2: #aab3bf;
  --muted: #7b8591;
  --accent: #f59e0b;
  --accent-2: #fbbf24;
  --accent-bg: rgba(245, 158, 11, 0.12);
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.12);
  --bad: #ef4444;
  --bad-bg: rgba(239, 68, 68, 0.12);
  --warn: #f97316;
  --warn-bg: rgba(249, 115, 22, 0.13);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.14);
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar-w: 232px;
  --sidebar-w-c: 60px;
  --topbar-h: 52px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
body.modal-open { overflow: hidden; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 13px; }
p { margin: 0 0 10px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--border-2); border-radius: 4px; background: var(--panel-2); }
::selection { background: rgba(245, 158, 11, 0.3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262d36; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* utilities */
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.accent { color: var(--accent); }
.text-bad { color: var(--bad); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.grow { flex: 1 1 auto; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.wrap-text { white-space: normal; word-break: break-word; }
.al-right { text-align: right; justify-content: flex-end; }
.al-center { text-align: center; }
.mt { margin-top: 16px; }
.pad { padding: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.row-end > .muted:first-child { margin-right: auto; }
.sep { width: 1px; height: 18px; background: var(--border-2); display: inline-block; margin: 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid2.gap { gap: 16px; margin-top: 16px; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.mobile-only { display: none !important; }

/* boot */
.boot { height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); letter-spacing: 0.3em; font-weight: 600; font-size: 13px; }
.boot-mark { width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 4px; transform: rotate(45deg); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width 0.18s ease; z-index: 40;
}
.sidebar.collapsed { width: var(--sidebar-w-c); }
.brand { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; border-bottom: 1px solid var(--border); gap: 6px; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none !important; min-width: 0; }
.brand-mark { flex: none; }
.brand-name { font-weight: 700; letter-spacing: 0.28em; font-size: 13px; color: var(--text); }
.sidebar.collapsed .brand { padding: 0; flex-direction: column; justify-content: center; gap: 2px; height: auto; min-height: var(--topbar-h); padding: 8px 0; }
.sidebar.collapsed .brand-name { display: none; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 14px 10px 6px; }
.sidebar.collapsed .nav-section { font-size: 0; padding: 8px 0; border-top: 1px solid var(--border); margin: 6px 8px 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none !important; font-weight: 500; font-size: 13.5px; position: relative; white-space: nowrap;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-2); }
.nav-item.active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 42px; }
.sidebar.collapsed .sidebar-foot { justify-content: center; padding: 10px 0; }
.ws-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.ws-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.ws-state.open i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.ws-state.connecting i, .ws-state.closed i { background: var(--warn); animation: pulse 1s infinite; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--border); background: rgba(11, 13, 16, 0.85); backdrop-filter: blur(8px);
}
.tb-server { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.tb-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-stats { display: flex; align-items: center; gap: 8px; }
.tb-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--panel); color: var(--text); font-size: 13px; text-decoration: none !important; white-space: nowrap;
}
.tb-pill:hover { border-color: var(--border-2); }
.tb-pill.warn { color: var(--accent-2); border-color: rgba(245, 158, 11, 0.4); background: var(--accent-bg); }
.user-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel); cursor: pointer; max-width: 180px;
}
.user-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn:hover { border-color: var(--border-2); }
.content { flex: 1; overflow: auto; }
.content-full { overflow: hidden; display: flex; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 35; }

.page { padding: 22px 24px 40px; max-width: 1600px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.back:hover { color: var(--text); text-decoration: none; }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none !important; user-select: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: #3a4552; }
.btn:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1204; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.danger:hover:not(:disabled) { background: #dc2626; }
.btn.danger-ghost { color: #fca5a5; }
.btn.danger-ghost:hover:not(:disabled) { background: var(--bad-bg); border-color: rgba(239, 68, 68, 0.5); color: #fecaca; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; flex: none; text-decoration: none !important;
}
.icon-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.solid { background: var(--panel); border-color: var(--border); }

.input {
  width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-2);
  background: var(--bg-2); color: var(--text); font: inherit; font-size: 13.5px; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }
.input::placeholder { color: #5a636e; }
.input:disabled, .input[readonly] { color: var(--text-2); background: var(--panel); }
.input.sm { height: 30px; font-size: 12.5px; }
.input.auto { width: auto; }
.input.num { width: 78px; }
select.input { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8591' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }
input[type="datetime-local"].input, input[type="time"].input { color-scheme: dark; }
.input-icon { position: relative; display: flex; align-items: center; min-width: 200px; flex: 0 1 320px; }
.input-icon > .ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 32px; }
.input-icon.sm { min-width: 140px; flex: 0 1 220px; }
.input-icon.sm > .ic { left: 9px; }
.input-icon.sm > .input { padding-left: 28px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field-hint { font-size: 11.5px; color: var(--muted); }
.field-error { font-size: 11.5px; color: var(--bad); }
.inline-field { display: inline-flex; align-items: center; gap: 6px; }
.inline-field .input { width: auto; }

.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; padding: 3px 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { width: 32px; height: 18px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--border-2); position: relative; flex: none; transition: background 0.15s; }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-2); transition: transform 0.15s, background 0.15s; }
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(14px); background: #1a1204; }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle.disabled { opacity: 0.45; cursor: not-allowed; }
.toggle-label { color: var(--text-2); }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 2px; margin-bottom: 12px; gap: 2px; }
.seg.wrap { flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; padding: 5px 11px; border-radius: 4px; cursor: pointer; color: var(--text-2); font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--panel-3); color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--border-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--panel); color: var(--text-2); cursor: pointer; font-size: 12.5px; font-weight: 500;
}
.chip:hover { color: var(--text); border-color: #3a4552; }
.chip.active { background: var(--accent-bg); color: var(--accent-2); border-color: rgba(245, 158, 11, 0.45); }
.chip-ic .ev-ic { width: 18px; height: 18px; margin-left: -5px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px;
  font-weight: 600; letter-spacing: 0.02em; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--border-2);
  white-space: nowrap; vertical-align: middle; text-transform: lowercase;
}
.badge-ok { background: var(--ok-bg); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.badge-bad { background: var(--bad-bg); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.badge-warn { background: var(--warn-bg); color: #fb923c; border-color: rgba(249, 115, 22, 0.3); }
.badge-info { background: var(--info-bg); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.badge-accent { background: var(--accent-bg); color: var(--accent-2); border-color: rgba(245, 158, 11, 0.35); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.flags { display: inline-flex; gap: 4px; flex-wrap: wrap; }

.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.sdot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg), 0 0 8px rgba(34, 197, 94, 0.6); }
.sdot.off { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.sdot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }

.spinner { display: inline-block; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.bar { height: 6px; background: var(--panel-3); border-radius: 999px; overflow: hidden; min-width: 50px; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.bar-ok { background: var(--ok); }
.bar-warn { background: var(--accent); }
.bar-bad { background: var(--bad); }
.bar-info { background: var(--info); }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 16px; color: var(--muted); gap: 6px; }
.empty-compact { padding: 22px 12px; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-2); margin-bottom: 4px; }
.empty-compact .empty-icon { width: 34px; height: 34px; border-radius: 9px; }
.empty-title { color: var(--text-2); font-weight: 600; }
.empty-body { font-size: 13px; max-width: 420px; }
.errbox { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bad-bg); border: 1px solid rgba(239, 68, 68, 0.35); color: #fecaca; margin-bottom: 12px; font-size: 13px; }
.errbox > span { flex: 1; }

/* ---------------------------------------------------------------- cards/stats */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); min-height: 46px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); text-transform: none; }
.card-head h3 .ic { color: var(--muted); }
.card-actions { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-body.nopad { padding: 0; }
.card-foot { padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12.5px; }
.card-note { padding: 12px 16px 0; margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; position: relative; overflow: hidden; min-width: 0; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; }
.stat-ok::after { background: var(--ok); }
.stat-bad::after { background: var(--bad); }
.stat-warn::after { background: var(--accent); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.stat-icon { color: var(--muted); display: flex; }
.stat-value { font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value a { color: inherit; }
.stat-inline { display: inline-flex; align-items: center; gap: 10px; }
.stat-of { color: var(--muted); font-size: 15px; font-weight: 500; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid.three { grid-template-columns: 1fr 1fr 1.6fr; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.mini-grid .stat-value { font-size: 20px; }

.leader { list-style: none; margin: 0; padding: 6px 0; }
.leader li { display: flex; align-items: center; gap: 10px; padding: 7px 16px; }
.leader li:hover { background: var(--panel-2); }
.rank { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--panel-3); color: var(--text-2); font-family: var(--mono); flex: none; }
.rank.r1 { background: var(--accent); color: #1a1204; }
.rank.r2 { background: #9ca3af; color: #111; }
.rank.r3 { background: #b45309; color: #fff; }
.leader-val { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* event feed */
.feed { max-height: 420px; overflow-y: auto; padding: 4px 0; }
.feed.tall { max-height: 560px; }
.ev-row { display: flex; align-items: center; gap: 10px; padding: 6px 14px; font-size: 13px; border-bottom: 1px solid rgba(35, 42, 51, 0.5); }
.ev-row:last-child { border-bottom: 0; }
.ev-row:hover { background: var(--panel-2); }
.ev-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-pos { font-size: 11px; color: var(--muted); flex: none; }
.ev-time { font-size: 11px; color: var(--muted); flex: none; }
.ev-weapon { font-family: var(--mono); font-size: 0.9em; color: var(--accent-2); }
.ev-chat { color: var(--text); }
.ev-ic { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--panel-3); color: var(--text-2); }
.ev-connect { color: #4ade80; background: var(--ok-bg); }
.ev-disconnect { color: var(--muted); }
.ev-kill { color: #f87171; background: var(--bad-bg); }
.ev-death { color: #fb923c; background: var(--warn-bg); }
.ev-hit { color: #fca5a5; }
.ev-chat.ev-ic { color: #60a5fa; background: var(--info-bg); }
.ev-build { color: var(--accent-2); background: var(--accent-bg); }
.ev-admin { color: #c084fc; background: rgba(168, 85, 247, 0.14); }
.ev-custom { color: #2dd4bf; background: rgba(45, 212, 191, 0.12); }
.plink { color: var(--text); font-weight: 500; }
.plink:hover { color: var(--accent-2); }

/* chart */
.chart { position: relative; width: 100%; }
.chart svg { display: block; }
.chart-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.grid-line { stroke: var(--border); stroke-width: 1; }
.cap-line { stroke: var(--muted); stroke-dasharray: 3 4; stroke-width: 1; opacity: 0.6; }
.cross-line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.axis-text { fill: var(--muted); font-size: 10.5px; font-family: var(--mono); }
.chart-tip { position: absolute; top: 0; background: var(--panel-3); border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 8px; font-size: 12px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.spark { display: block; }

/* ---------------------------------------------------------------- tables */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); max-width: 100%; }
.card .table-wrap { border: 0; border-radius: 0; background: transparent; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 2; background: var(--panel-2); text-align: left; font-weight: 500; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.th-in { display: inline-flex; align-items: center; gap: 4px; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.sort-ic { opacity: 0; display: inline-flex; }
.tbl th.sortable:hover .sort-ic { opacity: 0.5; }
.sort-ic.on { opacity: 1 !important; color: var(--accent); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid rgba(35, 42, 51, 0.7); vertical-align: middle; }
.tbl.dense td { padding: 6px 12px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(29, 35, 43, 0.6); }
.tbl.clickable tbody tr:not(.empty-row) { cursor: pointer; }
.tbl .empty-row:hover td { background: transparent; }
.tbl td.al-right, .tbl th.al-right { text-align: right; }
.tbl td.al-center, .tbl th.al-center { text-align: center; }
.row-dim td { opacity: 0.6; }
.row-new td { animation: flash 2s ease-out; }
@keyframes flash { from { background: rgba(245, 158, 11, 0.12); } }
.cell-name { display: inline-flex; align-items: center; gap: 8px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; font-size: 12.5px; }
.pager-btns { display: flex; align-items: center; gap: 4px; }
.pager-cur { padding: 0 8px; }
.load-more { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); font-family: var(--mono); }
.tab.active .tab-count { background: var(--accent-bg); color: var(--accent-2); }

/* ---------------------------------------------------------------- menus */
.menu-wrap { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 4px); z-index: 60; min-width: 200px; background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; animation: pop 0.1s ease-out;
}
.menu-right { right: 0; }
.menu-fixed { position: fixed; top: auto; overflow-y: auto; z-index: 150; }
.menu-left { left: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; background: transparent; border-radius: 5px; text-align: left; cursor: pointer; color: var(--text); font-size: 13px; white-space: nowrap; }
.menu-item:hover:not(:disabled) { background: var(--panel-3); }
.menu-item:disabled { opacity: 0.4; cursor: not-allowed; }
.menu-item .ic { color: var(--muted); }
.menu-item.danger { color: #fca5a5; }
.menu-item.danger .ic { color: #f87171; }
.menu-div { height: 1px; background: var(--border); margin: 4px 2px; }
.menu-title { padding: 6px 10px 7px; font-size: 11.5px; color: var(--accent); border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* combobox */
.combo { position: relative; width: 100%; }
.combo .input-icon { min-width: 0; flex: 1; width: 100%; max-width: none; }
.combo-spin { position: absolute; right: 10px; display: flex; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70; max-height: 280px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; }
.combo-opt { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; width: 100%; padding: 6px 9px; border: 0; background: transparent; border-radius: 5px; text-align: left; cursor: pointer; }
.combo-opt.active { background: var(--panel-3); }
.combo-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-sub { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.combo-none { padding: 10px; color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- modal / toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(3, 5, 8, 0.7); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; overflow-y: auto; animation: fade 0.12s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; background: var(--panel); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); animation: pop 0.14s ease-out; display: flex; flex-direction: column; margin: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 13px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.modal-head h2 .ic { color: var(--accent); }
.modal-body { padding: 16px 18px 6px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg-2); border-radius: 0 0 10px 10px; }
.foot-note { margin-right: auto; font-size: 12px; }
.confirm-msg { color: var(--text-2); padding-bottom: 12px; word-break: break-word; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 10px 10px 13px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 13px; animation: slidein 0.18s ease-out; border-left: 3px solid var(--info); }
.toast > .ic { margin-top: 1px; }
.toast-msg { flex: 1; word-break: break-word; padding-top: 1px; }
.toast-ok { border-left-color: var(--ok); } .toast-ok > .ic { color: var(--ok); }
.toast-error { border-left-color: var(--bad); } .toast-error > .ic { color: var(--bad); }
.toast-warn { border-left-color: var(--warn); } .toast-warn > .ic { color: var(--warn); }
.toast-info > .ic { color: var(--info); }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.auth-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%); }
.auth-card { position: relative; width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 26px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 18px 0 10px; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.auth-title { font-weight: 700; letter-spacing: 0.3em; color: var(--text); }
.auth-card .btn { margin-top: 6px; height: 38px; }

/* ---------------------------------------------------------------- map */
.map-page { flex: 1; display: flex; min-width: 0; min-height: 0; height: 100%; }
.map-area { flex: 1; position: relative; min-width: 0; isolation: isolate; }
.map-el { position: absolute; inset: 0; background: #07090b; z-index: 0; }
.map-loading { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.map-hud { position: absolute; z-index: 500; display: flex; align-items: center; gap: 10px; }
.map-hud-tl { top: 12px; left: 12px; }
.map-hud-bl { bottom: 24px; left: 12px; background: rgba(11, 13, 16, 0.85); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 12px; gap: 14px; pointer-events: none; }
.map-title { background: rgba(11, 13, 16, 0.85); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; }
.cap { text-transform: capitalize; }
.ruler { position: absolute; z-index: 450; pointer-events: none; font-family: var(--mono); font-size: 10px; color: rgba(245, 158, 11, 0.8); }
.ruler span { position: absolute; transform: translate(-50%, -50%); background: rgba(7, 9, 11, 0.75); padding: 0 3px; border-radius: 2px; }
.ruler-x { left: 0; right: 30px; bottom: 0; height: 16px; }
.ruler-x span { top: 50%; }
.ruler-z { top: 0; bottom: 16px; right: 0; width: 30px; }
.ruler-z span { left: 50%; }
.map-ctx { position: absolute; top: 0; left: 0; z-index: 800; }
.map-panel { width: 290px; flex: none; border-left: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel-hidden .map-panel { display: none; }
.map-panel-sec { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.map-panel-sec.grow { flex: 1; min-height: 0; }
.map-panel-title { display: flex; align-items: center; gap: 7px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.map-panel-sec .input-icon { flex: none; min-width: 0; width: 100%; max-width: none; margin-bottom: 4px; }
.map-plist { overflow-y: auto; flex: 1; margin: 0 -6px; }
.map-pl { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 0; background: transparent; border-radius: 5px; text-align: left; cursor: pointer; font-size: 13px; }
.map-pl:hover:not(:disabled) { background: var(--panel-2); }
.map-pl.active { background: var(--accent-bg); }
.map-pl:disabled { opacity: 0.5; cursor: default; }
.pl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.pl-uncon { background: var(--warn); }
.pl-dead { background: var(--bad); }
.kv { display: grid; grid-template-columns: 64px 1fr; gap: 7px 10px; align-items: center; }
.kv > span:nth-child(odd) { color: var(--muted); }
.sel-card { background: var(--panel); }

.leaflet-container { background: #07090b; font-family: var(--font); outline: none; }
.leaflet-container a { color: var(--accent-2); }
.map-el .leaflet-bottom.leaflet-right .leaflet-control { margin: 0 40px 26px 0; }
.leaflet-bar { border: 1px solid var(--border-2) !important; box-shadow: none !important; }
.leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-bottom-color: var(--border) !important; }
.leaflet-bar a:hover { background: var(--panel-3) !important; }
.map-image { image-rendering: auto; }
.pm-wrap { background: none; border: 0; }
.pm { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.pm-dot { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid #0b0d10; box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6), 0 0 10px rgba(34, 197, 94, 0.45); cursor: pointer; }
.pm-arrow { position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; transition: transform 0.6s ease; pointer-events: none; }
.pm-arrow::before { content: ""; position: absolute; left: 7px; top: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--ok); }
.pm-label { position: absolute; left: 11px; top: -9px; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: #fff; padding: 1px 6px; border-radius: 4px; background: rgba(11, 13, 16, 0.78); border: 1px solid rgba(255, 255, 255, 0.08); pointer-events: none; }
.hide-names .pm-label { display: none; }
.hide-names .pm-sel .pm-label { display: block; }
.pm-uncon .pm-dot, .pm-dead .pm-dot { background: var(--bad); box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.7), 0 0 10px rgba(239, 68, 68, 0.5); }
.pm-uncon .pm-arrow::before, .pm-dead .pm-arrow::before { border-bottom-color: var(--bad); }
.pm-dead .pm-label { color: #fca5a5; text-decoration: line-through; }
.pm-god .pm-dot { border-color: var(--info); }
.pm-frozen .pm-dot { outline: 2px dashed #93c5fd; outline-offset: 2px; }
.pm-veh .pm-dot { border-radius: 3px; }
.pm-sel .pm-dot { box-shadow: 0 0 0 3px var(--accent), 0 0 14px rgba(245, 158, 11, 0.8); }
.pm-sel .pm-label { border-color: var(--accent); }
.pin-wrap { background: none; border: 0; }
.map-pin { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25); animation: ping 1.6s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); } 100% { box-shadow: 0 0 0 18px rgba(245, 158, 11, 0); } }
.wd-popup .leaflet-popup-content-wrapper { background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.wd-popup .leaflet-popup-tip { background: var(--panel-2); border: 1px solid var(--border-2); }
.wd-popup .leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.4; }
.wd-popup a.leaflet-popup-close-button { color: var(--muted); }
.pp-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; padding-right: 12px; }
.pp-name { font-weight: 600; font-size: 14px; color: var(--text) !important; }
.pp-stats { display: grid; grid-template-columns: 40px 1fr; gap: 5px 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.pp-meta { font-size: 11px; color: var(--muted); margin: 8px 0; word-break: break-all; }
.pp-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.pp-actions .btn { padding: 0 6px; }
.leaflet-tooltip.wd-tip { background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 12px; }
.leaflet-tooltip.wd-tip::before { display: none; }

/* ---------------------------------------------------------------- profile */
.profile-head { display: flex; justify-content: space-between; gap: 20px; padding: 18px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.ph-main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.avatar { width: 54px; height: 54px; border-radius: 12px; background: linear-gradient(135deg, #3a2a0a, #1d232b); border: 1px solid rgba(245, 158, 11, 0.35); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-2); font-size: 18px; flex: none; }
.ph-id { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ph-id h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 21px; word-break: break-word; }
.ph-ids { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--text-2); }
.guid { max-width: 220px; }
.ph-stats { display: grid; grid-template-columns: repeat(5, auto); gap: 6px 26px; align-content: center; }
.ph-stats > div { display: flex; flex-direction: column; gap: 2px; }
.ph-stats b { font-weight: 600; white-space: nowrap; }
.action-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; }
.ab-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ab-group .toggle { padding: 0 6px; }
.live-card { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; padding: 14px 18px; margin-bottom: 12px; border-color: rgba(34, 197, 94, 0.25); }
.lc-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.profile-grid .col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.list { list-style: none; margin: 0; padding: 4px 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid rgba(35, 42, 51, 0.6); font-size: 13px; }
.list li:last-child { border-bottom: 0; }
.note-form { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.note-text { white-space: pre-wrap; word-break: break-word; }

/* ---------------------------------------------------------------- logs */
.filters { padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.logs-tbl .ev-cell { white-space: normal; word-break: break-word; }
.logs-tbl .ev-ic { width: 22px; height: 22px; }
.secs { opacity: 0.55; }

/* ---------------------------------------------------------------- console */
.console-page { display: flex; flex-direction: column; height: 100%; }
.quick-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.console { flex: 1; min-height: 320px; background: #07090b; border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; overflow: auto; padding: 10px 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.console-empty { color: var(--muted); padding: 6px 14px; }
.cl { display: flex; gap: 12px; padding: 0 14px; white-space: pre-wrap; word-break: break-word; }
.cl:hover { background: rgba(255, 255, 255, 0.025); }
.cl-ts { color: #4b5563; flex: none; user-select: none; }
.cl-in .cl-text { color: #cbd5e1; }
.cl-out .cl-text { color: var(--accent-2); }
.cl-resp .cl-text { color: #a7f3d0; }
.cl-err .cl-text { color: #fca5a5; }
.console-input { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 8px 10px; }
.console-input .input { border-color: transparent; background: transparent; }
.console-input .input:focus { box-shadow: none; border-color: transparent; }
.prompt { color: var(--accent); }
.content > .console-page { min-height: calc(100vh - var(--topbar-h)); }

/* ---------------------------------------------------------------- server */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.restart-pending { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-bg); border: 1px solid rgba(245, 158, 11, 0.35); margin-bottom: 12px; }
.big { font-size: 24px; font-weight: 600; color: var(--accent-2); }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; align-items: center; }
.btn.preset { height: 32px; }
.preset-custom { display: flex; gap: 6px; }
.preset-custom .input { width: 130px; }
.sched-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 5px; background: var(--panel-3); border: 1px solid var(--border-2); font-size: 12.5px; }
.tag-x { display: inline-flex; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 3px; }
.tag-x:hover { color: var(--bad); background: var(--bad-bg); }
.inline-add { display: flex; gap: 6px; }
.inline-add .input { width: 140px; }
.msg-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.msg-row .inline-field .input { width: 70px; }

/* ---------------------------------------------------------------- files */
.types-wrap { max-height: calc(100vh - 300px); min-height: 300px; }
.types-tbl td { padding: 3px 8px; }
.types-tbl th { padding: 8px; }
.sticky-col { position: sticky; left: 0; z-index: 1; background: var(--panel); }
.types-tbl th.sticky-col { z-index: 3; background: var(--panel-2); }
.types-tbl tbody tr:hover .sticky-col { background: var(--panel-2); }
.row-dirty td { background: rgba(245, 158, 11, 0.06); }
.row-dirty .sticky-col { background: #1f1a10 !important; box-shadow: inset 3px 0 0 var(--accent); }
.cell-num { width: 72px; height: 26px; padding: 0 6px; text-align: right; font-family: var(--mono); font-size: 12px; background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--text); }
.cell-num:hover { border-color: var(--border-2); }
.cell-num:focus { outline: none; border-color: var(--accent); background: var(--bg-2); }
.cell-select { height: 26px; background: transparent; border: 1px solid transparent; color: var(--text-2); border-radius: 4px; font-size: 12px; max-width: 120px; }
.cell-select:hover, .cell-select:focus { border-color: var(--border-2); background: var(--bg-2); }
.cell-select option { background: var(--panel); }
.flag-cb { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; margin-right: 3px; font-size: 9.5px; color: var(--muted); font-family: var(--mono); cursor: pointer; }
.flag-cb input { width: 13px; height: 13px; }
.chip-cell { display: flex; flex-wrap: wrap; gap: 3px; border: 1px dashed transparent; background: transparent; padding: 2px 4px; border-radius: 4px; cursor: pointer; min-width: 40px; max-width: 220px; }
.chip-cell:hover { border-color: var(--border-2); }
.mini-chip { font-size: 10.5px; padding: 1px 6px; border-radius: 3px; background: var(--panel-3); color: var(--text-2); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.ftp { display: grid; grid-template-columns: 340px 1fr; gap: 12px; min-height: 560px; }
.ftp-list { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 230px); }
.crumbs { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; font-size: 12.5px; }
.crumb { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; padding: 3px 5px; border-radius: 4px; font-family: var(--mono); font-size: 12px; }
.crumb:hover { background: var(--panel-3); color: var(--text); }
.ftp-entries { overflow-y: auto; flex: 1; padding: 4px; }
.ftp-entry { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; text-align: left; font-size: 13px; }
.ftp-entry:hover { background: var(--panel-2); }
.ftp-entry.active { background: var(--accent-bg); color: var(--accent-2); }
.ftp-entry .ic { color: var(--muted); }
.ftp-placeholder { display: flex; align-items: center; justify-content: center; }
.editor { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 230px); overflow: hidden; }
.editor-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); }
.code-area { flex: 1; display: flex; min-height: 420px; overflow: hidden; background: #07090b; border-radius: 0 0 var(--radius) var(--radius); }
.gutter { margin: 0; padding: 10px 10px 10px 12px; text-align: right; color: #4b5563; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; overflow: hidden; user-select: none; background: var(--bg-2); border-right: 1px solid var(--border); min-width: 52px; }
.code { flex: 1; margin: 0; border: 0; outline: none; resize: none; padding: 10px 12px; background: transparent; color: #d1d5db; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; tab-size: 4; white-space: pre; overflow: auto; }

/* ---------------------------------------------------------------- settings */
.settings { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.snav { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 0; background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); font-size: 13.5px; text-align: left; font-weight: 500; }
.snav:hover { background: var(--panel-2); color: var(--text); }
.snav.active { background: var(--panel-2); color: var(--accent-2); box-shadow: inset 2px 0 0 var(--accent); }
.settings-body { min-width: 0; max-width: 900px; }
.save-bar { display: flex; align-items: center; gap: 10px; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.test-wrap { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.test-result { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.img-row { display: flex; gap: 16px; align-items: flex-start; }
.map-thumb { width: 120px; height: 120px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border-2); flex: none; background: var(--bg-2); }
.empty-thumb { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.snippet { position: relative; }
.snippet pre { margin: 0; padding: 12px 14px; background: #07090b; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; overflow-x: auto; color: #d1d5db; }
.snippet-copy { position: absolute; top: 6px; right: 6px; }
.discord-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.discord-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.discord-label { width: 150px; font-size: 13px; color: var(--text-2); flex: none; }
.discord-row .input { flex: 1; min-width: 220px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 12px; }
.perm-cb { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.perm-cb.dim { opacity: 0.55; }
.roles-tbl td, .roles-tbl th { padding: 8px 14px; }
.narrow { max-width: 380px; }
.wl-switch { display: flex; align-items: center; padding: 0 6px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .dash-grid.three { grid-template-columns: 1fr 1fr; }
  .dash-grid.three .feed-card { grid-column: 1 / -1; }
  .ph-stats { grid-template-columns: repeat(3, auto); }
}
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .sched-grid { grid-template-columns: 1fr; }
  .ftp { grid-template-columns: 1fr; }
  .ftp.has-file .ftp-list { max-height: 260px; }
  .map-panel { width: 250px; }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-flex !important; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform 0.2s ease; width: var(--sidebar-w) !important; box-shadow: var(--shadow); }
  .sidebar.mobile-open { transform: none; }
  .sidebar .collapse-btn { display: none; }
  .sidebar.collapsed .brand { flex-direction: row; justify-content: space-between; padding: 0 10px 0 16px; }
  .sidebar.collapsed .brand-name, .sidebar.collapsed .nav-item span { display: inline; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .sidebar.collapsed .nav-section { font-size: 10.5px; padding: 14px 10px 6px; border: 0; margin: 0; }
  .topbar { padding: 0 10px; gap: 8px; }
  .tb-sub { display: none; }
  .user-btn span { display: none; }
  .page { padding: 16px 16px 32px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-value { font-size: 18px; }
  .dash-grid.three { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .server-grid { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .snav { white-space: nowrap; }
  .map-page { flex-direction: column; }
  .map-area { min-height: 60vh; }
  .map-panel { width: 100%; border-left: 0; border-top: 1px solid var(--border); max-height: 40vh; }
  .input-icon { flex: 1 1 100%; min-width: 0; }
  .ph-stats { grid-template-columns: repeat(2, auto); }
  .hide-sm { display: none; }
  .discord-label { width: 100%; }
  .img-row { flex-direction: column; }
  .modal-backdrop { padding-top: 16px; }
  .pp-actions { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- launcher & news ---- */
.span2 { grid-column: span 2; }
.news-list, .launcher-setup { display: grid; gap: 14px; }
.news-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-title { font-size: 15px; }
.news-body { white-space: pre-wrap; color: var(--text-2, #aab4c0); margin-top: 10px; line-height: 1.55; max-width: 80ch; overflow-wrap: anywhere; }
.mod-list li { gap: 8px; }
.mod-list .input { height: 32px; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg, #0b0d10); padding: 12px 0; border-top: 1px solid var(--border, #232a33); z-index: 2; }
@media (max-width: 760px) { .span2 { grid-column: auto; } .mod-list li { flex-wrap: wrap; } }

/* ---- world objects ---- */
.badge-violet { background: rgba(167, 139, 250, 0.13); color: #c4b5fd; border-color: rgba(167, 139, 250, 0.32); }
.kind-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chip-count { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.chip.active .chip-count { color: var(--accent); }
.hp-cell { display: flex; align-items: center; gap: 8px; }
.hp-cell .bar { flex: 1; }
.hp-cell .mono { min-width: 34px; text-align: right; line-height: 1; }
.snap-age { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wp-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; margin-top: 4px; }
.wp-meta > span:nth-child(odd) { color: var(--muted); }
.wp-cls { font-family: var(--mono); font-size: 13px; font-weight: 600; word-break: break-all; }
.wp-actions { margin-top: 10px; display: flex; gap: 6px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 10px; padding-left: 44px; font-size: 11.5px; color: var(--muted); }
.legend-row span { display: inline-flex; align-items: center; gap: 5px; }

/* ---- console (poll mode) ---- */
.console-note { display: flex; align-items: center; gap: 8px; padding: 7px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--muted); font-size: 12.5px; }
.console-note .ic { flex: none; }
