:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-muted: #eef0ec;
  --ink: #18201d;
  --muted: #69736e;
  --line: #d9deda;
  --line-strong: #bcc5bf;
  --sidebar: #1c2421;
  --sidebar-muted: #9da9a3;
  --accent: #16724a;
  --accent-hover: #105c3b;
  --accent-soft: #e5f2eb;
  --warning: #9a6200;
  --warning-soft: #fff3d8;
  --danger: #b23b32;
  --danger-soft: #fae9e7;
  --info: #286da8;
  --info-soft: #e6f1f9;
  --shadow: 0 8px 28px rgba(24, 32, 29, 0.08);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.hidden {
  display: none !important;
}

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(460px, 1.1fr);
}

.login-brand {
  background: var(--sidebar);
  color: #fff;
  padding: clamp(32px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
}

.brand-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #53605a;
  border-radius: 6px;
  color: #78d6a5;
}

.brand-symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 5px;
}

.logo-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.logo-preview {
  width: 56px;
  height: 56px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.logo-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.logo-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.login-brand h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 480px;
  color: #b8c3bd;
  font-size: 15px;
}

.login-panel {
  position: relative;
  padding: 32px 32px 72px;
  display: grid;
  place-items: center;
}

.login-form {
  width: min(420px, 100%);
}

.login-form h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.login-form > p {
  color: var(--muted);
  margin: 0 0 28px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand-mark {
  padding: 0 10px 24px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: #2b3531;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 10px 2px;
  border-top: 1px solid #35413c;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-account {
  min-width: 0;
}

.sidebar-account strong,
.sidebar-account span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account span {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.sidebar-actions {
  display: flex;
  margin-left: auto;
  gap: 2px;
}

.sidebar-logout {
  color: var(--sidebar-muted);
}

.sidebar-logout.button.ghost:hover {
  background: #2b3531;
  color: #fff;
}

.main {
  min-width: 0;
  min-height: 100vh;
  padding: 30px clamp(20px, 3vw, 44px) 48px;
  display: flex;
  flex-direction: column;
}

.record-footer {
  display: flex;
  justify-content: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 36px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.record-footer a {
  color: inherit;
  text-decoration: none;
}

.record-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.app-record-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 24px;
  margin-top: 0;
  padding-top: 10px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 30;
}

/* 桌面端固定页脚只覆盖主内容区，避免遮挡深色侧边栏底部的账户信息。 */
@media (min-width: 761px) {
  #appView:not(.hidden) ~ .app-record-footer {
    left: 232px;
  }
}

/* 客户端全局备案页脚为固定定位，主内容预留底部空间。 */
.app-shell:has(~ .app-record-footer),
.login-shell:has(~ .app-record-footer) {
  padding-bottom: 46px;
}

.login-record {
  position: absolute;
  right: 24px;
  bottom: 18px;
  left: 24px;
  padding: 0;
}

.topbar,
.section-head,
.topbar-actions,
.toolbar,
.row-actions,
.status-line,
.modal-head,
.modal-actions,
.inline-field,
.user-cell,
.pagination,
.process-actions {
  display: flex;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  margin-bottom: 28px;
}

.topbar-actions {
  gap: 8px;
}

.topbar h1,
.section-head h2,
.modal-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 26px;
}

.topbar p,
.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.button:hover {
  background: var(--accent-hover);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--surface-muted);
}

.button.danger {
  border-color: #edc8c4;
  background: var(--surface);
  color: var(--danger);
}

.button.danger:hover {
  background: var(--danger-soft);
}

