:root {
  --primary: #10a37f;
  --primary-hover: #0d8c6d;
  --primary-light: rgba(16, 163, 127, 0.12);
  --bg-primary: #343541;
  --bg-secondary: #444654;
  --bg-header: #202123;
  --bg-input: #40414f;
  --bg-hover: #2d2d3a;
  --text-primary: #ececf1;
  --text-secondary: #8e8ea0;
  --text-muted: #acacbe;
  --border: #4d4d4f;
  --ok: #19c37d;
  --bad: #ef4444;
  --warn: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 12px;
}
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f8;
  --bg-header: #f9f9f9;
  --bg-input: #ffffff;
  --bg-hover: #ececf1;
  --text-primary: #343541;
  --text-secondary: #6b6b7b;
  --text-muted: #8e8ea0;
  --border: #d1d1d6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  flex-shrink: 0;
}
.site-header__inner {
  max-width: none;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}
.site-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
.site-title a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .site-title { font-size: 15px; }
  .site-title a { white-space: normal; }
}
.site-title i { color: var(--primary); }
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}
.site-nav a {
  flex: 0 0 auto;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border);
}
.site-nav a.is-active {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
}
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  min-width: 0;
}
.auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.auth-slot .auth-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 顶栏右侧控件统一高度，避免带 checkbox 的 pill 视觉上偏上 */
.header-tools .theme-toggle,
.header-tools .btn,
.header-tools .pill {
  min-height: 32px;
  padding: 4px 10px;
  box-sizing: border-box;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.pill {
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* 带复选框的 pill：checkbox 默认基线对齐会显“飘高”，用 flex + 固定尺寸压齐 */
label.pill--checkbox {
  cursor: pointer;
  user-select: none;
}

label.pill--checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
  align-self: center;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.page-wrap {
  flex: 1;
  padding: 24px 20px 40px;
  overflow: auto;
}
.page-wrap--detail {
  padding-top: 0;
}
.page-inner {
  max-width: 1240px;
  margin: 0 auto;
}
.page-inner--wide {
  max-width: 1560px;
}
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.panel h2 { font-size: 20px; margin-bottom: 14px; font-weight: 600; }

/* ---------- 用户管理页：说明与创建表单留白 ---------- */
.panel.admin-page {
  padding: 28px clamp(20px, 3vw, 34px);
}
.panel.admin-page > h2.admin-page__title {
  margin-bottom: 12px;
}
.admin-page__hint {
  line-height: 1.75;
  max-width: 54em;
  margin-bottom: 22px;
  font-size: 13px;
}
.admin-page #adminToast:empty {
  margin: 0;
}
.admin-page #adminToast:not(:empty) {
  margin-bottom: 20px;
}
.admin-create {
  padding: 22px 24px 24px;
  margin-bottom: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-hover);
}
.admin-create__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 18px;
  color: var(--text-primary);
}
.admin-create__grid {
  display: grid;
  gap: 20px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-create__field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.admin-create__field input,
.admin-create__field select {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
}
.admin-create__field--wide {
  grid-column: 1 / -1;
}
.admin-create__actions {
  grid-column: 1 / -1;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.admin-create__actions .btn-primary {
  padding: 10px 18px;
  font-size: 14px;
}
.admin-user-table-wrap {
  margin-top: 4px;
}
@media (max-width: 640px) {
  .admin-create__grid {
    grid-template-columns: 1fr;
  }
}

.btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
}
a.btn { color: var(--text-primary); }
a.btn-primary { color: #fff; }
.btn:hover { background: var(--bg-hover); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
}
.muted { color: var(--text-muted); font-size: 13px; }
.admin-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.admin-link:hover {
  text-decoration: underline;
}
.error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--bad);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
}
[data-theme="light"] .error-banner { color: #991b1b; }
.success-banner {
  background: rgba(16, 163, 127, 0.18);
  border: 1px solid var(--primary);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
}
[data-theme="light"] .success-banner {
  background: rgba(16, 163, 127, 0.12);
  color: #0f172a;
}

/* 全局提示 / 确认（高于页面内其它 app-modal） */
.app-modal.app-dialog--global {
  z-index: 10050;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.app-modal.is-open {
  display: flex;
}
.app-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 20, 0.65);
  backdrop-filter: blur(3px);
  cursor: pointer;
}
[data-theme="light"] .app-modal__backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.app-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 22px 22px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.app-modal__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.app-modal__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 20px;
}
.app-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
html.app-modal-open,
html.app-modal-open body {
  overflow: hidden;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* 面试列表：自动列宽，表头与单元格始终对齐；长文本在提示/学科等列省略 */
table.data-table.data-table--list {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}
#listTableWrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table--list th,
.data-table--list td {
  vertical-align: middle;
  white-space: nowrap;
}
.data-table--list .data-table__clip {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table--list td.data-table__actions {
  overflow: visible;
  width: 1%;
  padding-left: 8px;
  padding-right: 8px;
}
.data-table--list td.data-table__actions .row-actions {
  flex-wrap: nowrap;
  gap: 6px;
}
.data-table--list td.data-table__actions .btn {
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.data-table th, .data-table td {
  border: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}
.data-table th {
  background: var(--bg-hover);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
}
.form-grid { display: grid; gap: 14px; max-width: 520px; }
label { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 6px; }
input[type="text"],
input[type="date"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
textarea,
select,
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  caret-color: var(--text-primary);
  font-size: 14px;
}
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}
/* 横排工具条里的控件不要强制 100% 宽度 */
.toolbar--inline-fields input[type="text"],
.toolbar--inline-fields input[type="password"],
.toolbar--inline-fields select {
  width: auto;
  min-width: 140px;
  max-width: min(320px, 100%);
}
.pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }

.search-q-form input[type="text"] {
  width: auto;
  flex: 1 1 260px;
  min-width: 200px;
}
.search-q-form select { width: auto; }
.search-q-item {
  display: block;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: inherit;
}
.search-q-title { font-size: 15px; line-height: 1.55; margin-bottom: 6px; }
.search-q-actions { margin-top: 10px; }
.kw-hl {
  background: rgba(250, 204, 21, 0.45);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.markdown-body {
  line-height: 1.65;
  font-size: 15px;
  margin-top: 16px;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1em 0 0.5em; }
.markdown-body pre {
  background: #1e1e2e;
  color: #d4d4d4;
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 12px 0;
}

/* ---------- 详情页：报告正文排版 ---------- */
.panel-detail {
  padding: 26px clamp(18px, 4vw, 48px) 40px;
}

.detail-head {
  margin-bottom: 8px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.detail-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.detail-meta {
  margin: 0;
  font-size: 14px;
}

.detail-audio {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: 8px calc(-1 * clamp(18px, 4vw, 48px)) 4px;
  padding: 6px clamp(18px, 4vw, 48px) 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 16px -12px rgba(0, 0, 0, 0.45);
}
.detail-audio-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-audio audio {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 40px;
}
@media (max-width: 640px) {
  .detail-audio-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.markdown-body--report {
  max-width: 52rem;
  margin: 28px auto 0;
  padding: 8px clamp(12px, 2.5vw, 28px) 12px;
  line-height: 1.8;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.markdown-body--report > *:first-child {
  margin-top: 0 !important;
}

.markdown-body--report h1 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.markdown-body--report h2 {
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 2.35rem 0 1rem;
  padding-top: 0.35rem;
  color: var(--text-primary);
}

.markdown-body--report h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 1.85rem 0 0.7rem;
  color: var(--text-primary);
}

.markdown-body--report h4,
.markdown-body--report h5,
.markdown-body--report h6 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.35rem 0 0.55rem;
  color: var(--text-secondary);
}

.markdown-body--report p {
  margin: 0.9rem 0;
}

.markdown-body--report ul,
.markdown-body--report ol {
  margin: 1rem 0 1.15rem;
  padding-left: 1.55em;
}

.markdown-body--report li {
  margin: 0.5rem 0;
}

.markdown-body--report li > p {
  margin: 0.35rem 0;
}

.markdown-body--report blockquote {
  margin: 1.1rem 0;
  padding: 0.65rem 1rem 0.65rem 1rem;
  border-left: 4px solid var(--primary);
  background: var(--bg-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.markdown-body--report hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

.markdown-body--report strong {
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-body--report table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.15rem 0;
  font-size: 14px;
}

.markdown-body--report th,
.markdown-body--report td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: top;
}

.markdown-body--report th {
  background: var(--bg-hover);
  font-weight: 600;
  text-align: left;
}

.markdown-body--report code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--bg-hover);
}

[data-theme="light"] .markdown-body--report pre {
  background: #f4f4f5;
  color: #27272a;
}

.cluster-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
  margin-bottom: 20px;
}
.cluster-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cluster-toolbar select {
  min-width: 140px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
}
.cluster-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cluster-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  background: var(--bg-secondary);
}
.cluster-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.cluster-card .cluster-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.cluster-card ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 14px;
  line-height: 1.55;
}
.cluster-card li {
  margin: 10px 0;
}
.cluster-card .q-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.cluster-card .q-meta a {
  color: var(--primary);
  text-decoration: none;
}
.cluster-card .q-meta a:hover {
  text-decoration: underline;
}

