:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  --bg: #ffffff;
  --panel: #ffffff;
  --sidebar: #f6f8fa;
  --soft: #f6f8fa;
  --hover: #eff2f5;
  --text: #1f2328;
  --muted: #59636e;
  --faint: #818b98;
  --line: #d1d9e0;
  --strong-line: #afb8c1;
  --accent: #00B3FF;
  --primary: #00B3FF;
  --primary-hover: #009DDF;
  --danger: #cf222e;
  --danger-hover: #a40e26;
  --warn: #9a6700;
  --error: #cf222e;
  --selection: #ddf4ff;
  --shadow: 0 8px 24px #1f23281f;
  --control-shadow: 0 1px 0 #1f23280a;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #03070e;
  --panel: #03070e;
  --sidebar: #0d1526;
  --soft: #101d32;
  --hover: #14233b;
  --text: #e6edf3;
  --muted: #9198a1;
  --faint: #7d8590;
  --line: #1e2c43;
  --strong-line: #344762;
  --accent: #00B3FF;
  --primary: #00B3FF;
  --primary-hover: #009DDF;
  --danger: #da3633;
  --danger-hover: #b62324;
  --warn: #d29922;
  --error: #f85149;
  --selection: #12324c;
  --shadow: 0 8px 24px #01040999;
  --control-shadow: 0 1px 0 #010409;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a, input, select, summary { outline-offset: 2px; }

button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  box-shadow: var(--control-shadow);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover { background: var(--hover); border-color: var(--strong-line); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a { color: inherit; text-decoration: none; }

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #1f232826;
  border-radius: 6px;
  background: var(--primary);
  box-shadow: inset 0 1px 0 #ffffff1a, 0 1px 0 #1f23280a;
  color: #fff;
  font-weight: 600;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.primary:hover { background: var(--primary-hover); border-color: #1f232840; color: #fff; }
.primary:active:not(:disabled) { box-shadow: inset 0 1px 2px #0104094d; }

input, select {
  width: 100%;
  min-width: 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--control-shadow);
  color: var(--text);
  font-size: 12px;
  line-height: 20px;
}

input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 0; }
input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -.5px; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.35; }
p, small { color: var(--muted); }

.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 32px; min-width: 32px; padding: 6px; }
.text-button { min-height: 28px; padding: 3px 7px; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); font-size: 11px; }
.text-button:hover { border-color: transparent; background: var(--hover); color: var(--text); }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.subtle-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.theme-toggle-floating { position: fixed; z-index: 40; top: 14px; right: 16px; }
.theme-toggle:hover { background: transparent; color: var(--text); }
.theme-toggle .icon { width: 18px; height: 18px; }
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-right: 0;
}

