:root {
  --default-font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
  --cflt-input-height: 24px;
  --cflt-input-min-width: 100px;
  --cflt-base-font-size: 13px;
}
.content-wrapper {
  display: contents;
}
.grid {
  display: grid;
  grid-template-columns: var(--grid-template-columns, auto);
  width: 100%;
}
.grid .grid-row {
  background: transparent;
}
.grid .grid-row:hover {
  background: var(--vscode-list-hoverBackground, #2a2d2e);
}
.grid .grid-row,
.grid > * {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}
.grid .grid-cell {
  padding: 4px 12px;
  color: var(--vscode-editor-foreground, #cccccc);
  font-family: var(--vscode-font-family, var(--default-font-family));
  font-size: var(--vscode-font-size, 13px);
  line-height: normal;
  font-weight: 400;
  border: 1px solid transparent;
}
.grid .grid-column-header {
  position: relative;
  font-weight: 600;
  text-align: left;
}
.grid .grid-cell:focus,
.grid .grid-cell:active {
  background: var(--vscode-list-activeSelectionBackground, #094771);
  border-color: var(--vscode-focusBorder, #007fd4);
  color: var(--vscode-list-activeSelectionForeground, #ffffff);
  outline: none;
}
.grid .grid-cell:focus *,
.grid .grid-cell:active * {
  color: var(--vscode-list-activeSelectionForeground, #ffffff);
}

/**
 * <label class="checkbox">
 *   <input type="checkbox" />
 *   <span>The Checkbox</span>
 * </label>
 */
.checkbox {
  display: inline-flex;
  align-items: center;
  outline: none;
  margin: 4px 0;
  user-select: none;
  font-size: var(--vscode-font-size, 13px);
  line-height: normal;
  cursor: pointer;
}
.checkbox::before {
  content: "";
  display: block;
  position: relative;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 3px;
  border: 1px solid var(--vscode-checkbox-border, #3c3c3c);
  background: var(--vscode-checkbox-background, #3c3c3c);
  font: 16px / 1 codicon;
  color: var(--vscode-editor-foreground, #cccccc);
  text-rendering: auto;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  pointer-events: none;
}
.checkbox:has([type="checkbox"]:focus)::before {
  border: 1px solid var(--vscode-focusBorder, #007fd4);
}
.checkbox:has([type="checkbox"]:disabled) {
  cursor: not-allowed;
  opacity: 0.4;
}
.checkbox:has([type="checkbox"]:checked)::before {
  content: "\eab2";
}
.checkbox:has([type="checkbox"]:indeterminate)::before {
  content: "\ea71";
}
.checkbox [type="checkbox"] {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.checkbox [type="checkbox"] + span {
  font-family: var(--vscode-font-family, var(--default-font-family));
  color: var(--vscode-foreground, #cccccc);
  padding-inline-start: 10px;
  margin-inline-end: 10px;
}

/** Shared styles for webview forms
* for layout, incl. children:
* div.webview-form
*   div.form-header
*   form.form-container (or <div>?)
*     fieldset|div.form-section (*n)
*       h2.form-section-heading
*       inputs(*n), e.g. div.input-container|div.input-row
*     div.form-section.button-group (incl. input[type="submit"] or .button[type="submit"])
*/
.webview-form {
  margin: 0 auto;
  max-width: 900px;
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media screen and (max-width: 800px) {
  .webview-form {
    padding: 24px;
    gap: 12px;
  }
}
.form-header {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 8px;
}
.form-header > * {
  margin: unset;
}
.heading {
  font-size: 26px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.2;
}
.form-description {
  color: var(--vscode-sideBarSectionHeader-foreground);
  font-size: 13px;
  font-style: normal;
  line-height: normal;
}

.form-container {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0;
  padding: 24px 0;
}
.form-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 32px 0px;
  align-self: stretch;
  border-bottom: 1px solid #d4d4d4;
}

.form-section:first-of-type {
  padding-top: 0;
}
.form-section:last-of-type {
  padding-bottom: 0;
  border-bottom: none;
}
.form-section > * {
  margin: unset;
}
.form-section-heading {
  color: var(--vscode-editor-foreground);
  font-size: 20px;
  font-weight: 500;
  white-space: nowrap;
}
/** Button group expects 2 buttons w/possible info
* e.g. div.button-group
*       .button.secondary
*       .info
*       .button[type="submit"]
*/
.button-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: none;
}
.button-group > .button:last-child {
  margin-left: auto;
}

.field-description {
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
}
.fieldset {
  padding: 0;
  border: 0;
  width: 100%;
  border-width: 0;
}

/** shorter inputs and dropdowns can be side-by-side */
.input-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: 100%;
}
/** Input Layout
* div.input-container
*   .label
*   .input
*   .info(.error) // description|message|help text
*/
.input-container {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 2px;
  width: 100%;
}
.input-container > .input {
  width: 100%;
  min-width: 8rem;
}
.input-container > select.input,
.input-container > .input[type="number"] {
  width: fit-content;
}
.input-container > .label,
.label-wrapper > .label {
  margin-bottom: 0;
  display: block;
  cursor: pointer;
  font-size: var(--cflt-base-font-size);
  font-style: normal;
  font-weight: 500;
  color: var(--vscode-editor-foreground);
}
.info {
  color: var(--vscode-descriptionForeground);
  font-weight: 450;
  font-size: 12px;
  position: relative;
}

/** Generic input styles using theme custom properties whenever possible */
.input {
  box-sizing: border-box;
  color: var(--vscode-input-foreground);
  background: var(--vscode-input-background);
  border-radius: 3px;
  border: 1px solid var(--vscode-dropdown-border);
  height: var(--cflt-input-height);
  min-width: var(--cflt-input-min-width);
  padding: 2px 5px;
  font-size: var(--cflt-base-font-size);
}
.input:focus {
  outline: 1px solid var(--vscode-inputOption-activeBorder);
  outline-offset: -1px;
}
.input.invalid {
  border: 1px solid var(--vscode-inputValidation-errorBorder);
}
.input::placeholder {
  color: var(--vscode-input-placeholderForeground);
}
.input:disabled {
  background-color: var(--vscode-disabledForeground);
  cursor: not-allowed;
}
.input + .hint {
  color: var(--vscode-descriptionForeground);
  font-size: 0.8em;
}
/** Button styles
* .input[type="submit"] or .button
*/
.input[type="submit"],
.button {
  display: inline-flex;
  outline: none;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  padding: 6px 11px;
  font-size: var(--cflt-base-font-size);
  color: var(--vscode-button-foreground);
  background: var(--vscode-button-background);
  border-radius: 3px;
  fill: currentColor;
  cursor: pointer;
  white-space: wrap;
  text-decoration: none;
  border: 1px solid var(--vscode-input-border);
}
.input[type="submit"]:hover:not(:disabled),
.button:hover:not(:disabled),
.button.secondary:hover:not(:disabled) {
  background-color: var(--vscode-button-hoverBackground);
  color: var(--vscode-button-foreground);
}
.input[type="submit"]:disabled,
.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.button.secondary {
  color: var(--vscode-button-background);
  background: var(--vscode-button-foreground);
  border: 1px solid var(--vscode-button-background);
}

/** Error states */
.input-container.error .pattern {
  color: var(--vscode-errorForeground);
}

.input-container > .info.error {
  min-width: 100%;
}

.input-container.error .input,
.input.error,
input:user-invalid {
  border: 1px solid var(--vscode-errorForeground);
}
.status-icon {
  font-size: 18px;
  line-height: 0;
  font-weight: 200;
}
.success .status-icon {
  color: var(--vscode-testing-iconPassed);
}
.error .status-icon {
  color: var(--vscode-testing-iconFailed);
}
