:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

.wf-surface {
  background: var(--wf-color-background-surface);
  color: var(--wf-color-text-primary);
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
  border-radius: var(--wf-radius-md);
  padding: var(--wf-space-16);
  box-shadow: var(--wf-shadow-none);
}

.wf-tone-default {
  background: var(--wf-color-background-surface);
}

.wf-tone-subtle {
  background: var(--wf-color-background-surface-subtle);
}

.wf-tone-elevated {
  background: var(--wf-color-background-surface);
  box-shadow: var(--wf-shadow-soft);
}

.wf-card {
  border-radius: var(--wf-radius-md);
  display: block;
}

.wf-button,
.wf-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wf-space-8);
  border-radius: var(--wf-radius-pill);
  border: var(--wf-border-width-default) solid transparent;
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-label-md-size);
  font-weight: var(--wf-font-label-md-weight);
  line-height: var(--wf-font-label-md-line-height);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.wf-button:focus-visible,
.wf-icon-button:focus-visible,
.wf-text-link:focus-visible,
.wf-input:focus-visible,
.wf-select:focus-visible,
.wf-checkbox:focus-visible,
.wf-switch-input:focus-visible + .wf-switch-track,
.wf-tab:focus-visible,
.wf-segment-input:focus-visible + .wf-segment-label {
  outline: none;
  box-shadow: 0 0 0 var(--wf-border-width-strong) var(--wf-color-focus-ring);
}

.wf-button:disabled,
.wf-icon-button:disabled,
.wf-input:disabled,
.wf-select:disabled,
.wf-checkbox:disabled,
.wf-switch-input:disabled + .wf-switch-track,
.wf-tab:disabled,
.wf-segment-input:disabled + .wf-segment-label {
  cursor: not-allowed;
  opacity: 0.52;
}

.wf-size-sm {
  min-height: var(--wf-control-height-sm);
  padding: 0 var(--wf-control-padding-x-sm);
}

.wf-size-md {
  min-height: var(--wf-control-height-md);
  padding: 0 var(--wf-control-padding-x-md);
}

.wf-size-lg {
  min-height: var(--wf-control-height-lg);
  padding: 0 var(--wf-control-padding-x-lg);
}

.wf-button-primary {
  background: var(--wf-color-action-primary-bg);
  color: var(--wf-color-action-primary-text);
  border-color: var(--wf-color-action-primary-border);
}

.wf-button-primary:hover:not(:disabled) {
  filter: saturate(1.08);
}

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

.wf-button-secondary:hover:not(:disabled) {
  background: var(--wf-color-background-surface);
}

.wf-button-ghost {
  background: transparent;
  color: var(--wf-color-action-ghost-text);
  border-color: var(--wf-color-border-default);
}

.wf-button-ghost:hover:not(:disabled) {
  background: var(--wf-color-background-surface-subtle);
}

.wf-button-destructive {
  background: var(--wf-color-action-destructive-bg);
  color: var(--wf-color-action-destructive-text);
  border-color: var(--wf-color-action-destructive-bg);
}

.wf-button-destructive:hover:not(:disabled) {
  filter: saturate(1.06);
}

.wf-icon-button {
  padding: 0;
}

.wf-icon-button.wf-size-sm {
  width: var(--wf-control-height-sm);
  height: var(--wf-control-height-sm);
}

.wf-icon-button.wf-size-md {
  width: var(--wf-control-height-md);
  height: var(--wf-control-height-md);
}

.wf-icon-button.wf-size-lg {
  width: var(--wf-control-height-lg);
  height: var(--wf-control-height-lg);
}

.wf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--wf-control-icon-md);
  line-height: 1;
}

.wf-icon-button.wf-size-sm .wf-icon {
  font-size: var(--wf-control-icon-sm);
}

.wf-icon-button.wf-size-lg .wf-icon {
  font-size: var(--wf-control-icon-lg);
}

.wf-text-link {
  color: var(--wf-color-action-ghost-text);
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  border-radius: var(--wf-radius-sm);
}

.wf-text-link:hover {
  text-decoration-thickness: 2px;
}

.wf-text-link-subtle {
  color: var(--wf-color-text-secondary);
}

.wf-text-link-primary {
  color: var(--wf-color-action-ghost-text);
}

