@import "@opencode-ai/ui/v2/text-input-v2.css";
@import "@opencode-ai/ui/v2/button-v2.css";

[data-component="tabs-v2"][data-variant="settings"] {
  height: 100%;
}

[data-component="dialog-v2"][data-variant="settings"] [data-slot="dialog-container"] {
  background: var(--v2-background-bg-base);
}

[data-component="dialog-v2"][data-variant="settings"] [data-slot="dialog-body"] {
  padding: 0;
  overflow: hidden;
}

.settings-v2-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}

.settings-v2-panel::-webkit-scrollbar {
  display: none;
}

.settings-v2-tab-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 40px 40px 32px;
  background: linear-gradient(to bottom, var(--v2-background-bg-base) calc(100% - 24px), transparent);
}

.settings-v2-tab-title {
  font-size: 15px;
  font-weight: 640;
  line-height: 1;
  color: var(--v2-text-text-base);
}

.settings-v2-tab-body {
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
  padding: 0 40px 40px;
}

[data-slot="settings-v2-row-description"] a.settings-v2-link {
  color: var(--v2-text-text-accent);
  cursor: pointer;
  text-decoration: none;
}

[data-slot="settings-v2-row-description"] a.settings-v2-link:hover {
  color: var(--v2-text-text-accent-hover);
}

.settings-v2-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-v2-section-title {
  padding-bottom: 8px;
  font-size: 15px;
  font-weight: 640;
  line-height: 1;
  color: var(--v2-text-text-base);
}

.settings-v2-section-title + [data-component="settings-v2-list"] {
  margin-top: -4px;
  margin-bottom: 0;
}

[data-component="settings-v2-list"] {
  border-radius: 8px;
  background-color: var(--v2-background-bg-layer-01);
  padding-inline: 20px;
  box-shadow: inset 0 0 0 0.5px var(--v2-border-border-muted);
}

[data-component="settings-v2-row"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-block: 20px;
  border-bottom: 0.5px solid var(--v2-border-border-base);
}

[data-component="settings-v2-row"]:last-child {
  border-bottom: none;
}

@media (min-width: 640px) {
  [data-component="settings-v2-row"] {
    flex-wrap: nowrap;
  }
}

[data-slot="settings-v2-row-copy"] {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

[data-slot="settings-v2-row-title"] {
  font-style: normal;
  font-size: 13px;
  font-weight: 530;
  line-height: 1;
  letter-spacing: -0.04px;
  color: var(--v2-text-text-base);
  font-variation-settings: "slnt" 0;
}

[data-slot="settings-v2-row-description"] {
  font-size: 11px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
}

[data-slot="settings-v2-row-control"] {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

[data-slot="settings-v2-row-control"] > div:has([data-component="switch"]),
[data-slot="settings-v2-row-control"] > [data-component="switch"] {
  display: inline-flex;
  align-items: center;
  padding: 4px;
}

@media (min-width: 640px) {
  [data-slot="settings-v2-row-control"] {
    width: auto;
    flex-shrink: 0;
  }
}

[data-slot="settings-v2-row-control"] [data-component="text-input-v2"] {
  width: 100%;
}

[data-component="dialog-v2"][data-variant="settings"] [data-component="select-v2-root"] {
  width: fit-content;
  max-width: 100%;
}

[data-component="dialog-v2"][data-variant="settings"] [data-component="button-v2"] {
  width: fit-content;
  max-width: 100%;
}

[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"] [data-slot="tabs-v2-list"] {
  background-color: var(--v2-background-bg-layer-01);
}

@media (max-width: 639px) {
  .settings-v2[data-component="tabs-v2"][data-variant="settings"][data-orientation="vertical"]
    [data-slot="tabs-v2-list"] {
    width: 144px;
    min-width: 144px;
    padding-inline: 8px;
  }
}

.settings-v2-nav-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 4px 4px;
}

.settings-v2-nav-footer > span {
  font-size: 11px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-faint);
}

.settings-v2-legacy-panel {
  height: 100%;
  overflow: hidden;
}

.settings-v2-legacy-panel [data-component="dialog"] {
  display: contents;
}

.settings-v2-provider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  border-bottom: 0.5px solid var(--v2-border-border-base);
}

.settings-v2-provider-row:last-child {
  border-bottom: none;
}

@media (min-width: 640px) {
  .settings-v2-provider-row {
    flex-wrap: nowrap;
  }
}

.settings-v2-providers [data-component="provider-icon"] {
  color: var(--v2-icon-icon-base);
}

.settings-v2-provider-lead {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  gap: 10px;
}

.settings-v2-provider-lead:not(:has(.settings-v2-provider-copy)) {
  align-items: center;
}

.settings-v2-provider-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.settings-v2-provider-main {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.settings-v2-provider-name {
  font-size: 13px;
  font-weight: 530;
  line-height: 16px;
  color: var(--v2-text-text-base);
}

.settings-v2-provider-description {
  margin: 0;
  font-size: 13px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
}

.settings-v2-provider-empty {
  padding-block: 20px;
  font-size: 13px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
}

.settings-v2-provider-env-hint {
  padding-right: 12px;
  font-size: 13px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
  opacity: 0;
  transition: opacity 200ms ease;
  cursor: default;
}

.group:hover .settings-v2-provider-env-hint {
  opacity: 1;
}

.settings-v2-providers-view-all {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 530;
  line-height: 1;
  color: var(--v2-text-text-accent);
  cursor: pointer;
  text-align: left;
}

.settings-v2-providers-view-all:hover {
  color: var(--v2-text-text-accent-hover);
}

.settings-v2-tab-body.settings-v2-providers {
  gap: 32px;
}

.settings-v2-tab-header:has(+ .settings-v2-tab-body.settings-v2-providers) {
  padding-bottom: 32px;
}

.settings-v2-providers .settings-v2-section-title {
  padding-bottom: 0;
  font-size: 13px;
  font-weight: 530;
  line-height: 1;
}

.settings-v2-providers .settings-v2-section-title + [data-component="settings-v2-list"] {
  margin-top: 16px;
}

.settings-v2-tab-header.settings-v2-tab-header--stacked {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 32px;
}

.settings-v2-tab-header--stacked > .settings-v2-tab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-v2-tab-search {
  position: relative;
  width: 100%;
}

.settings-v2-tab-search [data-component="text-input-v2"] {
  width: 100%;
}

.settings-v2-tab-search [data-slot="text-input-v2-input"] {
  padding-right: 28px;
}

.settings-v2-tab-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 1;
  transform: translateY(-50%);
}