.user-name {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .logout { gap: 7px; border-color: var(--danger); background: var(--danger); color: #fff; }
.topbar .logout:hover { border-color: var(--danger-hover); background: var(--danger-hover); color: #fff; }
.logout .icon { width: 15px; height: 15px; }

.app main {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  grid-template-rows: 52px minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  position: relative;
  z-index: 20;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.brand img { display: block; width: 34px; height: 34px; object-fit: contain; }
.brand span {color:var(--text);font-size:16px;font-weight:700;letter-spacing:-.3px;white-space:nowrap;}
.topbar-divider { width: 1px; height: 24px; margin: 0 1px; background: var(--line); }
.topbar nav { height: 100%; display: flex; align-items: center; gap: 5px; }

.nav {
  position: relative;
  min-height: 36px;
  padding: 7px 10px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.nav:hover { border-color: transparent; background: var(--hover); color: var(--text); }
.nav.active { color: var(--text); font-weight: 600; }
.nav::after { position: absolute; right: 8px; bottom: -8px; left: 8px; height: 2px; background: var(--accent); content: ""; transform: scaleX(0); transition: transform 150ms ease; }
.nav.active::after { transform: scaleX(1); }
.nav .icon { width: 15px; height: 15px; }

.app aside {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.filters { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.server-switcher {flex:0 0 auto;margin-top:auto;padding-top:14px;border-top:1px solid var(--line);}
.server-label {display:block;margin-bottom:7px;color:var(--muted);font-size:11px;font-weight:600;}
.server-select {display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:8px 10px;background:var(--panel);border:1px solid var(--line);border-radius:5px;color:var(--text);font-size:12px;box-shadow:none;}
.server-select .icon {flex-shrink:0;width:16px;height:16px;color:var(--muted);}
.server-select .server-arrows {width:13px;margin-left:auto;}
.server-select[aria-expanded="true"] {border-color:var(--strong-line);background:var(--hover);}
.server-options {position:fixed;inset:auto;margin:0;padding:5px;border:1px solid var(--strong-line);border-radius:6px;background:var(--sidebar);color:var(--text);box-shadow:0 8px 28px #0004;}
.server-options:popover-open {animation:server-open 130ms ease-out;}
.server-option {display:flex;align-items:center;gap:10px;width:100%;padding:10px 9px;border:0;background:var(--selection);color:var(--text);font-size:12px;text-align:left;box-shadow:none;}
.server-option .icon:last-child {margin-left:auto;}
@keyframes server-open {from{opacity:0;transform:translateY(5px);}to{opacity:1;transform:translateY(0);}}
@media(prefers-reduced-motion:reduce){.server-options:popover-open{animation:none;}}
.query-block { flex: 0 0 auto; padding: 0 4px 4px; }
.query-block > label, .channel-heading > span { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); box-shadow: var(--control-shadow); color: var(--muted); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.search-field input { padding: 5px 0; border: 0; background: transparent; box-shadow: none; outline: 0; font-size: 12px; }
.search-field input:focus { outline: 0; }
.search-clear { width: 23px; min-width: 23px; min-height: 23px; padding: 3px; border: 0; background: transparent; box-shadow: none; color: var(--muted); }
.search-clear:hover { background: var(--hover); }
.search-clear .icon { width: 13px; height: 13px; }
.search-field .icon { width: 15px; height: 15px; }
.query-block .search-field { margin-top: 8px; }
.search-field kbd { width: 18px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 4px; color: var(--faint); font-family: inherit; font-size: 10px; line-height: 17px; text-align: center; }
.channel-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 5px 8px; }
.channel-list { min-height: 80px; flex: 1; overflow-y: auto; padding-right: 3px; scrollbar-color: var(--strong-line) transparent; scrollbar-width: thin; overscroll-behavior: contain; }
.channel-list button { display: flex; width: 100%; min-width: 0; justify-content: flex-start; border: 0; background: transparent; box-shadow: none; text-align: left; }
.channel-list button:hover { background: var(--hover); }
.all-channels { margin-bottom: 10px !important; }
.channel-button { min-height: 32px; margin: 1px 0; padding: 5px 9px; border-radius: 6px; color: var(--muted); font-size: 12px; gap: 8px; }
.channel-button .icon { width: 14px; height: 14px; }
.channel-button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-button.active { background: var(--selection) !important; color: var(--text); font-weight: 600; }
.channel-hash { color: var(--faint); font-size: 16px; font-weight: 400; line-height: 1; }
.channel-family { margin: 2px 0 6px; }
.family-button { min-height: 28px; justify-content: flex-start; gap: 8px; padding: 3px 6px; border: 0 !important; border-radius: 4px; background: transparent !important; box-shadow: none !important; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; }
.family-button:hover { background: var(--selection) !important; color: var(--text); }
.family-button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-arrow { width: 10px; margin-left: auto; color: var(--faint); font-size: 15px; line-height: 1; transform: rotate(90deg); transition: transform 160ms ease; }
.family-button[aria-expanded="true"] .family-arrow { transform: rotate(90deg); }
.family-button[aria-expanded="false"] .family-arrow { transform: rotate(0); }
.family-button.selected { background: transparent !important; color: var(--text); }
.family-button:active:not(:disabled) { transform: none; }
.family-button:focus-visible { background: transparent !important; }
.family-button.selected:hover { background: var(--selection) !important; }
:root[data-theme="dark"] .family-button:hover { color: #ffffff; }
.family-channels { overflow: hidden; padding: 1px 0 5px 9px; }
.channel-family > :is(.family-channels,.directory-nav) {position:relative;}
.channel-family > :is(.family-channels,.directory-nav)::before {content:'';position:absolute;top:2px;bottom:0;left:17px;width:1px;background:var(--strong-line);transform:scaleY(0);transform-origin:top;transition:transform 130ms ease-out;pointer-events:none;}
.channel-family:has(> .family-button[aria-expanded="true"]) > :is(.family-channels,.directory-nav)::before {transform:scaleY(1);}
@media(prefers-reduced-motion:reduce){.channel-family > :is(.family-channels,.directory-nav)::before{transition:none;}}
.channel-no-results { padding: 24px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.sidebar-mobile-head, #open-sidebar { display: none; }

main { min-width: 0; overflow-y: auto; padding: 24px 32px 28px; scrollbar-width: thin; }
.breadcrumbs { min-height: 24px; display: flex; align-items: center; gap: 9px; margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.breadcrumbs > span:last-child { color: var(--text); font-weight: 500; }
.breadcrumb-separator { color: var(--faint); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.actions > button { min-height: 32px; }
.actions > #export { font-weight: 600; }

.notice { margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font-size: 13px; line-height: 1.5; }
.notice:empty { display: none; }

.log-card { min-height: 0; display: flex; flex: 1; flex-direction: column; overflow: hidden; border: 0; border-radius: 0; background: transparent; }
.list-heading { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 0; }
.list-heading > div { display: flex; align-items: center; gap: 8px; }
.list-heading .icon { width: 16px; height: 16px; color: var(--muted); }
.list-heading :is(h1,h2) { font-size: 14px; }
.count { padding: 1px 7px; border: 1px solid var(--line); border-radius: 20px; background: var(--soft); color: var(--muted); font-size: 11px; line-height: 18px; font-variant-numeric: tabular-nums; }
.table-wrap { position: relative; min-height: 0; flex: 1; overflow: auto; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 14px; background: var(--sidebar); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 100ms ease; }
tbody tr:hover { background: var(--sidebar); cursor: pointer; }
.time-cell { width: 145px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-time { display: block; color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.event-date { display: block; color: var(--faint); font-size: 11px; line-height: 1.5; }
.event-title { display: block; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; line-height: 1.45; }
.event-preview { display: block; max-width: 380px; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.event-cell { min-width: 200px; max-width: 410px; }
.tag { color: var(--muted); font-size: 12px; white-space: nowrap; }
.resource-tag { padding: 3px 7px; border: 1px solid var(--line); border-radius: 20px; background: var(--soft); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.level { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.level i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.level.warning { color: var(--warn); }
.level.error { color: var(--error); }
.row-action { width: 30px; min-height: 28px; padding: 5px; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.row-action .icon { width: 14px; height: 14px; }
.empty { padding: 64px 24px; text-align: center; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 15px; border: 1px solid var(--line); border-radius: 50%; background: var(--soft); color: var(--muted); }
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { max-width: 310px; margin: 7px auto 0; font-size: 13px; line-height: 1.6; }
.empty button { margin-top: 20px; }
.pagination { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.pagination-button { width: 30px; min-height: 30px; padding: 4px; font-size: 13px; }
#page { min-width: 42px; color: var(--text); text-align: center; }
#logs-view { min-height: 0; display: flex; flex: 1; flex-direction: column; }

.role-panel { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.role-heading { display: flex; align-items: center; justify-content: space-between; padding: 3px 5px 14px; }
.role-search { margin: 0 4px 12px; }
.role-panel #roles { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.role-button { width: 100%; min-height: auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; margin-bottom: 3px; padding: 9px 10px; border-color: transparent; background: transparent; box-shadow: none; text-align: left; font-size: 12px; }
.role-button:hover { border-color: transparent; background: var(--hover); }
.role-button.active { background: var(--selection); color: var(--text); }
.role-button small { color: var(--muted); font-size: 11px; }
.permission-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
.permission-header h2 { margin-top: 5px; font-size: 20px; }
.permission-header p { margin-top: 4px; font-size: 13px; }
.permission-tools { display: flex; align-items: center; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.permission-tools > .search-field { max-width: 330px; flex: 1; }
.permission-tools > .subtle-count { margin-right: auto; white-space: nowrap; }
.permission-tools > button { font-size: 11px; white-space: nowrap; }
.export-permission { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.export-permission strong { display: block; font-size: 13px; font-weight: 600; }
.export-permission small { display: block; margin-top: 3px; font-size: 12px; }
#permissions { width: 100%; }
.permission-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.permission-section > header { margin-bottom: 16px; }
.permission-section > header p { margin-top: 3px; font-size: 12px; }
.permission-family { padding: 15px 0; border-bottom: 1px solid var(--line); }
.permission-family:last-child { border-bottom: 0; }
.permission-family-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.permission-family-head h3 { font-size: 13px; font-weight: 600; }
.permission-switch-line { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 22px; }
.permission-item { min-width: 0; display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.permission-toggle { appearance: none; position: relative; width: 38px !important; height: 22px !important; flex: 0 0 38px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 999px !important; background: var(--strong-line) !important; box-shadow: inset 0 0 0 1px #00000012 !important; cursor: pointer; transition: background-color 160ms ease; }
.permission-toggle::after { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0004; content: ""; transition: transform 160ms cubic-bezier(.2,.8,.2,1); }
.permission-toggle:checked { background: var(--accent) !important; }
.permission-toggle:checked::after { transform: translateX(16px); }
.permission-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.permission-toggle:disabled { opacity: .48; cursor: not-allowed; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 28px; }
.action-permission { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.action-description { min-width: 0; display: block; }
.action-description strong, .action-description small { display: block; }
.action-description strong { color: var(--text); font-size: 13px; font-weight: 600; }
.action-description small { margin-top: 2px; font-size: 11px; }
.admin-empty { padding: 55px 20px; text-align: center; }
.admin-empty .icon { width: 28px; height: 28px; margin-bottom: 12px; color: var(--muted); }
.admin-empty p { font-size: 13px; }
.audit-list { width: 100%; border-top: 1px solid var(--line); }
.audit-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 18px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.audit-row time { color: var(--faint); font-size: 11px; }
.audit-row strong { font-size: 12px; font-weight: 600; }
.audit-row small { display: block; overflow-wrap: anywhere; margin-top: 3px; }
.audit-empty { padding: 26px 0; font-size: 13px; }

.discord-mention { min-height: 0; display: inline; padding: 0 2px; border: 0; border-radius: 4px; box-shadow: none; font-size: inherit; font-weight: 600; line-height: inherit; vertical-align: baseline; }
.player-id, .player-state { margin-top: 4px; color: var(--muted); font-size: 12px; }
.player-section { margin-top: 24px; }
.player-section h3 { margin-bottom: 10px; font-size: 13px; }
.player-role { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.player-role > small { text-align: right; }
.role-remove { min-height: 27px; padding: 3px 8px; color: var(--danger); font-size: 11px; }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-button { border-color: var(--danger); background: var(--danger); color: #fff; }
.danger-button:hover { border-color: var(--danger-hover); background: var(--danger-hover); color: #fff; }
.blacklist-state { margin-top: 12px; color: var(--danger); font-size: 12px; }
.player-error { color: var(--danger); font-size: 12px; }
#player-action-confirm { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
#player-action-message { margin-bottom: 10px; color: var(--text); font-size: 12px; }
#player-reason-field { display: block; margin: 10px 0; color: var(--muted); font-size: 11px; }
#player-reason { margin-top: 5px; }
.player-confirm-buttons { display: flex; justify-content: flex-end; gap: 8px; }
#app.audit-page { grid-template-columns: minmax(0, 1fr); }
#app.audit-page aside { display: none; }

.login { width: 100%; min-height: 100dvh; display: grid; place-items: center; padding: 60px 20px 32px; background: var(--bg); }
.login-card { width: min(100%, 330px); display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: center; box-shadow: none; }
.login-logo { display: block; width: 118px; max-width: 70%; height: auto; margin: 0 auto 18px; }
.login-card h1 { font-size: 23px; letter-spacing: -.3px; }
.login-button { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 20px; padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.login-button .icon { width: 14px; height: 14px; }
.login-card .notice { width: 100%; margin: 14px 0 0; font-size: 12px; }

dialog { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; background: var(--panel); box-shadow: var(--shadow); color: var(--text); }
dialog[open] { display: flex; flex-direction: column; animation: detail-reveal 240ms cubic-bezier(.16,1,.3,1); }
dialog::backdrop { background: #01040988; }
.dialog-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dialog-head > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.dialog-head .icon-button { border-color: transparent; background: transparent; box-shadow: none; }
.detail-scroll { min-height: 0; flex: 1; overflow-y: auto; padding: 24px; scrollbar-width: thin; }
#detail-title { overflow-wrap: anywhere; font-size: 23px; font-weight: 600; letter-spacing: -.3px; line-height: 1.3; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin: 20px 0; border: 1px solid var(--line); border-radius: 6px; }
.detail-meta > div { min-width: 0; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.detail-meta > div:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-meta > div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-meta dt { color: var(--muted); font-size: 10px; font-weight: 600; }
.detail-meta dd { overflow-wrap: anywhere; margin: 4px 0 0; color: var(--text); font-size: 12px; }
.detail-block { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--sidebar); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-block h3 { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.detail-block p { color: var(--text); font-size: 13px; }
.raw-data { margin-top: 20px; }
.raw-data summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.raw-data pre { font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.detail-link { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0; color: var(--accent); font-size: 12px; }
.detail-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); }
.detail-footer > span { color: var(--muted); font-size: 11px; }
.sidebar-backdrop { display: none; }
.no-permissions { padding: 18px 6px; color: var(--muted); font-size: 13px; }
mark { padding: 0 2px; border-radius: 3px; background: var(--selection); color: var(--text); }

@keyframes reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes detail-reveal { from { opacity: .7; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

@media (min-width: 1700px) {
  main { padding: 28px 48px 32px; }
  .table-wrap { min-height: 420px; }
}

@media (max-width: 1200px) {
  .app { grid-template-columns: 240px minmax(0, 1fr); }
  .topbar { gap: 14px; padding-left: 18px; }
  .brand img { width: 34px; }
  .nav { padding-inline: 8px; font-size: 11px; }
  .topbar-tools { padding-right: 0; }
  main { padding: 22px; }
  .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-tools { flex-wrap: wrap; }
  .permission-tools > .search-field { max-width: none; flex-basis: 55%; }
  .permission-tools > .subtle-count { margin-left: auto; margin-right: 0; }
  .page-heading h1 { font-size: 25px; }
  .event-preview { max-width: 260px; }
  td, th { padding-inline: 11px; }
}

@media (max-width: 850px) {
  .app { display: flex; flex-direction: column; }
  .topbar { height: 90px; min-height: 90px; flex-wrap: wrap; align-content: flex-start; gap: 0; padding: 5px 16px 0; }
  .brand img { width: 30px; height: 30px; }
  .brand {gap:6px;}
  .brand span {font-size:13px;}
  .topbar-divider { display: none; }
  .topbar nav { width: 100%; height: 43px; align-items: center; gap: 2px; }
  .nav { min-height: 34px; padding: 6px 6px; font-size: 10px; gap: 4px; }
  .nav.active::after { right: 7px; bottom: -4px; left: 7px; }
  .nav .icon { width: 14px; height: 14px; }
  .logout { margin-left: auto; }
  .topbar-tools { position: absolute; top: 10px; right: 10px; gap: 6px; padding-right: 0; }
  .user-name { max-width: 76px; font-size: 11px; }
  .logout { width: 32px; min-width: 32px; min-height: 32px; padding: 7px; }
  .logout span { display: none; }
  .app aside { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(330px, 90vw); height: 100dvh; display: flex; flex-direction: column; padding: 14px; border-right: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform 200ms ease; }
  .app.sidebar-open aside { transform: translateX(0); }
  .sidebar-mobile-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .sidebar-mobile-head strong { font-size: 14px; font-weight: 600; }
  .sidebar-mobile-head button { border-color: transparent; background: transparent; box-shadow: none; }
  .filters, .role-panel { min-height: 0; flex: 1; }
  .sidebar-backdrop { position: fixed; z-index: 45; inset: 0; width: 100%; height: 100%; display: block; padding: 0; border: 0; border-radius: 0; background: #01040966; box-shadow: none; }
  .sidebar-backdrop:hover { background: #01040966; }
  .app main { min-height: 0; flex: 1; padding: 16px 20px 22px; }
  .breadcrumbs { gap: 7px; margin-bottom: 18px; font-size: 11px; }
  #open-sidebar { width: 30px; min-height: 30px; display: inline-flex; margin-right: 2px; padding: 6px; background: var(--panel); }
  #open-sidebar .icon { width: 15px; height: 15px; }
  .page-header { flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
  .page-heading { min-width: 150px; flex: 1; }
  .page-heading h1 { font-size: 23px; }
  .page-heading p { max-width: 330px; font-size: 12px; line-height: 1.5; }
  .actions { align-self: center; gap: 6px; }
  .actions > #export { padding: 5px 9px; font-size: 11px; }
  .actions > .icon-button { width: 32px; min-height: 32px; }
  .list-heading { padding: 12px 14px; }
  .table-wrap { min-height: 0; }
  .pagination { padding: 10px 12px; }
  .permission-header { gap: 12px; padding: 4px 0 15px; }
  .permission-header h2 { font-size: 19px; }
  .permission-header > button { font-size: 11px; }
  .permission-tools { gap: 7px; padding: 12px 0; }
  .permission-tools > .search-field { flex-basis: 100%; }
  .permission-tools > .subtle-count { margin: 3px auto 3px 0; }
  .permission-tools > button { padding: 5px 8px; font-size: 10px; }
  .export-permission { padding: 15px 0; }
  .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
  .detail-scroll { padding: 20px; }
  .dialog-head { padding: 12px 16px; }
  .detail-footer { padding: 12px 16px; }
}

@media (max-width: 600px) {
  .app main { padding: 14px 12px 20px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .breadcrumbs { margin-bottom: 16px; }
  .page-header { align-items: center; }
  .page-heading { flex-basis: 100%; }
  .page-heading h1 { font-size: 22px; }
  .actions { margin-left: auto; }
  .list-heading { padding: 11px 12px; }
  .list-heading :is(h1,h2) { font-size: 13px; }
  .list-heading > div { gap: 6px; }
  .table-wrap { min-height: 240px; overflow: visible; }
  table, tbody { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 12px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  td { min-width: 0; display: block; padding: 0; border: 0; }
  td.time-cell { width: auto; grid-column: 1; grid-row: 1; }
  .event-time, .event-date { display: inline; font-size: 11px; }
  .event-date { margin-left: 7px; }
  td.event-cell { min-width: 0; max-width: none; grid-column: 1 / -1; grid-row: 2; }
  .event-title { font-size: 13px; }
  .event-preview { max-width: 100%; margin-top: 4px; font-size: 11px; }
  td:nth-child(3) { grid-column: 1; grid-row: 3; }
  td:nth-child(4) { display: none; }
  td:nth-child(5) { grid-column: 2; grid-row: 1; }
  td:last-child { grid-column: 2; grid-row: 3; justify-self: end; }
  .row-action { width: 32px; min-height: 30px; }
  .tag { font-size: 11px; }
  .pagination { gap: 8px; padding-inline: 10px; font-size: 10px; }
  .pagination > div { gap: 5px; }
  .permission-header { padding: 15px; }
  .permission-header h2 { font-size: 18px; }
  .permission-header p { font-size: 12px; }
  .permission-tools { padding: 11px 12px; }
  .permission-tools > button { padding: 4px 7px; }
  .export-permission { padding: 14px 0; }
  .export-permission small { max-width: 240px; font-size: 11px; }
  .permission-grid { grid-template-columns: 1fr; gap: 11px; }
  .action-grid { grid-template-columns: 1fr; }
  .permission-family-head h3 { font-size: 12px; }
  .permission-family-head label { font-size: 11px; }
  .login { padding: 60px 16px 32px; }
  .login-logo { width: 105px; margin-bottom: 16px; }
  .login-card h1 { font-size: 21px; }
  .login-button { margin-top: 17px; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .detail-meta > div { padding: 9px; }
  .detail-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.nav-separator {padding:20px 12px 9px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;}
.family-button {width:100%;min-height:46px;padding:12px!important;font-size:13px;letter-spacing:0;gap:11px;}
.family-button .family-arrow {margin-left:auto;}
.family-button.selected {background:var(--selection)!important;}
.channel-button {width:100%;min-height:40px;padding:10px 12px;font-size:12px;}
.channel-button:hover {background:var(--selection)!important;}
.family-channels {padding-left:12px;}
.family-button .icon {width:14px;height:14px;flex-shrink:0;}
.channel-list > .channel-button,.channel-list .family-button {display:grid;grid-template-columns:14px minmax(0,1fr) 12px;align-items:center;column-gap:10px;min-height:34px;padding:7px 10px!important;font-size:12px;font-weight:600;}
.channel-list .family-button .family-arrow {margin:0;justify-self:end;}
.breadcrumbs > span {display:none;}
.breadcrumbs {margin-bottom:8px;min-height:0;}
.list-heading {padding:20px;}
.list-heading :is(h1,h2) {font-size:18px;font-weight:750;color:var(--text);}
:root[data-theme="dark"] .list-heading :is(h1,h2) {color:#fff;}
#list-description {margin:5px 0 0;color:var(--muted);font-size:12px;font-weight:400;}
button > .icon {flex-shrink:0;}
.icon.fa-icon {fill:currentColor;stroke:none;}
.pagination[hidden] {display:none;}

.app:has(#logs-view:not([hidden])) .page-header {display:none;}

.family-button {min-height:34px;padding:7px 10px!important;font-size:12px;}
.channel-button {min-height:32px;padding:6px 10px;}
.channel-list {scrollbar-width:none;-ms-overflow-style:none;}
.channel-list::-webkit-scrollbar {display:none;}
.raw-data > button {margin:12px 0 20px;}
.stats-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;}
#dashboard {padding:20px 0;}
.stat-card {border:1px solid var(--line);border-radius:8px;padding:18px;display:grid;gap:8px;}
.stat-card strong {font-size:28px;color:var(--text);}
.stat-card span,.dashboard-section > small {font-size:12px;color:var(--muted);}
.stat-card .icon {color:var(--text);}
.dashboard-section {margin-top:28px;}
.dashboard-section h2 {font-size:14px;margin-bottom:16px;}
.hour-bars {display:flex;gap:4px;align-items:flex-end;overflow:hidden;}
.hour-bar {flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:6px;}
.hour-bar meter {writing-mode:vertical-lr;direction:rtl;width:100%;height:100px;accent-color:var(--accent);}
.hour-bar small {font-size:9px;color:var(--muted);writing-mode:vertical-rl;}
.ranking-row {display:flex;width:100%;gap:12px;align-items:center;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:12px;}
.ranking-row strong {margin-left:auto;}
@media(max-width:700px){.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.stat-card{padding:12px;}.stat-card strong{font-size:23px;}}

.log-id {display:block;color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums;margin-top:3px;}
.stats-grid {grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}

.role-button {display:grid;grid-template-columns:minmax(0,1fr) 16px;gap:2px 10px;align-items:center;padding:10px;}
.role-button .role-name {grid-column:1;grid-row:1;font-size:12px;font-weight:600;overflow-wrap:anywhere;}
.role-button > .icon {grid-column:2;grid-row:1 / 3;width:14px;height:14px;justify-self:end;}
.role-button > small {grid-column:1;grid-row:2;font-size:10px!important;font-weight:400;line-height:1.4;color:var(--muted);}
.permission-family {padding:0;border:1px solid var(--line);border-radius:7px;margin:0 0 9px;}
.permission-family:last-child {border-bottom:1px solid var(--line);}
.permission-family-head {display:flex;gap:10px;margin:0;padding:12px;cursor:pointer;list-style:none;}
.permission-family-head::-webkit-details-marker {display:none;}
.permission-family-head:hover {background:var(--hover);border-radius:7px;}
.permission-family-head h3 {flex:1;margin:0;font-size:13px;font-weight:600;}
.permission-family-head > .icon {width:15px;height:15px;flex-shrink:0;color:var(--muted);}
.permission-family-head > .icon:last-child {transition:transform .15s;}
.permission-family[open] > summary > .icon:last-child {transform:rotate(90deg);}
.permission-family-count {font-size:10px;color:var(--muted);white-space:nowrap;}
.permission-family .permission-grid {padding:12px 14px 16px;border-top:1px solid var(--line);grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;}
#action-permissions {display:block;}
.permission-section > header p {display:none;}
@media(max-width:600px){.permission-family .permission-grid{grid-template-columns:1fr;}}

main, .role-panel, #roles, .detail-scroll {scrollbar-width:none;}
main::-webkit-scrollbar,.role-panel::-webkit-scrollbar,#roles::-webkit-scrollbar,.detail-scroll::-webkit-scrollbar{display:none;}
.permission-grid{overflow:hidden;box-sizing:border-box;}
.primary{color:#002738;}

.staff-disconnect{margin-left:auto;min-height:30px;padding:5px 9px;font-size:11px;color:var(--danger);border-color:var(--line);background:transparent;}

.role-panel #roles::-webkit-scrollbar {display:none;width:0;height:0;}
.permission-family {overflow:hidden;box-sizing:border-box;overflow-anchor:none;}
.permission-family-head > .icon:last-child {transition:transform 280ms cubic-bezier(.22,1,.36,1);}
.permission-family[data-expanded="false"] > summary > .icon:last-child {transform:rotate(0);}
.permission-family[data-expanded="true"] > summary > .icon:last-child {transform:rotate(90deg);}
@media(prefers-reduced-motion:reduce){.permission-family-head > .icon:last-child{transition:none;}}

#dashboard {padding:6px 0 24px;}
.stats-grid {gap:18px;}
.stat-card {position:relative;grid-template-columns:1fr auto;gap:8px 18px;padding:24px;border-radius:14px;background:var(--sidebar);box-shadow:none;}
.stat-card > .icon {grid-column:2;grid-row:1 / 3;align-self:start;width:22px;height:22px;box-sizing:content-box;padding:12px;border-radius:12px;background:var(--soft);}
.stat-card strong {grid-column:1;grid-row:2;font-size:38px;line-height:1.15;font-weight:700;letter-spacing:-1px;font-variant-numeric:tabular-nums;}
.stat-card > span {grid-column:1;grid-row:1;font-size:12px;line-height:1.5;}
.dashboard-layout {display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr);gap:18px;margin-top:20px;align-items:start;}
.dashboard-section {margin:0;border:1px solid var(--line);border-radius:14px;padding:22px;background:var(--sidebar);min-width:0;}
.dashboard-panel-head {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px;}
.dashboard-panel-head h2 {font-size:15px;letter-spacing:-.2px;margin:0;}
.chart-period {color:var(--muted);font-size:11px;}
.online-count {font-size:11px;color:#23804b;background:#23804b12;border-radius:20px;padding:4px 9px;font-variant-numeric:tabular-nums;}
:root[data-theme="dark"] .online-count {color:#67d8a0;background:#67d8a012;}
.connections-chart {display:block;width:100%;height:auto;overflow:visible;}
.chart-gridline {stroke:var(--line);stroke-dasharray:3 5;stroke-width:1;}
.chart-bar {fill:var(--accent);transition:fill 180ms;}
.chart-bar:hover {fill:#65d2ff;}
.chart-bar-empty {fill:var(--strong-line);}
:root[data-theme="dark"] .channel-button.active {background:#102d45!important;color:#fff;}
#app:has(#dashboard:not([hidden])) .list-heading h1 {font-size:24px;letter-spacing:-.6px;}
.chart-value {fill:var(--text);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;}
.chart-day {fill:var(--muted);font-size:10px;}
.staff-row {display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--line);}
.staff-row:last-child {border-bottom:0;padding-bottom:0;}
.staff-avatar {position:relative;display:grid;place-items:center;width:38px;height:38px;flex-shrink:0;border-radius:12px;background:color-mix(in srgb,var(--accent) 12%,var(--panel));color:var(--text);font-size:12px;font-weight:600;}
.staff-avatar::after {content:'';position:absolute;bottom:-2px;right:-2px;width:9px;height:9px;background:#41c987;border:2px solid var(--sidebar);border-radius:50%;}
.staff-identity {display:grid;gap:4px;min-width:0;}
.staff-identity strong {font-size:12px;font-weight:600;overflow-wrap:anywhere;}
.staff-identity small {font-size:10px;color:var(--muted);}
.staff-disconnect {flex-shrink:0;border:0;background:transparent;font-size:10px;padding:5px;}
@media(max-width:1100px){.dashboard-layout{grid-template-columns:1fr;}.stat-card{padding:18px;}.stat-card strong{font-size:32px;}}
@media(max-width:600px){.stats-grid{grid-template-columns:1fr;gap:10px;}.stat-card{grid-template-columns:1fr auto;padding:16px 18px;}.stat-card strong{font-size:30px;}.dashboard-layout{margin-top:12px;gap:12px;}.dashboard-section{padding:18px 14px;}.dashboard-panel-head{margin-bottom:18px;}}

.icon {color:var(--muted);}
.stat-card > .icon {color:var(--text);background:var(--soft);}
.list-heading {padding-left:0;padding-right:0;border-bottom:0;}
#dashboard {padding-top:12px;}


:root[data-theme="dark"] :is(.channel-button.active,.family-button.selected,.family-button[aria-expanded="true"]) {color:#fff;}
:root[data-theme="dark"] :is(.channel-button.active,.family-button.selected,.family-button[aria-expanded="true"]) .icon {color:#fff;}
.dashboard-history .dashboard-panel-head {margin-bottom:14px;}
.chart-readout {display:flex;align-items:baseline;gap:10px;margin:0 0 14px 12px;min-height:35px;}
.chart-readout strong {font-size:28px;font-variant-numeric:tabular-nums;line-height:1.2;}
.chart-readout span {color:var(--muted);font-size:11px;}
.chart-area {fill:color-mix(in srgb,var(--accent) 9%,transparent);}
.chart-curve {fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;}
.chart-cursor {stroke:var(--strong-line);stroke-width:1;stroke-dasharray:3 5;}
.chart-dot {fill:var(--sidebar);stroke:var(--accent);stroke-width:2;transition:r 160ms ease;}
.chart-dot-active {r:6;fill:var(--accent);}
.chart-hit {fill:transparent;cursor:crosshair;outline:none;}
.chart-hit:focus-visible {stroke:var(--muted);stroke-width:1;rx:8;}

.changes-bar {position:fixed;z-index:55;bottom:24px;right:32px;left:288px;max-width:1000px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 20px;background:var(--sidebar);border:1px solid var(--strong-line);border-radius:12px;box-shadow:0 12px 45px #0004;}
.changes-bar p {font-size:16px;font-weight:600;line-height:1.5;margin:0;color:#fff;}
.changes-bar > div {display:flex;gap:8px;flex-shrink:0;}
.changes-bar button {min-height:34px;font-size:12px;}
.has-changes main {padding-bottom:120px;}
.search-field {position:relative;transition:border-color 180ms ease,box-shadow 180ms ease,background-color 180ms ease;}
.search-field:focus-within {box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent);}
.search-field::after {content:'';position:absolute;left:10px;right:10px;bottom:-1px;height:2px;background:var(--accent);transform:scaleX(0);opacity:0;pointer-events:none;}
.search-field.is-searching::after {animation:search-progress 900ms ease-in-out infinite;}
.search-clear {animation:search-clear-in 140ms ease-out;}
@keyframes search-progress {0%{transform:scaleX(.08);opacity:.2}50%{transform:scaleX(.7);opacity:.8}100%{transform:scaleX(1);opacity:0}}
@keyframes search-clear-in {from{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}
@media(max-width:850px){.changes-bar{left:18px;right:18px;bottom:18px;}}
@media(max-width:520px){.changes-bar{align-items:stretch;flex-direction:column;gap:12px;padding:16px;}.changes-bar > div{justify-content:flex-end;}.changes-bar p{font-size:15px;}.has-changes main{padding-bottom:180px;}}
@media(prefers-reduced-motion:reduce){.search-field,.search-clear{transition:none;animation:none;}.search-field.is-searching::after{animation:none;}dialog[open]{animation:none;}}

.changes-bar {background:#0d1526;color:#fff;border-color:#263955;}
#save .icon {width:18px;height:18px;color:inherit;opacity:1;}
#save > .icon > use {animation:none!important;opacity:1!important;}

#detail,#player-detail {inset:0;width:min(780px,calc(100vw - 40px));height:fit-content;max-height:calc(100dvh - 64px);margin:auto;border:1px solid var(--line);border-radius:16px;background:var(--sidebar);}
#player-detail {width:min(360px,calc(100vw - 32px));height:fit-content;max-height:calc(100dvh - 48px);}
#detail[open],#player-detail[open] {animation:modal-center-in 220ms cubic-bezier(.16,1,.3,1);}
.event-header {display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 28px;border-bottom:1px solid var(--line);}
.event-header h2 {margin:5px 0 0;font-size:23px;line-height:1.3;overflow-wrap:anywhere;}
.event-person-label,#detail-session {font-size:11px;color:var(--muted);}
#detail-session:not(:empty) {padding:7px 10px;border:1px solid var(--line);border-radius:7px;white-space:nowrap;}
.event-tabs {display:flex;gap:8px;padding:12px 24px;border-bottom:1px solid var(--line);}
.event-tabs button {border:0;background:transparent;box-shadow:none;color:var(--muted);font-size:12px;padding:9px 13px;border-radius:7px;}
.event-tabs button.active {background:var(--hover);color:var(--text);}
.event-tabs .active .icon {color:var(--text);}
#detail .detail-scroll,#player-detail .detail-scroll {padding:20px;flex:0 1 auto;min-height:0;overflow:auto;}
.identity-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}
.identity-grid > div {min-width:0;}
.identity-grid dt {font-size:11px;color:var(--muted);margin-bottom:7px;}
.identity-grid dd {margin:0;font-size:13px;overflow-wrap:anywhere;}
.event-people {display:flex;flex-wrap:wrap;gap:8px;margin-bottom:24px;}
.event-people button {font-size:11px;}
.event-people button.active {background:var(--hover);}
.event-sentence {font-size:20px;font-weight:600;line-height:1.5;letter-spacing:-.3px;margin:0 0 12px;}
.event-meta {display:flex;flex-wrap:wrap;gap:10px 20px;color:var(--muted);font-size:11px;margin-bottom:28px;}
.event-facts {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.event-facts > p {grid-column:1 / -1;font-size:13px;white-space:pre-wrap;}
.event-fact h3 {color:var(--muted);font-size:11px;font-weight:500;margin:0 0 7px;}
.event-fact p {font-size:13px;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;}
.player-history-row {display:flex;width:100%;align-items:center;gap:12px;padding:14px 4px;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;box-shadow:none;}
.player-history-row > span {display:grid;gap:7px;flex:1;min-width:0;}
.player-history-row strong {font-size:12px;font-weight:500;overflow-wrap:anywhere;}
.player-history-row small {font-size:10px;color:var(--muted);}
.history-more {margin-top:18px;}
#player-action-confirm label {display:grid;gap:8px;font-size:12px;margin-top:18px;}
#player-action-confirm textarea {width:100%;resize:vertical;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:7px;padding:10px;font:inherit;}
#player-action-status {font-size:12px;color:var(--muted);line-height:1.5;}
#player-id {margin:6px 0 0;font-size:12px;color:var(--muted);}
@keyframes modal-center-in {from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:600px){#detail{width:calc(100vw - 20px);height:fit-content;max-height:calc(100dvh - 32px);border-radius:12px;}.event-header{padding:18px;}.event-header h2{font-size:19px;}.event-tabs{padding:10px;gap:2px;}.event-tabs button{flex:1;padding:9px 7px;font-size:11px;}#detail .detail-scroll,#player-detail .detail-scroll{padding:20px 18px;}.identity-grid,.event-facts{grid-template-columns:1fr;}.event-sentence{font-size:17px;}}
@media(prefers-reduced-motion:reduce){#detail[open],#player-detail[open]{animation:none;}}

#login-error {color:var(--error);font-weight:600;}
#detail {display:none;grid-template-columns:140px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);height:fit-content;min-height:0;max-height:85dvh;border-radius:7px;}
#detail[open]{display:grid;}
#detail .event-header{grid-column:1/-1;}
#event-tabs{flex-direction:column;padding:14px 10px;border-bottom:0;border-right:1px solid var(--line);gap:5px;}
#event-tabs button{justify-content:flex-start;border-radius:4px;}
#detail .detail-scroll{max-height:60dvh;padding:22px;}
#player-detail{width:max-content;min-width:260px;max-width:min(380px,calc(100vw - 32px));height:fit-content;border-radius:7px;}
#player-detail .event-header{padding:16px 20px;}#player-detail .detail-scroll{padding:16px 20px;max-height:calc(85dvh - 90px);}
.player-actions{display:grid;grid-template-columns:1fr;gap:8px;}.player-actions button{justify-content:center;min-height:34px;padding:8px 12px;}#player-action-status:empty{display:none;}.player-actions button{border-radius:4px;}
.dashboard-section,.stat-card{border-radius:7px;}
.dashboard-layout{grid-template-columns:minmax(0,1fr) minmax(240px,calc((100% - 36px)/3));}
.identity-grid>div{position:relative;background:var(--panel);padding:14px 68px 14px 14px;border-radius:5px;border:1px solid var(--line);}
.identity-copy{position:absolute;right:9px;top:10px;padding:4px 6px;font-size:10px;min-height:24px;}
#detail .icon{color:var(--text);}:root[data-theme="dark"] .logout .icon{color:#fff;}
.logout .icon{color:inherit;}
@media(prefers-reduced-motion:no-preference){:root[data-theme="dark"] :is(button,a,summary):hover>.icon{color:#fff;}}
@media(max-width:900px){.dashboard-layout{grid-template-columns:1fr;}}
@media(max-width:600px){#detail{grid-template-columns:110px minmax(0,1fr);max-height:90dvh;min-height:0;}#event-tabs button{font-size:10px;gap:5px;padding:8px 5px;flex:none;}#detail .detail-scroll{padding:14px;max-height:65dvh;}.identity-grid{gap:10px;}.identity-grid>div{padding:12px 54px 12px 10px;}}

.icon use[href="#i-logout"],#event-tabs .icon use[href="#i-log"],#event-tabs .icon use[href="#i-clock"]{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}

.identity-copy {border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:4px;box-shadow:none;}
.identity-copy:hover {background:var(--sidebar);color:var(--text);border-color:var(--muted);}
.discord-mention,.discord-mention:hover {display:inline-flex;align-items:center;height:27px;padding:3px 8px;border:0;background:#15183a;color:#7889de;font-size:14px;line-height:20px;}
.kill-position,.kill-position:hover {min-height:0;padding:0;border:0;border-bottom:1px dotted var(--muted);border-radius:0;background:transparent;color:var(--text);font:inherit;box-shadow:none;cursor:crosshair;}
.kill-map-preview {position:fixed;inset:auto;margin:0;padding:5px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--text);box-shadow:0 8px 30px #0005;pointer-events:none;max-width:calc(100vw - 16px);}
.kill-map-canvas {position:relative;width:304px;height:182px;max-width:100%;overflow:hidden;border-radius:3px;background:#132534;}
.kill-map-canvas img {position:absolute;width:256px;height:256px;max-width:none;}
.kill-map-dot {position:absolute;left:50%;top:50%;width:10px;height:10px;border:2px solid white;border-radius:50%;background:#ef3038;box-shadow:0 0 0 5px #ef303840;transform:translate(-50%,-50%);}
.kill-map-caption {padding:6px 4px 2px;font-size:11px;font-variant-numeric:tabular-nums;}
.kill-replay p {margin:0;color:var(--muted);font-size:12px;}
.replay-player {overflow:hidden;border:1px solid var(--line);border-radius:5px;background:var(--panel);}
.replay-screen {position:relative;display:grid;place-items:center;aspect-ratio:16/9;background:#03070e;}
.replay-screen video {display:block;width:100%;height:100%;min-height:0;object-fit:contain;}
.replay-screen .loading-wheel,.replay-start {position:absolute;inset:0;margin:auto;}
.replay-start {display:grid;place-items:center;width:42px;height:42px;min-height:0;padding:10px;border:1px solid #ffffff40;border-radius:50%;background:#03070ecc;color:white;}
.replay-start:hover {background:#151d2c;color:white;}
.replay-controls {display:flex;align-items:center;gap:6px;padding:5px;background:var(--panel);color:var(--text);}
.replay-controls button {display:grid;place-items:center;flex:0 0 28px;min-height:28px;padding:5px;border:0;background:transparent;color:var(--text);box-shadow:none;}
.replay-controls button:hover {background:var(--hover);}
.replay-controls input[type=range] {width:0;min-width:24px;flex:1;height:18px;margin:0;padding:0;border:0;box-shadow:none;accent-color:var(--text);cursor:pointer;}
.replay-time {flex:none;font-size:10px;font-variant-numeric:tabular-nums;white-space:nowrap;}
.replay-player .replay-status {padding:8px;}
.replay-player:fullscreen {display:flex;flex-direction:column;justify-content:center;border:0;border-radius:0;}
.replay-player:fullscreen .replay-screen {flex:1;min-height:0;aspect-ratio:auto;}
.replay-player:fullscreen .replay-controls {padding:12px;gap:14px;}
.pagination {justify-content:center;}

.loading-wheel {display:grid;place-items:center;min-height:64px;}
.loading-wheel::before {content:'';width:18px;height:18px;border:2px solid var(--line);border-top-color:var(--text);border-radius:50%;animation:loading-spin .7s linear infinite;}
#player-blacklist-state .loading-wheel,#player-action-status .loading-wheel {min-height:28px;}
#detail,#player-detail {overflow:hidden;contain:layout style;}
@keyframes loading-spin {to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.loading-wheel::before{animation-duration:1.5s;}}

#event-tabs .icon {color:inherit;}

.directory-nav{display:grid;gap:2px;padding-left:10px;}.directory-nav[hidden]{display:none;}
#directory-view{padding:20px;flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--strong-line) transparent;scrollbar-gutter:stable;overscroll-behavior-y:contain;}.directory-search{display:flex;align-items:center;gap:10px;padding:5px 12px;margin-bottom:22px;background:var(--panel);border:1px solid var(--line);border-radius:5px;}
.directory-search input{flex:1;min-width:0;border:0;background:transparent;box-shadow:none;font-size:13px;padding:4px 0;}.directory-search input:focus{outline:none;box-shadow:none;}.directory-search:focus-within{border-color:var(--accent);}
.directory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start;}.directory-card{min-width:0;border:1px solid var(--line);border-radius:5px;background:var(--sidebar);overflow:hidden;}
.directory-card>summary{list-style:none;display:flex;align-items:center;gap:10px;padding:16px;cursor:pointer;min-height:70px;}.directory-card>summary::-webkit-details-marker{display:none;}.directory-card>summary>.icon:last-child{margin-left:auto;width:13px;}.directory-card[open]>summary>.icon:last-child{transform:rotate(90deg);}
.directory-card-title{display:grid;gap:6px;min-width:0;}.directory-card-title strong{overflow-wrap:anywhere;}.directory-card small{color:var(--muted);font-size:11px;}.directory-card-body{border-top:1px solid var(--line);padding:12px;}.directory-card-body:empty{display:none;}
.directory-person{display:flex;align-items:center;gap:10px;padding:12px;min-width:0;}.directory-person>div{display:grid;gap:5px;min-width:0;flex:1;}.directory-person strong{font-size:12px;overflow-wrap:anywhere;}.directory-person span{font-size:12px;color:var(--muted);overflow-wrap:anywhere;}.directory-person>.icon{width:20px;height:20px;}.directory-person .directory-copy{margin-left:auto;}.directory-card>summary>.directory-person{flex:1;padding:0;}
.directory-copy{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:28px;width:28px;padding:5px;border:0;background:transparent;box-shadow:none;}.directory-copy .icon{width:14px;height:14px;color:var(--text);}
.directory-more{display:block;margin:12px auto 0;}#directory-pagination{display:flex;justify-content:center;gap:10px;margin-top:18px;}.directory-empty{padding:28px;text-align:center;color:var(--muted);}
@media(max-width:1100px){.directory-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}@media(max-width:650px){#directory-view{padding:12px;}.directory-grid{grid-template-columns:1fr;}.directory-search{padding:5px 10px;gap:7px;}.directory-search button{font-size:11px;padding:7px;}.directory-search input{font-size:14px;}}



.directory-card-body{max-height:480px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--strong-line) transparent;}.directory-card-body::-webkit-scrollbar{display:block;width:6px;}.directory-card-body::-webkit-scrollbar-thumb{background:var(--strong-line);border-radius:4px;}@media(max-width:650px){.directory-card-body{max-height:60dvh;}}

.directory-search input{min-height:26px;}.directory-search button{min-height:28px;padding:5px 10px;font-size:12px;}.directory-nav{overflow:hidden;}.directory-nav .channel-button{padding-left:23px;}
.query-block .search-field{min-height:34px;}.query-block .search-field input{min-height:30px;padding-top:5px;padding-bottom:5px;}
.kill-players,.kill-metadata{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}.kill-layout{display:grid;gap:22px;}.kill-player{background:var(--panel);border:1px solid var(--line);border-radius:5px;padding:14px;min-width:0;}
.kill-layout h3{font-size:12px;color:var(--text);margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid var(--line);}.kill-fields{display:grid;gap:12px;margin:0;}.kill-fields>div{min-width:0;}.kill-fields dt{font-size:10px;color:var(--muted);margin-bottom:4px;}.kill-fields dd{font-size:12px;margin:0;overflow-wrap:anywhere;}.kill-metadata section{min-width:0;}
@media(max-width:600px){.kill-players,.kill-metadata{grid-template-columns:1fr;gap:12px;}.kill-player{padding:10px;}}

.directory-member{padding:5px 0;gap:7px;min-height:32px;}.directory-member>div{display:block;min-width:0;}.directory-member strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;font-weight:500;}.directory-member>.icon{width:15px;height:15px;}.directory-member .directory-copy{min-height:22px;width:22px;padding:3px;}
.directory-card{content-visibility:auto;contain-intrinsic-size:auto 72px;}

.directory-card{border-radius:8px;background:var(--sidebar);transition:border-color .15s ease;}.directory-card:hover{border-color:var(--strong-line);}.directory-card[open]{border-color:var(--strong-line);}
.directory-card[open]>.directory-card-body{animation:record-reveal .16s ease-out;}.directory-card-body{padding:18px;}
.directory-card>.record-vehicle-summary{display:block;padding:0;position:relative;min-height:0;}.record-vehicle-cover{position:relative;aspect-ratio:16/9;display:grid;place-items:center;overflow:hidden;background:radial-gradient(ellipse at 50% 85%,var(--hover),transparent 75%),var(--panel);}
.record-vehicle-cover>.icon{width:54px;height:54px;color:var(--faint);}.record-vehicle-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:10px 24px 22px;opacity:0;transition:opacity .15s;}.record-vehicle-cover.image-ready img{opacity:1;}.record-vehicle-cover.image-ready>.icon{visibility:hidden;}
.record-plate{position:absolute;left:16px;bottom:12px;padding:3px 8px;border:1px solid var(--strong-line);background:var(--sidebar);border-radius:4px;color:var(--text);font:600 11px ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:1px;}
.record-vehicle-heading{display:flex;align-items:center;gap:10px;padding:16px;}.record-vehicle-heading>div{min-width:0;flex:1;display:grid;gap:3px;}.record-vehicle-heading strong{font-size:14px;text-transform:capitalize;overflow-wrap:anywhere;}.record-vehicle-heading>.icon{width:14px;height:14px;}.directory-card[open] .record-vehicle-heading>.icon{transform:rotate(90deg);}
.record-state{position:absolute;top:12px;right:12px;font-size:10px!important;font-weight:600;border-radius:4px;padding:4px 7px;background:var(--sidebar);color:var(--text)!important;border:1px solid var(--line);}.record-state.warning{color:var(--warn)!important;}.record-state.out{color:var(--text)!important;}
.record-vehicle-detail,.record-player-detail{display:grid;gap:18px;}.record-quick{display:flex;gap:18px;padding-bottom:16px;border-bottom:1px solid var(--line);}.record-quick>div{display:grid;gap:3px;flex:1;}.record-quick strong{font-size:17px;font-weight:600;letter-spacing:-.4px;}
.record-sections{display:grid;grid-template-columns:1fr;gap:18px;}.record-section{min-width:0;}.record-section h3{font-size:10px;text-transform:uppercase;letter-spacing:1px;font-weight:600;color:var(--faint);margin:0 0 12px;}.record-values{display:grid;gap:10px;margin:0;}.record-values>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) auto;align-items:start;gap:8px;min-width:0;}.record-values dt{font-size:11px;color:var(--muted);}.record-values dd{font-size:11px;color:var(--text);text-align:right;margin:0;overflow-wrap:anywhere;}.record-values .directory-copy{min-height:18px;width:18px;padding:1px;}.record-values .directory-copy .icon{width:12px;height:12px;}
.record-player-link{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 12px;min-height:36px;border-radius:5px;border:1px solid var(--line);background:var(--soft);color:var(--text);text-decoration:none;font-size:12px;font-weight:500;}.record-player-link:hover{background:var(--hover);border-color:var(--strong-line);text-decoration:none;}.record-player-link .icon{color:inherit;width:14px;height:14px;}.record-player-link>.icon:last-child{margin-left:auto;}
.record-player-hero{display:flex;align-items:center;gap:14px;padding-bottom:18px;border-bottom:1px solid var(--line);}.record-avatar{flex:0 0 54px;width:54px;height:64px;overflow:hidden;border:1px solid var(--line);border-radius:6px;background:var(--soft);display:grid;place-items:center;}.record-avatar>.icon{width:26px;height:26px;}.record-player-photo{width:100%;height:100%;object-fit:cover;}.record-player-hero>div:last-child{min-width:0;}.record-player-hero h2{font-size:16px;margin:2px 0 5px;font-weight:600;line-height:1.3;overflow-wrap:anywhere;}.record-player-hero small{font-size:11px;}.record-uid{display:inline-block;font-size:10px;color:var(--muted);}
.directory-grid.directory-profile{grid-template-columns:minmax(0,1fr);max-width:1050px;margin:auto;}.directory-profile .record-profile{content-visibility:visible;contain-intrinsic-size:none;}.record-profile>summary{display:none;}.record-profile>.directory-card-body{max-height:none;overflow:visible;border-top:0;padding:30px;}.record-profile .record-sections{grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 42px;}.record-profile .record-player-hero{gap:20px;padding-bottom:24px;}.record-profile .record-avatar{flex-basis:72px;width:72px;height:86px;}.record-profile .record-player-hero h2{font-size:25px;}.record-profile .record-values dt,.record-profile .record-values dd{font-size:13px;}.record-profile .record-section h3{font-size:11px;}.record-back{justify-self:start;border:0;background:transparent;box-shadow:none;font-size:12px;padding:4px 0;color:var(--muted);}
@keyframes record-reveal{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(max-width:650px){.record-profile>.directory-card-body{padding:18px;}.record-profile .record-sections{grid-template-columns:1fr;gap:22px;}.record-profile .record-player-hero h2{font-size:21px;}.record-profile .record-values dt,.record-profile .record-values dd{font-size:12px;}}
@media(prefers-reduced-motion:reduce){.directory-card[open]>.directory-card-body{animation:none;}.record-vehicle-cover img{transition:none;}}

#directory-view::-webkit-scrollbar{display:block;width:8px;}#directory-view::-webkit-scrollbar-track{background:transparent;}#directory-view::-webkit-scrollbar-thumb{background:var(--strong-line);border-radius:4px;}
.directory-search{position:sticky;top:0;z-index:2;}.directory-player-thumb{width:30px;height:36px;object-fit:cover;border-radius:4px;flex:0 0 30px;}

.directory-column{display:flex;flex-direction:column;gap:16px;min-width:0;align-self:start;}
.record-inventory .record-values{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}.record-inventory .record-values>div{display:flex;align-items:center;justify-content:space-between;gap:6px;background:var(--panel);border:1px solid var(--line);border-radius:4px;padding:9px;min-width:0;}.record-inventory .record-values dt{color:var(--text);font-size:11px;overflow-wrap:anywhere;}.record-inventory .record-values dd{background:var(--soft);padding:2px 6px;border-radius:3px;font-size:11px;flex-shrink:0;font-variant-numeric:tabular-nums;}
.copy-notification{position:fixed;inset:auto 20px 20px auto;margin:0;max-width:calc(100vw - 40px);padding:12px 16px;border:1px solid var(--strong-line);border-radius:5px;background:var(--sidebar);color:var(--text);box-shadow:var(--shadow);font-size:12px;z-index:10000;}.copy-notification::backdrop{background:transparent;}

.log-inline-row{background:var(--sidebar);cursor:default!important;}.log-inline-row>td{padding:0!important;}.log-inline-shell{overflow:hidden;}.log-inline-content{padding:20px 24px;border-bottom:1px solid var(--line);}.inline-expanded{background:var(--sidebar);}.inline-expanded .row-action .icon{transform:rotate(90deg);}.log-inline-content .event-facts{gap:16px 24px;}.log-inline-content .raw-data{margin-top:16px;}.log-inline-content>.raw-data:first-child{margin-top:0;}
@media(max-width:600px){tbody tr.log-inline-row{display:block;padding:0;border-bottom:0;}tbody tr.log-inline-row>td{display:block;grid-column:auto;grid-row:auto;width:100%;justify-self:stretch;}.log-inline-content{padding:16px 12px;}.log-inline-content .event-facts{grid-template-columns:1fr;}}

.log-inline-description{margin:0 0 18px;color:var(--text);font-size:14px;font-weight:500;line-height:1.7;}.log-inline-description+.raw-data{margin-top:0;}

button.load-more,button.load-more:hover,button.load-more:active {display:block;width:max-content;max-width:100%;min-height:28px;margin:8px auto 0;padding:4px 0;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--muted);font-size:12px;font-weight:500;line-height:20px;white-space:nowrap;transform:none;}
button.load-more:hover,button.load-more:focus-visible {color:var(--text);text-decoration:underline;text-underline-offset:3px;}



/* Favorite channels */
.channel-row { position:relative; }
.channel-row .channel-button { width:100%;min-width:0;padding-right:32px;text-align:left;display:flex;align-items:center; }
.channel-row .channel-button span { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.channel-row .favorite-toggle { position:absolute;z-index:1;top:50%;right:5px;transform:translateY(-50%);width:24px;height:24px;min-height:0;padding:5px;display:grid;place-items:center;border:0;background:transparent;color:#8b949e;border-radius:4px; }
.favorite-toggle .icon,#nav-favorites .icon { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round; }
.favorite-toggle:hover { background:var(--hover); }
.favorite-toggle[aria-pressed="true"] { color:#f5c542; }
.favorite-toggle[aria-pressed="true"] .icon { fill:currentColor; }
.favorite-toggle:focus-visible { outline:2px solid var(--accent);outline-offset:2px; }
#nav-favorites.active .icon { color:#f5c542;fill:currentColor; }
.favorites-empty { padding:64px 20px;text-align:center;color:var(--muted); }
.favorites-empty>.icon { width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:1.5; }
.favorites-empty h2 { color:var(--text);font-size:18px; }
.favorites-empty p { margin-bottom:20px; }

.favorite-toggle .icon { color:inherit; }
.channel-row .channel-button { justify-content:flex-start; }

/* Font Awesome outlines are drawn in the SVG path itself. */
.favorite-toggle .icon,#nav-favorites .icon,.favorites-empty>.icon { fill:currentColor;stroke:none; }

.channel-row .favorite-toggle .icon { width:12px;height:12px; }
.channel-row .favorite-toggle[aria-pressed="true"] { color:#f5c542; }
.channel-row .favorite-toggle:hover { background:var(--hover); }

/* Favorite state changes are instantaneous. */
.channel-row .favorite-toggle,.channel-row .favorite-toggle * { transition:none!important;animation:none!important; }
.channel-row .favorite-toggle:hover,.channel-row .favorite-toggle:active:not(:disabled),.channel-row .favorite-toggle:focus { transform:translateY(-50%); }
.channel-list .family-button,.channel-row .channel-button { transition:none; }

#channel-list .favorite-toggle[aria-pressed="true"],#channel-list .favorite-toggle[aria-pressed="true"] .icon { color:#f5c542; }
#channel-list .favorite-toggle[aria-pressed="false"],#channel-list .favorite-toggle[aria-pressed="false"] .icon { color:#8b949e; }

#bot-records { width:min(900px,94vw); min-width:0; max-width:94vw; max-height:88vh; inset:0; margin:auto; box-sizing:border-box; }
#bot-records .detail-scroll { padding:20px; overflow:auto; max-height:72vh; }
#bot-records .event-header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.bot-record-search { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:16px 0; }
.bot-record-search label { flex:1; min-width:180px; }
#bot-records label { display:grid; gap:8px; }
.bot-record-card { display:grid; gap:8px; padding:16px 0; border-bottom:1px solid var(--border); overflow-wrap:anywhere; }
.bot-record-card h3,.bot-record-card p { margin:0; }
.bot-record-card small { display:block; opacity:.75; }
.bot-record-card a { width:fit-content; }

/* Pages Historique et Discord : mêmes surfaces, contrôles et couleurs que les logs. */
.topbar nav { flex:1; min-width:0; }
#nav-admin { margin-left:auto; }
#history-view,#discord-view { min-width:0; }
.feature-tabs { display:flex; flex-wrap:wrap; gap:5px; padding:0 0 14px; margin-bottom:22px; border-bottom:1px solid var(--line); }
.feature-tabs button { background:transparent; border-color:transparent; color:var(--muted); padding:8px 14px; }
.feature-tabs button[aria-selected="true"] { background:var(--selection); border-color:var(--accent); color:var(--text); }
.feature-heading,.feature-card>header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.feature-heading { margin-bottom:20px; }
.feature-heading h2 { margin:0 0 4px; font-size:21px; font-weight:600; }
.feature-heading p { margin:0; color:var(--muted); }
.feature-toolbar { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:0 0 18px; }
.feature-toolbar label { display:grid; gap:6px; flex:1; min-width:180px; max-width:440px; color:var(--muted); font-size:12px; }
.feature-toolbar input,.feature-toolbar select { width:100%; min-width:0; }
.feature-muted { color:var(--muted); font-size:12px; }
.feature-feedback { min-height:20px; color:var(--muted); font-size:13px; margin:14px 0; overflow-wrap:anywhere; }
.feature-error { color:var(--error)!important; }
.feature-empty { color:var(--muted); padding:24px 0; text-align:center; }
.feature-table-wrap { max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:7px; }
.feature-data-table { width:100%; border-collapse:collapse; background:var(--panel); }
.feature-data-table th { text-align:left; background:var(--sidebar); font-size:11px; }
.feature-data-table td { font-size:12px; vertical-align:top; min-width:95px; max-width:320px; overflow-wrap:anywhere; }
.feature-data-table td:nth-child(2),.feature-data-table td:nth-child(3) { white-space:normal; }
.feature-data-table tbody tr:hover { background:var(--hover); }
.feature-identity { display:grid; gap:3px; }
.feature-identity small { color:var(--muted); font-size:11px; }
.feature-badge { display:inline-flex; padding:2px 8px; border:1px solid var(--line); border-radius:4px; white-space:nowrap; color:var(--muted); }
.feature-badge.is-open { color:var(--accent); border-color:var(--accent); background:var(--selection); }
.feature-downloads,.feature-downloads details { display:grid; gap:7px; }
.feature-downloads a { font-size:12px; }
.feature-pagination { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:18px; }
.feature-text-button { color:var(--accent); background:transparent; border:0; padding:0; min-height:28px; text-align:left; }
.feature-card { padding:18px; border:1px solid var(--line); border-radius:7px; background:var(--panel); }
.feature-card h3 { font-size:14px; font-weight:600; margin:0 0 14px; }
.feature-card>header { margin-bottom:14px; }
.feature-card>header h3 { margin:0; }
.feature-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.feature-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:18px; }
.feature-actions>span:first-child { margin-right:auto; }
.feature-check { display:flex!important; align-items:center; gap:9px!important; color:var(--text)!important; font-size:12px; margin-top:12px!important; }
.feature-check input { width:16px!important; height:16px; flex-shrink:0; }
.feature-details { margin-top:18px; padding-top:14px; border-top:1px solid var(--line); }
.feature-details summary { cursor:pointer; color:var(--text); font-size:13px; font-weight:500; margin-bottom:12px; }
.feature-banner { border:1px solid var(--accent); border-radius:6px; padding:12px 16px; background:var(--selection); font-size:12px; overflow-wrap:anywhere; }
.feature-confirm { width:440px; max-width:92vw; min-width:0; min-height:0; height:fit-content; max-height:85vh; padding:24px; border:1px solid var(--line); border-radius:7px; background:var(--panel); color:var(--text); }
.feature-confirm::backdrop { background:#0008; }
.feature-confirm h2 { margin-top:0; font-size:20px; }
.feature-confirm p { color:var(--muted); }
.de-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,.8fr); gap:24px; align-items:start; }
.de-layout>form { min-width:0; }
#de-controls { display:grid; gap:16px; border:0; padding:0; margin:0; min-width:0; }
#de-controls label { display:grid; gap:6px; margin:0 0 14px; font-size:12px; color:var(--muted); min-width:0; }
#de-controls label:last-child { margin-bottom:0; }
#de-controls input:not([type="checkbox"]):not([type="color"]),#de-controls select,#de-controls textarea { width:100%; min-width:0; font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:5px; padding:8px 10px; }
#de-controls textarea { resize:vertical; line-height:1.6; }
#de-controls input:focus-visible,#de-controls select:focus-visible,#de-controls textarea:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.de-color { display:flex; align-items:center; gap:10px; }
.de-color input[type="color"] { padding:2px; width:42px; height:35px; border:1px solid var(--line); border-radius:4px; background:var(--bg); }
.de-color input:last-child { max-width:130px; }
.de-field-row,.de-rule-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; border:1px solid var(--line); border-radius:6px; padding:14px; margin-bottom:12px; }
.de-field-row button,.de-rule-row button { justify-self:start; align-self:end; }
.de-message-list { display:grid; gap:6px; margin:12px 0; max-height:320px; overflow:auto; }
.de-message { width:100%; display:flex; flex-direction:column; align-items:start; gap:3px; text-align:left; padding:10px 12px; overflow-wrap:anywhere; white-space:normal; }
.de-message strong { font-size:12px; font-weight:500; }
.de-message small { font-size:11px; color:var(--muted); }
#app.audit-page .de-preview-column { display:block; min-width:0; position:sticky; top:86px; }
.de-bot { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:20px 0 12px; font-size:13px; }
.de-bot img { width:30px; height:30px; border-radius:50%; }
.de-app-tag { padding:1px 5px; background:var(--selection); color:var(--accent); border-radius:3px; font-size:10px; }
.de-content { white-space:pre-wrap; overflow-wrap:anywhere; padding-bottom:12px; }
.de-embed { border:1px solid var(--line); border-left:4px solid var(--accent); background:var(--sidebar); border-radius:5px; padding:16px; overflow-wrap:anywhere; min-height:30px; }
.de-author { font-size:12px; font-weight:600; margin-bottom:8px; }
.de-title { display:block; font-size:15px; font-weight:600; color:var(--accent); margin-bottom:8px; }
.de-description { font-size:13px; line-height:1.6; white-space:pre-wrap; }
.de-description pre { overflow:auto; }
.de-thumbnail { float:right; width:65px; max-height:80px; object-fit:contain; margin:0 0 12px 12px; }
.de-image { display:block; max-width:100%; max-height:320px; object-fit:contain; border-radius:4px; margin-top:16px; }
.de-footer { display:block; clear:both; padding-top:12px; font-size:11px; color:var(--muted); }
.de-preview-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:14px; }
.de-preview-field { grid-column:1/-1; font-size:12px; white-space:pre-wrap; }
.de-preview-field.inline { grid-column:span 1; }
.de-preview-field strong { display:block; margin-bottom:4px; }
.de-reactions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.de-reaction { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); border-radius:4px; padding:2px 7px; font-size:14px; }
.de-reaction img,.de-emoji { width:19px; height:19px; vertical-align:middle; object-fit:contain; }
.de-reaction small { font-size:11px; color:var(--muted); }
.de-spoiler { background:var(--strong-line); border-radius:2px; }
@media(max-width:1050px) { .de-layout { grid-template-columns:minmax(0,1fr); } #app.audit-page .de-preview-column { position:static; } }
@media(max-width:850px) { .topbar nav { flex:auto; overflow-x:auto; scrollbar-width:thin; } .topbar .nav { flex-shrink:0; } }
@media(max-width:650px) {
  .feature-heading { align-items:start; flex-wrap:wrap; } .feature-heading h2 { font-size:19px; }
  .feature-two,.de-field-row,.de-rule-row { grid-template-columns:minmax(0,1fr); }
  .feature-card { padding:14px; } .feature-card>header { flex-wrap:wrap; gap:6px; }
  .feature-tabs { flex-wrap:nowrap; overflow-x:auto; gap:3px; } .feature-tabs button { flex-shrink:0; padding:7px 10px; }
  .feature-toolbar label { max-width:none; min-width:150px; }
  .feature-data-table,.feature-data-table tbody { display:block; width:100%; }
  .feature-data-table thead { display:none; }
  .feature-data-table tbody tr { display:block; padding:12px; border-bottom:1px solid var(--line); }
  .feature-data-table tbody td { display:grid; grid-template-columns:90px minmax(0,1fr); gap:10px; border:0; padding:5px 0; min-width:0; max-width:none; width:auto; text-align:left; white-space:normal; }
  .feature-data-table td::before { content:attr(data-label); font-size:11px; font-weight:500; color:var(--muted); }
  .feature-data-table tbody td>* { min-width:0; }
  .feature-actions button { min-height:36px; }
}