.wf-badge,
.wf-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--wf-radius-pill);
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-label-sm-size);
  font-weight: var(--wf-font-label-sm-weight);
  line-height: var(--wf-font-label-sm-line-height);
  padding: 0 var(--wf-space-12);
  min-height: var(--wf-control-height-sm);
  color: var(--wf-color-text-secondary);
  background: var(--wf-color-background-surface-subtle);
}

.wf-status-chip {
  min-height: var(--wf-control-height-md);
  padding: 0 var(--wf-space-16);
}

.wf-status-neutral {
  color: var(--wf-color-text-secondary);
  background: var(--wf-color-background-surface-subtle);
  border-color: var(--wf-color-border-default);
}

.wf-status-success {
  color: var(--wf-color-status-success-text);
  background: var(--wf-color-status-success-bg);
  border-color: var(--wf-color-status-success-border);
}

.wf-status-warning {
  color: var(--wf-color-status-warning-text);
  background: var(--wf-color-status-warning-bg);
  border-color: var(--wf-color-status-warning-border);
}

.wf-status-error {
  color: var(--wf-color-status-error-text);
  background: var(--wf-color-status-error-bg);
  border-color: var(--wf-color-status-error-border);
}

.wf-status-info {
  color: var(--wf-color-status-info-text);
  background: var(--wf-color-status-info-bg);
  border-color: var(--wf-color-status-info-border);
}

.wf-divider {
  border: 0;
  border-top: var(--wf-border-width-default) solid var(--wf-color-border-default);
  margin: var(--wf-space-16) 0;
}

.wf-divider-vertical {
  display: inline-block;
  width: var(--wf-border-width-default);
  height: 100%;
  margin: 0 var(--wf-space-16);
  border-top: 0;
  border-left: var(--wf-border-width-default) solid var(--wf-color-border-default);
  vertical-align: middle;
}

.wf-stat-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--wf-space-12);
  align-items: start;
}

.wf-stat-card-accent {
  width: var(--wf-space-8);
  min-height: calc(var(--wf-control-height-lg) + var(--wf-space-8));
  border-radius: var(--wf-radius-pill);
}

.wf-stat-card-body {
  display: grid;
  gap: var(--wf-space-4);
}

.wf-field {
  display: grid;
  gap: var(--wf-space-6);
}

.wf-label {
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-label-md-size);
  font-weight: var(--wf-font-label-md-weight);
  color: var(--wf-color-text-primary);
  display: inline-flex;
  gap: var(--wf-space-4);
  align-items: center;
}

.wf-label-marker {
  color: var(--wf-color-status-error-text);
}

.wf-label-meta,
.wf-hint-text,
.wf-error-text {
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-label-sm-size);
  line-height: var(--wf-font-label-sm-line-height);
}

.wf-label-meta,
.wf-hint-text {
  color: var(--wf-color-text-muted);
}

.wf-error-text {
  color: var(--wf-color-status-error-text);
}

.wf-input-shell {
  display: inline-flex;
  align-items: center;
  gap: var(--wf-space-8);
  width: 100%;
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
  border-radius: var(--wf-radius-md);
  background: var(--wf-color-background-surface);
  color: var(--wf-color-text-primary);
  padding: 0 var(--wf-space-12);
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.wf-input-shell:has(.wf-input:hover:not(:disabled)),
.wf-input-shell:has(.wf-select:hover:not(:disabled)) {
  border-color: var(--wf-color-border-strong);
}

.wf-control-sm {
  min-height: var(--wf-control-height-sm);
}

.wf-control-md {
  min-height: var(--wf-control-height-md);
}

.wf-control-lg {
  min-height: var(--wf-control-height-lg);
}

.wf-input,
.wf-select {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-body-sm-size);
  line-height: var(--wf-font-body-sm-line-height);
}

.wf-input::placeholder {
  color: var(--wf-color-text-muted);
}

.wf-input:focus-visible,
.wf-select:focus-visible {
  box-shadow: none;
}

.wf-input:focus-visible,
.wf-select:focus-visible,
.wf-checkbox:focus-visible,
.wf-tab:focus-visible,
.wf-segment-input:focus-visible + .wf-segment-label,
.wf-switch-input:focus-visible + .wf-switch-track {
  outline: none;
}

.wf-input-shell:has(.wf-input:focus-visible),
.wf-input-shell:has(.wf-select:focus-visible) {
  border-color: var(--wf-color-focus-ring);
  box-shadow: 0 0 0 var(--wf-border-width-strong) var(--wf-color-focus-ring);
}

