/* Shared management UI primitives. Load after app.css so these rules stay canonical. */
:root {
  --ui-control-height: 36px;
  --ui-control-height-sm: 32px;
  --ui-control-radius: 8px;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f8fafc;
  --ui-border: #e5e7eb;
  --ui-border-strong: #cbd5e1;
  --ui-text: rgba(0, 0, 0, 0.88);
  --ui-text-muted: rgba(0, 0, 0, 0.58);
  --ui-primary: #1677ff;
  --ui-primary-hover: #0958d9;
  --ui-danger: #d4380d;
  --ui-row-hover: #f5f9ff;
  --ui-shadow-dialog: 0 20px 56px rgba(15, 23, 42, 0.2);
}

.recruit-interview-sheet-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
}

.recruit-interview-sheet-preview {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 8px 3px 3px;
  border: 1px solid #cfe0f7;
  border-radius: 8px;
  background: #f4f8ff;
  color: #1769d2;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.recruit-interview-sheet-preview:hover,
.recruit-interview-sheet-preview:focus-visible {
  border-color: #7eb3f4;
  background: #eaf3ff;
}

.recruit-interview-sheet-preview img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

.recruit-interview-sheet-empty {
  color: var(--color-text-secondary, #777);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .recruit-interview-sheet-cell {
    min-width: 132px;
    flex-wrap: wrap;
  }
}

.goods-variant-meta {
  display: block;
  margin-top: 4px;
  color: var(--color-text-secondary, #6b7280);
  font-size: 12px;
  font-weight: 400;
}

.goods-inventory-detail-row > td {
  padding: 14px 16px;
  background: #fafafa;
}

.goods-inventory-detail {
  display: grid;
  gap: 14px;
}

.goods-inventory-detail h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.goods-inventory-detail .sku-matrix {
  width: 100%;
  background: #fff;
}

.goods-inventory-detail .sku-matrix th,
.goods-inventory-detail .sku-matrix td {
  text-align: center;
}

.inventory-search-page {
  align-content: start;
}

.inventory-search-field {
  width: min(560px, 100%);
  margin: 0;
}

.inventory-search-hint {
  padding: 12px 16px;
  color: var(--color-text-secondary, #6b7280);
  font-size: 13px;
}

#goodsInventorySearchResults {
  max-height: clamp(320px, calc(100vh - 300px), 820px);
  overflow: auto;
}

@media (max-width: 760px) {
  .inventory-search-toolbar {
    align-items: stretch;
  }

  .inventory-search-field {
    width: 100%;
  }
}

/* Desktop viewport contract: keep the shell fluid from compact office screens to wide monitors. */
@media (min-width: 769px) {
  .app {
    --pc-sidebar-width: 232px;
    --pc-page-gutter: 24px;
    width: 100%;
    min-width: 0;
    grid-template-columns: var(--pc-sidebar-width) minmax(0, 1fr);
  }

  .sidebar {
    width: var(--pc-sidebar-width);
  }

  .content {
    width: auto;
    min-width: 0;
    max-width: calc(100vw - var(--pc-sidebar-width));
  }

  .topbar,
  .view.active {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding-right: var(--pc-page-gutter);
    padding-left: var(--pc-page-gutter);
  }

  .topbar-left,
  .topbar-right,
  .global-search,
  .view.active > *,
  .profile-page,
  .profile-page > *,
  .panel,
  .profile-card-section,
  .personnel-profile-workspace,
  .personnel-profile-toolbar,
  .profile-list-toolbar,
  .ui-page-head,
  .ui-toolbar {
    min-width: 0;
    max-width: 100%;
  }

  .global-search {
    flex: 1 1 300px;
    min-width: 240px;
    max-width: min(520px, 45vw);
  }

  .topbar-right,
  .profile-list-toolbar,
  .ui-toolbar,
  .personnel-profile-filters,
  .personnel-profile-actions,
  .user-management-filter-toolbar {
    flex-wrap: wrap;
  }

  .ui-table-shell,
  .profile-table-wrap,
  .asset-table,
  .company-table-wrap,
  .battle-sheet-wrap,
  .control-room-table-scroll {
    max-width: 100%;
    overscroll-behavior-inline: contain;
  }
}

@media (min-width: 769px) and (max-width: 1099px) {
  .app {
    --pc-sidebar-width: 188px;
    --pc-page-gutter: 12px;
  }

  .brand,
  .nav-group-label {
    padding-right: 18px;
    padding-left: 18px;
  }

  .nav-button {
    padding-right: 18px;
    padding-left: 18px;
  }

  .nav-button.active {
    padding-left: 15px;
  }

  .topbar {
    flex-wrap: wrap;
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .app {
    --pc-sidebar-width: 196px;
    --pc-page-gutter: 14px;
  }

  .brand,
  .nav-group-label {
    padding-right: 20px;
    padding-left: 20px;
  }

  .nav-button {
    padding-right: 20px;
    padding-left: 20px;
  }

  .nav-button.active {
    padding-left: 17px;
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  .app {
    --pc-sidebar-width: 208px;
    --pc-page-gutter: 16px;
  }
}

@media (min-width: 1440px) and (max-width: 1759px) {
  .app {
    --pc-sidebar-width: 220px;
    --pc-page-gutter: 20px;
  }
}

@media (min-width: 1760px) and (max-width: 2199px) {
  .app {
    --pc-sidebar-width: 232px;
    --pc-page-gutter: 24px;
  }
}

@media (min-width: 2200px) {
  .app {
    --pc-sidebar-width: 232px;
    --pc-page-gutter: 28px;
  }
}

/* Buttons */
.btn,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--ui-control-height);
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--ui-control-radius);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary,
.primary-btn {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.18);
}

.btn-primary:hover,
.primary-btn:hover {
  border-color: var(--ui-primary-hover);
  background: var(--ui-primary-hover);
  color: #fff;
}

.btn-secondary,
.secondary-btn {
  border-color: var(--ui-border);
  background: #fff;
  color: var(--ui-text);
  box-shadow: none;
}

.btn-secondary:hover,
.secondary-btn:hover {
  border-color: var(--ui-border-strong);
  background: #f8fafc;
  color: var(--ui-text);
}

.btn-danger {
  border-color: var(--ui-danger);
  background: var(--ui-danger);
  color: #fff;
}

.btn-sm {
  min-height: var(--ui-control-height-sm);
  padding: 0 11px;
  font-size: 12px;
}

.btn-icon,
.modal-close,
.dialog-header .btn-ghost {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--ui-control-radius);
  background: transparent;
  color: var(--ui-text-muted);
  box-shadow: none;
}

