*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --page-bg: #ffffff;
  --app-bg: #ffffff;
  --secondary-bg: #f7f7f7;
  --hover-bg: #f2f2f2;
  --table-hover: #fafafa;
  --divider: #e5e5e5;
  --divider-strong: #d4d4d4;
  --border-input: #d7d7d7;
  --text-primary: #0f0f0f;
  --text-secondary: #777777;
  --text-inactive: #a3a3a3;
  --blue: #0f0f0f;
  --blue-hover: #000000;
  --blue-light: rgba(15, 15, 15, 0.08);
  --green: #0a7f42;
  --red: #d92d20;
  --orange: #b54708;
  --violet: #5b5bd6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.08);
  --primary-bg: #0f0f0f;
  --primary-bg-hover: #000000;
  --primary-text: #ffffff;
  --danger-bg: #fff1f0;
  --danger-text: #b42318;
  --success-bg: #ecfdf3;
  --success-text: #067647;
  --warning-bg: #fffaeb;
  --warning-text: #93370d;
  --page-bg-rgb: 255, 255, 255;
  --sidebar-width: 236px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-24: 24px;
  --spacing-32: 32px;
  --spacing-40: 40px;
  --transition: 160ms cubic-bezier(.2, .8, .2, 1);
  --radius-container: 8px;
  --radius-card: 8px;
  --radius-card-sm: 6px;
  --radius-button: 7px;
  --radius-input: 7px;
  --radius-round: 999px;
  --radius-avatar: 50%;
  --bg: var(--page-bg);
  --card: var(--app-bg);
  --card-border: var(--divider);
  --text: var(--text-primary);
  --text-dim: var(--text-secondary);
  --accent-a: var(--blue);
  --accent-b: var(--green);
  --grad: linear-gradient(135deg, #0f0f0f, #3a3a3a);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #000000;
  --app-bg: #101010;
  --secondary-bg: #181818;
  --hover-bg: #1f1f1f;
  --table-hover: #141414;
  --divider: #262626;
  --divider-strong: #343434;
  --border-input: #363636;
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1a1;
  --text-inactive: #6f6f6f;
  --blue: #f5f5f5;
  --blue-hover: #ffffff;
  --blue-light: rgba(255, 255, 255, 0.1);
  --green: #32d583;
  --red: #f97066;
  --orange: #fdb022;
  --violet: #a4a7ff;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.45);
  --primary-bg: #f5f5f5;
  --primary-bg-hover: #ffffff;
  --primary-text: #000000;
  --danger-bg: rgba(249, 112, 102, 0.12);
  --danger-text: #ffb4ad;
  --success-bg: rgba(50, 213, 131, 0.12);
  --success-text: #75e0a7;
  --warning-bg: rgba(253, 176, 34, 0.14);
  --warning-text: #fec84b;
  --page-bg-rgb: 0, 0, 0;
  --bg: var(--page-bg);
  --card: var(--app-bg);
  --card-border: var(--divider);
  --text: var(--text-primary);
  --text-dim: var(--text-secondary);
  --accent-a: var(--blue);
  --accent-b: var(--green);
  --grad: linear-gradient(135deg, #ffffff, #a3a3a3);
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 620px;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  overflow: hidden;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

body.auth-mode {
  align-items: center;
  justify-content: center;
  padding: 28px;
}

::selection {
  background: rgba(37, 99, 235, 0.18);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  min-height: 34px;
  background: #ccd2dc;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #aeb7c5;
}

.hidden {
  display: none !important;
}

#appShell {
  width: 100%;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

#appShell:not(.hidden) {
  display: flex;
}

.auth-card {
  position: relative;
  display: grid;
  gap: 22px;
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--divider);
  border-radius: 14px;
  background: color-mix(in srgb, var(--app-bg) 96%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 10%, transparent);
}

.auth-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-logo,
.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: linear-gradient(145deg, #111827, #2f6fed) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22) !important;
  font-size: 12px;
  font-weight: 800;
}

.auth-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 15px;
  letter-spacing: 0;
}

.auth-logo img,
.logo img {
  width: 82%;
  height: 82%;
  display: block;
  object-fit: contain;
}

.auth-logo img { width: 92%; height: 92%; }

.auth-version {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 760;
}

.auth-copy {
  display: grid;
  gap: 7px;
}

.auth-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 34px;
  font-weight: 780;
  line-height: 1.05;
}

.auth-sub {
  max-width: 340px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-field-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

#keyInput {
  width: 100% !important;
  height: 48px;
  min-height: 48px;
  padding: 0 14px !important;
  border-radius: 10px !important;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.auth-btns,
.btnrow,
.row,
.queue-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--orange);
  font-size: 12px;
  line-height: 1.4;
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--divider);
  background: var(--page-bg);
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--app-bg) 34%, transparent);
  backdrop-filter: blur(20px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--divider);
}

.title {
  min-width: 0;
}

.title h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

.title p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-banner {
  margin: 10px;
  padding: 14px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 58%, var(--divider));
  border-radius: 8px;
  background: color-mix(in srgb, var(--red) 14%, var(--app-bg));
  color: var(--danger-text);
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.version-banner:hover {
  border-color: var(--red);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--red) 18%, transparent);
  transform: translateY(-1px);
}

.version-banner-title {
  color: var(--danger-text);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.version-banner-sub {
  margin-top: 5px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.sidebar-stats {
  display: grid;
  gap: 11px;
  padding: 11px 10px 12px;
  border-bottom: 1px solid var(--divider);
}

.stat-label,
.label {
  color: var(--text-primary);
  font-weight: 720;
}

.stat-label {
  margin-bottom: 6px;
  font-size: 11px;
}

.progress-bar {
  display: flex;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(208, 213, 221, 0.75);
  border-radius: 999px;
  background: #edf0f4;
}

.progress-bar .seg {
  height: 100%;
  transition: width 240ms cubic-bezier(.2, .8, .2, 1);
}

.seg.pending {
  background: #f79009;
}

.seg.posting,
.seg.fill {
  background: var(--blue);
}

.seg.done {
  background: #12b76a;
}

.seg.error {
  background: #f04438;
}

.seg.empty {
  background: #edf0f4;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 10px;
}

.badge {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 10px;
  padding: 8px 10px;
  border: 1px solid #abefc6;
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 660;
  box-shadow: 0 1px 1px rgba(6, 118, 71, 0.06);
}

.badge.visible {
  display: flex;
  animation: cfFadeIn 180ms ease-out;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17b26a;
  box-shadow: 0 0 0 4px rgba(23, 178, 106, 0.12);
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 8px;
}

.sidebar-divider {
  height: 1px;
  margin: 7px 10px;
  background: rgba(208, 213, 221, 0.74);
}

.tabbtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 1px 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b5565;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.tabbtn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  transform: none;
}

.tabbtn.active {
  border-color: transparent;
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
  font-weight: 760;
}

.tabbtn.active::before {
  display: none;
}

.sidebar-nav .tabbtn.has-activity .tab-icon {
  color: #32d583;
}

.tabbtn.has-activity::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #32d583;
  box-shadow: 0 0 0 0 rgba(50, 213, 131, 0.5);
  animation: cfRunPulse 1.8s infinite;
}

