:root {
  color-scheme: light;
  font-family: Inter, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: #273248;
  background: #f5f6f8;
  font-synthesis: none;
  --accent: #af5638;
  --accent-soft: #fbf0eb;
  --muted: #68758a;
  --line: #e7e9ee;
  --green: #16816b;
  --amber: #a97519;
  --red: #c04747;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 10px 17px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.quiet {
  background: #fff;
  border-color: #dde1e7;
  color: #536078;
}
button.quiet:hover {
  background: #f6f7f9;
  border-color: #bac2ce;
}
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid #d88b68;
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #dfe3e9;
  border-radius: 9px;
  background: #fff;
  color: #273248;
  font-size: 14px;
}
input::placeholder,
textarea::placeholder {
  color: #959dad;
}
input[readonly],
textarea[readonly] {
  background: #f7f8fa;
}
textarea {
  resize: vertical;
}
label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #596579;
}
form {
  display: grid;
  gap: 14px;
}
form > button {
  justify-self: start;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: 15px;
  font-weight: 650;
}
h2 {
  font-size: 27px;
  letter-spacing: -0.7px;
  color: #1e293b;
}
h3 {
  font-size: 17px;
  font-weight: 650;
}
h4 {
  font-size: 14px;
}
p {
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.7;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.eyebrow {
  color: #969eac;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin: 0 0 7px;
}
.error {
  color: var(--red);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.shell {
  max-width: 1920px;
  margin: auto;
  padding: 108px 40px 20px 254px;
}
.app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  height: 76px;
  padding: 0 36px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 25px;
  font-weight: 700;
}
.brand-mark svg {
  width: 15px;
  height: 30px;
  fill: currentColor;
}
.brand .eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  margin-bottom: 3px;
  color: var(--accent);
}
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.header-actions .quiet {
  font-size: 12px;
  padding: 7px 12px;
}
.console-label {
  color: #9aa2af;
  font-size: 12px;
  margin-right: 18px;
}
.main-nav {
  position: fixed;
  top: 76px;
  bottom: 0;
  left: max(0px, calc((100vw - 1920px) / 2));
  width: 216px;
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--line);
  background: #fff;
  z-index: 4;
}
.nav-label {
  color: #a0a8b4;
  font-size: 11px;
  padding: 0 14px;
  margin: 3px 0 15px;
}
.main-nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 9px;
  color: #7a8495;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.main-nav a:hover {
  background: #f7f8fa;
}
.main-nav [aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}
.nav-icon {
  font-size: 21px;
  line-height: 1;
  width: 22px;
  text-align: center;
}
.nav-arrow {
  margin-left: auto;
  font-size: 18px;
  opacity: 0.6;
}
.nav-footnote {
  margin-top: auto;
  padding: 20px 12px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #839083;
}
.nav-footnote p {
  font-size: 10px;
  color: #a0a8b4;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 7px;
  vertical-align: 1px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 18px;
}
.section-heading h2,
.section-heading h3 {
  margin: 0;
}
.page-heading,
#monitor-panel > .section-heading,
#updates-panel > .section-heading:first-child,
#moderation-panel > .section-heading:first-child {
  margin-top: 0;
}
.page-heading p:last-child {
  margin-bottom: 0;
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  min-width: 0;
}
.card > h2,
.card > h3 {
  margin-bottom: 14px;
}
.card > .section-heading:first-child {
  margin-top: 0;
}
.login {
  max-width: 470px;
  margin: 5vh auto 12vh;
  padding: 38px;
  box-shadow: 0 12px 44px #24314606;
}
.login h2 {
  font-size: 25px;
  margin-top: 12px;
}
.login form {
  margin-top: 26px;
}
.login form > button {
  justify-self: stretch;
}
body:not(.authenticated) .shell {
  padding-left: 28px;
  padding-right: 28px;
}
body:not(.authenticated) footer {
  padding-top: 0;
}
.password-change {
  margin-bottom: 26px;
}
#desktop-access-panel,
.password-change {
  scroll-margin-top: 96px;
}
#notice:empty {
  display: none;
}
#notice {
  padding: 12px 16px;
  background: #eaf5f0;
  color: #28705d;
  border: 1px solid #d7e8df;
  border-radius: 10px;
  margin: 0 0 22px;
  overflow-wrap: anywhere;
}
#notice.error {
  color: var(--red);
  background: #fff0ee;
  border-color: #f2d7d4;
}
.pending main button,
.pending form button {
  pointer-events: none;
  opacity: 0.5;
}
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 27px 0 33px;
}
.stat-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
}
.stat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #8290a1;
}
.stat-symbol {
  color: #9aa7b8;
  font-size: 18px;
}
.stat-value {
  font-size: 31px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 10px 0 4px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: #25334a;
}
.stat-card.good .stat-value {
  color: var(--green);
}
.stat-card.warning .stat-value {
  color: var(--amber);
}
.stat-description {
  color: #798599;
  font-size: 11px;
  margin: 0;
}
.monitor-toolbar {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}
.monitor-toolbar h3 {
  font-size: 18px;
}
.monitor-toolbar p {
  margin: 5px 0 0;
}
.monitor-filters {
  display: flex;
  gap: 10px;
}
.search-field {
  width: 250px;
}
.monitor-filters input,
.monitor-filters select {
  font-size: 12px;
  min-height: 41px;
}
.monitor-filters select {
  min-width: 132px;
}
.monitor-caption {
  font-size: 12px;
  color: #798599;
  margin: 15px 0 20px;
}
.monitor-caption .status-dot {
  background: #a7b7b1;
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
.device-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 3px 7px #23334c02;
  min-width: 0;
}
.device-grid > .device-card:only-child {
  grid-column: 1 / -1;
}
.device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f0f1f4;
}
.device-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.device-symbol {
  color: #7a899c;
  background: #f1f4f8;
  border: 1px solid #e9edf3;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.device-title h3 {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.device-title .muted {
  font-size: 10px;
  margin: 3px 0 0;
}
.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 5px 8px;
  background: #f0f2f5;
  color: #788394;
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}
.status-pill.good,
.badge.good,
.stable {
  background: #ecf7f1;
  color: var(--green);
}
.status-pill.warning,
.badge.warning {
  background: #fdf5e7;
  color: var(--amber);
}
.status-pill.danger,
.badge.error {
  background: #fdf0ee;
  color: var(--red);
}
.status-pill::before {
  content: '';
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}
.device-body {
  flex: 1;
  padding: 22px 24px;
}
.account-identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.identity-label {
  font-size: 11px;
  color: #798599;
  margin: 0 0 5px;
}
.account-email {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: #2c3a50;
}
.account-number {
  font-size: 11px;
  color: #798599;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.plan-badge {
  color: #927248;
  background: #f7f1e9;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}
.identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #738096;
  font-size: 12px;
  margin: 12px 0 0;
}
.quota-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 23px 0 13px;
}
.quota-heading h4 {
  font-size: 12px;
  color: #657187;
  font-weight: 550;
}
.quota-timestamp {
  color: #798599;
  font-size: 11px;
  margin: -6px 0 14px;
}
.quota-list {
  display: grid;
  gap: 17px;
}
.quota-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #68758a;
}
.quota-label strong {
  font-size: 12px;
  font-weight: 600;
  color: #304059;
}
.quota-label strong.danger {
  color: var(--red);
}
.quota-track {
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: #edf1f5;
  margin: 8px 0 6px;
}
.quota-fill {
  height: 100%;
  background: #649789;
  border-radius: inherit;
}
.quota-fill.warning {
  background: #d9a558;
}
.quota-fill.danger {
  background: #d47b70;
}
.quota-row .muted {
  font-size: 11px;
  margin: 0;
}
.quota-alert {
  font-size: 11px;
  color: var(--amber);
  background: #fcf8ef;
  border-radius: 7px;
  padding: 9px 11px;
  margin: 15px 0 0;
  overflow-wrap: anywhere;
}
.quota-alert.error {
  color: var(--red);
  background: #fdf3f1;
}
.no-data {
  padding: 22px 15px;
  border: 1px dashed #e3e7ed;
  border-radius: 10px;
  background: #fbfcfd;
  text-align: center;
  color: #98a2b1;
  font-size: 12px;
  line-height: 1.8;
}
.device-empty {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.device-empty h4 {
  color: #7a879a;
  font-size: 14px;
}
.device-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: #fcfcfd;
  border-top: 1px solid #f0f1f4;
}
.device-footer .muted {
  font-size: 10px;
  margin: 0;
}
.device-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.device-actions button {
  font-size: 12px;
  padding: 6px 10px;
}
.device-actions .text-button {
  padding: 5px 0;
  color: var(--accent);
  border: 0;
  background: transparent;
}
.device-details {
  padding-top: 14px;
  margin-top: 18px;
  border-top: 1px solid #f0f1f4;
}
.device-details summary {
  font-size: 11px;
}
.account-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.account-record {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.account-record h3 {
  font-size: 15px;
}
.account-record h4 {
  margin-bottom: 8px;
}
.account-record .monitor-sample {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}
.account-record .monitor-sample p {
  font-size: 12px;
}
.note-editor {
  margin-top: 14px;
}
.note-editor textarea {
  min-height: 72px;
  font-size: 12px;
}
.note-editor button {
  font-size: 11px;
  padding: 7px 12px;
}
.note-preview {
  font-size: 12px;
  white-space: pre-wrap;
  color: #7e8999;
}
.history-panel {
  margin-top: 22px;
  padding: 20px 24px;
}
.history-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #56647a;
  font-size: 13px;
  font-weight: 600;
}
.history-panel > summary::after {
  content: '+';
  margin-left: 12px;
}
.history-panel[open] > summary::after {
  content: '−';
}
.enrollment-card {
  margin-top: 22px;
}
.enrollment-card > .section-heading {
  margin: 0;
}
.enrollment-card > .section-heading h3 {
  font-size: 14px;
}
.enrollment-card > .section-heading p {
  margin: 4px 0 0;
  font-size: 12px;
}
#enrollment-options {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}
#enrollment-result {
  display: grid;
  gap: 10px;
}
.access-tabs {
  display: flex;
  gap: 24px;
  margin: 22px 0;
  border-bottom: 1px solid var(--line);
}
.access-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #8993a1;
  padding: 12px 4px;
}
.access-tabs button[aria-selected='true'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.access-editor {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfcfd;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 8px 0;
  padding: 14px;
}
legend {
  font-size: 12px;
  color: #778194;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check input {
  width: auto;
  accent-color: var(--accent);
}
.channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.download-link {
  display: inline-block;
  padding: 11px 17px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.download-card h3,
.channel h3 {
  margin: 18px 0 10px;
}
.download-card details {
  margin-top: 18px;
}
#updates-panel > .card {
  margin-top: 24px;
}
#server-download {
  overflow-wrap: anywhere;
}
.notes {
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.digest {
  font:
    11px/1.9 Consolas,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #8c96a6;
}
#node-update-panel .heading-actions {
  flex-wrap: wrap;
}
#node-update-confirm-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
#node-update-panel .notes {
  max-height: 28rem;
  overflow: auto;
}
details {
  margin-top: 16px;
}
summary {
  color: #7b889c;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.6;
}
.upload-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.candidate-list {
  display: grid;
  gap: 18px;
}
.controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
}
.controls label {
  flex: 1;
  min-width: 180px;
}
.empty {
  text-align: center;
  color: #8793a4;
  padding: 35px 20px;
  border: 1px dashed #d8dee7;
  border-radius: 12px;
  grid-column: 1 / -1;
  background: #fff;
}
.audit-panel {
  margin-top: 28px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  background: #fafbfc;
  color: #8a94a3;
  font-weight: 500;
}
th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
footer {
  font-size: 11px;
  color: #a6aeba;
  text-align: center;
  padding: 32px 0 12px;
}
#moderation-panel > .card {
  margin: 24px 0;
}
#moderation-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 20px;
}
#moderation-config .card {
  display: grid;
  gap: 12px;
}
#moderation-config > button {
  grid-column: 1 / -1;
}
.thresholds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.preview-result,
#moderation-events td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.preview-result {
  max-width: 100%;
  font:
    12px/1.8 Consolas,
    monospace;
}
#moderation-panel table {
  min-width: 680px;
}
@media (min-width: 1680px) {
  .device-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1150px) {
  .shell {
    padding: 104px 26px 20px 220px;
  }
  .main-nav {
    width: 194px;
    padding-inline: 12px;
  }
  .device-grid {
    grid-template-columns: 1fr;
  }
  .console-label {
    display: none;
  }
  .stat-card {
    padding: 17px;
  }
  .overview-stats {
    gap: 12px;
  }
}
@media (max-width: 760px) {
  .app-header {
    height: 68px;
    padding: 0 18px;
  }
  .brand-mark {
    width: 30px;
    height: 34px;
    font-size: 22px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions .quiet {
    padding: 6px 8px;
    font-size: 10px;
  }
  .brand h1 {
    font-size: 13px;
  }
  .main-nav {
    position: static;
    flex-direction: row;
    width: auto;
    padding: 0;
    gap: 6px;
    border: 0;
    margin-bottom: 28px;
    background: transparent;
  }
  .main-nav a {
    flex: 1;
    justify-content: center;
    padding: 12px 7px;
    gap: 6px;
    font-size: 12px;
  }
  .nav-label,
  .nav-footnote,
  .nav-arrow {
    display: none;
  }
  .nav-icon {
    font-size: 18px;
    width: 18px;
  }
  .shell,
  body:not(.authenticated) .shell {
    padding: 88px 18px 16px;
  }
  h2 {
    font-size: 23px;
  }
  .section-heading {
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
  }
  .page-heading {
    gap: 18px;
  }
  .heading-actions {
    gap: 10px;
  }
  .heading-actions .muted {
    font-size: 10px;
  }
  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-value {
    font-size: 28px;
  }
  .monitor-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .monitor-filters {
    gap: 8px;
  }
  .search-field {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .monitor-filters select {
    min-width: 112px;
  }
  .monitor-caption {
    line-height: 1.8;
  }
  .device-header,
  .device-body {
    padding: 18px;
  }
  .device-footer {
    padding: 13px 18px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .device-actions {
    width: 100%;
    justify-content: space-between;
  }
  .account-email {
    font-size: 14px;
  }
  .channels,
  .upload-panel,
  .access-grid,
  #moderation-config {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .login {
    padding: 28px;
    margin: 4vh auto 9vh;
  }
  .history-panel > summary .muted {
    display: none;
  }
  .access-tabs {
    gap: 14px;
  }
  .access-tabs button {
    font-size: 12px;
  }
  .controls button {
    flex: 1;
  }
  .controls label {
    min-width: 0;
    flex-basis: 100%;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  .main-nav a {
    transition:
      background 0.15s,
      border-color 0.15s;
  }
}
