/* URP Logs. Plain, dense, made for reading log lines. */
:root {
  --bg: #111214;
  --bg-2: #17181b;
  --bg-3: #1e2024;
  --line: #2a2c31;
  --line-2: #383b42;
  --text: #d6d8dc;
  --dim: #8b9099;
  --faint: #5f636b;
  --accent: #e0a526;
  --accent-ink: #1a1405;
  --mark: rgba(224, 165, 38, .30);
  --bad: #e5534b;
  --ok: #57ab5a;
  --ip: #c7a252;
  --link: #8fb4e3;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafaf8;
    --bg-2: #ffffff;
    --bg-3: #f1f1ee;
    --line: #e3e3df;
    --line-2: #cfcfca;
    --text: #1d1e20;
    --dim: #62666d;
    --faint: #9a9da3;
    --accent: #b7791f;
    --accent-ink: #ffffff;
    --mark: rgba(224, 165, 38, .35);
    --ip: #8a6116;
    --link: #2f5f9e;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
code { font-family: var(--mono); font-size: 12px; }
h1 { font-size: 18px; margin: 0 0 8px; font-weight: 600; }
h2 { font-size: 13px; font-weight: 600; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
h2:first-child { margin-top: 0; }
small { color: var(--dim); font-size: 11.5px; font-weight: normal; }
.muted { color: var(--dim); }
.small { font-size: 12px; }
.grow { flex: 1; }

input, select, button { font: inherit; color: inherit; }
input, select {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 2px; padding: 4px 7px; height: 28px; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); }
input[type=checkbox], input[type=radio] { height: auto; accent-color: var(--accent); margin: 0; }

.btn {
  height: 28px; padding: 0 12px; border: 1px solid var(--line-2); background: var(--bg-3); border-radius: 2px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--bad); }

.boot { padding: 20px; color: var(--dim); font-family: var(--mono); }

/* denied */
.denied { max-width: 560px; padding: 48px 24px; }
.wordmark { font-family: var(--mono); font-weight: 700; color: var(--text); font-size: 14px; margin: 0 0 28px; letter-spacing: -.01em; }
.wordmark span { color: var(--accent); margin: 0 1px; }
.denied code { background: var(--bg-3); padding: 1px 6px; border: 1px solid var(--line); }
.request-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.request-form input { flex: 1; min-width: 160px; }
.login-msg { margin-top: 12px; }
.login-msg.bad { color: var(--bad); }

/* header */
.top { display: flex; align-items: stretch; gap: 22px; height: 40px; padding: 0 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.top .wordmark { margin: 0; align-self: center; }
.tabs { display: flex; gap: 2px; }
.tabs a { display: flex; align-items: center; padding: 0 10px; color: var(--dim); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.srv { display: flex; align-items: center; }
.srv button { height: 22px; padding: 0 8px; background: transparent; border: 1px solid var(--line-2); color: var(--dim); cursor: pointer; font-family: var(--mono); font-size: 11.5px; }
.srv button + button { border-left: 0; }
.srv button.on { background: var(--bg-3); color: var(--text); }
.srv button.on[data-src="beta"] { color: #c49bf0; }
.me { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--dim); }
.me #me-name { color: var(--text); }
.me .link { margin-left: 10px; font-family: var(--mono); font-size: 11.5px; }
.sep { color: var(--faint); }

main { padding: 14px 16px 40px; max-width: 1500px; }

/* search */
.searchbar { display: flex; }
.searchbar input { flex: 1; height: 32px; font-family: var(--mono); font-size: 13px; border-right: 0; }
.searchbar .btn { height: 32px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; color: var(--dim); }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.toolbar #player { width: 170px; }
.lbl { margin-right: -8px; }
.seg { display: inline-flex; }
.seg button { height: 26px; padding: 0 8px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--dim); cursor: pointer; font-family: var(--mono); font-size: 11.5px; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--bg-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.select { height: 26px; padding: 0 22px 0 8px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 2px; cursor: pointer; font-family: var(--mono); font-size: 11.5px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; color: var(--text); }
.select::after { content: "▾"; position: absolute; right: 7px; color: var(--dim); }
.select.set { border-color: var(--accent); }
.custom-range input { height: 26px; font-size: 12px; }

.help { margin-top: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); }
.help table { border-collapse: collapse; }
.help td { padding: 2px 16px 2px 0; }
.help p { margin: 8px 0 0; }

.logs-panel { margin-top: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); columns: 4 220px; column-gap: 24px; }
.logs-panel .lp-top { column-span: all; margin-bottom: 8px; display: flex; gap: 14px; color: var(--dim); }
.lp-group { break-inside: avoid; margin-bottom: 10px; }
.lp-group > label { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 2px; cursor: pointer; }
.lp-file { display: flex; align-items: center; gap: 6px; padding-left: 18px; font-family: var(--mono); font-size: 12px; color: var(--dim); cursor: pointer; }
.lp-file:hover { color: var(--text); }
.lp-file small { margin-left: auto; color: var(--faint); font-size: 11px; }