.wf-input-shell.is-invalid {
  border-color: var(--wf-color-status-error-border);
}

.wf-input-shell.is-disabled {
  background: var(--wf-color-background-surface-subtle);
}

.wf-control-leading,
.wf-control-trailing {
  color: var(--wf-color-text-muted);
  font-size: var(--wf-font-label-md-size);
  line-height: 1;
}

.wf-search-input .wf-control-leading {
  font-size: var(--wf-control-icon-sm);
}

.wf-select {
  appearance: none;
  cursor: pointer;
}

.wf-checkbox {
  appearance: none;
  width: var(--wf-space-20);
  height: var(--wf-space-20);
  border-radius: var(--wf-radius-sm);
  border: var(--wf-border-width-default) solid var(--wf-color-border-strong);
  background: var(--wf-color-background-surface);
  display: inline-grid;
  place-items: center;
}

.wf-checkbox::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
  transform: scale(0);
  transition: transform 100ms ease;
  background: var(--wf-color-action-primary-bg);
}

.wf-checkbox:checked::after,
.wf-checkbox[data-indeterminate='true']::after {
  transform: scale(1);
}

.wf-checkbox.is-invalid {
  border-color: var(--wf-color-status-error-border);
}

.wf-switch {
  display: inline-flex;
}

.wf-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wf-switch-track {
  width: 42px;
  height: 24px;
  border-radius: var(--wf-radius-pill);
  border: var(--wf-border-width-default) solid var(--wf-color-border-strong);
  background: var(--wf-color-background-surface-subtle);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.wf-switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: var(--wf-radius-pill);
  background: var(--wf-color-background-surface);
  box-shadow: var(--wf-shadow-none);
  transition: transform 120ms ease;
}

.wf-switch-input:checked + .wf-switch-track {
  background: var(--wf-color-action-primary-bg);
  border-color: var(--wf-color-action-primary-border);
}

.wf-switch-input:checked + .wf-switch-track .wf-switch-thumb {
  transform: translateX(18px);
}

.wf-tabs {
  display: inline-flex;
  border-bottom: var(--wf-border-width-default) solid var(--wf-color-border-default);
  gap: var(--wf-space-4);
}

.wf-tab {
  border: 0;
  border-bottom: var(--wf-border-width-strong) solid transparent;
  background: transparent;
  color: var(--wf-color-text-secondary);
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-label-md-size);
  font-weight: var(--wf-font-label-md-weight);
  line-height: var(--wf-font-label-md-line-height);
  padding: var(--wf-space-8) var(--wf-space-12);
  cursor: pointer;
}

.wf-tab:hover:not(:disabled) {
  color: var(--wf-color-text-primary);
}

.wf-tab.is-active {
  color: var(--wf-color-text-primary);
  border-bottom-color: var(--wf-color-action-primary-border);
}

.wf-segmented-control {
  display: inline-flex;
  gap: var(--wf-space-4);
  padding: var(--wf-space-4);
  border-radius: var(--wf-radius-pill);
  background: var(--wf-color-background-surface-subtle);
}

.wf-segment {
  position: relative;
}

.wf-segment-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wf-segment-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 var(--wf-space-16);
  border-radius: var(--wf-radius-pill);
  color: var(--wf-color-text-secondary);
  font-size: var(--wf-font-label-md-size);
  font-weight: var(--wf-font-label-md-weight);
  cursor: pointer;
}

.wf-segment:hover .wf-segment-label {
  color: var(--wf-color-text-primary);
}

.wf-segment.is-active .wf-segment-label,
.wf-segment-input:checked + .wf-segment-label {
  background: var(--wf-color-background-surface);
  color: var(--wf-color-text-primary);
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
}

.wf-alert,
.wf-notice-banner,
.wf-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--wf-space-12);
  align-items: start;
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
  border-radius: var(--wf-radius-md);
  padding: var(--wf-space-12);
}

.wf-alert-icon,
.wf-notice-banner-icon,
.wf-toast-icon {
  color: currentColor;
  font-size: var(--wf-control-icon-md);
  line-height: 1;
}

.wf-alert-title,
.wf-notice-banner-title {
  margin: 0;
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-label-md-size);
  font-weight: var(--wf-font-label-md-weight);
  color: inherit;
}