@keyframes cfRunPulse {
  0% { box-shadow: 0 0 0 0 rgba(50, 213, 131, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(50, 213, 131, 0); }
  100% { box-shadow: 0 0 0 0 rgba(50, 213, 131, 0); }
}

.tabbtn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.34);
  outline-offset: 2px;
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: currentColor;
}

.tab-icon svg {
  width: 21px;
  height: 21px;
}

.tab-label {
  overflow: hidden;
  font-size: 14px;
  font-weight: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-link {
  padding: 8px 8px 14px;
}

.theme-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 10px 10px 0;
  padding: 3px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--secondary-bg);
}

.theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.theme-option:hover {
  border: 0;
  background: var(--hover-bg);
  box-shadow: none;
  color: var(--text-primary);
  transform: none;
}

.theme-option.active {
  background: var(--app-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.support-link a,
.link {
  border: 0;
  background: transparent;
  color: var(--blue) !important;
  font: inherit;
  font-weight: 660;
  text-decoration: none;
  cursor: pointer;
}

.support-link a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text-primary) !important;
  font-size: 14px;
  font-weight: 760;
}

.support-link a:hover {
  background: var(--hover-bg);
  text-decoration: none;
}

.support-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.support-link a:hover,
.link:hover {
  color: var(--blue-hover) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.main {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: transparent;
}

.topbar {
  min-height: 50px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--page-bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar #licenseInstructions {
  flex-wrap: wrap;
  gap: 8px !important;
}

.topbar .link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--divider);
  border-radius: 7px;
  background: var(--secondary-bg);
  color: var(--text-secondary) !important;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
  text-decoration: none !important;
}

.topbar .link:hover {
  border-color: var(--divider-strong);
  background: var(--app-bg);
  color: var(--text-primary) !important;
  box-shadow: var(--shadow);
  text-decoration: none !important;
}

.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

h2,
h3,
h4 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-weight: 760;
  line-height: 1.22;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

h4 {
  font-size: 13px;
}

#tabPosts,
#tabAi,
#tabLike,
#tabSmartComment,
#tabWarmup,
#tabAutoReply,
#tabNotify,
#tabViral,
#tabAnalysis,
#tabCollected,
#tabCommenters,
#tabAiAgent {
  width: min(1040px, 100%);
  animation: cfFadeIn 190ms ease-out;
}

/* Keep the commenter search controls on one shared vertical baseline. */
#tabCommenters .commenters-filter-row {
  align-items: center;
  min-height: 38px;
}

#tabCommenters .commenters-filter-row > label,
#tabCommenters .commenters-filter-row > button {
  display: inline-flex;
  align-items: center !important;
  justify-content: center;
  min-height: 38px;
  box-sizing: border-box;
}

#tabCommenters .commenters-filter-limit {
  display: inline-grid !important;
  grid-template-columns: auto 52px;
  align-items: center !important;
  gap: 4px;
  height: 38px;
  min-height: 38px;
}

#tabCommenters #commentersSearchLimit {
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  line-height: 1;
}

#postSettings,
#smartSettings,
.settings-card,
.panel,
.card,
.queue-head,
.analysis-panel,
.viral-panel,
.collected-panel,
.infocard,
.list-item,
details,
#docDropZone,
#docContextPreview,
#aiStatus,
#smartGenerateStatus,
#viralAnalysisResult,
#viralGenerated,
#analysisContextBanner,
#commentersSearchDbPanel {
  border: 1px solid var(--divider) !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--app-bg) 92%, transparent) !important;
  box-shadow: var(--shadow);
}

#postSettings,
#smartSettings,
.settings-card,
.panel,
.card,
.infocard {
  padding: 14px !important;
}

.infocards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.label {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.25;
}

.hint,
.flabel {
  color: var(--text-secondary);
  font-size: 12px;
}

.flabel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ta-wrap {
  position: relative;
  margin-bottom: 10px;
}

input,
textarea,
select {
  width: auto;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid var(--border-input) !important;
  border-radius: 7px !important;
  background: var(--app-bg) !important;
  color: var(--text-primary) !important;
  font: inherit;
  outline: none;
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.02) !important;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  padding: 8px 10px !important;
}

textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.5;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #b9c2d0 !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue) !important;
  background: var(--app-bg) !important;
  box-shadow: 0 0 0 3px var(--blue-light), 0 1px 2px rgba(16, 24, 40, 0.04) !important;
}

input[type="checkbox"],
input[type="radio"] {
  width: 15px;
  height: 15px;
  min-height: 0;
  accent-color: var(--blue);
}

.count {
  position: absolute;
  right: 28px;
  bottom: 7px;
  z-index: 1;
  padding: 1px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--app-bg) 88%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  pointer-events: none;
}

.ta-wrap > textarea {
  padding-bottom: 30px !important;
}

textarea::-webkit-resizer {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M4 10 10 4M7.5 10 10 7.5' stroke='%23777777' stroke-width='1.25' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right bottom;
}

html[data-theme="dark"] textarea::-webkit-resizer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M4 10 10 4M7.5 10 10 7.5' stroke='%23A1A1A1' stroke-width='1.25' stroke-linecap='round'/%3E%3C/svg%3E");
}

button {
  min-height: 34px;
  border: 1px solid var(--divider-strong);
  border-radius: 7px;
  background: var(--app-bg);
  color: var(--text-primary);
  font: inherit;
  font-weight: 660;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.03);
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

