:root {
  --bg: #15121f; --bg2: #1e1a2b; --bg3: #29243a; --bg4: #343048; --line: #352f48;
  --text: #ebe7f3; --muted: #9b94ae; --accent: #8b6cf6; --accent2: #6e4ee8;
  --fatal: #ff3b30; --error: #f25a5a; --warning: #f5a623; --info: #4d9ef6; --debug: #7c8a99;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side: 230px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--text); text-decoration: none; } a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .strong { font-weight: 600; } .nowrap { white-space: nowrap; }
.spacer, .grow { flex: 1; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; }
code { font-family: var(--mono); background: var(--bg3); padding: 1px 4px; border-radius: 3px; }
kbd { font-family: var(--mono); font-size: 11px; background: rgba(255,255,255,.12); border-radius: 3px; padding: 0 5px; margin-left: 6px; }

/* layout */
.app { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .01em; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 7px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.card.login { text-align: center; } .card.login form { text-align: left; margin-top: 14px; }
.login-mark { border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.4); margin-bottom: 8px; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px; }
.side-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.side-item:hover { background: var(--bg3); text-decoration: none; }
.side-item.active { background: var(--bg4); font-weight: 600; }
.side-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-new { color: var(--muted); margin-top: 6px; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.shortcuts summary { cursor: pointer; color: var(--muted); font-size: 12px; list-style: none; }
.shortcuts dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0 0; font-size: 12px; }
.shortcuts dt { font-family: var(--mono); color: var(--text); } .shortcuts dd { margin: 0; color: var(--muted); }
.main { flex: 1; min-width: 0; padding: 22px 28px 40px; max-width: 1400px; }
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .side { width: auto; height: auto; position: static; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px; } .side-label { width: 100%; }
  .side-foot { flex-direction: row; justify-content: space-between; }
  .main { padding: 16px; }
}

.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head form { display: inline; }
.head-stats { display: flex; gap: 10px; align-items: center; }
.crumbs { font-size: 16px; } .crumbs .sep { color: var(--muted); margin: 0 4px; }
.count { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600; text-align: center; background: var(--bg4); color: var(--text); }
.count.unread { background: #c4453f; color: #fff; }
[hidden] { display: none !important; }

/* cards & forms */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.danger { border-color: #6b2e2e; }
label { display: block; margin-bottom: 12px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 12px; }
input[type=text], input[type=password], input:not([type]), select { width: 100%; padding: 7px 9px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 5px; font: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; padding: 6px 12px; background: var(--bg3); border: 1px solid var(--line); color: var(--text); border-radius: 5px; cursor: pointer; font: inherit; line-height: 1.3; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn.ghost { background: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--text); }
.btn.primary { background: var(--accent2); border-color: var(--accent2); }
.btn.danger { border-color: #a33; color: #f88; }
.btn.link { background: none; border: none; color: var(--muted); padding: 0; }
.btn.disabled { opacity: .35; pointer-events: none; }
.error { color: var(--error); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--bg3); }
.badge.error { background: #5a2a2a; color: #ffb3b3; }
.dsn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dsn-row .dsn { flex: 1; margin: 0; }
pre.dsn, pre.snippet { background: var(--bg); padding: 10px 12px; border-radius: 5px; border: 1px solid var(--line); user-select: all; }
pre.snippet { margin: 8px 0; }

/* tables */
table.list { width: 100%; border-collapse: collapse; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { font-size: 12px; color: var(--muted); font-weight: 500; }
table.list .num { text-align: right; white-space: nowrap; }
table.list .check { width: 32px; }
table.list .empty { text-align: center; color: var(--muted); padding: 30px; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: rgba(255,255,255,.025); }
tr.cursor td { background: rgba(139,108,246,.12) !important; }
tr.cursor td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.unread .title, tr.unread .strong { color: #fff; }
tr.unread .title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: middle; }
tr:not(.unread) .title { font-weight: 500; color: #d7d2e3; }

.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters select { width: auto; } .filters .search { flex: 1; min-width: 180px; }
td.issue { border-left: 3px solid var(--line); }
.level-fatal { border-left-color: var(--fatal) !important; } .level-error { border-left-color: var(--error) !important; }
.level-warning { border-left-color: var(--warning) !important; } .level-info { border-left-color: var(--info) !important; } .level-debug { border-left-color: var(--debug) !important; }
td.issue .title { font-weight: 600; }
.subtitle { color: #cfc9dd; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 3px; background: var(--bg3); color: var(--muted); font-size: 12px; }
.chip.status { color: var(--warning); }
.chip.level { color: var(--text); }
.bulk { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }

/* issue detail */
.issue-nav { display: flex; gap: 6px; }
.issue-head { display: flex; gap: 24px; align-items: flex-start; padding: 16px 20px; margin-bottom: 16px; background: var(--bg2); border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; }
.issue-head h1 { margin-bottom: 2px; }
.issue-head .subtitle { margin: 0 0 6px; font-size: 15px; }
.stats { display: flex; gap: 20px; }
.stats div { text-align: center; } .stats b { display: block; font-size: 18px; } .stats span { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 6px; } .actions form { display: inline-flex; gap: 6px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 1000px) { .columns { grid-template-columns: 1fr; } .issue-head { flex-wrap: wrap; } }
.event-bar { display: flex; gap: 16px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.message { background: var(--bg); padding: 10px 12px; border-radius: 5px; border: 1px solid var(--line); }
.caused { margin: 14px 0 -6px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.frames { display: flex; flex-direction: column; gap: 4px; }
.frame { border: 1px solid var(--line); border-radius: 5px; background: var(--bg); opacity: .7; }
.frame.in-app { opacity: 1; border-color: #4a4066; }
.frame summary { padding: 7px 10px; cursor: pointer; list-style: none; }
.frame summary::-webkit-details-marker { display: none; }
.frame summary::before { content: "\25B8"; color: var(--muted); margin-right: 6px; }
.frame[open] summary::before { content: "\25BE"; }
.code { border-top: 1px solid var(--line); padding: 4px 0; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; }
.line { display: flex; white-space: pre; padding: 0 10px; }
.line .ln { width: 48px; color: var(--muted); flex: none; user-select: none; }
.line.hl { background: #3d2f5c; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 8px 4px 0; width: 120px; vertical-align: top; white-space: nowrap; }
table.kv td { padding: 4px 0; word-break: break-word; }
table.kv.vars { border-top: 1px solid var(--line); padding: 4px 10px; }
table.kv.vars th, table.kv.vars td { padding: 3px 10px; font-size: 12px; }
details.section summary { cursor: pointer; list-style: none; } details.section summary h2 { display: inline-block; }
details.section summary::before { content: "\25B8 "; color: var(--muted); } details.section[open] summary::before { content: "\25BE "; }
table.crumbs { width: 100%; border-collapse: collapse; }
table.crumbs td { padding: 3px 8px 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
ul.events { list-style: none; padding: 0; margin: 0; }
ul.events li { padding: 4px 6px; border-radius: 3px; display: flex; justify-content: space-between; gap: 8px; }
ul.events li.current { background: var(--bg3); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--accent2); color: #fff; padding: 8px 16px; border-radius: 6px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.4); z-index: 10; }
