/* =========================================================
   Life OS — settings.css
   The Settings menu that slides in from the right.
   ========================================================= */
.settings-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: var(--backdrop); opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51;
  width: min(430px, 100vw);
  background: var(--panel); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateX(24px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), background-color 0.4s var(--ease);
}
#settings-root.open .settings-backdrop { opacity: 1; }
#settings-root.open .settings-panel { opacity: 1; transform: none; }

.set-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 10px 20px; border-bottom: 1px solid var(--border);
}
.set-header h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }

.set-body { flex: 1; overflow-y: auto; padding: 4px 20px 40px; }

.set-section { padding: 14px 0 10px; border-bottom: 1px solid var(--border); }
.set-section:last-child { border-bottom: 0; }
.set-section h3 {
  margin: 0 0 4px; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint);
}

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.set-text { min-width: 0; }
.set-label { font-size: 0.92rem; }
.set-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.set-info {
  font-size: 0.8rem; color: var(--text-muted); line-height: 1.45;
  background: var(--hover); border-radius: var(--radius);
  padding: 8px 10px; margin: 0 0 6px;
}
.set-info .set-hint { margin-top: 6px; }

.set-select {
  font-size: 0.86rem; padding: 5px 8px; max-width: 200px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--text); cursor: pointer;
}

.set-range { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.set-range input[type="range"] { width: 130px; accent-color: var(--accent); cursor: pointer; }
.set-range input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }
.set-range output { font-size: 0.8rem; color: var(--text-muted); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* On/off switch */
.switch { position: relative; display: inline-block; width: 34px; height: 20px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--switch-off); transition: background-color var(--dur); }
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Accent color swatches */
.swatches { display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: 7px; align-items: center; justify-content: flex-end; }
@media (max-width: 420px) { .swatches { flex-wrap: wrap; flex-shrink: 1; max-width: 140px; } }
.swatch {
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px currentColor; }
/* "Any color" button: a rainbow circle with the real color picker hidden on top */
.swatch-custom {
  position: relative; display: inline-block; width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  background: conic-gradient(#e5484d, #e8833a, #f5d90a, #22a06b, #2f80ed, #8b5cf6, #e0569b, #e5484d);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.swatch-custom:hover { transform: scale(1.12); }
.swatch-custom.active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px currentColor; }
.swatch-custom input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.swatch-custom:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Reset area */
.set-confirm {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; margin: 6px 0;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 8px;
}
.set-confirm-actions { display: flex; gap: 8px; margin-top: 6px; }
.set-done { font-size: 0.8rem; color: var(--text-muted); padding: 2px 0 6px; animation: pageIn 0.3s var(--ease) both; }
