.grid-settings-panel {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-block: 0.5rem;
}

.grid-settings-panel__section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.grid-settings-panel__section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.grid-settings-panel__section-header p {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.grid-settings-panel__options {
  display: grid;
  gap: 0.75rem;
}

.grid-settings-panel__column-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid-settings-panel__column-group {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface-1);
  min-inline-size: 0;
}

.grid-settings-panel__column-group legend {
  display: none;
}

.grid-settings-panel__column-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid-settings-panel__column-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  cursor: grab;
  color: var(--text-1);
  transition: opacity 160ms ease;
}

.grid-settings-panel__column-item:active {
  cursor: grabbing;
}

.grid-settings-panel__column-item--dragging {
  opacity: 0.65;
}

.grid-settings-panel__column-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0.72;
}

.grid-settings-panel__column-item-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-1);
}

.grid-settings-panel__column-item-label input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent-color);
}

.grid-settings-panel__option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-2);
  color: var(--text-1);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease,
    background-color 160ms ease;
}

.grid-settings-panel__option:hover,
.grid-settings-panel__option:focus-within {
  border-color: color-mix(in srgb, var(--accent-color) 55%, transparent 45%);
  box-shadow: 0 0 0 1px
    color-mix(in srgb, var(--accent-color) 35%, transparent 65%);
}

.grid-settings-panel__option input[type='radio'] {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin: 0.125rem 0 0;
  display: grid;
  place-items: center;
  background-color: var(--surface-1);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.grid-settings-panel__option input[type='radio']::before {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  transform: scale(0);
  transition: transform 160ms ease;
  background-color: var(--accent-color);
}

.grid-settings-panel__option input[type='radio']:checked {
  border-color: var(--accent-color);
  background-color: color-mix(in srgb, var(--accent-color) 12%, var(--surface-1) 88%);
}

.grid-settings-panel__option input[type='radio']:checked::before {
  transform: scale(1);
}

.grid-settings-panel__option-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.grid-settings-panel__drop-zone {
  height: 0;
  border-radius: 999px;
  background: transparent;
  margin: 0.15rem 0;
  transition: background-color 160ms ease, height 160ms ease;
}

.grid-settings-panel__column-list--dragging .grid-settings-panel__drop-zone {
  height: 0.25rem;
}

.grid-settings-panel__drop-zone--active {
  height: 0.65rem;
  background: color-mix(in srgb, var(--accent-color) 30%, transparent 70%);
}

.grid-settings-panel__option-label {
  font-weight: 600;
  color: var(--text-1);
}

.grid-settings-panel__option-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.grid-settings-panel__option--selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 50%, transparent 50%);
  background-color: color-mix(in srgb, var(--accent-color) 10%, var(--surface-2) 90%);
}

[data-theme='dark'] .grid-settings-panel__section-header p,
[data-theme='dark'] .grid-settings-panel__option-description,
[data-theme='dark'] .grid-settings-panel__column-handle {
  color: rgba(203, 213, 225, 0.72);
}

[data-theme='dark'] .grid-settings-panel__column-group {
  border-color: rgba(148, 163, 184, 0.18);
  background: color-mix(in srgb, var(--panel-bg) 90%, var(--color-neutral-900) 10%);
}

[data-theme='dark'] .grid-settings-panel__option {
  border-color: rgba(148, 163, 184, 0.18);
  background: color-mix(in srgb, var(--panel-bg) 86%, var(--color-neutral-900) 14%);
  color: var(--color-neutral-50);
}

[data-theme='dark'] .grid-settings-panel__option:hover,
[data-theme='dark'] .grid-settings-panel__option:focus-within {
  border-color: color-mix(in srgb, var(--accent-color) 55%, transparent 45%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 35%, transparent 65%);
  background: color-mix(in srgb, var(--accent-color) 8%, var(--panel-bg) 92%);
}

[data-theme='dark'] .grid-settings-panel__option input[type='radio'] {
  border-color: rgba(148, 163, 184, 0.35);
  background-color: color-mix(in srgb, var(--panel-bg) 78%, rgba(30, 41, 59, 0.65) 22%);
}

[data-theme='dark'] .grid-settings-panel__option input[type='radio']:checked {
  border-color: color-mix(in srgb, var(--accent-color) 65%, rgba(148, 163, 184, 0.35) 35%);
  background-color: color-mix(in srgb, var(--accent-color) 22%, rgba(15, 23, 42, 0.65) 78%);
}

[data-theme='dark'] .grid-settings-panel__option--selected {
  border-color: color-mix(in srgb, var(--accent-color) 75%, transparent 25%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 45%, transparent 55%);
  background-color: color-mix(in srgb, var(--accent-color) 16%, rgba(15, 23, 42, 0.78) 84%);
}