/* ---------- 聚类：主题标题折叠 ---------- */
.cluster-theme-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cluster-theme-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow: hidden;
}

.cluster-theme-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.cluster-theme-summary::-webkit-details-marker {
  display: none;
}

.cluster-theme-summary::before {
  content: "▸";
  flex-shrink: 0;
  width: 1em;
  margin-top: 3px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.cluster-theme-item[open] .cluster-theme-summary::before {
  transform: rotate(90deg);
}

.cluster-theme-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
}

.cluster-theme-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.cluster-theme-body {
  padding: 4px 16px 16px 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.65;
}

.cluster-theme-body .cluster-desc {
  margin: 12px 0 10px;
}

.cluster-theme-body ol {
  margin: 0;
  padding-left: 1.25rem;
}

.cluster-theme-body li {
  margin: 10px 0;
}

.cluster-report-intro {
  margin-bottom: 18px;
}

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

.cluster-panel-actions {
  display: flex;
  gap: 8px;
}

/* ---------- 详情页：题目列表折叠 ---------- */
.question-list-section {
  max-width: 52rem;
  margin: 28px auto 0;
  padding: 0 clamp(12px, 2.5vw, 28px);
}

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

.question-list-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
}

.question-list-actions {
  display: flex;
  gap: 8px;
}

