/* ── Help-tip tooltips ───────────────────────────────────────────────────── */

.help-tip {
  margin-left: 0.35em;
  color: rgba(0, 0, 0, 0.3);
  font-size: 0.95rem;
  font-weight: normal;
  cursor: default;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  user-select: none;
}

html.dark .help-tip {
  color: rgba(255, 255, 255, 0.35);
}

.help-tip::after {
  content: attr(data-tip);
  display: none;
  position: absolute;
  left: 1.4em;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  background: rgba(18, 20, 28, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.6em 0.85em;
  font-size: 0.92em;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  white-space: normal;
  z-index: 500;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.help-tip:hover::after {
  display: block;
}

/* Inline docs link in label */
a.label-link {
  font-size: 0.78em;
  font-weight: normal;
  margin-left: 0.5em;
  color: var(--tcm-blue-color);
  opacity: 0.7;
  text-decoration: none;
}

a.label-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Toggle switches ─────────────────────────────────────────────────────── */

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1.5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .toggle-grid {
    grid-template-columns: 1fr;
  }
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.toggle-field.standalone {
  margin-bottom: 0.75rem;
}

.toggle-switch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 11px;
  transition: background 0.22s, border-color 0.22s;
}

html.dark .toggle-track {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--tcm-blue-color);
  border-color: var(--tcm-blue-color);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.22s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

html.dark .toggle-thumb {
  background: rgba(255, 255, 255, 0.7);
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
  background: white;
}

.toggle-label {
  font-size: 0.93em;
  color: rgba(0, 0, 0, 0.78);
  line-height: 1.3;
  display: flex;
  align-items: center;
}

html.dark .toggle-label {
  color: rgba(255, 255, 255, 0.82);
}

/* ── Sticky save bar ─────────────────────────────────────────────────────── */

#sticky-save-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.75rem 1.75rem;
  background: rgba(248, 249, 252, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(99, 145, 210, 0.3);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 998;
}

html.dark #sticky-save-bar {
  background: rgba(13, 15, 22, 0.94);
}

#sticky-save-bar.visible {
  transform: translateY(0);
}

#sticky-save-label {
  font-size: 0.85em;
  color: rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
}

html.dark #sticky-save-label {
  color: rgba(255, 255, 255, 0.45);
}

body.save-bar-visible #main-content {
  padding-bottom: 4rem;
}

body.save-bar-visible #__current_log {
  bottom: calc(3.5rem + 0.8em);
}

/* ── Preserved existing rules ────────────────────────────────────────────── */

#excluded-card-types .menu .active.item {
  opacity: 30%;
  text-decoration: line-through;
  font-style: italic;
}

.inverted.slider .labels .label {
  color: #ccc;
}

#settings .horizontal.card {
  width: 100%;
}
.ui.card.horizontal > .image, .ui.horizontal.cards > .card > .image {
  width: 400px;
  max-width: 400px;
}

.system.info .label:not(.inverted) {
  background-color: color-mix(in srgb, #2185d0, transparent) !important;
}
.system.info .inverted.label {
  background-color: color-mix(in srgb, #54c8ff, transparent) !important;
}

.modal .content .list .item::before {
  margin-left: -1.45rem;
}
.modal .content .list .item .list .item::before {
  margin-left: -2.25em;
}
