/* Intelligence station desktop three-column layout:
 * Left: filter/search sidebar (.sidebar)
 * Middle: vertical category navigation (.top-navigation)
 * Right: intelligence feed content (.timeline-content)
 */
@media (min-width: 1101px) {
  html body .intelligence-station.intelligence-station {
    display: grid;
    grid-template-columns: clamp(236px, 20vw, 296px) clamp(156px, 14vw, 204px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "sidebar nav content";
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  html body .intelligence-station.intelligence-station > .main-content {
    display: contents;
  }

  html body .intelligence-station.intelligence-station .sidebar {
    grid-area: sidebar;
    flex: none;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    padding: 20px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    border-left: none;
    border-right: 1px solid #e5eaf1;
    box-shadow: 1px 0 6px rgba(15, 23, 42, 0.04);
  }

  html body .intelligence-station.intelligence-station > .top-navigation {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    background-color: #fff;
    border-bottom: none;
    border-right: 1px solid #e5eaf1;
    box-shadow: 1px 0 4px rgba(15, 23, 42, 0.03);
  }

  html body .intelligence-station.intelligence-station > .top-navigation::-webkit-scrollbar {
    width: 6px;
  }

  html body .intelligence-station.intelligence-station > .top-navigation::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  html body .intelligence-station.intelligence-station > .top-navigation::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }

  html body .intelligence-station.intelligence-station > .top-navigation::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }

  html body .intelligence-station.intelligence-station > .top-navigation .nav-tab {
    width: 100%;
  }

  html body .intelligence-station.intelligence-station .timeline-content {
    grid-area: content;
    flex: none;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 20px 24px;
  }

  html[data-table-theme='dark'] .intelligence-station.intelligence-station > .top-navigation .nav-tab:hover:not(.active) {
    background: rgba(56, 189, 248, 0.10) !important;
    color: #e0f2fe !important;
  }
}

/* Inline real-time post editor styles */
html body .intelligence-station .post-actions .edit-icon:hover,
html body .intelligence-station .post-actions .edit-icon.active {
  color: #1677ff;
  border-color: #bfdbfe;
  background-color: #eff6ff;
}

html body .intelligence-station .post-inline-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 12px;
  border: 1px solid #d7e3f4;
  border-radius: 10px;
  background-color: #f8fbff;
}

html body .intelligence-station .post-edit-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

html body .intelligence-station .post-edit-title-input {
  flex: 1 1 240px;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background-color: #fff;
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-sizing: border-box;
}

html body .intelligence-station .post-edit-category-select {
  flex: 0 0 168px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background-color: #fff;
  color: #334155;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

html body .intelligence-station .post-edit-content-textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background-color: #fff;
  color: #334155;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.72;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

html body .intelligence-station .post-edit-title-input:focus,
html body .intelligence-station .post-edit-category-select:focus,
html body .intelligence-station .post-edit-content-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
}

html body .intelligence-station .post-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

html body .intelligence-station .post-edit-hint {
  font-size: 12px;
  color: #64748b;
}

html body .intelligence-station .post-edit-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

html body .intelligence-station .post-edit-cancel-btn,
html body .intelligence-station .post-edit-save-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
}

html[data-table-theme='dark'] .intelligence-station .post-actions .edit-icon:hover,
html[data-table-theme='dark'] .intelligence-station .post-actions .edit-icon.active {
  color: #38bdf8 !important;
  border-color: var(--modern-dark-border-accent) !important;
  background: rgba(56, 189, 248, 0.16) !important;
}

html[data-table-theme='dark'] .intelligence-station .post-inline-editor {
  border-color: var(--modern-dark-border);
  background: rgba(18, 24, 39, 0.94);
}

html[data-table-theme='dark'] .intelligence-station :is(
  .post-edit-title-input,
  .post-edit-category-select,
  .post-edit-content-textarea
) {
  border-color: var(--modern-dark-border-hover);
  background: #121827;
  color: #f1f5f9;
}

html[data-table-theme='dark'] .intelligence-station .post-edit-hint {
  color: #94a3b8;
}

