:root {
  --ink:#162c32;
  --muted:#526873;
  --light:#edf2f2;
  --border:#d6e0e1;
  --accent:#00665d;
  --accent-light:#dcf0eb;
  --red:#913b30;
  --paper:#fff;
  --shadow:0 3px 14px #152d3310;
  font:15px/1.6 "Inter","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  color:var(--ink);
  background:#f3f6f5;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
button,input,select,textarea {
  font:inherit;
  color:inherit;
}
button,a,input,textarea,select {
  touch-action:manipulation;
}
button,a {
  transition:background .12s,color .12s;
}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible {
  outline:3px solid #17968c;
  outline-offset:2px;
}
button {
  border:1px solid var(--border);
  border-radius:7px;
  background:#fff;
  cursor:pointer;
  padding:.45rem .85rem;
  font-weight:580;
}
button:hover {
  background:var(--light);
}
button[disabled] {
  opacity:.52;
  cursor:wait;
}
button.primary {
  background:var(--accent);
  border-color:var(--accent);
  color:white;
}
button.primary:hover {
  background:#00524c;
}
a {
  color:var(--accent);
}
a:hover {
  text-decoration:underline;
}
.shell {
  display:grid;
  grid-template-columns:218px minmax(0,1fr);
  min-height:100vh;
}
.sidebar {
  background:#fcfdfc;
  border-inline-end:1px solid var(--border);
  padding:24px 14px;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.brand {
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 8px 17px;
  border-bottom:1px solid var(--border);
}
.mark {
  flex:0 0 32px;
  height:32px;
  background:var(--accent-light);
  color:var(--accent);
  border-radius:8px;
  display:grid;
  place-items:center;
  font-weight:700;
  font-size:17px;
}
.brand b {
  font-size:15px;
  font-weight:680;
  line-height:1.35;
}
.sidebar nav {
  display:grid;
  gap:15px;
}
.nav-label {
  padding:0 10px 4px;
  color:#68747b;
  font-size:11px;
  font-weight:400;
}
.nav-links {
  display:grid;
  gap:2px;
}
.sidebar nav a {
  display:flex;
  align-items:center;
  min-height:35px;
  text-decoration:none;
  color:#32494d;
  border-radius:6px;
  padding:6px 10px;
  font-size:14px;
  font-weight:500;
  line-height:1.4;
}
.sidebar nav a:hover {
  color:var(--accent);
}
.sidebar nav a[aria-current="page"] {
  background:#eef5f2;
  color:var(--accent);
  font-weight:600;
  box-shadow:inset 3px 0 var(--accent);
}
.main {
  width:100%;
  max-width:1350px;
  margin:0 auto;
  padding:34px clamp(20px,4vw,62px) 55px;
}
.topline,.headline,.card-head,.toolbar,.actions {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.topline {
  justify-content:space-between;
  border-bottom:1px solid var(--border);
  padding-bottom:14px;
  color:var(--muted);
  font-size:13px;
}
.topline-tools {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 12px;
}
.account-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.account-switch:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.account-switch select {
  max-width: min(42vw, 18rem);
}
.account-record-actions {
  flex-wrap: wrap;
}
.headline {
  justify-content:space-between;
  margin:23px 0 18px;
}
.headline h1 {
  font-size:clamp(25px,3vw,34px);
  letter-spacing:-.035em;
  line-height:1.25;
  margin:0;
}
.section {
  display:grid;
  gap:16px;
}
#docs {
  grid-template-columns:minmax(0,1fr);
}
.card,.metric {
  background:var(--paper);
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
}
.card {
  padding:19px 22px;
}
.card-head {
  justify-content:space-between;
  margin-bottom:12px;
}
h2,h3 {
  line-height:1.4;
  margin:0;
}
h2 {
  font-size:17px;
}
h3 {
  font-size:15px;
}
p {
  margin:.45em 0;
}
.muted,.hint {
  color:var(--muted);
}
.hint,.minor {
  font-size:13px;
}
.metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.metric {
  padding:16px;
}
.metric span {
  display:block;
  color:var(--muted);
  font-size:13px;
}
.metric strong {
  display:block;
  line-height:1.25;
  font-size:clamp(24px,2.8vw,34px);
  margin-top:6px;
  font-variant-numeric:tabular-nums;
}
.metrics.dashboard-metrics {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.dashboard-metrics strong {
  overflow-wrap:anywhere;
}
.dashboard-filter-legend {
  margin-bottom:9px;
  padding:0;
  font-weight:650;
}
fieldset.dashboard-filter {
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  gap:12px;
}
.dashboard-filter .field {
  min-width:0;
  flex:0 1 160px;
}
.api-log-filter .field {
  flex:0 1 195px;
}
.api-log-filter .api-log-path {
  flex-basis:240px;
}
.dashboard-scope {
  margin:12px 0 0;
}
.dashboard-trend {
  max-height:25rem;
  overflow:auto;
}
.dashboard-trend th {
  position:sticky;
  top:0;
}
.dashboard-trend th:first-child,.dashboard-trend th:last-child {
  width:1%;
  white-space:nowrap;
}
.dashboard-amount {
  display:grid;
  grid-template-columns:clamp(36px,7vw,76px) minmax(0,1fr);
  align-items:center;
  gap:8px;
  font-variant-numeric:tabular-nums;
}
.dashboard-amount meter {
  width:100%;
  height:.8rem;
}
.dashboard-amount meter::-webkit-meter-bar {
  background:var(--light);
  border:0;
  border-radius:8px;
}
.dashboard-amount meter::-webkit-meter-optimum-value {
  background:var(--accent);
  border-radius:8px;
}
.dashboard-amount meter::-moz-meter-bar {
  background:var(--accent);
}
.kv {
  margin:0;
  display:grid;
  gap:0;
}
.kv>div {
  display:grid;
  grid-template-columns:minmax(118px,32%) 1fr;
  gap:10px;
  border-bottom:1px solid var(--light);
  padding:10px 0;
}
.kv>div:last-child {
  border:0;
}
.kv dt {
  color:var(--muted);
}
.kv dd {
  margin:0;
  overflow-wrap:anywhere;
}
a.textlink {
  font-size:13px;
  text-decoration:none;
}
.toolbar {
  justify-content:space-between;
  align-items:flex-end;
  margin-bottom:12px;
}
.search {
  display:flex;
  flex:1;
  gap:6px;
  max-width:550px;
  align-items:end;
}
.field {
  display:grid;
  gap:5px;
  font-size:14px;
  color:var(--ink);
}
.field span {
  font-weight:600;
}
.field.grow {
  flex:1;
}
.field input,.field select,.field textarea {
  padding:8px 10px;
  border:1px solid #adbec2;
  border-radius:6px;
  width:100%;
  background:white;
  min-width:0;
}
.field textarea {
  resize:vertical;
  min-height:95px;
}
.selectrow {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.tabs {
  display:inline-flex;
  gap:3px;
  border-radius:8px;
  padding:3px;
  background:var(--light);
}
.tabs button {
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:13px;
}
.tabs button[aria-pressed=true] {
  background:#fff;
  color:var(--ink);
  box-shadow:var(--shadow);
}
.table-scroll {
  width:100%;
  overflow-x:auto;
}
.record-cell-title {
  display:none;
}
.record-time {
  white-space:nowrap;
}
.record-summary {
  white-space:pre-wrap;
}
.record-pagination {
  justify-content:flex-end;
  margin-top:12px;
}
table {
  border-collapse:collapse;
  width:100%;
  text-align:left;
  font-size:14px;
}
th,td {
  padding:9px 10px;
  border-bottom:1px solid var(--light);
  vertical-align:top;
  overflow-wrap:anywhere;
}
th {
  font-size:12px;
  color:var(--muted);
  font-weight:600;
  background:#f7f9f8;
}
td:first-child,th:first-child {
  padding-left:8px;
}
td.time {
  white-space:nowrap;
}
tr:last-child td {
  border-bottom:none;
}
.center {
  text-align:center;
  color:var(--muted);
  padding:23px 12px;
}
.mono,code,pre {
  font-family:"IBM Plex Mono",ui-monospace,Consolas,monospace;
  font-size:.9em;
}
code {
  color:#175b57;
  background:#eef5f3;
  border-radius:4px;
  padding:1px 4px;
  overflow-wrap:anywhere;
}
pre {
  margin:9px 0;
  background:#f0f5f3;
  border:1px solid var(--border);
  border-radius:7px;
  padding:11px;
  overflow:auto;
  line-height:1.5;
}
pre code {
  padding:0;
  background:none;
}
.doclist {
  margin:0;
  padding-left:1.3em;
}
.doclist li {
  margin:.45em 0;
}
.notice {
  margin:10px 0;
  padding:10px 12px;
  border-radius:6px;
  background:var(--accent-light);
  font-size:14px;
  color:#154e46;
  overflow-wrap:anywhere;
}
.notice.error {
  color:var(--red);
  background:#fff0ed;
}
.gridfields {
  display:grid;
  grid-template-columns:minmax(125px,.5fr) minmax(0,2fr);
  gap:12px;
}
.form {
  display:grid;
  gap:13px;
}
.login-shell {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px 16px;
}
.login-card {
  width:min(100%,420px);
  padding:clamp(18px,5vw,32px);
}
.login-heading {
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:20px;
}
.login-heading .mark {
  flex:none;
}
.login-heading h1 {
  font-size:clamp(19px,5vw,25px);
  line-height:1.25;
  margin:0;
}
.captcha-row {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
.captcha-row img {
  display:block;
  width:140px;
  height:46px;
  object-fit:contain;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--light);
}
.login-card .primary {
  margin-top:5px;
}
.commands {
  width:100%;
  max-width:100%;
  padding:0;
  border:0;
  background:none;
}
.badge {
  display:inline-block;
  border-radius:4px;
  padding:1px 7px;
  background:var(--light);
  font-size:12px;
}
.badge.good {
  color:#115b4e;
  background:var(--accent-light);
}
.badge.warn {
  color:#81382d;
  background:#fff0eb;
}
.space-top {
  margin-top:14px;
}
.two-col {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
dialog {
  width:min(94vw,480px);
  border:1px solid var(--border);
  border-radius:12px;
  padding:22px;
  box-shadow:0 20px 90px #142c4540;
  color:var(--ink);
}
dialog::backdrop {
  background:#19353c80;
}
dialog .actions {
  justify-content:flex-end;
  margin-top:20px;
}
.preview {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-height:200px;
  overflow-y:auto;
  padding:10px 12px;
  background:var(--light);
  border-radius:7px;
}
.nowrap {
  white-space:nowrap;
}
[hidden] {
  display:none!important;
}
@media(max-width:980px) {
  .shell {
    grid-template-columns:182px minmax(0,1fr);
  }
  .sidebar {
    padding:20px 10px;
  }
  .main {
    padding:24px 20px 40px;
  }
  .two-col {
    grid-template-columns:1fr;
  }
}
@media(max-width:700px) {
  .shell {
    display:block;
  }
  .sidebar {
    padding:12px 12px 8px;
    gap:7px;
    border-inline-end:0;
    border-bottom:1px solid var(--border);
  }
  .brand {
    padding:0 2px 9px;
  }
  .mark {
    flex-basis:28px;
    height:28px;
    border-radius:6px;
    font-size:15px;
  }
  .sidebar nav {
    gap:3px;
  }
  .nav-group {
    display:grid;
    grid-template-columns:70px minmax(0,1fr);
    align-items:start;
  }
  .nav-group + .nav-group {
    border-top:1px solid var(--border);
    padding-top:3px;
  }
  .nav-label {
    padding:7px 4px 0 2px;
    white-space:nowrap;
  }
  .nav-links {
    display:flex;
    flex-wrap:wrap;
    gap:1px 2px;
  }
  .sidebar nav a {
    padding:5px 8px;
    min-height:32px;
    white-space:nowrap;
    font-size:13px;
  }
  .sidebar nav a:focus-visible {
    outline-offset:-2px;
  }
  .main {
    padding:16px 12px 36px;
  }
  .headline {
    margin:17px 0 13px;
  }
  .metrics {
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .metric {
    padding:12px;
  }
  .card {
    padding:14px;
  }
  .gridfields {
    grid-template-columns:1fr;
  }
  .search {
    min-width:min(100%,230px);
  }
  .kv>div {
    grid-template-columns:105px 1fr;
  }
  .table-scroll {
    font-size:13px;
  }
  .record-table table,.record-table tbody {
    display:block;
  }
  .record-table thead {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
  }
  .record-table tbody tr {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    column-gap:12px;
    padding:10px 0;
    border-bottom:1px solid var(--border);
  }
  .record-table tbody tr:last-child {
    border-bottom:0;
  }
  .record-table td {
    padding:4px 0;
    border:0;
  }
  .record-table .center,
  #message-list td:first-child,#message-list td:last-child,
  #dashboard-errors td:first-child,#dashboard-errors td:nth-child(n+4),
  #api-log-list td:first-child,#api-log-list td:nth-child(n+4) {
    grid-column:1 / -1;
  }
  .record-cell-title {
    display:block;
    color:var(--muted);
    font-size:12px;
  }
  .record-time {
    white-space:normal;
  }
  .topline {
    font-size:12px;
  }
}
@media(max-width:480px) {
  .dashboard-filter .field {
    flex:1 1 120px;
  }
  .api-log-filter .field {
    flex-basis:180px;
  }
  .dashboard-filter .actions {
    flex-basis:100%;
  }
  .dashboard-metrics strong {
    font-size:21px;
  }
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 17px;
  min-width: 0;
}
fieldset[disabled] {
  opacity: .7;
}
.field small {
  font-size: 12px;
  color: var(--muted);
  margin-left: 5px;
  font-weight: normal;
}
.gridfields.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkline, .choices label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkline input, .choices input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.choices { display: flex; gap: 10px 20px; flex-wrap: wrap; margin-top: 8px; }
.choices label { background: var(--light); border-radius: 5px; padding: 4px 9px 4px 4px; }
.danger { color: var(--red); border-color: #d8b4ad; }
.danger:hover { background: #fff0ed; }
.keyline { margin: 17px 0; }
.keyvalue { padding: 7px 10px; display: inline-block; letter-spacing: .06em; }
.secret-panel { padding: 15px; margin-top: 20px; border: 1px solid var(--border); border-radius: 8px; }
.secret-panel .actions { margin-top: 10px; }
.brand b { overflow-wrap: anywhere; }
button.row-action { font-size: 12px; padding: 3px 7px; white-space: nowrap; }
@media (max-width: 700px) {
  .gridfields.even {grid-template-columns: 1fr;}
}
.rule-editor { border-top: 1px solid var(--border);margin-top:18px;padding-top:18px; }
.rule-editor .card-head { margin-bottom: 0; }
.keyline .keyvalue, #hook-url { max-width: 100%; overflow-wrap: anywhere; }
.device-avatar {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}
.device-connection {
  display: grid;
  justify-items: start;
  gap: 3px;
}
.notification-group-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
}
.notification-group-list .checkline {
  padding: 5px 0;
  overflow-wrap: anywhere;
}
#notification-selected-groups button {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
#notification-form-error, #notification-test-error {
  color: var(--red);
}
#confirm-description, #notification-preview-title, #notification-test-name {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  #notification-tasks td:first-child, #notification-tasks td:last-child,
  #notification-deliveries td:first-child {
    grid-column: 1 / -1;
  }
}
