/* Ticket desk — an operations console: graphite surfaces, hairlines, IBM Plex (sans for reading,
   mono for anything you compare: ids, times, counts). Dark values are the default, light follows the OS. */

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/sans/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/sans/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/sans/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/mono/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/mono/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --plane: #0d0e10;
  --surface: #141517;
  --surface-2: #1a1c1f;
  --surface-3: #232529;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --border: var(--line);
  --text: #ececec;
  --text-2: #8f9196;
  --text-3: #63666c;
  --grid: #26282c;
  --axis: #3d4046;
  /* the one brand color: primary action, active marker, focus */
  --accent: #d4f25c;
  --accent-ink: #15170b;
  --accent-soft: rgba(212, 242, 92, 0.13);
  --link: #ececec;
  /* chart series: fixed order, never cycled */
  --series-1: #338ced;
  --series-2: #e76624;
  /* status: always shown with a dot and a label */
  --good: #0aac23;
  --warning: #fbb315;
  --serious: #f18a59;
  --critical: #dc3c3d;
  --radius: 6px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --plane: #f4f4f2;
    --surface: #ffffff;
    --surface-2: #f6f6f4;
    --surface-3: #ebebe8;
    --line: rgba(15, 15, 15, 0.09);
    --line-strong: rgba(15, 15, 15, 0.18);
    --text: #17181a;
    --text-2: #62656b;
    --text-3: #8f9196;
    --grid: #e9e9e6;
    --axis: #c4c5c2;
    --accent: #17181a;
    --accent-ink: #ffffff;
    --accent-soft: rgba(23, 24, 26, 0.07);
    --link: #17181a;
    --series-1: #257de0;
    --series-2: #f47230;
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--plane);
  color: var(--text);
  font: 13.5px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
a:hover {
  text-decoration-color: currentColor;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}
h1 {
  font-size: clamp(19px, 1.2vw + 12px, 24px);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
h2 {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
}
code {
  font: 12px var(--mono);
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 3px;
}
.muted {
  color: var(--text-2);
}
.small {
  font-size: 12px;
}
.num {
  font-variant-numeric: tabular-nums;
}
td.num,
.mini-list .num {
  color: var(--text-2);
  font-size: 12.5px;
}
td.right.num {
  color: var(--text);
}
td.num {
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-soft);
}
.ic {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------- layout ------------------------------- */
#app {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 16px 10px 12px;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 6px;
  display: grid;
  place-items: center;
}
@media (prefers-color-scheme: light) {
  .brand-mark {
    background: #d4f25c;
    color: #15170b;
  }
}
.brand-mark .ic {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.brand-text strong {
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-text small {
  font: 11px var(--mono);
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
#nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
#nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
#nav a.active {
  background: var(--surface-2);
  color: var(--text);
}
#nav a.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.nav-count {
  margin-left: auto;
  font: 11px var(--mono);
  color: var(--text-2);
}
.nav-count.hot {
  color: var(--text);
}
.nav-count.hot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--warning);
  vertical-align: 1px;
}
.me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.me .who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.main {
  min-width: 0;
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 49px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--plane) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
#crumb {
  font: 12px var(--mono);
  color: var(--text-2);
  white-space: nowrap;
}
#search {
  margin-left: auto;
  position: relative;
  flex: 0 1 420px;
}
#search input {
  width: 100%;
  height: 30px;
  padding-right: 34px;
  background: var(--surface);
}
#search kbd {
  position: absolute;
  right: 7px;
  top: 6px;
  font: 11px var(--mono);
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 5px;
  line-height: 16px;
  pointer-events: none;
}
#view {
  padding: 26px 28px 72px;
  max-width: 1440px;
  outline: none;
}
#view.enter {
  animation: enter 0.24s var(--ease);
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head p {
  margin: 5px 0 0;
  max-width: 68ch;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cols {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}
.cols.even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}

/* ------------------------------- controls ------------------------------ */
input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}
input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 5px 10px;
  min-width: 0;
  transition: border-color 0.12s;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--axis);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}
