:root {
  /* ----- Typography (light) -------------------------------------------- */

  /* ----- Surfaces (light) ---------------------------------------------- */

  /* ----- Primary Button (light) ---------------------------------------- */

  /* ----- Secondary Button (light) -------------------------------------- */

  /* ----- Inputs & Controls (light) ------------------------------------- */

  /* ----- Destructive Palette ------------------------------------------- */

  /* ----- Constructive Palette ------------------------------------------ */

  /* ----- Disabled Palette ---------------------------------------------- */

  /* ----- Menus, Popovers & Dropdowns ----------------------------------- */

  /* ----- Color Series (light) ------------------------------------------ */
  --series-1: var(--vh-data-series-1, #7c3aed);
  --series-2: var(--vh-data-series-2, #351c71);
  --series-3: var(--vh-data-series-3, #c0392b);
  --series-4: var(--vh-data-series-4, #e67e22);
  --series-5: var(--vh-data-series-5, #f1c40f);
  --series-6: var(--vh-data-series-6, #16a085);
  --series-7: var(--vh-data-series-7, #27ae60);
  --series-8: var(--vh-data-series-8, #2980b9);
  --series-9: var(--vh-data-series-9, #8e44ad);
  --series-10: var(--vh-data-series-10, #2c3e50);
  --series-11: var(--vh-data-series-11, #7f8c8d);
  --series-12: var(--vh-data-series-12, #d35400);

  /* Typography scale (desktop-first) */
  --vh-text-xxs: 0.5rem;   /* 8px */
  --vh-text-xs: 0.75rem;   /* 12px */
  --vh-text-sm: 0.875rem;  /* 14px */
  --vh-text-md: 1rem;      /* 16px */
  --vh-text-lg: 1.25rem;   /* 20px */
  --vh-text-xl: 1.5rem;    /* 24px */
  --vh-text-2xl: 2rem;     /* 32px */
  --vh-text-3xl: 2.5rem;   /* 40px */

  /* Line-height pairings */
  --vh-leading-tight: 1.1;
  --vh-leading-standard: 1.4;
  --vh-leading-relaxed: 1.6;

  /* Button height + horizontal padding pattern */
  --vh-button-height-xs: 2rem;   /* 32px */
  --vh-button-height-sm: 2.5rem; /* 40px */
  --vh-button-height-md: 3rem;   /* 48px */
  --vh-button-height-lg: 3.5rem; /* 56px */

  --vh-button-padding-xs: 0 0.75rem;
  --vh-button-padding-sm: 0 1rem;
  --vh-button-padding-md: 0 1.25rem;
  --vh-button-padding-lg: 0 1.5rem;

  --vh-button-radius-xs: 4px;
  --vh-button-radius-sm: 6px;
  --vh-button-radius-md: 8px;
  --vh-button-radius-lg: 10px;
}

/* ==========================================================================
   Dark Theme
   ========================================================================== */

[data-theme="dark"] {
  /* ----- Typography (dark) --------------------------------------------- */

  /* ----- Surfaces (dark) ----------------------------------------------- */

  /* ----- Primary Button (dark) ----------------------------------------- */

  /* ----- Secondary Button (dark) --------------------------------------- */

  /* ----- Inputs & Controls (dark) -------------------------------------- */

  /* ----- Constructive (dark) ------------------------------------------- */

  /* ----- Disabled (dark) ----------------------------------------------- */

  /* ----- Menus, Popovers & Dropdowns (dark) --------------------------- */

  /* ----- Color Series (dark) ------------------------------------------ */
  --series-1: var(--vh-data-series-1, #a78bfa);
  --series-2: var(--vh-data-series-2, #7c3aed);
  --series-3: var(--vh-data-series-3, #e57373);
  --series-4: var(--vh-data-series-4, #ffb74d);
  --series-5: var(--vh-data-series-5, #f7dc6f);
  --series-6: var(--vh-data-series-6, #48c9b0);
  --series-7: var(--vh-data-series-7, #58d68d);
  --series-8: var(--vh-data-series-8, #5dade2);
  --series-9: var(--vh-data-series-9, #bb8fce);
  --series-10: var(--vh-data-series-10, #bfc9ca);
  --series-11: var(--vh-data-series-11, #ff8f48);
  --series-12: var(--vh-data-series-12, #7f8c8d);

  /* ----- Color Series Neon (dark only) -------------------------------- */
  --series-neon-1: #00fbff;
  --series-neon-2: #ff00ff;
  --series-neon-3: #ff9900;
  --series-neon-4: #ffff00;
  --series-neon-5: #00ff00;
}

/* ==========================================================================
   Global Resets & Base
   ========================================================================== */

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

html {
  font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.8rem 0;
  font-family: "TT Norms Pro", "Avenir Next", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: var(--vh-leading-tight);
}


a {
  color: var(--accent-text-secondary);
  text-decoration: none;
  transition: color 160ms ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-text-primary);
}

ul,
ol {
  margin: 0;
  padding-left: 1.25rem;
}

button {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--primary-focus) 40%, transparent);
}

::selection {
  background: color-mix(in srgb, var(--accent-text-secondary) 25%, transparent);
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */

.vh-text-xxs {
  font-size: var(--vh-text-xxs);
  line-height: var(--vh-leading-standard);
}

.vh-text-xs {
  font-size: var(--vh-text-xs);
  line-height: var(--vh-leading-standard);
}

.vh-text-sm {
  font-size: var(--vh-text-sm);
  line-height: var(--vh-leading-standard);
}

.vh-text-md {
  font-size: var(--vh-text-md);
  line-height: var(--vh-leading-standard);
}

.vh-text-lg {
  font-size: var(--vh-text-lg);
  line-height: var(--vh-leading-tight);
}

.vh-text-xl {
  font-size: var(--vh-text-xl);
  line-height: var(--vh-leading-tight);
}

.vh-text-2xl {
  font-size: var(--vh-text-2xl);
  line-height: var(--vh-leading-tight);
}

.vh-text-3xl {
  font-size: var(--vh-text-3xl);
  line-height: var(--vh-leading-tight);
}

.vh-text-muted {
  color: var(--text-muted);
}

.vh-text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.vh-weight-medium {
  font-weight: 500;
}

.vh-weight-semibold {
  font-weight: 500;
}

/* ==========================================================================
   Button System
   ========================================================================== */

.vh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--vh-button-radius-md);
  padding: var(--vh-button-padding-md);
  min-height: var(--vh-button-height-md);
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease, box-shadow 160ms ease;
}

.vh-button:focus-visible {
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--primary-focus) 35%, transparent);
}

.vh-button[disabled],
.vh-button.is-disabled {
  cursor: not-allowed;
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  border-color: var(--disabled-border);
  box-shadow: none;
}

.vh-button--primary {
  background-color: var(--primary-bg);
  color: var(--primary-text);
}

.vh-button--primary:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--primary-bg-hover);
}

.vh-button--primary:active:not([disabled]):not(.is-disabled) {
  background-color: var(--primary-bg-active);
}

.vh-button--secondary {
  background-color: var(--secondary-bg);
  color: var(--secondary-text);
  border-color: var(--secondary-border);
}

.vh-button--secondary:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--secondary-hover);
}

.vh-button--secondary:active:not([disabled]):not(.is-disabled) {
  background-color: var(--secondary-active);
}

.vh-button--constructive {
  background-color: var(--constructive-bg);
  color: var(--constructive-text);
}

.vh-button--constructive:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--constructive-hover);
}

.vh-button--constructive:active:not([disabled]):not(.is-disabled) {
  background-color: var(--constructive-active);
}

.vh-button--destructive {
  background-color: var(--destructive-bg);
  color: var(--destructive-text);
}

.vh-button--destructive:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--destructive-hover);
}

.vh-button--destructive:active:not([disabled]):not(.is-disabled) {
  background-color: var(--destructive-active);
}

.vh-button--ghost {
  background-color: transparent;
  color: var(--accent-text-primary);
  border-color: transparent;
}

.vh-button--ghost:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--secondary-hover);
}

.vh-button--ghost:active:not([disabled]):not(.is-disabled) {
  background-color: var(--secondary-active);
}

.vh-button-xs {
  font-size: var(--vh-text-xs);
  min-height: var(--vh-button-height-xs);
  padding: var(--vh-button-padding-xs);
  border-radius: var(--vh-button-radius-xs);
}

.vh-button-sm {
  font-size: var(--vh-text-sm);
  min-height: var(--vh-button-height-sm);
  padding: var(--vh-button-padding-sm);
  border-radius: var(--vh-button-radius-sm);
}

.vh-button-md {
  font-size: var(--vh-text-md);
  min-height: var(--vh-button-height-md);
  padding: var(--vh-button-padding-md);
  border-radius: var(--vh-button-radius-md);
}

.vh-button-lg {
  font-size: var(--vh-text-lg);
  min-height: var(--vh-button-height-lg);
  padding: var(--vh-button-padding-lg);
  border-radius: var(--vh-button-radius-lg);
}

/* Icon-only buttons */
.vh-button--icon {
  padding: 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: 2px;
  border-radius: 12px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.vh-button--icon svg {
  width: 60%;
  height: 60%;
}

.vh-button--icon.vh-button-xs {
  width: var(--vh-button-height-xs);
  height: var(--vh-button-height-xs);
}

.vh-button--icon.vh-button-sm {
  width: var(--vh-button-height-sm);
  height: var(--vh-button-height-sm);
}

.vh-button--icon.vh-button-md {
  width: var(--vh-button-height-md);
  height: var(--vh-button-height-md);
}

.vh-button--icon.vh-button-lg {
  width: var(--vh-button-height-lg);
  height: var(--vh-button-height-lg);
}

.vh-button--icon.vh-button--secondary {
  background: var(--secondary-bg);
  border-color: var(--secondary-border);
  color: var(--secondary-text);
}

.vh-button--icon.vh-button--secondary:hover:not([disabled]):not(.is-disabled) {
  background: var(--secondary-hover);
}

.vh-button--icon.vh-button--secondary:active:not([disabled]):not(.is-disabled) {
  background: var(--secondary-active);
}

.vh-button--icon.vh-button--primary {
  background-color: var(--primary-bg);
  border-color: var(--primary-focus);
  color: var(--primary-text);
}

.vh-button--icon.vh-button--primary:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--primary-bg-hover);
  border-color: var(--primary-focus);
}

.vh-button--icon.vh-button--primary:active:not([disabled]):not(.is-disabled) {
  background-color: var(--primary-bg-active);
  border-color: var(--primary-focus);
}

.vh-button--icon.vh-button--constructive {
  background-color: var(--constructive-bg);
  border-color: var(--constructive-focus);
  color: var(--constructive-text);
}

.vh-button--icon.vh-button--constructive:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--constructive-hover);
  border-color: var(--constructive-focus);
}

.vh-button--icon.vh-button--constructive:active:not([disabled]):not(.is-disabled) {
  background-color: var(--constructive-active);
  border-color: var(--constructive-focus);
}

.vh-button--icon.vh-button--destructive {
  background-color: var(--destructive-bg);
  border-color: var(--destructive-focus);
  color: var(--destructive-text);
}

.vh-button--icon.vh-button--destructive:hover:not([disabled]):not(.is-disabled) {
  background-color: var(--destructive-hover);
  border-color: var(--destructive-focus);
}

.vh-button--icon.vh-button--destructive:active:not([disabled]):not(.is-disabled) {
  background-color: var(--destructive-active);
  border-color: var(--destructive-focus);
}

/* ==========================================================================
   Form & Input System
   ========================================================================== */

.vh-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.vh-field__label {
  font-size: var(--vh-text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.vh-field__hint {
  font-size: var(--vh-text-xs);
  color: var(--text-muted);
}

.vh-input,
.vh-textarea {
  appearance: none;
  font-family: inherit;
  font-size: var(--vh-text-md);
  border-radius: 10px;
  border: 1px solid var(--menu-border);
  background-color: var(--menu-bg);
  color: var(--field-text);
  padding: 0.65rem 0.85rem;
  transition: border-color 140ms ease, box-shadow 140ms ease,
    background-color 140ms ease;
  width: 100%;
}

.vh-input::placeholder,
.vh-textarea::placeholder {
  color: var(--field-placeholder);
}

.vh-input:hover,
.vh-textarea:hover {
  border-color: var(--field-border);
}

.vh-input:focus,
.vh-textarea:focus {
  outline: none;
  border-color: var(--field-focus);
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--field-focus) 20%, transparent);
}

.vh-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--vh-leading-relaxed);
}

.vh-input:disabled,
.vh-textarea:disabled {
  cursor: not-allowed;
  background-color: var(--disabled-bg);
  color: var(--disabled-text);
  border-color: var(--disabled-border);
}

select.vh-input {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%234a4a4a' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 16px;
}

[data-theme="dark"] select.vh-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23c9c9c9' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

/* Search Bar */
.vh-search {
  position: relative;
  display: flex;
  align-items: center;
}

.vh-search__input {
  appearance: none;
  font-family: inherit;
  font-size: var(--vh-text-md);
  border-radius: 10px;
  border: 1px solid var(--menu-border);
  background-color: var(--menu-bg);
  color: var(--field-text);
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  width: 100%;
  transition: border-color 140ms ease, box-shadow 140ms ease,
    background-color 140ms ease;
}

.vh-search__input::placeholder {
  color: var(--field-placeholder);
}

.vh-search__input:hover {
  border-color: var(--field-border);
}

.vh-search__input:focus {
  outline: none;
  border-color: var(--field-focus);
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--field-focus) 20%, transparent);
}

.vh-search__icon {
  position: absolute;
  left: 0.75rem;
  width: 18px;
  height: 18px;
  pointer-events: none;
  color: var(--text-muted);
}

/* ==========================================================================
   Dropdown / Menu System
   ========================================================================== */

details.vh-dropdown {
  position: relative;
  display: inline-block;
  min-width: 220px;
}

summary.vh-dropdown__trigger {
  list-style: none;
  cursor: pointer;
}

summary.vh-dropdown__trigger::-webkit-details-marker {
  display: none;
}

.vh-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: var(--vh-button-padding-sm);
  min-height: var(--vh-button-height-sm);
  border-radius: var(--vh-button-radius-sm);
  background-color: var(--menu-bg);
  color: var(--secondary-text);
  border: 1px solid var(--secondary-border);
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease;
}