.btn-icon:hover,
.modal-close:hover,
.dialog-header .btn-ghost:hover {
  border-color: var(--ui-border);
  background: #f1f5f9;
  color: var(--ui-text);
}

.btn:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.record-action-btn:focus-visible,
.table-link-button:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.34);
  outline-offset: 2px;
}

.btn:disabled,
.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.record-action-btn,
.table-link-button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0958d9;
  font-size: 12px;
  font-weight: 600;
  line-height: 28px;
}

.record-action-btn:hover,
.table-link-button:hover {
  background: rgba(22, 119, 255, 0.08);
  color: #003eb3;
}

.record-action-btn.danger,
.table-link-button.danger {
  color: var(--ui-danger);
}

.record-action-btn.danger:hover,
.table-link-button.danger:hover {
  background: rgba(212, 56, 13, 0.08);
}

/* Page and toolbar template */
.ui-page {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ui-page-head,
.ui-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.ui-page-head__title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ui-page-head__title h2 {
  font-size: 18px;
  font-weight: 650;
}

.ui-page-head__title p,
.ui-table-meta {
  color: var(--ui-text-muted);
  font-size: 12px;
}

.ui-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.ui-toolbar__spacer {
  flex: 1 1 auto;
}

.profile-list-toolbar .btn,
.battle-toolbar .btn,
.recruit-toolbar .btn,
.control-room-toolbar .btn,
.monthly-snapshot-toolbar .btn,
.company-form-actions .btn {
  min-height: var(--ui-control-height);
}

/* Tables */
.ui-table-shell,
.profile-table-wrap,
.asset-table,
.company-table-wrap {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface);
  scrollbar-gutter: stable;
}

.ui-table,
.profile-data-table,
.asset-table table,
.designer-board-table,
.workspace-anchor-fill-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ui-table th,
.profile-data-table th,
.asset-table table th,
.designer-board-table th,
.workspace-anchor-fill-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 42px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-surface-muted);
  color: #526079;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
}

.ui-table td,
.profile-data-table td,
.asset-table table td,
.designer-board-table td,
.workspace-anchor-fill-table td {
  min-height: 46px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  background: #fff;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.45;
  vertical-align: middle;
}

.ui-table tbody tr:last-child td,
.profile-data-table tbody tr:last-child td,
.asset-table table tbody tr:last-child td,
.designer-board-table tbody tr:last-child td,
.workspace-anchor-fill-table tbody tr:last-child td {
  border-bottom: 0;
}

.ui-table tbody tr:hover td,
.profile-data-table tbody tr:hover td,
.asset-table table tbody tr:hover td,
.designer-board-table tbody tr:hover td,
.workspace-anchor-fill-table tbody tr:hover td {
  background: var(--ui-row-hover);
}

.table-action-column,
.ui-table__actions {
  width: 136px;
  min-width: 136px;
  max-width: 176px;
  text-align: center !important;
  white-space: nowrap;
}

.table-actions,
.record-actions,
.user-table-actions,
.ui-table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

/* Dialogs and modal cards */
dialog,
.ui-modal {
  max-height: min(88vh, 820px);
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--ui-shadow-dialog);
}

dialog::backdrop,
.ui-modal::backdrop {
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(2px);
}

.modal-card {
  display: flex;
  width: 100%;
  max-height: min(88vh, 820px);
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.dialog-header,
.modal-header,
.ui-modal__header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ui-border);
  background: #fff;
}

.dialog-header h2,
.modal-header h3,
.ui-modal__header h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}

.dialog-body,
.modal-body,
.ui-modal__body {
  display: grid;
  gap: 14px;
  min-height: 0;
  max-height: calc(88vh - 116px);
  padding: 16px 18px;
  overflow: auto;
}

.dialog-footer,
.modal-footer,
.ui-modal__footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 60px;
  padding: 12px 18px;
  border-top: 1px solid var(--ui-border);
  background: #fafbfc;
}

.dialog-body .field,
.modal-body .field,
.ui-form__field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dialog-body input:not([type="checkbox"]):not([type="radio"]),
.dialog-body select,
.modal-body input:not([type="checkbox"]):not([type="radio"]),
.modal-body select,
.ui-form__field input:not([type="checkbox"]):not([type="radio"]),
.ui-form__field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-control-radius);
  background: #fff;
}

.dialog-body textarea,
.modal-body textarea,
.ui-form__field textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-control-radius);
  background: #fff;
  resize: vertical;
}

/* Neutral management surfaces. Talent supply is the visual baseline. */
.ui-section,
.panel,
.workspace-card,
.profile-card-section,
.management-card,
.recruit-output-panel,
.recruit-dashboard-card,
.recruit-report-card,
.anchor-signing-section,
.issue-feedback-list-panel,
.data-safety-panel,
.governance-hero,
.governance-section,
.designer-board-section,
.error-log-cluster-panel,
.battle-publish-card {
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface);
  box-shadow: none;
}