button:hover {
  border-color: var(--divider-strong);
  background: var(--hover-bg);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

button:active {
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
  transform: translateY(0) scale(0.99);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
  transform: none;
}

button.primary,
button.ok,
.auth-btn-primary,
.btnwide {
  border-color: var(--primary-bg);
  background: linear-gradient(180deg, #1f2937, var(--primary-bg));
  color: var(--primary-text);
  box-shadow: 0 7px 18px rgba(17, 24, 39, 0.16);
}

button.primary:hover,
button.ok:hover,
.auth-btn-primary:hover,
.btnwide:hover {
  border-color: var(--primary-bg-hover);
  background: linear-gradient(180deg, #182230, var(--primary-bg-hover));
}

button.danger,
.danger {
  border-color: #fecdca;
  background: var(--danger-bg);
  color: var(--danger-text);
}

button.danger:hover,
.danger:hover {
  border-color: #f97066;
  background: #ffeceb;
}

.warn-btn {
  border-color: #fedf89;
  background: var(--warning-bg);
  color: var(--warning-text);
}

.auth-btn-secondary {
  background: var(--secondary-bg);
}

.auth-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.auth-btns button {
  width: 100%;
  min-height: 44px;
  padding: 0 14px !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
}

.auth-btn-primary {
  border-color: var(--primary-bg);
  background: var(--primary-bg);
  color: var(--primary-text);
}

.auth-btn-primary:disabled {
  border-color: var(--divider);
  background: var(--secondary-bg);
  color: var(--text-inactive);
  opacity: 1;
}

.auth-btn-secondary {
  border-color: var(--divider-strong);
  background: var(--app-bg);
  color: var(--text-primary);
}

.auth-help a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text-secondary) !important;
  font-weight: 700;
  text-decoration: none;
}

.auth-help a:hover {
  border-color: var(--divider-strong);
  background: var(--hover-bg);
  color: var(--text-primary) !important;
  text-decoration: none;
}

.btnrow {
  margin-bottom: 10px;
}

.post-main-actions {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.post-compose-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.post-compose-actions #addImageBtn,
.post-compose-actions #add {
  min-height: var(--control-height, 38px);
}

.post-compose-actions #addImageAllBtn {
  min-height: var(--control-height, 38px);
}

.post-compose-actions #add {
  min-width: 112px;
}

.btnrow button,
.auth-btns button,
.queue-actions button {
  padding: 7px 12px;
}

.btnwide {
  flex: 1;
}

.row {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 8px;
  padding: 11px 12px !important;
}

.queue-actions {
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.empty {
  padding: 22px 18px;
  border: 1px dashed #c8d0dc;
  border-radius: 8px;
  background: var(--secondary-bg);
  color: var(--text-secondary);
  text-align: center;
}

.post-item,
.item,
.log-item,
.viral-item,
.collected-item,
.list-item {
  padding: 11px !important;
  border: 1px solid var(--divider) !important;
  border-radius: 8px !important;
  background: var(--app-bg) !important;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.post-item:hover,
.item:hover,
.viral-item:hover,
.collected-item:hover,
.list-item:hover {
  border-color: var(--divider-strong) !important;
  background: var(--hover-bg) !important;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.queue-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-height: 92px;
  padding: 14px !important;
  border-left-width: 3px !important;
}

.queue-item.status-pending {
  border-left-color: var(--orange) !important;
}

.queue-item.status-posting {
  border-left-color: var(--blue) !important;
}

.queue-item.status-done {
  border-left-color: var(--green) !important;
}

.queue-item.status-error {
  border-left-color: var(--red) !important;
}

.queue-select {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.queue-item .item-cb {
  width: 18px;
  height: 18px;
  margin: 0;
}

.queue-item .itxt {
  min-width: 0;
  padding-right: 8px;
}

.queue-item .preview {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  overflow: hidden;
  white-space: pre-wrap;
}

.queue-item .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.queue-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 760;
}

.queue-status.pending {
  border-color: color-mix(in srgb, var(--orange) 46%, var(--divider));
  color: var(--orange);
}

.queue-status.posting {
  border-color: color-mix(in srgb, var(--blue) 38%, var(--divider));
  color: var(--blue);
}

.queue-status.done {
  border-color: color-mix(in srgb, var(--green) 46%, var(--divider));
  color: var(--green);
}

.queue-status.error {
  border-color: color-mix(in srgb, var(--red) 46%, var(--divider));
  color: var(--red);
}

.queue-item .deferred {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--orange) 46%, var(--divider));
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 10%, var(--secondary-bg));
  color: var(--orange);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.queue-item .actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.queue-item .actions button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
}

.queue-item .actions .play {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.queue-item.dragging {
  opacity: 0.62;
}

.queue-item.drag-over {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.drag-handle,
.dot2 {
  display: none !important;
}

.status,
.pill,
.tag,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 660;
}

.status.ok,
.pill.ok,
.success,
.done {
  border-color: #abefc6;
  background: var(--success-bg);
  color: var(--success-text);
}

.status.error,
.pill.error,
.error {
  border-color: #fecdca;
  background: var(--danger-bg);
  color: var(--danger-text);
}

table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  background: var(--app-bg);
  box-shadow: var(--shadow);
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--secondary-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 760;
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: var(--table-hover);
}

.analysis-table-wrap {
  overflow: auto;
  border-radius: 8px;
}

.analysis-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.ap-btn {
  min-width: 34px;
}

.ap-info {
  color: var(--text-secondary);
  font-size: 12px;
}

.modal,
.dialog {
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--app-bg);
  box-shadow: var(--shadow-hover);
}

details {
  padding: 10px 12px !important;
}

summary {
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}

#docDropZone {
  border-style: dashed !important;
  background: var(--secondary-bg) !important;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

#docDropZone:hover {
  border-color: var(--blue) !important;
  background: var(--hover-bg) !important;
}

#aiStatus,
#smartGenerateStatus,
#viralAnalysisResult,
#viralGenerated {
  color: var(--text-secondary) !important;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  max-width: 360px;
  padding: 11px 12px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: color-mix(in srgb, var(--app-bg) 94%, transparent);
  color: var(--text-primary);
  box-shadow: var(--shadow-hover);
  backdrop-filter: blur(14px);
  animation: cfToastIn 180ms ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

.toast span {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.toast-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.toast-close:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--divider) 60%, transparent);
}

.cd,
.post-elapsed {
  color: var(--text-secondary);
  font-weight: 400;
}

.badge-cd {
  color: var(--green);
  font-weight: 700;
}

[style*="border-radius:14px"],
[style*="border-radius: 14px"],
[style*="border-radius:18px"],
[style*="border-radius: 18px"],
[style*="border-radius:20px"],
[style*="border-radius: 20px"],
[style*="border-radius:12px"],
[style*="border-radius: 12px"] {
  border-radius: 8px !important;
}

[style*="background:#f8fafc"],
[style*="background: #f8fafc"],
[style*="background:#f3f4f6"],
[style*="background: #f3f4f6"],
[style*="background:#eef2ff"],
[style*="background: #eef2ff"] {
  background: color-mix(in srgb, var(--app-bg) 92%, transparent) !important;
}

