/* Base */
.viw-widget {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font: inherit;
  color: var(--viw-text, #000);
}
.viw-label { opacity: .85; }
.viw-value { font-weight: 600; cursor: pointer; }
.viw-value:focus { outline: 2px solid #8ab4f8; outline-offset: 2px; }
.viw-value:hover { text-decoration: underline; }

/* Switch wrapper */
.viw-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  position: relative;
}

/* Hidden checkbox but accessible */
.viw-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Elementor-style switch UI */
.viw-switch-ui {
  position: relative;
  width: 44px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  border-radius: 999px;
  background: #ddd;
  transition: background .2s ease;
  cursor: pointer;
}
.viw-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}
.viw-switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: left .2s ease;
}
.viw-switch-input:checked + .viw-switch-ui {
  background: var(--viw-primary, #6ec1e4);
}
.viw-switch-input:checked + .viw-switch-ui .viw-switch-handle {
  left: 24px;
}
.viw-switch-wrap:focus-within .viw-switch-ui {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}
.viw-switch-text {
  font-size: .9em;
  opacity: .9;
}

/* Tooltip */
.viw-tooltip {
  position: absolute;
  left: 100%;
  margin-left: .4rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--viw-tip-bg, #111);
  color: var(--viw-tip-fg, #fff);
  padding: .35rem .5rem;
  border-radius: .35rem;
  font-size: .85em;
  white-space: nowrap;
  z-index: 9;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: none;
}

/* Feedback */
.viw-feedback { margin-left: .25rem; font-size: .9em; opacity: .75; }

/* Dark theme */
.viw-dark { color: #e5e7eb; }
.viw-dark .viw-switch-ui { background: #444; }

/* Auto theme indicator class (logic in JS attaches viw-dark based on system) */
.viw-auto {}

/* Mobile hint (no button to hide now). The option disables click-to-copy in JS. */
