﻿:root {
  --ink: #1d2939;
  --muted: #667085;
  --line: #d7dee8;
  --line-soft: #eaf0f6;
  --bg: #f3f6fb;
  --bg-soft: #eef3f8;
  --panel: #ffffff;
  --panel-2: #f5f8fc;
  --brand: #1b2430;
  --brand-green: #6a8db6;
  --brand-green-deep: #4f7097;
  --accent: #6a8db6;
  --accent-soft: #edf3fa;
  --accent-strong: #4f7097;
  --pink-accent: #e94e92;
  --green: #eef4fb;
  --green-ink: #45658d;
  --amber: #fff2cf;
  --amber-ink: #7a5a00;
  --plum: #f2ecfb;
  --plum-ink: #5f4198;
  --danger: #b63333;
  --shadow-soft: 0 10px 28px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  transition: background-color .18s ease, color .18s ease;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #b8c2cf transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b8c2cf;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #98a5b3;
  background-clip: padding-box;
}

body[data-theme="dark"] {
  --ink: #f2f4f7;
  --muted: #a7b0bc;
  --line: #3a424e;
  --line-soft: #313844;
  --bg: #232831;
  --bg-soft: #2a3039;
  --panel: #2a3039;
  --panel-2: #313844;
  --brand: #f2f4f7;
  --brand-green: #7f9fc3;
  --brand-green-deep: #5f81a7;
  --accent: #7f9fc3;
  --accent-soft: rgba(127, 159, 195, .14);
  --accent-strong: #b7cae0;
  --green: rgba(127, 159, 195, .16);
  --green-ink: #d4e0ee;
  --amber: rgba(255, 210, 94, .14);
  --amber-ink: #ffd96b;
  --plum: rgba(190, 160, 255, .16);
  --plum-ink: #d6c2ff;
  --danger: #ff7a7a;
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, .22);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.hidden { display: none !important; }

body.auth-screen,
body.launcher-screen {
  overflow: hidden;
}

body.auth-screen .sidebar,
body.auth-screen .main,
body.launcher-screen .sidebar,
body.launcher-screen .main {
  display: none;
}

.auth-gate,
.app-launcher {
  min-height: 100vh;
  padding: 48px;
  background:
    radial-gradient(circle at 20% 12%, rgba(106, 141, 182, .18), transparent 32%),
    var(--bg);
}

.auth-card {
  width: min(460px, 100%);
  margin: 9vh auto 0;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.auth-brand h1,
.launcher-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.12;
}

.auth-brand p,
.launcher-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.auth-form label:not(.checkline) {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input:not([type]) {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel);
}

.auth-remember {
  color: var(--muted);
}

.auth-status {
  min-height: 22px;
  margin-top: 14px;
  color: var(--danger);
  font-weight: 700;
}

.session-panel {
  position: fixed;
  top: 22px;
  right: 32px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(320px, calc(100vw - 360px));
  min-width: 220px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
}

.session-panel span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.session-panel .ghost-btn {
  padding: 7px 10px;
  min-height: 32px;
  font-size: 12px;
}

.app-launcher {
  overflow: auto;
}

.launcher-head {
  display: flex;
  max-width: 1160px;
  margin: 0 auto 28px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.launcher-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.launcher-grid {
  display: grid;
  max-width: 1160px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.launcher-tile {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.launcher-tile span {
  display: block;
  font-size: 20px;
  font-weight: 800;
}

.launcher-tile small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.launcher-tile.is-ready:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.launcher-tile:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.users-admin-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(16, 24, 40, .42);
}

.users-admin-card {
  width: min(1040px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.users-admin-card header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}

.users-admin-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.15;
}

.users-admin-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.users-admin-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.users-admin-actions span {
  color: var(--muted);
  font-weight: 700;
}

.users-admin-create {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) minmax(180px, .8fr) auto;
  gap: 12px;
  align-items: end;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--soft) 55%, transparent);
}

.users-admin-create label,
.users-admin-create span {
  display: block;
}

.users-admin-create span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.users-admin-create input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
}

.users-admin-list {
  display: grid;
}

.users-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.users-admin-row b,
.users-admin-row span,
.users-admin-row small {
  display: block;
}

.users-admin-row b {
  color: var(--ink);
  font-size: 16px;
}

.users-admin-row span {
  margin-top: 3px;
  color: var(--muted);
}

.users-admin-row small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.users-admin-row form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.users-admin-row input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
}

.users-admin-empty {
  padding: 28px 24px;
  color: var(--muted);
  font-weight: 700;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 22px 16px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  transition: width .18s ease, padding .18s ease;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
}

.theme-toggle,
.sidebar-collapse {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--panel);
  line-height: 1;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.theme-toggle {
  margin-left: auto;
  position: relative;
  overflow: hidden;
  font-size: 16px;
}

.theme-toggle-light,
.theme-toggle-dark {
  position: absolute;
  transition: opacity .18s ease, transform .18s ease;
}

.theme-toggle-dark {
  opacity: 0;
  transform: translateY(8px);
}

.theme-toggle.is-dark .theme-toggle-light {
  opacity: 0;
  transform: translateY(-8px);
}

.theme-toggle.is-dark .theme-toggle-dark {
  opacity: 1;
  transform: translateY(0);
}

.sidebar-collapse {
  margin-left: 6px;
  font-size: 22px;
}

body.sidebar-collapsed .sidebar {
  width: 72px;
  padding: 22px 12px;
  overflow: visible;
}

body.sidebar-collapsed .main {
  margin-left: 72px;
}

body.sidebar-collapsed .brand {
  display: grid;
  justify-items: center;
  gap: 10px;
}

body.sidebar-collapsed .brand > div,
body.sidebar-collapsed .nav,
body.sidebar-collapsed .side-section,
body.sidebar-collapsed .side-tools {
  display: none;
}

body.sidebar-collapsed .session-panel {
  right: 24px;
  width: min(320px, calc(100vw - 120px));
}

body.sidebar-collapsed .sidebar-collapse {
  margin-left: 0;
  transform: rotate(180deg);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.nav, .side-tools, .side-section {
  display: grid;
  gap: 6px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group:not([open]) > :not(summary),
.nav-subgroup:not([open]) > :not(summary) {
  display: none !important;
}

.nav-group summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 10px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #667085;
  transform: rotate(0deg);
  transition: transform .16s ease, border-color .16s ease;
}

.nav-group:not([open]) summary::after {
  transform: rotate(-90deg);
}

.nav-group b {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent-soft);
  font-size: 12px;
}

.nav-subgroup {
  display: grid;
  gap: 3px;
  margin: 4px 0 6px;
}

.nav-subgroup summary {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
  text-transform: uppercase;
}

.nav-subgroup summary::-webkit-details-marker {
  display: none;
}

.nav-subgroup summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4.5px solid #667085;
  transform: rotate(0deg);
  transition: transform .16s ease, border-color .16s ease;
}

.nav-subgroup:not([open]) summary::after {
  transform: rotate(-90deg);
}

.nav-subgroup .nav-item {
  padding-left: 18px;
}

#articleAuditNavGroup .nav-subgroup {
  gap: 2px;
  margin: 2px 0 8px;
}

#articleAuditNavGroup .nav-subgroup summary {
  min-height: 26px;
  padding: 4px 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

#articleAuditNavGroup .nav-subgroup .nav-item {
  min-height: 30px;
  padding: 6px 10px 6px 18px;
  border-radius: 8px;
  font-size: 13px;
}

#articleAuditNavGroup .nav-subgroup .nav-item:not(.active) {
  background: transparent;
  box-shadow: none;
}

#articleAuditNavGroup .nav-subgroup .nav-item.is-zero:not(.active) {
  color: var(--muted);
  opacity: 0.72;
}

#articleAuditNavGroup .nav-subgroup .nav-item.is-zero:not(.active)::after {
  content: none;
}

.side-section, .side-tools {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.nav-item, .side-tools a, .side-tools button, .side-toggle {
  width: 100%;
  min-height: 38px;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  color: #4b5565;
  background: transparent;
  text-align: left;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.nav-root {
  margin-top: 6px;
  font-weight: 800;
}

.nav-item.is-disabled {
  color: #98a2b3;
  cursor: default;
}

.nav-item.active {
  color: var(--ink);
  background: var(--accent-soft);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--brand-green);
}

.side-tools span {
  padding: 0 12px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.side-tools a, .side-tools button, .side-toggle {
  border: 1px solid var(--line);
  background: var(--panel);
}

.side-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #475467;
  content: "";
}

.hamburger {
  position: relative;
}

.hamburger::before {
  position: absolute;
  top: -5px;
}

.hamburger::after {
  position: absolute;
  top: 5px;
}

.side-drawer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.import-modal,
.publish-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 18, 32, .54);
}

.import-dialog,
.publish-dialog {
  position: relative;
  width: min(620px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.publish-dialog {
  width: min(840px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.dialog-head {
  padding-right: 42px;
  margin-bottom: 20px;
}

.dialog-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.dialog-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef2f6;
  color: #344054;
  font-size: 24px;
  line-height: 1;
}

.import-dialog form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px;
  gap: 14px;
  align-items: end;
}

.dialog-field {
  display: grid;
  gap: 7px;
}

.dialog-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dialog-check {
  grid-column: 1 / -1;
}

.dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.side-drawer form, .compact-field {
  display: grid;
  gap: 8px;
}

.compact-field span, label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input, select {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: #8a94a6;
}

.checkline {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #455064;
  font-size: 13px;
}

.checkline input {
  min-height: auto;
  width: auto;
}

.primary-btn, .ghost-btn, .success-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 7px;
  font-weight: 800;
}

.primary-btn {
  border: 1px solid var(--brand);
  color: #fff;
  background: var(--brand);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.success-btn:disabled,
.error-btn:disabled {
  cursor: not-allowed;
  opacity: .78;
}

.primary-btn:disabled {
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel-2);
}

.dialog-actions .primary-btn:disabled,
body[data-theme="dark"] .dialog-actions .primary-btn:disabled {
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel-2);
  opacity: .95;
}