[style*="border:1px solid #e5e7eb"],
[style*="border: 1px solid #e5e7eb"],
[style*="border:1px solid #e2e8f0"],
[style*="border: 1px solid #e2e8f0"] {
  border-color: var(--divider) !important;
}

html[data-theme="dark"] .auth-logo,
html[data-theme="dark"] .logo {
  border-color: #343434;
  background: #f5f5f5 !important;
  color: #000000 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .auth-logo,
html[data-theme="light"] .logo {
  border-color: #0f0f0f;
  background: #0f0f0f !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .progress-bar,
html[data-theme="dark"] .seg.empty {
  background: #181818;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar {
  box-shadow: none;
}

html[data-theme="dark"] .tabbtn {
  color: #a1a1a1;
}

html[data-theme="dark"] .tabbtn.active {
  box-shadow: inset 0 0 0 1px #343434;
}

html[data-theme="dark"] .topbar .link,
html[data-theme="dark"] .theme-switcher,
html[data-theme="dark"] .theme-option.active,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] button,
html[data-theme="dark"] table,
html[data-theme="dark"] .post-item,
html[data-theme="dark"] .item,
html[data-theme="dark"] .log-item,
html[data-theme="dark"] .viral-item,
html[data-theme="dark"] .collected-item,
html[data-theme="dark"] .list-item {
  box-shadow: none;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] button.primary,
html[data-theme="dark"] button.ok,
html[data-theme="dark"] .auth-btn-primary,
html[data-theme="dark"] .btnwide {
  box-shadow: none;
}

html[data-theme="dark"] .toast {
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] button:not(.tabbtn):not(.theme-option) {
  border-color: #333333;
  background: #181818;
  color: #f5f5f5;
  box-shadow: none;
}

html[data-theme="dark"] button:not(.tabbtn):not(.theme-option):hover {
  border-color: #4a4a4a;
  background: #222222;
  box-shadow: none;
  transform: none;
}

html[data-theme="dark"] button:not(.tabbtn):not(.theme-option):active {
  background: #2a2a2a;
  box-shadow: none;
  transform: scale(0.985);
}

html[data-theme="dark"] button.primary,
html[data-theme="dark"] button.ok,
html[data-theme="dark"] .auth-btn-primary,
html[data-theme="dark"] .btnwide {
  border-color: #f5f5f5;
  background: #f5f5f5;
  color: #000000;
  box-shadow: none;
}

html[data-theme="dark"] button.primary:hover,
html[data-theme="dark"] button.ok:hover,
html[data-theme="dark"] .auth-btn-primary:hover,
html[data-theme="dark"] .btnwide:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

html[data-theme="dark"] .topbar .link {
  min-height: 32px;
  padding: 7px 12px;
  border-color: #333333;
  background: #181818;
  color: #f5f5f5 !important;
  font-weight: 700;
}

html[data-theme="dark"] .topbar .link:hover {
  border-color: #4a4a4a;
  background: #222222;
  color: #ffffff !important;
  box-shadow: none;
  transform: none;
}

html[data-theme="dark"] .content .link,
html[data-theme="dark"] .queue-actions .link {
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #f5f5f5 !important;
  box-shadow: none;
}

html[data-theme="dark"] .content .link:hover,
html[data-theme="dark"] .queue-actions .link:hover {
  background: #181818;
  color: #ffffff !important;
  text-decoration: none;
  transform: none;
}

html[data-theme="dark"] .theme-switcher {
  border-color: #333333;
  background: #181818;
}

html[data-theme="dark"] .theme-option {
  border: 0;
  background: transparent;
  color: #a1a1a1;
}

html[data-theme="dark"] .theme-option:hover {
  background: #222222;
  color: #f5f5f5;
}

html[data-theme="dark"] .theme-option.active {
  background: #0f0f0f;
  color: #ffffff;
}

html[data-theme="dark"] .tabbtn {
  border-color: transparent;
  background: transparent;
  color: #a1a1a1;
  box-shadow: none;
}

html[data-theme="dark"] .tabbtn:hover {
  border-color: transparent;
  background: #181818;
  color: #f5f5f5;
  box-shadow: none;
  transform: none;
}

html[data-theme="dark"] .tabbtn.active {
  border-color: transparent;
  background: transparent;
  color: #ffffff;
  box-shadow: none;
}

html[data-theme="dark"] .sidebar-nav {
  padding-top: 18px;
}

html[data-theme="dark"] .sidebar-divider {
  background: #262626;
}

html[data-theme="dark"] .support-link a {
  color: #f5f5f5 !important;
  font-size: 14px;
  font-weight: 760;
}

.auth-card .auth-btn-primary {
  border-color: var(--primary-bg) !important;
  background: var(--primary-bg) !important;
  color: var(--primary-text) !important;
}

.auth-card .auth-btn-primary:hover:not(:disabled) {
  border-color: var(--primary-bg-hover) !important;
  background: var(--primary-bg-hover) !important;
}

.auth-card .auth-btn-primary:disabled {
  border-color: var(--divider) !important;
  background: var(--secondary-bg) !important;
  color: var(--text-inactive) !important;
  opacity: 1 !important;
}

.auth-card .auth-btn-secondary {
  border-color: var(--divider-strong) !important;
  background: var(--app-bg) !important;
  color: var(--text-primary) !important;
}

.auth-card .auth-btn-secondary:hover {
  border-color: var(--divider-strong) !important;
  background: var(--hover-bg) !important;
}

html[data-theme="dark"] .auth-card {
  border-color: #2f2f2f;
  background: #101010;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
}

html[data-theme="dark"] .auth-card .auth-btn-primary {
  border-color: #f5f5f5 !important;
  background: #f5f5f5 !important;
  color: #000000 !important;
}

html[data-theme="dark"] .auth-card .auth-btn-primary:disabled {
  border-color: #2f2f2f !important;
  background: #181818 !important;
  color: #6f6f6f !important;
}

html[data-theme="dark"] .auth-card .auth-btn-secondary {
  border-color: #343434 !important;
  background: #181818 !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .auth-help a {
  border-color: #2f2f2f;
  background: #181818;
  color: #a1a1a1 !important;
}

html[data-theme="dark"] .auth-help a:hover {
  border-color: #4a4a4a;
  background: #222222;
  color: #ffffff !important;
}

/* Unified layout rhythm: keep every tab on the same spacing grid. */
.content > div[id^="tab"] {
  display: grid;
  align-content: start;
  gap: 14px;
}

.content > div[id^="tab"].hidden {
  display: none !important;
}

.content > div[id^="tab"] > * {
  margin-top: 0 !important;
}

.content > div[id^="tab"] > *:last-child {
  margin-bottom: 0 !important;
}

.content .row,
.content .btnrow,
.content .queue-actions,
.content .infocards,
.content details,
.content .list,
.content .badge,
.content textarea,
.content input:not([type="checkbox"]):not([type="radio"]),
.content select {
  margin-top: 0 !important;
}

.content .row,
.content .btnrow {
  gap: 8px !important;
  margin-bottom: 12px !important;
}

.content .queue-actions {
  gap: 8px !important;
  margin: 0 0 14px !important;
  padding-top: 2px;
}

.content .label,
.content .hint {
  margin-top: 0 !important;
}

.content details {
  margin-bottom: 12px !important;
}

.content details > div {
  padding-top: 10px !important;
}

.content textarea {
  margin-bottom: 8px !important;
}

.content .list {
  gap: 10px !important;
  margin-top: 0 !important;
}

#postSettings,
#smartSettings,
.settings-card,
.panel,
.card {
  display: grid;
  align-content: start;
  gap: 12px;
}

#postSettings > *,
#smartSettings > *,
.settings-card > *,
.panel > *,
.card > * {
  margin-top: 0 !important;
}

#postSettings > *:last-child,
#smartSettings > *:last-child,
.settings-card > *:last-child,
.panel > *:last-child,
.card > *:last-child {
  margin-bottom: 0 !important;
}

#likeLog,
#smartLog,
#warmupLog,
#autoReplyLog,
#collectedLog,
#commentersLog {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--secondary-bg);
  scroll-behavior: smooth;
}

