:root {
  color-scheme: dark;
  --bg: #111416;
  --panel: #191d21;
  --panel-2: #20262b;
  --text: #edf2f4;
  --muted: #9ca8ae;
  --line: #30383f;
  --accent: #4fb7a8;
  --accent-2: #f2c14e;
  --danger: #e45d5d;
  --field-bg: #0d1012;
  --sidebar-bg: #15191c;
  --code-bg: #0d1012;
  --row-bg: #12171a;
  --readonly-line: #263038;
  --button-text: #061311;
  --toast-bg: var(--panel);
  --toast-text: var(--text);
  --toast-line: var(--line);
  --toast-shadow: rgba(0, 0, 0, 0.28);
}

body.theme-light {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #f3f6fa;
  --text: #1e293b;
  --muted: #64748b;
  --line: #d9e2ef;
  --accent: #11998e;
  --accent-2: #d19b1d;
  --danger: #dc4f4f;
  --field-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --code-bg: #f8fafc;
  --row-bg: #ffffff;
  --readonly-line: #cbd5e1;
  --button-text: #ffffff;
  --toast-bg: #ffffff;
  --toast-text: #1e293b;
  --toast-line: #d9e2ef;
  --toast-shadow: rgba(15, 23, 42, 0.12);
}

body.theme-dayblue {
  color-scheme: light;
  --bg: #eef4fb;
  --panel: #ffffff;
  --panel-2: #f6f9fd;
  --text: #0f172a;
  --muted: #51617a;
  --line: #d6e0ef;
  --accent: #1483d8;
  --accent-2: #d49b2a;
  --danger: #dc4f4f;
  --field-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --code-bg: #f8fafc;
  --row-bg: #ffffff;
  --readonly-line: #cbd5e1;
  --button-text: #ffffff;
  --toast-bg: #ffffff;
  --toast-text: #0f172a;
  --toast-line: #d6e0ef;
  --toast-shadow: rgba(15, 23, 42, 0.12);
}

body.theme-dark {
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px 1fr;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

[hidden] { display: none !important; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 14, 0.94);
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 14px;
}

.login-panel h1 {
  font-size: 24px;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.login-tabs button {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.login-tabs button.active {
  background: var(--accent);
  color: var(--button-text);
  border-color: transparent;
}

#loginForm,
#registerForm {
  display: grid;
  gap: 14px;
}

.login-error {
  min-height: 20px;
  color: var(--danger);
}

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

button {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--button-text);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

button:hover { filter: brightness(1.05); }

button:disabled {
  cursor: not-allowed;
  opacity: .55;
  filter: none;
}

input, select, textarea {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  min-height: 36px;
  padding: 8px 10px;
  outline: none;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

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

input[readonly] {
  color: var(--muted);
  border-color: var(--readonly-line);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  background: var(--sidebar-bg);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #071210;
  font-weight: 900;
}

.brand strong { display: block; }
.brand span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

nav {
  display: grid;
  gap: 8px;
}

.nav {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-weight: 600;
}

.nav.active {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}

main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1, h2, p { margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
p { color: var(--muted); margin-top: 6px; }

.panel-count {
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.auth {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
}

.auth-label,
.target-user span,
#currentUserLabel {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.target-user {
  display: grid;
  grid-template-columns: auto minmax(180px, 240px);
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.notice-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  min-width: 82px;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
  white-space: nowrap;
}

.theme-toggle:hover,
.theme-toggle:focus {
  background: var(--panel-2);
  border-color: var(--accent);
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(79, 183, 168, 0.16);
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

.icon-button {
  min-width: 38px;
  width: 38px;
  padding: 0;
  position: relative;
  display: inline-grid;
  place-items: center;
}

.icon-button.has-unread {
  border-color: rgba(79, 183, 168, 0.75);
  box-shadow: 0 0 0 2px rgba(79, 183, 168, 0.16);
}

.bell-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#noticeUnreadBadge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}

.notice-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  overflow: hidden;
}

.notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.notice-head button {
  min-height: 28px;
  padding: 0 10px;
}

.notice-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notice-list {
  max-height: 320px;
  overflow: auto;
}

.notice-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.notice-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notice-item-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notice-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.notice-delete-one {
  min-height: 26px;
  padding: 0 8px;
  color: var(--danger);
  border-color: var(--danger);
  background: transparent;
  flex: 0 0 auto;
}

.notice-item.is-read {
  opacity: .62;
}

.notice-item p {
  margin-top: 6px;
  color: var(--text);
  line-height: 1.45;
}

.notice-item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.notice-mail-one {
  min-height: 26px;
  padding: 0 8px;
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
  flex: 0 0 auto;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.58);
}

.modal-card {
  width: min(620px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

#noticeComposer .modal-card {
  width: min(560px, calc(100vw - 32px));
}

#noticeComposer .form-grid.notice-composer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#noticeComposer .form-grid.notice-composer-grid .wide {
  grid-column: 1 / -1;
}

#noticeComposer .toggle-line.notice-email-toggle {
  align-items: center;
  min-height: 36px;
  grid-column: 1 / -1;
}

#noticeComposer .button-pair {
  justify-content: flex-end;
}

#noticeComposer input,
#noticeComposer select,
#noticeComposer textarea {
  min-width: 0;
}

#noticeComposer textarea {
  width: 100%;
  max-width: 100%;
  min-height: 150px;
  max-height: min(46vh, 360px);
  resize: vertical;
}

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

.modal-head button {
  min-width: 36px;
  width: 36px;
  padding: 0;
}

.notice-popup-overlay {
  z-index: 60;
}

.unread-notice-card {
  width: min(680px, 100%);
  max-height: min(78vh, 760px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 28px 32px 20px;
}

.unread-notice-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unread-notice-icon,
.unread-notice-pill {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--button-text);
  font-weight: 800;
}

.unread-notice-icon {
  width: 28px;
}

.unread-notice-pill {
  padding: 0 10px;
  font-size: 12px;
}

.unread-notice-card h2 {
  font-size: 24px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.unread-notice-card small {
  color: var(--muted);
}

.unread-notice-content {
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.75;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.unread-notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.invite-payment-card {
  width: min(540px, 100%);
}

.invite-payment-summary {
  display: grid;
  gap: 12px;
}

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

.invite-pay-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-2);
}

.invite-pay-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.invite-pay-grid strong {
  display: block;
  font-size: 18px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.invite-pay-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.invite-payment-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.invite-payment-actions button {
  width: 100%;
}

.balance-recharge-form {
  display: grid;
  gap: 14px;
}

.balance-recharge-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.pay-route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.pay-callback-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pay-callback-note code {
  color: var(--text);
  overflow-wrap: anywhere;
}

.gateway-cards {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

.gateway-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
}

.gateway-card .panel-head {
  min-height: 42px;
  margin: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.gateway-card .panel-head h2 {
  font-size: 15px;
}

.pay-gateway-body {
  display: grid;
  gap: 14px;
  padding: 18px 16px;
}

.pay-gateway-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;
}

.pay-enable-line,
.pay-check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
  font-weight: 800;
}

.pay-field {
  min-width: 0;
}

.pay-field-textarea textarea {
  min-height: 76px;
  resize: vertical;
}

.pay-gateway-actions {
  display: flex;
  justify-content: flex-start;
}

.pay-gateway-actions button::before {
  content: "✓";
  margin-right: 7px;
}

.template-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.template-status {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

body.is-template-mode .template-status {
  border-color: rgba(79, 183, 168, 0.45);
  background: rgba(79, 183, 168, 0.12);
  color: var(--text);
}

.popup-settings {
  display: grid;
  gap: 18px;
}

.popup-settings textarea {
  resize: vertical;
  min-height: 84px;
}

.popup-admin-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel-2) 62%, transparent);
}