.wf-alert-message,
.wf-notice-banner-message,
.wf-toast-message {
  margin: 0;
  font-family: var(--wf-font-body);
  font-size: var(--wf-font-body-sm-size);
  line-height: var(--wf-font-body-sm-line-height);
  color: inherit;
}

.wf-alert-body,
.wf-notice-banner-body {
  display: grid;
  gap: var(--wf-space-4);
}

.wf-alert-action,
.wf-notice-banner-action,
.wf-toast-dismiss {
  display: inline-flex;
  align-items: center;
}

.wf-toast {
  align-items: center;
  min-height: var(--wf-control-height-md);
  border-radius: var(--wf-radius-pill);
  padding: var(--wf-space-8) var(--wf-space-12);
}

.wf-empty-state {
  display: grid;
  gap: var(--wf-space-8);
  text-align: left;
  padding: var(--wf-space-20);
  border: var(--wf-border-width-default) dashed var(--wf-color-border-strong);
  border-radius: var(--wf-radius-md);
  background: var(--wf-color-background-surface);
}

.wf-empty-state-media {
  display: inline-flex;
  align-items: center;
  color: var(--wf-color-text-muted);
}

.wf-empty-state-label {
  margin: 0;
  color: var(--wf-color-text-muted);
  font-size: var(--wf-font-label-sm-size);
  line-height: var(--wf-font-label-sm-line-height);
}

.wf-empty-state-title {
  margin: 0;
  color: var(--wf-color-text-primary);
  font-family: var(--wf-font-heading);
  font-size: var(--wf-font-heading-sm-size);
  line-height: var(--wf-font-heading-sm-line-height);
}

.wf-empty-state-description {
  margin: 0;
  color: var(--wf-color-text-secondary);
  font-size: var(--wf-font-body-sm-size);
  line-height: var(--wf-font-body-sm-line-height);
}

.wf-empty-state-action {
  display: inline-flex;
  align-items: center;
  gap: var(--wf-space-8);
}

.wf-modal-shell,
.wf-drawer-shell {
  display: grid;
  gap: var(--wf-space-16);
  background: var(--wf-color-background-surface);
  color: var(--wf-color-text-primary);
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
  border-radius: var(--wf-radius-lg);
  box-shadow: var(--wf-shadow-overlay);
  padding: var(--wf-space-20);
}

.wf-modal-shell {
  width: min(640px, 100%);
}

.wf-drawer-shell {
  width: min(420px, 100%);
}

.wf-drawer-shell-start {
  justify-self: start;
}

.wf-drawer-shell-end {
  justify-self: end;
}

.wf-modal-shell-header,
.wf-drawer-shell-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--wf-space-12);
}

.wf-modal-shell-title,
.wf-drawer-shell-title {
  margin: 0;
  font-family: var(--wf-font-heading);
  font-size: var(--wf-font-heading-sm-size);
  line-height: var(--wf-font-heading-sm-line-height);
}

.wf-modal-shell-content,
.wf-drawer-shell-content {
  display: grid;
  gap: var(--wf-space-12);
}

.wf-modal-shell-footer,
.wf-drawer-shell-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--wf-space-8);
}

.wf-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
  border-radius: var(--wf-radius-md);
  background: var(--wf-color-background-surface);
}

.wf-table {
  width: 100%;
  border-collapse: collapse;
}

.wf-table-header {
  background: var(--wf-color-background-surface-subtle);
}

.wf-table-head-cell,
.wf-table-cell {
  text-align: left;
  font-size: var(--wf-font-body-sm-size);
  line-height: var(--wf-font-body-sm-line-height);
  padding: var(--wf-space-12) var(--wf-space-16);
  border-bottom: var(--wf-border-width-default) solid var(--wf-color-border-default);
}

.wf-table-head-cell,
.wf-table-cell-header {
  font-weight: var(--wf-font-label-md-weight);
  color: var(--wf-color-text-primary);
}

.wf-table-row:last-child .wf-table-cell {
  border-bottom: 0;
}

.wf-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--wf-space-12);
  padding: var(--wf-space-12) var(--wf-space-16);
  border: var(--wf-border-width-default) solid var(--wf-color-border-default);
  border-radius: var(--wf-radius-md);
  background: var(--wf-color-background-surface);
}

.wf-list-row-main,
.wf-list-row-meta,
.wf-list-row-trailing {
  min-width: 0;
}

.wf-list-row-meta {
  color: var(--wf-color-text-muted);
  font-size: var(--wf-font-label-sm-size);
}