#importForm .dialog-actions .primary-btn,
#importForm .dialog-actions .primary-btn:disabled {
  color: #1d2939;
  background: #eef3f8;
  border-color: #cfd8e3;
}

#importForm .dialog-actions .primary-btn:not(:disabled) {
  background: #dfeaf5;
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.success-btn {
  border: 1px solid #12b76a;
  color: #fff;
  background: #12b76a;
}

.success-btn:hover,
.success-btn:focus {
  border-color: #039855;
  background: #039855;
  outline: none;
}

.error-btn {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #fda29b;
  border-radius: 7px;
  color: #b42318;
  background: #fff5f4;
  font-weight: 800;
}

.error-btn:hover,
.error-btn:focus {
  border-color: #f97066;
  background: #fee4e2;
  outline: none;
}

.full {
  width: 100%;
}

.import-status, .preview-box {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.preview-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.import-diagnostics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 4px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
}

.import-diagnostics div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.import-diagnostics dt,
.import-diagnostics dd {
  margin: 0;
}

.import-diagnostics dt {
  color: var(--muted);
}

.import-diagnostics dd {
  color: var(--ink);
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.main {
  min-height: 100vh;
  margin-left: 248px;
  padding: 28px 24px 40px;
  transition: margin-left .18s ease;
  background: var(--bg);
}

.workspace {
  max-width: 1700px;
}

.page-head {
  display: grid;
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}

.page-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(140px, 220px) minmax(180px, 360px);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.archive-tools {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(260px, 360px) minmax(180px, 240px);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.archive-category-picker {
  position: relative;
  display: grid;
  gap: 6px;
}

.archive-category-search,
.archive-category-select {
  width: 100%;
  min-height: 34px;
  font-size: 13px;
}

.search-field {
  display: grid;
  gap: 6px;
}

.compact-field input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  font-size: 13px;
}

.status-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  min-width: 0;
  overflow: visible;
  padding-bottom: 2px;
}

.tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 18px;
  color: #556070;
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line-soft);
}

a.tab {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.tab.active {
  color: #fff;
  background: var(--brand-green-deep);
  border-color: var(--brand-green-deep);
  box-shadow: none;
}

.tab.tab-primary,
.article-audit-view .audit-export-link {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.candidate-panel {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 400px);
  gap: 16px;
  align-items: start;
}

body.analytics-view .review-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.analytics-view .case-detail {
  display: none;
}

body.analytics-view .topbar > .search-field {
  display: none !important;
}

.analytics-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.analytics-controls label {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.analytics-controls label span,
.analytics-action-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-controls select,
.analytics-controls input {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

.analytics-action-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}

.analytics-action-status.is-warning {
  color: #9a5b09;
}

.analytics-controls button:disabled,
.analytics-controls select:disabled,
.analytics-controls input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.analytics-board {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.analytics-warning {
  border: 1px solid #f1d4a7;
  border-radius: 8px;
  padding: 10px 12px;
  color: #7a4b09;
  background: #fff7e8;
  font-size: 13px;
  font-weight: 700;
}

.analytics-explainer {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
}

.analytics-explainer b {
  color: var(--ink);
  font-size: 14px;
}

.analytics-explainer span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.analytics-group {
  display: grid;
  gap: 10px;
}

.analytics-group > header {
  display: grid;
  gap: 3px;
}

.analytics-group h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.analytics-group p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.analytics-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.analytics-wide {
  padding: 14px;
}

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

.analytics-section header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.analytics-section h3 {
  margin: 0;
  font-size: 15px;
}

.analytics-section small {
  color: var(--muted);
}

.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analytics-metric {
  min-height: 86px;
  padding: 12px 14px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.analytics-metric span,
.analytics-metric small {
  display: block;
}

.analytics-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-metric b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.05;
}

.analytics-metric small {
  margin-top: 6px;
  font-size: 11px;
}

.analytics-daily-table {
  display: grid;
}

.analytics-daily-head,
.analytics-daily-row {
  display: grid;
  grid-template-columns: 110px repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}

.analytics-daily-head {
  color: var(--muted);
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 800;
}

.analytics-daily-row {
  font-size: 13px;
}

.analytics-empty-row {
  padding: 18px 14px;
  color: var(--muted);
}

.analytics-funnel,
.analytics-top-list {
  display: grid;
  gap: 10px;
}

.analytics-funnel-row {
  display: grid;
  grid-template-columns: 150px minmax(120px, 1fr) 64px 48px;
  gap: 10px;
  align-items: center;
}

.analytics-funnel-row span,
.analytics-top-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-funnel-row b,
.analytics-funnel-row em {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.analytics-bar,
.analytics-top-bars {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.analytics-bar i,
.analytics-top-bars i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--ui-blue);
}

.analytics-age-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, 1fr));
  gap: 12px;
  min-height: 190px;
  align-items: end;
}

.analytics-age-column {
  display: grid;
  grid-template-rows: 22px 130px 34px;
  gap: 7px;
  text-align: center;
}

.analytics-age-column b {
  color: var(--ink);
  font-size: 14px;
}

.analytics-age-column i {
  align-self: end;
  justify-self: center;
  width: min(54px, 70%);
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #527aa3 0%, #2d4f73 100%);
}

.analytics-age-column span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analytics-top-row {
  display: grid;
  gap: 5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.analytics-top-row:last-child {
  border-bottom: 0;
}

.analytics-top-row strong {
  color: var(--ink);
  font-size: 13px;
}

.analytics-top-bars {
  height: 8px;
}

.analytics-top-bars .open {
  background: #527aa3;
}

.analytics-top-bars .incoming {
  position: absolute;
  inset: 0 auto 0 0;
  background: #8fc0a9;
  opacity: .72;
}

.analytics-trend {
  display: grid;
  grid-template-columns: repeat(30, minmax(8px, 1fr));
  gap: 5px;
  height: 150px;
  align-items: end;
}

.analytics-trend-day {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
  height: 100%;
}

.analytics-trend-day span {
  display: block;
  width: 7px;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
}

.analytics-trend-day .incoming {
  background: #527aa3;
}

.analytics-trend-day .closed {
  background: #4f9f77;
}

@media (max-width: 980px) {
  .analytics-section-grid {
    grid-template-columns: 1fr;
  }
  .analytics-two-col {
    grid-template-columns: 1fr;
  }
  .analytics-funnel-row {
    grid-template-columns: 1fr;
  }
  .analytics-funnel-row b,
  .analytics-funnel-row em {
    text-align: left;
  }

  .analytics-daily-head,
  .analytics-daily-row {
    grid-template-columns: 1fr;
  }
}

.table-head, .case-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 72px minmax(118px, 132px);
  gap: 14px;
  align-items: center;
}

.table-head.bulk-select-head,
.case-row.bulk-select-row {
  grid-template-columns: 34px 82px minmax(0, 1fr) 72px minmax(118px, 132px);
}

.table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
  font-weight: 800;
}

.date-sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 28px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.product-sort-toggle,
.download-btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.product-sort-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--brand-green-deep);
  border-color: transparent;
  text-align: center;
  white-space: nowrap;
}

.completed-view .topbar {
  margin-bottom: 0;
  border-bottom-color: transparent;
  border-radius: 16px 16px 0 0;
  box-shadow: none;
}

.completed-view .archive-tools {
  margin-bottom: 16px;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  box-shadow: var(--shadow-soft);
}

.date-sort-toggle:hover,
.date-sort-toggle:focus {
  color: var(--ink);
  outline: none;
}

.article-alpha-sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-width: 58px;
  min-height: 28px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.article-alpha-sort-toggle:hover,
.article-alpha-sort-toggle:focus {
  color: var(--ink);
  outline: none;
}

#sortIcon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--accent-strong);
  background: var(--panel);
  font-size: 13px;
  line-height: 1;
}

.case-list {
  display: grid;
}

.candidate-panel,
.case-detail {
  min-width: 0;
}

.case-row {
  position: relative;
  min-height: 88px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.case-row:hover {
  background: var(--bg-soft);
}

.case-row.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--brand-green);
}