select {
  height: 30px;
  padding-right: 6px;
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  padding: 9px 11px;
  line-height: 1.5;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.btn:hover {
  background: var(--surface-3);
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}
.btn.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
}
.btn.danger {
  color: color-mix(in srgb, var(--critical) 62%, var(--text));
}
.btn.danger:hover {
  border-color: var(--critical);
  background: color-mix(in srgb, var(--critical) 12%, var(--surface));
}
.btn.ghost {
  background: none;
  border-color: transparent;
  color: var(--text-2);
}
.btn.ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}
.btn.small {
  height: 24px;
  padding: 0 7px;
  font-size: 12px;
}
.btn.big {
  height: 42px;
  padding: 0 18px;
  font-size: 14.5px;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
}
.seg button {
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  height: 28px;
  padding: 0 11px;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
}
.seg button:first-child {
  border-left: 0;
}
.seg button:hover {
  color: var(--text);
}
.seg button[aria-pressed='true'] {
  background: var(--surface-3);
  color: var(--text);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.filters input[type='search'] {
  flex: 1 1 240px;
  height: 30px;
}

/* -------------------------------- panels ------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.card > header .count {
  color: var(--text);
  margin-left: 6px;
}
.card .body {
  padding: 14px;
}
.empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-2);
}

/* stat strip: one continuous band, cells split by hairlines */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.tile {
  background: var(--surface);
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}
a.tile:hover {
  background: var(--surface-2);
}
.tile .label {
  font: 500 10.5px/1.4 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
}
.tile .value {
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.tile .hint {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
}
.tile.alert .label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--warning);
  vertical-align: 1px;
}

/* -------------------------------- tables ------------------------------- */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th:first-child,
td:first-child {
  padding-left: 14px;
}
th:last-child,
td:last-child {
  padding-right: 14px;
}
td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 0.1s;
}
tbody tr:hover {
  background: var(--surface-2);
}
td.right,
th.right {
  text-align: right;
}
.t-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 170px;
  max-width: 440px;
}
.t-main a,
.mini-list a.tk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
}
.t-main a .ic,
.mini-list a.tk .ic {
  color: var(--text-2);
}
.chan {
  font: 500 12.5px var(--mono);
}
.t-main a:hover .chan,
.mini-list a.tk:hover .chan {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.t-main .sub {
  padding-left: 22px;
  color: var(--text-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
}

/* ---------------------------- people & states --------------------------- */
.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  background: var(--surface-3);
}
.avatar.ph {
  display: inline-grid;
  place-items: center;
  font: 500 10px var(--mono);
  color: var(--text-2);
}
.avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}
.avatar.md {
  width: 30px;
  height: 30px;
  font-size: 12px;
}
.avatar.sq {
  border-radius: 8px;
}
.user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
  max-width: 100%;
  white-space: nowrap;
  vertical-align: middle;
}
.user > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.user:hover > span:last-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rbx {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font: 500 10px var(--mono);
  flex: none;
}
/* a state is a dot and a word; no pill */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text);
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}
.badge:not(.good):not(.warning):not(.serious):not(.critical) {
  color: var(--text-2);
}
.badge.good::before {
  background: var(--good);
}
.badge.warning::before {
  background: var(--warning);
}
.badge.serious::before {
  background: var(--serious);
}
.badge.critical::before {
  background: var(--critical);
}
/* a tag is a fact about the row, not a state: quiet outlined label */
.badge.plain {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 3px 5px;
}
.badge.plain::before {
  display: none;
}
.badges {
  display: inline-flex;
  gap: 12px;
  white-space: nowrap;
}