.button.ghost {
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.button.ghost:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.button.icon-only {
  width: 36px;
  padding: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 12px;
  font-size: 30px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 20px;
}

.panel {
  min-width: 0;
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
}

.section-head {
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 17px;
}

.process-panel {
  min-height: 270px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.process-panel .section-head {
  margin-bottom: 20px;
}

.status-line {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.status-line:last-of-type {
  border-bottom: 0;
}

.status-line span:first-child {
  color: var(--muted);
}

.process-actions {
  gap: 8px;
  margin-top: 20px;
}

.audit-list {
  display: grid;
  gap: 0;
}

.audit-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.audit-item:last-child {
  border-bottom: 0;
}

.audit-item strong {
  font-size: 13px;
}

.audit-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.announce-panel {
  margin-bottom: 16px;
}

.announce-list {
  display: grid;
  gap: 0;
}

.announce-empty {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.announce-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.announce-item:last-child {
  border-bottom: 0;
}

.announce-item header {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.announce-item header strong {
  font-size: 13px;
}

.announce-item time {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.announce-item p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  position: relative;
  width: min(340px, 100%);
}

.search .icon {
  position: absolute;
  top: 10px;
  left: 11px;
  color: var(--muted);
}

.search input {
  padding-left: 36px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.mapping-table {
  min-width: 1090px;
}

.client-mapping-table {
  min-width: 980px;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f7f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbf9;
}

.user-cell {
  gap: 10px;
}

.user-cell.compact .avatar {
  width: 28px;
  height: 28px;
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.user-cell strong,
.user-cell small {
  display: block;
}

.user-cell small {
  color: var(--muted);
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge.success {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info {
  background: var(--info-soft);
  color: var(--info);
}

.port-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.port-chip {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8f9f7;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.traffic-cell {
  min-width: 154px;
}

.traffic-rates {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.traffic-rate {
  display: grid;
  grid-template-columns: 30px minmax(72px, auto);
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.traffic-rate span {
  color: var(--muted);
}

.traffic-rate strong {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.traffic-rate.incoming strong {
  color: var(--accent);
}

.traffic-rate.outgoing strong {
  color: var(--info);
}

.traffic-unavailable {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.stat-live .stat-value {
  color: var(--success);
}

.stat-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  vertical-align: middle;
}

.traffic-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.traffic-user-section {
  margin-top: 16px;
}
.traffic-user-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.traffic-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.traffic-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.traffic-user-item .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.traffic-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.traffic-user-rates {
  font-size: 12px;
  color: var(--muted);
}
.traffic-user-totals {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.usage-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  min-width: 100px;
}
.usage-cell span {
  color: var(--muted);
}
.usage-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s ease;
}
.usage-fill.warning {
  background: var(--warning);
}
.usage-fill.danger {
  background: var(--danger);
}

.row-actions {
  justify-content: flex-end;
  gap: 3px;
}

.mapping-summary {
  min-width: 58px;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mapping-summary strong {
  color: var(--accent);
}

.mapping-summary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.protocol-label {
  color: var(--info);
  font-size: 12px;
  font-weight: 750;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.segmented button {
  min-width: 54px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
}

.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(24, 32, 29, 0.12);
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.settings-pane > .panel {
  margin-bottom: 20px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 650;
}

.field small {
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
}

textarea {
  min-height: 0;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 114, 74, 0.12);
}

.check-label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  cursor: pointer;
}

.check-label input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.check-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--accent);
}

.error-text {
  min-height: 21px;
  margin: 4px 0 8px;
  color: var(--danger);
  font-size: 13px;
}

.notice {
  padding: 11px 13px;
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  color: #174f7b;
}

dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 20, 18, 0.48);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-head h2 {
  font-size: 18px;
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toast.error {
  border-left-color: var(--danger);
}

.empty {
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.account-strip {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.account-item {
  min-width: 0;
  padding: 15px 17px;
  background: var(--surface);
}

.account-item span,
.account-item strong {
  display: block;
}

.account-item span {
  color: var(--muted);
  font-size: 12px;
}

.account-item strong {
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

.connection-banner {
  margin-bottom: 22px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.connection-banner.offline {
  border-left-color: var(--warning);
}

.connection-banner strong,
.connection-banner span {
  display: block;
}

.connection-banner span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  text-align: center;
}

.gauge-card h3 {
  margin: 10px 0 2px;
  font-size: 15px;
}

.gauge-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.gauge {
  position: relative;
  width: 120px;
  height: 120px;
}

.gauge-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: var(--surface-muted);
  stroke-width: 11;
}

.gauge-arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 11;
  stroke-linecap: round;
  transition:
    stroke-dashoffset 0.6s ease,
    stroke 0.3s ease;
}

.gauge-arc.level-accent {
  stroke: var(--info);
}

.gauge-arc.level-ok {
  stroke: var(--accent);
}

.gauge-arc.level-warn {
  stroke: var(--warning);
}

.gauge-arc.level-danger {
  stroke: var(--danger);
}

.gauge-arc.level-muted {
  stroke: var(--line-strong);
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.gauge-center strong {
  font-size: 20px;
  line-height: 1.2;
}

.gauge-center span {
  color: var(--muted);
  font-size: 11px;
}

.port-input-row {
  display: flex;
  gap: 8px;
}

.port-input-row input {
  flex: 1;
  min-width: 0;
}

.port-input-row select {
  flex: 0 0 auto;
  max-width: 45%;
}

.port-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.port-suggest-label,
.port-suggest-empty {
  color: var(--muted);
  font-size: 12px;
}

.port-chip {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 12px/1.4 "Cascadia Code", Consolas, monospace;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.port-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.mono {
  font-family: "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.log-view {
  max-height: 300px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 5px;
  background: #171d1b;
  color: #c7d2cc;
  font: 12px/1.6 "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 220px;
    padding: 28px 22px;
  }

  .login-brand h1 {
    font-size: 30px;
  }

  .login-brand p {
    margin-bottom: 0;
  }

  .login-panel {
    padding: 34px 20px 72px;
    place-items: start center;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 13px 14px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .sidebar .brand-mark {
    padding: 0;
  }

  .sidebar .brand-mark span:last-child {
    display: none;
  }

  .nav {
    display: flex;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-button {
    width: auto;
    min-width: max-content;
  }

  .sidebar-footer {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
  }

  .sidebar-account {
    display: none;
  }

  .main {
    padding: 22px 15px 40px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .account-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .toolbar,
  .topbar,
  .connection-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-group {
    justify-content: space-between;
  }

  .toolbar .button,
  .topbar-actions,
  .topbar-actions .button,
  .connection-banner .button {
    width: 100%;
  }

  .topbar-actions .button {
    flex: 1 1 0;
  }
}