.case-row.bulk-selected {
  background: color-mix(in srgb, #eff8ff 72%, var(--panel));
}

.case-select-cell,
.case-select-all {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  cursor: pointer;
}

.case-select-cell input,
.case-select-all input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

.bulk-actions {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, #eff8ff);
}

.bulk-actions b {
  color: var(--ink);
  font-size: 14px;
}

.bulk-actions .ghost-btn,
.bulk-actions .case-delete {
  width: fit-content;
  min-height: 34px;
  margin: 0;
  padding: 7px 12px;
}

.status-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.deleted-row {
  background: #fff8f7;
}

.deleted-row:hover {
  background: #fff3f1;
}

.case-delete {
  display: inline-grid;
  display: grid;
  place-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid #fda29b;
  border-radius: 7px;
  color: #d92d20;
  background: #fff1f0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.detail-delete {
  margin-top: 8px;
}

.case-delete:hover,
.case-delete:focus {
  border-color: #fda29b;
  color: #b42318;
  background: #fee4e2;
  outline: none;
}

.deleted-actions {
  display: grid;
  gap: 6px;
}

.deleted-meta {
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
}

.restore-btn,
.purge-btn {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 800;
}

.restore-btn {
  border: 1px solid #9ec5ff;
  color: #175cd3;
  background: #eff6ff;
}

.purge-btn {
  border: 1px solid #fda29b;
  color: #b42318;
  background: #fff1f0;
}

.date {
  color: #475467;
  font-size: 14px;
  font-weight: 700;
}

.fragment {
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.photo-cell {
  min-height: 56px;
}

.photo-thumb {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  box-shadow: 0 4px 12px rgba(16, 24, 40, .08);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb.is-video,
.detail-photo-thumb.is-video {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(95, 132, 174, .22), rgba(72, 106, 145, .28));
  color: var(--ink);
  font-weight: 900;
}

.video-tile-label {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.photo-thumb > span:not(.video-tile-label) {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 10px;
  color: #fff;
  background: rgba(21, 28, 40, .86);
  font-size: 11px;
  font-weight: 800;
}

.no-photo, .photo-missing, .teamly-unknown {
  color: var(--muted);
  font-size: 13px;
}

.teamly-link {
  display: inline-block;
  color: var(--accent-strong);
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.teamly-link:hover {
  text-decoration: underline;
}

.telegram-link {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.telegram-link:hover {
  text-decoration: underline;
}

.answer-cell {
  display: grid;
  gap: 4px;
}

.answer-waiting {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 14px;
  color: #805700;
  background: #fff7e6;
  font-size: 12px;
  font-weight: 800;
}

.answer-ready {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 14px;
  color: var(--green-ink);
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.answer-date,
.answer-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.answer-text {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.attachment-file,
.attachment-thumb {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #175cd3;
  background: var(--panel);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.attachment-file span {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--bg-soft);
  font-size: 10px;
}

.attachment-file.disabled {
  color: #667085;
  pointer-events: none;
}

.attachment-thumb img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.attachment-thumb span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-answer .attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 132px));
  align-items: start;
}

.detail-answer .attachment-thumb {
  display: grid;
  gap: 6px;
  padding: 6px;
  color: #344054;
}

.detail-answer .attachment-thumb img {
  width: 100%;
  height: 94px;
  border-radius: 7px;
}

.detail-answer .attachment-file {
  min-height: 44px;
}

.teamly-confidence {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.3;
}

.teamly-confidence.muted {
  color: #98a2b3;
}

.category-picker {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  position: relative;
}

.category-search {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  font-size: 13px;
  outline: none;
}

.category-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 184, 106, .18);
}

.category-suggestions {
  position: absolute;
  z-index: 20;
  top: 38px;
  right: 0;
  left: 0;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.category-suggestion {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.category-suggestion:hover,
.category-suggestion:focus {
  background: var(--accent-soft);
  outline: none;
}

.category-suggestion span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.category-suggestion small {
  color: #667085;
  font-size: 11px;
  line-height: 1.25;
}

.category-select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel);
  font-size: 13px;
}

.category-select:disabled {
  opacity: .6;
}

.decision-actions {
  display: grid;
  gap: 6px;
  align-items: flex-start;
}

.decision-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.decision-btn {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: var(--panel-2);
  color: #4b5565;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.decision-btn.check.active {
  border-color: #e5c56b;
  color: var(--amber-ink);
  background: var(--amber);
}

.decision-btn.add.active {
  border-color: #96d2aa;
  color: var(--green-ink);
  background: var(--green);
}

.decision-btn.duplicate.active {
  border-color: #c2b3df;
  color: var(--plum-ink);
  background: var(--plum);
}

.decision-btn.done.active {
  border-color: #9aa4b2;
  color: #344054;
  background: #e7ecf2;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 14px;
  background: var(--panel-2);
  color: #465265;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.check {
  color: var(--amber-ink);
  background: var(--amber);
}

.status-badge.add {
  color: var(--green-ink);
  background: var(--green);
}

.status-badge.duplicate {
  color: var(--plum-ink);
  background: var(--plum);
}

.status-badge.done {
  color: #344054;
  background: #e7ecf2;
}

.status-badge.error {
  color: #b42318;
  background: #fee4e2;
}

.done-btn {
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid #98a2b3;
  border-radius: 7px;
  color: #344054;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.done-btn:hover,
.done-btn:focus,
.done-btn.active {
  border-color: #344054;
  color: #fff;
  background: #344054;
  outline: none;
}

.return-queue-btn {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #9ec5ff;
  border-radius: 7px;
  color: #175cd3;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.return-queue-btn:hover,
.return-queue-btn:focus {
  border-color: #84adff;
  background: #dbeafe;
  outline: none;
}

.publish-btn {
  width: fit-content;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #9ec5ff;
  border-radius: 15px;
  color: #175cd3;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.publish-btn:hover,
.publish-btn:focus {
  border-color: #84adff;
  background: #dbeafe;
  outline: none;
}

.publish-error-note {
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
}

.publish-target {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
}

.publish-target span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.publish-title-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.publish-title-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.publish-title-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-weight: 800;
}

.publish-text {
  width: 100%;
  min-height: 220px;
  margin-top: 14px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  line-height: 1.45;
}

.teamly-preview {
  margin-top: 14px;
}

.teamly-preview-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.teamly-expand-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.teamly-expand-preview header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}

.teamly-chevron {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  color: var(--muted);
  font-size: 14px;
}

.teamly-expand-body {
  display: grid;
  gap: 10px;
  padding: 16px 20px 20px 48px;
}

.teamly-expand-body h4 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-style: italic;
  font-weight: 900;
}

.teamly-expand-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
  white-space: normal;
}

.teamly-preview-category {
  color: var(--accent-strong) !important;
  font-weight: 900;
}

.publish-attachments {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.publish-attachments h4 {
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.publish-status {
  min-height: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--muted);
}

.audit-category {
  border-bottom: 1px solid var(--line-soft);
}

.audit-category h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 13px;
  background: var(--panel-2);
}

.audit-category h3 b {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent-soft);
}

.audit-row .fragment {
  display: grid;
  gap: 5px;
}

.audit-row .fragment b {
  color: var(--ink);
}

.audit-row .fragment small {
  color: var(--muted);
  font-weight: 700;
}

.audit-status,
.audit-type {
  width: fit-content;
}

.audit-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-status-actions .decision-btn.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.audit-status-open,
.audit-status-choice.audit-status-open.active {
  color: #475467;
  background: #f2f4f7;
  border-color: #e4e7ec;
}

.audit-status-progress,
.audit-status-choice.audit-status-progress.active {
  color: #175cd3;
  background: #eff8ff;
  border-color: #b2ddff;
}

.audit-status-ok,
.audit-status-choice.audit-status-ok.active {
  color: #027a48;
  background: #ecfdf3;
  border-color: #abefc6;
}

.audit-status-outdated,
.audit-status-choice.audit-status-outdated.active {
  color: #b42318;
  background: #fef3f2;
  border-color: #fecdca;
}

.audit-status-duplicate,
.audit-status-choice.audit-status-duplicate.active {
  color: #7a2e0e;
  background: #fff4ed;
  border-color: #ffd6ae;
}

.audit-status-done,
.audit-status-choice.audit-status-done.active {
  color: #175cd3;
  background: #eff8ff;
  border-color: #b2ddff;
}

.audit-status-choice.active {
  box-shadow: inset 0 0 0 1px currentColor;
}

.audit-comment {
  width: 100%;
  min-height: 88px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  resize: vertical;
}

.audit-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.audit-comment-actions .audit-save-comment {
  margin-top: 0;
}

.audit-save-comment.is-saving,
.audit-save-comment.is-dirty {
  border-color: #fedf89;
  color: #93370d;
  background: #fffaeb;
}

.audit-save-comment.is-saved {
  border-color: #abefc6;
  color: #027a48;
  background: #ecfdf3;
}

.audit-save-comment.is-error {
  border-color: #fecdca;
  color: #b42318;
  background: #fef3f2;
}

.audit-comment-save-state {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.audit-comment-save-state.is-saved {
  color: #027a48;
}

.audit-comment-save-state.is-error {
  color: #b42318;
}

.audit-comment-save-state.is-saving,
.audit-comment-save-state.is-dirty {
  color: #93370d;
}

.audit-fragment {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: var(--ink);
  background: var(--panel-2);
}

.article-audit-view .topbar {
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 460px);
  align-items: start;
}

.article-audit-view .topbar .search-field:first-child {
  grid-column: 1;
  grid-row: 1;
}

.article-audit-view #answerFilter {
  min-width: 260px;
}

.article-audit-view #answerFilter.hidden {
  display: none;
}

.article-audit-view .article-audit-filter-stack {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}

.article-category-combo {
  position: relative;
  display: grid;
  gap: 8px;
}

.article-category-current {
  min-height: 54px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
}

.article-category-current::after {
  content: "v";
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

#articleAuditAlphaSortIcon {
  display: inline-grid;
  min-width: 42px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--panel);
  font-size: 11px;
  line-height: 1;
}

.article-category-current[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 139, 190, .16);
}

