.kilo-console .models {
  display: grid;
  gap: 0.5rem;
}

.kilo-console .models-filter-card {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 0.75rem;
}

.kilo-console .models-filter-row {
  display: grid;
  gap: 0.5rem;
  align-items: center;
}

.kilo-console .models-filter-primary {
  grid-template-columns: minmax(14rem, 1.6fr) repeat(3, minmax(8.75rem, 1fr)) auto;
}

.kilo-console .models-filter-field {
  position: relative;
  display: grid;
  min-width: 0;
}

.kilo-console .models-filter-field > span {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.kilo-console .models-filter-field input,
.kilo-console .models-select summary,
.kilo-console .models-favorite-filter,
.kilo-console .models-capability-toggle {
  height: 2rem;
  min-height: 2rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  line-height: 1.45;
}

.kilo-console .models-filter-field input {
  padding: 0 0.75rem;
}

.kilo-console .models-select {
  position: relative;
  min-width: 0;
}

.kilo-console .models-select summary {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--input) 35%, transparent);
  color: var(--foreground);
  cursor: pointer;
  list-style: none;
  padding: 0 0.75rem;
  white-space: nowrap;
}

.kilo-console .models-select summary::-webkit-details-marker {
  display: none;
}

.kilo-console .models-select summary::marker {
  content: "";
}

.kilo-console .models-select summary::after {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23a1a1aa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 1rem;
  content: "";
}

.kilo-console .models-select[open] summary,
.kilo-console .models-select summary:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 25%, transparent);
  outline: 0;
}

.kilo-console .models-select.disabled summary {
  cursor: not-allowed;
  opacity: 0.65;
}

.kilo-console .models-select.invalid summary {
  border-color: var(--status-error-base);
}

.kilo-console .models-select-menu {
  position: absolute;
  z-index: 35;
  top: calc(100% + 0.25rem);
  left: 0;
  display: grid;
  width: 100%;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--popover);
  box-shadow: 0 1rem 2rem color-mix(in oklab, black 24%, transparent);
  padding: 0.25rem;
}

.kilo-console .models-select-option {
  display: block;
  width: 100%;
  min-height: 1.75rem;
  border: 0;
  border-radius: calc(var(--radius-md) - 0.125rem);
  background: transparent;
  color: var(--popover-foreground);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.45;
  padding: 0.25rem 0.5rem;
  text-align: left;
}

.kilo-console .models-select-option:hover,
.kilo-console .models-select-option:focus-visible {
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  color: var(--foreground);
  outline: 0;
}

.kilo-console .models-select-option.selected {
  background: color-mix(in oklab, var(--primary) 20%, transparent);
  color: var(--foreground);
}

.kilo-console .models-select-option.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.kilo-console .models-favorite-filter,
.kilo-console .models-capability-toggle {
  display: inline-flex;
  gap: 0.375rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--input) 35%, transparent);
  color: var(--muted-foreground);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0 0.75rem;
}

.kilo-console .models-favorite-filter:hover,
.kilo-console .models-capability-toggle:hover,
.kilo-console .models-favorite-filter.selected,
.kilo-console .models-capability-toggle.selected {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  color: var(--foreground);
}

.kilo-console .models-favorite-filter .model-star {
  width: 1rem;
  height: 1rem;
  cursor: inherit;
  padding: 0;
}

.kilo-console .models-filter-secondary {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.kilo-console .models-context-filter {
  flex: 1 1 auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 16rem;
}

.kilo-console .models-context-filter > span,
.kilo-console .models-capabilities-filter > span {
  flex: 0 0 auto;
  color: var(--muted-foreground);
  font-size: 0.6875rem;
  line-height: 1.45;
  white-space: nowrap;
}

.kilo-console .models-context-filter .context-range {
  flex: 1 1 auto;
  height: 1rem;
  min-height: 1rem;
  border: 0;
  background: transparent;
  padding: 0;
}

.kilo-console .models-context-filter .context-track,
.kilo-console .models-context-filter .context-fill {
  top: 50%;
  right: 0;
  left: 0;
  height: 0.25rem;
  transform: translateY(-50%);
}

.kilo-console .models-context-filter .context-track {
  background: var(--border);
}

.kilo-console .models-context-filter .context-fill {
  right: calc(100% - var(--context-max));
  background: var(--primary);
}

.kilo-console .models-context-filter .context-max {
  top: 50%;
  left: var(--context-max);
  width: 0.875rem;
  height: 0.875rem;
  min-height: 0.875rem;
  border: 1px solid var(--border);
  background: var(--foreground);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--background) 70%, transparent);
  transform: translate(-50%, -50%);
}