.panel:hover,
.workspace-card:hover,
.management-card:hover,
.recruit-dashboard-card:hover,
.recruit-report-card:hover,
.governance-section:hover,
.designer-board-section:hover {
  border-color: var(--ui-border);
  box-shadow: none;
}

.ui-section {
  min-width: 0;
  overflow: hidden;
}

.ui-section__head,
.panel-header,
.management-card-title,
.recruit-output-heading,
.anchor-signing-section-head,
.designer-board-title {
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ui-border);
  background: #fff;
  color: var(--ui-text);
  box-shadow: none;
}

.ui-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ui-section__head h3,
.ui-section__head p {
  margin: 0;
}

.ui-section__head h3 {
  font-size: 15px;
  font-weight: 650;
}

.ui-section__head p {
  margin-top: 5px;
  color: var(--ui-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ui-section__body {
  padding: 16px;
}

/* One tab treatment for management modules: plain text and one blue underline. */
.ui-tabs,
.recruit-tabs,
.battle-tabs,
.control-tabs,
.drawer-tabs,
.designer-tabs,
.recruit-report-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-height: 43px;
  margin: 0 0 16px;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--ui-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

.ui-tabs::-webkit-scrollbar,
.recruit-tabs::-webkit-scrollbar,
.battle-tabs::-webkit-scrollbar,
.control-tabs::-webkit-scrollbar,
.drawer-tabs::-webkit-scrollbar,
.designer-tabs::-webkit-scrollbar,
.recruit-report-tabs::-webkit-scrollbar {
  display: none;
}

.ui-tab,
.recruit-tab,
.battle-tab,
.control-tab,
.drawer-tab,
.recruit-report-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 16px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ui-text-muted);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
}

.ui-tab:hover,
.recruit-tab:hover,
.battle-tab:hover,
.control-tab:hover,
.drawer-tab:hover,
.recruit-report-tab:hover {
  border-color: transparent;
  background: transparent;
  color: var(--ui-text);
  box-shadow: none;
}

.ui-tab.active,
.recruit-tab.active,
.battle-tab.active,
.control-tab.active,
.drawer-tab.active,
.recruit-report-tab.active {
  border-color: transparent;
  border-bottom-color: var(--ui-primary);
  background: transparent;
  color: var(--ui-primary);
  box-shadow: none;
  font-weight: 650;
}

#battleView .battle-tabs .battle-tab {
  min-height: 44px;
  padding: 9px 16px 11px;
  font-size: 14px;
  font-weight: 600;
}

/* KPI summaries keep one neutral card style; color belongs to status, not modules. */
.ui-kpi-grid,
.analysis-kpi-grid,
.recruit-result-kpi-row,
.battle-sheet-stats,
.designer-summary-grid,
.asset-summary-grid {
  display: grid;
  gap: 12px;
}

.ui-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recruit-rank-switch {
  display: none;
}

.battle-mobile-mode-switch {
  display: none;
}

#battleView .battle-platform-toggle {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #91caff;
  background: #e6f4ff;
  color: #0958d9;
  font-weight: 650;
  line-height: 30px;
  white-space: nowrap;
}

#battleView .battle-platform-toggle:hover {
  border-color: #69b1ff;
  background: #bae0ff;
  color: #003eb3;
}

#battleView .battle-edit-table th {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

#battleView .battle-platform-group-th,
#battleView .battle-progress-group-th {
  padding: 7px 10px;
}

#battleView .battle-group-head {
  display: grid;
  gap: 5px;
  min-width: 0;
}

#battleView .battle-group-head > strong {
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

#battleView .battle-group-head-columns {
  display: grid;
  align-items: center;
  min-width: 0;
  color: var(--ui-text-muted);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

#battleView .battle-platform-group-head .battle-group-head-columns {
  grid-template-columns: minmax(64px, 0.7fr) minmax(112px, 1.2fr) minmax(84px, 0.8fr) minmax(68px, 0.8fr);
  gap: 5px;
}

#battleView .battle-progress-group-head .battle-group-head-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#battleView .battle-edit-table td,
#battleView .battle-edit-table input:not([type="checkbox"]),
#battleView .battle-edit-table select {
  font-size: 13px;
  line-height: 1.4;
}

#battleView .battle-platform-metric-row strong,
#battleView .battle-platform-name-input {
  font-size: 13px;
  line-height: 1.35;
}

#battleView .battle-platform-summary > span {
  font-size: 13px;
  line-height: 1.35;
}

#battleView .battle-platform-summary strong {
  font-size: 13px;
  font-weight: 650;
}

#battleView .battle-edit-table .record-action-btn,
#battleView .battle-edit-table .btn {
  font-size: 13px;
  line-height: 1.35;
}

#battleView .battle-platform-metric-row input,
#battleView .battle-platform-editor-actions .btn {
  box-sizing: border-box;
  font-family: inherit;
  letter-spacing: 0;
  -webkit-appearance: none;
  appearance: none;
}

#battleView .battle-platform-metric-row input {
  height: var(--ui-control-height-sm);
  min-height: var(--ui-control-height-sm);
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#battleView .battle-platform-metric-row [data-battle-platform-field="gmv"] {
  min-width: 112px;
}

#battleView .battle-platform-metric-row [data-battle-platform-field="duration"] {
  min-width: 84px;
}

#battleView .battle-platform-metric-row input[type="number"]::-webkit-inner-spin-button,
#battleView .battle-platform-metric-row input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

#battleView .battle-platform-editor-actions,
#battleView .battle-platform-editor-actions .btn {
  min-width: max-content;
  white-space: nowrap;
}

#battleView .battle-platform-editor-actions .btn {
  height: var(--ui-control-height-sm);
  min-height: var(--ui-control-height-sm);
  padding: 0 10px;
  line-height: 1;
}