.article-category-current span,
.article-category-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.article-category-current b,
.article-category-option b {
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-group-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(89, 139, 184, .16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.article-category-current small,
.article-category-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-category-panel {
  position: absolute;
  z-index: 45;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.article-category-search {
  min-height: 36px;
  border-radius: 8px;
}

.article-category-list {
  max-height: 320px;
  display: grid;
  gap: 4px;
  overflow: auto;
  padding-right: 3px;
}

.article-category-option {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.article-category-option:hover,
.article-category-option:focus {
  background: var(--panel-2);
  outline: none;
}

.article-category-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.article-category-option em {
  min-width: 30px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--chip);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.article-category-reset {
  width: fit-content;
  padding: 0;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.article-category-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.article-audit-view .article-audit-status-filter {
  margin-top: 10px;
}

.article-audit-view #articleAuditStatusFilter {
  min-width: 260px;
}

.article-audit-empty-detail {
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
}

.article-audit-empty-detail span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.article-audit-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.article-audit-link-actions .ghost-btn {
  width: fit-content;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.copy-feedback {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.article-audit-view .status-strip {
  grid-column: 1;
  grid-row: 2;
  justify-content: flex-start;
  align-self: end;
}

.article-audit-view .table-head,
.article-audit-view .audit-row {
  grid-template-columns: 34px 72px minmax(0, 1fr) minmax(220px, 280px);
}

.article-audit-view .table-head {
  padding-inline: 22px;
}

.audit-list {
  display: grid;
}

.article-audit-bulk-actions select {
  width: min(260px, 100%);
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.article-audit-view .audit-row {
  min-height: 92px;
  padding: 18px 22px;
}

.audit-select-cell,
.audit-select-all {
  align-self: center;
}

.audit-letter {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent-strong);
  background: var(--panel-2);
  font-size: 15px;
  font-weight: 900;
}

.audit-row .fragment small {
  display: block;
}

.audit-row .fragment em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.audit-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.archive-footer {
  position: sticky;
  bottom: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.case-detail {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.detail-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-head h3 {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.3;
}

.detail-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.detail-section p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  align-items: start;
}

body[data-theme="dark"] .sidebar {
  background: var(--panel);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04);
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .archive-tools {
  background: var(--panel);
}

body[data-theme="dark"] .table-head,
body[data-theme="dark"] .archive-footer,
body[data-theme="dark"] .case-row,
body[data-theme="dark"] .candidate-panel,
body[data-theme="dark"] .case-detail,
body[data-theme="dark"] .import-dialog,
body[data-theme="dark"] .publish-dialog {
  background: var(--panel);
}

body[data-theme="dark"] .case-row:hover {
  background: #313844;
}

body[data-theme="dark"] .case-row.selected {
  background: rgba(91, 189, 128, .10);
}

body[data-theme="dark"] .photo-thumb,
body[data-theme="dark"] .attachment-file,
body[data-theme="dark"] .attachment-thumb,
body[data-theme="dark"] .publish-target,
body[data-theme="dark"] .publish-attachments,
body[data-theme="dark"] .category-suggestions,
body[data-theme="dark"] .article-category-panel,
body[data-theme="dark"] .article-category-current,
body[data-theme="dark"] .tab {
  background: var(--panel-2);
}

body[data-theme="dark"] .video-tile-label {
  background: var(--panel-2);
  color: var(--ink);
}

body[data-theme="dark"] .tab.active,
body[data-theme="dark"] .download-btn {
  color: #ffffff;
}

body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .sidebar-collapse,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] .category-search,
body[data-theme="dark"] .article-category-search,
body[data-theme="dark"] .publish-title-input,
body[data-theme="dark"] .publish-text,
body[data-theme="dark"] .product-sort-toggle,
body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .done-btn,
body[data-theme="dark"] .side-tools a,
body[data-theme="dark"] .side-toggle {
  background: var(--panel-2);
  color: var(--ink);
}

body[data-theme="dark"] .primary-btn:disabled {
  border-color: #495463;
  color: var(--ink);
  background: #343c48;
}

body[data-theme="dark"] * {
  scrollbar-color: #5a6472 transparent;
}

body[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: #5a6472;
  background-clip: padding-box;
}

body[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: #738091;
  background-clip: padding-box;
}

body[data-theme="dark"] .nav-item,
body[data-theme="dark"] .side-tools a,
body[data-theme="dark"] .side-toggle,
body[data-theme="dark"] .side-tools span,
body[data-theme="dark"] .brand p,
body[data-theme="dark"] .page-head p,
body[data-theme="dark"] .date,
body[data-theme="dark"] .answer-date,
body[data-theme="dark"] .answer-count,
body[data-theme="dark"] .teamly-confidence,
body[data-theme="dark"] .detail-date,
body[data-theme="dark"] .detail-section h4,
body[data-theme="dark"] .table-head {
  color: var(--muted);
}

body[data-theme="dark"] .brand h1,
body[data-theme="dark"] .page-head h2,
body[data-theme="dark"] .fragment,
body[data-theme="dark"] .detail-section p,
body[data-theme="dark"] .answer-text,
body[data-theme="dark"] .teamly-expand-preview header,
body[data-theme="dark"] .teamly-expand-body h4,
body[data-theme="dark"] .teamly-expand-body p,
body[data-theme="dark"] .detail-head h3,
body[data-theme="dark"] .article-category-current b,
body[data-theme="dark"] .article-category-option b {
  color: var(--ink);
}

body[data-theme="dark"] .checkline {
  color: var(--ink);
}

body[data-theme="dark"] .nav-item.active {
  color: var(--ink);
  background: rgba(91, 189, 128, .10);
}

body[data-theme="dark"] .tab {
  color: var(--muted);
  border-color: var(--line);
}

body[data-theme="dark"] .tab.active {
  border-color: var(--brand-green-deep);
  background: var(--brand-green-deep);
}

body[data-theme="dark"] .candidate-panel,
body[data-theme="dark"] .case-detail,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .archive-tools {
  border-color: var(--line);
}

body[data-theme="dark"] .telegram-link,
body[data-theme="dark"] .teamly-link,
body[data-theme="dark"] .teamly-preview-category {
  color: var(--accent-strong) !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] .category-search,
body[data-theme="dark"] .article-category-search,
body[data-theme="dark"] .publish-text,
body[data-theme="dark"] .compact-field input {
  border-color: #495463;
  background: #343c48;
  color: var(--ink);
}

body[data-theme="dark"] .article-category-current,
body[data-theme="dark"] .article-category-panel {
  border-color: var(--line);
}

body[data-theme="dark"] .article-category-option:hover,
body[data-theme="dark"] .article-category-option:focus {
  background: #343c48;
}

body[data-theme="dark"] .article-category-option.active {
  border-color: var(--accent);
  background: rgba(125, 174, 214, .16);
}

body[data-theme="dark"] .article-category-option em {
  color: #d7e8f8;
  background: rgba(125, 174, 214, .18);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #b2bbc7;
}

body[data-theme="dark"] .detail-answer {
  background: #343c48;
  border-color: #495463;
}

body[data-theme="dark"] .detail-photo-thumb {
  background: #343c48;
}

body[data-theme="dark"] .date-sort-toggle:hover,
body[data-theme="dark"] .date-sort-toggle:focus {
  color: var(--ink);
}

body[data-theme="dark"] #sortIcon {
  color: var(--accent-strong);
  background: #343c48;
  border-color: #495463;
}

body[data-theme="dark"] #articleAuditAlphaSortIcon,
body[data-theme="dark"] .audit-letter {
  color: #b7cae0;
  background: #343c48;
  border-color: #495463;
}

body[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.6);
  cursor: pointer;
}

body[data-theme="dark"].article-audit-view .topbar,
body[data-theme="dark"].article-audit-view .candidate-panel,
body[data-theme="dark"].article-audit-view .case-detail {
  border-color: #3a4654;
  background: #28303a;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .18);
}

body[data-theme="dark"].article-audit-view .table-head {
  border-color: #3a4654;
  background: #28303a;
  color: #b9c3cf;
}

body[data-theme="dark"].article-audit-view .audit-row {
  border-color: #35404c;
  background: #28303a;
}

body[data-theme="dark"].article-audit-view .audit-row:hover {
  background: #303946;
}

body[data-theme="dark"].article-audit-view .audit-row.selected {
  border-left-color: #7f9fc3;
  background: rgba(127, 159, 195, .14);
}

body[data-theme="dark"].article-audit-view .audit-row .fragment small,
body[data-theme="dark"].article-audit-view .audit-row .fragment em {
  color: #aeb8c5;
}

body[data-theme="dark"].article-audit-view .audit-row .fragment b,
body[data-theme="dark"].article-audit-view .case-detail h3,
body[data-theme="dark"].article-audit-view .detail-section p,
body[data-theme="dark"].article-audit-view .audit-fragment {
  color: #f2f4f7;
}

body[data-theme="dark"].article-audit-view .detail-section,
body[data-theme="dark"].article-audit-view .detail-head {
  border-color: #35404c;
}

body[data-theme="dark"].article-audit-view .empty-state,
body[data-theme="dark"].article-audit-view .detail-empty,
body[data-theme="dark"].article-audit-view .article-audit-empty-detail {
  color: #b9c3cf;
  background: transparent;
}

body[data-theme="dark"].article-audit-view .audit-status,
body[data-theme="dark"].article-audit-view .audit-type {
  background: #343c48;
  color: #dce5ef;
}

body[data-theme="dark"].article-audit-view .audit-status-open,
body[data-theme="dark"].article-audit-view .audit-status-choice.audit-status-open {
  background: rgba(127, 159, 195, .16);
  color: #d7e8f8;
}

body[data-theme="dark"].article-audit-view .audit-status-progress,
body[data-theme="dark"].article-audit-view .audit-status-choice.audit-status-progress {
  background: rgba(127, 159, 195, .20);
  color: #e5f0fb;
}

body[data-theme="dark"].article-audit-view .audit-status-ok,
body[data-theme="dark"].article-audit-view .audit-status-choice.audit-status-ok {
  background: rgba(109, 191, 156, .16);
  color: #c9f3e0;
}

body[data-theme="dark"].article-audit-view .audit-status-outdated,
body[data-theme="dark"].article-audit-view .audit-status-choice.audit-status-outdated {
  background: rgba(255, 126, 126, .14);
  color: #ffc8c8;
}

body[data-theme="dark"].article-audit-view .audit-status-duplicate,
body[data-theme="dark"].article-audit-view .audit-status-choice.audit-status-duplicate {
  background: rgba(210, 176, 255, .16);
  color: #e4d4ff;
}

body[data-theme="dark"].article-audit-view .audit-status-done,
body[data-theme="dark"].article-audit-view .audit-status-choice.audit-status-done {
  background: rgba(127, 159, 195, .18);
  color: #d7e8f8;
}

body[data-theme="dark"].article-audit-view .audit-comment {
  border-color: #495463;
  background: #343c48;
  color: var(--ink);
}

body[data-theme="dark"].article-audit-view .audit-save-comment.is-saving,
body[data-theme="dark"].article-audit-view .audit-save-comment.is-dirty {
  border-color: rgba(254, 223, 137, .42);
  color: #f7c97b;
  background: rgba(147, 55, 13, .18);
}

body[data-theme="dark"].article-audit-view .audit-save-comment.is-saved {
  border-color: rgba(171, 239, 198, .42);
  color: #88ddb2;
  background: rgba(2, 122, 72, .2);
}

body[data-theme="dark"].article-audit-view .audit-save-comment.is-error {
  border-color: rgba(254, 205, 202, .42);
  color: #ffb4ad;
  background: rgba(180, 35, 24, .2);
}

body[data-theme="dark"].article-audit-view .audit-comment-save-state.is-saved {
  color: #88ddb2;
}

body[data-theme="dark"].article-audit-view .audit-comment-save-state.is-error {
  color: #ffb4ad;
}

body[data-theme="dark"].article-audit-view .audit-comment-save-state.is-saving,
body[data-theme="dark"].article-audit-view .audit-comment-save-state.is-dirty {
  color: #f7c97b;
}

body[data-theme="dark"].article-audit-view .copy-feedback {
  color: #b7cae0;
}

.detail-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.detail-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
  cursor: zoom-in;
}

.detail-photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-photo-thumb > span:not(.video-tile-label) {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #fff;
  background: rgba(21, 28, 40, .86);
  font-size: 11px;
  font-weight: 900;
}

.detail-photo-thumb:hover,
.detail-photo-thumb:focus {
  border-color: #2f80a7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 128, 167, .16);
}

.detail-answer-list {
  display: grid;
  gap: 10px;
}

.detail-answer {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfd;
}

.detail-answer-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.thread-message-list {
  display: grid;
  gap: 10px;
}

.thread-message {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, var(--soft));
}

.thread-message-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: lowercase;
}

.thread-message p {
  margin: 0;
}

.thread-message .attachment-list {
  margin-top: 2px;
}

.thread-group-summary {
  display: grid;
  gap: 8px;
}

.thread-group-item {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, var(--soft));
}