/* Smart commenting has many legacy inline styles. This block pins it to one form grid. */
#tabSmartComment {
  gap: 14px !important;
}

#tabSmartComment > .label {
  margin-bottom: 0 !important;
  font-size: 16px;
}

#tabSmartComment > .hint {
  max-width: 760px;
  margin-bottom: 0 !important;
  line-height: 1.45 !important;
}

#tabSmartComment #smartSettings {
  gap: 14px !important;
  padding: 16px !important;
}

#tabSmartComment #smartSettings > .label,
#tabSmartComment #smartSettings .label {
  margin: 0 !important;
  font-size: 13px;
  line-height: 1.25;
}

#tabSmartComment #smartSettings .hint {
  min-width: 0 !important;
  margin: 0 !important;
  font-size: 12px;
  line-height: 1.4;
}

#tabSmartComment #smartSettings > label,
#tabSmartComment #smartPromptModeSelector > label,
#tabSmartComment #smartContextRow,
#tabSmartComment #smartSettings details label {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center !important;
  gap: 10px !important;
  min-height: 34px;
  margin: 0 !important;
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  line-height: 1.35;
  white-space: normal !important;
}

#tabSmartComment #smartSettings input[type="checkbox"],
#tabSmartComment #smartSettings input[type="radio"] {
  margin: 0 !important;
  align-self: center;
  justify-self: start;
}

#tabSmartComment #smartSettings textarea,
#tabSmartComment #smartSettings select,
#tabSmartComment #smartSettings input:not([type="checkbox"]):not([type="radio"]) {
  margin: 0 !important;
}

#tabSmartComment #smartKeywords,
#tabSmartComment #smartDescription {
  min-height: 72px !important;
}

#tabSmartComment #smartPrompt,
#tabSmartComment #smartCustomText {
  min-height: 96px !important;
}

#tabSmartComment #smartStopWords {
  min-height: 64px !important;
}

#tabSmartComment #smartPromptModeSelector {
  display: grid;
  gap: 10px;
  margin: 0 !important;
  padding-top: 14px !important;
  border-top: 1px solid var(--divider);
}

#tabSmartComment #smartAiPromptWrap,
#tabSmartComment #smartCustomPromptWrap,
#tabSmartComment #smartCustomTextWrap {
  display: grid !important;
  gap: 10px;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--secondary-bg);
}

#tabSmartComment #smartAiPromptWrap[style*="display:none"],
#tabSmartComment #smartCustomPromptWrap[style*="display:none"],
#tabSmartComment #smartCustomTextWrap[style*="display:none"] {
  display: none !important;
}

#tabSmartComment #smartAiPromptWrap > div,
#tabSmartComment #smartCustomPromptWrap > div {
  margin: 0 !important;
}

#tabSmartComment #smartAiPromptWrap > div:has(button),
#tabSmartComment #smartAiPromptWrap > div:has(select),
#tabSmartComment #smartCustomPromptWrap > div:has(select) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px !important;
}

#tabSmartComment #smartAiPromptWrap > div:has(#smartGenerateBtn) {
  grid-template-columns: auto minmax(0, 1fr);
}

#tabSmartComment #smartGenerateBtn,
#tabSmartComment .saved-prompt-save {
  min-height: 34px !important;
  padding: 7px 12px !important;
  font-size: 12px !important;
}

#tabSmartComment #smartGenerateStatus {
  min-height: 20px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none;
  font-size: 12px !important;
  line-height: 1.35;
}

#tabSmartComment #smartSettings details {
  display: grid;
  gap: 12px;
  margin: 0 !important;
  padding: 12px !important;
}

#tabSmartComment #smartSettings details > summary {
  min-height: 24px;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  line-height: 1.35;
}

#tabSmartComment #smartSettings details > div {
  display: grid;
  gap: 12px;
  margin: 0 !important;
  padding: 0 !important;
}

#tabSmartComment #smartSettings .row {
  display: grid !important;
  grid-template-columns: 144px minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

#tabSmartComment #smartSettings .row:has(select) {
  grid-template-columns: 144px minmax(0, 1fr);
}

#tabSmartComment #smartSettings .row:has(#smartMaxComments),
#tabSmartComment #smartSettings .row:has(#smartMaxChars),
#tabSmartComment #smartSettings .row:has(#smartMaxAge) {
  grid-template-columns: 144px 108px auto;
}

#tabSmartComment #smartSettings .row:has(#smartDelayMin),
#tabSmartComment #smartSettings .row:has(#smartPauseMin) {
  grid-template-columns: 144px 108px 18px 108px 34px;
}

#tabSmartComment #smartSettings .row:has(#smartStopIntervalStart) {
  grid-template-columns: 22px 126px 26px 126px;
  padding-left: 0;
}

#tabSmartComment #smartSettings .row > .hint:first-child {
  min-width: 0 !important;
  width: 144px;
  white-space: normal;
}

#tabSmartComment #smartSettings input[type="number"] {
  width: 108px !important;
}

#tabSmartComment #smartSettings input[type="time"] {
  width: 126px !important;
}

