/* DSN-8 v1: Telemetry, SigNoz as its own service. Tokens come from the look (assets/look/look.css), dark scheme,
   as DSN-7's env power dashboard; the shell is DSN-7's, and the rest is this design's own. */

:root[data-scheme='dark'] {
  --side: #0f1217;
  --raised: #232833;
  --line: #2a303b;
  --row: #252a33;
  --head: #191d24;
  --violet: #b69cff;
  --warn: #f0a742;
  --info: #7ea2ff;
  --debug: #8790a1;
  --well: #12151b;
}

html, body { background: var(--bg); color: var(--fg); }
body { font-size: 14px; line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
code, .mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.bad { color: var(--error) !important; }
.ok { color: var(--on); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- App shell (DSN-7's) ---------- */
.app {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--side) 0 231px, var(--line) 231px 232px, transparent 232px);
}
.side {
  position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; color: var(--fg); text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #0f1320; flex: none;
  background: linear-gradient(135deg, #ff9e6e, #b69cff);
}
.brand__mark .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.brand b { display: block; font-size: 16px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.nav a:hover { background: #171b22; color: var(--fg); }
.nav a.is-here { background: var(--card); color: var(--fg); box-shadow: inset 2px 0 0 var(--accent); }
.nav__count { margin-left: auto; font-size: 12px; background: var(--raised); color: var(--muted); padding: 1px 8px; border-radius: 10px; }
.nav__count--bad { color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); }
.nav__label { margin: 18px 10px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6f7788; }
.side__src { margin: 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.side__src b { color: var(--fg); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.side__src b i { width: 7px; height: 7px; border-radius: 50%; background: var(--on); box-shadow: 0 0 0 3px color-mix(in srgb, var(--on) 25%, transparent); }
.side__foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; gap: 10px; align-items: center; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: #2b3242; color: var(--fg); font-weight: 700; font-size: 13px;
}
.who { min-width: 0; flex: 1; }
.who b { display: block; font-size: 13px; }
.who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout { color: var(--muted); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; }
.signout:hover { background: #171b22; color: var(--fg); }

.main { padding: 22px 32px 56px; min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; min-height: 40px; }
.top h1 { font-size: 24px; letter-spacing: -.01em; }
.top__sub { color: var(--muted); }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.clock { color: var(--muted); font-size: 13px; white-space: nowrap; }
.clock b { color: var(--fg); font-weight: 600; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- Where: which SigNoz, which environments ---------- */
.where { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); }
.seg a, .seg button {
  all: unset; cursor: pointer; padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.seg a:hover, .seg button:hover { color: var(--fg); }
.seg .is-on { background: var(--raised); color: var(--fg); box-shadow: inset 0 0 0 1px #3a4150; }
.seg .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot--prod { background: var(--error); }
.dot--nonprod { background: var(--info); }
.where__about { font-size: 12.5px; color: var(--muted); }

.multi {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 30px 4px 10px; border-radius: 8px;
  background: var(--well); border: 1px solid var(--border); color: var(--muted); font-size: 13px; position: relative; min-width: 180px;
}
.multi::after { content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; }
.multi__label { color: #6f7788; font-size: 12px; margin-right: 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 8px; border-radius: 6px; background: var(--raised);
  color: var(--fg); font-size: 12.5px; border: 1px solid #39404d; white-space: nowrap;
}
.pill button { all: unset; cursor: pointer; color: var(--muted); padding: 0 4px; border-radius: 4px; }
.pill button:hover { color: var(--fg); background: #353c49; }

/* ---------- Buttons, chips, fields ---------- */
.btn {
  font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--raised); color: var(--fg);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #4a5262; }
.btn--sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #0f1320; }
.btn--danger-solid { background: var(--error); border-color: var(--error); color: #1a0d0b; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--fg); }
.btn--live { color: var(--on); border-color: color-mix(in srgb, var(--on) 50%, transparent); background: color-mix(in srgb, var(--on) 12%, transparent); }
.btn--live i { width: 8px; height: 8px; border-radius: 50%; background: var(--on); box-shadow: 0 0 0 3px color-mix(in srgb, var(--on) 30%, transparent); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap; line-height: 19px;
}
.chip--err { color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, transparent); background: color-mix(in srgb, var(--error) 10%, transparent); }
.chip--ok { color: var(--on); border-color: color-mix(in srgb, var(--on) 45%, transparent); }
.chip--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.chip--info { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); }

.input {
  font: inherit; font-size: 13.5px; color: var(--fg); background: var(--well); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 11px; min-height: 36px;
}
.input::placeholder { color: #6f7788; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); white-space: nowrap; }
.check i { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #4a5262; display: grid; place-items: center; }
.check i.on { background: var(--accent); border-color: var(--accent); }
.check i.on::after { content: ''; width: 8px; height: 4px; border: 2px solid #0f1320; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card--flush .card__head { padding: 16px 20px 0; }
.card__head h2 { font-size: 15px; }
.card__head .muted { font-size: 13px; }
.card__head > .end { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 13px; }
.stack { display: grid; gap: 18px; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; display: grid; gap: 2px; }
.tile__label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.tile__n { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.tile__n small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.tile__d { font-size: 12.5px; color: var(--muted); }
.tile--bad .tile__n { color: var(--error); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8790a1;
  padding: 0 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 0 14px; height: 42px; border-bottom: 1px solid var(--row); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #20252e; }
.table td:first-child, .table th:first-child { padding-left: 20px; }
.table td:last-child, .table th:last-child { padding-right: 20px; }
.table .svc a, .table a.svc { color: var(--fg); text-decoration: none; font-family: var(--font-mono); font-size: 13.5px; }
.table .svc a:hover, .table a.svc:hover { color: var(--accent); text-decoration: underline; }
.table tr.is-picked td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.table tr.is-picked .svc a { color: var(--accent); }
.table tr.err td { background: color-mix(in srgb, var(--error) 5%, transparent); }
.spark { width: 120px; height: 26px; display: block; }
.spark path { fill: none; stroke: var(--on); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark .a { fill: color-mix(in srgb, var(--on) 14%, transparent); stroke: none; }
.spark--bad path { stroke: var(--error); }
.spark--bad .a { fill: color-mix(in srgb, var(--error) 14%, transparent); }
.bar { position: relative; height: 6px; border-radius: 3px; background: #262b35; width: 64px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--on); }
.bar--bad i { background: var(--error); }
.op { font-family: var(--font-mono); font-size: 13px; }
.tid { font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- Exceptions ---------- */
.exc { list-style: none; margin: 0; padding: 0; }
.exc li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; padding: 12px 20px; border-top: 1px solid var(--row); }
.exc li:first-child { border-top: 1px solid var(--line); }
.exc__type { display: flex; align-items: center; gap: 10px; min-width: 0; }
.exc__type strong { font-family: var(--font-mono); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exc__n { font-weight: 700; color: var(--error); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.exc__svc { font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: var(--raised); padding: 0 7px; border-radius: 5px; white-space: nowrap; }
.exc__msg { grid-column: 1; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exc__side { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Charts ---------- */
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chart { margin: 0; background: var(--head); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 10px; }
.chart figcaption { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.chart figcaption .muted { font-weight: 400; font-size: 12px; }
.chart__big { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.chart__big small { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.chart svg { width: 100%; height: 96px; display: block; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .ar { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.chart .grid { stroke: #2c323d; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart--bad .ln { stroke: var(--error); }
.chart--bad .ar { fill: color-mix(in srgb, var(--error) 15%, transparent); }
.chart--warn .ln { stroke: var(--warn); }
.chart--warn .ar { fill: color-mix(in srgb, var(--warn) 14%, transparent); }
.chart__ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: #6f7788; margin-top: 4px; }

/* ---------- Filter bar ---------- */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; }
.filters .grow { flex: 1; min-width: 160px; }
.filters .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }

/* ---------- Trace ---------- */
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.facts b { color: var(--fg); font-weight: 600; }
.facts code { color: var(--fg); background: var(--raised); padding: 1px 7px; border-radius: 5px; font-size: 12px; }
.trace { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.wf__head, .span { display: grid; grid-template-columns: 380px minmax(0, 1fr); align-items: center; column-gap: 14px; padding: 0 16px; }
.wf__head { height: 36px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: #8790a1; }
.wf__ticks { position: relative; height: 100%; }
.wf__ticks span { position: absolute; top: 50%; transform: translate(-50%, -50%); font-variant-numeric: tabular-nums; }
.wf__ticks span:first-child { transform: translate(0, -50%); }
.wf__ticks span:last-child { transform: translate(-100%, -50%); }
.span { height: 34px; border-bottom: 1px solid var(--row); font-size: 13px; cursor: pointer; }
.span:hover { background: #20252e; }
.span.is-on { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.span__name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.span__tw { width: 14px; color: var(--muted); font-size: 11px; flex: none; text-align: center; }
.span__svc { font-family: var(--font-mono); font-size: 11.5px; padding: 0 6px; border-radius: 4px; flex: none; color: #0f1320; font-weight: 600; }
.span__nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: 12.5px; }
.span__dur { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-left: 8px; }
.span__bar { position: relative; height: 12px; }
.span__bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; min-width: 2px; }
.span.err .span__nm { color: var(--error); }
.c-api { background: #7ea2ff; }
.c-silo { background: #5cc781; }
.c-int { background: #f0a742; }
.c-auth { background: #b69cff; }
.c-ext { background: #8790a1; }
.c-sql { background: #6fd3d8; }
.span.err .span__bar i { box-shadow: inset 0 0 0 2px var(--error); }
.detail h2 { font-size: 15px; font-family: var(--font-mono); word-break: break-all; margin-bottom: 8px; }
.detail h3 { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #8790a1; margin: 16px 0 8px; }
.status { padding: 9px 12px; border-radius: 8px; background: color-mix(in srgb, var(--error) 10%, transparent); border: 1px solid color-mix(in srgb, var(--error) 35%, transparent); color: var(--error); font-size: 13px; margin-top: 12px; }
.stacktrace { margin: 8px 0 0; padding: 10px 12px; background: var(--well); border: 1px solid var(--line); border-radius: 8px; font: 11.5px/1.6 var(--font-mono); color: #c9cfda; white-space: pre-wrap; word-break: break-word; }
.stacktrace b { color: var(--error); font-weight: 600; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--row); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); overflow-wrap: anywhere; }
.kv code { color: var(--fg); overflow-wrap: anywhere; }
.errlist { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; }
.errlist li { display: flex; gap: 10px; align-items: baseline; }
.errlist a { font-family: var(--font-mono); font-size: 12.5px; color: var(--error); text-decoration: none; }
.errlist a:hover { text-decoration: underline; }

/* ---------- Logs ---------- */
.hist { display: flex; align-items: flex-end; gap: 3px; height: 54px; padding: 0 20px; }
.hist i { flex: 1; background: #343b48; border-radius: 2px 2px 0 0; position: relative; }
.hist i b { position: absolute; left: 0; right: 0; bottom: 0; background: var(--error); border-radius: 2px 2px 0 0; }
.hist i u { position: absolute; left: 0; right: 0; background: var(--warn); }
.hist__ticks { display: flex; justify-content: space-between; padding: 6px 20px 14px; font-size: 11.5px; color: #6f7788; border-bottom: 1px solid var(--line); }
.logs { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log { border-bottom: 1px solid var(--row); border-left: 3px solid transparent; }
.log:last-child { border-bottom: 0; }
.log__line { display: grid; grid-template-columns: 92px 58px 150px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 20px 8px 17px; }
.log:hover { background: #1f242c; }
.log__time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.log__sev { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.log__svc { font-family: var(--font-mono); font-size: 12px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log__svc small { display: block; color: #6f7788; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.log__body { font-family: var(--font-mono); font-size: 12.5px; color: #d5dae3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log.open .log__body { white-space: pre-wrap; word-break: break-word; }
.log__acts { display: flex; gap: 12px; font-size: 12.5px; white-space: nowrap; }
.log__acts a, .log__acts button { all: unset; cursor: pointer; color: var(--accent); }
.log__acts a:hover, .log__acts button:hover { text-decoration: underline; }
.log--error { border-left-color: var(--error); }
.log--error .log__sev { color: var(--error); }
.log--warn { border-left-color: var(--warn); }
.log--warn .log__sev { color: var(--warn); }
.log--info .log__sev { color: var(--info); }
.log--new { background: color-mix(in srgb, var(--on) 7%, transparent); }
.log--new .log__time::after { content: 'new'; display: block; width: max-content; margin-top: 3px; font-family: var(--font-ui); font-size: 10px; font-weight: 700; line-height: 15px; color: #0f1320; background: var(--on); border-radius: 4px; padding: 0 5px; }
.props { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 4px 20px 16px 182px; }
.log.open .props { display: grid; }
.props h3 { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #8790a1; margin: 4px 0 6px; }
.props .kv { grid-template-columns: minmax(0, 1fr); gap: 1px; }
.props .kv span { word-break: normal; overflow-wrap: anywhere; font-size: 12px; }
.copied { color: var(--on) !important; }
.follow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on); white-space: nowrap; }
.follow i { width: 8px; height: 8px; border-radius: 50%; background: var(--on); box-shadow: 0 0 0 4px color-mix(in srgb, var(--on) 25%, transparent); }

/* ---------- API ---------- */
.api { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.api > .stack, .api > .stack > * { min-width: 0; }
.key { display: flex; gap: 10px; align-items: center; }
.key__val {
  flex: 1; font: 14px var(--font-mono); padding: 10px 13px; border-radius: 8px; background: var(--well); border: 1px solid var(--border);
  letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.key__val b { color: var(--fg); }
.key__meta { display: flex; gap: 22px; margin-top: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.code { margin: 0; padding: 14px 16px; background: var(--well); border: 1px solid var(--line); border-radius: 10px; font: 13px/1.7 var(--font-mono); color: #d5dae3; white-space: pre; overflow: hidden; }
.code .c { color: #6f7788; }
.code .s { color: #8fd6a4; }
.ep { display: grid; grid-template-columns: 62px 250px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--row); font-size: 13.5px; }
.ep:last-child { border-bottom: 0; }
.ep code { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep span { color: var(--muted); }
.verb { font: 700 11px var(--font-mono); text-align: center; padding: 2px 0; border-radius: 5px; color: var(--on); background: color-mix(in srgb, var(--on) 14%, transparent); }
.verb--sse { color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }
.calls { display: grid; }
.call { display: grid; grid-template-columns: 70px minmax(0, 1fr) 36px; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--row); font-size: 13px; align-items: baseline; }
.call:last-child { border-bottom: 0; }
.call code { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call small { display: block; font-family: var(--font-ui); color: #6f7788; font-size: 11.5px; }
.call .st { text-align: right; font-weight: 700; font-size: 12.5px; }
.know { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 13.5px; color: var(--muted); }
.know b { color: var(--fg); }

/* ---------- Dialog ---------- */
.scrim { position: fixed; inset: 0; background: rgba(6, 8, 12, .66); display: grid; place-items: center; z-index: 10; }
.dialog { width: 520px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.dialog h2 { font-size: 19px; margin-bottom: 10px; }
.dialog p { color: var(--muted); margin-bottom: 12px; }
.dialog__acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.notice {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; margin-bottom: 18px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--on);
}
.notice .icon { color: var(--on); }
.notice--warn { border-left-color: var(--warn); }
.notice--warn .icon { color: var(--warn); }

/* ---------- Sign in ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 560px; background: var(--side); }
.gate__art { position: relative; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(1200px 600px at 20% 0%, #1b2030 0, var(--side) 60%); padding: 56px 64px; display: flex; flex-direction: column; }
.gate__art svg.wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 460px; }
.gate__lede { margin-top: auto; position: relative; max-width: 560px; padding-bottom: 300px; }
.gate__lede h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 16px; }
.gate__lede p { font-size: 17px; color: var(--muted); }
.gate__panel { display: flex; flex-direction: column; justify-content: center; padding: 64px; background: var(--bg); }
.gate__panel h2 { font-size: 26px; margin-bottom: 8px; }
.gate__panel > p { color: var(--muted); margin-bottom: 28px; font-size: 15px; }
.ms {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 18px; border-radius: 10px; font-size: 15px; font-weight: 600;
  background: #f5f6f8; color: #1d2330; text-decoration: none; border: 1px solid #d9dde5;
}
.ms:hover { background: #fff; }
.ms svg { width: 20px; height: 20px; }
.gate__rules { margin-top: 26px; display: grid; gap: 12px; font-size: 13.5px; color: var(--muted); }
.gate__rules div { display: flex; gap: 10px; align-items: flex-start; }
.gate__rules .icon { color: var(--on); margin-top: 2px; }
.gate__foot { margin-top: 40px; font-size: 12.5px; color: #6f7788; }
.refused { border: 1px solid color-mix(in srgb, var(--error) 40%, transparent); background: color-mix(in srgb, var(--error) 8%, transparent); border-radius: 12px; padding: 16px 18px; margin-bottom: 22px; }
.refused b { color: var(--fg); }
.refused p { color: var(--muted); font-size: 14px; }
.refused p + p { margin-top: 8px; }
.as { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); margin-bottom: 18px; }
.as .who span { white-space: normal; }

/* ---------- Tickets, from Zendesk (v2) ---------- */
.zd { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.zd__mark { width: 20px; height: 20px; border-radius: 5px; background: #e9f4f2; display: grid; place-items: center; flex: none; }
.zd__mark svg { width: 13px; height: 13px; }
.lookup { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.lookup h2 { font-size: 15px; margin-right: 6px; }
.lookup p { font-size: 13px; color: var(--muted); }
.lookup__num { display: inline-flex; align-items: center; background: var(--well); border: 1px solid var(--border); border-radius: 8px; padding-left: 12px; min-height: 40px; }
.lookup__num b { color: #6f7788; font: 600 15px var(--font-mono); }
.lookup__num input { all: unset; font: 15px var(--font-mono); color: var(--fg); padding: 8px 12px 8px 4px; width: 110px; }
.lookup__num input::placeholder { color: #6f7788; }
.tkno { font-family: var(--font-mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.tkno a { color: var(--fg); text-decoration: none; }
.tkno a:hover { color: var(--accent); text-decoration: underline; }
.tk-subj { min-width: 0; padding: 8px 0; }
.tk-subj a, .tk-subj span.t { color: var(--fg); text-decoration: none; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-subj a:hover { color: var(--accent); text-decoration: underline; }
.tk-subj small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table td.tk-subj { height: auto; max-width: 0; width: 46%; }
.zst { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.zst--new { color: #f5c76b; background: color-mix(in srgb, #f5c76b 14%, transparent); }
.zst--open { color: var(--error); background: color-mix(in srgb, var(--error) 13%, transparent); }
.zst--pending { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }
.zst--solved { color: var(--muted); background: var(--raised); }
.prio { font-size: 13px; color: var(--muted); white-space: nowrap; }
.prio--high { color: var(--warn); }
.prio--urgent { color: var(--error); font-weight: 600; }
.found { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.found i { width: 7px; height: 7px; border-radius: 50%; background: #4a5262; flex: none; }
.found--hit { color: var(--error); }
.found--hit i { background: var(--error); }
.found--slow { color: var(--warn); }
.found--slow i { background: var(--warn); }
.found--clear { color: var(--on); }
.found--clear i { background: var(--on); }
.found--none { color: #6f7788; }

.tk { display: grid; grid-template-columns: minmax(0, 1fr) 500px; gap: 18px; align-items: start; }
.tk-head { margin-bottom: 18px; }
.tk-head h1 { font-size: 20px; letter-spacing: -.01em; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.tk-head h1 .tkno { font-size: 18px; font-weight: 400; }
.thread__head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; }
.thread__head h2 { font-size: 15px; }
.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 16px 20px; border-top: 1px solid var(--row); }
.msg__who { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.msg__who b { font-size: 13.5px; }
.msg__who .muted { font-size: 12.5px; }
.msg__who time { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.msg__body { color: #d5dae3; font-size: 14px; line-height: 1.55; }
.msg__body p + p { margin-top: 8px; }
.msg--note { background: color-mix(in srgb, #f5c76b 6%, transparent); box-shadow: inset 3px 0 0 #f5c76b; }
.msg__tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #f5c76b; }
.msg--new { background: color-mix(in srgb, var(--on) 7%, transparent); box-shadow: inset 3px 0 0 var(--on); }
.msg--new .msg__tag { color: var(--on); }
.avatar--agent { background: #213a37; color: #8fd6c4; }
.avatar--tel { background: linear-gradient(135deg, #ff9e6e, #b69cff); color: #0f1320; }
.clue { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--fg); border-bottom: 1.5px dashed var(--accent); border-radius: 3px; padding: 0 2px; }
.att { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; background: var(--raised); margin: 10px 8px 0 0; color: var(--fg); }
.att small { color: var(--muted); }
.readonly { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--head); font-size: 12.5px; color: var(--muted); }

.find h2 { font-size: 15px; }
.find h3 { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8790a1; margin: 16px 0 4px; }
.find h3 a { margin-left: auto; font-size: 12.5px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.clues { display: grid; gap: 7px; padding: 12px 14px; background: var(--well); border: 1px solid var(--line); border-radius: 10px; }
.clue-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; font-size: 13px; align-items: baseline; }
.clue-row > span:first-child { color: #8790a1; font-size: 12px; }
.clue-row small { color: var(--muted); font-size: 12px; }
.clue-row code { font-size: 12px; color: var(--fg); }
.verdict { margin-top: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--error) 38%, transparent); background: color-mix(in srgb, var(--error) 8%, transparent); font-size: 13.5px; color: #e9dcdb; }
.verdict b { color: var(--error); display: block; font-size: 14px; margin-bottom: 3px; }
.verdict--clear { border-color: color-mix(in srgb, var(--on) 38%, transparent); background: color-mix(in srgb, var(--on) 7%, transparent); color: #d9e7dd; }
.verdict--clear b { color: var(--on); }
.verdict a { color: var(--fg); }
.hits { list-style: none; margin: 0; padding: 0; }
.hit { display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--row); font-size: 13px; align-items: baseline; }
.hit:first-child { border-top: 0; }
.hit > span:first-child { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.hit code { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d5dae3; }
.hit small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit .sev { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; margin-right: 6px; }
.hit a { font-size: 12.5px; white-space: nowrap; }
.saw { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.saw li { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--row); font-size: 13px; }
.saw li:first-child { border-top: 0; }
.saw li > span:first-child { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.saw li.key { color: var(--fg); }
.saw li.key b { color: var(--warn); }
.find__acts { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.find__acts .end { margin-left: auto; }
.done { display: inline-flex; align-items: center; gap: 7px; color: var(--on); font-weight: 600; font-size: 14px; }

.dialog--wide { width: 640px; }
.opts { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 6px 0 14px; }
.opt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--row); font-size: 13.5px; }
.opt:first-child { border-top: 0; }
.opt .check i { margin: 0; }
.opt small { color: var(--muted); font-size: 12.5px; }
.opt code { font-size: 12px; color: var(--muted); }
.as-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, #f5c76b 7%, transparent); border: 1px solid color-mix(in srgb, #f5c76b 30%, transparent); font-size: 13px; color: #e8dfc8; }
.as-note b { color: #f5c76b; }
.note-preview { margin: 0; padding: 12px 14px; background: var(--well); border: 1px solid var(--line); border-radius: 10px; font: 12px/1.6 var(--font-mono); color: #c9cfda; white-space: pre-wrap; }
.dialog h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8790a1; margin: 14px 0 6px; }