.thread-group-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.thread-group-item p {
  margin: 0;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  justify-items: center;
  padding: 34px 72px;
  background: rgba(11, 18, 32, .82);
}

.photo-modal figure {
  max-width: min(100%, 980px);
  max-height: 100%;
  overflow: auto;
  margin: 0;
  text-align: center;
}

.photo-modal img {
  max-width: 100%;
  max-height: calc(100vh - 110px);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  transform-origin: center center;
  transition: transform .12s ease;
}

.photo-modal video {
  max-width: min(100%, 980px);
  max-height: calc(100vh - 110px);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.photo-modal figcaption {
  margin-top: 10px;
  color: #fff;
  font-weight: 800;
}

.modal-close, .modal-arrow {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, .14);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 28px;
}

.modal-arrow {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  font-size: 42px;
}

.modal-arrow:disabled {
  opacity: .35;
  cursor: default;
}

.photo-zoom-controls {
  position: absolute;
  top: 20px;
  left: 50%;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  transform: translateX(-50%);
}

.photo-zoom-controls button,
.photo-zoom-controls span {
  min-width: 36px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  font-weight: 900;
}

.photo-zoom-controls span {
  min-width: 56px;
  background: transparent;
}

@media (max-width: 1360px) {
  .review-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }

  .table-head, .case-row {
    grid-template-columns: 82px minmax(0, 1fr) 64px 124px;
    gap: 12px;
  }
}

@media (max-width: 1180px) {
  .session-panel {
    position: static;
    width: auto;
    margin: 10px 0 16px;
  }

  .topbar, .page-head, .archive-tools {
    grid-template-columns: 1fr;
  }

  .review-layout {
    grid-template-columns: 1fr;
  }

  .case-detail {
    position: static;
    max-height: none;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .table-head, .case-row {
    grid-template-columns: 84px minmax(240px, 1fr) 74px 150px;
  }
}

@media (max-width: 820px) {
  .users-admin-dialog {
    padding: 12px;
  }

  .users-admin-card {
    max-height: calc(100vh - 24px);
  }

  .users-admin-card header,
  .users-admin-actions,
  .users-admin-create,
  .users-admin-row {
    padding: 16px;
  }

  .users-admin-row,
  .users-admin-create,
  .users-admin-row form {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    margin-left: 0;
    padding: 18px 12px;
  }

  .table-head {
    display: none;
  }

  .case-row {
    grid-template-columns: 82px 1fr 66px;
    gap: 10px;
  }

  .case-row .product,
  .case-row .answer-column,
  .case-row .status-cell {
    grid-column: 2 / -1;
  }

  .photo-modal {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding: 46px 12px;
  }

  .import-dialog form {
    grid-template-columns: 1fr;
  }

.dialog-actions {
    display: grid;
  }
}

details.nav-group:not([open]) > button,
details.nav-group:not([open]) > details,
details.nav-subgroup:not([open]) > button {
  display: none !important;
}

/* 2026-07-13 cosmetic unification.
   This layer intentionally touches only visual presentation: typography,
   spacing, color contrast, radii and state styling. No behavior is changed. */
:root {
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-panel: 14px;
  --focus-ring: 0 0 0 3px rgba(106, 141, 182, .18);
  --control-height: 40px;
}

body {
  font-weight: 400;
}

.brand h1,
.page-head h2,
.dialog-head h3 {
  font-weight: 700;
}

.brand p,
.page-head p,
.dialog-head p,
.teamly-confidence,
.no-photo,
.photo-missing,
.teamly-unknown,
.answer-date,
.answer-count,
.import-status,
.preview-box {
  font-weight: 400;
}

label,
.compact-field span,
.dialog-field span,
.side-tools span,
.table-head,
.teamly-preview-label,
.publish-target span,
.publish-title-field span,
.audit-row .fragment small {
  font-weight: 600;
}

.nav-item,
.side-tools a,
.side-tools button,
.side-toggle {
  font-weight: 500;
}

.nav-root,
.nav-group summary,
.nav-item.active,
.side-toggle,
.primary-btn,
.ghost-btn,
.success-btn,
.error-btn,
.download-btn,
.product-sort-toggle,
.publish-btn,
.done-btn,
.return-queue-btn {
  font-weight: 700;
}

.tab,
.status-badge,
.decision-btn,
.answer-ready,
.answer-waiting,
.thread-group-badge,
.video-tile-label,
.photo-thumb.is-video,
.detail-photo-thumb.is-video {
  font-weight: 600;
}

.teamly-link,
.telegram-link,
.article-category-current b,
.article-category-option b,
.category-suggestion span {
  font-weight: 700;
}

.main {
  background:
    radial-gradient(circle at top left, rgba(106, 141, 182, .08), transparent 34rem),
    var(--bg);
}

.sidebar,
.topbar,
.archive-tools,
.candidate-panel,
.case-detail,
.import-dialog,
.publish-dialog,
.teamly-expand-preview {
  border-color: var(--line);
  box-shadow: 0 10px 26px rgba(16, 24, 40, .045);
}

.sidebar {
  background: color-mix(in srgb, var(--panel) 94%, var(--bg));
}

.topbar,
.archive-tools,
.candidate-panel,
.case-detail {
  border-radius: var(--radius-panel);
}

.import-dialog,
.publish-dialog,
.teamly-expand-preview,
.publish-target,
.publish-attachments,
.preview-box,
.import-diagnostics,
.article-category-panel,
.category-suggestions {
  border-radius: var(--radius-card);
}

.theme-toggle,
.sidebar-collapse,
.nav-item,
.side-tools a,
.side-tools button,
.side-toggle,
input,
select,
textarea,
.compact-field input,
.category-search,
.category-select,
.archive-category-search,
.archive-category-select,
.article-category-search,
.article-category-current,
.article-category-option,
.primary-btn,
.ghost-btn,
.success-btn,
.error-btn,
.download-btn,
.product-sort-toggle,
.case-delete,
.done-btn,
.return-queue-btn {
  border-radius: var(--radius-control);
}

input,
select,
textarea,
.compact-field input,
.category-search,
.category-select,
.archive-category-search,
.archive-category-select,
.article-category-search {
  min-height: var(--control-height);
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

input:focus,
select:focus,
textarea:focus,
.compact-field input:focus,
.category-search:focus,
.category-select:focus,
.archive-category-search:focus,
.archive-category-select:focus,
.article-category-search:focus,
.article-category-current:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  outline: none;
}

.category-search:focus {
  box-shadow: var(--focus-ring);
}

.tab,
.decision-btn,
.status-badge,
.answer-ready,
.answer-waiting,
.publish-btn,
.thread-group-badge {
  border-radius: 999px;
}

.tab {
  min-height: 32px;
  padding: 6px 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-2) 92%, var(--panel));
}

.tab.active {
  color: #ffffff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.nav-group summary {
  min-height: 36px;
  padding: 8px 10px;
}

.nav-subgroup summary {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.nav-item,
.side-tools a,
.side-tools button,
.side-toggle {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--muted);
}

.nav-item.active {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

.side-tools a,
.side-tools button,
.side-toggle {
  background: color-mix(in srgb, var(--panel) 94%, var(--bg));
}

.case-row {
  min-height: 82px;
  padding: 14px 18px;
}

.case-row.selected {
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--panel));
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

.case-row:hover {
  background: color-mix(in srgb, var(--bg-soft) 74%, var(--panel));
}

.status-badge,
.decision-btn {
  min-height: 28px;
  padding: 5px 9px;
}

.status-badge {
  color: var(--muted);
  background: var(--panel-2);
}

.status-badge.check,
.decision-btn.check.active {
  color: #705100;
  background: #fff5d7;
  border-color: #f0d585;
}

.status-badge.add,
.decision-btn.add.active,
.answer-ready {
  color: var(--green-ink);
  background: var(--green);
  border-color: color-mix(in srgb, var(--green-ink) 22%, transparent);
}

.status-badge.duplicate,
.decision-btn.duplicate.active {
  color: var(--plum-ink);
  background: var(--plum);
  border-color: color-mix(in srgb, var(--plum-ink) 20%, transparent);
}

.status-badge.done,
.decision-btn.done.active {
  color: #445163;
  background: #edf1f6;
  border-color: #d7dee8;
}

.primary-btn,
.download-btn {
  background: var(--brand);
  border-color: var(--brand);
}

.ghost-btn,
.product-sort-toggle {
  background: var(--panel);
}

.success-btn {
  background: #12a66a;
  border-color: #12a66a;
}

.photo-thumb,
.detail-photo-thumb,
.attachment-thumb img {
  border-radius: 10px;
}

.detail-answer .attachment-thumb,
.attachment-file,
.attachment-thumb {
  background: color-mix(in srgb, var(--panel) 94%, var(--bg));
}

.article-audit-view .topbar {
  gap: 14px;
}

.article-category-current {
  min-height: 50px;
}

.article-category-option em,
.nav-group b {
  font-weight: 700;
}

body[data-theme="dark"] {
  --bg: #202630;
  --bg-soft: #252c37;
  --panel: #2a313d;
  --panel-2: #303846;
  --line: #414a59;
  --line-soft: #37404d;
  --ink: #f4f7fb;
  --muted: #b4bfcc;
  --brand: #f4f7fb;
  --accent: #8fb0d2;
  --accent-soft: rgba(143, 176, 210, .14);
  --accent-strong: #9fbfe0;
  --green: rgba(143, 176, 210, .16);
  --green-ink: #dbe9f7;
  --plum: rgba(177, 161, 219, .16);
  --plum-ink: #dfd4ff;
  --shadow-soft: none;
  --focus-ring: 0 0 0 3px rgba(143, 176, 210, .22);
}