.kilo-console .models-context-value {
  flex: 0 0 3.5rem;
  color: var(--foreground);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: right;
}

.kilo-console .models-capabilities-filter {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.kilo-console .models-capabilities-list {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex-wrap: wrap;
}

.kilo-console .explore-models {
  grid-template-columns: repeat(auto-fill, minmax(22.5rem, 1fr));
  gap: 0.625rem;
}

.kilo-console .model {
  display: grid;
  gap: 0.65rem;
  border: 1px solid var(--border-weak-base);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.75rem;
}

.kilo-console .model strong,
.kilo-console .model span:where(:not([data-component="tag"])) {
  display: block;
}

.kilo-console .model span:where(:not([data-component="tag"])) {
  color: var(--text-weaker);
  font-size: var(--font-size-small);
}

.kilo-console .model-main {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.kilo-console .model-title {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  min-width: 0;
}

.kilo-console .model-star {
  flex: 0 0 auto;
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  border: 0;
  background: transparent;
  color: var(--text-weaker);
  cursor: pointer;
  padding: 0.1rem;
}

.kilo-console .model-star::before {
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  content: "";
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' fill-rule='evenodd' d='M8 1.25L10.05 5.4L14.63 6.07L11.32 9.29L12.1 13.85L8 11.69L3.9 13.85L4.68 9.29L1.37 6.07L5.95 5.4L8 1.25ZM8 3.51L6.88 5.78L6.65 6.26L6.12 6.34L3.61 6.7L5.43 8.47L5.81 8.84L5.72 9.37L5.29 11.86L7.53 10.68L8 10.43L8.47 10.68L10.71 11.86L10.28 9.37L10.19 8.84L10.57 8.47L12.39 6.7L9.88 6.34L9.35 6.26L9.12 5.78L8 3.51Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.kilo-console .model-star.active {
  color: var(--text-interactive-base);
}

.kilo-console .model-star.active::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8 1.25L10.05 5.4L14.63 6.07L11.32 9.29L12.1 13.85L8 11.69L3.9 13.85L4.68 9.29L1.37 6.07L5.95 5.4L8 1.25Z'/%3E%3C/svg%3E");
}

.kilo-console .model-star:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.kilo-console .model-star:focus-visible {
  border-radius: var(--radius-md);
  outline: 2px solid color-mix(in srgb, var(--border-focus) 45%, transparent);
  outline-offset: 2px;
}

.kilo-console .model-option {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.kilo-console .model-option.selected,
.kilo-console .tool-option.selected {
  border-color: var(--border-focus);
  background: color-mix(in srgb, var(--surface-brand-base) 16%, var(--surface-base));
}

.kilo-console .model-option .model-star {
  pointer-events: none;
}

.kilo-console .tool-option {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.kilo-console .tool-option .tool-capabilities {
  text-align: left;
}

.kilo-console .model-controls {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(3, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kilo-console .model-controls label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-weak);
  font-size: var(--font-size-small);
}

.kilo-console .model-description {
  margin: 0;
  color: var(--text-weak);
  font-size: 0.75rem;
  line-height: 1.45;
}

.kilo-console .explore-model-card {
  gap: 0.625rem;
  border-color: var(--border);
  background: var(--card);
  padding: 0.875rem;
}

.kilo-console .explore-model-card .model-main {
  align-items: flex-start;
  flex-wrap: nowrap;
}

.kilo-console .explore-model-card .model-title {
  flex: 1 1 auto;
}

.kilo-console .explore-model-card .model-title strong {
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
}

.kilo-console .explore-model-card .model-title span {
  margin-top: 0.125rem;
  font-family: var(--font-family-mono);
  font-size: 0.6875rem;
  line-height: 1.45;
}

.kilo-console .explore-model-card .model-tags {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.kilo-console .model-capabilities {
  justify-content: flex-start;
  gap: 0.25rem;
}

.kilo-console .model-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--border);
}

.kilo-console .model-stat {
  border: 0;
  border-radius: 0;
  background: var(--card);
  padding: 0.625rem;
}

.kilo-console .model-stat span,
.kilo-console .model-stat strong {
  display: block;
}

.kilo-console .model-stat span {
  color: var(--text-weaker);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kilo-console .model-stat strong {
  display: flex;
  gap: 0.25rem;
  align-items: baseline;
  margin-top: 0.25rem;
  color: var(--text-strong);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.2;
}

.kilo-console .model-stat small {
  color: var(--muted-foreground);
  font-size: 0.625rem;
  font-weight: 400;
}