#battleView .battle-anchor-entry {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

#battleView .battle-anchor-entry select {
  min-width: 0;
}

#battleView .battle-anchor-select {
  width: 18px;
  height: 18px;
  margin: 0 auto;
}

#battleView .battle-month-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
}

#battleView .battle-month-progress > span {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: center;
  min-width: 0;
  padding: 0 8px;
  border-right: 1px solid var(--ui-border);
  font-variant-numeric: tabular-nums;
}

#battleView .battle-month-progress > span:last-child {
  border-right: 0;
}

#battleView .battle-month-progress small {
  grid-column: 1 / -1;
  color: var(--ui-text-muted);
  font-size: 13px;
  line-height: 1.25;
}

#battleView .battle-month-progress strong {
  overflow: hidden;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
}

#battleView .battle-month-progress em {
  color: var(--ui-text-muted);
  font-size: 11px;
  font-style: normal;
}

#battleView .battle-delete-row {
  width: 56px;
  height: 28px;
  min-height: 28px;
  padding: 0 3px;
  color: var(--color-danger);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

#battleView .battle-rank-board {
  display: grid;
  gap: 14px;
}

#battleView .battle-rank-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

#battleView .battle-rank-summary > div {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 13px 16px;
  border-right: 1px solid var(--ui-border);
}

#battleView .battle-rank-summary > div:last-child {
  border-right: 0;
}

#battleView .battle-rank-summary span {
  color: var(--ui-text-muted);
  font-size: 12px;
}

#battleView .battle-rank-summary strong {
  align-self: end;
  color: var(--ui-text);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

#battleView .battle-rank-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  justify-self: start;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #f3f5f8;
}

#battleView .battle-rank-switch button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-text-muted);
  cursor: pointer;
  font-weight: 650;
}

#battleView .battle-rank-switch button.active {
  background: #fff;
  color: var(--ui-primary);
  box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
}

#battleView .battle-rank-panel .ui-table-shell {
  max-height: min(58vh, 620px);
}

#battleView .battle-rank-table {
  min-width: 1080px;
}

#battleView .battle-rank-table th,
#battleView .battle-rank-table td {
  height: 46px;
  padding: 9px 12px;
  white-space: nowrap;
}

#battleView .battle-rank-index {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 700;
}

#battleView .battle-rank-index.top-1,
#battleView .battle-rank-index.top-2,
#battleView .battle-rank-index.top-3 {
  background: #e8f2ff;
  color: var(--ui-primary);
}

#battleView .battle-rank-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
}

#battleView .battle-rank-status.success {
  background: #edf8f1;
  color: #237a45;
}

#battleView .battle-rank-status.warning {
  background: #fff7e6;
  color: #ad6800;
}

#battleView .battle-rank-status.danger {
  background: #fff1f0;
  color: #c53030;
}

#battleView .battle-rank-status.muted {
  background: #f1f3f5;
  color: var(--ui-text-muted);
}

#battleView .battle-rank-empty {
  padding: 34px 16px !important;
  color: var(--ui-text-muted);
  text-align: center !important;
}

#battleView .battle-rank-secondary {
  margin-top: 16px;
  border-top: 1px solid var(--ui-border);
}

#battleView .battle-rank-secondary > summary {
  padding: 14px 2px;
  color: var(--ui-text-muted);
  cursor: pointer;
  font-weight: 650;
}

@media (min-width: 1760px) {
  #battleView col[data-battle-role="anchor"] {
    width: 160px !important;
  }

  #battleView col[data-battle-role="platform"] {
    width: 280px !important;
  }

  #battleView col[data-battle-role="progress"] {
    width: 360px !important;
  }
}

@media (min-width: 761px) {
  #battleView .battle-platform-cell {
    min-width: 560px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  #battleView .battle-platform-content.is-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  #battleView .battle-platform-content.is-open .battle-platform-editor {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  #battleView .battle-platform-content.is-open .battle-platform-editor-head {
    display: none;
  }

  #battleView .battle-platform-content.is-open .battle-platform-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
  }

  #battleView .battle-platform-content.is-open .battle-platform-metric-row {
    grid-template-columns: minmax(64px, 0.7fr) minmax(112px, 1.2fr) minmax(84px, 0.8fr) 28px;
    gap: 5px;
    min-width: 0;
    margin: 0;
  }

  #battleView .battle-platform-content.is-open .battle-platform-metric-row > span:last-child {
    display: none;
  }

  #battleView .battle-platform-content.is-open .battle-platform-editor-actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
  }

  #battleView .battle-platform-content.is-open .battle-platform-summary {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    min-width: 82px;
    min-height: 0;
    padding-left: 10px;
    border-left: 1px solid var(--ui-border);
  }

  #battleView .battle-platform-content.is-open .battle-platform-summary .record-action-btn {
    display: none;
  }

  #battleView .battle-platform-content.is-open .battle-platform-summary > span {
    font-size: 13px;
  }

  #battleView .battle-platform-content.is-open .battle-platform-summary strong {
    font-size: 13px;
  }
}

.recruit-rank-panel {
  min-width: 0;
}

.analysis-mobile-detail-switch,
.analysis-mobile-rank-switch {
  display: none;
}

#analysisOperationsPanel .analysis-mobile-detail-switch,
#analysisOperationsPanel .analysis-mobile-rank-switch {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 420px);
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #f3f5f8;
}

#analysisOperationsPanel .analysis-mobile-detail-switch {
  display: grid;
}

#analysisOperationsPanel .analysis-mobile-rank-switch {
  display: none;
}

#analysisOperationsPanel .analysis-mobile-rank-switch.is-mobile-active {
  display: grid;
}

#analysisOperationsPanel .analysis-mobile-detail-switch button,
#analysisOperationsPanel .analysis-mobile-rank-switch button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