.player-card { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: baseline; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line); border-left: 2px solid var(--accent); }
.player-card .pc-name { font-weight: 600; font-size: 14px; }
.player-card .kv { color: var(--dim); }
.player-card .kv b { color: var(--text); font-weight: normal; font-family: var(--mono); font-size: 12px; margin-left: 4px; }
.player-card .link { margin-left: auto; }
.online { color: var(--ok) !important; }

.summary { margin: 14px 0 6px; color: var(--dim); min-height: 19px; }
.summary b { color: var(--text); font-weight: 600; }
.hist-wrap { margin-bottom: 6px; }
.histogram { display: flex; align-items: flex-end; gap: 1px; height: 44px; border-bottom: 1px solid var(--line-2); }
.histogram .bar { flex: 1; background: var(--dim); opacity: .55; min-height: 0; cursor: pointer; }
.histogram .bar:hover { background: var(--accent); opacity: 1; }
.axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.facets { margin: 4px 0 10px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); line-height: 1.9; }
.facet { background: none; border: 0; padding: 0; margin-right: 14px; cursor: pointer; color: var(--dim); font: inherit; }
.facet:hover { color: var(--text); }
.facet b { font-weight: normal; color: var(--faint); margin-left: 4px; }
.facet.on { color: var(--accent); }

.results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.results:empty { display: none; }
.r { display: grid; grid-template-columns: 128px 120px 1fr; gap: 12px; padding: 2px 6px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.3px; line-height: 1.55; align-items: baseline; }
.r.click { cursor: pointer; }
.r:hover { background: var(--bg-2); }
.r .t { color: var(--faint); white-space: nowrap; }
.r .f { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r .x { white-space: pre-wrap; word-break: break-word; }
.r mark { background: var(--mark); color: inherit; }
.r .pl { color: var(--link); cursor: pointer; }
.r .pl:hover { text-decoration: underline; }
.r .ip { color: var(--ip); }
.r.hl { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--accent); }
.r.new { animation: flash 1.5s ease-out; }
@keyframes flash { from { background: var(--bg-3); } to { background: transparent; } }
.more { padding: 12px 6px; color: var(--faint); font-family: var(--mono); font-size: 11.5px; }

/* tail */
.tail-status { font-family: var(--mono); font-size: 11.5px; color: var(--ok); }
.tail-status.paused { color: var(--dim); }
.tail-status.err { color: var(--bad); }
#view-tail .toolbar { margin: 0 0 10px; }

/* access + audit */
.cols { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
.requests:empty::before { content: "None."; color: var(--faint); }
.req { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.req .grow { min-width: 0; }
.add-ip { display: grid; gap: 6px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; color: var(--dim); padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .acts { text-align: right; white-space: nowrap; }
.table .acts .link + .link { margin-left: 12px; }
.table .rights { color: var(--dim); max-width: 520px; }
.table.audit td { font-size: 12px; }
.table.audit .detail { font-family: var(--mono); font-size: 11.5px; color: var(--dim); word-break: break-word; }
.mono { font-family: var(--mono); font-size: 12px; }
.tag { font-family: var(--mono); font-size: 11px; padding: 0 4px; border: 1px solid var(--line-2); color: var(--dim); }
.tag.acc { border-color: var(--accent); color: var(--accent); }

/* dialogs */
.dialog { background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 2px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
.dialog.wide { width: min(1300px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dialog header { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 1; font-family: var(--mono); font-size: 12px; }
.dialog footer { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg-2); }
.dialog .results.ctx { border-top: 0; }
.edit-body { padding: 14px; display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f { display: flex; flex-direction: column; gap: 4px; color: var(--dim); }
.f input, .f select { color: var(--text); }
.radios, .checks { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text); }
.radios, .checks.col { flex-direction: column; }
.radios label, .checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.presets { display: flex; gap: 14px; flex-wrap: wrap; }
.picker { border: 1px solid var(--line); padding: 8px 10px; columns: 3 190px; column-gap: 18px; max-height: 300px; overflow: auto; color: var(--text); }
.picker .lp-group { margin-bottom: 8px; }
.picker .lp-all { column-span: all; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.picker .lp-all label { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.picker label.off, .checks label.off, .radios label.off { opacity: .4; cursor: default; }
.summary-line { margin: 0; padding: 8px 10px; background: var(--bg-3); border-left: 2px solid var(--accent); }
.edit-err { margin: 0; color: var(--bad); }

.toast { position: fixed; bottom: 16px; right: 16px; background: var(--bg-3); border: 1px solid var(--line-2); padding: 7px 12px; z-index: 50; font-size: 12.5px; }
.toast.bad { border-color: var(--bad); color: var(--bad); }

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; height: auto; padding: 6px 16px; gap: 6px 16px; }
  .tabs a { padding: 6px 8px; }
  .me { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  main { padding: 12px 16px 32px; }
  .r { grid-template-columns: 1fr; gap: 0; padding: 5px 4px; }
  .r .t, .r .f { font-size: 11px; }
  .grid2 { grid-template-columns: 1fr; }
  .toolbar #player { width: 140px; }
}
