.view-toggle {
  display: inline-flex;
  background: #f0ede8;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #9ca3af;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;

  & input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  & svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: currentColor;
  }

  & svg.lucide {
    fill: none;
  }

  &:hover { background: #e5e0d8; color: #374151; }
}

.view-toggle__btn--active,
.view-toggle__btn:has(input:checked) {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);

  &:hover { background: #ffffff; color: #111827; }
}

.view-toggle__btn--label {
  width: auto;
  height: 30px;
  padding: 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
}

[data-theme="dark"] .view-toggle {
  background: #1e293b;
}

[data-theme="dark"] .view-toggle__btn {
  color: #64748b;
}

[data-theme="dark"] .view-toggle__btn:hover {
  background: #273548;
  color: #cbd5e1;
}

[data-theme="dark"] .view-toggle__btn--active,
[data-theme="dark"] .view-toggle__btn--active:hover,
[data-theme="dark"] .view-toggle__btn:has(input:checked),
[data-theme="dark"] .view-toggle__btn:has(input:checked):hover {
  background: #334155;
  color: #f1f5f9;
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .view-toggle {
    background: #1e293b;
  }

  :root:not([data-theme="light"]) .view-toggle__btn {
    color: #64748b;
  }

  :root:not([data-theme="light"]) .view-toggle__btn:hover {
    background: #273548;
    color: #cbd5e1;
  }

  :root:not([data-theme="light"]) .view-toggle__btn--active,
  :root:not([data-theme="light"]) .view-toggle__btn--active:hover,
  :root:not([data-theme="light"]) .view-toggle__btn:has(input:checked),
  :root:not([data-theme="light"]) .view-toggle__btn:has(input:checked):hover {
    background: #334155;
    color: #f1f5f9;
    box-shadow: none;
  }
}
