:root {
  --canvas: #f3f5f7;
  --surface: #fff;
  --ink: #16212c;
  --muted: #526275;
  --line: #dbe2e8;
  --nav: #12202a;
  --nav-muted: #b9c7d0;
  --accent: #07685f;
  --active: #04544d;
  --danger: #9a302e;
  --radius: 7px;
  font: 15px "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--active); text-underline-offset: .22em; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid #178779; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 4.2vw, 43px); line-height: 1.12; letter-spacing: -.045em; text-wrap: balance; }
h2 { font-size: 19px; letter-spacing: -.02em; }
small { font-size: 12px; }
.shell { display: grid; min-height: 100vh; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 26px 15px 18px; color: #fff; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; line-height: 1.15; font-weight: 750; font-size: 20px; letter-spacing: -.035em; }
.sidebar .brand { padding-inline: 8px; }
.brand small { display: block; color: var(--muted); font-weight: 450; letter-spacing: .025em; margin-top: 4px; }
.sidebar .brand small { color: var(--nav-muted); }
.brand-mark { display: grid; place-items: center; background: var(--accent); color: #fff; width: 36px; height: 36px; border-radius: var(--radius); font-size: 14px; letter-spacing: 0; padding-left: 2px; }
.sidebar nav { display: grid; gap: 3px; }
.sidebar nav a { border-inline-start: 3px solid transparent; text-decoration: none; color: var(--nav-muted); padding: 10px 11px; border-radius: 4px; }
.sidebar nav a:hover { background: #233541; color: #fff; }
.sidebar nav a[aria-current] { border-color: #51c0ae; background: #213741; color: #fff; font-weight: 650; }
.signout { margin-top: auto; }
.signout button { padding-left: 12px; color: var(--nav-muted); }
.content { width: 100%; max-width: 1536px; margin-inline: auto; padding: 34px clamp(19px, 4vw, 56px) 56px; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 23px; }
.section-head.compact { margin-bottom: 12px; }
.section-head.compact a, .back { font-size: 13px; }
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); }
.content > section { margin-top: 32px; }
.content > section > h2 { margin-bottom: 12px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 27px; }
.metrics div { display: grid; align-content: start; gap: 8px; padding: 15px 16px 16px; min-width: 0; }
.metrics div + div { border-inline-start: 1px solid var(--line); }
.metrics span { color: var(--muted); font-size: 12px; }
.metrics strong { font-size: clamp(20px, 2vw, 29px); font-weight: 650; white-space: nowrap; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.channels { max-height: 55vh; }
table { border-collapse: collapse; width: 100%; text-align: start; }
td, th { text-align: start; padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 650; white-space: nowrap; color: var(--muted); background: #f9fafb; }
.channels th { position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faf9; }
td small { color: var(--muted); display: block; margin-top: 3px; }
.row-title { color: var(--ink); text-decoration: none; font-weight: 650; }
.row-title:hover { text-decoration: underline; }
.right { text-align: end; }
.mobile-copy { display: none; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.status { display: inline-flex; align-items: center; line-height: 1.25; gap: 6px; width: max-content; border-radius: 5px; padding: 3px 7px; font-size: 12px; font-weight: 600; background: #e9edf0; color: #415265; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.live { background: #dcefe8; color: #12604d; }
.status.starting, .status.queued, .status.retry { background: #f6ead5; color: #774e18; }
.empty { padding: 24px 17px; border: 1px dashed #c6d0d9; border-radius: var(--radius); color: var(--muted); background: #fafbfc; }
.empty p { margin-bottom: 7px; }
.button, button { display: inline-flex; justify-content: center; align-items: center; min-height: 36px; padding: 7px 12px; border: 1px solid #c7d1da; border-radius: var(--radius); color: var(--ink); background: var(--surface); font-size: 13px; font-weight: 620; line-height: 1.3; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #eaf1f2; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover { background: var(--active); color: #fff; }
.quiet { background: transparent; border-color: transparent; color: var(--active); }
.sidebar button:hover { color: var(--ink); }
.danger { color: var(--danger); }
.toolbar, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar { margin-bottom: 13px; }
.toolbar > input:not([type=hidden]) { min-width: min(235px, 100%); }
.action-gap { margin-top: 10px; }
input:not([type=checkbox]), textarea, select { min-height: 36px; min-width: 0; max-width: 100%; padding: 7px 9px; border: 1px solid #c7d1da; background: #fff; border-radius: var(--radius); color: var(--ink); }
input[type=checkbox] { accent-color: var(--accent); inline-size: 17px; block-size: 17px; margin: 0; vertical-align: middle; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 620; }
label.check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
label.check small { color: var(--muted); font-weight: 450; }
.stack { display: grid; gap: 14px; }
.editor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 26px); max-width: 800px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hint { color: var(--muted); line-height: 1.45; text-wrap: pretty; }
.link-strip { display: flex; align-items: end; gap: 7px; flex-wrap: wrap; background: #ebf1f3; padding: 12px; border-radius: var(--radius); margin-bottom: 18px; }
.link-strip label { flex: 1 1 310px; }
.link-strip input { font-family: ui-monospace, Consolas, monospace; font-size: 12px; width: 100%; }
.event-detail { display: inline-block; color: var(--muted); font-size: 13px; }
.event-name.error, .event-name.subscription { color: var(--danger); }
.flash { padding: 10px 12px; border: 1px solid #c1dfd3; border-radius: var(--radius); background: #e5f4ed; color: #125749; margin-bottom: 14px; }
.flash.error { background: #f9e9e7; border-color: #edc7c0; color: var(--danger); }
.floating { position: fixed; z-index: 2; right: 18px; bottom: 18px; background: var(--nav); color: #fff; padding: 13px; border-radius: var(--radius); }
.server-info { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 20px; margin: 0 0 18px; }
.server-info dt { color: var(--muted); }
.server-info dd { margin: 0; overflow-wrap: anywhere; }
.preview { display: block; width: min(900px, 100%); aspect-ratio: 16 / 9; background: #0b151c; border-radius: var(--radius); margin-bottom: 12px; }
.device { border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.device small { color: var(--muted); }
.history { display: block; width: 100%; height: 140px; background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 13px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-box { width: min(100%, 390px); border-radius: var(--radius); padding: 27px; border: 1px solid var(--line); background: var(--surface); }
.login-box h1 { margin: 25px 0 16px; font-size: 30px; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 180px minmax(0, 1fr); }
  .metrics div { padding-inline: 9px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; gap: 10px; padding: 12px 14px 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; display: flex; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; border-inline-start: none; border-bottom: 3px solid transparent; padding: 8px; font-size: 13px; }
  .signout { margin-block: auto; }
  .content { padding: 20px 14px 36px; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics div:nth-child(4), .metrics div:nth-child(5) { border-top: 1px solid var(--line); }
  .metrics div:nth-child(4) { border-inline-start: 0; }
  .desktop-copy { display: none; }
  .mobile-copy { display: block; }
  .mobile-copy button { justify-content: start; padding-inline: 0; text-align: start; }
  td, th { padding: 10px 9px; }
}
@media (max-width: 390px) {
  .section-head { align-items: start; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