#tabSmartComment #smartSettings select {
  width: 100% !important;
}

#tabSmartComment #smartStopIntervalTimes {
  display: grid !important;
  gap: 8px;
  margin: 0 !important;
  padding: 10px 0 0 28px !important;
}

#tabSmartComment #smartStopIntervalTimes[style*="display: none"],
#tabSmartComment #smartStopIntervalTimes[style*="display:none"] {
  display: none !important;
}

#tabSmartComment #smartSettings > div:has(#smartStopIntervalEnabled:not(:checked)) #smartStopIntervalTimes {
  display: none !important;
}

#tabSmartComment #smartSettings div[style*="display:flex"][style*="flex-wrap:wrap"] {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  margin: 0 !important;
}

#tabSmartComment #smartSettings div[style*="display:flex"][style*="flex-wrap:wrap"] label {
  width: auto;
  min-height: 30px;
}

#tabSmartComment #smartSettings .row label {
  display: flex !important;
  grid-column: 1 / -1;
  align-items: center !important;
  gap: 8px !important;
  min-height: 34px;
  margin: 0 !important;
}

#tabSmartComment #smartSettings .row label input[type="number"] {
  flex: 0 0 108px;
}

#tabSmartComment > .btnrow {
  gap: 8px !important;
  margin: 0 !important;
}

#tabSmartComment > .btnrow button {
  min-width: 112px;
}

#tabSmartComment #smartStatus {
  min-height: 18px;
  color: var(--text-secondary);
  font-size: 12px;
}

#tabSmartComment div:has(> .label #smartStatus) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
}

#tabSmartComment div:has(> .label #smartStatus) .label {
  min-width: 0;
  margin: 0 !important;
}

#tabSmartComment div:has(> #smartFound) {
  margin: 0 !important;
  color: var(--text-secondary) !important;
  font-size: 12px;
}

#tabSmartComment .infocards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.log-entry {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--divider);
  border-left: 3px solid var(--text-inactive);
  border-radius: 8px;
  background: var(--app-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: cfLogIn 140ms ease-out;
}

.log-time {
  color: var(--text-inactive);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  white-space: nowrap;
}

.log-level {
  min-width: 54px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}

.log-message {
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.log-message a {
  color: var(--blue-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.log-success {
  border-left-color: var(--green);
}

.log-success .log-level {
  background: var(--success-bg);
  color: var(--success-text);
}

.log-error {
  border-left-color: var(--red);
}

.log-error .log-level {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.log-warning {
  border-left-color: var(--orange);
}

.log-warning .log-level {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.log-debug {
  border-left-color: var(--violet);
}

.log-debug .log-level {
  background: color-mix(in srgb, var(--violet) 14%, var(--secondary-bg));
  color: var(--violet);
}

@keyframes cfLogIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cfFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cfToastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  /* Сайдбар остаётся сбоку — при сжатии окна НЕ переключаемся в колонку,
     иначе меню уезжает вверх и перелезает на вкладку постов */
  #appShell:not(.hidden) {
    flex-direction: row;
  }

  .sidebar {
    width: 64px;
    flex: 0 0 64px;
    overflow-y: auto;
    border-right: 1px solid var(--divider);
    border-bottom: 0;
  }

  .sidebar-header {
    display: none;
  }

  .sidebar-stats {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
  }

  .sidebar-nav .tabbtn {
    justify-content: center;
    gap: 0;
    width: 48px;
    min-height: 44px;
    padding: 10px 0;
  }

  .sidebar-nav .tab-label {
    display: none;
  }

  .sidebar-nav .tabbtn[title] {
    position: relative;
  }

  .sidebar .theme-switcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 8px 4px 0;
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .sidebar .theme-option {
    width: 48px;
    min-height: 44px;
    padding: 10px 0;
    justify-content: center;
    display: flex;
    align-items: center;
  }

  .sidebar .theme-label {
    display: none;
  }

  .sidebar .support-link {
    padding: 8px 4px 12px;
    display: flex;
    justify-content: center;
  }

  .sidebar .support-link a {
    display: flex;
    justify-content: center;
    width: 48px;
  }

  .sidebar .support-link a span:not(.support-icon) {
    display: none;
  }

  .main {
    flex: 1;
    min-width: 0;
    min-height: 520px;
  }

  .content {
    padding: 14px;
  }

  /* Сжатый сайдбар: версия-баннер и бейдж статуса — только значки */
  .version-banner {
    margin: 6px 8px 0;
    padding: 6px 0;
    width: 44px;
    min-height: 36px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    align-self: flex-start;
    border-color: color-mix(in srgb, var(--red) 58%, var(--divider));
    font-size: 20px;
    line-height: 1;
  }

  .version-banner .vb-text {
    display: none;
  }

  .version-banner-title {
    font-size: 20px;
    line-height: 1;
  }

  .version-banner-sub {
    display: none;
  }

  .badge {
    margin: 6px auto 0;
    max-width: 64px;
    min-height: 44px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    text-align: center;
  }

  .badge .badge-status {
    display: none;
  }

  .badge .badge-cd {
    font-size: 9px;
    font-weight: 500;
    line-height: 1.15;
    word-break: break-word;
    max-width: 58px;
  }

  .badge .dot {
    flex-shrink: 0;
  }
}

/* === ClientFlow UI polish: unified controls, rhythm and typography === */
:root {
  --control-height: 38px;
  --control-height-sm: 32px;
  --content-width: 1080px;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent);
}

body {
  font-size: 13px;
  line-height: 1.5;
}

.main {
  min-width: 0;
}

.content {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding: clamp(16px, 2.4vw, 28px);
}

.content > div[id^="tab"] {
  width: 100%;
}

.content > div[id^="tab"] > .label:first-child {
  margin-bottom: 5px;
  font-size: 18px !important;
  font-weight: 780;
  letter-spacing: -0.015em;
}

.label {
  color: var(--text-primary);
  font-weight: 740;
  letter-spacing: -0.005em;
}

.hint {
  color: var(--text-secondary) !important;
  line-height: 1.5 !important;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
button {
  min-height: var(--control-height);
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  font-size: 13px !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-inactive);
  opacity: 1;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' stroke='%23777777' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 13px center !important;
  background-size: 12px 8px !important;
  cursor: pointer;
}

html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' stroke='%23A1A1A1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

/* Warmup day is a native choice, not a decorative field. Keep the browser
   arrow and explicitly remove any inherited/repeated background artwork. */
#warmupDayOverride {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
  background: var(--app-bg) !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  padding-right: 10px !important;
}

select:disabled {
  cursor: not-allowed;
  opacity: .55;
}

textarea {
  min-height: 72px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

button.primary,
button.ok,
.btnwide {
  font-weight: 730;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 62%, transparent) !important;
  outline-offset: 2px;
}

/* Consistent custom checkboxes and radios across every settings tab. */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0;
  padding: 0 !important;
  border: 1.5px solid var(--divider-strong) !important;
  background: var(--app-bg) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

input[type="checkbox"] {
  border-radius: 5px !important;
}

input[type="radio"] {
  border-radius: 50% !important;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--text-secondary) !important;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--primary-bg) !important;
  background: var(--primary-bg) !important;
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--primary-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--primary-text);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none !important;
  box-shadow: var(--focus-ring) !important;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: .5;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 9px !important;
  min-height: 26px;
  color: var(--text-secondary) !important;
  line-height: 1.42;
}

