:root {
  /* re-use layout tokens from theme */
  --content-max-settings: var(--content-max);
  --settings-gap: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body.settings-body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

/* Center content under sticky header */
.settings-main {
  max-width: var(--content-max-settings);
  margin: 0 auto;
  padding: 20px var(--settings-gap) 40px;
  display: grid;
  grid-template-columns: 1fr;
}

/* Card panel */
.settings-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px 18px 22px;
  box-shadow: var(--shadow-1);
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 14px;
}

.settings-title {
  margin: 0 0 4px 0;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-text);
}

.settings-intro {
  margin: 0 0 4px 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Form layout */
.settings-form {
  margin: 6px 0 0 0;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 12px;
}

.settings-fieldset {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 10px 8px;
  margin: 0;
}

.settings-legend {
  padding: 0 4px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* Options list (grid instead of flex) */
.settings-options {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 8px;
}

/* Individual option */
.settings-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 2px;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.settings-option:hover {
  background: var(--header-hover-bg);
}

.settings-option input[type="radio"] {
  margin-top: 3px;
}

.option-label-main {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--color-text);
}

.option-label-sub {
  grid-column: 2 / 3;
  font-size: 0.86rem;
  color: var(--color-muted);
}

/* Status message */
.settings-status {
  margin: 4px 2px 0 2px;
  font-size: 0.85rem;
  color: var(--color-muted);
  min-height: 1.2em;
}

/* Small note at bottom */
.settings-note {
  margin: 4px 2px 0 2px;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.settings-note code {
  font-size: 0.85em;
  background: rgba(0,0,0,0.08);
  padding: 1px 4px;
  border-radius: 4px;
}

/* --------- Responsive tweaks --------- */

@media (max-width: 600px) {
  .settings-main {
    padding: 14px 10px 30px;
  }
  .settings-panel {
    padding: 16px 12px 18px;
  }
}

@media (min-width: 900px) {
  .settings-panel {
    padding: 22px 22px 24px;
  }
  .settings-title {
    font-size: 1.5rem;
  }
}