.popup-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.popup-admin-head h3 {
  margin: 0;
  font-size: 15px;
}

.popup-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.popup-config-list {
  display: grid;
  gap: 12px;
}
.menu-icon-breadcrumb { display:flex; align-items:center; gap:8px; margin:14px 0; color:var(--muted); }
.menu-icon-breadcrumb button { border:0; background:none; color:var(--accent); padding:0; cursor:pointer; }
.menu-icon-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:12px; padding:16px; border:1px solid var(--line); border-radius:6px; background:#080b0d; }
.menu-icon-card { min-width:0; min-height:150px; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:7px; padding:10px; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--text); }
.menu-icon-card:hover { border-color:var(--accent); background:var(--panel-2); }
button.menu-icon-card { cursor:pointer; }
.folder-glyph { width:58px; height:42px; margin:12px 0 8px; border-radius:4px; background:#1994ed; position:relative; }
.folder-glyph:before { content:''; position:absolute; left:5px; top:-7px; width:24px; height:10px; border-radius:4px 4px 0 0; background:#1994ed; }
.menu-icon-card small { color:var(--muted); }
.menu-icon-thumb { width:92px; height:86px; display:flex; align-items:center; justify-content:center; margin-bottom:3px; }
.menu-icon-thumb img { max-width:86px; max-height:80px; object-fit:contain; }
.image-card input, .image-card select { width:100%; min-width:0; box-sizing:border-box; }
.image-card .danger { width:100%; }

.popup-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.popup-config-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.popup-config-fields .wide {
  grid-column: 1 / -1;
}

.popup-preview {
  width: 132px;
  min-height: 132px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  overflow: hidden;
}

.popup-preview img {
  max-width: 100%;
  max-height: 116px;
  object-fit: contain;
  display: block;
}

.client-variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.client-variant-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.client-preview {
  height: 250px;
  background: #f2f5f8;
  color: #111827;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

.preview-window-bar {
  height: 26px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #dde5ef;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.preview-window-bar span {
  margin-right: auto;
}

.preview-window-bar i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid #9aa8ba;
}

.original-preview-body,
.studio-preview-body,
.portal-preview-body {
  height: calc(100% - 26px);
  display: grid;
  grid-template-columns: 92px 1fr;
}

.original-preview aside,
.studio-preview aside,
.portal-preview aside {
  background: #fff;
  border-right: 1px solid #e3e9f1;
  padding: 16px 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.original-preview aside b,
.studio-preview aside b {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 6px;
}

.original-preview aside em,
.studio-preview aside em,
.portal-preview aside em {
  display: block;
  height: 20px;
  border-radius: 5px;
  padding: 4px 6px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #334155;
  background: transparent;
}

.original-preview aside em:first-of-type,
.studio-preview aside em:first-of-type,
.portal-preview aside em:first-of-type {
  color: #0875e1;
  background: #dceeff;
}

.original-preview {
  background: #101827;
  color: #eef4ff;
}

.original-preview .preview-window-bar {
  background: #18243a;
  border-bottom-color: #263750;
  color: #eef4ff;
}

.original-preview-body {
  background: #101827;
}

.original-preview aside {
  background: #0b1220;
  border-right-color: #24344f;
}

.original-preview aside em {
  color: #b8c4d8;
}

.original-preview aside em:first-of-type {
  color: #e9fbff;
  background: #24445e;
}

.original-preview main {
  padding: 14px;
}

.original-preview h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

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

.original-button-grid span {
  height: 34px;
  border: 1px solid #304762;
  border-radius: 7px;
  background: linear-gradient(180deg, #1d2b41, #23354f);
  color: #eef4ff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.studio-preview main {
  padding: 12px;
}

.studio-preview h4,
.portal-preview h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.studio-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 12px;
}

.studio-button-grid span,
.studio-small-row span {
  height: 22px;
  border: 1px solid #d7e0ea;
  border-radius: 5px;
  background: #fbfdff;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 800;
}

.studio-small-row {
  display: grid;
  grid-template-columns: repeat(2, 90px);
  gap: 8px;
}

.portal-preview-body {
  grid-template-columns: 86px 1fr;
  background: #fff;
}

.portal-preview aside b {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #b9c0c9;
  color: white;
}

.portal-preview main {
  padding: 12px 14px;
}

.portal-hero {
  height: 66px;
  border-radius: 8px;
  background: linear-gradient(120deg, #1e66a5, #102653);
  color: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  margin-bottom: 10px;
}

.portal-hero strong {
  font-size: 24px;
}

.portal-hero span {
  font-size: 10px;
}

.portal-card {
  width: 170px;
  height: 62px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 10px;
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: 20px 22px;
  gap: 4px 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.portal-card b {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #e8f2ff;
  color: #1681ef;
}

.portal-card strong {
  font-size: 11px;
}

.portal-card span {
  width: 42px;
  height: 20px;
  border-radius: 5px;
  background: #1681ef;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.client-variant-info {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.vst76-preview .preview-window-bar b { color: #64748b; font-size: 8px; font-weight: 700; }
.vst76-preview-body { height: calc(100% - 26px); display: grid; grid-template-columns: 96px 1fr; background: #f2f5f8; }
.vst76-preview-body aside { padding: 12px 8px; display: grid; align-content: start; gap: 5px; border-right: 1px solid #e2e8f0; background: #fff; }
.vst76-preview-body aside strong { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 5px; background: #1681ef; color: #fff; }
.vst76-preview-body aside em { padding: 4px 6px; border-radius: 5px; color: #526173; font-size: 8px; font-style: normal; font-weight: 700; }
.vst76-preview-body aside em.active { color: #0875e1; border-left: 2px solid #1681ef; background: #e8f3ff; }
.vst76-preview-body main { min-width: 0; padding: 12px; }
.vst76-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.vst76-metrics span { min-width: 0; height: 66px; padding: 8px; display: grid; gap: 4px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.vst76-metrics b { color: #64748b; font-size: 8px; } .vst76-metrics strong { font-size: 15px; }
.vst76-metrics i { height: 3px; border-radius: 2px; background: #1681ef; }
.vst76-lower { display: grid; grid-template-columns: 1.35fr 1fr; gap: 7px; margin-top: 8px; }
.vst76-lower section { height: 76px; padding: 9px; display: grid; align-content: start; gap: 5px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.vst76-lower section b { font-size: 9px; } .vst76-lower small { color: #64748b; font-size: 7px; }
.vst76-lower button { width: 58px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: #1681ef; color: #fff; font-size: 8px; }

.client-variant-info > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-variant-info strong {
  font-size: 16px;
}

.client-variant-info span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.client-variant-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.client-variant-download-count { color: var(--muted); font-size: 13px; }

.popup-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.popup-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.status {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2147483000;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 24px));
  pointer-events: none;
  isolation: isolate;
}

.toast {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 9px;
  overflow: hidden;
  border: 1px solid var(--toast-line);
  border-radius: 6px;
  background: var(--toast-bg);
  box-shadow: 0 8px 24px var(--toast-shadow);
  color: var(--toast-text);
  transform: translateX(10px);
  opacity: 0;
  animation: toast-in 180ms ease forwards;
  pointer-events: auto;
}

.toast-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #37c789;
  color: #09201a;
  font-size: 11px;
  font-weight: 900;
}

.toast.error .toast-icon {
  background: #ff5d5d;
  color: #fff;
}

.toast.warn .toast-icon {
  background: #f7c948;
  color: #111416;
}

.toast-message {
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-weight: 700;
  font-size: 13px;
}

.toast-close {
  width: 18px;
  min-height: 18px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--panel-2) 78%, transparent);
}

.toast.removing {
  animation: toast-out 160ms ease forwards;
}

.client-build-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 10, 0.68);
}

.client-build-overlay.show {
  display: grid;
}

.client-build-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #151a1d;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
  padding: 26px;
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.client-build-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(79, 183, 168, 0.12);
  box-shadow: inset 0 0 0 1px rgba(79, 183, 168, 0.2);
}

.client-build-ring span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(79, 183, 168, 0.24);
  border-top-color: var(--accent);
  animation: build-spin 1200ms linear infinite;
}

.client-build-overlay.done .client-build-ring span,
.client-build-overlay.error .client-build-ring span {
  animation: none;
  border-color: var(--accent);
  border-top-color: var(--accent);
}

.client-build-overlay.done .client-build-ring span::after {
  content: "✓";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--accent);
  font-weight: 900;
}

.client-build-overlay.error .client-build-ring {
  background: rgba(228, 93, 93, 0.12);
}

.client-build-overlay.error .client-build-ring span {
  border-color: var(--danger);
}

.client-build-overlay.error .client-build-ring span::after {
  content: "!";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--danger);
  font-weight: 900;
}

.client-build-dialog h2 {
  font-size: 20px;
}

.client-build-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.client-build-meter {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #0c1012;
  border: 1px solid var(--line);
}

.client-build-meter i {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #74d6c8);
  transition: width 360ms ease;
}

.client-build-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

#clientBuildClose {
  min-width: 90px;
}

@keyframes build-spin {
  to { transform: rotate(360deg); }
}

@keyframes toast-in {
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  to { transform: translateX(18px); opacity: 0; }
}

.view { display: none; }
.view.show { display: grid; gap: 18px; }

#view-overview.show {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

#view-overview > .panel:first-child,
#appLoginPanel,
#pageAccessPanel,
#appUpdatePanel,
#view-overview > .stats {
  grid-column: 1 / -1;
}

#appPropertyPanel .form-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

#appLoginPanel {
  display: none;
}

body.is-super-admin #appLoginPanel {
  display: block;
}

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

.exchange-block {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 210px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.exchange-block h3 {
  font-size: 16px;
}

.exchange-actions,
.exchange-import-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.exchange-actions button,
.exchange-import-row button,
.file-pick {
  min-height: 38px;
}

.file-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.file-pick input {
  display: none;
}

.mono-input {
  font-family: Consolas, "Cascadia Mono", monospace;
}

.exchange-import-row input {
  flex: 1 1 320px;
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.panel-head h2 {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-wrap: anywhere;
}

.collapsible-panel.is-collapsed .panel-head {
  margin-bottom: 0;
}

.collapsible-panel.is-collapsed .panel-head > button:not(.panel-collapse-toggle) {
  display: none;
}

.collapsible-panel.is-collapsed .panel-head > .invite-filter {
  display: none;
}
.collapsible-panel.is-collapsed .panel-head > .button-pair {
  display: none;
}

.panel-collapse-toggle {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text);
  font-size: 12px;
}

.icon-picker-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-picker-trigger {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
  background: var(--input);
  border-color: var(--line);
  color: var(--text);
}

.icon-picker-trigger img {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
}

.icon-picker-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: min(560px, calc(100vw - 80px));
  max-height: 330px;
  padding: 10px;
  overflow: auto;
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.icon-field { position: relative; overflow: visible; }
.icon-field .icon-picker-popover { top: calc(100% + 6px); left: 0; }

.icon-picker-popover[hidden] {
  display: none;
}
.icon-picker-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.icon-picker-head button { border:0; background:none; color:var(--accent); cursor:pointer; padding:2px; }
.icon-picker-head input[type="search"] { flex:1 1 150px; min-width:110px; }
.icon-picker-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; max-height:300px; overflow:auto; }
.icon-picker-grid .icon-picker-item { min-height:82px; padding:7px; }
.icon-picker-grid .icon-picker-item img { width:42px; height:42px; object-fit:contain; }

.icon-picker-item {
  height: 92px;
  padding: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.icon-picker-item:hover,
.icon-picker-item.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-2));
}

