:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --border: #dbe4ef;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.12);
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #ca8a04;
  --input-bg: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  flex: 0 0 auto;
}

.tabs {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.tab {
  background: #e2e8f0;
  border: 1px solid var(--border);
  color: #334155;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
}

.license-badge.ok {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.license-badge.err {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.license-expiry {
  color: inherit;
  opacity: 0.95;
  font-size: 11px;
  font-weight: 600;
}

.license-info-card {
  padding: 8px 10px;
  margin-bottom: 6px;
}

.license-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
}

.license-info-row strong {
  flex: 0 0 auto;
  font-size: 13px;
}

.license-info-status {
  flex: 1 1 auto;
  min-width: 0;
}

.license-info-status.ok {
  color: #15803d;
  font-weight: 600;
}

.license-info-status.err {
  color: #b91c1c;
}

.license-info-expiry {
  flex: 1 1 100%;
  font-size: 12px;
  color: #15803d;
  font-weight: 600;
}

.license-info-expiry:empty {
  display: none;
}

.license-action {
  font-size: 11px;
  padding: 0;
  color: var(--primary);
}

.license-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.license-overlay.hidden {
  display: none !important;
}

body.license-locked .topbar,
body.license-locked .page {
  opacity: 0.35;
}

body:not(.license-locked) .topbar,
body:not(.license-locked) .page {
  pointer-events: auto;
  user-select: auto;
  opacity: 1;
}

.license-panel {
  width: min(380px, 100%);
  padding: 20px 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.license-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.license-desc,
.license-device {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.license-panel input {
  width: 100%;
  margin-bottom: 10px;
}

.license-panel .primary {
  width: 100%;
}

.license-device {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 11px;
  word-break: break-all;
}

.notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
}

.notice-overlay.hidden {
  display: none;
}

.notice-panel {
  width: min(520px, calc(100vw - 32px));
  padding: 24px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.notice-panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.notice-content {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

.notice-actions {
  display: flex;
  justify-content: flex-end;
}

.license-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  text-align: left;
}

.license-notice.hidden {
  display: none;
}

.license-notice-label {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.license-notice-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  max-height: 180px;
  overflow: auto;
}

.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge.ok {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ok);
  border-color: rgba(22, 163, 74, 0.25);
}

.page {
  display: none;
  padding: 6px 8px 10px;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.page.active { display: block; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.card-compact {
  padding: 8px 10px;
  margin-bottom: 6px;
}

.card-compact h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.card-head-tight {
  margin-bottom: 8px;
}

.option-item.compact-check,
.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  cursor: pointer;
}

.compact-check input {
  width: auto;
  margin: 0;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 10px;
}

.login-grid .form-row {
  margin-bottom: 4px;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.login-actions .status {
  flex: 0 1 auto;
  margin-top: 0;
  min-height: 0;
  min-width: 0;
  padding: 4px 8px;
}

.account-list-tools {
  margin-bottom: 6px;
  padding: 6px;
  gap: 4px;
}

.account-log-tools {
  gap: 8px;
  width: auto;
}

.inline-tip {
  padding: 8px 0;
  font-size: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-head h2 { margin: 0; }

/* 登录/设置：左标签 + 右控件 */
.form-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}

.login-grid .form-row {
  margin-bottom: 6px;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.login-actions .primary {
  flex: 0 0 auto;
  min-width: 120px;
}

.login-actions .status {
  flex: 0 1 auto;
  margin-top: 0;
  min-width: 0;
}

.form-row > label:first-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field-with-tip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-grid {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.field-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field-item label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.field-item input,
.field-item select {
  margin-top: 0;
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.option-list.vertical {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.option-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #334155;
  font-size: 14px;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
}

.option-item.block {
  display: flex;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.option-item input {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.option-item span {
  flex: 1 1 auto;
  line-height: 1.4;
}

.toolbar-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.toolbar-stack > * {
  width: 100%;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-actions > * {
  flex: 1 1 140px;
  min-width: 0;
}

.preset-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.preset-toolbar .form-row {
  flex: 1 1 220px;
  margin-bottom: 0;
}

.preset-toolbar input,
.preset-toolbar button {
  flex: 1 1 140px;
  min-width: 0;
}

.status {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.4;
}

.status.error {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 500;
}

.status.success {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
}

.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;
}

label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
}

button.primary { background: var(--primary); }
button.secondary {
  background: #e2e8f0;
  color: var(--text);
  border: 1px solid var(--border);
}
button.secondary.error { color: var(--danger); }
button.danger { background: var(--danger); }
button.link {
  background: transparent;
  color: var(--primary);
  padding: 0;
}
button.large {
  padding: 12px 24px;
  font-size: 15px;
}

button.btn-compact {
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.tip,
.inline-tip {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.danger-link { color: var(--danger) !important; }

#accountList.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  overflow: hidden;
}

.account-item.active {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.35);
}

.account-item-desktop {
  display: grid;
  grid-template-columns: 36px minmax(120px, 1fr) minmax(80px, 120px) minmax(100px, 140px) minmax(72px, 96px) minmax(180px, 1.2fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.account-item-mobile {
  display: none;
  padding: 12px;
}

.account-name-text,
.account-log-toggle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.account-log-toggle:hover,
.account-item.active .account-name-text {
  color: var(--primary);
}

.account-group,
.account-userid {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

.account-remark-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-remark-input {
  flex: 1 1 auto;
  min-width: 0;
}

.account-status {
  font-weight: 700;
  white-space: nowrap;
}

.status-idle { color: var(--warn); }
.status-running { color: var(--ok); }
.status-error { color: var(--danger); }

.account-list-head {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.account-list-head h2 {
  margin: 0;
  font-size: 15px;
}

.account-list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.account-list-tools .group-toolbar-main {
  display: flex;
  gap: 6px;
  flex: 1 1 160px;
  min-width: 0;
}

.account-list-tools .group-select {
  flex: 1 1 auto;
  min-width: 0;
}

.account-list-tools #batchMoveGroupSelect {
  flex: 0 1 120px;
  min-width: 88px;
  max-width: 160px;
}

.group-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}

.group-toolbar-main {
  display: flex;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
  align-items: center;
}

.group-toolbar-main .group-select {
  flex: 1 1 auto;
  min-width: 0;
}

.group-manage-panel {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.group-manage-panel summary {
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
  user-select: none;
  list-style: none;
  white-space: nowrap;
}

.group-manage-panel summary::-webkit-details-marker {
  display: none;
}

.group-manage-panel summary::after {
  content: ' ▾';
  font-size: 11px;
}

.group-manage-panel[open] summary::after {
  content: ' ▴';
}

.group-manage-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 8px;
  align-items: center;
}

.bulk-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
  cursor: pointer;
}

.bulk-check input {
  width: auto;
  margin: 0;
}

.group-manage-body input {
  flex: 1 1 100px;
  min-width: 0;
}

.account-log-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.account-log-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.account-log-window {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.account-log-title {
  padding: 8px 10px;
  background: var(--primary-soft);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}

.account-log-window pre {
  flex: 1 1 auto;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  color: var(--text);
  padding: 10px 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  min-height: calc(1.5em * 8 + 24px);
  max-height: min(360px, 42vh);
}

.group-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bl-group-tree {
  gap: 10px;
}

.bl-group-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.bl-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}

.bl-group-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.bl-group-name em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.bl-group-select-all {
  flex: 0 0 auto;
  font-size: 12px;
  padding: 0;
}

.bl-group-accounts {
  display: flex;
  flex-direction: column;
}

.bl-account-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.bl-account-item:last-child {
  border-bottom: none;
}

.bl-account-item input {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.bl-account-item span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-block { margin-bottom: 14px; }

.hidden { display: none !important; }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
}

#joinLeaveGroupsLogBox {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: calc(1.5em * 18 + 24px);
  max-height: calc(1.5em * 18 + 24px);
  overflow: auto;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text);
  margin: 0;
}

.join-leave-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.join-leave-toolbar .inline-tip {
  flex: 1 1 220px;
  min-width: 0;
}

#join-leave-page textarea {
  min-height: 120px;
}

#join-leave-page .runtime-account-select {
  width: 100%;
  max-width: 360px;
}

.join-leave-remaining-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#bl-field-remaining-groups {
  min-height: 100px;
  background: #f8fafc;
}

#blLogBox {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: calc(1.5em * 12 + 24px);
  max-height: min(420px, 45vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 16px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text);
  scroll-behavior: auto;
}

.status-pending { color: var(--muted); }

.haiou-toast-root {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}

.haiou-toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  word-break: break-word;
}

.haiou-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.haiou-toast-success { background: #15803d; }
.haiou-toast-error { background: #b91c1c; }
.haiou-toast-warn { background: #b45309; }
.haiou-toast-info { background: #1d4ed8; }

@media (max-width: 768px) {
  .haiou-toast-root {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .account-item-desktop {
    display: none;
  }

  .account-item-mobile {
    display: block;
  }

  .account-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .account-item-head .account-name-text {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 15px;
  }

  .account-meta-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
  }

  .account-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .account-actions-row button {
    width: 100%;
  }

  .account-remark-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .account-item-desktop {
    display: none;
  }

  .account-item-mobile {
    display: block;
  }

  .account-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .account-item-head .account-name-text {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 15px;
  }

  .account-meta-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
  }

  .account-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .account-actions-row button {
    width: 100%;
  }

  .account-remark-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 1101px) {
  .page {
    padding: 10px 16px 16px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 8px 10px;
    gap: 8px;
  }

  .brand {
    font-size: 16px;
    flex: 1 1 auto;
    width: auto;
  }

  .tabs {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .tab {
    flex: 0 1 auto;
    padding: 8px 10px;
    font-size: 13px;
  }

  .topbar-meta {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-meta .license-badge {
    width: 100%;
    justify-content: center;
  }

  .topbar-meta .badge {
    align-self: flex-start;
  }

  .page {
    padding: 6px 8px 12px;
  }

  .page-title,
  .page-title.compact {
    padding: 8px 10px;
    margin-bottom: 6px;
  }

  .page-title h1,
  .page-title h2 {
    font-size: 16px;
  }

  .card,
  .card-compact {
    padding: 10px;
    margin-bottom: 8px;
  }

  .login-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 6px;
    margin-bottom: 6px;
  }

  .login-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .login-actions .primary {
    width: 100%;
  }

  .account-list-tools {
    gap: 6px;
    padding: 6px;
  }

  .account-list-tools .group-toolbar-main {
    flex: 1 1 100%;
  }

  .account-list-tools #batchMoveGroupSelect {
    flex: 1 1 80px;
    max-width: none;
  }

  .group-manage-panel {
    width: 100%;
  }

  .group-manage-panel[open] .group-manage-body {
    width: 100%;
  }

  .field-grid.cols-3,
  .field-grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .preset-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .preset-toolbar .form-row,
  .preset-toolbar input,
  .preset-toolbar button {
    width: 100%;
    flex: 1 1 auto;
  }

  .toolbar-actions > * {
    flex: 1 1 100%;
  }

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

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

  .card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .account-log-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .bl-account-table thead {
    display: none;
  }

  .bl-account-table,
  .bl-account-table tbody,
  .bl-account-table tr,
  .bl-account-table td {
    display: block;
    width: 100%;
  }

  .bl-account-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
  }

  .bl-account-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #eef2f7;
    padding: 8px 0;
  }

  .bl-account-table td:last-child {
    border-bottom: none;
  }

  .bl-account-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .account-actions-row {
    grid-template-columns: 1fr;
  }

  button.large {
    width: 100%;
  }
}