/* Inline new post composer card & image uploader (upload + clipboard paste + drag-drop) */
html body .intelligence-station .post-composer-card {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto 16px;
  padding: 16px 18px 14px;
  box-sizing: border-box;
  border: 1.5px solid #93c5fd;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}

html body .intelligence-station .post-composer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

html body .intelligence-station .post-composer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

html body .intelligence-station .post-composer-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

html body .intelligence-station .post-composer-subtitle {
  font-size: 13px;
  color: #64748b;
}

html body .intelligence-station .post-composer-close {
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

html body .intelligence-station .post-composer-close:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

html body .intelligence-station .post-composer-card .post-inline-editor {
  margin: 0;
}

html body .intelligence-station .post-editor-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background-color: #fff;
}

html body .intelligence-station .post-editor-images-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

html body .intelligence-station .post-upload-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background-color: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

html body .intelligence-station .post-upload-trigger:hover {
  background-color: #dbeafe;
  border-color: #93c5fd;
}

html body .intelligence-station .post-editor-images-tip {
  flex: 1 1 200px;
  font-size: 12px;
  color: #64748b;
}

html body .intelligence-station .post-clear-images-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  cursor: pointer;
}

html body .intelligence-station .post-clear-images-btn:hover {
  background: #fee2e2;
}

html body .intelligence-station .post-editor-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

html body .intelligence-station .post-editor-image-thumb {
  position: relative;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #dbe4ef;
  background-color: #f8fafc;
}

html body .intelligence-station .post-editor-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

html body .intelligence-station .post-editor-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html body .intelligence-station .post-editor-image-remove:hover {
  background: #dc2626;
}

html body .intelligence-station .post-editor-image-index {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.68);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

html[data-table-theme='dark'] .intelligence-station .post-composer-card {
  border-color: var(--modern-dark-border-accent) !important;
  background: rgba(13, 19, 34, 0.95) !important;
}

html[data-table-theme='dark'] .intelligence-station .post-composer-subtitle,
html[data-table-theme='dark'] .intelligence-station .post-editor-images-tip {
  color: #94a3b8;
}

html[data-table-theme='dark'] .intelligence-station .post-composer-close {
  border-color: var(--modern-dark-border);
  background: rgba(21, 30, 52, 0.70);
  color: #cbd5e1;
}

html[data-table-theme='dark'] .intelligence-station .post-editor-images {
  border-color: var(--modern-dark-border-hover);
  background: rgba(17, 23, 39, 0.78);
}