body[data-theme="dark"] .main {
  background:
    radial-gradient(circle at top left, rgba(143, 176, 210, .08), transparent 34rem),
    var(--bg);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .archive-tools,
body[data-theme="dark"] .candidate-panel,
body[data-theme="dark"] .case-detail,
body[data-theme="dark"] .import-dialog,
body[data-theme="dark"] .publish-dialog,
body[data-theme="dark"] .teamly-expand-preview,
body[data-theme="dark"] .preview-box,
body[data-theme="dark"] .article-category-panel,
body[data-theme="dark"] .category-suggestions {
  box-shadow: none;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .compact-field input,
body[data-theme="dark"] .category-search,
body[data-theme="dark"] .category-select,
body[data-theme="dark"] .archive-category-search,
body[data-theme="dark"] .archive-category-select,
body[data-theme="dark"] .article-category-search,
body[data-theme="dark"] .article-category-current,
body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .product-sort-toggle,
body[data-theme="dark"] .preview-box,
body[data-theme="dark"] .publish-target,
body[data-theme="dark"] .publish-attachments,
body[data-theme="dark"] .import-diagnostics,
body[data-theme="dark"] .teamly-expand-preview {
  color: var(--ink);
  background: var(--panel-2);
  border-color: var(--line);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #8f9baa;
}

body[data-theme="dark"] .case-row {
  background: var(--panel);
}

body[data-theme="dark"] .case-row:hover {
  background: color-mix(in srgb, var(--panel-2) 82%, var(--panel));
}

body[data-theme="dark"] .case-row.selected {
  background: rgba(143, 176, 210, .13);
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

body[data-theme="dark"] .tab {
  color: var(--muted);
  background: rgba(244, 247, 251, .045);
  border-color: var(--line-soft);
}

body[data-theme="dark"] .tab.active,
body[data-theme="dark"] .download-btn {
  color: #16202d;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

body[data-theme="dark"] .primary-btn {
  color: #16202d;
  background: var(--ink);
  border-color: var(--ink);
}

body[data-theme="dark"] .status-badge,
body[data-theme="dark"] .decision-btn {
  color: var(--muted);
  background: rgba(244, 247, 251, .055);
}

body[data-theme="dark"] .status-badge.check,
body[data-theme="dark"] .decision-btn.check.active,
body[data-theme="dark"] .answer-waiting {
  color: #f7d984;
  background: rgba(247, 217, 132, .13);
  border-color: rgba(247, 217, 132, .22);
}

body[data-theme="dark"] .status-badge.add,
body[data-theme="dark"] .decision-btn.add.active,
body[data-theme="dark"] .answer-ready {
  color: #dbe9f7;
  background: rgba(143, 176, 210, .16);
  border-color: rgba(143, 176, 210, .24);
}

body[data-theme="dark"] .status-badge.done,
body[data-theme="dark"] .decision-btn.done.active {
  color: #d4dbe5;
  background: rgba(212, 219, 229, .12);
  border-color: rgba(212, 219, 229, .2);
}

body[data-theme="dark"] .status-badge.error,
body[data-theme="dark"] .error-btn {
  color: #ffb4ad;
  background: rgba(255, 122, 122, .12);
  border-color: rgba(255, 122, 122, .24);
}

body[data-theme="dark"] .teamly-link,
body[data-theme="dark"] .telegram-link,
body[data-theme="dark"] .article-category-reset {
  color: var(--accent-strong);
}

/* 2026-07-13 live Jino cosmetic corrections.
   Keeps the visual layer consistent where older dark-theme selectors had
   higher specificity than the unification block above. */
body[data-theme="dark"] .nav-item.active {
  color: var(--ink);
  background: rgba(143, 176, 210, .14);
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

body[data-theme="dark"] .nav-group b {
  color: var(--ink);
  background: rgba(143, 176, 210, .14);
}

body[data-theme="dark"] .nav-group summary::after {
  color: var(--muted);
}

body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .sidebar-collapse,
body[data-theme="dark"] .side-tools a,
body[data-theme="dark"] .side-tools button,
body[data-theme="dark"] .side-toggle {
  color: var(--ink);
  background: var(--panel-2);
  border-color: var(--line);
}

body[data-theme="dark"] .side-tools a:hover,
body[data-theme="dark"] .side-tools button:hover,
body[data-theme="dark"] .side-toggle:hover,
body[data-theme="dark"] .theme-toggle:hover,
body[data-theme="dark"] .sidebar-collapse:hover {
  background: color-mix(in srgb, var(--panel-2) 78%, var(--accent-soft));
}

body[data-theme="dark"] .case-row.selected {
  background: rgba(143, 176, 210, .13);
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

body[data-theme="dark"] .detail-answer,
body[data-theme="dark"] .detail-photo-thumb,
body[data-theme="dark"] .attachment-file,
body[data-theme="dark"] .attachment-thumb,
body[data-theme="dark"] .photo-missing,
body[data-theme="dark"] .no-photo,
body[data-theme="dark"] .teamly-unknown {
  color: var(--ink);
  background: var(--panel-2);
  border-color: var(--line);
}

body[data-theme="dark"] .detail-section h4,
body[data-theme="dark"] .publish-target span,
body[data-theme="dark"] .publish-title-field span,
body[data-theme="dark"] .side-tools span {
  color: var(--muted);
}

body[data-theme="dark"] .article-audit-view .table-head,
body[data-theme="dark"] .article-audit-view .audit-row,
body[data-theme="dark"] .audit-category,
body[data-theme="dark"] .article-audit-empty-detail,
body[data-theme="dark"] .audit-comment,
body[data-theme="dark"] .audit-fragment {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

body[data-theme="dark"] .article-audit-view .audit-row.selected,
body[data-theme="dark"] .article-audit-view .audit-row:hover {
  background: rgba(143, 176, 210, .13);
}

body[data-theme="dark"] .audit-status,
body[data-theme="dark"] .audit-type {
  color: var(--muted);
  background: rgba(244, 247, 251, .055);
}

body[data-theme="dark"] .audit-status-actions .decision-btn,
body[data-theme="dark"] .audit-status-choice {
  color: var(--muted);
  background: rgba(244, 247, 251, .055);
  border-color: var(--line);
}

body[data-theme="dark"] .audit-status-actions .decision-btn.active,
body[data-theme="dark"] .audit-status-choice.active {
  color: #16202d;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

body[data-theme="dark"] .article-alpha-sort-toggle,
body[data-theme="dark"] #articleAuditAlphaSortIcon,
body[data-theme="dark"] .audit-letter {
  color: var(--ink);
  background: var(--panel-2);
  border-color: var(--line);
}

/* 2026-07-14 final cosmetic polish.
   Self-critique fixes before release:
   1) user card competed with navigation;
   2) dark theme still had uneven surfaces and weak input contrast;
   3) badges looked too much like primary actions;
   4) long case lists were visually noisy during scanning;
   5) modals and tool screens did not fully match the working UI. */
:root {
  --ui-radius-xs: 6px;
  --ui-radius-sm: 8px;
  --ui-radius-md: 10px;
  --ui-radius-lg: 12px;
  --ui-control-h: 42px;
  --ui-font-sm: 13px;
  --ui-font-md: 15px;
  --ui-font-lg: 20px;
  --ui-shadow-card: 0 12px 26px rgba(16, 24, 40, .045);
  --ui-shadow-float: 0 18px 48px rgba(16, 24, 40, .13);
  --ui-blue-soft: #eaf2fb;
  --ui-blue-mid: #5b7fa7;
  --ui-blue-strong: #42698f;
  --ui-ink-soft: #344054;
}

html {
  color-scheme: light;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #222832;
  --bg-soft: #252d38;
  --panel: #2b333f;
  --panel-2: #323b49;
  --line: #465161;
  --line-soft: #3a4452;
  --ink: #f3f6fb;
  --muted: #b9c3d0;
  --brand: #f3f6fb;
  --accent: #9bb8d6;
  --accent-soft: rgba(155, 184, 214, .15);
  --accent-strong: #a9c4df;
  --green: rgba(155, 184, 214, .15);
  --green-ink: #dce9f6;
  --shadow-soft: none;
}

body {
  font-size: var(--ui-font-md);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-size: 14px;
  line-height: 1.35;
}

button,
a,
summary,
.case-row,
.photo-thumb,
.detail-photo-thumb,
.attachment-thumb,
.attachment-file {
  -webkit-tap-highlight-color: transparent;
}

.main {
  background:
    radial-gradient(circle at 0 0, rgba(91, 127, 167, .07), transparent 34rem),
    linear-gradient(180deg, rgba(255, 255, 255, .42), transparent 18rem),
    var(--bg);
}

.sidebar {
  scrollbar-gutter: stable;
  border-right: 1px solid var(--line-soft);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(102, 112, 133, .34);
  background-clip: padding-box;
}

.brand {
  gap: 10px;
}

.page-head {
  padding-right: min(420px, 32vw);
}

.brand h1,
.page-head h2,
.launcher-head h1,
.auth-brand h1 {
  letter-spacing: 0;
  color: var(--ink);
}

.page-head h2 {
  font-size: clamp(26px, 2.3vw, 34px);
  line-height: 1.12;
}

.brand h1 {
  font-size: 17px;
}

.brand p,
.page-head p,
.launcher-head p,
.auth-brand p,
.detail-date,
.teamly-confidence,
.no-photo,
.teamly-unknown,
.photo-missing {
  color: var(--muted);
}

.session-panel {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 22;
  display: flex;
  width: auto;
  max-width: min(380px, calc(100vw - 44px));
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  box-shadow: var(--ui-shadow-card);
}

.session-panel span {
  max-width: 210px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-panel .ghost-btn {
  min-height: 32px;
  padding: 6px 10px;
}

body.sidebar-collapsed .session-panel {
  display: flex;
}

.nav,
.side-tools,
.side-section {
  gap: 5px;
}

.nav-group summary,
.nav-item,
.side-tools a,
.side-tools button,
.side-toggle {
  border-radius: var(--ui-radius-sm);
}

.nav-group summary {
  color: var(--ink);
  font-weight: 700;
}

.nav-subgroup summary {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: none;
}

.nav-item,
.side-tools a,
.side-tools button,
.side-toggle {
  color: var(--muted);
  font-weight: 500;
}

.nav-item:hover,
.side-tools a:hover,
.side-tools button:hover,
.side-toggle:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-soft) 54%, transparent);
}

.nav-item.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-soft) 86%, var(--panel));
  box-shadow: inset 3px 0 0 var(--accent-strong);
  font-weight: 700;
}

.nav-group b {
  min-width: 30px;
  padding: 2px 8px;
  color: var(--ui-blue-strong);
  background: var(--ui-blue-soft);
  text-align: center;
}

.topbar,
.archive-tools,
.candidate-panel,
.case-detail,
.auth-card,
.launcher-tile,
.users-admin-card,
.import-dialog,
.publish-dialog {
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-lg);
  background: var(--panel);
  box-shadow: var(--ui-shadow-card);
}

.topbar,
.archive-tools {
  gap: 14px;
  align-items: end;
}

.search-field,
.compact-field,
.dialog-field,
.publish-title-field {
  gap: 7px;
}

label,
.compact-field span,
.dialog-field span,
.search-field label,
.publish-title-field span,
.table-head,
.teamly-preview-label,
.detail-section h4 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

input,
select,
textarea,
.category-search,
.category-select,
.archive-category-search,
.archive-category-select,
.article-category-search,
.article-category-current,
.publish-title-input,
.publish-text {
  min-height: var(--ui-control-h);
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-sm);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  color: var(--ink);
}

textarea,
.publish-text,
.audit-comment {
  line-height: 1.55;
}

input:hover,
select:hover,
textarea:hover,
.article-category-current:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

input:focus,
select:focus,
textarea:focus,
.article-category-current:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .72;
}