.icon-picker-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.icon-picker-item strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 12px;
}

.icon-picker-built-in {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--muted);
  color: var(--muted);
  font-size: 11px;
}

.panel-collapse-toggle::before {
  content: "▸";
  display: inline-block;
  margin-right: 5px;
}

.collapsible-panel:not(.is-collapsed) .panel-collapse-toggle::before {
  content: "▾";
}

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

.form-grid.compact {
  grid-template-columns: 1.1fr 1.1fr 1fr 1.3fr 140px 2fr;
}

.manage-grid {
  display: grid;
  grid-template-columns: 170px minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.button-pair {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.button-pair button {
  white-space: nowrap;
}

.batch-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0 14px;
}

.checkline {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.checkline input,
.user-check {
  width: 14px;
  min-height: 14px;
}

.user-card-list {
  display: grid;
  gap: 12px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--row-bg);
  overflow: hidden;
}

.user-card-main {
  display: grid;
  grid-template-columns: auto 34px 42px minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.agent-card-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: max-content max-content max-content minmax(270px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-top: 2px;
}

.agent-card-meta .pill {
  min-width: 0;
}

.user-expand {
  width: 34px;
  padding: 0;
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}

.user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #071210;
  font-weight: 900;
}

.user-summary {
  min-width: 0;
}

.user-summary strong,
.user-summary span,
.user-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.user-summary small {
  margin-top: 3px;
  color: #7f8d94;
  font-size: 12px;
}

.user-card-detail {
  border-top: 1px solid var(--line);
  padding: 14px;
  background: var(--panel);
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(79, 183, 168, 0.35);
  color: var(--text);
  background: rgba(79, 183, 168, 0.12);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.danger-pill {
  border-color: rgba(228, 93, 93, 0.45);
  background: rgba(228, 93, 93, 0.12);
}

.muted-pill {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--muted);
}

.inline-balance {
  display: grid;
  grid-template-columns: auto 96px auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  justify-self: end;
}

.inline-balance input {
  min-height: 30px;
  padding: 5px 8px;
}

.inline-balance button {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.agent-level-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.agent-level-head { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) minmax(90px, .7fr) auto auto; gap: 8px; margin-top: 10px; padding: 0 8px; color: var(--muted); font-size: 12px; }
.agent-level-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.agent-level-list { display: grid; gap: 8px; margin-top: 10px; }
.agent-level-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) minmax(90px, .7fr) auto auto; align-items: center; gap: 8px; }
.agent-level-row input[type="number"] { min-width: 0; }
@media (max-width: 760px) {
  .agent-level-head { display: none; }
  .agent-level-row { grid-template-columns: 1fr 1fr; }
  .agent-level-row .checkline { grid-column: 1; }
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.toggle-line span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
}