html[data-table-theme='dark'] .intelligence-station .post-upload-trigger {
  border-color: var(--modern-dark-border-accent);
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

html[data-table-theme='dark'] .intelligence-station .post-editor-image-thumb {
  border-color: var(--modern-dark-border);
  background: #121827;
}

/* LHB / Stock-workbench unified date selector in intelligence sidebar */
html body .intelligence-station .date-query .intelligence-date-filter {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e9f2;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  color: #6d829b;
}

html body .intelligence-station .date-query .stock-workbench-period {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  margin: 0;
}

html body .intelligence-station .date-query .stock-workbench-select {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 26px 0 10px;
  border: 1px solid #d8e2ee;
  border-radius: 7px;
  outline: 0;
  background: #fff;
  color: #40516a;
  font-size: 13px;
  cursor: pointer;
  box-sizing: border-box;
}

html body .intelligence-station .date-query .stock-workbench-select:focus {
  border-color: #88b8ee;
  box-shadow: 0 0 0 3px rgba(36, 116, 229, 0.1);
}

html body .intelligence-station .date-query .stock-workbench-days {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin-top: 0;
  padding-top: 6px;
  border-top: 1px solid #edf1f6;
}

html body .intelligence-station .date-query .stock-workbench-day {
  min-width: 0;
  height: 24px;
  padding: 0;
  border: 1px solid #dfe6ef;
  border-radius: 5px;
  background: #fff;
  color: #718096;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

html body .intelligence-station .date-query .stock-workbench-day:hover,
html body .intelligence-station .date-query .stock-workbench-day.active {
  border-color: #3d8dec;
  background: #3d8dec;
  color: #fff;
  font-weight: 700;
}

html body .intelligence-station .date-query .intelligence-date-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
  font-size: 11px;
  color: #7d899a;
}

html body .intelligence-station .date-query .intelligence-date-clear {
  padding: 1px 7px;
  border: 1px solid #d4e1f0;
  border-radius: 4px;
  background: #f5f9ff;
  color: #2f72c3;
  font-size: 11px;
  cursor: pointer;
}

html body .intelligence-station .date-query .intelligence-date-clear:hover {
  border-color: #88b8ee;
  background: #e8f2ff;
}

html[data-table-theme='dark'] .intelligence-station .date-query .intelligence-date-filter {
  border-color: var(--modern-dark-border) !important;
  background: rgba(14, 15, 20, 0.88) !important;
  color: #9aa3b2;
}

html[data-table-theme='dark'] .intelligence-station .date-query .stock-workbench-select {
  border-color: var(--modern-dark-border-hover);
  background: rgba(255, 255, 255, 0.05);
  color: #d8dae0;
}

html[data-table-theme='dark'] .intelligence-station .date-query .stock-workbench-days {
  border-top-color: var(--modern-dark-border);
}

html[data-table-theme='dark'] .intelligence-station .date-query .stock-workbench-day {
  border-color: var(--modern-dark-border);
  background: rgba(255, 255, 255, 0.04);
  color: #b8bbc3;
}

html[data-table-theme='dark'] .intelligence-station .date-query .stock-workbench-day:hover,
html[data-table-theme='dark'] .intelligence-station .date-query .stock-workbench-day.active {
  border-color: var(--modern-dark-border-accent);
  background: rgba(94, 106, 210, 0.32);
  color: #eef0ff;
}

html[data-table-theme='dark'] .intelligence-station .date-query .intelligence-date-clear {
  border-color: var(--modern-dark-border-hover);
  background: rgba(255, 255, 255, 0.06);
  color: #c7d2fe;
}

/* Middle column (.top-navigation) header icon toolbar for add/edit/delete category */
html body .intelligence-station .top-navigation .nav-column-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #edf1f6;
}

html body .intelligence-station .top-navigation .nav-column-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

html body .intelligence-station .top-navigation .nav-column-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

html body .intelligence-station .top-navigation .nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  background-color: #f8fafc;
  color: #52657a;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

html body .intelligence-station .top-navigation .nav-icon-btn .el-icon {
  font-size: 14px;
}