label:has(> input[type="checkbox"]):hover,
label:has(> input[type="radio"]):hover {
  color: var(--text-primary) !important;
}

.row,
.btnrow,
.queue-actions,
.actions {
  gap: 10px;
}

.row {
  align-items: center;
}

.row > .hint:first-child {
  flex: 0 0 116px;
  min-width: 116px !important;
  font-weight: 630;
}

.row > input:not([type="checkbox"]):not([type="radio"]),
.row > select,
.row > textarea {
  min-width: 120px;
}

.btnrow {
  flex-wrap: wrap;
}

.btnrow > button {
  flex: 0 1 auto;
}

details {
  overflow: clip;
  padding: 0 !important;
}

details > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 38px 10px 12px;
  list-style: none;
  border-radius: inherit;
  color: var(--text-primary) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35;
  transition: background var(--transition), color var(--transition);
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::after {
  content: "";
  position: absolute;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
}

details[open] > summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

details > summary:hover {
  background: var(--hover-bg);
}

details[open] > summary {
  border-bottom: 1px solid var(--divider);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

details > :not(summary) {
  margin-inline: 12px !important;
}

details > :last-child {
  margin-bottom: 12px !important;
}

.infocards {
  gap: 12px;
}

.infocard {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.infocard .n {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.infocard .l {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.list-item,
.post-item,
.item,
.log-item {
  overflow-wrap: anywhere;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 84px;
  line-height: 1.5;
}

/* Viral article form: predictable two-column layout and readable help. */
#tabViral > div:has(#viralArticleGenerateBtn) {
  padding: 14px !important;
  border-color: var(--divider-strong) !important;
  background: color-mix(in srgb, var(--secondary-bg) 58%, var(--app-bg)) !important;
}

#tabViral #viralArticleTopic,
#tabViral #viralArticleFacts {
  min-height: 76px;
}

#tabViral #viralArticleCta {
  min-height: var(--control-height);
}

#tabViral #viralArticleGenerateBtn {
  min-height: 42px;
}

#tabViral .viral-field {
  display: grid !important;
  flex: 1 1 260px;
  min-width: 0;
  gap: 5px !important;
  margin: 0;
  color: var(--text-primary) !important;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.3;
}

#tabViral .viral-field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

#tabViral .viral-field em,
#tabViral .viral-field small {
  color: var(--text-inactive);
  font-size: 10px;
  font-style: normal;
  font-weight: 560;
}

#tabViral .viral-field em {
  color: var(--orange);
}

#tabViral .viral-field input,
#tabViral .viral-field textarea,
#tabViral .viral-field select {
  width: 100% !important;
  margin-bottom: 0 !important;
}

#tabViral .viral-field-wide {
  margin-bottom: 8px;
}

#viralArticleResult .list-item {
  max-height: 440px;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .content {
    padding: 16px;
  }

  .row > .hint:first-child {
    flex-basis: 96px;
    min-width: 96px !important;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 12px;
  }

  .content > div[id^="tab"] > .label:first-child {
    font-size: 16px !important;
  }

  .row {
    align-items: stretch;
  }

  .row > .hint:first-child {
    flex: 1 0 100%;
    min-width: 0 !important;
    margin-bottom: -4px;
  }

  .row > input:not([type="checkbox"]):not([type="radio"]),
  .row > select,
  .row > textarea,
  .btnrow > button {
    flex: 1 1 160px;
  }

  #tabViral > div:has(#viralArticleGenerateBtn) > .row {
    display: grid !important;
    grid-template-columns: 1fr;
  }

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

/* Sidebar alignment: one fixed icon rail and one fixed text rail. */
.sidebar-nav {
  padding-inline: 10px;
}

.sidebar-nav .tabbtn {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  column-gap: 12px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
}

.sidebar-nav .tab-icon {
  grid-column: 1;
  justify-self: center;
}

.sidebar-nav .tab-label {
  grid-column: 2;
  justify-self: start;
  text-align: left;
}

@media (max-width: 760px) {
  .sidebar-nav {
    padding-inline: 4px;
  }

  .sidebar-nav .tabbtn {
    display: grid;
    grid-template-columns: 24px;
    justify-content: center;
    width: 48px;
    padding: 10px 0;
  }

  .sidebar-nav .tab-icon {
    grid-column: 1;
  }
}