.question-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow: hidden;
  scroll-margin-top: 88px;
}
.question-item.is-locate {
  outline: 2px solid var(--primary);
}

.question-item summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.question-item summary::-webkit-details-marker {
  display: none;
}

.question-item summary::before {
  content: "▸";
  flex-shrink: 0;
  width: 1em;
  margin-top: 2px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.question-item[open] summary::before {
  transform: rotate(90deg);
}

.q-index {
  flex-shrink: 0;
  min-width: 1.6em;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.q-title {
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
}

.q-score {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.q-score.is-good {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.q-score.is-mid {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}

.q-score.is-low {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.q-detail {
  padding: 4px 16px 16px 2.5rem;
  border-top: 1px solid var(--border);
}

.q-field + .q-field {
  margin-top: 14px;
}

.q-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.q-field-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-report-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.detail-report-title {
  max-width: 52rem;
  margin: 0 auto 8px;
  padding: 0 clamp(12px, 2.5vw, 28px);
  font-size: 1.08rem;
  font-weight: 600;
}

.cluster-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 16px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}
.cluster-view-toggle__btn {
  appearance: none;
  margin: 0;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 132px;
}
.cluster-view-toggle__btn:last-child {
  border-right: none;
}
.cluster-view-toggle__btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-input);
}
.cluster-view-toggle__btn.is-active {
  background: var(--primary);
  color: #fff;
  cursor: default;
}
.cluster-view-toggle__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cluster-view-panel[hidden] {
  display: none !important;
}

.cluster-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 15, 20, 0.72);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}
.cluster-busy-overlay.is-open {
  display: flex;
}
[data-theme="light"] .cluster-busy-overlay {
  background: rgba(255, 255, 255, 0.82);
}
.cluster-busy-card {
  max-width: 400px;
  width: 100%;
  padding: 28px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.cluster-busy-title {
  font-size: 17px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text-primary);
}
.cluster-busy-hint {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}
.cluster-busy-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: cluster-busy-spin 0.75s linear infinite;
}
@keyframes cluster-busy-spin {
  to { transform: rotate(360deg); }
}
html.cluster-busy,
html.cluster-busy body {
  overflow: hidden;
}

@media (max-width: 1200px) {
  .site-header__inner {
    flex-wrap: wrap;
  }
  .site-nav {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
  }
  .header-tools {
    order: 2;
    margin-left: auto;
  }
}
@media (max-width: 640px) {
  .header-tools {
    width: auto;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