.vh-dropdown__trigger:hover {
  background-color: var(--secondary-hover);
}

details.vh-dropdown[open] > summary.vh-dropdown__trigger {
  background-color: var(--secondary-hover);
}

.vh-dropdown__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background-color: var(--menu-bg);
  border: 1px solid var(--menu-border);
  border-radius: 12px;
  box-shadow: var(--menu-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 20;
}

details.vh-dropdown[open] .vh-dropdown__menu {
  opacity: 1;
  pointer-events: auto;
}

.vh-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: var(--vh-text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.vh-dropdown__item:hover {
  background-color: var(--menu-item-hover);
  color: var(--accent-text-secondary);
}

.vh-dropdown__item:active {
  background-color: var(--menu-item-active);
}

.vh-dropdown__item.is-destructive {
  color: var(--destructive-bg);
}

.vh-dropdown__item + .vh-dropdown__item-divider {
  margin: 0.25rem 0;
}

.vh-dropdown__item-divider {
  height: 1px;
  background: var(--menu-divider);
}

.vh-dropdown__meta {
  font-size: var(--vh-text-xs);
  color: var(--text-muted);
}

/* ==========================================================================
   Utility Helpers
   ========================================================================== */

.vh-surface {
  background-color: var(--bg-surface);
  border: 1px solid var(--stroke-soft);
  border-radius: 16px;
  padding: 1.5rem;
}

.vh-elevated {
  background-color: var(--bg-elevated);
  box-shadow: 0 18px 44px rgba(23, 25, 38, 0.08);
}

.vh-stack-sm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vh-stack-md {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.vh-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.vh-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--vh-text-xs);
  font-weight: 600;
  color: var(--secondary-text);
  background-color: var(--secondary-hover);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.vh-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background-color: var(--destructive-bg);
  color: var(--destructive-text);
  font-size: var(--vh-text-xs);
  font-weight: 600;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --vh-text-3xl: 2.25rem;
    --vh-text-2xl: 1.875rem;
    --vh-text-xl: 1.375rem;
    --vh-text-lg: 1.125rem;
  }

  .vh-button {
    width: 100%;
  }

  .vh-dropdown__menu {
    min-width: 240px;
  }
}