html body .intelligence-station .top-navigation .nav-icon-btn--add:hover:not(:disabled),
html body .intelligence-station .top-navigation .nav-icon-btn--edit:hover:not(:disabled) {
  color: var(--rhea-primary, #1677ff);
  border-color: color-mix(in oklab, var(--rhea-primary, #1677ff) 40%, #dbe4ef);
  background-color: color-mix(in oklab, var(--rhea-primary, #1677ff) 10%, #fff);
  transform: translateY(-1px);
}

html body .intelligence-station .top-navigation .nav-icon-btn--danger:hover:not(:disabled) {
  color: #dc2626;
  border-color: #fecaca;
  background-color: #fef2f2;
  transform: translateY(-1px);
}

html body .intelligence-station .top-navigation .nav-icon-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 1100px) {
  html body .intelligence-station .top-navigation .nav-column-header {
    padding: 0 10px 0 8px;
    margin-bottom: 0;
    border-bottom: none;
    border-right: 1px solid #edf1f6;
  }
}

html[data-table-theme='dark'] .intelligence-station .top-navigation .nav-column-header {
  border-color: var(--modern-dark-border) !important;
}

html[data-table-theme='dark'] .intelligence-station .top-navigation .nav-column-title {
  color: #d8dae0;
}

html[data-table-theme='dark'] .intelligence-station .top-navigation .nav-icon-btn {
  border-color: var(--modern-dark-border-hover);
  background: rgba(255, 255, 255, 0.05);
  color: #b8bbc3;
}

html[data-table-theme='dark'] .intelligence-station .top-navigation .nav-icon-btn--add:hover:not(:disabled),
html[data-table-theme='dark'] .intelligence-station .top-navigation .nav-icon-btn--edit:hover:not(:disabled) {
  border-color: var(--modern-dark-border-accent);
  background: rgba(94, 106, 210, 0.22);
  color: #eef0ff;
}

html[data-table-theme='dark'] .intelligence-station .top-navigation .nav-icon-btn--danger:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

/* Category navigation and editor share compact, single-line rows. */
html body .intelligence-station.intelligence-station > .top-navigation .nav-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}

html body .intelligence-station.intelligence-station > .top-navigation .nav-tab:hover,
html body .intelligence-station.intelligence-station > .top-navigation .nav-tab.active {
  border-color: color-mix(in oklab, var(--rhea-primary, #1677ff) 26%, var(--rhea-border, #e2e8f0));
  background: color-mix(in oklab, var(--rhea-primary, #1677ff) 10%, var(--rhea-card, #fff));
  color: var(--rhea-foreground, #1e293b);
}

.nav-tab-name,
.category-editor-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-grip {
  flex: 0 0 16px;
  display: grid;
  height: 24px;
  place-items: center;
  opacity: 0.52;
  touch-action: none;
}

.category-grip::before {
  content: "";
  width: 10px;
  height: 15px;
  background: radial-gradient(circle at center, currentColor 1px, transparent 1.3px) 0 0 / 5px 5px;
}

@media (pointer: coarse) {
  .category-grip { flex-basis: 24px; }
}

:is(.nav-tab, .category-editor-row)[draggable='true'] .category-grip {
  cursor: grab;
}

:is(.nav-tab, .category-editor-row).category-dragging {
  opacity: 0.5;
  cursor: grabbing;
}

html body :is(.intelligence-station .nav-tab, .category-editor-dialog .category-editor-row) {
  --category-drop-color: color-mix(in oklab, var(--rhea-primary, #1677ff) 70%, var(--rhea-foreground, #1e293b));
  position: relative;
}

:is(.nav-tab, .category-editor-row):is(.category-drop-before, .category-drop-after)::after {
  content: "";
  position: absolute;
  inset-inline: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--category-drop-color);
  pointer-events: none;
}

:is(.nav-tab, .category-editor-row).category-drop-before::after { top: 0; }
:is(.nav-tab, .category-editor-row).category-drop-after::after { bottom: 0; }

@media (max-width: 1100px) {
  html body .intelligence-station.intelligence-station > .top-navigation .nav-tab {
    max-width: min(220px, 55vw);
    font-size: 13px;
  }

  .nav-tab:is(.category-drop-before, .category-drop-after)::after {
    inset-block: 3px;
    width: 2px;
    height: auto;
  }

  .nav-tab.category-drop-before::after { inset-inline: 0 auto; }
  .nav-tab.category-drop-after::after { inset-inline: auto 0; }
}

html body .el-dialog.category-editor-dialog {
  --category-panel: var(--rhea-card, #fff);
  --category-subtle: var(--rhea-muted, #f5f7fa);
  --category-border: var(--rhea-border, #e2e8f0);
  --category-text: var(--rhea-card-foreground, #1e293b);
  --category-muted: var(--rhea-muted-foreground, #5c6b7a);
  --category-accent-border: color-mix(in oklab, var(--rhea-primary, #1677ff) 36%, var(--category-border));
  --category-accent-fill: color-mix(in oklab, var(--rhea-primary, #1677ff) 12%, var(--category-panel));
  --category-focus: color-mix(in oklab, var(--rhea-primary, #1677ff) 70%, var(--category-text));
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 0;
  color: var(--category-text);
}

html[data-table-theme='dark'] body .el-dialog.category-editor-dialog {
  background: var(--category-panel) !important;
  backdrop-filter: none;
}

html body .category-editor-dialog .el-dialog__header {
  flex: 0 0 auto;
  padding: 15px 46px 14px 18px;
}

html body .category-editor-dialog .el-dialog__title {
  font-size: 17px;
  font-weight: 650;
}

html body .category-editor-dialog .el-dialog__headerbtn {
  top: 0;
  width: 48px;
  height: 52px;
}

html body .category-editor-dialog .el-dialog__body {
  min-height: 0;
  padding: 0;
  overflow: auto;
  color: inherit;
}

.category-editor-content {
  display: grid;
  grid-template-columns: minmax(174px, 0.72fr) minmax(0, 1.28fr);
  min-height: min(325px, 53dvh);
}

.category-editor-list,
.category-editor-details {
  min-width: 0;
  padding: 14px 16px 16px;
}

.category-editor-list {
  background: var(--category-subtle);
  border-inline-end: 1px solid var(--category-border);
}

.category-editor-details {
  padding-inline: 20px;
}

.category-editor-section-header {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.category-editor-section-header h3,
.category-editor-section-header p {
  margin: 0;
}

.category-editor-section-header h3 {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.category-editor-section-header p,
.category-editor-status,
.category-editor-empty,
.category-order-total {
  color: var(--category-muted);
  font-size: 12px;
}

.category-editor-rows {
  display: grid;
  align-content: start;
  gap: 4px;
  max-height: min(324px, 47dvh);
  margin: 0 -4px;
  padding: 3px 4px;
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.category-editor-rows li {
  min-width: 0;
}

.category-editor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--category-border);
  border-radius: 7px;
  background: var(--category-panel);
  color: inherit;
  font: inherit;
  line-height: 1.4;
  text-align: start;
  cursor: pointer;
}

.category-editor-row:hover:not(:disabled),
.category-editor-row.is-selected {
  border-color: var(--category-accent-border);
  background: var(--category-accent-fill);
}

.category-editor-row.is-selected {
  font-weight: 650;
}

.category-editor-row-name:only-child {
  margin-inline-start: 24px;
}

html body .category-editor-dialog .el-form-item {
  margin-bottom: 17px;
}

html body .category-editor-dialog .el-form-item:last-child {
  margin-bottom: 0;
}

html body .category-editor-dialog .el-form-item__label {
  margin-bottom: 5px;
  font-weight: 600;
  line-height: 1.4;
}

html body .category-editor-dialog :is(.el-input__wrapper, .el-textarea__inner) {
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--category-border) 85%, var(--category-text));
}

html body .category-editor-dialog .el-form-item.is-error .el-input__wrapper {
  box-shadow: inset 0 0 0 1px var(--el-color-danger) !important;
}

.category-order-field,
.category-order-buttons,
.category-editor-footer,
.category-editor-footer-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-order-field .el-input-number {
  width: 76px;
}

.category-order-total {
  font-variant-numeric: tabular-nums;
}

.category-order-buttons {
  gap: 4px;
  margin-inline-start: 4px;
}

.category-order-button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--category-border);
  border-radius: 6px;
  background: var(--category-panel);
  color: inherit;
  cursor: pointer;
}

.category-order-button:hover:not(:disabled) {
  border-color: var(--category-accent-border);
  background: var(--category-accent-fill);
}

.category-order-button:disabled,
.category-editor-row:disabled {
  opacity: 0.55;
  cursor: default;
}

html body .category-editor-dialog .el-dialog__footer {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: var(--category-panel);
}

.category-editor-status {
  flex: 1;
  min-width: 0;
  text-align: start;
  overflow-wrap: anywhere;
}

.category-editor-footer-buttons .el-button + .el-button {
  margin: 0;
}

html body .category-editor-dialog .el-button:disabled:not(.is-loading) {
  opacity: 0.5;
  transform: none !important;
}

.category-editor-dialog :is(.category-editor-row, .category-order-button):focus-visible,
html body .intelligence-station .nav-tab:focus-visible {
  outline: 2px solid var(--category-focus, var(--category-drop-color));
  outline-offset: -2px;
}

@media (max-width: 600px) {
  .category-editor-content {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .category-editor-list {
    border-inline-end: 0;
    border-bottom: 1px solid var(--category-border);
  }

  .category-editor-details {
    padding-inline: 16px;
  }

  .category-editor-rows {
    max-height: min(162px, 27dvh);
  }

  .category-editor-footer {
    flex-wrap: wrap;
  }

  .category-editor-footer-buttons {
    margin-inline-start: auto;
  }

  .category-editor-status:not(:empty) {
    order: -1;
    flex: 0 0 100%;
  }
}