/* ===== Контент завод (factory) ===== */
.factory-toolbar{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.factory-toolbar button{white-space:nowrap}
.factory-layout{display:flex;gap:8px;height:520px;border:1px solid var(--divider);border-radius:10px;background:var(--secondary-bg);padding:6px}
.factory-palette{flex:0 0 118px;display:flex;flex-direction:column;border-right:1px solid var(--divider);padding-right:6px;overflow-y:auto}
.factory-palette-title{font-size:11px;font-weight:700;margin-bottom:6px;color:var(--text-secondary)}
.factory-pal-item{padding:7px 8px;margin-bottom:5px;border:1px solid var(--divider);border-radius:8px;background:var(--app-bg);color:var(--text-primary);font-size:11px;cursor:grab;user-select:none;text-align:center}
.factory-pal-item:active{cursor:grabbing}
.factory-pal-item:hover{border-color:var(--accent-b, #4ade80)}
.factory-canvas-wrap{flex:1;display:flex;flex-direction:column;min-width:0}
.factory-canvas{position:relative;flex:1;border:1px dashed var(--divider);border-radius:8px;background:var(--app-bg);overflow:hidden}
.factory-canvas.drag-over{border-color:var(--accent-b, #4ade80);background:rgba(74,222,128,0.05)}
.factory-canvas-tip{font-size:10px;color:var(--text-secondary);margin-top:4px}
.factory-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--text-secondary);font-size:12px;pointer-events:none;text-align:center}
.factory-svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1}
.factory-svg path{fill:none}
.factory-svg path.factory-edge{stroke:var(--accent-b, #4ade80);stroke-width:2;stroke-dasharray:5 4}
.factory-svg line{stroke:var(--accent-b, #4ade80);stroke-width:2;stroke-dasharray:4 3}
.factory-svg path.edge-del{pointer-events:stroke;stroke-width:10;stroke:transparent;cursor:pointer}
.factory-svg path.edge-del:hover{stroke:rgba(255,80,80,0.35)}
.factory-block{position:absolute;z-index:2;width:118px;padding:7px 6px;border:1px solid var(--divider);border-radius:9px;background:var(--secondary-bg);color:var(--text-primary);font-size:11px;cursor:move;text-align:center;box-shadow:0 2px 6px rgba(0,0,0,0.25);user-select:none}
.factory-block:hover{border-color:var(--accent-b, #4ade80)}
.factory-block.selected{border-color:var(--accent-b, #4ade80);box-shadow:0 0 0 2px rgba(74,222,128,0.35)}
.factory-block.dragging{opacity:0.6}
.factory-block .factory-block-title{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.factory-block .factory-block-hint{font-size:9px;color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.factory-block .factory-block-del{position:absolute;top:1px;right:1px;width:14px;height:14px;border-radius:50%;background:rgba(0,0,0,0.6);color:#fff;border:none;font-size:8px;cursor:pointer;display:none;align-items:center;justify-content:center;padding:0}
.factory-block .factory-block-conn{position:absolute;top:50%;right:-9px;transform:translateY(-50%);width:18px;height:18px;border-radius:50%;background:var(--accent-b, #4ade80);border:2px solid var(--secondary-bg);box-shadow:0 0 0 1px rgba(255,255,255,0.35);cursor:crosshair;display:flex;align-items:center;justify-content:center;font-size:10px;color:#0d0d0f;z-index:3;transition:transform 0.12s, box-shadow 0.12s}
.factory-block .factory-block-conn:hover{transform:translateY(-50%) scale(1.35);box-shadow:0 0 10px rgba(74,222,128,0.8)}
.factory-block .factory-block-conn.active{transform:translateY(-50%) scale(1.35);box-shadow:0 0 10px rgba(74,222,128,0.9);background:#fff}
.factory-block .factory-block-conn-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:7px solid #0d0d0f}
.factory-block:hover .factory-block-del{display:flex}
.factory-block.running{border-color:var(--accent-b, #4ade80);box-shadow:0 0 0 2px rgba(74,222,128,0.4)}
.factory-drawing{position:absolute;z-index:3;width:10px;height:10px;border-radius:50%;background:var(--accent-b, #4ade80);pointer-events:none}
.factory-overlay{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;padding:16px}
.factory-panel{width:360px;max-width:92vw;background:var(--secondary-bg);border:1px solid var(--divider);border-radius:12px;overflow:hidden;display:flex;flex-direction:column;max-height:88vh}
.factory-panel-head{display:flex;align-items:center;justify-content:space-between;padding:9px 12px;border-bottom:1px solid var(--divider);font-weight:700;font-size:13px}
.factory-panel-close{background:none;border:none;color:var(--text-secondary);font-size:14px;cursor:pointer;padding:2px 6px}
.factory-panel-body{padding:10px 12px;overflow-y:auto}
.factory-panel-body .hint{min-width:0}
.factory-panel-foot{display:flex;align-items:center;gap:6px;padding:9px 12px;border-top:1px solid var(--divider)}
.factory-panel-foot button{white-space:nowrap}
.factory-status-ok{color:var(--green, #4ade80)}
.factory-status-err{color:var(--danger, #f05454)}

.qmedia{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.qmedia-th{position:relative;width:54px;height:54px;border-radius:8px;overflow:hidden;border:1px solid var(--divider);background:var(--secondary-bg);cursor:pointer;flex:0 0 auto;transition:transform 0.12s ease}
.qmedia-th:hover{transform:scale(1.06);border-color:var(--green, #4ade80)}
.qmedia-th img{width:100%;height:100%;object-fit:cover;display:block}
.qmedia-th .qmedia-vid{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:16px;color:#fff;background:rgba(0,0,0,0.35)}
.qmedia-th .qmedia-more{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:#fff;background:rgba(0,0,0,0.55)}

/* ===== Очередь постов: линия слева и цвета по состояниям (как в старом расширении) ===== */
.queue-item {
  position: relative;
  border-left-width: 3px !important;
}
.queue-item.status-pending { border-left-color: var(--orange) !important; }
.queue-item.status-posting { border-left-color: #2f80ed !important; }
.queue-item.status-done   { border-left-color: var(--green)  !important; }
.queue-item.status-error  { border-left-color: var(--red)    !important; }
.queue-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 10px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}
.queue-status.pending { border-color: color-mix(in srgb, var(--orange) 46%, var(--divider)); color: var(--orange); }
.queue-status.posting { border-color: color-mix(in srgb, #2f80ed 40%, var(--divider)); color: #2f80ed; }
.queue-status.done    { border-color: color-mix(in srgb, var(--green) 46%, var(--divider)); color: var(--green); }
.queue-status.error   { border-color: color-mix(in srgb, var(--red) 46%, var(--divider)); color: var(--red); }

.ai-progress-track {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--divider);
}
.ai-progress-bar {
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #67e8a5, var(--accent));
  animation: ai-progress-slide 1.15s ease-in-out infinite;
}
.ai-spinner {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 2px solid var(--divider);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ai-spin .75s linear infinite;
}
@keyframes ai-progress-slide { from { transform: translateX(-120%); } to { transform: translateX(290%); } }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.cf-toggle{position:relative;display:inline-flex;width:36px;height:20px;flex:0 0 36px}.cf-toggle input{position:absolute;opacity:0;width:0;height:0}.cf-toggle-track{position:absolute;inset:0;border-radius:999px;background:#555;transition:.2s;cursor:pointer}.cf-toggle-track:before{content:"";position:absolute;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background:#fff;transition:.2s}.cf-toggle input:checked+.cf-toggle-track{background:#29c46a}.cf-toggle input:checked+.cf-toggle-track:before{transform:translateX(16px)}

/* Final form-control normalization: prevent inline background shorthands from
   repeating the select chevron as a zig-zag pattern across the whole control. */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  background-color: var(--app-bg) !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  background-size: auto !important;
}

select {
  padding-right: 38px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' stroke='%23777777' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-position: right 13px center !important;
  background-size: 12px 8px !important;
}

html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' stroke='%23A1A1A1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