.settings-v2-tab-body.settings-v2-models {
  gap: 24px;
}

.settings-v2-models-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
}

.settings-v2-models .settings-v2-section-title {
  padding-bottom: 0;
  font-size: 13px;
  font-weight: 530;
  line-height: 16px;
}

.settings-v2-models [data-component="provider-icon"] {
  color: var(--v2-icon-icon-base);
}

.settings-v2-models .settings-v2-section-title + [data-component="settings-v2-list"] {
  margin-top: 0;
}

.settings-v2-models [data-slot="settings-v2-row-description"]:empty {
  display: none;
}

.settings-v2-models [data-slot="settings-v2-row-copy"] {
  gap: 0;
}

.settings-v2-models [data-slot="settings-v2-row-title"] {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 440;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-v2-models-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-block: 48px;
  font-size: 13px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
  text-align: center;
}

.settings-v2-models-status-filter {
  color: var(--v2-text-text-base);
}

.settings-v2-shortcuts .settings-v2-section {
  gap: 16px;
}

.settings-v2-shortcuts .settings-v2-section-title {
  padding-bottom: 0;
  font-size: 13px;
  font-weight: 530;
  line-height: 1;
}

.settings-v2-shortcuts [data-component="settings-v2-list"] {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  border-radius: 6px;
}

.settings-v2-shortcuts [data-component="settings-v2-list"] > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-v2-shortcuts [data-component="settings-v2-list"] > div:not(:last-child) {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 0.5px solid var(--v2-border-border-base);
}

.settings-v2-shortcuts [data-component="settings-v2-list"] > div > span {
  font-weight: 440;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -0.04px;
  color: var(--v2-text-text-base);
  font-variation-settings: "slnt" 0;
}

.settings-v2-keybind-button {
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 6px 8px;
  margin: -6px -8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  font-style: normal;
  font-weight: 530;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.05px;
  font-variant-numeric: tabular-nums;
  font-feature-settings:
    "tnum" on,
    "lnum" on;
  font-variation-settings: "slnt" 0;
  color: var(--v2-text-text-faint);
}

.settings-v2-keybind-button:hover {
  background-color: var(--v2-background-bg-layer-02);
}

.settings-v2-keybind-button:focus-visible {
  outline: 2px solid var(--v2-border-border-focus);
  outline-offset: 2px;
}

.settings-v2-keybind-button--active {
  color: var(--v2-text-text-faint);
  border-radius: 2px;
  background-color: var(--v2-background-bg-layer-02);
}

.settings-v2-shortcuts-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-block: 48px;
  font-size: 13px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
  text-align: center;
}

.settings-v2-shortcuts-status-filter {
  color: var(--v2-text-text-base);
}

.settings-v2-tab-body.settings-v2-servers {
  gap: 0;
}

.settings-v2-tab-header.settings-v2-servers-header {
  padding-bottom: 24px;
}

.settings-v2-servers-header .settings-v2-tab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-v2-tab-header.settings-v2-servers-header.settings-v2-tab-header--stacked {
  gap: 24px;
  padding-bottom: 24px;
}

.settings-v2-servers [data-component="settings-v2-list"] {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  border-radius: 6px;
}

.settings-v2-servers-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-v2-servers-row:not(:last-child) {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 0.5px solid var(--v2-border-border-base);
}

.settings-v2-servers-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.settings-v2-servers-lead {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  gap: 10px;
}

.settings-v2-servers-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
}

.settings-v2-servers-name {
  font-size: 13px;
  font-weight: 530;
  line-height: 1;
  color: var(--v2-text-text-base);
}

.settings-v2-servers-meta {
  font-size: 11px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
}

.settings-v2-servers-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-block: 48px;
  font-size: 13px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-text-text-muted);
  text-align: center;
}

.settings-v2-servers-status-filter {
  color: var(--v2-text-text-base);
}

[data-component="dialog-v2"].settings-v2-server-dialog [data-slot="dialog-container"] {
  width: 480px;
  max-width: calc(100vw - 32px);
  height: auto;
  border-radius: 8px;
  align-items: stretch;
}

[data-component="dialog-v2"].settings-v2-server-dialog [data-slot="dialog-content"] {
  align-items: stretch;
  width: 100%;
}

[data-component="dialog-v2"].settings-v2-server-dialog [data-slot="dialog-header"] {
  align-items: center;
  padding: 24px 24px 16px;
}

[data-component="dialog-v2"].settings-v2-server-dialog [data-slot="dialog-body"] {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
}

[data-component="dialog-v2"].settings-v2-server-dialog [data-slot="dialog-footer"] {
  padding: 24px;
}

.settings-v2-server-dialog-label {
  font-size: 13px;
  font-weight: 530;
  line-height: 1;
  color: var(--v2-text-text-base);
}

.settings-v2-server-dialog-error {
  font-size: 11px;
  font-weight: 440;
  line-height: 1;
  color: var(--v2-state-fg-danger);
}