#analysisOperationsPanel .analysis-mobile-detail-switch button.active,
#analysisOperationsPanel .analysis-mobile-rank-switch button.active {
  background: #fff;
  color: var(--ui-primary);
  box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
}

#analysisOperationsPanel [data-analysis-mobile-panel] {
  display: none;
}

#analysisOperationsPanel [data-analysis-mobile-panel].is-mobile-active {
  display: block;
}

#analysisOperationsPanel [data-analysis-mobile-panel="rank"].is-mobile-active {
  display: none;
}

#analysisOperationsPanel [data-analysis-mobile-panel="rank"].is-mobile-active.is-mobile-rank-active {
  display: block;
  grid-column: 1 / -1;
}

.ui-kpi-card {
  display: grid;
  align-content: center;
  gap: 5px;
}

.ui-kpi-card span,
.ui-kpi-card small {
  color: var(--ui-text-muted);
  font-size: 12px;
}

.ui-kpi-card strong {
  color: var(--ui-text);
  font-size: 22px;
  line-height: 1.25;
}

.ui-kpi-card,
.company-kpi-card,
.analysis-kpi-card,
.recruit-result-kpi-card,
.battle-sheet-stat,
.error-log-summary-card,
.workspace-overview-card,
.monthly-summary-grid > div {
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.company-kpi-card:hover,
.analysis-kpi-card:hover,
.recruit-result-kpi-card:hover,
.workspace-overview-card:hover {
  border-color: var(--ui-border-strong);
  background: #fff;
  box-shadow: none;
  transform: none;
}

.analysis-period-overview .company-kpi-row.all {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.analysis-period-overview .company-kpi-card {
  justify-items: center;
  text-align: center;
  cursor: default;
}

.analysis-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}

.analysis-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.analysis-source-chip.primary {
  border-color: #b8d4ff;
  color: #0f67d8;
  background: #eff6ff;
}

.analysis-source-chip.warning {
  border-color: #f5d18b;
  color: #a85d00;
  background: #fff8e8;
}

.analysis-table-muted {
  color: #8a94a6;
  background: #fafbfc;
  font-weight: 600;
}

#analysisView .analysis-company-comparison-table {
  min-width: 1540px;
}

#analysisView .analysis-company-comparison-table td,
#analysisView .analysis-company-comparison-table th {
  text-align: center;
}

#analysisView .analysis-company-comparison-table td:nth-child(2),
#analysisView .analysis-company-comparison-table th:nth-child(2) {
  text-align: left;
}

#monthly-snapshotView .monthly-snapshot-table {
  min-width: 1680px;
}

#monthly-snapshotView .monthly-snapshot-table input[type="number"] {
  min-width: 118px;
  text-align: center;
}

