/* Desktop density. Keep the existing mobile layout and touch controls below 993px. */
@media (min-width: 993px) {
  :root {
    font-size: 87.5%;
    --portal-sidebar-width: 200px;
    --portal-sidebar-collapsed-width: 52px;
    --portal-topbar-height: 48px;
    --portal-page-padding: 16px;
  }

  body.support-admin-app {
    font-size: 0.928571rem;
    line-height: 1.45;
  }

  .sidebar {
    width: var(--portal-sidebar-width);
    padding-top: var(--portal-topbar-height);
  }

  .sidebar .logo-area,
  .topbar {
    height: var(--portal-topbar-height);
  }

  .topbar {
    padding-block: 4px;
  }

  .topbar,
  .content {
    margin-left: var(--portal-sidebar-width);
  }

  .content {
    padding: calc(var(--portal-topbar-height) + 20px) var(--portal-page-padding) var(--portal-page-padding);
  }

  .sidebar.collapsed {
    width: var(--portal-sidebar-collapsed-width);
  }

  .topbar.full,
  .content.full {
    margin-left: var(--portal-sidebar-collapsed-width);
  }

  .sidebar-logo-image {
    max-width: 160px;
    height: 38px;
  }

  .sidebar-collapse-logo {
    width: 40px;
    height: 34px;
  }

  .sidebar .nav-link {
    width: calc(100% - 16px);
    margin: 1px 8px;
    padding: 6px 8px;
    gap: 9px;
    font-size: 0.892857rem;
  }

  .sidebar .nav-link .ti {
    width: 16px;
    font-size: 16px;
  }

  .sidebar.collapsed .nav-link {
    width: 100%;
    margin: 0;
    padding: 7px 0;
    justify-content: center;
    gap: 0;
  }

  .sidebar .nav > li.px-4 {
    padding-inline: 16px !important;
  }

  #page-title {
    font-size: 1.571429rem !important;
  }

  .mb-6 {
    margin-bottom: 1.5rem !important;
  }

  .py-10 {
    padding-top: calc(var(--portal-topbar-height) + 20px) !important;
    padding-bottom: var(--portal-page-padding) !important;
  }

  .card {
    --bs-card-spacer-x: 1.142857rem;
    --bs-card-spacer-y: 1.142857rem;
  }

  .stat-card .card-body,
  .table-card .card-body,
  .editor-card .card-body {
    padding: 1.142857rem;
  }

  .section-head {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .btn {
    --bs-btn-font-size: 0.928571rem;
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-padding-x: 0.65rem;
  }

  .btn-sm {
    --bs-btn-font-size: 0.875rem;
    --bs-btn-padding-y: 0.25rem;
    --bs-btn-padding-x: 0.5rem;
  }

  .form-control,
  .form-select {
    font-size: 0.928571rem;
  }

  .form-control-sm,
  .form-select-sm {
    min-height: 28px;
    font-size: 0.875rem;
  }

  .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
  }

  .table {
    font-size: 0.857143rem;
    line-height: 1.4;
  }

  .table-sm > :not(caption) > * > * {
    padding: 0.25rem 0.4rem;
  }

  .table-pill {
    min-width: 66px;
    padding: 0.25rem 0.5rem;
  }

  .knowledge-page-buttons .btn,
  .crash-report-page-buttons .btn,
  .release-note-page-buttons .btn {
    min-width: 28px;
  }

  .release-note-page-buttons .btn,
  .release-note-actions .btn {
    height: 28px;
  }

  .release-note-actions .btn {
    width: 28px;
  }

  .portal-theme-switch {
    width: 72px;
    height: 30px;
    flex-basis: 72px;
  }

  .theme-switch-thumb {
    width: 24px;
    height: 24px;
    top: 2px;
    font-size: 15px;
  }

  .theme-switch-light,
  .theme-switch-dark {
    font-size: 15px;
  }

  [data-bs-theme="dark"] .theme-switch-thumb {
    transform: translateX(40px);
  }

  .modal {
    --bs-modal-width: 440px;
  }

  .modal-sm {
    --bs-modal-width: 280px;
  }

  .modal-lg,
  .modal-xl {
    --bs-modal-width: 720px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 0.9rem;
  }

  #confirm-modal .modal-body {
    padding: 2rem !important;
  }

  #knowledge-editor-body .jodit-container,
  #release-note-editor-body .jodit-container,
  .jodit-dialog,
  .jodit-popup {
    --jd-font-size-default: 13px;
    --jd-padding-default: 6px;
    --jd-input-height: 28px;
    --jd-button-icon-size: 12px;
    font-size: 13px;
  }

  .report-page {
    gap: 1rem;
  }

  .report-header h2 {
    font-size: 1.571429rem;
  }

  .report-kpi,
  .report-panel {
    padding: 1rem;
  }

  .report-donut {
    width: 128px;
    height: 128px;
  }

  .report-donut > div {
    width: 96px;
    height: 96px;
  }

  .quick-guide-workspace {
    min-height: 440px;
  }

  .quick-guide-workspace-bar {
    min-height: 52px;
  }

  .quick-guide-editor-topbar {
    min-height: 44px;
  }

  .internal-dock-button,
  .live-dock-button {
    width: 44px;
    height: 44px;
  }

  .internal-chat-list-head,
  .internal-thread-head,
  .internal-dock-head {
    min-height: 50px;
  }

  .ka-header {
    padding: 1rem 1.142857rem;
  }

  .ka-metrics {
    margin-inline: 1.142857rem;
    padding-block: 0.8rem;
  }

  .ka-chart-grid {
    gap: 0.75rem;
    padding: 1rem 1.142857rem;
  }

  .ka-chart-panel {
    padding: 1rem;
  }

  .ka-donut {
    width: 120px;
    flex-basis: 120px;
  }

  .ka-donut-layout {
    min-height: 128px;
  }

  .ka-icon-button {
    width: 28px;
    height: 28px;
  }

  .ka-selects .form-select {
    min-height: 30px;
  }

  .knowledge-detail-drawer {
    width: min(480px, 100vw);
  }

  .ka-reset-dialog {
    width: min(400px, calc(100vw - 2rem));
  }

  /* Keep chart captions and action explanations readable as the surrounding layout shrinks. */
  .ka-chart-panel header p,
  .ka-chart-note,
  .ka-chart-legend,
  .ka-chart-legend span,
  .ka-action-hint,
  .ka-action-byline,
  .ka-list-count,
  .ka-date,
  .ka-small,
  .ka-drawer-header p,
  .ka-record-heading time {
    font-size: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .modal-xl {
    --bs-modal-width: 1000px;
  }
}