.toggle-line input[type="checkbox"] {
  width: 14px;
  min-height: 14px;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stats div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stats strong {
  display: block;
  font-size: 30px;
}

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

.search { max-width: 320px; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  color: var(--muted);
  text-align: left;
  background: #14181b;
  font-size: 13px;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.target-note {
  min-height: 18px;
  font-size: 12px;
}

.target-input {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-input {
  width: 72px;
  min-width: 72px;
  text-align: center;
}

.button-filters {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(130px, 180px) minmax(130px, 170px) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  width: min(720px, 100%);
}

.button-filters .search {
  width: 100%;
}

.page-feature-grid {
  margin-bottom: 12px;
}

.page-lock-table {
  min-width: 980px;
}

.page-lock-table input[type="password"] {
  width: 100%;
  min-width: 220px;
}

.page-lock-table select {
  min-width: 112px;
}

.page-lock-group-box {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 520px);
  gap: 18px;
  align-items: center;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.page-lock-group-selectors,
.page-lock-group-add,
.page-lock-independent-toggle {
  grid-column: 1 / -1;
}

.page-lock-group-selectors {
  display: grid;
  gap: 8px;
}

.page-lock-group-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 72px;
  gap: 8px;
}

.page-lock-group-row select {
  width: 100%;
}

.page-lock-group-row button {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  background: transparent;
}

.page-lock-group-add {
  width: 100%;
}

.page-lock-independent-toggle {
  justify-content: flex-start;
  width: fit-content;
}

.page-lock-group-box small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.page-lock-group-box input {
  width: 100%;
}

@media (max-width: 860px) {
  .page-lock-group-box {
    grid-template-columns: 1fr;
  }
}

.page-lock-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-field {
  display: grid;
  grid-template-columns: 54px minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 290px;
}

.icon-preview {
  width: 52px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  user-select: none;
}

.icon-preview img {
  max-width: 42px;
  max-height: 28px;
  object-fit: contain;
}

.icon-field input {
  min-width: 220px;
}

td.actions {
  width: 260px;
  min-width: 260px;
}

td.actions button {
  margin: 0 6px 6px 0;
  white-space: nowrap;
}

tr.row-highlight {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: rgba(79, 183, 168, .12);
  transition: background .25s ease, outline-color .25s ease;
}

.button-disabled-row {
  opacity: 0.58;
}

.button-disabled-row input,
.button-disabled-row select {
  color: var(--muted);
}

.muted-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.script-target-control {
  display: grid;
  gap: 8px;
}

.custom-client-cover img,
.variant-setting-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.variant-settings-grid { display: grid; gap: 14px; margin-top: 16px; }
.variant-setting { display: grid; grid-template-columns: minmax(260px, 38%) 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.variant-setting-preview { height: 220px; overflow: hidden; background: #eef2f6; }
.variant-setting-preview .client-preview { height: 220px; border-bottom: 0; }
.variant-setting-fields { padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.variant-setting-fields .wide, .variant-upload-row { grid-column: 1 / -1; }
.variant-upload-row { display: flex; gap: 10px; align-items: center; }
.variant-upload-row input { min-width: 0; flex: 1; }
.password-field { display: flex; gap: 8px; align-items: center; }
.password-field input { flex: 1; min-width: 0; }
.page-lock-group-title { display: flex; align-items: center; gap: 12px; }
.page-lock-group-title .checkline { margin: 0; width: auto; }
.login-ip-history { padding: 12px; border: 1px solid var(--line); margin-bottom: 12px; font-size: 13px; line-height: 1.8; }
.ip-location-settings { display: grid; gap: 18px; }
.ip-provider-grid { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 12px 0; border-block: 1px solid var(--line); }
.ip-provider-grid .checkline { width: auto; margin: 0; }
.ip-test-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ip-test-row input { width: min(360px, 100%); }
.audit-panel .panel-head { align-items: center; }
.audit-panel .panel-head .muted { margin-top: 4px; font-size: 12px; }
.audit-filters { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; align-items: end; }
.audit-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.audit-filters input, .audit-filters select, .audit-filters button { width: 100%; min-width: 0; }
.audit-table-wrap { max-height: calc(100vh - 330px); min-height: 360px; overflow: auto; }
.audit-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.audit-table { min-width: 880px; table-layout: fixed; font-size: 13px; }
.audit-table th, .audit-table td { padding: 8px 10px; overflow: hidden; }
.audit-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.audit-table th:nth-child(1) { width: 18%; } .audit-table th:nth-child(2) { width: 32%; } .audit-table th:nth-child(3) { width: 19%; } .audit-table th:nth-child(4) { width: auto; } .audit-table th:nth-child(5) { width: 92px; }
.audit-table td:nth-child(4) { overflow-wrap: anywhere; word-break: break-all; line-height: 1.35; }
.audit-table td:nth-child(5) { overflow: visible; white-space: nowrap; }
.audit-risk { display: inline-flex; align-items: center; min-height: 24px; padding: 1px 7px; border: 1px solid; border-radius: 6px; white-space: nowrap; font-size: 11px; }
.audit-risk.high { color: #ff6b6b; border-color: #a84949; background: rgba(168,73,73,.12); }
.audit-risk.medium { color: #e5b84b; border-color: #8d742f; background: rgba(141,116,47,.12); }
.audit-risk.low { color: #63c995; border-color: #397b5a; background: rgba(57,123,90,.12); }
.audit-log-row { cursor: pointer; transition: background-color .16s ease; }
.audit-log-row:hover, .audit-log-row:focus { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.audit-log-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.audit-change-count { margin-top: 4px; font-size: 11px; font-weight: 400; }
.audit-detail-card { width: min(820px, 100%); max-height: calc(100vh - 36px); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.audit-detail-card > .panel-head { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.audit-detail-body { display: grid; gap: 14px; overflow: auto; min-height: 0; padding-right: 3px; }
.audit-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.audit-detail-section { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 82%, var(--bg)); }
.audit-detail-section h3 { margin: 0 0 10px; font-size: 14px; }
.audit-detail-section p { margin: 0; }
.audit-detail-section dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 12px; margin: 0; }
.audit-detail-section dt { color: var(--muted); }
.audit-detail-section dd { min-width: 0; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.audit-detail-user { line-height: 1.65; overflow-wrap: anywhere; }
.audit-change-list { display: grid; gap: 9px; }
.audit-change-row { display: grid; grid-template-columns: minmax(120px, .55fr) minmax(0, 1.45fr); gap: 14px; align-items: start; padding: 10px 12px; border-radius: 7px; background: color-mix(in srgb, var(--bg) 72%, transparent); }
.audit-change-row > div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; }
.audit-change-row span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-change-row b { color: var(--muted); }
.audit-before { color: #e5a2a2; }
.audit-after { color: #72d7aa; }
.audit-raw-info { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1100px) { .audit-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); } }
@media (max-width: 680px) { .audit-filters { grid-template-columns: 1fr; } .audit-table-wrap { max-height: none; min-height: 320px; } .audit-detail-card { width: 100%; max-height: calc(100vh - 36px); padding: 12px; } .audit-detail-grid { grid-template-columns: 1fr; } .audit-change-row { grid-template-columns: 1fr; gap: 7px; } .audit-change-row > div { grid-template-columns: 1fr; gap: 5px; } .audit-change-row b { transform: rotate(90deg); width: max-content; } .audit-detail-section dl { grid-template-columns: 1fr; gap: 3px; } .audit-detail-section dd + dt { margin-top: 6px; } }
@media (max-width: 800px) { .variant-setting { grid-template-columns: 1fr; } .variant-setting-fields { grid-template-columns: 1fr; } .variant-setting-fields .wide, .variant-upload-row { grid-column: auto; } }

.download-target-control { display: grid; gap: 8px; min-width: 420px; }
.download-custom-options { display: grid; gap: 8px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.download-custom-options label { display: grid; gap: 4px; }
.download-custom-options .checkline { display: flex; align-items: center; gap: 6px; }
#view-buttons .form-grid > label.download-config-field { grid-column: 1 / -1; min-width: 0; }
#view-buttons .form-grid > label.download-config-field .download-target-control { min-width: 0; width: 100%; }
.download-multiple { display: grid; gap: 8px; }
.download-file-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(180px, 1fr) 118px 34px; gap: 8px; align-items: center; }
.download-file-row input { min-width: 0; }
.download-primary { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; }
.download-primary input[type="radio"] { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); }
.download-file-row button { width: 34px; min-width: 34px; height: 36px; padding: 0; font-size: 18px; }
.download-multiple > small { display: block; color: var(--muted); }
@media (max-width: 900px) { .download-target-control { min-width: 280px; } .download-file-row { grid-template-columns: 1fr; } .download-file-row button { width: 100%; } }

.button-edit-row > td { padding: 12px !important; }
.button-edit-panel { box-sizing: border-box; display: grid; gap: 16px; width: 100%; min-width: 0; padding: 16px; border: 1px solid rgba(79, 183, 168, .32); border-radius: 8px; background: rgba(79, 183, 168, .06); }
.button-edit-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.button-edit-title span { color: var(--muted); font-size: 12px; }
.button-edit-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; }
.button-edit-grid label, .button-edit-target { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.button-edit-grid input, .button-edit-grid select, .button-edit-target input, .button-edit-target select { width: 100%; min-width: 0; }
.button-edit-target .target-control { display: block; width: 100%; }
.button-edit-panel .download-target-control { min-width: 0; }
.button-edit-panel .download-primary input[type="radio"] { width: 16px !important; min-width: 16px !important; height: 16px !important; }
.button-edit-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1100px) { .button-edit-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
@media (max-width: 640px) { .button-edit-grid { grid-template-columns: 1fr; } .button-edit-title { align-items: flex-start; flex-direction: column; } }

.script-help-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 183, 168, .28);
  border-radius: 8px;
  background: rgba(79, 183, 168, .08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.script-help-box strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.script-help-box p {
  margin: 4px 0;
}

.script-help-box code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(5, 9, 12, .48);
  color: var(--text);
}

.custom-script-input {
  min-width: 260px;
}

.user-endpoint {
  min-width: 360px;
}

.invite-create {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.invite-create label {
  font-size: 12px;
}

.invite-create input {
  min-height: 32px;
  padding: 6px 9px;
}

.invite-create select {
  min-height: 32px;
  padding: 6px 9px;
}

.invite-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 154px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.invite-filter select {
  width: 96px;
  min-height: 34px;
  padding: 6px 9px;
}

.invite-table table {
  min-width: 1320px;
}

.invite-table th,
.invite-table td {
  padding: 7px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.invite-table th:first-child,
.invite-table td:first-child {
  width: 42px;
  text-align: center;
}

.invite-table .actions {
  width: 220px;
  min-width: 220px;
}

.invite-table .actions button {
  min-height: 30px;
  padding: 0 10px;
  margin-bottom: 0;
}

.invite-code {
  min-width: 150px;
  max-width: 210px;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 13px;
}

.invite-lock-note {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
}

.invite-result-card {
  width: min(620px, calc(100vw - 32px));
}

.invite-result-list {
  display: grid;
  gap: 10px;
  max-height: 45vh;
  overflow: auto;
}

.invite-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.invite-result-row input {
  min-width: 0;
}

.invite-result-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.invite-result-actions button,
.invite-result-row button {
  min-height: 34px;
}

.invite-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(79, 183, 168, .42);
  background: rgba(79, 183, 168, .12);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.invite-badge.is-inactive,
.invite-badge.is-used {
  border-color: rgba(228, 93, 93, .55);
  background: rgba(228, 93, 93, .12);
}

.invite-badge.is-unused {
  color: #bff5ea;
}

.agent-account-card {
  display: grid;
  gap: 12px;
}

.agent-account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.agent-account-grid > div,
.agent-mini-order {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.agent-account-grid span,
.agent-mini-order span,
.agent-mini-order small {
  color: var(--muted);
  font-size: 12px;
}

.agent-account-grid strong {
  font-size: 15px;
}

.agent-mini-orders {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.agent-apply-dialog {
  width: min(620px, calc(100vw - 32px));
}

.agent-apply-description {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 183, 168, .28);
  border-radius: 8px;
  background: rgba(79, 183, 168, .08);
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.agent-application-table table {
  min-width: 1180px;
}

.agent-application-table th,
.agent-application-table td {
  vertical-align: top;
}

.agent-application-reason {
  max-width: 260px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

#jsonEditor {
  min-height: 62vh;
  resize: vertical;
  font-family: Consolas, "Cascadia Mono", monospace;
  line-height: 1.45;
}

.json-permission-panel {
  margin-bottom: 0;
}

.permission-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.permission-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--row-bg);
}

.permission-item input {
  width: auto;
  min-height: 0;
}

.permission-item strong,
.permission-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-item small {
  margin-top: 2px;
  color: var(--muted);
}

@media (max-width: 900px) {
  body {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 15;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

  .brand {
    margin-bottom: 12px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav {
    flex: 0 0 auto;
    width: auto;
    min-width: 76px;
    text-align: center;
    padding: 0 12px;
  }

  main {
    padding: 14px;
  }

  .topbar {
    display: grid;
    gap: 12px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  h1 {
    font-size: 22px;
  }

  .target-user {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .button-filters {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .auth {
    grid-template-columns: 1fr auto;
  }

  .form-grid,
  .form-grid.compact,
  .manage-grid,
  .invite-create,
  .template-actions {
    grid-template-columns: 1fr;
  }

  .template-actions {
    display: grid;
  }

  .template-actions button,
  .template-status {
    width: 100%;
  }

  .user-card-main {
    grid-template-columns: auto 34px 38px minmax(0, 1fr);
  }

  .agent-card-meta {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .agent-card-meta .inline-balance {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .user-card-main .pill {
    grid-column: span 2;
  }

  .inline-balance {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(96px, 1fr) auto;
  }

  .panel {
    padding: 12px;
  }

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

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

  .search {
    max-width: none;
  }

  .button-pair {
    align-items: stretch;
  }

  .button-pair button {
    flex: 1 1 120px;
  }

  .toast-stack {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  table {
    min-width: 860px;
  }

  .user-endpoint {
    min-width: 260px;
  }

  .pay-route-grid,
  .pay-gateway-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .popup-config-row {
    grid-template-columns: 1fr;
  }

  .popup-config-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .popup-preview {
    width: 100%;
    min-height: 148px;
  }

  .popup-preview img {
    max-height: 132px;
  }

  .popup-row-actions {
    justify-content: stretch;
  }

  .popup-row-actions button {
    flex: 1 1 120px;
  }
}

@media (max-width: 520px) {
  .login-panel {
    width: calc(100vw - 20px);
    padding: 16px;
  }

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

  .brand-mark {
    width: 34px;
    height: 34px;
  }

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

  .panel-head button,
  .auth button {
    width: 100%;
  }

  .pay-route-grid,
  .pay-gateway-grid {
    grid-template-columns: 1fr;
  }

  .pay-gateway-actions button {
    width: 100%;
  }

  .popup-config-fields {
    grid-template-columns: 1fr;
  }

  .popup-admin-head button {
    width: 100%;
  }
}

.endpoint {
  margin-top: 12px;
  padding: 12px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: Consolas, "Cascadia Mono", monospace;
  word-break: break-all;
}

.note {
  color: var(--muted);
  line-height: 1.7;
}

pre {
  overflow: auto;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .topbar { align-items: stretch; flex-direction: column; }
  .auth, .target-user { grid-template-columns: 1fr; }
  #view-overview.show,
  #appPropertyPanel .form-grid,
  .form-grid, .form-grid.compact, .manage-grid, .stats { grid-template-columns: 1fr; }
}

/* Collapsible app sidebar */
body {
  grid-template-columns: 238px minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed {
  grid-template-columns: 66px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width 180ms ease, padding 180ms ease;
}

.sidebar-toggle {
  width: 34px;
  min-height: 34px;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  background: var(--panel-2);
  border-color: var(--line);
}

.brand > div:last-child,
.nav-text {
  min-width: 0;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  overflow: hidden;
}

.nav-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
  color: var(--text);
}

.nav.active .nav-icon {
  background: rgba(79, 183, 168, 0.16);
  color: var(--accent);
}

body.sidebar-collapsed .sidebar {
  padding-left: 14px;
  padding-right: 14px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  margin-bottom: 20px;
}

body.sidebar-collapsed .brand > div:last-child,
body.sidebar-collapsed .nav-text {
  width: 0;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
}

body.sidebar-collapsed .brand-mark {
  width: 36px;
  height: 36px;
}

body.sidebar-collapsed nav {
  gap: 10px;
}

body.sidebar-collapsed .nav {
  grid-template-columns: 28px;
  justify-content: center;
  width: 38px;
  padding: 0 5px;
  border-radius: 10px;
}

body.sidebar-collapsed .nav.active {
  background: var(--panel-2);
}

@media (max-width: 900px) {
  body,
  body.sidebar-collapsed {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
  }

  body.sidebar-open {
    grid-template-columns: 204px minmax(0, 1fr);
  }

  body.sidebar-open .brand > div:last-child,
  body.sidebar-open .nav-text {
    width: auto;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  body.sidebar-open .nav {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-content: stretch;
    width: 100%;
    padding: 0 12px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 16;
    height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 12px 14px;
  }

  .sidebar-toggle {
    margin-bottom: 14px;
  }

  .brand {
    margin-bottom: 20px;
  }

  nav {
    display: grid;
    overflow: visible;
    padding-bottom: 0;
  }

  main {
    min-width: 0;
    padding: 14px;
  }
}

@media (max-width: 900px) {
  body,
  body.sidebar-collapsed,
  body.sidebar-open {
    display: block;
    grid-template-columns: none;
    padding-left: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 0;
    height: 100dvh;
    padding: 0;
    border-right: 0;
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transition: width 180ms ease, padding 180ms ease;
  }

  body.sidebar-open .sidebar {
    width: min(246px, 82vw);
    padding: 58px 14px 16px;
    border-right: 1px solid var(--line);
    background: var(--sidebar-bg);
    box-shadow: 24px 0 48px rgba(0, 0, 0, 0.42);
  }

  .sidebar .brand,
  .sidebar nav {
    display: none;
  }

  body.sidebar-open .sidebar .brand,
  body.sidebar-open .sidebar nav {
    display: flex;
  }

  body.sidebar-open .sidebar nav {
    display: grid;
  }

  .sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 50;
    width: 40px;
    min-height: 40px;
    margin: 0;
    border-color: var(--line);
    background: var(--sidebar-bg);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  }

  .brand {
    justify-content: flex-start;
    margin-bottom: 18px;
  }

  body.sidebar-collapsed .brand > div:last-child,
  body.sidebar-collapsed .nav-text,
  body.sidebar-open .brand > div:last-child,
  body.sidebar-open .nav-text {
    width: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  nav,
  body.sidebar-collapsed nav {
    display: grid;
    gap: 8px;
    overflow: visible;
  }

  .nav,
  body.sidebar-collapsed .nav,
  body.sidebar-open .nav {
    grid-template-columns: 28px minmax(0, 1fr);
    justify-content: stretch;
    width: 100%;
    min-width: 0;
    padding: 0 12px;
    text-align: left;
  }

  main {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 58px 14px 14px;
  }

  .panel,
  .form-grid,
  .manage-grid,
  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }

  .topbar {
    display: grid;
    gap: 12px;
  }

  .auth,
  .target-user {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .panel-head button,
  .auth button,
  .card-actions button,
  .button-pair button {
    width: 100%;
  }

  .card-actions,
  .button-pair {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #view-users.show {
    gap: 12px;
  }

  #view-users .panel {
    padding: 12px;
    overflow: hidden;
  }

  #view-users .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  #view-users .panel-head h2 {
    font-size: 18px;
    line-height: 1.35;
  }

  #view-users .panel-head > button:not(.panel-collapse-toggle) {
    min-height: 34px;
  }

  .panel-collapse-toggle {
    width: auto;
    max-width: none;
  }

  .batch-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
  }

  .batch-bar .checkline,
  .batch-bar .danger {
    grid-column: 1 / -1;
  }

  .user-card-list {
    gap: 10px;
  }

  .user-card-main {
    grid-template-columns: 18px 34px 40px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .user-card-main .pill {
    grid-column: auto;
    min-height: 26px;
    padding: 0 8px;
    font-size: 12px;
  }

  .user-card-main .pill:nth-of-type(1) {
    grid-column: 2 / 4;
  }

  .user-card-main .pill:nth-of-type(2),
  .user-card-main .pill:nth-of-type(3) {
    grid-column: span 2;
  }

  .agent-card-meta {
    grid-template-columns: 1fr 1fr;
  }

  .agent-card-meta .pill {
    grid-column: auto;
  }

  .inline-balance {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .user-summary strong,
  .user-summary span,
  .user-summary small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .user-card-detail {
    padding: 12px;
  }

  .user-endpoint {
    min-width: 0;
  }

  .invite-create {
    margin-bottom: 10px;
  }

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

  .agent-application-table {
    overflow-x: auto;
  }

  .invite-table {
    border: 0;
    overflow: visible;
  }

  .invite-table table,
  .invite-table thead,
  .invite-table tbody,
  .invite-table tr,
  .invite-table th,
  .invite-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .invite-table thead {
    display: none;
  }

  .invite-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--row-bg);
    overflow: hidden;
  }

  .invite-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 42px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .invite-table td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .invite-table .empty-cell {
    display: block;
    text-align: center;
  }

  .invite-table .empty-cell::before {
    content: none;
  }

  .invite-table td:nth-child(1)::before { content: "选择"; }
  .invite-table td:nth-child(2)::before { content: "邀请码"; }
  .invite-table td:nth-child(3)::before { content: "生成时间"; }
  .invite-table td:nth-child(4)::before { content: "注册后角色"; }
  .invite-table td:nth-child(5)::before { content: "绑定代理"; }
  .invite-table td:nth-child(6)::before { content: "代理邀请码"; }
  .invite-table td:nth-child(7)::before { content: "状态"; }
  .invite-table td:nth-child(8)::before { content: "是否使用"; }
  .invite-table td:nth-child(9)::before { content: "使用次数"; }
  .invite-table td:nth-child(10)::before { content: "使用记录"; }
  .invite-table td:nth-child(11)::before { content: "操作"; }

  .invite-table td:first-child {
    text-align: left;
  }

  .invite-table td:last-child {
    border-bottom: 0;
  }

  .invite-table .actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .invite-table .actions button {
    width: 100%;
    margin: 0 0 8px;
  }

  .invite-table .actions button:last-child {
    margin-bottom: 0;
  }

  .invite-code {
    min-width: 0;
    max-width: 100%;
  }

  .invite-result-row {
    grid-template-columns: 1fr;
  }

  .invite-result-row button,
  .invite-result-actions button {
    width: 100%;
  }
}

/* Final mobile layout overrides */
#view-buttons .form-grid.compact {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  align-items: end;
}

#view-buttons .form-grid.compact > button {
  width: auto;
  min-width: 112px;
  justify-self: end;
  align-self: end;
}

#view-buttons .panel-head > button {
  width: auto;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: start;
    gap: 10px 8px;
  }

  .topbar > div:first-child {
    grid-column: 1 / 2;
    grid-row: 1;
    min-width: 0;
  }

  .notice-tools {
    grid-column: 2 / 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  #logoutBtn {
    grid-column: 4 / 5;
    grid-row: 1;
    width: auto;
    min-width: 64px;
    justify-self: end;
    align-self: start;
  }

  .theme-toggle {
    grid-column: 3 / 4;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    min-width: 76px;
  }

  .target-user {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    margin-left: 0;
  }

  #currentUserLabel {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  #view-buttons .panel-head {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  #view-buttons .panel-head > button {
    width: auto;
    min-width: 96px;
  }

  #view-buttons .form-grid.compact {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #view-buttons .form-grid.compact > button {
    width: auto;
    min-width: 112px;
    justify-self: end;
  }

  .invite-table {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
  }

  .invite-table table {
    display: table;
    width: 100%;
    min-width: 1040px;
  }

  .invite-table thead {
    display: table-header-group;
  }

  .invite-table tbody {
    display: table-row-group;
  }

  .invite-table tr {
    display: table-row;
    margin-bottom: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .invite-table th,
  .invite-table td {
    display: table-cell;
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
  }

  .invite-table td::before {
    content: none !important;
  }

  .invite-table th:first-child,
  .invite-table td:first-child {
    width: 42px;
    text-align: center;
  }

  .invite-table .actions {
    display: table-cell;
    width: 220px;
    min-width: 220px;
  }

  .invite-table .actions button {
    width: auto;
    margin: 0 6px 6px 0;
  }

  .invite-code {
    min-width: 150px;
    max-width: 210px;
  }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  #noticeComposer .form-grid.notice-composer-grid {
    grid-template-columns: 1fr;
  }

  .notice-item-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .notice-item-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .notice-tools {
    grid-column: 2 / 3;
  }

  .theme-toggle {
    grid-column: 3 / 4;
    grid-row: 1;
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  .theme-toggle span:last-child {
    display: none;
  }

  #logoutBtn {
    grid-column: 3 / 4;
    grid-row: 2;
  }

  .target-user {
    grid-row: 3;
  }

  #currentUserLabel {
    grid-row: 4;
  }

  #openNoticeComposerBtn {
    padding: 0 12px;
  }
}

.tuner-preview {
  background: #f4f7fb;
  color: #0f172a;
}

.tuner-window-bar {
  height: 22px;
  padding: 0 8px 0 10px;
  gap: 7px;
}

.tuner-window-bar em {
  font-style: normal;
  font-size: 11px;
  color: #8da0b8;
  font-weight: 700;
}

.tuner-preview-body {
  height: calc(100% - 22px);
  display: grid;
  grid-template-columns: 118px 1fr;
  background: #f4f7fb;
}

.tuner-preview aside {
  background: #fff;
  padding: 12px 8px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.tuner-brand {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.tuner-brand b {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #36b9b3;
  color: #0f172a;
  font-size: 13px;
  grid-row: span 2;
}

.tuner-brand strong {
  font-size: 10px;
  line-height: 1.1;
}

.tuner-brand small {
  font-size: 8px;
  color: #0f172a;
}

.tuner-preview aside em {
  height: 18px;
  border-radius: 4px;
  padding: 3px 8px;
  font-style: normal;
  font-size: 10px;
  color: #17324d;
}

.tuner-preview aside em.active {
  color: #fff;
  background: #2f94ee;
}

.tuner-preview main {
  position: relative;
  padding: 14px 12px 0;
}

.tuner-section {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e1e8f2;
  overflow: hidden;
}

.tuner-section h4 {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #e1e8f2;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tuner-section h4 span { color: #1684ff; }
.tuner-section h4 b { margin-left: auto; color: #64748b; }

.tuner-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}

.tuner-buttons span {
  height: 26px;
  border: 1px solid #d5dfec;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  background: #fbfdff;
}

.tuner-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  background: #fff;
  border-top: 1px solid #e1e8f2;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 9px;
}

.tuner-status span { color: #64748b; }
.tuner-status span::first-letter { color: #22c55e; }
.tuner-status time { margin-left: auto; color: #111827; }

/* Button management table compact layout */
#view-buttons .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
#view-buttons table {
  table-layout: fixed;
  width: 1180px;
  min-width: 1180px;
}
#view-buttons th:nth-child(1), #view-buttons td:nth-child(1) { width: 112px; }
#view-buttons th:nth-child(2), #view-buttons td:nth-child(2) { width: 62px; text-align: center; }
#view-buttons th:nth-child(3), #view-buttons td:nth-child(3) { width: 150px; }
#view-buttons th:nth-child(4), #view-buttons td:nth-child(4) { width: 88px; }
#view-buttons th:nth-child(5), #view-buttons td:nth-child(5) { width: 150px; }
#view-buttons th:nth-child(6), #view-buttons td:nth-child(6) { width: 84px; }
#view-buttons th:nth-child(7), #view-buttons td:nth-child(7) { width: 360px; }
#view-buttons th:nth-child(8), #view-buttons td:nth-child(8) { width: 180px; }
#view-buttons td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
#view-buttons .target-preview {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#view-buttons tr:not(.button-edit-row) td:nth-child(7) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#view-buttons td.actions {
  width: 180px;
  min-width: 180px;
}
#view-buttons td.actions button {
  padding: 7px 10px;
  margin: 0 4px 6px 0;
}
#view-buttons .button-edit-row td:nth-child(7) input,
#view-buttons .button-edit-row td:nth-child(7) select,
#view-buttons .button-edit-row .target-control,
#view-buttons .button-edit-row .target-control input,
#view-buttons .button-edit-row .target-control select {
  max-width: 100%;
  min-width: 0;
}


/* Restore original compact button-management list style */
#view-buttons .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
#view-buttons table {
  width: 100%;
  min-width: 1500px;
  table-layout: fixed;
}
#view-buttons th:nth-child(1), #view-buttons td:nth-child(1) { width: 220px; }
#view-buttons th:nth-child(2), #view-buttons td:nth-child(2) { width: 92px; text-align: left; }
#view-buttons th:nth-child(3), #view-buttons td:nth-child(3) { width: 170px; }
#view-buttons th:nth-child(4), #view-buttons td:nth-child(4) { width: 310px; }
#view-buttons th:nth-child(5), #view-buttons td:nth-child(5) { width: 150px; }
#view-buttons th:nth-child(6), #view-buttons td:nth-child(6) { width: 120px; }
#view-buttons th:nth-child(7), #view-buttons td:nth-child(7) { width: 250px; }
#view-buttons th:nth-child(8), #view-buttons td:nth-child(8) { width: 260px; }
#view-buttons .button-edit-row td:nth-child(1) select {
  width: 200px;
  max-width: 200px;
  display: block;
  margin-bottom: 6px;
}
#view-buttons .button-edit-row td:nth-child(2) input { width: 72px; }
#view-buttons .button-edit-row td:nth-child(3) input { width: 150px; }
#view-buttons .button-edit-row td:nth-child(5) input { width: 132px; }
#view-buttons .button-edit-row td:nth-child(6) select { width: 112px; }
#view-buttons .button-edit-row td:nth-child(7) input,
#view-buttons .button-edit-row td:nth-child(7) select,
#view-buttons .button-edit-row .target-control,
#view-buttons .button-edit-row .target-control input,
#view-buttons .button-edit-row .target-control select {
  width: 220px;
  max-width: 220px;
  min-width: 0;
}
#view-buttons .target-preview {
  display: block;
  width: 220px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#view-buttons td.actions {
  width: 260px;
  min-width: 260px;
  white-space: normal;
}
#view-buttons td.actions button {
  margin: 0 6px 6px 0;
  padding: 9px 14px;
  white-space: nowrap;
}
/* Admin update announcements */
.announcement-nav { position: relative; }
.nav-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  transform: translateY(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.announcement-toolbar { display: grid; gap: 12px; }
.announcement-heading { display: flex; align-items: baseline; gap: 12px; }
.announcement-heading h2 { margin: 0; }
.announcement-heading span, .announcement-stats { color: var(--muted); font-size: 13px; }
.announcement-filters { display: grid; grid-template-columns: 150px 150px minmax(180px, 1fr) auto auto; gap: 10px; align-items: center; }
.announcement-list { display: grid; gap: 8px; }
.announcement-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(460px, auto) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.announcement-row-main { display: grid; grid-template-columns: 10px 1fr; gap: 9px; align-items: center; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; }
.announcement-row-main span:last-child { display: grid; gap: 5px; min-width: 0; }
.announcement-row-main strong, .announcement-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement-row-main small { color: var(--muted); }
.announcement-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.announcement-row.unread .announcement-unread-dot { background: var(--accent); }
.announcement-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.announcement-meta span, .announcement-detail-head span { padding: 3px 7px; border-radius: 4px; background: var(--panel-2); color: var(--muted); font-size: 12px; }
.announcement-admin-actions { display: flex; gap: 6px; }
.announcement-empty { color: var(--muted); text-align: center; padding: 36px; }
.announcement-detail-card { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: hidden; }
.announcement-popup-card { width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden; }
.announcement-popup-card .panel-head { align-items: flex-start; }
.announcement-popup-card .panel-head h2 { margin-bottom: 3px; }
.announcement-popup-card .panel-head small { color: var(--muted); }
#announcementPopupBody { max-height: calc(100vh - 190px); overflow-y: auto; padding: 2px 8px 2px 2px; }
.announcement-popup-list { display: grid; }
.announcement-popup-entry { position: relative; padding: 12px 0 20px 30px; border-left: 1px solid var(--line); margin-left: 9px; }
.announcement-popup-entry:last-child { padding-bottom: 4px; }
.announcement-popup-version { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 22px; color: var(--muted); }
.announcement-popup-version strong { color: var(--accent); font-size: 16px; }
.announcement-popup-version em { padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-style: normal; }
.announcement-popup-version > span:not(.announcement-popup-dot) { font-size: 12px; }
.announcement-popup-dot { position: absolute; left: -7px; top: 17px; width: 13px; height: 13px; border: 2px solid var(--panel); border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 1px var(--line); }
.announcement-popup-entry.is-new .announcement-popup-dot { background: var(--accent); }
.announcement-popup-entry-body { padding-top: 8px; }
.announcement-popup-entry-body h3 { margin: 0 0 7px; font-size: 17px; }
.announcement-popup-entry .announcement-content { max-height: none; overflow: visible; }
.announcement-editor-card { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.announcement-detail-head { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.announcement-summary { color: var(--muted); }
.announcement-content { max-height: min(48vh, 440px); overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); line-height: 1.65; overflow-wrap: anywhere; }
.announcement-content h2, .announcement-content h3 { margin: 12px 0 6px; }
.announcement-content p { margin: 7px 0; }
.announcement-content ul, .announcement-content ol { margin: 7px 0; padding-left: 24px; }
.announcement-content a { color: var(--accent); }
.announcement-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.announcement-editor-grid .wide { grid-column: 1 / -1; }
.announcement-editor-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.announcement-editor-tools button { min-height: 32px; padding: 5px 10px; }
.announcement-editor-tools .announcement-color-red { color: #dc2626; }
.announcement-editor-tools .announcement-color-orange { color: #ea580c; }
.announcement-editor-tools .announcement-color-green { color: #16a34a; }
.announcement-editor-tools .announcement-color-blue { color: #2563eb; }
.announcement-editor-tools .announcement-color-highlight { color: #854d0e; background: #fef08a; }
.announcement-content .notice-color-red { color: #dc2626; font-weight: 600; }
.announcement-content .notice-color-orange { color: #ea580c; font-weight: 600; }
.announcement-content .notice-color-green { color: #16a34a; font-weight: 600; }
.announcement-content .notice-color-blue { color: #2563eb; font-weight: 600; }
.announcement-content .notice-color-highlight { color: #854d0e; background: #fef08a; padding: 0 2px; border-radius: 2px; }
.announcement-preview { min-height: 100px; }
.announcement-popup-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.announcement-popup-actions span { margin-right: auto; color: var(--muted); font-size: 12px; }
.announcement-popup-hint { align-self: center; margin: 0; color: var(--muted); font-size: 12px; }
.announcement-mail-card { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 12px; }
.announcement-mail-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.announcement-mail-tools input { flex: 1 1 240px; min-width: 0; }
.announcement-mail-users { max-height: min(52vh, 500px); overflow-y: auto; display: grid; gap: 6px; padding-right: 4px; }
.announcement-mail-user { display: grid; grid-template-columns: 28px repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); cursor: pointer; }
.announcement-mail-user.is-disabled { opacity: .58; cursor: not-allowed; }
.announcement-mail-user span { min-width: 0; display: grid; gap: 2px; }
.announcement-mail-user strong, .announcement-mail-user small { overflow-wrap: anywhere; }
.announcement-mail-user small { color: var(--muted); font-size: 11px; }
.announcement-mail-empty, .announcement-mail-result { padding: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; }
.announcement-mail-result { color: var(--text); background: var(--panel-2); }
.announcement-mail-result ul { margin: 8px 0 0; padding-left: 20px; }
.announcement-mail-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.announcement-mail-footer strong { color: var(--muted); font-size: 13px; }
body.sidebar-collapsed .announcement-nav .nav-badge { right: 2px; top: 5px; transform: none; }
@media (max-width: 1100px) {
  .announcement-filters { grid-template-columns: 1fr 1fr; }
  .announcement-row { grid-template-columns: 1fr; }
  .announcement-meta { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .announcement-filters, .announcement-editor-grid { grid-template-columns: 1fr; }
  .announcement-editor-grid .wide { grid-column: auto; }
  .announcement-popup-actions { flex-wrap: wrap; }
  .announcement-mail-user { grid-template-columns: 28px 1fr 1fr; }
  .announcement-mail-user span:nth-of-type(3), .announcement-mail-user span:nth-of-type(4) { grid-column: span 1; }
}

#userListSearch {
  width: min(360px, 100%);
  min-width: 220px;
  margin-right: auto;
}

.update-variant-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.update-variant-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); }
.update-variant-card h3 { margin: 0 0 12px; font-size: 15px; }
.update-variant-card .form-grid { margin: 0; }
@media (max-width: 900px) { .update-variant-list { grid-template-columns: 1fr; } }
.button-layout-setting { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; min-width: 0; }
.button-layout-setting legend { margin-bottom: 8px; color: var(--text); font-weight: 700; }
.button-layout-options { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 10px; }
.button-layout-option { display: grid; grid-template-columns: auto 116px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 76px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); cursor: pointer; }
.button-layout-option.layout-none { grid-column: 1 / -1; min-height: 62px; }
.button-layout-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.button-layout-option input { width: 16px; height: 16px; margin: 0; }
.button-layout-option strong { line-height: 1.45; }
.button-layout-page-picker { grid-column: 1 / -1; display: grid; gap: 7px; width: 100%; padding-top: 8px; border-top: 1px solid var(--line); cursor: default; }
.button-layout-scope-toggle { display: flex; gap: 7px; align-items: center; color: var(--text); font-size: 13px; cursor: pointer; }
.button-layout-scope-toggle input { width: 16px; height: 16px; }
.button-layout-page-dropdown { position: relative; width: 100%; }
.button-layout-page-dropdown summary { min-height: 36px; padding: 8px 34px 8px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); cursor: pointer; list-style: none; }
.button-layout-page-dropdown summary::-webkit-details-marker { display: none; }
.button-layout-page-dropdown summary::after { content: '⌄'; position: absolute; right: 12px; top: 8px; color: var(--muted); }
.button-layout-page-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; max-height: 190px; margin-top: 5px; padding: 8px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.button-layout-page-options label { display: flex; gap: 7px; align-items: center; min-width: 0; padding: 5px; color: var(--text); cursor: pointer; }
.button-layout-page-options input { flex: 0 0 auto; width: 15px; height: 15px; }
.button-layout-preview { display: flex; width: 116px; height: 52px; align-items: center; justify-content: center; gap: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); box-sizing: border-box; }
.button-layout-preview.icon-top { flex-direction: column; gap: 3px; }
.button-layout-preview i { display: block; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 4px; background: var(--accent); }
.button-layout-preview b { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.button-layout-status { min-height: 20px; padding-top: 7px; color: var(--muted); font-size: 13px; }
.button-layout-status.success { color: #20a464; }
.button-layout-status.error { color: #e05252; }
@media (max-width: 760px) { .button-layout-options { grid-template-columns: 1fr; } }
