/* Settings page.
   The boxes, rows, switches and selects all come from css/ui.css — this file
   only owns what is specific to this page: the section rhythm, the jump nav,
   the colour swatches, the panic-key display and the plan pill. */

.settings-page {
  max-width: 860px;
  margin-inline: auto;
}

/* Jump list. Sticky so it stays reachable while scrolling a long page, and it
   sits above the boxes rather than beside them so the content column keeps its
   full width on narrow screens. */
.settings-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 26px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.settings-nav a {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.settings-nav a:hover { background: var(--surface-hover); color: var(--text); }

.settings-sections {
  display: grid;
  gap: 38px;
}

.settings-section {
  display: grid;
  gap: 14px;
  /* Anchored sections must clear the sticky nav when jumped to. */
  scroll-margin-top: 74px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-color);
}

/* ── Accent swatches ──────────────────────────────────────── */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.swatch {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  /* --sw is set per button by page-settings.js from the preset list. */
  background: var(--sw);
  cursor: pointer;
  /* The ring is drawn with a shadow rather than an outline so it sits outside
     the circle without changing its size when selected. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--sw);
}

/* Native colour well, sized to sit next to the hex field. */
.color-well {
  width: 44px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
}
.color-well::-webkit-color-swatch-wrapper { padding: 0; }
.color-well::-webkit-color-swatch { border: 0; border-radius: 0; }
.color-well::-moz-color-swatch { border: 0; border-radius: 0; }

.hex-input {
  width: 128px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: lowercase;
}

/* ── Panic key ────────────────────────────────────────────── */

.key-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  white-space: nowrap;
}
.key-display.empty { color: var(--text-faint); font-style: italic; }
.key-display.listening {
  border-color: var(--accent-color);
  color: var(--accent-color);
  font-style: normal;
  animation: key-pulse 1.1s ease-in-out infinite;
}

@keyframes key-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

/* ── Plan pill ────────────────────────────────────────────── */

.plan-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.plan-pill.paid {
  border-color: transparent;
  background: var(--accent);
  color: var(--acc-ink);
}