.status-strip {
  gap: 8px;
  align-items: center;
}

.tab {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-2) 78%, var(--panel));
  font-weight: 650;
}

.tab:hover {
  color: var(--ink);
  border-color: var(--line);
}

.tab.active,
.download-btn,
.primary-btn {
  color: #ffffff;
  background: var(--ui-blue-strong);
  border-color: var(--ui-blue-strong);
}

.tab.active:hover,
.download-btn:hover,
.primary-btn:hover {
  background: #385d80;
  border-color: #385d80;
}

.table-head {
  min-height: 44px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 94%, var(--bg));
}

.case-row {
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
  transition: background-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.case-row:hover {
  background: color-mix(in srgb, var(--bg-soft) 62%, var(--panel));
}

.case-row.selected {
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--panel));
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

.case-row .fragment,
.detail-section p,
.teamly-expand-body p,
.audit-fragment {
  color: var(--ink);
  font-weight: 400;
}

.case-row .date,
.detail-date,
.answer-date {
  font-size: 13px;
  font-weight: 650;
}

.status-badge,
.decision-btn,
.answer-ready,
.answer-waiting,
.thread-group-badge,
.deleted-meta {
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.status-badge.check,
.decision-btn.check.active,
.answer-waiting {
  color: #745810;
  background: #fff4d8;
  border-color: #efdca3;
}

.status-badge.add,
.decision-btn.add.active,
.answer-ready {
  color: #335f8b;
  background: #edf5fd;
  border-color: #cfe0f2;
}

.status-badge.done,
.decision-btn.done.active {
  color: #475467;
  background: #eef2f7;
  border-color: #d9e0ea;
}

.status-badge.error,
.error-btn,
.deleted-meta {
  color: #a33535;
  background: #fff0f0;
  border-color: #f3c6c6;
}

.decision-main,
.decision-actions,
.deleted-actions,
.dialog-actions,
.audit-status-actions {
  gap: 8px;
}

.ghost-btn,
.product-sort-toggle,
.done-btn,
.return-queue-btn,
.case-delete,
.article-alpha-sort-toggle {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
}

.ghost-btn:hover,
.product-sort-toggle:hover,
.done-btn:hover,
.return-queue-btn:hover,
.article-alpha-sort-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--panel));
}

.case-detail {
  scrollbar-gutter: stable;
}

.detail-head {
  gap: 8px;
}

.detail-head h3 {
  line-height: 1.25;
}

.detail-section {
  padding: 15px 0;
  border-color: var(--line-soft);
}

.detail-answer,
.thread-message,
.teamly-expand-preview,
.publish-target,
.publish-attachments,
.preview-box,
.import-diagnostics {
  border: 1px solid var(--line-soft);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
}

.detail-photo-grid,
.attachment-list {
  gap: 8px;
}

.photo-thumb,
.detail-photo-thumb,
.attachment-thumb,
.attachment-file {
  border: 1px solid var(--line);
  border-radius: var(--ui-radius-sm);
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
}

.photo-thumb img,
.detail-photo-thumb img,
.attachment-thumb img {
  border-radius: calc(var(--ui-radius-sm) - 2px);
}

.photo-thumb span,
.detail-photo-thumb span {
  background: rgba(20, 31, 45, .82);
  color: #ffffff;
}

.article-category-current,
.article-category-option {
  border-radius: var(--ui-radius-sm);
}

.article-category-panel,
.category-suggestions {
  border: 1px solid var(--line);
  box-shadow: var(--ui-shadow-float);
}

.article-category-option.active,
.category-suggestion:hover,
.category-suggestion:focus {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel));
}

.article-audit-view .audit-row {
  grid-template-columns: 84px minmax(0, 1fr) minmax(180px, .42fr);
}

.audit-letter {
  border-radius: var(--ui-radius-sm);
  color: var(--ui-blue-strong);
  background: var(--ui-blue-soft);
}

.audit-status,
.audit-type {
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--panel-2) 74%, var(--panel));
}

.teamly-expand-preview header {
  min-height: 48px;
  padding: 12px 16px;
}

.teamly-expand-body {
  padding: 16px;
}

.auth-gate,
.app-launcher {
  background:
    radial-gradient(circle at 16% 10%, rgba(91, 127, 167, .12), transparent 30rem),
    var(--bg);
}

.auth-card,
.launcher-tile {
  box-shadow: var(--ui-shadow-card);
}

.launcher-grid {
  align-items: stretch;
}

.launcher-tile {
  text-align: left;
}

.users-admin-card {
  max-height: min(760px, calc(100vh - 64px));
}

body[data-theme="dark"] .main {
  background:
    radial-gradient(circle at 0 0, rgba(155, 184, 214, .065), transparent 34rem),
    var(--bg);
}

body[data-theme="dark"] .session-panel,
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .archive-tools,
body[data-theme="dark"] .candidate-panel,
body[data-theme="dark"] .case-detail,
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .launcher-tile,
body[data-theme="dark"] .users-admin-card,
body[data-theme="dark"] .import-dialog,
body[data-theme="dark"] .publish-dialog,
body[data-theme="dark"] .detail-answer,
body[data-theme="dark"] .thread-message,
body[data-theme="dark"] .teamly-expand-preview,
body[data-theme="dark"] .publish-target,
body[data-theme="dark"] .publish-attachments,
body[data-theme="dark"] .preview-box,
body[data-theme="dark"] .import-diagnostics,
body[data-theme="dark"] .article-category-panel,
body[data-theme="dark"] .category-suggestions {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: none;
}

body[data-theme="dark"] .table-head {
  background: #29313c;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .category-search,
body[data-theme="dark"] .category-select,
body[data-theme="dark"] .archive-category-search,
body[data-theme="dark"] .archive-category-select,
body[data-theme="dark"] .article-category-search,
body[data-theme="dark"] .article-category-current,
body[data-theme="dark"] .publish-title-input,
body[data-theme="dark"] .publish-text,
body[data-theme="dark"] .audit-comment {
  color: var(--ink);
  background: #333d4b;
  border-color: #526071;
}

body[data-theme="dark"] input:hover,
body[data-theme="dark"] select:hover,
body[data-theme="dark"] textarea:hover,
body[data-theme="dark"] .article-category-current:hover {
  border-color: #7896b8;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #a8b3c1;
}

body[data-theme="dark"] .tab {
  color: #c5cfdb;
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .04);
}

body[data-theme="dark"] .tab:hover {
  color: var(--ink);
  border-color: #526071;
}

body[data-theme="dark"] .tab.active,
body[data-theme="dark"] .download-btn,
body[data-theme="dark"] .primary-btn {
  color: #17212e;
  background: #b5cce4;
  border-color: #b5cce4;
}

body[data-theme="dark"] .nav-item.active {
  color: var(--ink);
  background: rgba(155, 184, 214, .15);
  box-shadow: inset 3px 0 0 #b5cce4;
}

body[data-theme="dark"] .nav-group b,
body[data-theme="dark"] .audit-letter {
  color: #dbe9f7;
  background: rgba(155, 184, 214, .13);
}

body[data-theme="dark"] .case-row {
  background: var(--panel);
  border-color: var(--line-soft);
}

body[data-theme="dark"] .case-row:hover {
  background: #303947;
}

body[data-theme="dark"] .case-row.selected {
  background: rgba(155, 184, 214, .13);
  box-shadow: inset 3px 0 0 #b5cce4;
}

body[data-theme="dark"] .status-badge.check,
body[data-theme="dark"] .decision-btn.check.active,
body[data-theme="dark"] .answer-waiting {
  color: #f5dc91;
  background: rgba(245, 220, 145, .13);
  border-color: rgba(245, 220, 145, .25);
}

body[data-theme="dark"] .status-badge.add,
body[data-theme="dark"] .decision-btn.add.active,
body[data-theme="dark"] .answer-ready {
  color: #dce9f6;
  background: rgba(155, 184, 214, .16);
  border-color: rgba(155, 184, 214, .3);
}

body[data-theme="dark"] .status-badge.done,
body[data-theme="dark"] .decision-btn.done.active {
  color: #d8e0ea;
  background: rgba(216, 224, 234, .12);
  border-color: rgba(216, 224, 234, .22);
}

