@layer orvel {
  :where([class^="ov-"], [class*=" ov-"]) {
    box-sizing: border-box;
    font-family: var(--ov-font-sans);
  }
  :where(a.ov-button, .ov-link) {
    text-decoration: none;
  }
  :where(
    .ov-button,
    .ov-input,
    .ov-checkbox,
    .ov-link,
    .ov-table-scroll,
    .ov-menu__item,
    .ov-tabs__trigger,
    .ov-tabs__content,
    .ov-switch
  ):focus-visible {
    outline: 2px solid var(--ov-accent);
    outline-offset: 3px;
  }
  .ov-container {
    width: min(100% - 48px, var(--ov-content-width));
    margin-inline: auto;
  }
  .ov-stack {
    display: flex;
    gap: var(--ov-stack-gap, 16px);
  }
  .ov-grid {
    display: grid;
    grid-template-columns: repeat(var(--ov-columns, 3), minmax(0, 1fr));
    gap: 24px;
  }
  .ov-surface {
    padding: 24px;
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius-panel);
    background: var(--ov-surface);
    color: var(--ov-text);
  }
  .ov-heading {
    color: var(--ov-text);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.12;
    margin: 0;
    text-wrap: balance;
  }
  h1.ov-heading {
    font-size: clamp(32px, 4.8vw, 64px);
  }
  h2.ov-heading {
    font-size: clamp(26px, 3vw, 40px);
  }
  h3.ov-heading {
    font-size: 22px;
  }
  .ov-text {
    font-size: 16px;
    line-height: 1.65;
    margin: 0;
    color: var(--ov-text);
  }
  .ov-text--muted {
    color: var(--ov-muted);
  }
  .ov-divider {
    border: 0;
    border-top: 1px solid var(--ov-border);
    margin: 24px 0;
  }
  .ov-logo {
    display: block;
    width: 142px;
    height: auto;
  }
  .ov-logo--compact {
    width: 40px;
  }
  .ov-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--ov-control-height);
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--ov-radius-button, 999px);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    transition:
      background var(--ov-motion),
      border-color var(--ov-motion),
      color var(--ov-motion);
  }
  .ov-button--primary {
    background: var(--ov-accent);
    color: var(--ov-on-accent);
  }
  .ov-button--primary:hover {
    background: var(--ov-accent-hover);
    color: var(--ov-on-accent);
  }
  .ov-button--secondary {
    background: var(--ov-surface);
    color: var(--ov-text);
    border-color: var(--ov-border);
  }
  .ov-button--secondary:hover {
    background: var(--ov-bg);
    border-color: var(--ov-muted);
  }
  .ov-button--ghost {
    background: transparent;
    color: var(--ov-muted);
  }
  .ov-button--ghost:hover {
    background: var(--ov-accent-soft);
    color: var(--ov-accent-hover);
  }
  .ov-button--danger {
    background: var(--ov-danger);
    color: #fff;
  }
  .ov-button--danger:hover {
    background: #8e1b2b;
  }
  .ov-button--sm {
    min-height: 32px;
    padding: 7px 11px;
    font-size: 13px;
  }
  .ov-button--lg {
    min-height: 48px;
    padding: 13px 22px;
    font-size: 16px;
  }
  .ov-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .ov-icon-button {
    padding: 8px;
    aspect-ratio: 1;
  }
  .ov-link {
    color: var(--ov-accent-hover);
    font-weight: 500;
  }
  .ov-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .ov-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
  }
  .ov-tone--neutral {
    color: var(--ov-muted);
    background: var(--ov-bg);
  }
  .ov-tone--info {
    color: var(--ov-accent-hover);
    background: var(--ov-accent-soft);
  }
  .ov-tone--success {
    color: var(--ov-success);
    background: var(--ov-success-soft);
  }
  .ov-tone--warning {
    color: var(--ov-warning);
    background: var(--ov-warning-soft);
  }
  .ov-tone--danger {
    color: var(--ov-danger);
    background: var(--ov-danger-soft);
  }
  .ov-alert {
    padding: 14px 16px;
    border: 1px solid currentColor;
    border-radius: var(--ov-radius);
    font-size: 14px;
    line-height: 1.5;
  }
  .ov-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ov-spin 0.8s linear infinite;
  }
  @keyframes ov-spin {
    to {
      transform: rotate(360deg);
    }
  }
  .ov-skeleton {
    height: 20px;
    min-width: 60px;
    background: var(--ov-border);
    border-radius: 4px;
    animation: ov-pulse 1.6s ease-in-out infinite alternate;
  }
  @keyframes ov-pulse {
    to {
      opacity: 0.5;
    }
  }
  .ov-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
    gap: 12px;
  }
  .ov-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .ov-label {
    color: var(--ov-text);
    font-weight: 500;
    font-size: 14px;
  }
  .ov-field__hint {
    color: var(--ov-muted);
    font-size: 13px;
  }
  .ov-field__error {
    color: var(--ov-danger);
    font-size: 13px;
  }
  .ov-input {
    display: block;
    width: 100%;
    min-height: var(--ov-control-height);
    padding: 10px 12px;
    background: var(--ov-surface);
    color: var(--ov-text);
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius);
    font-size: 14px;
    line-height: 1.5;
  }
  .ov-input:hover {
    border-color: #a5afbd;
  }
  .ov-input[aria-invalid="true"] {
    border-color: var(--ov-danger);
  }
  .ov-input:disabled {
    background: var(--ov-bg);
    color: var(--ov-muted);
    cursor: not-allowed;
  }
  .ov-input::placeholder {
    color: #667085;
  }
  .ov-textarea {
    min-height: 120px;
    resize: vertical;
  }
  .ov-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--ov-accent);
  }
  .ov-table-scroll {
    position: relative;
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius-panel);
    background: var(--ov-surface);
  }
  .ov-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--ov-text);
    text-align: left;
  }
  .ov-table th {
    padding: 12px var(--ov-table-padding);
    background: var(--ov-bg);
    color: var(--ov-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
  .ov-table td {
    padding: var(--ov-table-padding);
    border-top: 1px solid var(--ov-border);
    font-variant-numeric: tabular-nums;
  }
  .ov-table tbody tr:hover {
    background: #f9faff;
  }
  .ov-metric {
    padding: 20px;
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius-panel);
    background: var(--ov-surface);
  }
  .ov-metric__label {
    font-size: 13px;
    color: var(--ov-muted);
  }
  .ov-metric__value {
    margin: 10px 0 4px;
    color: var(--ov-text);
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
  }
  .ov-metric__hint {
    font-size: 12px;
    color: var(--ov-muted);
  }
  .ov-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
  }
  .ov-page-header .ov-text {
    margin-top: 14px;
    max-width: 660px;
  }
  .ov-page-header__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }
  .ov-eyebrow {
    margin: 0 0 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ov-accent-hover);
    letter-spacing: 0;
    text-transform: none;
  }
  .ov-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 10px;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: var(--ov-muted);
  }
  .ov-breadcrumbs li + li:before {
    content: "/";
    margin-right: 10px;
    color: var(--ov-border);
  }
  .ov-breadcrumbs a {
    color: var(--ov-muted);
  }
  .ov-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px;
    font-size: 14px;
  }
  .ov-public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 88px;
    border-bottom: 1px solid var(--ov-border);
  }
  .ov-public-footer {
    padding: 40px 0;
    border-top: 1px solid var(--ov-border);
  }
  .ov-app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--ov-bg);
  }
  .ov-sidebar {
    padding: 24px 16px;
    background: var(--ov-surface);
    border-right: 1px solid var(--ov-border);
  }
  .ov-app-main {
    min-width: 0;
    padding: 40px;
  }
  .ov-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #11182766;
  }
  .ov-modal {
    position: fixed;
    z-index: 1001;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 32px));
    max-height: calc(100dvh - 40px);
    overflow: auto;
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius-panel);
    padding: 24px;
    background: var(--ov-surface);
    color: var(--ov-text);
    box-shadow: 0 20px 70px #11182726;
  }
  .ov-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
  .ov-modal__head .ov-heading {
    font-size: 22px;
  }
  .ov-modal__description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ov-muted);
    margin: 12px 0 20px;
  }
  .ov-modal__body {
    margin-top: 20px;
  }
  .ov-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
  }
  .ov-drawer {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    transform: none;
    height: 100dvh;
    max-height: none;
    width: min(360px, calc(100% - 32px));
    border-radius: 0;
  }
  .ov-drawer--left {
    left: 0;
    right: auto;
  }
  .ov-menu {
    z-index: 1010;
    min-width: 180px;
    padding: 5px;
    background: var(--ov-surface);
    color: var(--ov-text);
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius);
    box-shadow: 0 8px 30px #11182712;
  }
  .ov-menu__item {
    padding: 9px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    outline: none;
  }
  .ov-menu__item[data-highlighted] {
    background: var(--ov-accent-soft);
    color: var(--ov-accent-hover);
  }
  .ov-menu__item[data-disabled] {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .ov-menu__item--danger {
    color: var(--ov-danger);
  }
  .ov-tabs__list {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--ov-border);
    gap: 20px;
  }
  .ov-tabs__trigger {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 12px 2px;
    color: var(--ov-muted);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
  }
  .ov-tabs__trigger[data-state="active"] {
    color: var(--ov-accent-hover);
    border-bottom-color: var(--ov-accent);
  }
  .ov-tabs__trigger:disabled {
    opacity: 0.4;
  }
  .ov-tabs__content {
    padding-top: 24px;
  }
  .ov-tooltip {
    z-index: 1020;
    max-width: 280px;
    padding: 8px 12px;
    background: var(--ov-text);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
  }
  .ov-tooltip svg {
    fill: var(--ov-text);
  }
  .ov-switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ov-text);
    font-size: 14px;
  }
  .ov-switch {
    width: 38px;
    height: 22px;
    border: 0;
    border-radius: 20px;
    padding: 3px;
    background: #8893a4;
    cursor: pointer;
  }
  .ov-switch[data-state="checked"] {
    background: var(--ov-accent);
  }
  .ov-switch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .ov-switch__thumb {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--ov-motion);
  }
  .ov-switch__thumb[data-state="checked"] {
    transform: translateX(16px);
  }
  .ov-toast-viewport {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    width: min(380px, calc(100% - 32px));
    padding: 0;
    list-style: none;
    outline: none;
  }
  .ov-toast {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    background: var(--ov-surface);
    color: var(--ov-text);
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius-panel);
    box-shadow: 0 8px 32px #11182718;
    font-size: 14px;
  }
  @media (max-width: 767px) {
    .ov-container {
      width: calc(100% - 32px);
    }
    .ov-grid {
      grid-template-columns: 1fr;
    }
    .ov-page-header {
      align-items: flex-start;
      flex-direction: column;
    }
    .ov-app-shell {
      display: block;
    }
    .ov-app-main {
      padding: 24px 16px;
    }
    .ov-sidebar {
      border-right: 0;
    }
    .ov-modal__actions {
      flex-wrap: wrap;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .ov-spinner,
    .ov-skeleton {
      animation: none;
    }
    :where([class^="ov-"], [class*=" ov-"]) {
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
}