@media (max-width: 1680px) {
  .analysis-period-overview .company-kpi-row.all {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .analysis-period-overview .company-kpi-row.all {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

.analysis-period-overview .company-kpi-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.analysis-period-overview .company-kpi-title small {
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 500;
}

.analysis-comparison {
  color: var(--ui-text-muted);
  font-size: 12px;
  font-style: normal;
}

.analysis-comparison.up { color: var(--ui-primary); }
.analysis-comparison.down { color: #b45309; }
.analysis-comparison.flat,
.analysis-comparison.muted { color: var(--ui-text-muted); }

.recruit-result-kpi-card {
  align-items: flex-start;
  justify-content: center;
}

.company-kpi-card span,
.analysis-kpi-card span,
.recruit-result-kpi-card .kpi-label,
.battle-sheet-stat span,
.error-log-summary-card span,
.workspace-overview-card span {
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 500;
}

.company-kpi-card strong,
.analysis-kpi-card strong,
.recruit-result-kpi-card .kpi-value,
.battle-sheet-stat strong,
.error-log-summary-card strong,
.workspace-overview-card strong {
  color: var(--ui-text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

/* Remove decorative color blocks from operational boards. */
.company-hero {
  background: #fff;
}

.designer-board-title {
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-text);
  text-align: left;
}

.designer-board-title strong {
  font-size: 16px;
  font-weight: 650;
}

.designer-board-title span {
  color: var(--ui-text-muted);
  font-size: 12px;
}

.designer-board-table tbody tr:nth-child(odd) td,
.designer-board-table tbody tr:nth-child(even) td,
.designer-board-table tfoot th,
.designer-board-table tfoot td {
  border-color: var(--ui-border);
  background: #fff;
}

.designer-board-table thead th {
  border-color: var(--ui-border);
  background: var(--ui-surface-muted);
  color: #526079;
  font-size: 12px;
  font-weight: 650;
}

.asset-equipment-view-toolbar {
  padding: 0;
  border: 0;
  background: transparent;
}

/* Wide editable sheets scroll inside their frame instead of widening the page. */
#battleView,
#battleView .profile-page,
#battleFormPanel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#battleView .battle-sheet-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.analysis-talent-detail-switch,
.analysis-talent-rank-switch {
  display: none;
}

.analysis-talent-quality small {
  display: block;
  margin-top: 4px;
  color: var(--ui-text-muted);
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  #battleView .battle-rank-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #battleView .battle-rank-summary > div:nth-child(2) {
    border-right: 0;
  }

  #battleView .battle-rank-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ui-border);
  }

  #battleView .battle-rank-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  #battleView .battle-rank-switch button {
    padding: 0 8px;
  }

  #battleView .battle-anchor-select {
    display: none;
  }

  #battleView .battle-anchor-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="platform-metrics"] {
    display: block;
  }

  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="platform-metrics"]::before {
    display: block;
    margin-bottom: 8px;
  }

  #battleView .battle-platform-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #battleView .battle-platform-metric-row,
  #battleView .battle-platform-editor-head {
    grid-template-columns: minmax(64px, 0.7fr) minmax(112px, 1.2fr) minmax(84px, 0.8fr) 28px;
  }

  #battleView .battle-platform-editor {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .ui-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ui-toolbar {
    width: 100%;
  }

  .ui-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  dialog,
  .ui-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .dialog-header,
  .modal-header,
  .ui-modal__header,
  .dialog-body,
  .modal-body,
  .ui-modal__body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .dialog-footer,
  .modal-footer,
  .ui-modal__footer {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .dialog-footer .btn,
  .dialog-footer .primary-btn,
  .dialog-footer .secondary-btn,
  .modal-footer .btn,
  .modal-footer .primary-btn,
  .modal-footer .secondary-btn {
    flex: 1 1 0;
    min-width: 0;
  }

  /* Mobile management views prioritize decisions before long-form detail. */
  #analysisView .analysis-page,
  #recruitView .profile-page {
    gap: 12px;
  }

  #analysisView .analysis-section-tabs {
    width: 100%;
  }

  #analysisView .analysis-filterbar,
  #recruitReportPanel .recruit-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fff;
  }

  #analysisView .analysis-filterbar .field,
  #analysisView .analysis-filterbar .btn,
  #recruitReportPanel .recruit-toolbar .field,
  #recruitReportPanel .recruit-toolbar .btn {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  #analysisView #analysisRefreshButton,
  #recruitReportPanel #recruitReportExportButton {
    grid-column: 1 / -1;
  }

  #analysisOperationsPanel {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #analysisOperationsPanel > #analysisCompanyOverviewHost {
    order: 1;
  }

  #analysisOperationsPanel > .analysis-grid {
    order: 2;
  }

  #analysisOperationsPanel > #analysisDataHealthHost {
    order: 3;
  }

  #analysisOperationsPanel .analysis-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }

  #analysisOperationsPanel .analysis-card {
    width: 100%;
    height: auto;
  }

  #analysisOperationsPanel .analysis-card--risk { order: 1; }
  #analysisOperationsPanel .analysis-card--company { order: 2; }
  #analysisOperationsPanel .analysis-card--anchor { order: 3; }
  #analysisOperationsPanel .analysis-card--agent { order: 4; }
  #analysisOperationsPanel .analysis-card--trend { order: 5; }

  #analysisOperationsPanel .analysis-company-overview .company-kpi-row,
  #analysisView .analysis-kpi-grid,
  #recruitView .recruit-result-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #analysisOperationsPanel .analysis-company-overview .company-kpi-row {
    padding: 12px;
  }

  #analysisOperationsPanel .analysis-company-overview .company-kpi-card,
  #analysisView .analysis-kpi-card,
  #recruitView .recruit-result-kpi-card {
    min-height: 88px;
    padding: 12px;
    gap: 5px;
    text-align: left;
  }

  #analysisOperationsPanel .analysis-company-overview .company-kpi-card strong,
  #analysisView .analysis-kpi-card strong,
  #recruitView .recruit-result-kpi-card .kpi-value {
    font-size: 21px;
  }

  #analysisOperationsPanel .analysis-company-overview .company-kpi-card em,
  #analysisView .analysis-kpi-card small,
  #recruitView .recruit-result-kpi-card small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.4;
  }

  #analysisOperationsPanel .analysis-mobile-detail-switch,
  #analysisOperationsPanel .analysis-mobile-rank-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #f3f5f8;
  }

  #analysisOperationsPanel .analysis-mobile-detail-switch {
    display: grid;
    order: 2;
  }

  #analysisOperationsPanel .analysis-mobile-rank-switch {
    display: none;
    order: 3;
  }

  #analysisOperationsPanel .analysis-mobile-rank-switch.is-mobile-active {
    display: grid;
  }

  #analysisOperationsPanel .analysis-mobile-detail-switch button,
  #analysisOperationsPanel .analysis-mobile-rank-switch button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text-muted);
    font-weight: 650;
    cursor: pointer;
  }

  #analysisOperationsPanel .analysis-mobile-detail-switch button.active,
  #analysisOperationsPanel .analysis-mobile-rank-switch button.active {
    background: #fff;
    color: var(--ui-primary);
    box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
  }

  #analysisOperationsPanel > .analysis-grid {
    order: 4;
  }

  #analysisOperationsPanel > #analysisDataHealthHost {
    order: 5;
  }

  #analysisOperationsPanel [data-analysis-mobile-panel] {
    display: none;
  }

  #analysisOperationsPanel [data-analysis-mobile-panel].is-mobile-active {
    display: block;
  }

  #analysisOperationsPanel [data-analysis-mobile-panel="rank"].is-mobile-active {
    display: none;
  }

  #analysisOperationsPanel [data-analysis-mobile-panel="rank"].is-mobile-active.is-mobile-rank-active {
    display: block;
  }

  #analysisOperationsPanel .analysis-card,
  #analysisOperationsPanel .analysis-health-panel,
  #analysisTalentPanel .analysis-talent-intro,
  #analysisTalentPanel .analysis-talent-section,
  #analysisTalentPanel .analysis-talent-quality,
  #recruitView .recruit-output-panel,
  #recruitView .recruit-dashboard-card {
    border-radius: 8px;
    box-shadow: none;
  }

  #analysisOperationsPanel .analysis-card-header,
  #analysisTalentPanel .analysis-talent-section-head,
  #recruitView .recruit-output-heading,
  #recruitView .recruit-card-heading {
    min-height: 0;
    padding: 12px;
  }

  #analysisOperationsPanel .analysis-card-header span,
  #analysisTalentPanel .analysis-talent-section-head > span,
  #analysisTalentPanel .analysis-talent-table-head > span,
  #recruitView .recruit-output-heading > span {
    white-space: normal;
    text-align: right;
  }

  #analysisOperationsPanel .analysis-health-header,
  #analysisOperationsPanel .analysis-health-grid,
  #analysisOperationsPanel .analysis-health-missing {
    padding: 12px;
  }

  #analysisOperationsPanel .analysis-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #analysisOperationsPanel .analysis-health-metric,
  #analysisOperationsPanel .analysis-health-metric:first-child,
  #analysisOperationsPanel .analysis-health-metric:last-child {
    min-height: 82px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
  }

  #analysisOperationsPanel .analysis-health-metric + .analysis-health-metric {
    border-left: 1px solid var(--ui-border);
  }

  #analysisTalentPanel .analysis-talent {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #analysisTalentPanel .analysis-talent-intro { order: 1; }
  #analysisTalentPanel .analysis-talent-kpis { order: 2; }
  #analysisTalentPanel .analysis-talent-detail-switch { order: 3; }
  #analysisTalentPanel .analysis-talent-section--recruitment { order: 4; }
  #analysisTalentPanel .analysis-talent-section--signing { order: 4; }
  #analysisTalentPanel .analysis-talent-quality { order: 4; }

  #analysisTalentPanel .analysis-talent-intro {
    padding: 14px;
  }

  #analysisTalentPanel .analysis-talent-intro h3 {
    font-size: 16px;
  }

  #analysisTalentPanel .analysis-talent-actions {
    display: none;
  }

  #analysisTalentPanel .analysis-talent-detail-switch,
  #analysisTalentPanel .analysis-talent-rank-switch {
    display: grid;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #f3f5f8;
  }

  #analysisTalentPanel .analysis-talent-detail-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #analysisTalentPanel .analysis-talent-rank-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 12px 12px;
  }

  #analysisTalentPanel .analysis-talent-detail-switch button,
  #analysisTalentPanel .analysis-talent-rank-switch button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text-muted);
    font-weight: 650;
    cursor: pointer;
  }

  #analysisTalentPanel .analysis-talent-detail-switch button.active,
  #analysisTalentPanel .analysis-talent-rank-switch button.active {
    background: #fff;
    color: var(--ui-primary);
    box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
  }

  #analysisTalentPanel [data-talent-rank-panel] {
    display: none;
  }

  #analysisTalentPanel [data-talent-rank-panel].is-mobile-active {
    display: block;
  }

  #analysisTalentPanel [data-talent-section-panel] {
    display: none;
  }

  #analysisTalentPanel [data-talent-section-panel].is-mobile-active {
    display: block;
  }

  #analysisTalentPanel .analysis-talent-table {
    padding: 12px;
  }

  #analysisTalentPanel .analysis-talent-table + .analysis-talent-table {
    border-top: 1px solid var(--ui-border);
  }

  #analysisTalentPanel .analysis-talent-quality {
    padding: 12px;
  }

  #analysisTalentPanel .analysis-talent-quality > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  #analysisTalentPanel .analysis-talent-quality > div:last-child span {
    padding: 9px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    background: #fff;
    white-space: normal;
  }

  #analysisView table[data-mobile-rank-table],
  #analysisView table[data-mobile-risk-table] {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  #analysisView table[data-mobile-rank-table] thead,
  #analysisView table[data-mobile-risk-table] thead {
    display: none;
  }

  #analysisView table[data-mobile-rank-table] tbody,
  #analysisView table[data-mobile-risk-table] tbody,
  #analysisView table[data-mobile-rank-table] tr,
  #analysisView table[data-mobile-risk-table] tr,
  #analysisView table[data-mobile-rank-table] td,
  #analysisView table[data-mobile-risk-table] td {
    display: block;
    width: 100%;
  }

  #analysisView table[data-mobile-rank-table] tr,
  #analysisView table[data-mobile-risk-table] tr {
    padding: 8px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #fff;
  }

  #analysisView table[data-mobile-rank-table] td,
  #analysisView table[data-mobile-risk-table] td {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    align-items: center;
    min-height: 32px;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    text-align: right;
    white-space: normal;
  }

  #analysisView table[data-mobile-rank-table] td::before,
  #analysisView table[data-mobile-risk-table] td::before {
    content: attr(data-label);
    color: var(--ui-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
  }

  #analysisView table[data-mobile-rank-table] td > *,
  #analysisView table[data-mobile-risk-table] td > * {
    justify-self: end;
  }

  #analysisView table[data-mobile-rank-table] .recruit-empty-cell {
    display: block;
    padding: 24px 12px;
    text-align: center;
  }

  #analysisView table[data-mobile-rank-table] .recruit-empty-cell::before {
    display: none;
  }

  #analysisView table[data-mobile-risk-table] tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "status item count"
      "hint hint hint";
    align-items: center;
    gap: 6px 10px;
    padding: 10px 12px;
  }

  #analysisView table[data-mobile-risk-table] td {
    display: block;
    width: auto;
    min-height: 0;
    padding: 0;
    text-align: left;
  }

  #analysisView table[data-mobile-risk-table] td::before {
    display: none;
  }

  #analysisView table[data-mobile-risk-table] td:nth-child(1) { grid-area: status; }
  #analysisView table[data-mobile-risk-table] td:nth-child(2) { grid-area: item; }
  #analysisView table[data-mobile-risk-table] td:nth-child(3) { grid-area: hint; }
  #analysisView table[data-mobile-risk-table] td:nth-child(4) { grid-area: count; }

  #analysisView table[data-mobile-risk-table] .analysis-risk-hint {
    grid-column: 1 / -1;
    color: var(--ui-text-muted);
    font-size: 12px;
  }

  #analysisView table[data-mobile-risk-table] .analysis-risk-row.success .analysis-risk-hint {
    display: none;
  }

  #analysisView table[data-mobile-risk-table] .analysis-risk-row.success {
    display: none;
  }

  #analysisView table[data-mobile-risk-table] tbody:not(:has(.analysis-risk-row.warning, .analysis-risk-row.danger))::after {
    content: "当前暂无风险";
    display: block;
    padding: 24px 12px;
    color: var(--ui-text-muted);
    text-align: center;
  }

  #analysisView table[data-mobile-risk-table] .number-cell {
    justify-self: end;
  }

  #analysisView table[data-mobile-rank-table] tbody tr:nth-child(n + 6) {
    display: none;
  }

  #analysisView .analysis-operations-table-shell,
  #analysisView .analysis-talent-table-shell {
    max-height: none;
    overflow: visible;
  }

  #analysisOperationsPanel .analysis-trend,
  #analysisOperationsPanel .analysis-rank-list,
  #analysisOperationsPanel .analysis-risk-list,
  #analysisOperationsPanel .empty-state {
    min-height: 0;
  }

  #analysisOperationsPanel .empty-state {
    padding: 28px 16px;
  }

  #recruitView .recruit-result-kpi-row {
    margin-bottom: 12px;
  }

  #recruitView .recruit-rank-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 10px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #f3f5f8;
  }

  #recruitView .recruit-rank-switch button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text-muted);
    font-weight: 650;
    cursor: pointer;
  }

  #recruitView .recruit-rank-switch button.active {
    background: #fff;
    color: var(--ui-primary);
    box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
  }

  #recruitView .recruit-rank-panel {
    display: none;
  }

  #recruitView .recruit-rank-panel.is-active {
    display: block;
  }

  #recruitView .recruit-output-grid,
  #recruitView .recruit-process-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
  }

  #recruitView .recruit-output-table-shell {
    max-height: none;
    padding: 0 10px 10px;
    overflow: visible;
  }

  #recruitView table.recruit-output-table[data-responsive-card-table] {
    min-width: 0;
    border-spacing: 0 8px;
  }

  #recruitView table.recruit-output-table[data-responsive-card-table] tr {
    padding: 8px 10px;
    border-color: var(--ui-border);
    border-radius: 8px;
    box-shadow: none;
  }

  #recruitView table.recruit-output-table[data-responsive-card-table] td {
    min-height: 32px;
    padding: 5px 2px;
    text-align: right;
  }

  #recruitView table.recruit-output-table[data-responsive-card-table] td > * {
    justify-self: end;
  }

  #recruitView table[data-responsive-card-table] .recruit-empty-cell {
    display: block;
    padding: 24px 12px;
    text-align: center;
  }

  #recruitView table[data-responsive-card-table] .recruit-empty-cell::before {
    display: none;
  }

  #recruitView table.recruit-detail-table[data-responsive-card-table] {
    min-width: 0;
  }

  #recruitView table.recruit-detail-table[data-responsive-card-table] tr {
    border-color: var(--ui-border);
    border-radius: 8px;
    box-shadow: none;
  }

  #recruitView table.recruit-output-table[data-mobile-rank-table] tbody tr:nth-child(n + 6) {
    display: none;
  }

  #recruitView .recruit-report-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  #recruitView .recruit-report-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #recruitView .recruit-detail-heading {
    margin-top: 14px;
  }

  #battleView .battle-sheet-wrap .battle-edit-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    box-shadow: none;
  }

  #battleView .battle-mobile-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 12px 0 10px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #f3f5f8;
  }

  #battleView .battle-mobile-mode-switch button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text-muted);
    font-weight: 650;
    cursor: pointer;
  }

  #battleView .battle-mobile-mode-switch button.active {
    background: #fff;
    color: var(--ui-primary);
    box-shadow: 0 1px 3px rgb(15 23 42 / 10%);
  }

  #battleView .battle-bulk-toolbar {
    display: none;
  }

  #battleView #battleFormPanel[data-mobile-battle-mode="daily"] [data-battle-section="monthly"],
  #battleView #battleFormPanel[data-mobile-battle-mode="daily"] [data-battle-cell="select"],
  #battleView #battleFormPanel[data-mobile-battle-mode="daily"] [data-battle-cell="stage"],
  #battleView #battleFormPanel[data-mobile-battle-mode="daily"] [data-battle-cell="target"],
  #battleView #battleFormPanel[data-mobile-battle-mode="daily"] [data-battle-cell="month-progress"],
  #battleView #battleFormPanel[data-mobile-battle-mode="monthly"] [data-battle-section="daily"],
  #battleView #battleFormPanel[data-mobile-battle-mode="monthly"] [data-battle-cell="select"],
  #battleView #battleFormPanel[data-mobile-battle-mode="monthly"] [data-battle-cell="status"] {
    display: none;
  }

  #battleView .battle-sheet-wrap .battle-edit-table td {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    align-items: stretch;
    gap: 5px;
    min-height: 0;
    padding: 9px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    background: #fff;
  }

  #battleView .battle-sheet-wrap .battle-edit-table td::before {
    min-width: 0;
    font-weight: 600;
  }

  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="anchor"],
  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="platform-metrics"],
  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="month-progress"],
  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="status"],
  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="action"],
  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="fill-status"] {
    grid-column: 1 / -1;
  }

  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="action"] {
    display: flex;
    justify-content: flex-end;
    border-color: transparent;
    padding: 2px 0 0;
  }

  #battleView .battle-sheet-wrap .battle-edit-table td[data-battle-cell="action"]::before {
    display: none;
  }

  #battleView .battle-sheet-wrap .battle-edit-table .battle-empty-row {
    display: block;
  }

  #battleView .battle-sheet-wrap .battle-edit-table .battle-empty-row td {
    display: block;
    border: 0;
  }

  #battleView .battle-sheet-wrap .battle-edit-table .battle-empty-row td::before {
    display: none;
  }
}