body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .product-sort-toggle,
body[data-theme="dark"] .done-btn,
body[data-theme="dark"] .return-queue-btn,
body[data-theme="dark"] .article-alpha-sort-toggle,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .sidebar-collapse,
body[data-theme="dark"] .side-tools a,
body[data-theme="dark"] .side-tools button,
body[data-theme="dark"] .side-toggle {
  color: var(--ink);
  background: #333d4b;
  border-color: #526071;
}

body[data-theme="dark"] .teamly-link,
body[data-theme="dark"] .telegram-link,
body[data-theme="dark"] .article-category-reset {
  color: #bfd7f0;
}

body[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.35);
  opacity: .78;
}

/* 2026-07-14 sidebar and article-audit cleanup.
   Keeps navigation readable and fixes visual regressions without changing data flow. */
.sidebar .nav,
.sidebar .nav-group,
.sidebar .nav-subgroup,
.sidebar .side-tools,
.sidebar .side-section {
  font-family: inherit !important;
  font-size: 15px !important;
}

.sidebar .nav-group summary,
.sidebar .nav-root,
.sidebar .nav-item,
.sidebar .side-tools a,
.sidebar .side-tools button,
.sidebar .side-toggle {
  font-family: inherit !important;
  min-height: 42px !important;
  padding-block: 10px !important;
  font-size: 15px !important;
  line-height: 1.42 !important;
  letter-spacing: 0 !important;
}

.sidebar .nav-group summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-weight: 700 !important;
}

.sidebar .nav-subgroup summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 34px !important;
  padding: 8px 12px 6px !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
}

.sidebar .nav-subgroup .nav-item,
#articleAuditNavGroup .nav-subgroup .nav-item {
  min-height: 38px !important;
  padding: 9px 10px 9px 18px !important;
  font-size: 15px !important;
  line-height: 1.42 !important;
  font-weight: 500 !important;
}

.sidebar .nav-item,
.sidebar .side-tools a,
.sidebar .side-tools button {
  align-items: flex-start !important;
}

.sidebar .nav-group summary span:first-child,
.sidebar .nav-item span:first-child,
.sidebar .side-tools a span:first-child,
.sidebar .side-tools button span:first-child {
  line-height: 1.35 !important;
}

.sidebar .nav-group b {
  min-width: 32px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

.sidebar .nav-subgroup .nav-item b,
#articleAuditNavGroup .nav-subgroup .nav-item b {
  font-size: 12px !important;
  font-weight: 700 !important;
}

.sidebar .nav-item,
.sidebar .nav-group summary,
.sidebar .nav-subgroup summary,
.sidebar .side-toggle,
.sidebar .side-tools a,
.sidebar .side-tools button {
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

.sidebar .nav-item.active,
#articleAuditNavGroup .nav-subgroup .nav-item.active {
  color: var(--ink);
  background: var(--ui-blue-soft);
  box-shadow: inset 3px 0 0 var(--ui-blue-strong);
  font-weight: 700;
}

#articleAuditNavGroup .nav-subgroup .nav-item.is-zero:not(.active) {
  color: var(--muted);
  opacity: .72;
}

#articleAuditNavGroup .nav-subgroup .nav-item.is-zero:not(.active)::after {
  content: none;
}

.article-audit-view .topbar,
.article-audit-view .candidate-panel,
.article-audit-view .case-detail,
.article-audit-view .table-head,
.article-audit-view .audit-row {
  background: var(--panel);
  border-color: var(--line);
}

.article-audit-view .audit-row.selected {
  background: color-mix(in srgb, var(--ui-blue-soft) 86%, white);
  box-shadow: inset 4px 0 0 var(--ui-blue-mid);
}

.article-audit-view .audit-row:hover {
  background: color-mix(in srgb, var(--ui-blue-soft) 58%, white);
}

.article-alpha-sort-toggle {
  min-width: 54px;
  justify-content: center;
  gap: 0;
  border-color: transparent;
  background: var(--ui-blue-soft);
  color: var(--ui-blue-strong);
  box-shadow: none;
}

#articleAuditAlphaSortIcon {
  min-width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

body[data-theme="dark"] .sidebar .nav-item.active,
body[data-theme="dark"] #articleAuditNavGroup .nav-subgroup .nav-item.active {
  color: var(--ink);
  background: rgba(155, 184, 214, .16);
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

body[data-theme="dark"] .article-audit-view .topbar,
body[data-theme="dark"] .article-audit-view .candidate-panel,
body[data-theme="dark"] .article-audit-view .case-detail,
body[data-theme="dark"] .article-audit-view .table-head,
body[data-theme="dark"] .article-audit-view .audit-row,
body[data-theme="dark"].article-audit-view .topbar,
body[data-theme="dark"].article-audit-view .candidate-panel,
body[data-theme="dark"].article-audit-view .case-detail,
body[data-theme="dark"].article-audit-view .table-head,
body[data-theme="dark"].article-audit-view .audit-row {
  background: var(--panel);
  border-color: var(--line-soft);
}

body[data-theme="dark"] .article-audit-view .audit-row.selected,
body[data-theme="dark"].article-audit-view .audit-row.selected {
  background: rgba(155, 184, 214, .14);
  box-shadow: inset 4px 0 0 var(--accent-strong);
}

body[data-theme="dark"] .article-audit-view .audit-row:hover,
body[data-theme="dark"].article-audit-view .audit-row:hover {
  background: rgba(155, 184, 214, .09);
}

body[data-theme="dark"] .article-alpha-sort-toggle {
  border-color: var(--line-soft);
  background: rgba(155, 184, 214, .14);
  color: var(--accent-strong);
}

.sidebar .nav-group summary::after,
.sidebar .nav-subgroup summary::after {
  content: "";
  flex: 0 0 auto;
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--muted);
  opacity: .72;
  font-size: 0;
  line-height: 0;
  background: transparent !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  transform: translateY(-1px) rotate(45deg);
  transition: transform .16s ease, color .16s ease;
  pointer-events: none;
}

.sidebar .nav-subgroup summary::after {
  width: 5px;
  height: 5px;
}

.sidebar .nav-group:not([open]) > summary::after,
.sidebar .nav-subgroup:not([open]) > summary::after {
  transform: translateY(0) rotate(-45deg);
}

.sidebar .nav-group summary:hover::after,
.sidebar .nav-subgroup summary:hover::after {
  color: var(--ui-blue-strong);
  opacity: 1;
}

.sidebar .nav-group summary::-webkit-details-marker,
.sidebar .nav-subgroup summary::-webkit-details-marker {
  display: none !important;
}

.sidebar .nav-group > summary,
.sidebar .nav-subgroup > summary {
  list-style: none !important;
  -webkit-appearance: none !important;
  appearance: none;
}

.sidebar .nav-group > summary::marker,
.sidebar .nav-subgroup > summary::marker {
  content: "";
}

.sidebar .nav-group > summary::-moz-list-bullet,
.sidebar .nav-subgroup > summary::-moz-list-bullet {
  font-size: 0 !important;
}

.sidebar .nav-group summary::after,
.sidebar .nav-subgroup summary::after {
  content: none !important;
  display: none !important;
}

.sidebar .nav-group > summary,
.sidebar .nav-subgroup > summary {
  list-style: revert !important;
}

.sidebar .nav-group summary::-webkit-details-marker,
.sidebar .nav-subgroup summary::-webkit-details-marker {
  display: inline-block !important;
}

.article-audit-run-status {
  align-self: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

body[data-theme="dark"] .case-row.bulk-selected {
  background: rgba(127, 159, 195, .14);
}

body[data-theme="dark"] .bulk-actions {
  border-color: #3a4452;
  background: color-mix(in srgb, var(--panel) 90%, #263241);
}

.article-audit-view .table-head.article-audit-select-head,
.article-audit-view .audit-row {
  grid-template-columns: 34px 54px minmax(320px, 1fr) minmax(160px, 210px) !important;
  column-gap: 16px;
}

.article-audit-view .table-head.article-audit-select-head {
  align-items: center;
  min-height: 54px;
  padding: 12px 22px;
}

.article-audit-view .audit-row {
  align-items: start;
  min-height: 0;
  padding: 16px 22px;
}

.article-audit-view .audit-select-cell {
  align-self: start;
  margin-top: 4px;
}

.article-audit-view .audit-letter {
  width: 38px;
  height: 38px;
  justify-self: start;
}

.article-audit-view .audit-row .fragment {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-self: start;
}

.article-audit-view .audit-row .fragment small,
.article-audit-view .audit-row .fragment b,
.article-audit-view .audit-row .fragment em {
  overflow-wrap: anywhere;
}

.article-audit-view .audit-row .fragment b {
  font-size: 16px;
  line-height: 1.35;
}

.article-audit-view .audit-row .fragment em {
  line-height: 1.4;
}

.article-audit-view .audit-row-meta {
  align-self: start;
  justify-content: flex-start;
  align-items: flex-start;
}

.article-audit-view .article-audit-bulk-actions {
  top: 0;
  border-radius: 0;
}

@media (max-width: 1180px) {
  .article-audit-view .table-head.article-audit-select-head,
  .article-audit-view .audit-row {
    grid-template-columns: 34px 50px minmax(0, 1fr) !important;
  }

  .article-audit-view .table-head.article-audit-select-head > span:last-child,
  .article-audit-view .audit-row-meta {
    grid-column: 3;
  }

  .article-audit-view .audit-row-meta {
    margin-top: 8px;
  }
}

@media (max-width: 1180px) {
  .session-panel {
    top: 10px;
    right: 10px;
    max-width: 280px;
  }

  .session-panel span {
    max-width: 150px;
  }

  .page-head {
    padding-right: 280px;
  }
}

@media (max-width: 760px) {
  .session-panel {
    position: static;
    margin: 12px 0;
    max-width: none;
  }

  .session-panel span {
    max-width: 100%;
  }

  .page-head {
    padding-right: 0;
  }

  .topbar,
  .archive-tools {
    grid-template-columns: 1fr;
  }
}

.hidden,
[hidden],
.topbar > .search-field.hidden,
.analytics-controls label[hidden] {
  display: none !important;
}