/* ------------------------------ ticket page ----------------------------- */
.ticket-title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ticket-title h1 {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.kv {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}
.kv dt {
  color: var(--text-2);
  font-size: 12.5px;
}
.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.prose {
  overflow-wrap: anywhere;
}
.prose blockquote {
  margin: 2px 0;
  padding-left: 10px;
  border-left: 2px solid var(--axis);
  color: var(--text-2);
}
.prose small {
  color: var(--text-2);
}
.mention {
  background: var(--accent-soft);
  color: var(--text);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 500;
  text-decoration: none;
}
.conv {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}
.msg {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  padding: 8px 14px;
  border-left: 2px solid transparent;
}
.msg:hover {
  background: var(--surface-2);
}
.msg.opener {
  border-left-color: var(--line-strong);
}
.msg .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.3;
  margin-bottom: 2px;
}
.msg .meta a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.msg .meta a:hover {
  text-decoration: underline;
}
.msg .meta .num {
  font: 11px var(--mono);
}
.msg .embed {
  margin-top: 6px;
  padding: 8px 12px;
  border-left: 2px solid var(--axis);
  background: var(--surface-2);
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.msg .embed strong {
  color: var(--text);
}
.msg.bot .prose {
  color: var(--text-2);
}
.files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}
.files img {
  max-width: 260px;
  max-height: 200px;
  border-radius: 5px;
  border: 1px solid var(--line);
  display: block;
}
.file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font: 12px var(--mono);
  color: var(--text);
  text-decoration: none;
}
a.file:hover {
  background: var(--surface-3);
}
.file .ic {
  color: var(--text-2);
}
.reply {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.timeline li {
  position: relative;
  padding: 0 0 14px 18px;
}
.timeline li:last-child {
  padding-bottom: 0;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--axis);
}
.timeline li::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 17px;
  bottom: -5px;
  width: 1px;
  background: var(--line-strong);
}
.timeline li:last-child::after {
  display: none;
}
.timeline .small {
  font-family: var(--mono);
  font-size: 11px;
}
.notice {
  padding: 10px 13px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--warning) 38%, transparent);
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
}
.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mini-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.mini-list li:last-child {
  border-bottom: 0;
}
.mini-list .grow {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------ person page ----------------------------- */
.identity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.identity .card {
  border: 0;
  border-radius: 0;
}
.id-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  align-items: center;
}
.id-card .names {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.id-card .names > .small:first-child {
  font: 500 10.5px var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.id-card .names strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

/* -------------------------------- charts ------------------------------- */
.chart {
  position: relative;
  height: 240px;
  padding: 12px 14px 12px;
}
.heat {
  display: grid;
  grid-template-columns: 32px repeat(24, minmax(0, 1fr));
  gap: 2px;
  padding: 14px 14px 12px;
  font: 10.5px var(--mono);
  color: var(--text-2);
}
.heat .cell {
  aspect-ratio: 1.15;
  min-height: 14px;
  border-radius: 2px;
  background: color-mix(in oklab, var(--series-1) calc(var(--v) * 100%), var(--surface-2));
}
.heat .cell:hover {
  outline: 1.5px solid var(--text);
  outline-offset: 0;
}
.heat .hour {
  text-align: center;
}
.heat .dayname {
  display: flex;
  align-items: center;
}
.legend-ramp {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 11px var(--mono);
  color: var(--text-2);
  padding: 0 14px 14px;
}
.legend-ramp span.swatch {
  width: 90px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--surface-2), var(--series-1));
}
.bar-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 120px;
}
.bar-cell i {
  height: 6px;
  border-radius: 0 3px 3px 0;
  background: var(--series-1);
  min-width: 2px;
}

/* --------------------------- dialog, toast, tip -------------------------- */
dialog {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
dialog[open] {
  animation: enter 0.18s var(--ease);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
dialog h2 {
  font: 600 16px var(--sans);
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}
dialog form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
dialog input {
  width: 100%;
  height: 32px;
}
#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}
.toast {
  padding: 9px 13px 9px 11px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--good);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  max-width: 380px;
  animation: enter 0.2s var(--ease);
}
.toast.error {
  border-left-color: var(--critical);
}
#tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--text);
  color: var(--plane);
  font: 11.5px var(--mono);
  white-space: nowrap;
}

/* --------------------------------- login -------------------------------- */
body.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 56px);
  border-right: 1px solid var(--line);
  overflow: hidden;
  /* ledger grid: the desk where cases are filed */
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: -1px -1px;
}
.login-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 0% 100%, transparent 30%, var(--plane) 78%);
  pointer-events: none;
}
.login-art > * {
  position: relative;
  z-index: 1;
}
.login-art h1 {
  font-size: clamp(34px, 5.2vw, 76px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
  max-width: 9ch;
}
.login-art h1 em {
  font-style: normal;
  color: var(--text-3);
}
.login-meta {
  font: 11.5px var(--mono);
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.login-card {
  align-self: center;
  justify-self: center;
  width: min(360px, 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: enter 0.4s var(--ease);
}
.login-card h2 {
  font: 600 20px var(--sans);
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--text);
}
.login-card p {
  margin: 0;
}
.login-card .btn {
  width: 100%;
  margin-top: 6px;
}
.login-error {
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent);
  background: color-mix(in srgb, var(--critical) 9%, var(--surface));
}

/* -------------------------------- mobile -------------------------------- */
@media (max-width: 900px) {
  #app {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 16px;
    gap: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #nav {
    flex-direction: row;
  }
  #nav a.active::before {
    display: none;
  }
  #nav a .ic,
  .nav-count:not(.hot) {
    display: none;
  }
  .me {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }
  .me .who,
  .brand-text,
  #crumb {
    display: none;
  }
  .top,
  #view {
    padding-left: 16px;
    padding-right: 16px;
  }
  #search {
    flex: 1;
  }
  .cols,
  .cols.even {
    grid-template-columns: minmax(0, 1fr);
  }
  body.login {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-art {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* small screens: counters stay on one line, filters share the row evenly */
.nav-count {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .filters select {
    flex: 1 1 140px;
  }
}
